From 866a6ca0e749f4446b7fdc7579a6d553df85ec10 Mon Sep 17 00:00:00 2001 From: Christian Cunningham Date: Wed, 5 Jan 2022 14:27:09 -0800 Subject: Moved includes to its own directory --- include/util/mutex.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 include/util/mutex.h (limited to 'include/util/mutex.h') diff --git a/include/util/mutex.h b/include/util/mutex.h new file mode 100644 index 0000000..524a461 --- /dev/null +++ b/include/util/mutex.h @@ -0,0 +1,17 @@ +#ifndef UTIL_MUTEX_H +#define UTIL_MUTEX_H + +#define NULL_PID 0 +#define SYS_PID 1 +#define SCHED_PID 2 + +struct Mutex { + void* addr; + unsigned long pid; +} __attribute__((packed, aligned(4)));; + +unsigned char lock_mutex(struct Mutex*, unsigned long); +unsigned char release_mutex(struct Mutex*, unsigned long); +struct Mutex* create_mutex(void* addr); + +#endif -- cgit v1.2.1