diff --git a/kernel/arch/x86_64/PageTable.cpp b/kernel/arch/x86_64/PageTable.cpp index 88533b8fde..58a4945dc4 100644 --- a/kernel/arch/x86_64/PageTable.cpp +++ b/kernel/arch/x86_64/PageTable.cpp @@ -4,10 +4,6 @@ #include #include -#define KERNEL_OFFSET 0xFFFFFFFF80000000 -#define V2P(vaddr) (((vaddr_t)(vaddr)) - KERNEL_OFFSET) -#define P2V(paddr) (((paddr_t)(paddr)) + KERNEL_OFFSET) - #define CLEANUP_STRUCTURE(s) \ do { \ for (uint64_t i = 0; i < 512; i++) \ diff --git a/kernel/include/kernel/Memory/Types.h b/kernel/include/kernel/Memory/Types.h index 7d9f637e7e..0b5439f38f 100644 --- a/kernel/include/kernel/Memory/Types.h +++ b/kernel/include/kernel/Memory/Types.h @@ -1,5 +1,15 @@ #pragma once +#include + +#if ARCH(x86_64) + #define KERNEL_OFFSET 0xFFFFFFFF80000000 + #define V2P(vaddr) (((vaddr_t)(vaddr)) - KERNEL_OFFSET) + #define P2V(paddr) (((paddr_t)(paddr)) + KERNEL_OFFSET) +#else + #error +#endif + #define PAGE_SIZE 4096 #define PAGE_FLAG_MASK ((uintptr_t)0xFFF) #define PAGE_ADDR_MASK (~PAGE_FLAG_MASK)