summaryrefslogtreecommitdiff
path: root/firmware/export/thread.h
diff options
context:
space:
mode:
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);