From 65ba015d6c1f248d36ad01a653bc49637804b15b Mon Sep 17 00:00:00 2001 From: Jon Santmyer Date: Sun, 10 Aug 2025 15:46:33 -0400 Subject: working usermode objdir iteration --- lib/libjove/include/syscall.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 lib/libjove/include/syscall.h (limited to 'lib/libjove/include/syscall.h') diff --git a/lib/libjove/include/syscall.h b/lib/libjove/include/syscall.h new file mode 100644 index 0000000..432be85 --- /dev/null +++ b/lib/libjove/include/syscall.h @@ -0,0 +1,35 @@ +#ifndef _LIBJOVE_SYSCALL_H +#define _LIBJOVE_SYSCALL_H 1 + +#include + +#include +#include + +#define SYSCALL_PAYLOAD_PUTL(buf, at, v, type) \ + if(at + sizeof(type) > KO_MESSAGE_BYTES) return -1; \ + *((type*)(&buf[at])) = v; \ + at += sizeof(type) + +#define SYSCALL_PAYLOAD_SAVEPTR(buf, at, type, val) \ + if(at + sizeof(type) >= KO_MESSAGE_BYTES) return -1; \ + val = (type*)(&buf[at]); \ + at += sizeof(type) + +#define SYSCALL_PAYLOAD_PUTOBJ(buf, at, obj) \ + at = path_tobuf(JOVE_OBJECT_TYPED(obj), buf, at, KO_MESSAGE_BYTES); \ + if(at < 0) return at + + +int _syscall_invoke(void); +void _syscall_debug_putc(char c); + +int _syscall_invoke_objdir_nmemb(KernelObjectDirectory *dir, uint8_t *result); +int _syscall_invoke_objdir_getmemb(KernelObjectDirectory *dir, uint8_t member, obj_type_t *result); + +int _syscall_invoke_untyped_size(KernelObjectUntyped *untyped, size_t *bytes); +int _syscall_invoke_untyped_split(KernelObjectUntyped *path, size_t bytes, KernelObjectUntyped *dest); +int _syscall_invoke_untyped_merge(KernelObjectUntyped *a, KernelObjectUntyped *b); +int _syscall_invoke_untyped_alignment(KernelObjectUntyped *path, size_t *alignment); + +#endif -- cgit v1.2.1