xv6-riscv-kernel/memlayout.h

16 lines
657 B
C
Raw Normal View History

2011-08-07 12:30:34 -04:00
// Memory layout
#define EXTMEM 0x100000 // Start of extended memory
2011-09-01 10:25:20 -04:00
#define PHYSTOP 0xE000000 // Top physical memory
#define DEVSPACE 0xFE000000 // Other devices are at high addresses
2011-08-07 12:30:34 -04:00
2011-09-01 10:25:20 -04:00
// Key addresses for address space layout (see kmap in vm.c for layout)
2011-08-31 09:48:52 -04:00
#define KERNBASE 0x80000000 // First kernel virtual address
#define KERNLINK (KERNBASE+EXTMEM) // Address where kernel is linked
2011-08-07 12:30:34 -04:00
2011-09-13 12:28:45 -04:00
#define V2P(a) (((uint) (a)) - KERNBASE)
#define P2V(a) (((void *) (a)) + KERNBASE)
2011-08-07 12:30:34 -04:00
#define V2P_WO(x) ((x) - KERNBASE) // same as V2P, but without casts
2015-09-18 23:36:45 +08:00
#define P2V_WO(x) ((x) + KERNBASE) // same as P2V, but without casts