2011-08-07 18:30:34 +02:00
|
|
|
// Memory layout
|
|
|
|
|
2011-08-16 21:47:22 +02:00
|
|
|
#define EXTMEM 0x100000 // Start of extended memory
|
2011-09-01 16:25:20 +02:00
|
|
|
#define PHYSTOP 0xE000000 // Top physical memory
|
2011-08-16 21:47:22 +02:00
|
|
|
#define DEVSPACE 0xFE000000 // Other devices are at high addresses
|
2011-08-07 18:30:34 +02:00
|
|
|
|
2011-09-01 16:25:20 +02:00
|
|
|
// Key addresses for address space layout (see kmap in vm.c for layout)
|
2011-08-31 15:48:52 +02:00
|
|
|
#define KERNBASE 0x80000000 // First kernel virtual address
|
2011-08-16 21:47:22 +02:00
|
|
|
#define KERNLINK (KERNBASE+EXTMEM) // Address where kernel is linked
|
2011-08-07 18:30:34 +02:00
|
|
|
|
|
|
|
#ifndef __ASSEMBLER__
|
|
|
|
|
|
|
|
static inline uint v2p(void *a) { return (uint) a - KERNBASE; }
|
|
|
|
static inline void *p2v(uint a) { return (void *) a + KERNBASE; }
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define V2P(a) ((uint) a - KERNBASE)
|
|
|
|
#define P2V(a) ((void *) a + KERNBASE)
|
|
|
|
|
2011-08-08 19:30:08 +02:00
|
|
|
#define V2P_WO(x) ((x) - KERNBASE) // same as V2P, but without casts
|
|
|
|
#define P2V_WO(x) ((x) + KERNBASE) // same as V2P, but without casts
|