From 772717dc22e04b4d168d0f77bee6b6357118768c Mon Sep 17 00:00:00 2001 From: Jon Santmyer Date: Tue, 19 Aug 2025 15:03:42 -0400 Subject: refactor KO_MEMORY_MAPPING invoke --- include/arch/x86_64/idt.h | 2 +- include/arch/x86_64/object.h | 3 +++ include/arch/x86_64/page-mapping.h | 8 ++++++++ include/arch/x86_64/syscall.h | 10 ++++------ 4 files changed, 16 insertions(+), 7 deletions(-) create mode 100644 include/arch/x86_64/page-mapping.h (limited to 'include/arch') diff --git a/include/arch/x86_64/idt.h b/include/arch/x86_64/idt.h index ca1c484..4ca820f 100644 --- a/include/arch/x86_64/idt.h +++ b/include/arch/x86_64/idt.h @@ -7,8 +7,8 @@ typedef struct jove_IVTState { uint64_t r15, r14, r13, r12, r11, r10, r9, r8; uint64_t rbp, rdi, rsi, rdx, rcx, rbx, rax; - uint64_t rip, cs, rflags, rsp, ss; uint64_t num, err; + uint64_t rip, cs, rflags, rsp, ss; } ivt_state_t; void kpanic_state(ivt_state_t *state, const char *fmt, ...); diff --git a/include/arch/x86_64/object.h b/include/arch/x86_64/object.h index e13a987..77b07ea 100644 --- a/include/arch/x86_64/object.h +++ b/include/arch/x86_64/object.h @@ -13,6 +13,9 @@ typedef struct jove_ThreadControlBlock uintptr_t sp, ksp; void *pml4; void *mailbox; + + /* PML caching for faster calls?*/ + uint8_t kstack[KERNEL_STACKBYTES]; } tcb_t; diff --git a/include/arch/x86_64/page-mapping.h b/include/arch/x86_64/page-mapping.h new file mode 100644 index 0000000..bc495dd --- /dev/null +++ b/include/arch/x86_64/page-mapping.h @@ -0,0 +1,8 @@ +#ifndef _JOVE_ARCH_x86_64_PAGE_MAPPING_H +#define _JOVE_ARCH_x86_64_PAGE_MAPPING_H 1 + +#include "arch/x86_64/page.h" + +pmle_t *page_mapping_traverse(pmle_t *pml4, uint8_t depth, uint16_t *path); + +#endif diff --git a/include/arch/x86_64/syscall.h b/include/arch/x86_64/syscall.h index 2d5060e..e470537 100644 --- a/include/arch/x86_64/syscall.h +++ b/include/arch/x86_64/syscall.h @@ -4,13 +4,11 @@ /**@ENUM mapping invokes*/ enum { - /*[target path][u8 funcid]*/ - INVOKE_MAPPING_RELEASE = 0, - /*[target path][u8 funcid][u16 pmli][dest path]*/ - INVOKE_MAPPING_GET, - /*[target path][u8 funcid][u16 pmli][untyped path][u64 flags]*/ + /*[target path][u8 funcid][u8 depth][u16*depth pmli]*/ + INVOKE_MAPPING_EXISTS = 0, + /*[target path][u8 funcid][u8 depth][u16*depth pmli][untyped path][u64 flags]*/ INVOKE_MAPPING_MAP, - /*[target path][u8 funcid][u16 pmli][mapped path]*/ + /*[target path][u8 funcid][u8 depth][u16*depth pmli][dest path]*/ INVOKE_MAPPING_UNMAP }; -- cgit v1.2.1