diff options
author | Rafaël Carré <rafael.carre@gmail.com> | 2011-11-20 18:44:40 +0000 |
---|---|---|
committer | Rafaël Carré <rafael.carre@gmail.com> | 2011-11-20 18:44:40 +0000 |
commit | 814ffffdbe5a5ea420ddc6475512a75cba7a8583 (patch) | |
tree | 8aab4d0bf5ac49a4bb2d3abb64625f6b70aa9a66 | |
parent | bccee8900242d089e4e2c819725cd64b308b0157 (diff) | |
download | rockbox-814ffffdbe5a5ea420ddc6475512a75cba7a8583.tar.gz rockbox-814ffffdbe5a5ea420ddc6475512a75cba7a8583.zip |
Add INIT_ATTR to storage_init() when possible
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31036 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | firmware/export/ata.h | 2 | ||||
-rw-r--r-- | firmware/export/config.h | 10 | ||||
-rw-r--r-- | firmware/export/mmc.h | 2 | ||||
-rw-r--r-- | firmware/export/nand.h | 2 | ||||
-rw-r--r-- | firmware/export/ramdisk.h | 2 | ||||
-rw-r--r-- | firmware/export/sd.h | 2 | ||||
-rw-r--r-- | firmware/export/storage.h | 2 |
7 files changed, 16 insertions, 6 deletions
diff --git a/firmware/export/ata.h b/firmware/export/ata.h index 5be32da231..a3537812e5 100644 --- a/firmware/export/ata.h +++ b/firmware/export/ata.h | |||
@@ -37,7 +37,7 @@ void ata_sleepnow(void); | |||
37 | */ | 37 | */ |
38 | bool ata_disk_is_active(void); | 38 | bool ata_disk_is_active(void); |
39 | int ata_soft_reset(void); | 39 | int ata_soft_reset(void); |
40 | int ata_init(void); | 40 | int ata_init(void) STORAGE_INIT_ATTR; |
41 | void ata_close(void); | 41 | void ata_close(void); |
42 | int ata_read_sectors(IF_MD2(int drive,) unsigned long start, int count, void* buf); | 42 | int ata_read_sectors(IF_MD2(int drive,) unsigned long start, int count, void* buf); |
43 | int ata_write_sectors(IF_MD2(int drive,) unsigned long start, int count, const void* buf); | 43 | int ata_write_sectors(IF_MD2(int drive,) unsigned long start, int count, const void* buf); |
diff --git a/firmware/export/config.h b/firmware/export/config.h index a7f0a3578f..979a14d0c9 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h | |||
@@ -908,6 +908,16 @@ Lyre prototype 1 */ | |||
908 | #define INITDATA_ATTR | 908 | #define INITDATA_ATTR |
909 | #endif | 909 | #endif |
910 | 910 | ||
911 | /* We need to call storage_init more than once only if USB storage mode is | ||
912 | * handled in hardware: | ||
913 | * Deinit storage -> let hardware handle USB mode -> storage_init() again | ||
914 | */ | ||
915 | #if defined(HAVE_USBSTACK) || defined(USB_NONE) | ||
916 | #define STORAGE_INIT_ATTR INIT_ATTR | ||
917 | #else | ||
918 | #define STORAGE_INIT_ATTR | ||
919 | #endif | ||
920 | |||
911 | #if (CONFIG_PLATFORM & PLATFORM_HOSTED) && defined(__APPLE__) | 921 | #if (CONFIG_PLATFORM & PLATFORM_HOSTED) && defined(__APPLE__) |
912 | #define DATA_ATTR __attribute__ ((section("__DATA, .data"))) | 922 | #define DATA_ATTR __attribute__ ((section("__DATA, .data"))) |
913 | #else | 923 | #else |
diff --git a/firmware/export/mmc.h b/firmware/export/mmc.h index f2b0ad3509..7e72cb0846 100644 --- a/firmware/export/mmc.h +++ b/firmware/export/mmc.h | |||
@@ -33,7 +33,7 @@ void mmc_sleep(void); | |||
33 | void mmc_sleepnow(void); | 33 | void mmc_sleepnow(void); |
34 | bool mmc_disk_is_active(void); | 34 | bool mmc_disk_is_active(void); |
35 | int mmc_soft_reset(void); | 35 | int mmc_soft_reset(void); |
36 | int mmc_init(void); | 36 | int mmc_init(void) STORAGE_INIT_ATTR; |
37 | void mmc_close(void); | 37 | void mmc_close(void); |
38 | int mmc_read_sectors(IF_MD2(int drive,) unsigned long start, int count, void* buf); | 38 | int mmc_read_sectors(IF_MD2(int drive,) unsigned long start, int count, void* buf); |
39 | int mmc_write_sectors(IF_MD2(int drive,) unsigned long start, int count, const void* buf); | 39 | int mmc_write_sectors(IF_MD2(int drive,) unsigned long start, int count, const void* buf); |
diff --git a/firmware/export/nand.h b/firmware/export/nand.h index 60b986dc2f..13d559486c 100644 --- a/firmware/export/nand.h +++ b/firmware/export/nand.h | |||
@@ -33,7 +33,7 @@ void nand_sleep(void); | |||
33 | void nand_sleepnow(void); | 33 | void nand_sleepnow(void); |
34 | bool nand_disk_is_active(void); | 34 | bool nand_disk_is_active(void); |
35 | int nand_soft_reset(void); | 35 | int nand_soft_reset(void); |
36 | int nand_init(void); | 36 | int nand_init(void) STORAGE_INIT_ATTR; |
37 | void nand_close(void); | 37 | void nand_close(void); |
38 | int nand_read_sectors(IF_MD2(int drive,) unsigned long start, int count, void* buf); | 38 | int nand_read_sectors(IF_MD2(int drive,) unsigned long start, int count, void* buf); |
39 | int nand_write_sectors(IF_MD2(int drive,) unsigned long start, int count, const void* buf); | 39 | int nand_write_sectors(IF_MD2(int drive,) unsigned long start, int count, const void* buf); |
diff --git a/firmware/export/ramdisk.h b/firmware/export/ramdisk.h index 7a56e05989..5135e38301 100644 --- a/firmware/export/ramdisk.h +++ b/firmware/export/ramdisk.h | |||
@@ -32,7 +32,7 @@ void ramdisk_spindown(int seconds); | |||
32 | void ramdisk_sleep(void); | 32 | void ramdisk_sleep(void); |
33 | bool ramdisk_disk_is_active(void); | 33 | bool ramdisk_disk_is_active(void); |
34 | int ramdisk_soft_reset(void); | 34 | int ramdisk_soft_reset(void); |
35 | int ramdisk_init(void); | 35 | int ramdisk_init(void) STORAGE_INIT_ATTR; |
36 | void ramdisk_close(void); | 36 | void ramdisk_close(void); |
37 | int ramdisk_read_sectors(IF_MD2(int drive,) unsigned long start, int count, void* buf); | 37 | int ramdisk_read_sectors(IF_MD2(int drive,) unsigned long start, int count, void* buf); |
38 | int ramdisk_write_sectors(IF_MD2(int drive,) unsigned long start, int count, const void* buf); | 38 | int ramdisk_write_sectors(IF_MD2(int drive,) unsigned long start, int count, const void* buf); |
diff --git a/firmware/export/sd.h b/firmware/export/sd.h index 8e400bf88a..43c961efb3 100644 --- a/firmware/export/sd.h +++ b/firmware/export/sd.h | |||
@@ -39,7 +39,7 @@ void sd_sleep(void); | |||
39 | void sd_sleepnow(void); | 39 | void sd_sleepnow(void); |
40 | bool sd_disk_is_active(void); | 40 | bool sd_disk_is_active(void); |
41 | int sd_soft_reset(void); | 41 | int sd_soft_reset(void); |
42 | int sd_init(void); | 42 | int sd_init(void) STORAGE_INIT_ATTR; |
43 | void sd_close(void); | 43 | void sd_close(void); |
44 | int sd_read_sectors(IF_MD2(int drive,) unsigned long start, int count, void* buf); | 44 | int sd_read_sectors(IF_MD2(int drive,) unsigned long start, int count, void* buf); |
45 | int sd_write_sectors(IF_MD2(int drive,) unsigned long start, int count, const void* buf); | 45 | int sd_write_sectors(IF_MD2(int drive,) unsigned long start, int count, const void* buf); |
diff --git a/firmware/export/storage.h b/firmware/export/storage.h index e9ac8b4cb9..58d8d32b6d 100644 --- a/firmware/export/storage.h +++ b/firmware/export/storage.h | |||
@@ -214,7 +214,7 @@ void storage_sleep(void); | |||
214 | void storage_sleepnow(void); | 214 | void storage_sleepnow(void); |
215 | bool storage_disk_is_active(void); | 215 | bool storage_disk_is_active(void); |
216 | int storage_soft_reset(void); | 216 | int storage_soft_reset(void); |
217 | int storage_init(void); | 217 | int storage_init(void) STORAGE_INIT_ATTR; |
218 | int storage_flush(void); | 218 | int storage_flush(void); |
219 | void storage_spin(void); | 219 | void storage_spin(void); |
220 | void storage_spindown(int seconds); | 220 | void storage_spindown(int seconds); |