summaryrefslogtreecommitdiffstats
path: root/syscall/invoke-untyped.c
diff options
context:
space:
mode:
authorJon Santmyer <jon@jonsantmyer.com>2025-09-04 12:01:44 -0400
committerJon Santmyer <jon@jonsantmyer.com>2025-09-04 12:01:44 -0400
commit032a7bc4d79efea100a00cf3464bea3249a07ff6 (patch)
treedab1be8053ac540e4163ffbff850fefa4f22171f /syscall/invoke-untyped.c
parentd26eb8b54969e79d933a8e20f2725343cd42deab (diff)
downloadjove-kernel-032a7bc4d79efea100a00cf3464bea3249a07ff6.tar.gz
jove-kernel-032a7bc4d79efea100a00cf3464bea3249a07ff6.tar.bz2
jove-kernel-032a7bc4d79efea100a00cf3464bea3249a07ff6.zip
syscall message unmaps upon invokemain
Diffstat (limited to 'syscall/invoke-untyped.c')
-rw-r--r--syscall/invoke-untyped.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/syscall/invoke-untyped.c b/syscall/invoke-untyped.c
index fe34ce9..a89306e 100644
--- a/syscall/invoke-untyped.c
+++ b/syscall/invoke-untyped.c
@@ -1,4 +1,5 @@
#include "handles.h"
+#include "object.h"
#include "syscall.h"
#include "error.h"
#include "memory.h"
@@ -69,7 +70,7 @@ s_handle_invoke_untyped_split(
};
size_t *split = ko_entry_data(dest_entry);
- *untyped -= dest_bytes;
+*untyped -= dest_bytes;
*split = dest_bytes;
#ifdef DBG_SYSCALL
@@ -80,11 +81,29 @@ s_handle_invoke_untyped_split(
return 0;
}
+static int
+s_handle_invoke_untyped_retype(
+ objdir_t *root_dir,
+ objdir_entry_t *target,
+ uint8_t *payload,
+ size_t payload_at
+ )
+{
+ obj_type_t retype;
+ SYSCALL_PAYLOAD_TAKEL(payload, payload_at, retype, obj_type_t);
+
+ switch(retype) {
+ case KO_OBJECT_DIRECTORY:
+ return ko_untyped_retype_objdir(target);
+ default: return KE_BADTYPE;
+ }
+}
+
static int (*s_invoke_handles[])(objdir_t*, objdir_entry_t*, uint8_t*, size_t) = {
[INVOKE_UNTYPED_SIZE] = s_handle_invoke_untyped_size,
[INVOKE_UNTYPED_SPLIT] = s_handle_invoke_untyped_split,
-
- [INVOKE_UNTYPED_ALIGNMENT] = s_handle_invoke_untyped_alignment
+ [INVOKE_UNTYPED_ALIGNMENT] = s_handle_invoke_untyped_alignment,
+ [INVOKE_UNTYPED_RETYPE] = s_handle_invoke_untyped_retype,
};
static size_t s_invoke_handles_count = sizeof(s_invoke_handles) / sizeof(void*);