summaryrefslogtreecommitdiffstats
path: root/firmware/export/kernel.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/export/kernel.h')
-rw-r--r--firmware/export/kernel.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/firmware/export/kernel.h b/firmware/export/kernel.h
index ec8aa28a08..495e558175 100644
--- a/firmware/export/kernel.h
+++ b/firmware/export/kernel.h
@@ -83,10 +83,14 @@ struct event_queue
#endif
};
+#define MTX_UNOWNED 0x00000000
+#define MTX_BLOCKED_WAITER 0x00000001
+#define MTX_SPIN_WAITER 0x00010001
+#define MTX_SPIN_OWNER 0x00020001
struct mutex
{
+ uint32_t locked;
struct thread_entry *thread;
- bool locked;
};
/* global tick variable */
@@ -126,8 +130,12 @@ extern void queue_remove_from_head(struct event_queue *q, long id);
extern int queue_broadcast(long id, intptr_t data);
extern void mutex_init(struct mutex *m);
+static inline void spinlock_init(struct mutex *m)
+{ mutex_init(m); } /* Same thing for now */
extern void mutex_lock(struct mutex *m);
extern void mutex_unlock(struct mutex *m);
+extern void spinlock_lock(struct mutex *m);
+extern void spinlock_unlock(struct mutex *m);
extern void tick_start(unsigned int interval_in_ms);
#define IS_SYSEVENT(ev) ((ev & SYS_EVENT) == SYS_EVENT)