summaryrefslogtreecommitdiff
path: root/firmware/export
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/export')
-rw-r--r--firmware/export/kernel.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/firmware/export/kernel.h b/firmware/export/kernel.h
index 405f6b6838..c7fcd93284 100644
--- a/firmware/export/kernel.h
+++ b/firmware/export/kernel.h
@@ -142,17 +142,19 @@ struct event_queue
142struct mutex 142struct mutex
143{ 143{
144 struct thread_entry *queue; /* waiter list */ 144 struct thread_entry *queue; /* waiter list */
145 int count; /* lock owner recursion count */ 145 int recursion; /* lock owner recursion count */
146#ifdef HAVE_PRIORITY_SCHEDULING 146#ifdef HAVE_PRIORITY_SCHEDULING
147 struct blocker blocker; /* priority inheritance info 147 struct blocker blocker; /* priority inheritance info
148 for waiters */ 148 for waiters */
149 bool no_preempt; /* don't allow higher-priority thread 149 bool no_preempt; /* don't allow higher-priority thread
150 to be scheduled even if woken */ 150 to be scheduled even if woken */
151#else 151#else
152 struct thread_entry *thread; 152 struct thread_entry *thread; /* Indicates owner thread - an owner
153 implies a locked state - same goes
154 for priority scheduling
155 (in blocker struct for that) */
153#endif 156#endif
154 IF_COP( struct corelock cl; ) /* multiprocessor sync */ 157 IF_COP( struct corelock cl; ) /* multiprocessor sync */
155 bool locked; /* locked semaphore */
156}; 158};
157 159
158#ifdef HAVE_SEMAPHORE_OBJECTS 160#ifdef HAVE_SEMAPHORE_OBJECTS
@@ -265,10 +267,17 @@ extern void mutex_init(struct mutex *m);
265extern void mutex_lock(struct mutex *m); 267extern void mutex_lock(struct mutex *m);
266extern void mutex_unlock(struct mutex *m); 268extern void mutex_unlock(struct mutex *m);
267#ifdef HAVE_PRIORITY_SCHEDULING 269#ifdef HAVE_PRIORITY_SCHEDULING
268/* Temporary function to disable mutex preempting a thread on unlock */ 270/* Deprecated temporary function to disable mutex preempting a thread on
271 * unlock - firmware/drivers/fat.c and a couple places in apps/buffering.c -
272 * reliance on it is a bug! */
269static inline void mutex_set_preempt(struct mutex *m, bool preempt) 273static inline void mutex_set_preempt(struct mutex *m, bool preempt)
270 { m->no_preempt = !preempt; } 274 { m->no_preempt = !preempt; }
271#endif 275#else
276/* Deprecated but needed for now - firmware/drivers/ata_mmc.c */
277static inline bool mutex_test(const struct mutex *m)
278 { return m->thread != NULL; }
279#endif /* HAVE_PRIORITY_SCHEDULING */
280
272#ifdef HAVE_SEMAPHORE_OBJECTS 281#ifdef HAVE_SEMAPHORE_OBJECTS
273extern void semaphore_init(struct semaphore *s, int max, int start); 282extern void semaphore_init(struct semaphore *s, int max, int start);
274extern void semaphore_wait(struct semaphore *s); 283extern void semaphore_wait(struct semaphore *s);