diff options
author | Christian Cunningham <cc@localhost> | 2022-03-12 16:39:39 -0800 |
---|---|---|
committer | Christian Cunningham <cc@localhost> | 2022-03-12 16:39:39 -0800 |
commit | a29f40e073a0308bd74f0f9803a4660aa233c3ab (patch) | |
tree | e607ee7eed39da0e1dcf65c4eb76dd1426899f85 /include/util | |
parent | b62c324bde267a5a940b1d06f44f62a125aef50d (diff) |
"Dynamic" Mutex Allocation
Diffstat (limited to 'include/util')
-rw-r--r-- | include/util/lock.h | 2 | ||||
-rw-r--r-- | include/util/mutex.h | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/include/util/lock.h b/include/util/lock.h index c5b2f7e..da18f81 100644 --- a/include/util/lock.h +++ b/include/util/lock.h @@ -1,8 +1,6 @@ #ifndef UTIL_LOCK_H #define UTIL_LOCK_H -#include <util/mutex.h> - struct Lock { unsigned long pid; } __attribute__((packed, aligned(4))); diff --git a/include/util/mutex.h b/include/util/mutex.h index ab318b4..c0dd17b 100644 --- a/include/util/mutex.h +++ b/include/util/mutex.h @@ -8,6 +8,8 @@ #define CORE3_PID 4 #define FIRST_AVAIL_PID CORE3_PID+1 +#define MAX_MUTEXS 0x100 + // PID field is first so that it can be treated // as a lock struct Mutex { @@ -15,4 +17,7 @@ struct Mutex { void* addr; } __attribute__((packed, aligned(4))); +struct Mutex* create_mutex(void* addr); +unsigned char delete_mutex(struct Mutex* m); + #endif |