summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorAlex AUVOLAT <alexis211@gmail.com>2012-05-04 21:02:43 +0200
committerAlex AUVOLAT <alexis211@gmail.com>2012-05-04 21:02:43 +0200
commit68940415ee0932a68e2c3fb4fe0dc8b711e67d7c (patch)
tree6b5aadd621bd4cd4a00850247d35757709d83893 /src/common
parenta9bb8d1be024730fc4687aab78a8e5cb54b4f05e (diff)
downloadTCE-68940415ee0932a68e2c3fb4fe0dc8b711e67d7c.tar.gz
TCE-68940415ee0932a68e2c3fb4fe0dc8b711e67d7c.zip
Preparations.
Diffstat (limited to 'src/common')
-rw-r--r--src/common/include/sched.h15
-rw-r--r--src/common/include/tce/syscalls.h19
2 files changed, 31 insertions, 3 deletions
diff --git a/src/common/include/sched.h b/src/common/include/sched.h
index 0f8f8f4..1fe148d 100644
--- a/src/common/include/sched.h
+++ b/src/common/include/sched.h
@@ -7,9 +7,18 @@
#define MUTEX_UNLOCKED 0
//A mutex is just an uint32_t
+typedef uint32_t mutex_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);
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int mutex_lock(mutex_t* mutex); //wait for mutex to be free
+int mutex_lockE(mutex_t* mutex); //lock mutex only if free, returns !0 if locked, 0 if was busy
+void mutex_unlock(mutex_t* mutex);
+
+#ifdef __cplusplus
+}
+#endif
#endif
diff --git a/src/common/include/tce/syscalls.h b/src/common/include/tce/syscalls.h
new file mode 100644
index 0000000..3b5b68f
--- /dev/null
+++ b/src/common/include/tce/syscalls.h
@@ -0,0 +1,19 @@
+#ifndef DEF_TCE_SYSCALLS_H
+#define DEF_TCE_SYSCALLS_H
+
+#define SC_THREAD_EXIT 1
+#define SC_SCHEDULE 2
+#define SC_THREAD_SLEEP 3
+#define SC_PROCESS_EXIT 4
+#define SC_PRINTK 5
+#define SC_THREAD_NEW 6
+#define SC_IRQ_WAIT 7
+#define SC_PROC_PRIV 8
+#define SC_SBRK 9
+#define SC_BRK 10
+
+// NOT YET IMPLEMENTED
+#define SC_MMAP 11
+#define SC_MUNMAP 12
+
+#endif