summaryrefslogtreecommitdiff
path: root/firmware/kernel/include/thread.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/kernel/include/thread.h')
-rw-r--r--firmware/kernel/include/thread.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/firmware/kernel/include/thread.h b/firmware/kernel/include/thread.h
index 5a8bff0107..dfb632785e 100644
--- a/firmware/kernel/include/thread.h
+++ b/firmware/kernel/include/thread.h
@@ -26,6 +26,7 @@
26#include <stdbool.h> 26#include <stdbool.h>
27#include "config.h" 27#include "config.h"
28#include "gcc_extensions.h" 28#include "gcc_extensions.h"
29#include "linked_list.h"
29#include "bitarray.h" 30#include "bitarray.h"
30#include "corelock.h" 31#include "corelock.h"
31 32
@@ -52,7 +53,7 @@
52#define PRIORITY_REALTIME_4 4 53#define PRIORITY_REALTIME_4 4
53#define PRIORITY_REALTIME 4 /* Lowest realtime range */ 54#define PRIORITY_REALTIME 4 /* Lowest realtime range */
54#define PRIORITY_BUFFERING 15 /* Codec buffering thread */ 55#define PRIORITY_BUFFERING 15 /* Codec buffering thread */
55#define PRIORITY_USER_INTERFACE 16 /* The main thread */ 56#define PRIORITY_USER_INTERFACE 16 /* For most UI thrads */
56#define PRIORITY_RECORDING 16 /* Recording thread */ 57#define PRIORITY_RECORDING 16 /* Recording thread */
57#define PRIORITY_PLAYBACK 16 /* Variable between this and MAX */ 58#define PRIORITY_PLAYBACK 16 /* Variable between this and MAX */
58#define PRIORITY_PLAYBACK_MAX 5 /* Maximum allowable playback priority */ 59#define PRIORITY_PLAYBACK_MAX 5 /* Maximum allowable playback priority */
@@ -61,6 +62,7 @@
61#define NUM_PRIORITIES 32 62#define NUM_PRIORITIES 32
62#define PRIORITY_IDLE 32 /* Priority representative of no tasks */ 63#define PRIORITY_IDLE 32 /* Priority representative of no tasks */
63 64
65#define PRIORITY_MAIN_THREAD PRIORITY_USER_INTERFACE
64#define IO_PRIORITY_IMMEDIATE 0 66#define IO_PRIORITY_IMMEDIATE 0
65#define IO_PRIORITY_BACKGROUND 32 67#define IO_PRIORITY_BACKGROUND 32
66 68
@@ -108,6 +110,9 @@ extern unsigned sleep(unsigned ticks);
108#define IFN_PRIO(...) __VA_ARGS__ 110#define IFN_PRIO(...) __VA_ARGS__
109#endif 111#endif
110 112
113#define __wait_queue lld_head
114#define __wait_queue_node lld_node
115
111/* Basic structure describing the owner of an object */ 116/* Basic structure describing the owner of an object */
112struct blocker 117struct blocker
113{ 118{
@@ -168,6 +173,7 @@ int thread_get_priority(unsigned int thread_id);
168void thread_set_io_priority(unsigned int thread_id, int io_priority); 173void thread_set_io_priority(unsigned int thread_id, int io_priority);
169int thread_get_io_priority(unsigned int thread_id); 174int thread_get_io_priority(unsigned int thread_id);
170#endif /* HAVE_IO_PRIORITY */ 175#endif /* HAVE_IO_PRIORITY */
176
171#if NUM_CORES > 1 177#if NUM_CORES > 1
172unsigned int switch_core(unsigned int new_core); 178unsigned int switch_core(unsigned int new_core);
173#endif 179#endif
@@ -186,11 +192,21 @@ int core_get_debug_info(unsigned int core, struct core_debug_info *infop);
186 192
187#endif /* NUM_CORES */ 193#endif /* NUM_CORES */
188 194
195#ifdef HAVE_SDL_THREADS
196#define IF_SDL(x...) x
197#define IFN_SDL(x...)
198#else
199#define IF_SDL(x...)
200#define IFN_SDL(x...) x
201#endif
202
189struct thread_debug_info 203struct thread_debug_info
190{ 204{
191 char statusstr[4]; 205 char statusstr[4];
192 char name[32]; 206 char name[32];
207#ifndef HAVE_SDL_THREADS
193 unsigned int stack_usage; 208 unsigned int stack_usage;
209#endif
194#if NUM_CORES > 1 210#if NUM_CORES > 1
195 unsigned int core; 211 unsigned int core;
196#endif 212#endif