This source file includes following definitions.
- local_flush_tlb_all
- local_flush_tlb_mm
- local_flush_tlb_page
- local_flush_tlb_kernel_page
- flush_pmd_entry
- clean_pmd_entry
1
2
3
4
5
6
7
8
9 #ifndef __UNICORE_TLBFLUSH_H__
10 #define __UNICORE_TLBFLUSH_H__
11
12 #ifndef __ASSEMBLY__
13
14 #include <linux/sched.h>
15
16 extern void __cpu_flush_user_tlb_range(unsigned long, unsigned long,
17 struct vm_area_struct *);
18 extern void __cpu_flush_kern_tlb_range(unsigned long, unsigned long);
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63 static inline void local_flush_tlb_all(void)
64 {
65 const int zero = 0;
66
67
68 asm("movc p0.c6, %0, #6; nop; nop; nop; nop; nop; nop; nop; nop"
69 : : "r" (zero) : "cc");
70 }
71
72 static inline void local_flush_tlb_mm(struct mm_struct *mm)
73 {
74 const int zero = 0;
75
76 if (cpumask_test_cpu(get_cpu(), mm_cpumask(mm))) {
77
78 asm("movc p0.c6, %0, #6; nop; nop; nop; nop; nop; nop; nop; nop"
79 : : "r" (zero) : "cc");
80 }
81 put_cpu();
82 }
83
84 static inline void
85 local_flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr)
86 {
87 if (cpumask_test_cpu(smp_processor_id(), mm_cpumask(vma->vm_mm))) {
88 #ifndef CONFIG_CPU_TLB_SINGLE_ENTRY_DISABLE
89
90 asm("movc p0.c6, %0, #5; nop; nop; nop; nop; nop; nop; nop; nop"
91 : : "r" (uaddr & PAGE_MASK) : "cc");
92
93 asm("movc p0.c6, %0, #3; nop; nop; nop; nop; nop; nop; nop; nop"
94 : : "r" (uaddr & PAGE_MASK) : "cc");
95 #else
96
97 asm("movc p0.c6, %0, #6; nop; nop; nop; nop; nop; nop; nop; nop"
98 : : "r" (uaddr & PAGE_MASK) : "cc");
99 #endif
100 }
101 }
102
103 static inline void local_flush_tlb_kernel_page(unsigned long kaddr)
104 {
105 #ifndef CONFIG_CPU_TLB_SINGLE_ENTRY_DISABLE
106
107 asm("movc p0.c6, %0, #5; nop; nop; nop; nop; nop; nop; nop; nop"
108 : : "r" (kaddr & PAGE_MASK) : "cc");
109
110 asm("movc p0.c6, %0, #3; nop; nop; nop; nop; nop; nop; nop; nop"
111 : : "r" (kaddr & PAGE_MASK) : "cc");
112 #else
113
114 asm("movc p0.c6, %0, #6; nop; nop; nop; nop; nop; nop; nop; nop"
115 : : "r" (kaddr & PAGE_MASK) : "cc");
116 #endif
117 }
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132 static inline void flush_pmd_entry(pmd_t *pmd)
133 {
134 #ifndef CONFIG_CPU_DCACHE_LINE_DISABLE
135
136 asm("mov r1, %0 << #20\n"
137 "ldw r2, =_stext\n"
138 "add r2, r2, r1 >> #20\n"
139 "ldw r1, [r2+], #0x0000\n"
140 "ldw r1, [r2+], #0x1000\n"
141 "ldw r1, [r2+], #0x2000\n"
142 "ldw r1, [r2+], #0x3000\n"
143 : : "r" (pmd) : "r1", "r2");
144 #else
145
146 asm("movc p0.c5, %0, #14; nop; nop; nop; nop; nop; nop; nop; nop"
147 : : "r" (pmd) : "cc");
148 #endif
149 }
150
151 static inline void clean_pmd_entry(pmd_t *pmd)
152 {
153 #ifndef CONFIG_CPU_DCACHE_LINE_DISABLE
154
155 asm("movc p0.c5, %0, #11; nop; nop; nop; nop; nop; nop; nop; nop"
156 : : "r" (__pa(pmd) & ~(L1_CACHE_BYTES - 1)) : "cc");
157 #else
158
159 asm("movc p0.c5, %0, #10; nop; nop; nop; nop; nop; nop; nop; nop"
160 : : "r" (pmd) : "cc");
161 #endif
162 }
163
164
165
166
167 #define local_flush_tlb_range(vma, start, end) \
168 __cpu_flush_user_tlb_range(start, end, vma)
169 #define local_flush_tlb_kernel_range(s, e) \
170 __cpu_flush_kern_tlb_range(s, e)
171
172 #define flush_tlb_all local_flush_tlb_all
173 #define flush_tlb_mm local_flush_tlb_mm
174 #define flush_tlb_page local_flush_tlb_page
175 #define flush_tlb_kernel_page local_flush_tlb_kernel_page
176 #define flush_tlb_range local_flush_tlb_range
177 #define flush_tlb_kernel_range local_flush_tlb_kernel_range
178
179
180
181
182
183
184 extern void update_mmu_cache(struct vm_area_struct *vma,
185 unsigned long addr, pte_t *ptep);
186
187 extern void do_bad_area(unsigned long addr, unsigned int fsr,
188 struct pt_regs *regs);
189
190 #endif
191
192 #endif