1
2
3
4
5
6 #ifndef __ASM_SN_MAPPED_KERNEL_H
7 #define __ASM_SN_MAPPED_KERNEL_H
8
9 #include <linux/mmzone.h>
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 #include <asm/addrspace.h>
27
28 #define REP_BASE CAC_BASE
29
30 #ifdef CONFIG_MAPPED_KERNEL
31
32 #define MAPPED_ADDR_RO_TO_PHYS(x) (x - REP_BASE)
33 #define MAPPED_ADDR_RW_TO_PHYS(x) (x - REP_BASE - 16777216)
34
35 #define MAPPED_KERN_RO_PHYSBASE(n) (hub_data(n)->kern_vars.kv_ro_baseaddr)
36 #define MAPPED_KERN_RW_PHYSBASE(n) (hub_data(n)->kern_vars.kv_rw_baseaddr)
37
38 #define MAPPED_KERN_RO_TO_PHYS(x) \
39 ((unsigned long)MAPPED_ADDR_RO_TO_PHYS(x) | \
40 MAPPED_KERN_RO_PHYSBASE(get_compact_nodeid()))
41 #define MAPPED_KERN_RW_TO_PHYS(x) \
42 ((unsigned long)MAPPED_ADDR_RW_TO_PHYS(x) | \
43 MAPPED_KERN_RW_PHYSBASE(get_compact_nodeid()))
44
45 #else
46
47 #define MAPPED_KERN_RO_TO_PHYS(x) (x - REP_BASE)
48 #define MAPPED_KERN_RW_TO_PHYS(x) (x - REP_BASE)
49
50 #endif
51
52 #define MAPPED_KERN_RO_TO_K0(x) PHYS_TO_K0(MAPPED_KERN_RO_TO_PHYS(x))
53 #define MAPPED_KERN_RW_TO_K0(x) PHYS_TO_K0(MAPPED_KERN_RW_TO_PHYS(x))
54
55 #endif