comparison include/memlayout.h @ 0:ed10291ff195

first commit
author mir3636
date Sun, 06 Jan 2019 19:27:03 +0900
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:ed10291ff195
1 /*****************************************************************
2 * memlayout.h
3 * by Zhiyi Huang, hzy@cs.otago.ac.nz
4 * University of Otago
5 *
6 ********************************************************************/
7
8
9
10 // Memory layout
11
12 #define PHYSTOP (PHYSTART+PHYSIZE)
13
14 #define USERBOUND 0x40000000 // maximum user space due to one page pgd
15 #define GPUMEMBASE 0x40000000
16 #define GPUMEMSIZE (1024*MBYTE)
17
18 #define TVSIZE 0x1000
19
20 static inline uint v2p(void *a) { return ((uint) (a)) - (KERNBASE-PHYSTART); }
21 static inline void *p2v(uint a) { return (void *) ((a) + (KERNBASE-PHYSTART)); }
22
23 #define V2P(a) (((uint) (a)) - (KERNBASE-PHYSTART))
24 #define P2V(a) (((void *) (a)) + (KERNBASE-PHYSTART))
25
26 #define V2P_WO(x) ((x) - (KERNBASE-PHYSTART)) // same as V2P, but without casts
27 #define P2V_WO(x) ((x) + (KERNBASE-PHYSTART)) // same as V2P, but without casts
28