summaryrefslogtreecommitdiff
path: root/firmware/export/ata_idle_notify.h
diff options
context:
space:
mode:
authorFrank Gevaerts <frank@gevaerts.be>2008-11-01 16:14:28 +0000
committerFrank Gevaerts <frank@gevaerts.be>2008-11-01 16:14:28 +0000
commit2f8a0081c64534da23fc0fa9cc685eb7454fd9c9 (patch)
tree84dbdbd5326cb48f43d2ebd5a4c86e992c1d5288 /firmware/export/ata_idle_notify.h
parent646cac0bde7b11fa7bcb670d1d76eec78e360485 (diff)
downloadrockbox-2f8a0081c64534da23fc0fa9cc685eb7454fd9c9.tar.gz
rockbox-2f8a0081c64534da23fc0fa9cc685eb7454fd9c9.zip
Apply FS#9500. This adds a storage_*() abstraction to replace ata_*(). To do that, it also introduces sd_*, nand_*, and mmc_*.
This should be a good first step to allow multi-driver targets, like the Elio (ATA/SD), or the D2 (NAND/SD). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18960 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export/ata_idle_notify.h')
-rw-r--r--firmware/export/ata_idle_notify.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/firmware/export/ata_idle_notify.h b/firmware/export/ata_idle_notify.h
index aea2c92b06..ceba2eeda4 100644
--- a/firmware/export/ata_idle_notify.h
+++ b/firmware/export/ata_idle_notify.h
@@ -26,15 +26,15 @@
26#include "events.h" 26#include "events.h"
27 27
28/* 28/*
29 NOTE: ata_idle_notify usage notes.. 29 NOTE: storage_idle_notify usage notes..
30 30
311) The callbacks are called in the ata thread, not main/your thread. 311) The callbacks are called in the ata thread, not main/your thread.
322) Asynchronous callbacks (like the buffer refill) should be avoided. 322) Asynchronous callbacks (like the buffer refill) should be avoided.
33 If you must use an async callback, remember to check ata_is_active() before 33 If you must use an async callback, remember to check storage_is_active() before
34 accessing the disk, and do not call any functions between that check and the 34 accessing the disk, and do not call any functions between that check and the
35 disk access which may cause a yield (lcd_update() does this!). 35 disk access which may cause a yield (lcd_update() does this!).
363) Do not call any yielding functions in the callback. 363) Do not call any yielding functions in the callback.
374) Do not call ata_sleep in the callbacks. 374) Do not call storage_sleep in the callbacks.
385) Don't Panic! 385) Don't Panic!
39 39
40*/ 40*/
@@ -43,21 +43,21 @@ enum {
43 DISK_EVENT_SPINUP = (EVENT_CLASS_DISK|1), 43 DISK_EVENT_SPINUP = (EVENT_CLASS_DISK|1),
44}; 44};
45 45
46#define USING_ATA_CALLBACK !defined(SIMULATOR) \ 46#define USING_STORAGE_CALLBACK !defined(SIMULATOR) \
47 && ! ((CONFIG_STORAGE & STORAGE_NAND) \ 47 && ! ((CONFIG_STORAGE & STORAGE_NAND) \
48 && (CONFIG_NAND & NAND_IFP7XX)) \ 48 && (CONFIG_NAND & NAND_IFP7XX)) \
49 && !defined(BOOTLOADER) 49 && !defined(BOOTLOADER)
50 50
51typedef bool (*ata_idle_notify)(void); 51typedef bool (*storage_idle_notify)(void);
52 52
53extern void register_ata_idle_func(ata_idle_notify function); 53extern void register_storage_idle_func(storage_idle_notify function);
54#if USING_ATA_CALLBACK 54#if USING_STORAGE_CALLBACK
55extern void unregister_ata_idle_func(ata_idle_notify function, bool run); 55extern void unregister_storage_idle_func(storage_idle_notify function, bool run);
56extern bool call_ata_idle_notifys(bool force); 56extern bool call_storage_idle_notifys(bool force);
57#else 57#else
58#define unregister_ata_idle_func(f,r) 58#define unregister_storage_idle_func(f,r)
59#define call_ata_idle_notifys(f) 59#define call_storage_idle_notifys(f)
60#define ata_idle_notify_init(s) 60#define storage_idle_notify_init(s)
61#endif 61#endif
62 62
63#endif /* __ATACALLBACK_H__ */ 63#endif /* __ATACALLBACK_H__ */