summaryrefslogtreecommitdiffstats
path: root/lib/libjove/syscall/invoke-objdir.c
diff options
context:
space:
mode:
authorJon Santmyer <jon@jonsantmyer.com>2025-08-10 15:46:33 -0400
committerJon Santmyer <jon@jonsantmyer.com>2025-08-10 15:46:33 -0400
commit65ba015d6c1f248d36ad01a653bc49637804b15b (patch)
treea77c3fb3ca7ecac8f65eb9638d152f1e90307d0a /lib/libjove/syscall/invoke-objdir.c
downloadjove-os-65ba015d6c1f248d36ad01a653bc49637804b15b.tar.gz
jove-os-65ba015d6c1f248d36ad01a653bc49637804b15b.tar.bz2
jove-os-65ba015d6c1f248d36ad01a653bc49637804b15b.zip
working usermode objdir iteration
Diffstat (limited to 'lib/libjove/syscall/invoke-objdir.c')
-rw-r--r--lib/libjove/syscall/invoke-objdir.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/lib/libjove/syscall/invoke-objdir.c b/lib/libjove/syscall/invoke-objdir.c
new file mode 100644
index 0000000..462c282
--- /dev/null
+++ b/lib/libjove/syscall/invoke-objdir.c
@@ -0,0 +1,39 @@
+#include <jove.h>
+#include <object.h>
+#include <path-fromobj.h>
+#include <syscall.h>
+#include <kernel/syscall.h>
+
+int
+_syscall_invoke_objdir_getmemb(KernelObjectDirectory *dir, uint8_t member, obj_type_t *result)
+{
+ uint8_t *syscallData = _syscall_message_ptr;
+ int syscall_at = 0;
+ obj_type_t *syscall_result;
+
+ SYSCALL_PAYLOAD_PUTOBJ(syscallData, syscall_at, dir);
+ SYSCALL_PAYLOAD_PUTL(syscallData, syscall_at, INVOKE_OBJDIR_GETMEMB, uint8_t);
+ SYSCALL_PAYLOAD_PUTL(syscallData, syscall_at, member, uint8_t);
+ SYSCALL_PAYLOAD_SAVEPTR(syscallData, syscall_at, obj_type_t, syscall_result);
+
+ int status = _syscall_invoke();
+ *result = *syscall_result;
+ return status;
+}
+
+int
+_syscall_invoke_objdir_nmemb(KernelObjectDirectory *dir, uint8_t *result)
+{
+ uint8_t *syscallData = _syscall_message_ptr;
+ int syscall_at = 0;
+ uint8_t *syscall_result;
+
+ SYSCALL_PAYLOAD_PUTOBJ(syscallData, syscall_at, dir);
+ SYSCALL_PAYLOAD_PUTL(syscallData, syscall_at, INVOKE_OBJDIR_NMEMB, uint8_t);
+ SYSCALL_PAYLOAD_SAVEPTR(syscallData, syscall_at, uint8_t, syscall_result);
+
+ int status = _syscall_invoke();
+ *result = *syscall_result;
+
+ return status;
+}