summaryrefslogtreecommitdiff
path: root/firmware/kernel/include/mutex.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/kernel/include/mutex.h')
-rw-r--r--firmware/kernel/include/mutex.h20
1 files changed, 7 insertions, 13 deletions
diff --git a/firmware/kernel/include/mutex.h b/firmware/kernel/include/mutex.h
index bcf5701bd9..02b85f331f 100644
--- a/firmware/kernel/include/mutex.h
+++ b/firmware/kernel/include/mutex.h
@@ -28,20 +28,14 @@
28 28
29struct mutex 29struct mutex
30{ 30{
31 struct thread_entry *queue; /* waiter list */ 31 struct thread_entry *queue; /* waiter list */
32 int recursion; /* lock owner recursion count */ 32 int recursion; /* lock owner recursion count */
33 struct blocker blocker; /* priority inheritance info
34 for waiters and owner*/
35 IF_COP( struct corelock cl; ) /* multiprocessor sync */
33#ifdef HAVE_PRIORITY_SCHEDULING 36#ifdef HAVE_PRIORITY_SCHEDULING
34 struct blocker blocker; /* priority inheritance info 37 bool no_preempt;
35 for waiters */
36 bool no_preempt; /* don't allow higher-priority thread
37 to be scheduled even if woken */
38#else
39 struct thread_entry *thread; /* Indicates owner thread - an owner
40 implies a locked state - same goes
41 for priority scheduling
42 (in blocker struct for that) */
43#endif 38#endif
44 IF_COP( struct corelock cl; ) /* multiprocessor sync */
45}; 39};
46 40
47extern void mutex_init(struct mutex *m); 41extern void mutex_init(struct mutex *m);
@@ -56,7 +50,7 @@ static inline void mutex_set_preempt(struct mutex *m, bool preempt)
56#else 50#else
57/* Deprecated but needed for now - firmware/drivers/ata_mmc.c */ 51/* Deprecated but needed for now - firmware/drivers/ata_mmc.c */
58static inline bool mutex_test(const struct mutex *m) 52static inline bool mutex_test(const struct mutex *m)
59 { return m->thread != NULL; } 53 { return m->blocker.thread != NULL; }
60#endif /* HAVE_PRIORITY_SCHEDULING */ 54#endif /* HAVE_PRIORITY_SCHEDULING */
61 55
62#endif /* MUTEX_H */ 56#endif /* MUTEX_H */