summaryrefslogtreecommitdiffstats
path: root/arch/x86_64/hal
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86_64/hal')
-rw-r--r--arch/x86_64/hal/obj.c2
-rw-r--r--arch/x86_64/hal/paging.c8
2 files changed, 9 insertions, 1 deletions
diff --git a/arch/x86_64/hal/obj.c b/arch/x86_64/hal/obj.c
index 75cb0c0..110351c 100644
--- a/arch/x86_64/hal/obj.c
+++ b/arch/x86_64/hal/obj.c
@@ -1,5 +1,5 @@
#include "obj.h"
-#include "arch/x86_64/lock.h"
+#include "sys/lock.h"
#include "lib/printf.h"
#include "paging.h"
#include "hal/obj.h"
diff --git a/arch/x86_64/hal/paging.c b/arch/x86_64/hal/paging.c
index a0d6ca9..1587c62 100644
--- a/arch/x86_64/hal/paging.c
+++ b/arch/x86_64/hal/paging.c
@@ -28,6 +28,14 @@ phys_tovirt(uintptr_t phys)
return (void*)(phys | IDENT_VIRT_BASE);
}
+physaddr_t
+phys_fromvirt(virtaddr_t virt)
+{
+ if(virt < IDENT_VIRT_BASE) return 0;
+ if(virt > KERNEL_VIRT_BASE) return KPTR_TOPHYS(virt);
+ return virt & ~IDENT_VIRT_BASE;
+}
+
uintptr_t
paging_get_pml4(void)
{