1
2#ifndef _ASM_POWERPC_BOOK3S_32_MMU_HASH_H_
3#define _ASM_POWERPC_BOOK3S_32_MMU_HASH_H_
4
5
6
7
8
9
10
11
12
13#define BL_128K 0x000
14#define BL_256K 0x001
15#define BL_512K 0x003
16#define BL_1M 0x007
17#define BL_2M 0x00F
18#define BL_4M 0x01F
19#define BL_8M 0x03F
20#define BL_16M 0x07F
21#define BL_32M 0x0FF
22#define BL_64M 0x1FF
23#define BL_128M 0x3FF
24#define BL_256M 0x7FF
25
26
27#define BPP_XX 0x00
28#define BPP_RX 0x01
29#define BPP_RW 0x02
30
31#ifndef __ASSEMBLY__
32
33#ifdef CONFIG_PHYS_64BIT
34#define BAT_PHYS_ADDR(x) ((u32)((x & 0x00000000fffe0000ULL) | \
35 ((x & 0x0000000e00000000ULL) >> 24) | \
36 ((x & 0x0000000100000000ULL) >> 30)))
37#else
38#define BAT_PHYS_ADDR(x) (x)
39#endif
40
41struct ppc_bat {
42 u32 batu;
43 u32 batl;
44};
45#endif
46
47
48
49
50
51
52#define PP_RWXX 0
53#define PP_RWRX 1
54#define PP_RWRW 2
55#define PP_RXRX 3
56
57#ifndef __ASSEMBLY__
58
59
60
61
62
63
64struct hash_pte {
65 unsigned long v:1;
66 unsigned long vsid:24;
67 unsigned long h:1;
68 unsigned long api:6;
69 unsigned long rpn:20;
70 unsigned long xpn:3;
71 unsigned long r:1;
72 unsigned long c:1;
73 unsigned long w:1;
74 unsigned long i:1;
75 unsigned long m:1;
76 unsigned long g:1;
77 unsigned long x:1;
78 unsigned long pp:2;
79};
80
81typedef struct {
82 unsigned long id;
83 unsigned long vdso_base;
84} mm_context_t;
85
86#endif
87
88
89
90
91#define mmu_virtual_psize MMU_PAGE_4K
92#define mmu_linear_psize MMU_PAGE_256M
93
94#endif
95