Kernel: Define KERNEL_OFFSET for i386 target

This commit is contained in:
Bananymous 2024-03-22 11:22:02 +02:00
parent aa2e53c4f8
commit 7ce0370b6a
1 changed files with 5 additions and 2 deletions

View File

@ -4,12 +4,15 @@
#if ARCH(x86_64)
#define KERNEL_OFFSET 0xFFFFFFFF80000000
#define V2P(vaddr) (((vaddr_t)(vaddr)) - KERNEL_OFFSET)
#define P2V(paddr) (((paddr_t)(paddr)) + KERNEL_OFFSET)
#elif ARCH(i386)
#define KERNEL_OFFSET 0xC0000000
#else
#error
#endif
#define V2P(vaddr) (((vaddr_t)(vaddr)) - KERNEL_OFFSET)
#define P2V(paddr) (((paddr_t)(paddr)) + KERNEL_OFFSET)
#define PAGE_SIZE ((uintptr_t)4096)
#define PAGE_SIZE_SHIFT 12
#define PAGE_ADDR_MASK (~(uintptr_t)0xFFF)