summaryrefslogtreecommitdiff
path: root/firmware/drivers/ramdisk.c
diff options
context:
space:
mode:
authorFrank Gevaerts <frank@gevaerts.be>2009-07-17 22:28:49 +0000
committerFrank Gevaerts <frank@gevaerts.be>2009-07-17 22:28:49 +0000
commitc0a5a67387c4eec3db3bad4da77ba5126faf03c4 (patch)
treed7e61f6287c5fcdce903489b6b72d474225b98a7 /firmware/drivers/ramdisk.c
parentbb3b57f64594ba517e06add4cfeff72b2b06e65b (diff)
downloadrockbox-c0a5a67387c4eec3db3bad4da77ba5126faf03c4.tar.gz
rockbox-c0a5a67387c4eec3db3bad4da77ba5126faf03c4.zip
Commit FS#9545, storage cleanup and multi-driver support
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21933 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers/ramdisk.c')
-rw-r--r--firmware/drivers/ramdisk.c46
1 files changed, 43 insertions, 3 deletions
diff --git a/firmware/drivers/ramdisk.c b/firmware/drivers/ramdisk.c
index 0ea4012ef1..661aa39695 100644
--- a/firmware/drivers/ramdisk.c
+++ b/firmware/drivers/ramdisk.c
@@ -31,11 +31,14 @@ unsigned char ramdisk[SECTOR_SIZE * NUM_SECTORS];
31 31
32long last_disk_activity = -1; 32long last_disk_activity = -1;
33 33
34int ramdisk_read_sectors(IF_MV2(int drive,) 34int ramdisk_read_sectors(IF_MD2(int drive,)
35 unsigned long start, 35 unsigned long start,
36 int count, 36 int count,
37 void* buf) 37 void* buf)
38{ 38{
39#ifdef HAVE_MULTIDRIVE
40 (void)drive; /* unused for now */
41#endif
39 if(start+count>NUM_SECTORS) 42 if(start+count>NUM_SECTORS)
40 { 43 {
41 return -1; 44 return -1;
@@ -44,11 +47,14 @@ int ramdisk_read_sectors(IF_MV2(int drive,)
44 return 0; 47 return 0;
45} 48}
46 49
47int ramdisk_write_sectors(IF_MV2(int drive,) 50int ramdisk_write_sectors(IF_MD2(int drive,)
48 unsigned long start, 51 unsigned long start,
49 int count, 52 int count,
50 const void* buf) 53 const void* buf)
51{ 54{
55#ifdef HAVE_MULTIDRIVE
56 (void)drive; /* unused for now */
57#endif
52 if(start+count>NUM_SECTORS) 58 if(start+count>NUM_SECTORS)
53 { 59 {
54 return -1; 60 return -1;
@@ -79,13 +85,36 @@ void ramdisk_sleepnow(void)
79{ 85{
80} 86}
81 87
88void ramdisk_enable(bool on)
89{
90 (void)on;
91}
92
93bool ramdisk_disk_is_active(void)
94{
95 return true;
96}
97
98int ramdisk_soft_reset(void)
99{
100 return 0;
101}
102
103int ramdisk_spinup_time(void)
104{
105 return 0;
106}
107
82void ramdisk_spindown(int seconds) 108void ramdisk_spindown(int seconds)
83{ 109{
84 (void)seconds; 110 (void)seconds;
85} 111}
86#ifdef STORAGE_GET_INFO 112#ifdef STORAGE_GET_INFO
87void ramdisk_get_info(IF_MV2(int drive,) struct storage_info *info) 113void ramdisk_get_info(IF_MD2(int drive,) struct storage_info *info)
88{ 114{
115#ifdef HAVE_MULTIDRIVE
116 (void)drive; /* unused for now */
117#endif
89 /* firmware version */ 118 /* firmware version */
90 info->revision="0.00"; 119 info->revision="0.00";
91 120
@@ -100,3 +129,14 @@ void ramdisk_get_info(IF_MV2(int drive,) struct storage_info *info)
100} 129}
101#endif 130#endif
102 131
132#ifdef CONFIG_STORAGE_MULTI
133int ramdisk_num_drives(int first_drive)
134{
135 /* We don't care which logical drive number(s) we have been assigned */
136 (void)first_drive;
137
138 return 1;
139}
140#endif
141
142