diff options
Diffstat (limited to 'src/common/include')
-rw-r--r-- | src/common/include/sched.h | 15 | ||||
-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 |