From 376d8d577fe94a8dc8742deff5a7524aa1595e1c Mon Sep 17 00:00:00 2001 From: Frank Gevaerts Date: Sat, 3 Apr 2010 22:02:09 +0000 Subject: 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 --- firmware/common/dircache.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'firmware/common/dircache.c') diff --git a/firmware/common/dircache.c b/firmware/common/dircache.c index 9f19ac3d24..8b9be78b35 100644 --- a/firmware/common/dircache.c +++ b/firmware/common/dircache.c @@ -40,6 +40,7 @@ #include "file.h" #include "buffer.h" #include "dir.h" +#include "storage.h" #if CONFIG_RTC #include "time.h" #include "timefuncs.h" @@ -760,6 +761,7 @@ void* dircache_steal_buffer(long *size) void dircache_init(void) { int i; + int thread_id; dircache_initialized = false; dircache_initializing = false; @@ -771,10 +773,14 @@ void dircache_init(void) } queue_init(&dircache_queue, true); - create_thread(dircache_thread, dircache_stack, + thread_id = create_thread(dircache_thread, dircache_stack, sizeof(dircache_stack), 0, dircache_thread_name IF_PRIO(, PRIORITY_BACKGROUND) IF_COP(, CPU)); +#ifdef HAVE_IO_PRIORITY + thread_set_io_priority(thread_id,IO_PRIORITY_BACKGROUND); +#endif + } /** -- cgit v1.2.3