diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:32:55 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:32:55 -0500 |
commit | dcbae6b377d78190954055ef2d8909ae83ff57de (patch) | |
tree | 8e180095b115a22cdf1d7e0b3a107b51188e443a /include/asm-x86/pgtable_64.h | |
parent | 61f38226def55d972cfd0e789971e952525ff8e5 (diff) |
x86/pgtable: unify pagetable accessors, #1
based on:
Subject: x86/pgtable: unify pagetable accessors
From: Jeremy Fitzhardinge <jeremy@goop.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/asm-x86/pgtable_64.h')
-rw-r--r-- | include/asm-x86/pgtable_64.h | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/include/asm-x86/pgtable_64.h b/include/asm-x86/pgtable_64.h index 93eb4df2ec1..3a058808848 100644 --- a/include/asm-x86/pgtable_64.h +++ b/include/asm-x86/pgtable_64.h | |||
@@ -179,21 +179,27 @@ static inline pte_t pfn_pte(unsigned long page_nr, pgprot_t pgprot) | |||
179 | * Undefined behaviour if not.. | 179 | * Undefined behaviour if not.. |
180 | */ | 180 | */ |
181 | #define __LARGE_PTE (_PAGE_PSE|_PAGE_PRESENT) | 181 | #define __LARGE_PTE (_PAGE_PSE|_PAGE_PRESENT) |
182 | |||
182 | static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; } | 183 | static inline int pte_dirty(pte_t pte) { return pte_val(pte) & _PAGE_DIRTY; } |
183 | static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } | 184 | static inline int pte_young(pte_t pte) { return pte_val(pte) & _PAGE_ACCESSED; } |
184 | static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; } | 185 | static inline int pte_write(pte_t pte) { return pte_val(pte) & _PAGE_RW; } |
185 | static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } | 186 | static inline int pte_file(pte_t pte) { return pte_val(pte) & _PAGE_FILE; } |
186 | static inline int pte_huge(pte_t pte) { return pte_val(pte) & _PAGE_PSE; } | 187 | static inline int pte_huge(pte_t pte) { return pte_val(pte) & _PAGE_PSE; } |
187 | 188 | ||
188 | static inline pte_t pte_mkclean(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_DIRTY)); return pte; } | 189 | static inline int pmd_large(pmd_t pte) { |
189 | static inline pte_t pte_mkold(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_ACCESSED)); return pte; } | 190 | return (pmd_val(pte) & (_PAGE_PSE|_PAGE_PRESENT)) == |
190 | static inline pte_t pte_wrprotect(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_RW)); return pte; } | 191 | (_PAGE_PSE|_PAGE_PRESENT); |
191 | static inline pte_t pte_mkexec(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_NX)); return pte; } | 192 | } |
192 | static inline pte_t pte_mkdirty(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_DIRTY)); return pte; } | 193 | |
193 | static inline pte_t pte_mkyoung(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_ACCESSED)); return pte; } | 194 | static inline pte_t pte_mkclean(pte_t pte) { return __pte(pte_val(pte) & ~_PAGE_DIRTY); } |
194 | static inline pte_t pte_mkwrite(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_RW)); return pte; } | 195 | static inline pte_t pte_mkold(pte_t pte) { return __pte(pte_val(pte) & ~_PAGE_ACCESSED); } |
195 | static inline pte_t pte_mkhuge(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) | _PAGE_PSE)); return pte; } | 196 | static inline pte_t pte_wrprotect(pte_t pte) { return __pte(pte_val(pte) & ~_PAGE_RW); } |
196 | static inline pte_t pte_clrhuge(pte_t pte) { set_pte(&pte, __pte(pte_val(pte) & ~_PAGE_PSE)); return pte; } | 197 | static inline pte_t pte_mkexec(pte_t pte) { return __pte(pte_val(pte) & ~_PAGE_NX); } |
198 | static inline pte_t pte_mkdirty(pte_t pte) { return __pte(pte_val(pte) | _PAGE_DIRTY); } | ||
199 | static inline pte_t pte_mkyoung(pte_t pte) { return __pte(pte_val(pte) | _PAGE_ACCESSED); } | ||
200 | static inline pte_t pte_mkwrite(pte_t pte) { return __pte(pte_val(pte) | _PAGE_RW); } | ||
201 | static inline pte_t pte_mkhuge(pte_t pte) { return __pte(pte_val(pte) | _PAGE_PSE); } | ||
202 | static inline pte_t pte_clrhuge(pte_t pte) { return __pte(pte_val(pte) & ~_PAGE_PSE); } | ||
197 | 203 | ||
198 | struct vm_area_struct; | 204 | struct vm_area_struct; |
199 | 205 | ||