diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:32:56 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:32:56 -0500 |
commit | e8a4852453c5af27d2a9c606e76809afa3dedb64 (patch) | |
tree | 44fbde545c2ac842fce0ae642442ccffa432258c | |
parent | 7d00a1ae54779db1bec03fa575cf53d99cb6cc48 (diff) |
x86/pgtable: unify pagetable accessors, #5
reorder. NOP.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | include/asm-x86/pgtable_32.h | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/include/asm-x86/pgtable_32.h b/include/asm-x86/pgtable_32.h index b3e92124fc3f..1c43c302609c 100644 --- a/include/asm-x86/pgtable_32.h +++ b/include/asm-x86/pgtable_32.h | |||
@@ -108,28 +108,23 @@ extern unsigned long pg0[]; | |||
108 | static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; } | 108 | static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; } |
109 | static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } | 109 | static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } |
110 | static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; } | 110 | static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; } |
111 | static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } | ||
111 | static inline int pte_huge(pte_t pte) { return pte_val(pte) & _PAGE_PSE; } | 112 | static inline int pte_huge(pte_t pte) { return pte_val(pte) & _PAGE_PSE; } |
112 | 113 | ||
113 | /* | 114 | static inline int pmd_large(pmd_t pte) { |
114 | * The following only works if pte_present() is not true. | 115 | return (pmd_val(pte) & (_PAGE_PSE|_PAGE_PRESENT)) == |
115 | */ | 116 | (_PAGE_PSE|_PAGE_PRESENT); |
116 | static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } | 117 | } |
117 | 118 | ||
118 | static inline pte_t pte_mkclean(pte_t pte) { return __pte(pte_val(pte) & ~_PAGE_DIRTY); } | 119 | static inline pte_t pte_mkclean(pte_t pte) { return __pte(pte_val(pte) & ~_PAGE_DIRTY); } |
119 | static inline pte_t pte_mkold(pte_t pte) { return __pte(pte_val(pte) & ~_PAGE_ACCESSED); } | 120 | static inline pte_t pte_mkold(pte_t pte) { return __pte(pte_val(pte) & ~_PAGE_ACCESSED); } |
120 | static inline pte_t pte_wrprotect(pte_t pte) { return __pte(pte_val(pte) & ~_PAGE_RW); } | 121 | static inline pte_t pte_wrprotect(pte_t pte) { return __pte(pte_val(pte) & ~_PAGE_RW); } |
122 | static inline pte_t pte_mkexec(pte_t pte) { return __pte(pte_val(pte) & ~_PAGE_NX); } | ||
121 | static inline pte_t pte_mkdirty(pte_t pte) { return __pte(pte_val(pte) | _PAGE_DIRTY); } | 123 | static inline pte_t pte_mkdirty(pte_t pte) { return __pte(pte_val(pte) | _PAGE_DIRTY); } |
122 | static inline pte_t pte_mkyoung(pte_t pte) { return __pte(pte_val(pte) | _PAGE_ACCESSED); } | 124 | static inline pte_t pte_mkyoung(pte_t pte) { return __pte(pte_val(pte) | _PAGE_ACCESSED); } |
123 | static inline pte_t pte_mkwrite(pte_t pte) { return __pte(pte_val(pte) | _PAGE_RW); } | 125 | static inline pte_t pte_mkwrite(pte_t pte) { return __pte(pte_val(pte) | _PAGE_RW); } |
124 | static inline pte_t pte_mkhuge(pte_t pte) { return __pte(pte_val(pte) | _PAGE_PSE); } | 126 | static inline pte_t pte_mkhuge(pte_t pte) { return __pte(pte_val(pte) | _PAGE_PSE); } |
125 | |||
126 | static inline pte_t pte_clrhuge(pte_t pte) { return __pte(pte_val(pte) & ~_PAGE_PSE); } | 127 | static inline pte_t pte_clrhuge(pte_t pte) { return __pte(pte_val(pte) & ~_PAGE_PSE); } |
127 | static inline pte_t pte_mkexec(pte_t pte) { return __pte(pte_val(pte) & ~_PAGE_NX); } | ||
128 | |||
129 | static inline int pmd_large(pmd_t pte) { | ||
130 | return (pmd_val(pte) & (_PAGE_PSE|_PAGE_PRESENT)) == | ||
131 | (_PAGE_PSE|_PAGE_PRESENT); | ||
132 | } | ||
133 | 128 | ||
134 | #ifdef CONFIG_X86_PAE | 129 | #ifdef CONFIG_X86_PAE |
135 | # include <asm/pgtable-3level.h> | 130 | # include <asm/pgtable-3level.h> |