diff options
Diffstat (limited to 'include/asm-powerpc/pgtable-ppc64.h')
-rw-r--r-- | include/asm-powerpc/pgtable-ppc64.h | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/include/asm-powerpc/pgtable-ppc64.h b/include/asm-powerpc/pgtable-ppc64.h index cc6a43ba41d0..5fc78c0be302 100644 --- a/include/asm-powerpc/pgtable-ppc64.h +++ b/include/asm-powerpc/pgtable-ppc64.h | |||
@@ -91,9 +91,11 @@ | |||
91 | #define _PAGE_DIRTY 0x0080 /* C: page changed */ | 91 | #define _PAGE_DIRTY 0x0080 /* C: page changed */ |
92 | #define _PAGE_ACCESSED 0x0100 /* R: page referenced */ | 92 | #define _PAGE_ACCESSED 0x0100 /* R: page referenced */ |
93 | #define _PAGE_RW 0x0200 /* software: user write access allowed */ | 93 | #define _PAGE_RW 0x0200 /* software: user write access allowed */ |
94 | #define _PAGE_HASHPTE 0x0400 /* software: pte has an associated HPTE */ | ||
95 | #define _PAGE_BUSY 0x0800 /* software: PTE & hash are busy */ | 94 | #define _PAGE_BUSY 0x0800 /* software: PTE & hash are busy */ |
96 | 95 | ||
96 | /* Strong Access Ordering */ | ||
97 | #define _PAGE_SAO (_PAGE_WRITETHRU | _PAGE_NO_CACHE | _PAGE_COHERENT) | ||
98 | |||
97 | #define _PAGE_BASE (_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_COHERENT) | 99 | #define _PAGE_BASE (_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_COHERENT) |
98 | 100 | ||
99 | #define _PAGE_WRENABLE (_PAGE_RW | _PAGE_DIRTY) | 101 | #define _PAGE_WRENABLE (_PAGE_RW | _PAGE_DIRTY) |
@@ -115,6 +117,10 @@ | |||
115 | #define PAGE_AGP __pgprot(_PAGE_BASE | _PAGE_WRENABLE | _PAGE_NO_CACHE) | 117 | #define PAGE_AGP __pgprot(_PAGE_BASE | _PAGE_WRENABLE | _PAGE_NO_CACHE) |
116 | #define HAVE_PAGE_AGP | 118 | #define HAVE_PAGE_AGP |
117 | 119 | ||
120 | #define PAGE_PROT_BITS __pgprot(_PAGE_GUARDED | _PAGE_COHERENT | \ | ||
121 | _PAGE_NO_CACHE | _PAGE_WRITETHRU | \ | ||
122 | _PAGE_4K_PFN | _PAGE_RW | _PAGE_USER | \ | ||
123 | _PAGE_ACCESSED | _PAGE_DIRTY | _PAGE_EXEC) | ||
118 | /* PTEIDX nibble */ | 124 | /* PTEIDX nibble */ |
119 | #define _PTEIDX_SECONDARY 0x8 | 125 | #define _PTEIDX_SECONDARY 0x8 |
120 | #define _PTEIDX_GROUP_IX 0x7 | 126 | #define _PTEIDX_GROUP_IX 0x7 |
@@ -239,7 +245,7 @@ static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW;} | |||
239 | static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY;} | 245 | static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY;} |
240 | static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED;} | 246 | static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED;} |
241 | static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE;} | 247 | static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE;} |
242 | static inline int pte_special(pte_t pte) { return 0; } | 248 | static inline int pte_special(pte_t pte) { return pte_val(pte) & _PAGE_SPECIAL; } |
243 | 249 | ||
244 | static inline void pte_uncache(pte_t pte) { pte_val(pte) |= _PAGE_NO_CACHE; } | 250 | static inline void pte_uncache(pte_t pte) { pte_val(pte) |= _PAGE_NO_CACHE; } |
245 | static inline void pte_cache(pte_t pte) { pte_val(pte) &= ~_PAGE_NO_CACHE; } | 251 | static inline void pte_cache(pte_t pte) { pte_val(pte) &= ~_PAGE_NO_CACHE; } |
@@ -259,7 +265,11 @@ static inline pte_t pte_mkyoung(pte_t pte) { | |||
259 | static inline pte_t pte_mkhuge(pte_t pte) { | 265 | static inline pte_t pte_mkhuge(pte_t pte) { |
260 | return pte; } | 266 | return pte; } |
261 | static inline pte_t pte_mkspecial(pte_t pte) { | 267 | static inline pte_t pte_mkspecial(pte_t pte) { |
262 | return pte; } | 268 | pte_val(pte) |= _PAGE_SPECIAL; return pte; } |
269 | static inline unsigned long pte_pgprot(pte_t pte) | ||
270 | { | ||
271 | return __pgprot(pte_val(pte)) & PAGE_PROT_BITS; | ||
272 | } | ||
263 | 273 | ||
264 | /* Atomic PTE updates */ | 274 | /* Atomic PTE updates */ |
265 | static inline unsigned long pte_update(struct mm_struct *mm, | 275 | static inline unsigned long pte_update(struct mm_struct *mm, |
@@ -314,6 +324,16 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr, | |||
314 | old = pte_update(mm, addr, ptep, _PAGE_RW, 0); | 324 | old = pte_update(mm, addr, ptep, _PAGE_RW, 0); |
315 | } | 325 | } |
316 | 326 | ||
327 | static inline void huge_ptep_set_wrprotect(struct mm_struct *mm, | ||
328 | unsigned long addr, pte_t *ptep) | ||
329 | { | ||
330 | unsigned long old; | ||
331 | |||
332 | if ((pte_val(*ptep) & _PAGE_RW) == 0) | ||
333 | return; | ||
334 | old = pte_update(mm, addr, ptep, _PAGE_RW, 1); | ||
335 | } | ||
336 | |||
317 | /* | 337 | /* |
318 | * We currently remove entries from the hashtable regardless of whether | 338 | * We currently remove entries from the hashtable regardless of whether |
319 | * the entry was young or dirty. The generic routines only flush if the | 339 | * the entry was young or dirty. The generic routines only flush if the |