]> git.buserror.net Git - polintos/scott/priv.git/blob - kernel/include/arch-x86/addrs.h
minor doc updates
[polintos/scott/priv.git] / kernel / include / arch-x86 / addrs.h
1 #ifndef _ARCH_ADDRS_H
2 #define _ARCH_ADDRS_H
3
4 #define PHYSMEM_START 0x80000000
5 #define KERNEL_START PHYSMEM_START
6
7 #ifdef __cplusplus
8 #include <kern/types.h>
9
10 namespace Arch {
11         static inline ulong kvirt_to_phys(void *addr)
12         {
13                 return reinterpret_cast<ulong>(addr) - PHYSMEM_START;
14         }
15
16         static inline void *phys_to_kvirt(ulong addr)
17         {
18                 return reinterpret_cast<void *>(addr + PHYSMEM_START);
19         }
20         
21         namespace Priv {
22                 static const ulong max_ktext_map = 4 * 1024 * 1024;
23         }
24
25         // Allow some room for these regions to grow if needed
26         // (8 pages each should be more than sufficient).
27         static const ulong roshared_map = 0x7fff0000;
28         static const ulong rwshared_map = 0x7fff8000;
29         
30         static const ulong stack_bottom = 0x7f000000;
31         static const ulong stack_top = 0x7ffeffff;
32         static const bool stack_grows_up = false;
33 };
34
35 #endif
36 #endif