rockbox/firmware
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
..
asm fix warning in lcd-as-memframe.c 2017-09-17 15:13:52 +02:00
common Optimize lld_remove() a bit 2017-04-13 18:59:45 -04:00
decompressor Add KEEP() around vectors in linker scripts. 2011-12-18 06:43:08 +00:00
drivers Unify storage threads into one 2017-10-26 14:35:41 -04:00
export Unify storage threads into one 2017-10-26 14:35:41 -04:00
include Do some housekeeping with fat.h and SECTOR_SIZE 2017-03-12 22:05:44 -04:00
kernel Fix dangerous casts 2017-02-04 17:24:47 +01:00
libc Improve code for gmtime_r() 2017-02-03 14:40:55 -05:00
target Unify storage threads into one 2017-10-26 14:35:41 -04:00
test Limit more variables to file scope 2015-01-11 21:40:51 +01:00
usbstack Do some housekeeping with fat.h and SECTOR_SIZE 2017-03-12 22:05:44 -04:00
arabjoin.c
arabjoin.h
ata_idle_notify.c Fix reds. 2014-03-14 23:43:45 +01:00
backlight-sw-fading.c Get rid of stupid _backlight_* function names 2015-01-12 11:09:27 +01:00
backlight.c Selective Backlight/Advanced Softlock - Selective actions based on context 2017-01-17 23:06:17 +01:00
bidi.c bidi.c: Check buffer sizes. 2014-01-09 23:30:32 +01:00
buflib.c buflib: Switch from term "cookie" to "metadata" 2015-01-02 19:26:03 +01:00
COPYING
core_alloc.c Make a few local variables static 2015-01-11 18:02:43 +01:00
debug.c Redirect (L)DEBUGFs to adb logcat in DEBUG enabled builds. 2010-09-20 17:38:47 +00:00
eeprom_settings.c
enc_base.c FS#12378 : Remove various unused code, and comment out some unused code and data for reference or future use. 2011-12-14 21:45:25 +00:00
events.c Make thirty functions static to reduce binary size 2015-01-05 18:44:36 +01:00
firmware.make Fix makefile not rebuilding rbversion.h in some cases 2016-09-23 23:03:23 +02:00
font_cache.c fonts: Do not unload completely on USB. 2014-01-15 23:37:39 +01:00
font.c Initial commit for the Sony NWZ linux port 2017-09-05 21:42:12 +02:00
general.c kernel: Break out kernel primitives into separate files and move to separate dir. 2014-03-03 18:11:57 +01:00
hangul.c
ifp_usb_serial.c Make thirty functions static to reduce binary size 2015-01-05 18:44:36 +01:00
load_code.c Fix various reds. Some includes needed fixup. 2014-03-03 19:10:48 +01:00
logf.c Don't add new message to logf when we dump it to file 2016-04-04 11:07:44 +02:00
lru.c Revert r30818 2011-10-22 08:02:38 +00:00
panic.c Initial commit for the Sony NWZ linux port 2017-09-05 21:42:12 +02:00
pcm_mixer.c Enable setting of global output samplerate on certain targets. 2013-07-06 04:22:04 +02:00
pcm_sampr.c
pcm_sw_volume.c Greatly reduce volume-change zipper artifacts with SW volume. 2014-03-08 08:04:41 +01:00
pcm.c Greatly reduce volume-change zipper artifacts with SW volume. 2014-03-08 08:04:41 +01:00
powermgmt.c iBasso DX50/DX90: Major code cleanup and reorganization. 2015-02-02 21:57:55 +01:00
profile.c Remove last traces of sprintf.h 2010-05-07 02:13:47 +00:00
README
rolo.c Fix AMSv2 variant 1 detection if rockbox loaded from SD card 2016-04-22 20:43:45 +00:00
rom.lds rombox: Do not copy .init section to ram on startup. 2014-01-20 10:42:02 +01:00
screendump.c Fix warnings in firmware/screendump.c 2015-02-24 16:55:26 -05:00
scroll_engine.c scroll_engine: Fix FS#12894: Text scrolling stops working after a few seconds/minutes 2014-01-12 21:29:55 +01:00
sdmmc.c Various minor cleanups 2010-08-01 10:07:05 +00:00
sound.c Add DAC's oversampling filter roll-off selection to sound settings. 2013-05-24 11:18:16 +04:00
SOURCES Add simulator support for the A860 2017-09-17 00:03:45 +02:00
storage.c Unify storage threads into one 2017-10-26 14:35:41 -04:00
system.c AMS: Return ascodec to interrupt-based I2C2 driver 2017-01-25 00:05:13 +01:00
timer.c
tuner.c Improve radio RDS driver and framework 2017-02-11 22:19:32 -05:00
usb.c Do some housekeeping with fat.h and SECTOR_SIZE 2017-03-12 22:05:44 -04:00

See docs/README