Kernel - Reworked x86 physical memory allocation
[tpg/acess2.git] / Kernel / arch / x86 / include / mm_virt.h
1 /*
2  * Acess2
3  * - Virtual Memory Manager (Header)
4  */
5 #ifndef _MM_VIRT_H
6 #define _MM_VIRT_H
7
8
9 // - Memory Layout
10 #define MM_USER_MIN     0x00200000
11 #define USER_STACK_SZ   0x00020000      // 128 KiB
12 #define USER_STACK_TOP  0x00800000
13 #define USER_LIB_MAX    0xBC000000
14 #define MM_USER_MAX     0xBC000000      // Top load address for user libraries
15 #define MM_PPD_MIN      0xBC000000      // Per-Process Data
16 #define MM_PPD_VFS      0xBC000000      // 
17 #define MM_PPD_CFG      0xBFFFF000      // 
18 #define MM_PPD_MAX      0xC0000000      // 
19
20 #define MM_KHEAP_BASE   0xC0400000      // C+4MiB
21 #define MM_KHEAP_MAX    0xCF000000      //
22 #define MM_KERNEL_VFS   0xCF000000      // 
23 #define MM_KUSER_CODE   0xCFFF0000      // 16 Pages
24 #define MM_MODULE_MIN   0xD0000000      // Lowest Module Address
25 #define MM_MODULE_MAX   0xE0000000      // 128 MiB
26 // Needs (2^36/2^12*8 bytes)
27 // - 2^27 bytes max = 128 MiB = 0x10000000
28 // 2^12/2^3 items per page
29 // - 2^9 = 512
30 #define MM_PAGEINFO_BASE        0xE0000000
31
32 // === FUNCTIONS ===
33 extern void     MM_FinishVirtualInit(void);
34 extern void     MM_SetCR3(Uint CR3);
35 extern tPAddr   MM_Clone(void);
36 extern tVAddr   MM_NewKStack(void);
37 extern tVAddr   MM_NewWorkerStack(void);
38
39 #endif

UCC git Repository :: git.ucc.asn.au