From 68940415ee0932a68e2c3fb4fe0dc8b711e67d7c Mon Sep 17 00:00:00 2001 From: Alex AUVOLAT Date: Fri, 4 May 2012 21:02:43 +0200 Subject: Preparations. --- src/common/include/sched.h | 15 ++++++++++++--- src/common/include/tce/syscalls.h | 19 +++++++++++++++++++ 2 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 src/common/include/tce/syscalls.h (limited to 'src/common/include') 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 -- cgit v1.2.3