summaryrefslogtreecommitdiff
path: root/firmware/common/dircache.c
diff options
context:
space:
mode:
authorFrank Gevaerts <frank@gevaerts.be>2010-04-03 22:02:09 +0000
committerFrank Gevaerts <frank@gevaerts.be>2010-04-03 22:02:09 +0000
commit376d8d577fe94a8dc8742deff5a7524aa1595e1c (patch)
tree4d76e5232d8b513a40f11588d0f6899d47336b49 /firmware/common/dircache.c
parentba7501513a87433043a217a813c9147d004314a5 (diff)
downloadrockbox-376d8d577fe94a8dc8742deff5a7524aa1595e1c.tar.gz
rockbox-376d8d577fe94a8dc8742deff5a7524aa1595e1c.zip
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
Diffstat (limited to 'firmware/common/dircache.c')
-rw-r--r--firmware/common/dircache.c8
1 files changed, 7 insertions, 1 deletions
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 @@
40#include "file.h" 40#include "file.h"
41#include "buffer.h" 41#include "buffer.h"
42#include "dir.h" 42#include "dir.h"
43#include "storage.h"
43#if CONFIG_RTC 44#if CONFIG_RTC
44#include "time.h" 45#include "time.h"
45#include "timefuncs.h" 46#include "timefuncs.h"
@@ -760,6 +761,7 @@ void* dircache_steal_buffer(long *size)
760void dircache_init(void) 761void dircache_init(void)
761{ 762{
762 int i; 763 int i;
764 int thread_id;
763 765
764 dircache_initialized = false; 766 dircache_initialized = false;
765 dircache_initializing = false; 767 dircache_initializing = false;
@@ -771,10 +773,14 @@ void dircache_init(void)
771 } 773 }
772 774
773 queue_init(&dircache_queue, true); 775 queue_init(&dircache_queue, true);
774 create_thread(dircache_thread, dircache_stack, 776 thread_id = create_thread(dircache_thread, dircache_stack,
775 sizeof(dircache_stack), 0, dircache_thread_name 777 sizeof(dircache_stack), 0, dircache_thread_name
776 IF_PRIO(, PRIORITY_BACKGROUND) 778 IF_PRIO(, PRIORITY_BACKGROUND)
777 IF_COP(, CPU)); 779 IF_COP(, CPU));
780#ifdef HAVE_IO_PRIORITY
781 thread_set_io_priority(thread_id,IO_PRIORITY_BACKGROUND);
782#endif
783
778} 784}
779 785
780/** 786/**