summaryrefslogtreecommitdiffstats
path: root/arch/x86_64/memory/koentry-ptr.c
diff options
context:
space:
mode:
authorJon Santmyer <jon@jonsantmyer.com>2025-08-29 09:43:09 -0400
committerJon Santmyer <jon@jonsantmyer.com>2025-08-29 09:43:09 -0400
commit8f0ba2fd31408d04175513b8826bf9418ad8b087 (patch)
tree22dc7902bf32f77bfd4ded444c35fa9f219ac9e5 /arch/x86_64/memory/koentry-ptr.c
parent772717dc22e04b4d168d0f77bee6b6357118768c (diff)
downloadjove-kernel-8f0ba2fd31408d04175513b8826bf9418ad8b087.tar.gz
jove-kernel-8f0ba2fd31408d04175513b8826bf9418ad8b087.tar.bz2
jove-kernel-8f0ba2fd31408d04175513b8826bf9418ad8b087.zip
move memory functions to memory folder
Diffstat (limited to 'arch/x86_64/memory/koentry-ptr.c')
-rw-r--r--arch/x86_64/memory/koentry-ptr.c16
1 files changed, 16 insertions, 0 deletions
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 <stdint.h>
+
+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);
+}