From 8f0ba2fd31408d04175513b8826bf9418ad8b087 Mon Sep 17 00:00:00 2001 From: Jon Santmyer Date: Fri, 29 Aug 2025 09:43:09 -0400 Subject: move memory functions to memory folder --- arch/x86_64/memory/koentry-ptr.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 arch/x86_64/memory/koentry-ptr.c (limited to 'arch/x86_64/memory/koentry-ptr.c') diff --git a/arch/x86_64/memory/koentry-ptr.c b/arch/x86_64/memory/koentry-ptr.c new file mode 100644 index 0000000..b32d4e7 --- /dev/null +++ b/arch/x86_64/memory/koentry-ptr.c @@ -0,0 +1,16 @@ +#include "memory.h" +#include "arch/x86_64/page.h" +#include + +void* +ko_entry_data(objdir_entry_t *entry) +{ + if((intmax_t)entry->data < 0) return (void*)entry->data; + return vmem_phys_tovirt(entry->data); +} + +uintptr_t +ko_data_toentry(uintptr_t vptr) +{ + return vmem_ident_tophys((void*)vptr); +} -- cgit v1.2.1