summaryrefslogtreecommitdiffstats
path: root/arch/x86_64/syscall/invoke-mapping.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86_64/syscall/invoke-mapping.c')
-rw-r--r--arch/x86_64/syscall/invoke-mapping.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/arch/x86_64/syscall/invoke-mapping.c b/arch/x86_64/syscall/invoke-mapping.c
index 186b420..e470034 100644
--- a/arch/x86_64/syscall/invoke-mapping.c
+++ b/arch/x86_64/syscall/invoke-mapping.c
@@ -1,5 +1,5 @@
#include "arch/x86_64/syscall/wrappers.h"
-#include "arch/x86_64/syscall.h"
+#include "arch/x86_64/api/syscall.h"
#include "arch/x86_64/page.h"
#include <stddef.h>
#include "api/error.h"
@@ -20,7 +20,9 @@ s_handle_invoke_mapping_exists(
pmle_t *target_pml;
uint8_t target_depth;
SYSCALL_PAYLOAD_TAKEPML(payload, payload_at, pml4, target_depth, target_pml);
- if(target_pml == NULL || !target_pml->p) return KE_DNE;
+ if(target_pml == NULL || !target_pml->p) {
+ return KE_DNE;
+ }
#ifdef DBG_SYSCALL
klogf("pml d%i %p from %p exists\n", target_depth, target_pml, pml4);
@@ -46,7 +48,9 @@ s_handle_invoke_mapping_map(
objdir_entry_t *untyped_entry;
SYSCALL_PAYLOAD_TAKEOBJ(payload, payload_at, untyped_pathw, untyped_entry);
- if(untyped_entry->type != KO_MEMORY_UNTYPED) return KE_BADOBJ;
+ if(untyped_entry->type != KO_MEMORY_UNTYPED) {
+ return KE_BADOBJ;
+ }
mtx_acquire(&untyped_entry->lock);
if((untyped_entry->data & 0xFFF) != 0) {
@@ -69,6 +73,7 @@ s_handle_invoke_mapping_map(
memset(untyped, 0, 0x1000);
}
untyped_entry->type = KO_NONE;
+ untyped_entry->data = 0;
#ifdef DBG_SYSCALL
klogf("map %p[%i] to %p[%i]\n", untyped_phys, target_depth, target_pml, ((uintptr_t)target_pml & 0xFFF) / 8);
#endif