diff options
author | Frank Gevaerts <frank@gevaerts.be> | 2010-04-03 22:02:09 +0000 |
---|---|---|
committer | Frank Gevaerts <frank@gevaerts.be> | 2010-04-03 22:02:09 +0000 |
commit | 376d8d577fe94a8dc8742deff5a7524aa1595e1c (patch) | |
tree | 4d76e5232d8b513a40f11588d0f6899d47336b49 /firmware/common | |
parent | ba7501513a87433043a217a813c9147d004314a5 (diff) | |
download | rockbox-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')
-rw-r--r-- | firmware/common/dircache.c | 8 | ||||
-rw-r--r-- | firmware/common/disk.c | 2 |
2 files changed, 8 insertions, 2 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) | |||
760 | void dircache_init(void) | 761 | void 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 | /** |
diff --git a/firmware/common/disk.c b/firmware/common/disk.c index c4553099ec..f8efe1c88b 100644 --- a/firmware/common/disk.c +++ b/firmware/common/disk.c | |||
@@ -82,7 +82,7 @@ struct partinfo* disk_init(IF_MD_NONVOID(int drive)) | |||
82 | (void)drive; | 82 | (void)drive; |
83 | #endif | 83 | #endif |
84 | 84 | ||
85 | storage_read_sectors(drive, 0,1, §or); | 85 | storage_read_sectors(IF_MD2(drive,) 0,1, §or); |
86 | /* check that the boot sector is initialized */ | 86 | /* check that the boot sector is initialized */ |
87 | if ( (sector[510] != 0x55) || | 87 | if ( (sector[510] != 0x55) || |
88 | (sector[511] != 0xaa)) { | 88 | (sector[511] != 0xaa)) { |