1 // Memory layout 2 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 6 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 10 11 #define V2P(a) (((uint) (a)) - KERNBASE) 12 #define P2V(a) ((void *)(((char *) (a)) + KERNBASE)) 13 14 #define V2P_WO(x) ((x) - KERNBASE) // same as V2P, but without casts 15 #define P2V_WO(x) ((x) + KERNBASE) // same as P2V, but without casts