summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Gevaerts <frank@gevaerts.be>2008-11-02 02:01:57 +0000
committerFrank Gevaerts <frank@gevaerts.be>2008-11-02 02:01:57 +0000
commit8d68a567e448975f56a24dad60191d2e3788cb1a (patch)
treed608f87687000b04fe7b6d18b326824b5a370211
parent86f0c75cde212262abd49c5211ce9c15babefa78 (diff)
downloadrockbox-8d68a567e448975f56a24dad60191d2e3788cb1a.tar.gz
rockbox-8d68a567e448975f56a24dad60191d2e3788cb1a.zip
add proper dummy storage implementation for sims
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18977 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/SOURCES2
-rw-r--r--firmware/export/storage.h111
-rw-r--r--firmware/storage-sim.c118
3 files changed, 141 insertions, 90 deletions
diff --git a/firmware/SOURCES b/firmware/SOURCES
index 567fa1c579..7bd809ca60 100644
--- a/firmware/SOURCES
+++ b/firmware/SOURCES
@@ -122,6 +122,8 @@ drivers/fat.c
122#if (CONFIG_STORAGE & STORAGE_MMC) || (CONFIG_STORAGE & STORAGE_SD) 122#if (CONFIG_STORAGE & STORAGE_MMC) || (CONFIG_STORAGE & STORAGE_SD)
123hotswap.c 123hotswap.c
124#endif 124#endif
125#else /* SIMULATOR */
126storage-sim.c
125#endif /* SIMULATOR */ 127#endif /* SIMULATOR */
126 128
127/* EEPROM */ 129/* EEPROM */
diff --git a/firmware/export/storage.h b/firmware/export/storage.h
index 68867a98b1..d4e69163b7 100644
--- a/firmware/export/storage.h
+++ b/firmware/export/storage.h
@@ -175,98 +175,29 @@ struct storage_info
175 175
176 #endif /* NOT CONFIG_STORAGE_MULTI */ 176 #endif /* NOT CONFIG_STORAGE_MULTI */
177#else /*NOT SIMULATOR */ 177#else /*NOT SIMULATOR */
178static inline void storage_enable(bool on) 178void storage_enable(bool on);
179{ 179void storage_sleep(void);
180 (void)on; 180void storage_sleepnow(void);
181} 181bool storage_disk_is_active(void);
182static inline void storage_sleep(void) 182int storage_hard_reset(void);
183{ 183int storage_soft_reset(void);
184} 184int storage_init(void);
185static inline void storage_sleepnow(void) 185void storage_close(void);
186{ 186int storage_read_sectors(int drive, unsigned long start, int count, void* buf);
187} 187int storage_write_sectors(int drive, unsigned long start, int count, const void* buf);
188static inline bool storage_disk_is_active(void) 188void storage_spin(void);
189{ 189void storage_spindown(int seconds);
190 return 0;
191}
192static inline int storage_hard_reset(void)
193{
194 return 0;
195}
196static inline int storage_soft_reset(void)
197{
198 return 0;
199}
200static inline int storage_init(void)
201{
202 return 0;
203}
204static inline void storage_close(void)
205{
206}
207static inline int storage_read_sectors(int drive, unsigned long start, int count, void* buf)
208{
209 (void)drive;
210 (void)start;
211 (void)count;
212 (void)buf;
213 return 0;
214}
215static inline int storage_write_sectors(int drive, unsigned long start, int count, const void* buf)
216{
217 (void)drive;
218 (void)start;
219 (void)count;
220 (void)buf;
221 return 0;
222}
223
224static inline void storage_spin(void)
225{
226}
227static inline void storage_spindown(int seconds)
228{
229 (void)seconds;
230}
231
232#if (CONFIG_LED == LED_REAL) 190#if (CONFIG_LED == LED_REAL)
233static inline void storage_set_led_enabled(bool enabled) 191void storage_set_led_enabled(bool enabled);
234{ 192#endif
235 (void)enabled; 193long storage_last_disk_activity(void);
236} 194int storage_spinup_time(void);
237#endif /*LED*/
238
239static inline long storage_last_disk_activity(void)
240{
241 return 0;
242}
243
244static inline int storage_spinup_time(void)
245{
246 return 0;
247}
248
249#ifdef STORAGE_GET_INFO 195#ifdef STORAGE_GET_INFO
250static inline void storage_get_info(int drive, struct storage_info *info) 196void storage_get_info(int drive, struct storage_info *info);
251{ 197#endif
252 (void)drive; 198#ifdef HOTSWAP
253 (void)info; 199bool storage_removable(int drive);
254} 200bool storage_present(int drive);
255#endif 201#endif
256
257#ifdef HAVE_HOTSWAP
258static inline bool storage_removable(int drive)
259{
260 (void)drive;
261 return 0;
262}
263
264static inline bool storage_present(int drive)
265{
266 (void)drive;
267 return 0;
268}
269#endif /* HOTSWAP */
270
271#endif/*NOT SIMULATOR */ 202#endif/*NOT SIMULATOR */
272#endif 203#endif
diff --git a/firmware/storage-sim.c b/firmware/storage-sim.c
new file mode 100644
index 0000000000..24b3f18b4e
--- /dev/null
+++ b/firmware/storage-sim.c
@@ -0,0 +1,118 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id: $
9 *
10 * Copyright (C) 2008 by Frank Gevaerts
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#include "config.h" /* for HAVE_MULTIVOLUME or not */
22#include "storage.h"
23
24#ifdef SIMULATOR
25void storage_enable(bool on)
26{
27 (void)on;
28}
29void storage_sleep(void)
30{
31}
32void storage_sleepnow(void)
33{
34}
35bool storage_disk_is_active(void)
36{
37 return 0;
38}
39int storage_hard_reset(void)
40{
41 return 0;
42}
43int storage_soft_reset(void)
44{
45 return 0;
46}
47int storage_init(void)
48{
49 return 0;
50}
51void storage_close(void)
52{
53}
54int storage_read_sectors(int drive, unsigned long start, int count, void* buf)
55{
56 (void)drive;
57 (void)start;
58 (void)count;
59 (void)buf;
60 return 0;
61}
62int storage_write_sectors(int drive, unsigned long start, int count, const void* buf)
63{
64 (void)drive;
65 (void)start;
66 (void)count;
67 (void)buf;
68 return 0;
69}
70
71void storage_spin(void)
72{
73}
74void storage_spindown(int seconds)
75{
76 (void)seconds;
77}
78
79#if (CONFIG_LED == LED_REAL)
80void storage_set_led_enabled(bool enabled)
81{
82 (void)enabled;
83}
84#endif /*LED*/
85
86long storage_last_disk_activity(void)
87{
88 return 0;
89}
90
91int storage_spinup_time(void)
92{
93 return 0;
94}
95
96#ifdef STORAGE_GET_INFO
97void storage_get_info(int drive, struct storage_info *info)
98{
99 (void)drive;
100 (void)info;
101}
102#endif
103
104#ifdef HAVE_HOTSWAP
105bool storage_removable(int drive)
106{
107 (void)drive;
108 return 0;
109}
110
111bool storage_present(int drive)
112{
113 (void)drive;
114 return 0;
115}
116#endif /* HOTSWAP */
117
118#endif