comparison include/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 /*****************************************************************
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 EXTMEM 0x8000 /* start of kernel code */
13 #define PHYSTOP 0xC000000 /* assuming 128M RAM; need a fix to find the true RAM size */
14 #define DEVSPACE 0xFE000000 /* i/o registers */
15
16 // Key addresses for address space layout (see kmap in vm.c for layout)
17 #define KERNBASE 0x80000000 // First kernel virtual address
18 #define KERNLINK (KERNBASE+EXTMEM) // Address where kernel is linked
19 #define USERBOUND 0x40000000 // maximum user space due to one page pgd
20 #define GPUMEMBASE 0x40000000
21 #define GPUMEMSIZE (1024*MBYTE)
22
23 #define PA_START 0x0
24 #define PHYSIO 0x20000000
25 #define RAMSIZE 0xC000000
26 #define IOSIZE (16*MBYTE)
27 #define TVSIZE 0x1000
28
29 static inline uint v2p(void *a) { return ((uint) (a)) - KERNBASE; }
30 static inline void *p2v(uint a) { return (void *) ((a) + KERNBASE); }
31
32 #define V2P(a) (((uint) (a)) - KERNBASE)
33 #define P2V(a) (((void *) (a)) + KERNBASE)
34
35 #define V2P_WO(x) ((x) - KERNBASE) // same as V2P, but without casts
36 #define P2V_WO(x) ((x) + KERNBASE) // same as V2P, but without casts
37