removed mutex kernel code
parent
76c5c3ba3a
commit
06f8cfd279
@ -1,37 +0,0 @@
|
||||
#include "mutex.h"
|
||||
#include "../kernel.h"
|
||||
|
||||
// mutex lock structure:
|
||||
// this is a dict describing which process instantiated the lock
|
||||
// it maps mutex_id -> pid (or zero for unused locks)
|
||||
int locks[MUTEX_COUNT];
|
||||
int locks_bitfield[MUTEX_COUNT / XLEN]; // each bit representing if the lock is
|
||||
// engaged
|
||||
|
||||
|
||||
int mutex_is_locked(int mutex_id)
|
||||
{
|
||||
int offset = mutex_id % XLEN;
|
||||
|
||||
return locks[mutex_id / XLEN] & (1 << offset);
|
||||
}
|
||||
|
||||
int mutex_create()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void mutex_lock(int mutex_id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void mutex_unlock(int mutex_id)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void mutex_destroy(int mutex_id)
|
||||
{
|
||||
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
#ifndef H_MUTEX
|
||||
#define H_MUTEX
|
||||
|
||||
// mutex operations (modifies data, no checks)
|
||||
int mutex_create();
|
||||
void mutex_lock(int mutex_id);
|
||||
void mutex_unlock(int mutex_id);
|
||||
void mutex_destroy(int mutex_id);
|
||||
// mutex helpers
|
||||
int mutex_is_locked(int mutex_id);
|
||||
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue