0
|
1 // Memory layout
|
|
2
|
|
3 // Key addresses for address space layout (see kmap in vm.c for layout)
|
|
4 #define EXTMEM 0x20000
|
|
5 #define KERNBASE 0x80000000 // First kernel virtual address
|
|
6 #define KERNLINK (KERNBASE+EXTMEM) // Address where kernel is linked
|
|
7
|
|
8 // we first map 1MB low memory containing kernel code.
|
|
9 #define INIT_KERNMAP 0x100000
|
|
10
|
|
11 #ifndef __ASSEMBLER__
|
|
12
|
|
13 static inline uint v2p(void *a) { return ((uint) (a)) - KERNBASE; }
|
|
14 static inline void *p2v(uint a) { return (void *) ((a) + KERNBASE); }
|
|
15
|
|
16 #endif
|
|
17
|
|
18 #define V2P(a) (((uint) (a)) - KERNBASE)
|
|
19 #define P2V(a) (((void *) (a)) + KERNBASE)
|
|
20
|
|
21 #define V2P_WO(x) ((x) - KERNBASE) // same as V2P, but without casts
|
|
22 #define P2V_WO(x) ((x) + KERNBASE) // same as V2P, but without casts
|