diff options
Diffstat (limited to 'firmware/export/thread.h')
| -rw-r--r-- | firmware/export/thread.h | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/firmware/export/thread.h b/firmware/export/thread.h index 279ea44..0e2ba8e 100644 --- a/firmware/export/thread.h +++ b/firmware/export/thread.h @@ -105,8 +105,11 @@ struct thread_entry { unsigned long statearg; unsigned short stack_size; #ifdef HAVE_PRIORITY_SCHEDULING - unsigned short priority; - unsigned long priority_x; + unsigned char priority; + unsigned char priority_x; +# if NUM_CORES > 1 + unsigned char core; /* To which core threads belongs to. */ +# endif long last_run; #endif struct thread_entry *next, *prev; @@ -116,11 +119,18 @@ struct thread_entry { }; struct core_entry { - struct thread_entry threads[MAXTHREADS]; struct thread_entry *running; struct thread_entry *sleeping; struct thread_entry *waking; struct thread_entry **wakeup_list; +#ifdef HAVE_PRIORITY_SCHEDULING + long highest_priority; +#endif +#if NUM_CORES > 1 + volatile bool lock_issued; + volatile bool kernel_running; +#endif + long last_tick; #ifdef HAVE_EXTENDED_MESSAGING_AND_NAME int switch_to_irq_level; #define STAY_IRQ_LEVEL -1 @@ -171,6 +181,14 @@ struct core_entry { }) #endif +#if NUM_CORES > 1 +inline void lock_cores(void); +inline void unlock_cores(void); +#else +#define lock_cores(...) +#define unlock_cores(...) +#endif + struct thread_entry* create_thread(void (*function)(void), void* stack, int stack_size, const char *name IF_PRIO(, int priority) |