Kernel: Define KERNEL_OFFSET for i386 target
This commit is contained in:
parent
aa2e53c4f8
commit
7ce0370b6a
|
@ -4,12 +4,15 @@
|
||||||
|
|
||||||
#if ARCH(x86_64)
|
#if ARCH(x86_64)
|
||||||
#define KERNEL_OFFSET 0xFFFFFFFF80000000
|
#define KERNEL_OFFSET 0xFFFFFFFF80000000
|
||||||
#define V2P(vaddr) (((vaddr_t)(vaddr)) - KERNEL_OFFSET)
|
#elif ARCH(i386)
|
||||||
#define P2V(paddr) (((paddr_t)(paddr)) + KERNEL_OFFSET)
|
#define KERNEL_OFFSET 0xC0000000
|
||||||
#else
|
#else
|
||||||
#error
|
#error
|
||||||
#endif
|
#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 ((uintptr_t)4096)
|
||||||
#define PAGE_SIZE_SHIFT 12
|
#define PAGE_SIZE_SHIFT 12
|
||||||
#define PAGE_ADDR_MASK (~(uintptr_t)0xFFF)
|
#define PAGE_ADDR_MASK (~(uintptr_t)0xFFF)
|
||||||
|
|
Loading…
Reference in New Issue