summaryrefslogtreecommitdiff
path: root/firmware/export/kernel.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/export/kernel.h')
-rw-r--r--firmware/export/kernel.h15
1 files changed, 5 insertions, 10 deletions
diff --git a/firmware/export/kernel.h b/firmware/export/kernel.h
index 96a7752017..be5041f6c2 100644
--- a/firmware/export/kernel.h
+++ b/firmware/export/kernel.h
@@ -119,18 +119,14 @@ struct mutex
119 unsigned char locked; /* locked semaphore */ 119 unsigned char locked; /* locked semaphore */
120}; 120};
121 121
122#if NUM_CORES > 1
122struct spinlock 123struct spinlock
123{ 124{
124#if NUM_CORES > 1
125 struct corelock cl; /* inter-core sync */ 125 struct corelock cl; /* inter-core sync */
126#endif
127 struct thread_entry *thread; /* lock owner */ 126 struct thread_entry *thread; /* lock owner */
128 int count; /* lock owner recursion count */ 127 int count; /* lock owner recursion count */
129 unsigned char locked; /* is locked if nonzero */
130#if NUM_CORES > 1
131 unsigned char task_switch; /* can task switch? */
132#endif
133}; 128};
129#endif
134 130
135#ifdef HAVE_SEMAPHORE_OBJECTS 131#ifdef HAVE_SEMAPHORE_OBJECTS
136struct semaphore 132struct semaphore
@@ -229,12 +225,11 @@ extern int queue_broadcast(long id, intptr_t data);
229extern void mutex_init(struct mutex *m); 225extern void mutex_init(struct mutex *m);
230extern void mutex_lock(struct mutex *m); 226extern void mutex_lock(struct mutex *m);
231extern void mutex_unlock(struct mutex *m); 227extern void mutex_unlock(struct mutex *m);
232#define SPINLOCK_TASK_SWITCH 0x10 228#if NUM_CORES > 1
233#define SPINLOCK_NO_TASK_SWITCH 0x00 229extern void spinlock_init(struct spinlock *l);
234extern void spinlock_init(struct spinlock *l IF_COP(, unsigned int flags));
235extern void spinlock_lock(struct spinlock *l); 230extern void spinlock_lock(struct spinlock *l);
236extern void spinlock_unlock(struct spinlock *l); 231extern void spinlock_unlock(struct spinlock *l);
237extern int spinlock_lock_w_tmo(struct spinlock *l, int ticks); 232#endif
238#ifdef HAVE_SEMAPHORE_OBJECTS 233#ifdef HAVE_SEMAPHORE_OBJECTS
239extern void semaphore_init(struct semaphore *s, int max, int start); 234extern void semaphore_init(struct semaphore *s, int max, int start);
240extern void semaphore_wait(struct semaphore *s); 235extern void semaphore_wait(struct semaphore *s);