Commit 188429fd by malcolm

mutex create function and threadid

parent 50a1ffb3
Showing with 11 additions and 0 deletions
#include "mutex.h"
mutex mutex_create()
{
mutex m;
m.lock_var=0;
m.value=0;
m.thread_id=0;
return m;
}
uint32_t mutex_lock(mutex m)
{
asm volatile
......
......@@ -7,8 +7,10 @@ typedef struct
{
uint32_t lock_var;
uint32_t value;
uint32_t thread_id;
}__attribute__((packed)) mutex;
mutex mutex_create();
uint32_t mutex_lock(mutex m);
uint32_t mutex_unlock(mutex m);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment