summaryrefslogtreecommitdiffstats
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 @@
#define NUM_PRIORITIES 32
#define PRIORITY_IDLE 32 /* Priority representative of no tasks */
+#define IO_PRIORITY_IMMEDIATE 0
+#define IO_PRIORITY_BACKGROUND 32
+
#if CONFIG_CODEC == SWCODEC
#ifdef HAVE_RECORDING
@@ -294,6 +297,9 @@ struct thread_entry
struct corelock waiter_cl; /* Corelock for thread_wait */
struct corelock slot_cl; /* Corelock to lock thread slot */
#endif
+#ifdef HAVE_IO_PRIORITY
+ unsigned char io_priority;
+#endif
};
/*** Macros for internal use ***/
@@ -539,6 +545,10 @@ unsigned int wakeup_thread(struct thread_entry **list);
int thread_set_priority(unsigned int thread_id, int priority);
int thread_get_priority(unsigned int thread_id);
#endif /* HAVE_PRIORITY_SCHEDULING */
+#ifdef HAVE_IO_PRIORITY
+void thread_set_io_priority(unsigned int thread_id, int io_priority);
+int thread_get_io_priority(unsigned int thread_id);
+#endif /* HAVE_IO_PRIORITY */
#if NUM_CORES > 1
unsigned int switch_core(unsigned int new_core);
#endif