Decoupling Architectural-specific Code (#35)
[lunaix-os.git] / lunaix-os / arch / generic / includes / sys / mm / mm_defs.h
1 #ifndef __LUNAIX_MM_DEFS_H
2 #define __LUNAIX_MM_DEFS_H
3
4
5 #include "mempart.h"
6 #include "pagetable.h"
7
8 #define KSTACK_PAGES            3
9 #define KSTACK_SIZE             (KSTACK_PAGES * MEM_PAGE)
10
11 /*
12     Regardless architecture we need to draw the line very carefully, and must 
13     take the size of VM into account. In general, we aims to achieve 
14     "sufficiently large" of memory for kernel
15
16     In terms of x86_32:
17         * #768~1022 PTEs of PD      (0x00000000c0000000, ~1GiB)
18     
19     In light of upcomming x86_64 support (for Level 4&5 Paging):
20         * #510 entry of PML4        (0x0000ff0000000000, ~512GiB)
21         * #510 entry of PML5        (0x01fe000000000000, ~256TiB)
22 */
23 // Where the kernel getting re-mapped.
24 #define KERNEL_RESIDENT         0x0
25
26 // Pages reserved for kernel image
27 #define KEXEC_RSVD              16
28
29 #define kernel_addr(addr)       (addr)
30
31 #define to_kphysical(k_va)      ((ptr_t)(k_va))
32 #define to_kvirtual(k_pa)       ((ptr_t)(k_pa))
33
34 #endif /* __LUNAIX_MM_DEFS_H */