aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-01-30 07:32:56 -0500
committerIngo Molnar <mingo@elte.hu>2008-01-30 07:32:56 -0500
commite8a4852453c5af27d2a9c606e76809afa3dedb64 (patch)
tree44fbde545c2ac842fce0ae642442ccffa432258c /include
parent7d00a1ae54779db1bec03fa575cf53d99cb6cc48 (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>
Diffstat (limited to 'include')
-rw-r--r--include/asm-x86/pgtable_32.h17
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[];
108static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; } 108static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; }
109static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } 109static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; }
110static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; } 110static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; }
111static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; }
111static inline int pte_huge(pte_t pte) { return pte_val(pte) & _PAGE_PSE; } 112static inline int pte_huge(pte_t pte) { return pte_val(pte) & _PAGE_PSE; }
112 113
113/* 114static 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);
116static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } 117}
117 118
118static inline pte_t pte_mkclean(pte_t pte) { return __pte(pte_val(pte) & ~_PAGE_DIRTY); } 119static inline pte_t pte_mkclean(pte_t pte) { return __pte(pte_val(pte) & ~_PAGE_DIRTY); }
119static inline pte_t pte_mkold(pte_t pte) { return __pte(pte_val(pte) & ~_PAGE_ACCESSED); } 120static inline pte_t pte_mkold(pte_t pte) { return __pte(pte_val(pte) & ~_PAGE_ACCESSED); }
120static inline pte_t pte_wrprotect(pte_t pte) { return __pte(pte_val(pte) & ~_PAGE_RW); } 121static inline pte_t pte_wrprotect(pte_t pte) { return __pte(pte_val(pte) & ~_PAGE_RW); }
122static inline pte_t pte_mkexec(pte_t pte) { return __pte(pte_val(pte) & ~_PAGE_NX); }
121static inline pte_t pte_mkdirty(pte_t pte) { return __pte(pte_val(pte) | _PAGE_DIRTY); } 123static inline pte_t pte_mkdirty(pte_t pte) { return __pte(pte_val(pte) | _PAGE_DIRTY); }
122static inline pte_t pte_mkyoung(pte_t pte) { return __pte(pte_val(pte) | _PAGE_ACCESSED); } 124static inline pte_t pte_mkyoung(pte_t pte) { return __pte(pte_val(pte) | _PAGE_ACCESSED); }
123static inline pte_t pte_mkwrite(pte_t pte) { return __pte(pte_val(pte) | _PAGE_RW); } 125static inline pte_t pte_mkwrite(pte_t pte) { return __pte(pte_val(pte) | _PAGE_RW); }
124static inline pte_t pte_mkhuge(pte_t pte) { return __pte(pte_val(pte) | _PAGE_PSE); } 126static inline pte_t pte_mkhuge(pte_t pte) { return __pte(pte_val(pte) | _PAGE_PSE); }
125
126static inline pte_t pte_clrhuge(pte_t pte) { return __pte(pte_val(pte) & ~_PAGE_PSE); } 127static inline pte_t pte_clrhuge(pte_t pte) { return __pte(pte_val(pte) & ~_PAGE_PSE); }
127static inline pte_t pte_mkexec(pte_t pte) { return __pte(pte_val(pte) & ~_PAGE_NX); }
128
129static 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>