summaryrefslogtreecommitdiff
path: root/firmware/export/thread.h
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/export/thread.h
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/export/thread.h')
-rw-r--r--firmware/export/thread.h10
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);
539int thread_set_priority(unsigned int thread_id, int priority); 545int thread_set_priority(unsigned int thread_id, int priority);
540int thread_get_priority(unsigned int thread_id); 546int thread_get_priority(unsigned int thread_id);
541#endif /* HAVE_PRIORITY_SCHEDULING */ 547#endif /* HAVE_PRIORITY_SCHEDULING */
548#ifdef HAVE_IO_PRIORITY
549void thread_set_io_priority(unsigned int thread_id, int io_priority);
550int thread_get_io_priority(unsigned int thread_id);
551#endif /* HAVE_IO_PRIORITY */
542#if NUM_CORES > 1 552#if NUM_CORES > 1
543unsigned int switch_core(unsigned int new_core); 553unsigned int switch_core(unsigned int new_core);
544#endif 554#endif