diff options
Diffstat (limited to 'sys/syscall.h')
| -rw-r--r-- | sys/syscall.h | 32 |
1 files changed, 20 insertions, 12 deletions
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 <stdint.h> -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 |
