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/export/thread.h | |
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/export/thread.h')
-rw-r--r-- | firmware/export/thread.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/firmware/export/thread.h b/firmware/export/thread.h index 2a2a7a8619..a75981dcba 100644 --- a/firmware/export/thread.h +++ b/firmware/export/thread.h | |||
@@ -58,6 +58,9 @@ | |||
58 | #define NUM_PRIORITIES 32 | 58 | #define NUM_PRIORITIES 32 |
59 | #define PRIORITY_IDLE 32 /* Priority representative of no tasks */ | 59 | #define PRIORITY_IDLE 32 /* Priority representative of no tasks */ |
60 | 60 | ||
61 | #define IO_PRIORITY_IMMEDIATE 0 | ||
62 | #define IO_PRIORITY_BACKGROUND 32 | ||
63 | |||
61 | #if CONFIG_CODEC == SWCODEC | 64 | #if CONFIG_CODEC == SWCODEC |
62 | 65 | ||
63 | #ifdef HAVE_RECORDING | 66 | #ifdef HAVE_RECORDING |
@@ -294,6 +297,9 @@ struct thread_entry | |||
294 | struct corelock waiter_cl; /* Corelock for thread_wait */ | 297 | struct corelock waiter_cl; /* Corelock for thread_wait */ |
295 | struct corelock slot_cl; /* Corelock to lock thread slot */ | 298 | struct corelock slot_cl; /* Corelock to lock thread slot */ |
296 | #endif | 299 | #endif |
300 | #ifdef HAVE_IO_PRIORITY | ||
301 | unsigned char io_priority; | ||
302 | #endif | ||
297 | }; | 303 | }; |
298 | 304 | ||
299 | /*** Macros for internal use ***/ | 305 | /*** Macros for internal use ***/ |
@@ -539,6 +545,10 @@ unsigned int wakeup_thread(struct thread_entry **list); | |||
539 | int thread_set_priority(unsigned int thread_id, int priority); | 545 | int thread_set_priority(unsigned int thread_id, int priority); |
540 | int thread_get_priority(unsigned int thread_id); | 546 | int thread_get_priority(unsigned int thread_id); |
541 | #endif /* HAVE_PRIORITY_SCHEDULING */ | 547 | #endif /* HAVE_PRIORITY_SCHEDULING */ |
548 | #ifdef HAVE_IO_PRIORITY | ||
549 | void thread_set_io_priority(unsigned int thread_id, int io_priority); | ||
550 | int thread_get_io_priority(unsigned int thread_id); | ||
551 | #endif /* HAVE_IO_PRIORITY */ | ||
542 | #if NUM_CORES > 1 | 552 | #if NUM_CORES > 1 |
543 | unsigned int switch_core(unsigned int new_core); | 553 | unsigned int switch_core(unsigned int new_core); |
544 | #endif | 554 | #endif |