diff options
-rw-r--r-- | firmware/target/hosted/samsungypr/ypr0/system-ypr0.c | 14 | ||||
-rw-r--r-- | lib/rbcodec/rbcodecplatform-unix.h | 8 | ||||
-rw-r--r-- | lib/rbcodec/test/SOURCES | 2 | ||||
-rw-r--r-- | lib/rbcodec/test/file.h | 4 | ||||
-rw-r--r-- | lib/rbcodec/test/warble.c | 7 | ||||
-rw-r--r-- | uisimulator/common/sim_tasks.c | 22 |
6 files changed, 48 insertions, 9 deletions
diff --git a/firmware/target/hosted/samsungypr/ypr0/system-ypr0.c b/firmware/target/hosted/samsungypr/ypr0/system-ypr0.c index a21c82b1f2..9cc307073b 100644 --- a/firmware/target/hosted/samsungypr/ypr0/system-ypr0.c +++ b/firmware/target/hosted/samsungypr/ypr0/system-ypr0.c | |||
@@ -94,6 +94,20 @@ bool hostfs_present(IF_MD_NONVOID(int drive)) | |||
94 | return true; /* internal: always present */ | 94 | return true; /* internal: always present */ |
95 | } | 95 | } |
96 | 96 | ||
97 | #ifdef HAVE_MULTIDRIVE | ||
98 | int volume_drive(int drive) | ||
99 | { | ||
100 | return drive; | ||
101 | } | ||
102 | #endif /* HAVE_MULTIDRIVE */ | ||
103 | |||
104 | #ifdef CONFIG_STORAGE_MULTI | ||
105 | int hostfs_driver_type(int drive) | ||
106 | { | ||
107 | return drive > 0 ? STORAGE_SD_NUM : STORAGE_HOSTFS_NUM; | ||
108 | } | ||
109 | #endif /* CONFIG_STORAGE_MULTI */ | ||
110 | |||
97 | #ifdef HAVE_HOTSWAP | 111 | #ifdef HAVE_HOTSWAP |
98 | bool volume_removable(int volume) | 112 | bool volume_removable(int volume) |
99 | { | 113 | { |
diff --git a/lib/rbcodec/rbcodecplatform-unix.h b/lib/rbcodec/rbcodecplatform-unix.h index 5e65be3ae4..4ed25f44e8 100644 --- a/lib/rbcodec/rbcodecplatform-unix.h +++ b/lib/rbcodec/rbcodecplatform-unix.h | |||
@@ -50,15 +50,7 @@ | |||
50 | #endif | 50 | #endif |
51 | 51 | ||
52 | /* filesize */ | 52 | /* filesize */ |
53 | #include <sys/stat.h> | ||
54 | off_t filesize(int fd); | 53 | off_t filesize(int fd); |
55 | /* | ||
56 | static inline off_t filesize(int fd) { | ||
57 | struct stat st; | ||
58 | fstat(fd, &st); | ||
59 | return st.st_size; | ||
60 | } | ||
61 | */ | ||
62 | 54 | ||
63 | /* snprintf */ | 55 | /* snprintf */ |
64 | #include <stdio.h> | 56 | #include <stdio.h> |
diff --git a/lib/rbcodec/test/SOURCES b/lib/rbcodec/test/SOURCES index d1413c758a..7afee84ae6 100644 --- a/lib/rbcodec/test/SOURCES +++ b/lib/rbcodec/test/SOURCES | |||
@@ -2,4 +2,4 @@ warble.c | |||
2 | ../../../firmware/common/strlcpy.c | 2 | ../../../firmware/common/strlcpy.c |
3 | ../../../firmware/common/unicode.c | 3 | ../../../firmware/common/unicode.c |
4 | ../../../firmware/common/structec.c | 4 | ../../../firmware/common/structec.c |
5 | ../../../uisimulator/common/io.c | 5 | ../../../firmware/common/pathfuncs.c |
diff --git a/lib/rbcodec/test/file.h b/lib/rbcodec/test/file.h new file mode 100644 index 0000000000..b673fa8f93 --- /dev/null +++ b/lib/rbcodec/test/file.h | |||
@@ -0,0 +1,4 @@ | |||
1 | #undef MAX_PATH | ||
2 | #define MAX_PATH 260 | ||
3 | #include <unistd.h> | ||
4 | #include <fcntl.h> | ||
diff --git a/lib/rbcodec/test/warble.c b/lib/rbcodec/test/warble.c index 6c8442ae26..8f11b9b56e 100644 --- a/lib/rbcodec/test/warble.c +++ b/lib/rbcodec/test/warble.c | |||
@@ -77,6 +77,13 @@ int find_first_set_bit(uint32_t value) | |||
77 | return __builtin_ctz(value); | 77 | return __builtin_ctz(value); |
78 | } | 78 | } |
79 | 79 | ||
80 | off_t filesize(int fd) | ||
81 | { | ||
82 | struct stat st; | ||
83 | fstat(fd, &st); | ||
84 | return st.st_size; | ||
85 | } | ||
86 | |||
80 | /***************** INTERNAL *****************/ | 87 | /***************** INTERNAL *****************/ |
81 | 88 | ||
82 | static enum { MODE_PLAY, MODE_WRITE } mode; | 89 | static enum { MODE_PLAY, MODE_WRITE } mode; |
diff --git a/uisimulator/common/sim_tasks.c b/uisimulator/common/sim_tasks.c index 003b993740..c2497d113b 100644 --- a/uisimulator/common/sim_tasks.c +++ b/uisimulator/common/sim_tasks.c | |||
@@ -234,4 +234,26 @@ bool mmc_touched(void) | |||
234 | } | 234 | } |
235 | #endif | 235 | #endif |
236 | 236 | ||
237 | #ifdef CONFIG_STORAGE_MULTI | ||
238 | int hostfs_driver_type(int drive) | ||
239 | { | ||
240 | /* Hack alert */ | ||
241 | #if (CONFIG_STORAGE & STORAGE_ATA) | ||
242 | #define SIMEXT1_TYPE_NUM STORAGE_ATA_NUM | ||
243 | #elif (CONFIG_STORAGE & STORAGE_SD) | ||
244 | #define SIMEXT1_TYPE_NUM STORAGE_SD_NUM | ||
245 | #elif (CONFIG_STORAGE & STORAGE_MMC) | ||
246 | #define SIMEXT1_TYPE_NUM STORAGE_MMC_NUM | ||
247 | #elif (CONFIG_STORAGE & STORAGE_NAND) | ||
248 | #define SIMEXT1_TYPE_NUM STORAGE_NAND_NUM | ||
249 | #elif (CONFIG_STORAGE & STORAGE_RAMDISK) | ||
250 | #define SIMEXT1_TYPE_NUM STORAGE_RAMDISK_NUM | ||
251 | #else | ||
252 | #error Unknown storage driver | ||
253 | #endif /* CONFIG_STORAGE */ | ||
254 | |||
255 | return drive > 0 ? SIMEXT1_TYPE_NUM : STORAGE_HOSTFS_NUM; | ||
256 | } | ||
257 | #endif /* CONFIG_STORAGE_MULTI */ | ||
258 | |||
237 | #endif /* CONFIG_STORAGE & STORAGE_MMC */ | 259 | #endif /* CONFIG_STORAGE & STORAGE_MMC */ |