diff options
author | Alex AUVOLAT <alexis211@gmail.com> | 2012-05-01 12:20:45 +0200 |
---|---|---|
committer | Alex AUVOLAT <alexis211@gmail.com> | 2012-05-01 12:20:45 +0200 |
commit | 5cac9acd3aedc8043d4272d93c56805c46ff6214 (patch) | |
tree | ba9eb5ef86f7cf7afd4f7ab02de1d6bb86715632 /src/user/lib/include/mutex.h | |
parent | 66b32658d2e5aa99493dcb3abcb73cdb2cc6f0b5 (diff) | |
download | TCE-5cac9acd3aedc8043d4272d93c56805c46ff6214.tar.gz TCE-5cac9acd3aedc8043d4272d93c56805c46ff6214.zip |
Some cleanup ; relocated the kernel at 0xC0000000
Diffstat (limited to 'src/user/lib/include/mutex.h')
-rw-r--r-- | src/user/lib/include/mutex.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/user/lib/include/mutex.h b/src/user/lib/include/mutex.h new file mode 100644 index 0000000..a6b949b --- /dev/null +++ b/src/user/lib/include/mutex.h @@ -0,0 +1,15 @@ +#ifndef DEF_MUTEX_H +#define DEF_MUTEX_H + +#include <tce/syscall.h> + +#define MUTEX_LOCKED 1 +#define MUTEX_UNLOCKED 0 + +//A mutex is just an uint32_t + +void mutex_lock(uint32_t* mutex); //wait for mutex to be free +int mutex_lockE(uint32_t* mutex); //lock mutex only if free, returns !0 if locked, 0 if was busy +void mutex_unlock(uint32_t* mutex); + +#endif |