diff options
author | Jon Santmyer <jon@jonsantmyer.com> | 2025-09-26 13:17:41 -0400 |
---|---|---|
committer | Jon Santmyer <jon@jonsantmyer.com> | 2025-09-26 13:17:41 -0400 |
commit | 2dadbfc899df4179ca70c4ea04f74a5e190c2ae7 (patch) | |
tree | b166aaa9af42406cd07fbaf150f93aefeb2fbe33 /arch/x86_64/syscall/invoke-mapping.c | |
parent | ddc4fbc15223e362896a9f42beca73f05f48e664 (diff) | |
download | jove-kernel-2dadbfc899df4179ca70c4ea04f74a5e190c2ae7.tar.gz jove-kernel-2dadbfc899df4179ca70c4ea04f74a5e190c2ae7.tar.bz2 jove-kernel-2dadbfc899df4179ca70c4ea04f74a5e190c2ae7.zip |
fix usermode interrupts. add ability to define custom interrupt handlersmain
Diffstat (limited to 'arch/x86_64/syscall/invoke-mapping.c')
-rw-r--r-- | arch/x86_64/syscall/invoke-mapping.c | 11 |
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 |