summaryrefslogtreecommitdiff
path: root/src/common/include
diff options
context:
space:
mode:
authorAlex AUVOLAT <alexis211@gmail.com>2012-05-01 17:42:36 +0200
committerAlex AUVOLAT <alexis211@gmail.com>2012-05-01 17:42:36 +0200
commite9683297bf480f9590b0e5796f4520fb430e2e03 (patch)
tree93ef75cd154edf4c342d0a22cd56eb3670feb2b5 /src/common/include
parente8cf65c07d78e3cfbac953b1b97c51998a5900df (diff)
downloadTCE-e9683297bf480f9590b0e5796f4520fb430e2e03.tar.gz
TCE-e9683297bf480f9590b0e5796f4520fb430e2e03.zip
Now using Doug Lea's malloc for userland too. And improved stability.
Diffstat (limited to 'src/common/include')
-rw-r--r--src/common/include/sched.h15
-rw-r--r--src/common/include/stdlib_common.h (renamed from src/common/include/stdlib.h)2
2 files changed, 16 insertions, 1 deletions
diff --git a/src/common/include/sched.h b/src/common/include/sched.h
new file mode 100644
index 0000000..0f8f8f4
--- /dev/null
+++ b/src/common/include/sched.h
@@ -0,0 +1,15 @@
+#ifndef DEF_MUTEX_H
+#define DEF_MUTEX_H
+
+#include <types.h>
+
+#define MUTEX_LOCKED 1
+#define MUTEX_UNLOCKED 0
+
+//A mutex is just an uint32_t
+
+int 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
diff --git a/src/common/include/stdlib.h b/src/common/include/stdlib_common.h
index 2c5e6dd..80c188f 100644
--- a/src/common/include/stdlib.h
+++ b/src/common/include/stdlib_common.h
@@ -7,7 +7,7 @@
#define MAX(a, b) ((a) > (b) ? (a) : (b))
void *memcpy(void *dest, const void *src, int count);
-uint8_t *memset(uint8_t *dest, uint8_t val, int count);
+void *memset(void *dest, int val, int count);
uint16_t *memsetw(uint16_t *dest, uint16_t val, int count);
#endif