summaryrefslogtreecommitdiff
path: root/firmware/export/thread.h
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2007-03-09 08:03:18 +0000
committerMichael Sevakis <jethead71@rockbox.org>2007-03-09 08:03:18 +0000
commitdee43ece2086e15894934b754e47cb7ce5882cda (patch)
tree9238a5c80fe4382975387ec90eca61bda8d4ed8f /firmware/export/thread.h
parentf4b83e68594f076cdfe510cd2e23b7f57fd158b5 (diff)
downloadrockbox-dee43ece2086e15894934b754e47cb7ce5882cda.tar.gz
rockbox-dee43ece2086e15894934b754e47cb7ce5882cda.zip
Put an end to priority inversion in the ata driver. Gave up trying to have fully atomic dual use mutexes so just replaced the ata driver locking with spins. Maybe I'll have better luck later. Things should run smoothly with database updates and such happening in the background.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12688 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export/thread.h')
-rw-r--r--firmware/export/thread.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/firmware/export/thread.h b/firmware/export/thread.h
index 3a979722b9..7a9414c79f 100644
--- a/firmware/export/thread.h
+++ b/firmware/export/thread.h
@@ -105,6 +105,7 @@ struct thread_entry {
105 unsigned short stack_size; 105 unsigned short stack_size;
106#ifdef HAVE_PRIORITY_SCHEDULING 106#ifdef HAVE_PRIORITY_SCHEDULING
107 unsigned short priority; 107 unsigned short priority;
108 unsigned long priority_x;
108 long last_run; 109 long last_run;
109#endif 110#endif
110 struct thread_entry *next, *prev; 111 struct thread_entry *next, *prev;
@@ -114,6 +115,10 @@ struct core_entry {
114 struct thread_entry threads[MAXTHREADS]; 115 struct thread_entry threads[MAXTHREADS];
115 struct thread_entry *running; 116 struct thread_entry *running;
116 struct thread_entry *sleeping; 117 struct thread_entry *sleeping;
118#ifdef HAVE_EXTENDED_MESSAGING_AND_NAME
119 int switch_to_irq_level;
120 #define STAY_IRQ_LEVEL -1
121#endif
117}; 122};
118 123
119#ifdef HAVE_PRIORITY_SCHEDULING 124#ifdef HAVE_PRIORITY_SCHEDULING
@@ -149,7 +154,14 @@ void wakeup_thread(struct thread_entry **thread);
149#ifdef HAVE_PRIORITY_SCHEDULING 154#ifdef HAVE_PRIORITY_SCHEDULING
150int thread_set_priority(struct thread_entry *thread, int priority); 155int thread_set_priority(struct thread_entry *thread, int priority);
151int thread_get_priority(struct thread_entry *thread); 156int thread_get_priority(struct thread_entry *thread);
152#endif 157/* Yield that guarantees thread execution once per round regardless of
158 thread's scheduler priority - basically a transient realtime boost
159 without altering the scheduler's thread precedence. */
160void priority_yield(void);
161#else
162static inline void priority_yield(void)
163 { yield(); }
164#endif /* HAVE_PRIORITY_SCHEDULING */
153struct thread_entry * thread_get_current(void); 165struct thread_entry * thread_get_current(void);
154void init_threads(void); 166void init_threads(void);
155int thread_stack_usage(const struct thread_entry *thread); 167int thread_stack_usage(const struct thread_entry *thread);