merge codes
This commit is contained in:
@@ -153,4 +153,9 @@ bool semaphore_wait(int sem_id)
|
||||
bool semaphore_signal(int sem_id)
|
||||
{
|
||||
return syscall(SYSCALL_SEMAPHORE, (intptr_t)SYS_SEM_SIGNAL, (intptr_t)sem_id, 0, 0);
|
||||
}
|
||||
|
||||
int sleep(intptr_t ms)
|
||||
{
|
||||
return syscall(SYSCALL_SLEEP, (intptr_t)ms, 0, 0, 0);
|
||||
}
|
||||
@@ -34,6 +34,7 @@
|
||||
#define SYSCALL_KILL 12 // kill the task by id
|
||||
|
||||
#define SYSCALL_SEMAPHORE 13 // semaphore related operations
|
||||
#define SYSCALL_SLEEP 14 // sleep
|
||||
// clang-format on
|
||||
|
||||
typedef enum {
|
||||
@@ -105,4 +106,6 @@ uintptr_t get_tick();
|
||||
int semaphore_new(int val);
|
||||
bool semaphore_free(int sem_id);
|
||||
bool semaphore_wait(int sem_id);
|
||||
bool semaphore_signal(int sem_id);
|
||||
bool semaphore_signal(int sem_id);
|
||||
|
||||
int sleep(intptr_t ms);
|
||||
Reference in New Issue
Block a user