Commit graph

10 commits

Author SHA1 Message Date
Michael Sevakis
1654efc313 Unify storage threads into one
* Editing a bunch of drivers' thread routines in order to
implement a new feature is tedious.

* No matter the number of storage drivers, they share one thread.
No extra threads needed for CONFIG_STORAGE_MULTI.

* Each has an event callback called by the storage thread.

* A default callback is provided to fake sleeping in order to
trigger idle callbacks. It could also do other default processing.
Changes to it will be part of driver code without editing each
one.

* Drivers may sleep and wake as they please as long as they give
a low pulse on their storage bit to ask to go into sleep mode.
Idle callback is called on its behalf and driver immediately put
into sleep mode.

* Drivers may indicate they are to continue receiving events in
USB mode, otherwise they receve nothing until disconnect (they
do receive SYS_USB_DISCONNECTED no matter what).

* Rework a few things to keep the callback implementation sane
and maintainable. ata.c was dreadful with all those bools; make
it a state machine and easier to follow. Remove last_user_activity;
it has no purpose that isn't served by keeping the disk active
through last_disk_activity instead.

* Even-out stack sizes partly because of a lack of a decent place
to define them by driver or SoC or whatever; it doesn't seem too
critical to do that anyway. Many are simply too large while at
least one isn't really adequate. They may be individually
overridden if necessary (figure out where). The thread uses the
greatest size demanded. Newer file code is much more frugal with
stack space. I barely see use crack 50% after idle callbacks
(usually mid-40s). Card insert/eject doesn't demand much.

* No forcing of idle callbacks. If it isn't necessary for one or
more non-disk storage types, it really isn't any more necessary for
disk storage. Besides, it makes the whole thing easier to implement.

Change-Id: Id30c284d82a8af66e47f2cfe104c52cbd8aa7215
2017-10-26 14:35:41 -04:00
Thomas Jarosch
cfbd9cb22f Make a few local variables static
Change-Id: Ieb77a7f2cdf765afa3121320d03c0478cd97eb0f
2015-01-11 18:02:43 +01:00
Michael Sevakis
a56f1ca1ed Cleanup MV/MD macros a little.
When using variadic macros there's no need for IF_MD2/IF_MV2 to deal
with function parameters. IF_MD/IF_MV are enough.

Throw in IF_MD_DRV/ID_MV_VOL that return the parameter if MD/MV, or 0
if not.

Change-Id: I7605e6039f3be19cb47110c84dcb3c5516f2c3eb
2013-08-17 12:18:22 -04:00
Maurus Cuelenaere
77b3529246 Ramdisk: add hotswap support
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28363 a1c6a512-1295-4272-9138-f99709370657
2010-10-26 12:27:33 +00:00
Frank Gevaerts
c0a5a67387 Commit FS#9545, storage cleanup and multi-driver support
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21933 a1c6a512-1295-4272-9138-f99709370657
2009-07-17 22:28:49 +00:00
Frank Gevaerts
8cba8447f8 Allow access to the last sector of the ramdisk as well
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21930 a1c6a512-1295-4272-9138-f99709370657
2009-07-17 21:02:44 +00:00
Thomas Martitz
0dd0e4e072 Correct svn:keywords and svn:eol-style on a few more files.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21798 a1c6a512-1295-4272-9138-f99709370657
2009-07-12 09:43:44 +00:00
Maurus Cuelenaere
4af26e7e98 Onda VX747:
* Commit (premature) SD, USB & audio drivers
 * Fix ramdisk.c mistake
 * Add battery readout


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19011 a1c6a512-1295-4272-9138-f99709370657
2008-11-05 00:24:46 +00:00
Frank Gevaerts
d5a5f37a6a ramdisk needs to be non-extern
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18994 a1c6a512-1295-4272-9138-f99709370657
2008-11-03 21:21:48 +00:00
Frank Gevaerts
214cd81f08 Add ramdisk storage driver. It will be useful for developing multi-driver storage
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18993 a1c6a512-1295-4272-9138-f99709370657
2008-11-03 20:52:27 +00:00