From cfc1c5c74b9e00c46412a00825eae93bd65c5e94 Mon Sep 17 00:00:00 2001 From: Anton Lydike Date: Mon, 16 Aug 2021 12:57:59 +0200 Subject: [PATCH] removing mutex syscalls --- kinclude/ecall.c | 24 ++---------------------- kinclude/ecall.h | 25 +++++++++++++++---------- 2 files changed, 17 insertions(+), 32 deletions(-) diff --git a/kinclude/ecall.c b/kinclude/ecall.c index a99bd22..348d565 100644 --- a/kinclude/ecall.c +++ b/kinclude/ecall.c @@ -2,7 +2,7 @@ #include "sched.h" #include "csr.h" -void ecall_handle_fork() +void ecall_handle_spawn(void* entry, void* args) { } @@ -12,7 +12,7 @@ void ecall_handle_sleep(int until) } -void ecall_handle_wait(int pid, int timeout) +void ecall_handle_join(int pid, int timeout) { } @@ -27,26 +27,6 @@ void ecall_handle_exit(int status) } -void ecall_handle_m_create() -{ - -} - -void ecall_handle_m_lock(int mutex_id) -{ - -} - -void ecall_handle_m_unlock(int mutex_id) -{ - -} - -void ecall_handle_m_destroy(int mutex_id) -{ - -} - void trap_handle_ecall() { int *regs = get_current_process_registers(); int code = regs[16]; diff --git a/kinclude/ecall.h b/kinclude/ecall.h index a92639c..32fdeef 100644 --- a/kinclude/ecall.h +++ b/kinclude/ecall.h @@ -1,21 +1,26 @@ #ifndef H_ECALL #define H_ECALL +/* ecall codes are defined here + * + * + */ +enum ecall_codes { + ECALL_SPAWN = 1, + ECALL_SLEEP = 2, + ECALL_JOIN = 3, + ECALL_KILL = 4, + ECALL_EXIT = 5, +}; + // syscall handlers, are setup in the mtvec csr -void ecall_handle_fork(); +void ecall_handle_spawn(void* entry, void* args); void ecall_handle_sleep(int until); -void ecall_handle_wait(int pid, int timeout); +void ecall_handle_join(int pid, int timeout); void ecall_handle_kill(int pid); void ecall_handle_exit(int status); -void ecall_handle_m_create(); -void ecall_handle_m_lock(int mutex_id); -void ecall_handle_m_unlock(int mutex_id); -void ecall_handle_m_destroy(int mutex_id); - -void __attribute__((__noreturn__)) trap_handle(int interrupt_bit, int code, int mtval); - - +void __attribute__((__noreturn__)) trap_handle(int interrupt_bit, int code, int mtval); #endif \ No newline at end of file