1
0
Fork 0
forked from len0rd/rockbox

Add IO priority handling. Currently all IO has equal priority, except the dircache scanning thread which is lower. This fixes the slow boot problem for me, with the added benefit that actual audio playback also starts faster.

Lots of the changes are due to changing storage_(read|write)sectors() from macros to wrapper functions. This means that they have to be called with IF_MD2(drive,) again.

Flyspray: FS#11167
Author: Frank Gevaerts


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25459 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Frank Gevaerts 2010-04-03 22:02:09 +00:00
parent ba7501513a
commit 376d8d577f
10 changed files with 220 additions and 102 deletions

View file

@ -58,6 +58,9 @@
#define NUM_PRIORITIES 32
#define PRIORITY_IDLE 32 /* Priority representative of no tasks */
#define IO_PRIORITY_IMMEDIATE 0
#define IO_PRIORITY_BACKGROUND 32
#if CONFIG_CODEC == SWCODEC
#ifdef HAVE_RECORDING
@ -294,6 +297,9 @@ struct thread_entry
struct corelock waiter_cl; /* Corelock for thread_wait */
struct corelock slot_cl; /* Corelock to lock thread slot */
#endif
#ifdef HAVE_IO_PRIORITY
unsigned char io_priority;
#endif
};
/*** Macros for internal use ***/
@ -539,6 +545,10 @@ unsigned int wakeup_thread(struct thread_entry **list);
int thread_set_priority(unsigned int thread_id, int priority);
int thread_get_priority(unsigned int thread_id);
#endif /* HAVE_PRIORITY_SCHEDULING */
#ifdef HAVE_IO_PRIORITY
void thread_set_io_priority(unsigned int thread_id, int io_priority);
int thread_get_io_priority(unsigned int thread_id);
#endif /* HAVE_IO_PRIORITY */
#if NUM_CORES > 1
unsigned int switch_core(unsigned int new_core);
#endif