merge codes

This commit is contained in:
xj
2024-08-25 20:10:52 -07:00
parent 21f454fd87
commit 93ad360a1a
9 changed files with 47 additions and 2 deletions
@@ -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);