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

@ -2413,6 +2413,11 @@ unsigned int create_thread(void (*function)(void),
prio_add_entry(&thread->pdist, priority);
#endif
#ifdef HAVE_IO_PRIORITY
/* Default to high (foreground) priority */
thread->io_priority = IO_PRIORITY_IMMEDIATE;
#endif
#if NUM_CORES > 1
thread->core = core;
@ -2918,6 +2923,20 @@ int thread_get_priority(unsigned int thread_id)
}
#endif /* HAVE_PRIORITY_SCHEDULING */
#ifdef HAVE_IO_PRIORITY
int thread_get_io_priority(unsigned int thread_id)
{
struct thread_entry *thread = thread_id_entry(thread_id);
return thread->io_priority;
}
void thread_set_io_priority(unsigned int thread_id,int io_priority)
{
struct thread_entry *thread = thread_id_entry(thread_id);
thread->io_priority = io_priority;
}
#endif
/*---------------------------------------------------------------------------
* Starts a frozen thread - similar semantics to wakeup_thread except that
* the thread is on no scheduler or wakeup queue at all. It exists simply by