diff options
Diffstat (limited to 'arch/powerpc/include/asm/pgtable.h')
-rw-r--r-- | arch/powerpc/include/asm/pgtable.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/powerpc/include/asm/pgtable.h b/arch/powerpc/include/asm/pgtable.h index a8805fee0df9..7e77f2ca5132 100644 --- a/arch/powerpc/include/asm/pgtable.h +++ b/arch/powerpc/include/asm/pgtable.h | |||
@@ -30,7 +30,8 @@ struct mm_struct; | |||
30 | #include <asm/tlbflush.h> | 30 | #include <asm/tlbflush.h> |
31 | 31 | ||
32 | /* Generic accessors to PTE bits */ | 32 | /* Generic accessors to PTE bits */ |
33 | static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; } | 33 | static inline int pte_write(pte_t pte) |
34 | { return (pte_val(pte) & (_PAGE_RW | _PAGE_RO)) != _PAGE_RO; } | ||
34 | static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; } | 35 | static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; } |
35 | static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } | 36 | static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } |
36 | static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } | 37 | static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } |
@@ -115,12 +116,14 @@ static inline unsigned long pte_pfn(pte_t pte) { | |||
115 | 116 | ||
116 | /* Generic modifiers for PTE bits */ | 117 | /* Generic modifiers for PTE bits */ |
117 | static inline pte_t pte_wrprotect(pte_t pte) { | 118 | static inline pte_t pte_wrprotect(pte_t pte) { |
118 | pte_val(pte) &= ~(_PAGE_RW | _PAGE_HWWRITE); return pte; } | 119 | pte_val(pte) &= ~(_PAGE_RW | _PAGE_HWWRITE); |
120 | pte_val(pte) |= _PAGE_RO; return pte; } | ||
119 | static inline pte_t pte_mkclean(pte_t pte) { | 121 | static inline pte_t pte_mkclean(pte_t pte) { |
120 | pte_val(pte) &= ~(_PAGE_DIRTY | _PAGE_HWWRITE); return pte; } | 122 | pte_val(pte) &= ~(_PAGE_DIRTY | _PAGE_HWWRITE); return pte; } |
121 | static inline pte_t pte_mkold(pte_t pte) { | 123 | static inline pte_t pte_mkold(pte_t pte) { |
122 | pte_val(pte) &= ~_PAGE_ACCESSED; return pte; } | 124 | pte_val(pte) &= ~_PAGE_ACCESSED; return pte; } |
123 | static inline pte_t pte_mkwrite(pte_t pte) { | 125 | static inline pte_t pte_mkwrite(pte_t pte) { |
126 | pte_val(pte) &= ~_PAGE_RO; | ||
124 | pte_val(pte) |= _PAGE_RW; return pte; } | 127 | pte_val(pte) |= _PAGE_RW; return pte; } |
125 | static inline pte_t pte_mkdirty(pte_t pte) { | 128 | static inline pte_t pte_mkdirty(pte_t pte) { |
126 | pte_val(pte) |= _PAGE_DIRTY; return pte; } | 129 | pte_val(pte) |= _PAGE_DIRTY; return pte; } |