1 #ifndef __LUNAIX_MM_DEFS_H
2 #define __LUNAIX_MM_DEFS_H
8 #define KSTACK_SIZE (KSTACK_PAGES * MEM_PAGE)
11 Regardless architecture we need to draw the line very carefully, and must
12 take the size of VM into account. In general, we aims to achieve
13 "sufficiently large" of memory for kernel
16 * #768~1022 PTEs of PD (0x00000000c0000000, ~1GiB)
18 In light of upcomming x86_64 support (for Level 4&5 Paging):
19 * #510 entry of PML4 (0x0000ff0000000000, ~512GiB)
20 * #510 entry of PML5 (0x01fe000000000000, ~256TiB)
22 // Where the kernel getting re-mapped.
23 #define KERNEL_RESIDENT 0xc0000000UL
25 // Pages reserved for kernel image
28 #define kernel_addr(addr) ((addr) >= KERNEL_RESIDENT || (addr) < USR_EXEC)
30 #define to_kphysical(k_va) ((ptr_t)(k_va) - KERNEL_RESIDENT)
31 #define to_kvirtual(k_pa) ((ptr_t)(k_pa) - KERNEL_RESIDENT)
33 #endif /* __LUNAIX_MM_DEFS_H */