From df0688efa326a03a22bcbc36d1900926b7b1c986 Mon Sep 17 00:00:00 2001 From: Jon Santmyer Date: Mon, 7 Sep 2026 19:19:24 -0400 Subject: split syscall info into api subfolder. untyped syscalls --- sys/syscall.h | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) (limited to 'sys/syscall.h') diff --git a/sys/syscall.h b/sys/syscall.h index 6ad221f..ea75152 100644 --- a/sys/syscall.h +++ b/sys/syscall.h @@ -1,15 +1,27 @@ #ifndef _JOVE_SYS_SYSCALL_H #define _JOVE_SYS_SYSCALL_H 1 +#include "api/syscall.h" #include "hal/obj.h" #include -struct syscall_header -{ - uint16_t callid; - uint16_t pathlen; - uint16_t path[]; -}; +#define CHECK_TOOSMALL(required, present, fail_msg) \ + do { if(present < required) { \ + kprintf("%s: %s\n", __func__, fail_msg); \ + return ETOOSMALL; \ + } } while(0) + +#define CHECK_OBJEXISTS(obj, fail_msg) \ +do { if(obj == NULL) { \ + kprintf("%s: %s\n", __func__, fail_msg); \ + return EBADOBJ; \ +} } while(0) + +#define CHECK_OBJTYPE(obj, type, fail_msg) \ + do { if(obj_gettype(obj) != type) { \ + kprintf("%s: %s\n", __func__, fail_msg); \ + return EBADOBJ; \ + } } while(0) #define SYSCALL_FUNCTION_ARGS \ jove_owned_obj_t*, /*PCB object*/ \ @@ -25,12 +37,8 @@ typedef int (*syscall_handle_t)(SYSCALL_FUNCTION_ARGS); int _syscall_handle_generic(SYSCALL_FUNCTION_ARGS); int _syscall_handle_arch(SYSCALL_FUNCTION_ARGS); -#define SYSCALL_VTT_WRITE 0 -struct syscall_vtt_write -{ - size_t len; - char data[]; -}; int _syscall_handle_vtt(SYSCALL_FUNCTION_ARGS); +int _syscall_handle_objdir(SYSCALL_FUNCTION_ARGS); +int _syscall_handle_untyped(SYSCALL_FUNCTION_ARGS); #endif -- cgit v1.2.3