summaryrefslogtreecommitdiff
path: root/firmware/export/storage.h
diff options
context:
space:
mode:
authorFrank Gevaerts <frank@gevaerts.be>2010-04-03 22:02:09 +0000
committerFrank Gevaerts <frank@gevaerts.be>2010-04-03 22:02:09 +0000
commit376d8d577fe94a8dc8742deff5a7524aa1595e1c (patch)
tree4d76e5232d8b513a40f11588d0f6899d47336b49 /firmware/export/storage.h
parentba7501513a87433043a217a813c9147d004314a5 (diff)
downloadrockbox-376d8d577fe94a8dc8742deff5a7524aa1595e1c.tar.gz
rockbox-376d8d577fe94a8dc8742deff5a7524aa1595e1c.zip
Add IO priority handling. Currently all IO has equal priority, except the dircache scanning thread which is lower. This fixes the slow boot problem for me, with the added benefit that actual audio playback also starts faster.
Lots of the changes are due to changing storage_(read|write)sectors() from macros to wrapper functions. This means that they have to be called with IF_MD2(drive,) again. Flyspray: FS#11167 Author: Frank Gevaerts git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25459 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export/storage.h')
-rw-r--r--firmware/export/storage.h20
1 files changed, 8 insertions, 12 deletions
diff --git a/firmware/export/storage.h b/firmware/export/storage.h
index 0096e87a8d..e62cf0d902 100644
--- a/firmware/export/storage.h
+++ b/firmware/export/storage.h
@@ -57,6 +57,7 @@ struct storage_info
57 */ 57 */
58 #define storage_num_drives() NUM_DRIVES 58 #define storage_num_drives() NUM_DRIVES
59 #if (CONFIG_STORAGE & STORAGE_ATA) 59 #if (CONFIG_STORAGE & STORAGE_ATA)
60 #define STORAGE_FUNCTION(NAME) (ata_## NAME)
60 #define storage_spindown ata_spindown 61 #define storage_spindown ata_spindown
61 #define storage_sleep ata_sleep 62 #define storage_sleep ata_sleep
62 #define storage_spin ata_spin 63 #define storage_spin ata_spin
@@ -67,8 +68,6 @@ struct storage_info
67 #define storage_soft_reset() ata_soft_reset() 68 #define storage_soft_reset() ata_soft_reset()
68 #define storage_init() ata_init() 69 #define storage_init() ata_init()
69 #define storage_close() ata_close() 70 #define storage_close() ata_close()
70 #define storage_read_sectors(drive, start, count, buf) ata_read_sectors(IF_MD2(drive,) start, count, buf)
71 #define storage_write_sectors(drive, start, count, buf) ata_write_sectors(IF_MD2(drive,) start, count, buf)
72 #ifdef HAVE_STORAGE_FLUSH 71 #ifdef HAVE_STORAGE_FLUSH
73 #define storage_flush() (void)0 72 #define storage_flush() (void)0
74 #endif 73 #endif
@@ -84,6 +83,7 @@ struct storage_info
84 #define storage_present(drive) ata_present(IF_MD(drive)) 83 #define storage_present(drive) ata_present(IF_MD(drive))
85 #endif 84 #endif
86 #elif (CONFIG_STORAGE & STORAGE_SD) 85 #elif (CONFIG_STORAGE & STORAGE_SD)
86 #define STORAGE_FUNCTION(NAME) (sd_## NAME)
87 #define storage_spindown sd_spindown 87 #define storage_spindown sd_spindown
88 #define storage_sleep sd_sleep 88 #define storage_sleep sd_sleep
89 #define storage_spin sd_spin 89 #define storage_spin sd_spin
@@ -93,8 +93,6 @@ struct storage_info
93 #define storage_disk_is_active() 0 93 #define storage_disk_is_active() 0
94 #define storage_soft_reset() (void)0 94 #define storage_soft_reset() (void)0
95 #define storage_init() sd_init() 95 #define storage_init() sd_init()
96 #define storage_read_sectors(drive, start, count, buf) sd_read_sectors(IF_MD2(drive,) start, count, buf)
97 #define storage_write_sectors(drive, start, count, buf) sd_write_sectors(IF_MD2(drive,) start, count, buf)
98 #ifdef HAVE_STORAGE_FLUSH 96 #ifdef HAVE_STORAGE_FLUSH
99 #define storage_flush() (void)0 97 #define storage_flush() (void)0
100 #endif 98 #endif
@@ -110,6 +108,7 @@ struct storage_info
110 #define storage_present(drive) sd_present(IF_MD(drive)) 108 #define storage_present(drive) sd_present(IF_MD(drive))
111 #endif 109 #endif
112 #elif (CONFIG_STORAGE & STORAGE_MMC) 110 #elif (CONFIG_STORAGE & STORAGE_MMC)
111 #define STORAGE_FUNCTION(NAME) (mmc_## NAME)
113 #define storage_spindown mmc_spindown 112 #define storage_spindown mmc_spindown
114 #define storage_sleep mmc_sleep 113 #define storage_sleep mmc_sleep
115 #define storage_spin mmc_spin 114 #define storage_spin mmc_spin
@@ -119,8 +118,6 @@ struct storage_info
119 #define storage_disk_is_active() mmc_disk_is_active() 118 #define storage_disk_is_active() mmc_disk_is_active()
120 #define storage_soft_reset() (void)0 119 #define storage_soft_reset() (void)0
121 #define storage_init() mmc_init() 120 #define storage_init() mmc_init()
122 #define storage_read_sectors(drive, start, count, buf) mmc_read_sectors(IF_MD2(drive,) start, count, buf)
123 #define storage_write_sectors(drive, start, count, buf) mmc_write_sectors(IF_MD2(drive,) start, count, buf)
124 #ifdef HAVE_STORAGE_FLUSH 121 #ifdef HAVE_STORAGE_FLUSH
125 #define storage_flush() (void)0 122 #define storage_flush() (void)0
126 #endif 123 #endif
@@ -136,6 +133,7 @@ struct storage_info
136 #define storage_present(drive) mmc_present(IF_MD(drive)) 133 #define storage_present(drive) mmc_present(IF_MD(drive))
137 #endif 134 #endif
138 #elif (CONFIG_STORAGE & STORAGE_NAND) 135 #elif (CONFIG_STORAGE & STORAGE_NAND)
136 #define STORAGE_FUNCTION(NAME) (nand_## NAME)
139 #define storage_spindown nand_spindown 137 #define storage_spindown nand_spindown
140 #define storage_sleep nand_sleep 138 #define storage_sleep nand_sleep
141 #define storage_spin nand_spin 139 #define storage_spin nand_spin
@@ -145,8 +143,6 @@ struct storage_info
145 #define storage_disk_is_active() 0 143 #define storage_disk_is_active() 0
146 #define storage_soft_reset() (void)0 144 #define storage_soft_reset() (void)0
147 #define storage_init() nand_init() 145 #define storage_init() nand_init()
148 #define storage_read_sectors(drive, start, count, buf) nand_read_sectors(IF_MD2(drive,) start, count, buf)
149 #define storage_write_sectors(drive, start, count, buf) nand_write_sectors(IF_MD2(drive,) start, count, buf)
150 #ifdef HAVE_STORAGE_FLUSH 146 #ifdef HAVE_STORAGE_FLUSH
151 #define storage_flush() nand_flush() 147 #define storage_flush() nand_flush()
152 #endif 148 #endif
@@ -162,6 +158,7 @@ struct storage_info
162 #define storage_present(drive) nand_present(IF_MD(drive)) 158 #define storage_present(drive) nand_present(IF_MD(drive))
163 #endif 159 #endif
164 #elif (CONFIG_STORAGE & STORAGE_RAMDISK) 160 #elif (CONFIG_STORAGE & STORAGE_RAMDISK)
161 #define STORAGE_FUNCTION(NAME) (ramdisk_## NAME)
165 #define storage_spindown ramdisk_spindown 162 #define storage_spindown ramdisk_spindown
166 #define storage_sleep ramdisk_sleep 163 #define storage_sleep ramdisk_sleep
167 #define storage_spin ramdisk_spin 164 #define storage_spin ramdisk_spin
@@ -171,8 +168,6 @@ struct storage_info
171 #define storage_disk_is_active() 0 168 #define storage_disk_is_active() 0
172 #define storage_soft_reset() (void)0 169 #define storage_soft_reset() (void)0
173 #define storage_init() ramdisk_init() 170 #define storage_init() ramdisk_init()
174 #define storage_read_sectors(drive, start, count, buf) ramdisk_read_sectors(IF_MD2(drive,) start, count, buf)
175 #define storage_write_sectors(drive, start, count, buf) ramdisk_write_sectors(IF_MD2(drive,) start, count, buf)
176 #ifdef HAVE_STORAGE_FLUSH 171 #ifdef HAVE_STORAGE_FLUSH
177 #define storage_flush() (void)0 172 #define storage_flush() (void)0
178 #endif 173 #endif
@@ -200,8 +195,6 @@ void storage_sleepnow(void);
200bool storage_disk_is_active(void); 195bool storage_disk_is_active(void);
201int storage_soft_reset(void); 196int storage_soft_reset(void);
202int storage_init(void); 197int storage_init(void);
203int storage_read_sectors(int drive, unsigned long start, int count, void* buf);
204int storage_write_sectors(int drive, unsigned long start, int count, const void* buf);
205int storage_flush(void); 198int storage_flush(void);
206void storage_spin(void); 199void storage_spin(void);
207void storage_spindown(int seconds); 200void storage_spindown(int seconds);
@@ -217,4 +210,7 @@ bool storage_present(int drive);
217#endif 210#endif
218 211
219#endif /* NOT CONFIG_STORAGE_MULTI and NOT SIMULATOR*/ 212#endif /* NOT CONFIG_STORAGE_MULTI and NOT SIMULATOR*/
213
214int storage_read_sectors(IF_MD2(int drive,) unsigned long start, int count, void* buf);
215int storage_write_sectors(IF_MD2(int drive,) unsigned long start, int count, const void* buf);
220#endif 216#endif