3 #define EXTMEM 0x100000 // Start of extended memory
4 #define PHYSTOP 0xE000000 // Top physical memory
5 #define DEVSPACE 0xFE000000 // Other devices are at high addresses
7 // Key addresses for address space layout (see kmap in vm.c for layout)
8 #define KERNBASE 0x80000000 // First kernel virtual address
9 #define KERNLINK (KERNBASE+EXTMEM) // Address where kernel is linked
13 static inline uint
v2p(void *a
) { return ((uint
) (a
)) - KERNBASE
; }
14 static inline void *p2v(uint a
) { return (void *) ((a
) + KERNBASE
); }
18 #define V2P(a) (((uint) (a)) - KERNBASE)
19 #define P2V(a) (((void *) (a)) + KERNBASE)
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