Mercurial > hg > Members > mitsuki > xv6_rpi2_port
diff include/memlayout.h @ 0:ed10291ff195
first commit
author | mir3636 |
---|---|
date | Sun, 06 Jan 2019 19:27:03 +0900 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/include/memlayout.h Sun Jan 06 19:27:03 2019 +0900 @@ -0,0 +1,28 @@ +/***************************************************************** +* memlayout.h +* by Zhiyi Huang, hzy@cs.otago.ac.nz +* University of Otago +* +********************************************************************/ + + + +// Memory layout + +#define PHYSTOP (PHYSTART+PHYSIZE) + +#define USERBOUND 0x40000000 // maximum user space due to one page pgd +#define GPUMEMBASE 0x40000000 +#define GPUMEMSIZE (1024*MBYTE) + +#define TVSIZE 0x1000 + +static inline uint v2p(void *a) { return ((uint) (a)) - (KERNBASE-PHYSTART); } +static inline void *p2v(uint a) { return (void *) ((a) + (KERNBASE-PHYSTART)); } + +#define V2P(a) (((uint) (a)) - (KERNBASE-PHYSTART)) +#define P2V(a) (((void *) (a)) + (KERNBASE-PHYSTART)) + +#define V2P_WO(x) ((x) - (KERNBASE-PHYSTART)) // same as V2P, but without casts +#define P2V_WO(x) ((x) + (KERNBASE-PHYSTART)) // same as V2P, but without casts +