summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-11-17 00:47:10 -0500
committerIan Moffett <ian@osmora.org>2025-11-17 00:47:10 -0500
commit7eab317b51fd60682c5700d08df5dc76e2a462d1 (patch)
tree845e59804feec89cecbaf930265ef8bf6307d0df /sys
parent8bf5d4e496a320d37cd03ed6cd0516acb187720d (diff)
kern: vm: Add KERN_BASE macro for HHDM
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys')
-rw-r--r--sys/inc/vm/vm.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/inc/vm/vm.h b/sys/inc/vm/vm.h
index 4134005..daf865f 100644
--- a/sys/inc/vm/vm.h
+++ b/sys/inc/vm/vm.h
@@ -37,8 +37,9 @@
extern volatile struct limine_hhdm_request hhdm_req;
#define PAGESIZE 0x1000
-#define PHYS_TO_VIRT(PHYS) PTR_OFFSET(PHYS, hhdm_req.response->offset)
-#define VIRT_TO_PHYS(VIRT) (uintptr_t)PTR_NOFFET(VIRT, hhdm_req.response->offset)
+#define KERN_BASE hhdm_req.response->offset
+#define PHYS_TO_VIRT(PHYS) PTR_OFFSET(PHYS, KERN_BASE)
+#define VIRT_TO_PHYS(VIRT) (uintptr_t)PTR_NOFFET(VIRT, KERN_BASE)
/*
* Initialize the virtual memory management