diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /arch/mips/mm/cache.c | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'arch/mips/mm/cache.c')
-rw-r--r-- | arch/mips/mm/cache.c | 59 |
1 files changed, 40 insertions, 19 deletions
diff --git a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c index 694d51f523d1..12af739048fa 100644 --- a/arch/mips/mm/cache.c +++ b/arch/mips/mm/cache.c | |||
@@ -133,29 +133,50 @@ void __update_cache(struct vm_area_struct *vma, unsigned long address, | |||
133 | } | 133 | } |
134 | 134 | ||
135 | unsigned long _page_cachable_default; | 135 | unsigned long _page_cachable_default; |
136 | EXPORT_SYMBOL_GPL(_page_cachable_default); | 136 | EXPORT_SYMBOL(_page_cachable_default); |
137 | 137 | ||
138 | static inline void setup_protection_map(void) | 138 | static inline void setup_protection_map(void) |
139 | { | 139 | { |
140 | protection_map[0] = PAGE_NONE; | 140 | if (kernel_uses_smartmips_rixi) { |
141 | protection_map[1] = PAGE_READONLY; | 141 | protection_map[0] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_EXEC | _PAGE_NO_READ); |
142 | protection_map[2] = PAGE_COPY; | 142 | protection_map[1] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_EXEC); |
143 | protection_map[3] = PAGE_COPY; | 143 | protection_map[2] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_EXEC | _PAGE_NO_READ); |
144 | protection_map[4] = PAGE_READONLY; | 144 | protection_map[3] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_EXEC); |
145 | protection_map[5] = PAGE_READONLY; | 145 | protection_map[4] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_READ); |
146 | protection_map[6] = PAGE_COPY; | 146 | protection_map[5] = __pgprot(_page_cachable_default | _PAGE_PRESENT); |
147 | protection_map[7] = PAGE_COPY; | 147 | protection_map[6] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_READ); |
148 | protection_map[8] = PAGE_NONE; | 148 | protection_map[7] = __pgprot(_page_cachable_default | _PAGE_PRESENT); |
149 | protection_map[9] = PAGE_READONLY; | 149 | |
150 | protection_map[10] = PAGE_SHARED; | 150 | protection_map[8] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_EXEC | _PAGE_NO_READ); |
151 | protection_map[11] = PAGE_SHARED; | 151 | protection_map[9] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_EXEC); |
152 | protection_map[12] = PAGE_READONLY; | 152 | protection_map[10] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_EXEC | _PAGE_WRITE | _PAGE_NO_READ); |
153 | protection_map[13] = PAGE_READONLY; | 153 | protection_map[11] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_EXEC | _PAGE_WRITE); |
154 | protection_map[14] = PAGE_SHARED; | 154 | protection_map[12] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_NO_READ); |
155 | protection_map[15] = PAGE_SHARED; | 155 | protection_map[13] = __pgprot(_page_cachable_default | _PAGE_PRESENT); |
156 | protection_map[14] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_WRITE | _PAGE_NO_READ); | ||
157 | protection_map[15] = __pgprot(_page_cachable_default | _PAGE_PRESENT | _PAGE_WRITE); | ||
158 | |||
159 | } else { | ||
160 | protection_map[0] = PAGE_NONE; | ||
161 | protection_map[1] = PAGE_READONLY; | ||
162 | protection_map[2] = PAGE_COPY; | ||
163 | protection_map[3] = PAGE_COPY; | ||
164 | protection_map[4] = PAGE_READONLY; | ||
165 | protection_map[5] = PAGE_READONLY; | ||
166 | protection_map[6] = PAGE_COPY; | ||
167 | protection_map[7] = PAGE_COPY; | ||
168 | protection_map[8] = PAGE_NONE; | ||
169 | protection_map[9] = PAGE_READONLY; | ||
170 | protection_map[10] = PAGE_SHARED; | ||
171 | protection_map[11] = PAGE_SHARED; | ||
172 | protection_map[12] = PAGE_READONLY; | ||
173 | protection_map[13] = PAGE_READONLY; | ||
174 | protection_map[14] = PAGE_SHARED; | ||
175 | protection_map[15] = PAGE_SHARED; | ||
176 | } | ||
156 | } | 177 | } |
157 | 178 | ||
158 | void __devinit cpu_cache_init(void) | 179 | void __cpuinit cpu_cache_init(void) |
159 | { | 180 | { |
160 | if (cpu_has_3k_cache) { | 181 | if (cpu_has_3k_cache) { |
161 | extern void __weak r3k_cache_init(void); | 182 | extern void __weak r3k_cache_init(void); |
@@ -194,7 +215,7 @@ void __devinit cpu_cache_init(void) | |||
194 | 215 | ||
195 | int __weak __uncached_access(struct file *file, unsigned long addr) | 216 | int __weak __uncached_access(struct file *file, unsigned long addr) |
196 | { | 217 | { |
197 | if (file->f_flags & O_SYNC) | 218 | if (file->f_flags & O_DSYNC) |
198 | return 1; | 219 | return 1; |
199 | 220 | ||
200 | return addr >= __pa(high_memory); | 221 | return addr >= __pa(high_memory); |