Mercurial > hg > Members > innparusu > xv6_rpi_port
comparison uprogs/memlayout.h @ 0:c450faca55f4
Init
author | Tatsuki IHA <innparusu@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 22 Oct 2017 18:25:39 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:c450faca55f4 |
---|---|
1 // Memory layout | |
2 | |
3 #define EXTMEM 0x8000 /* start of kernel code */ | |
4 #define PHYSTOP 0x8000000 /* assuming 128M RAM; need a fix to find the true RAM size */ | |
5 #define DEVSPACE 0xFE000000 /* i/o registers */ | |
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 #define USERBOUND 0x40000000 // maximum user space due to one page pgd | |
11 | |
12 #define MACHADDR (KERNBASE+0x2000) | |
13 #define PA_START 0x0 | |
14 #define PHYSIO 0x20000000 | |
15 #define RAMSIZE (128*MByte) | |
16 #define IOSIZE (16*MByte) | |
17 #define TVSIZE 0x1000 | |
18 | |
19 static inline uint v2p(void *a) { return ((uint) (a)) - KERNBASE; } | |
20 static inline void *p2v(uint a) { return (void *) ((a) + KERNBASE); } | |
21 | |
22 #define V2P(a) (((uint) (a)) - KERNBASE) | |
23 #define P2V(a) (((void *) (a)) + KERNBASE) | |
24 | |
25 #define V2P_WO(x) ((x) - KERNBASE) // same as V2P, but without casts | |
26 #define P2V_WO(x) ((x) + KERNBASE) // same as V2P, but without casts | |
27 |