Add INIT_ATTR to storage_init() when possible

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31036 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Rafaël Carré 2011-11-20 18:44:40 +00:00
parent bccee89002
commit 814ffffdbe
7 changed files with 16 additions and 6 deletions

View file

@ -37,7 +37,7 @@ void ata_sleepnow(void);
*/
bool ata_disk_is_active(void);
int ata_soft_reset(void);
int ata_init(void);
int ata_init(void) STORAGE_INIT_ATTR;
void ata_close(void);
int ata_read_sectors(IF_MD2(int drive,) unsigned long start, int count, void* buf);
int ata_write_sectors(IF_MD2(int drive,) unsigned long start, int count, const void* buf);

View file

@ -908,6 +908,16 @@ Lyre prototype 1 */
#define INITDATA_ATTR
#endif
/* We need to call storage_init more than once only if USB storage mode is
* handled in hardware:
* Deinit storage -> let hardware handle USB mode -> storage_init() again
*/
#if defined(HAVE_USBSTACK) || defined(USB_NONE)
#define STORAGE_INIT_ATTR INIT_ATTR
#else
#define STORAGE_INIT_ATTR
#endif
#if (CONFIG_PLATFORM & PLATFORM_HOSTED) && defined(__APPLE__)
#define DATA_ATTR __attribute__ ((section("__DATA, .data")))
#else

View file

@ -33,7 +33,7 @@ void mmc_sleep(void);
void mmc_sleepnow(void);
bool mmc_disk_is_active(void);
int mmc_soft_reset(void);
int mmc_init(void);
int mmc_init(void) STORAGE_INIT_ATTR;
void mmc_close(void);
int mmc_read_sectors(IF_MD2(int drive,) unsigned long start, int count, void* buf);
int mmc_write_sectors(IF_MD2(int drive,) unsigned long start, int count, const void* buf);

View file

@ -33,7 +33,7 @@ void nand_sleep(void);
void nand_sleepnow(void);
bool nand_disk_is_active(void);
int nand_soft_reset(void);
int nand_init(void);
int nand_init(void) STORAGE_INIT_ATTR;
void nand_close(void);
int nand_read_sectors(IF_MD2(int drive,) unsigned long start, int count, void* buf);
int nand_write_sectors(IF_MD2(int drive,) unsigned long start, int count, const void* buf);

View file

@ -32,7 +32,7 @@ void ramdisk_spindown(int seconds);
void ramdisk_sleep(void);
bool ramdisk_disk_is_active(void);
int ramdisk_soft_reset(void);
int ramdisk_init(void);
int ramdisk_init(void) STORAGE_INIT_ATTR;
void ramdisk_close(void);
int ramdisk_read_sectors(IF_MD2(int drive,) unsigned long start, int count, void* buf);
int ramdisk_write_sectors(IF_MD2(int drive,) unsigned long start, int count, const void* buf);

View file

@ -39,7 +39,7 @@ void sd_sleep(void);
void sd_sleepnow(void);
bool sd_disk_is_active(void);
int sd_soft_reset(void);
int sd_init(void);
int sd_init(void) STORAGE_INIT_ATTR;
void sd_close(void);
int sd_read_sectors(IF_MD2(int drive,) unsigned long start, int count, void* buf);
int sd_write_sectors(IF_MD2(int drive,) unsigned long start, int count, const void* buf);

View file

@ -214,7 +214,7 @@ void storage_sleep(void);
void storage_sleepnow(void);
bool storage_disk_is_active(void);
int storage_soft_reset(void);
int storage_init(void);
int storage_init(void) STORAGE_INIT_ATTR;
int storage_flush(void);
void storage_spin(void);
void storage_spindown(int seconds);