diff options
Diffstat (limited to 'include/asm-i386/pgtable.h')
-rw-r--r-- | include/asm-i386/pgtable.h | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h index 7d398f493dde..e6a4723f0eb1 100644 --- a/include/asm-i386/pgtable.h +++ b/include/asm-i386/pgtable.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <asm/processor.h> | 15 | #include <asm/processor.h> |
16 | #include <asm/fixmap.h> | 16 | #include <asm/fixmap.h> |
17 | #include <linux/threads.h> | 17 | #include <linux/threads.h> |
18 | #include <asm/paravirt.h> | ||
18 | 19 | ||
19 | #ifndef _I386_BITOPS_H | 20 | #ifndef _I386_BITOPS_H |
20 | #include <asm/bitops.h> | 21 | #include <asm/bitops.h> |
@@ -34,14 +35,14 @@ struct vm_area_struct; | |||
34 | #define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page)) | 35 | #define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page)) |
35 | extern unsigned long empty_zero_page[1024]; | 36 | extern unsigned long empty_zero_page[1024]; |
36 | extern pgd_t swapper_pg_dir[1024]; | 37 | extern pgd_t swapper_pg_dir[1024]; |
37 | extern kmem_cache_t *pgd_cache; | 38 | extern struct kmem_cache *pgd_cache; |
38 | extern kmem_cache_t *pmd_cache; | 39 | extern struct kmem_cache *pmd_cache; |
39 | extern spinlock_t pgd_lock; | 40 | extern spinlock_t pgd_lock; |
40 | extern struct page *pgd_list; | 41 | extern struct page *pgd_list; |
41 | 42 | ||
42 | void pmd_ctor(void *, kmem_cache_t *, unsigned long); | 43 | void pmd_ctor(void *, struct kmem_cache *, unsigned long); |
43 | void pgd_ctor(void *, kmem_cache_t *, unsigned long); | 44 | void pgd_ctor(void *, struct kmem_cache *, unsigned long); |
44 | void pgd_dtor(void *, kmem_cache_t *, unsigned long); | 45 | void pgd_dtor(void *, struct kmem_cache *, unsigned long); |
45 | void pgtable_cache_init(void); | 46 | void pgtable_cache_init(void); |
46 | void paging_init(void); | 47 | void paging_init(void); |
47 | 48 | ||
@@ -246,6 +247,7 @@ static inline pte_t pte_mkhuge(pte_t pte) { (pte).pte_low |= _PAGE_PSE; return p | |||
246 | # include <asm/pgtable-2level.h> | 247 | # include <asm/pgtable-2level.h> |
247 | #endif | 248 | #endif |
248 | 249 | ||
250 | #ifndef CONFIG_PARAVIRT | ||
249 | /* | 251 | /* |
250 | * Rules for using pte_update - it must be called after any PTE update which | 252 | * Rules for using pte_update - it must be called after any PTE update which |
251 | * has not been done using the set_pte / clear_pte interfaces. It is used by | 253 | * has not been done using the set_pte / clear_pte interfaces. It is used by |
@@ -261,7 +263,7 @@ static inline pte_t pte_mkhuge(pte_t pte) { (pte).pte_low |= _PAGE_PSE; return p | |||
261 | */ | 263 | */ |
262 | #define pte_update(mm, addr, ptep) do { } while (0) | 264 | #define pte_update(mm, addr, ptep) do { } while (0) |
263 | #define pte_update_defer(mm, addr, ptep) do { } while (0) | 265 | #define pte_update_defer(mm, addr, ptep) do { } while (0) |
264 | 266 | #endif | |
265 | 267 | ||
266 | /* | 268 | /* |
267 | * We only update the dirty/accessed state if we set | 269 | * We only update the dirty/accessed state if we set |
@@ -275,7 +277,7 @@ static inline pte_t pte_mkhuge(pte_t pte) { (pte).pte_low |= _PAGE_PSE; return p | |||
275 | do { \ | 277 | do { \ |
276 | if (dirty) { \ | 278 | if (dirty) { \ |
277 | (ptep)->pte_low = (entry).pte_low; \ | 279 | (ptep)->pte_low = (entry).pte_low; \ |
278 | pte_update_defer((vma)->vm_mm, (addr), (ptep)); \ | 280 | pte_update_defer((vma)->vm_mm, (address), (ptep)); \ |
279 | flush_tlb_page(vma, address); \ | 281 | flush_tlb_page(vma, address); \ |
280 | } \ | 282 | } \ |
281 | } while (0) | 283 | } while (0) |
@@ -305,7 +307,7 @@ do { \ | |||
305 | __dirty = pte_dirty(*(ptep)); \ | 307 | __dirty = pte_dirty(*(ptep)); \ |
306 | if (__dirty) { \ | 308 | if (__dirty) { \ |
307 | clear_bit(_PAGE_BIT_DIRTY, &(ptep)->pte_low); \ | 309 | clear_bit(_PAGE_BIT_DIRTY, &(ptep)->pte_low); \ |
308 | pte_update_defer((vma)->vm_mm, (addr), (ptep)); \ | 310 | pte_update_defer((vma)->vm_mm, (address), (ptep)); \ |
309 | flush_tlb_page(vma, address); \ | 311 | flush_tlb_page(vma, address); \ |
310 | } \ | 312 | } \ |
311 | __dirty; \ | 313 | __dirty; \ |
@@ -318,12 +320,20 @@ do { \ | |||
318 | __young = pte_young(*(ptep)); \ | 320 | __young = pte_young(*(ptep)); \ |
319 | if (__young) { \ | 321 | if (__young) { \ |
320 | clear_bit(_PAGE_BIT_ACCESSED, &(ptep)->pte_low); \ | 322 | clear_bit(_PAGE_BIT_ACCESSED, &(ptep)->pte_low); \ |
321 | pte_update_defer((vma)->vm_mm, (addr), (ptep)); \ | 323 | pte_update_defer((vma)->vm_mm, (address), (ptep)); \ |
322 | flush_tlb_page(vma, address); \ | 324 | flush_tlb_page(vma, address); \ |
323 | } \ | 325 | } \ |
324 | __young; \ | 326 | __young; \ |
325 | }) | 327 | }) |
326 | 328 | ||
329 | #define __HAVE_ARCH_PTEP_GET_AND_CLEAR | ||
330 | static inline pte_t ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) | ||
331 | { | ||
332 | pte_t pte = raw_ptep_get_and_clear(ptep); | ||
333 | pte_update(mm, addr, ptep); | ||
334 | return pte; | ||
335 | } | ||
336 | |||
327 | #define __HAVE_ARCH_PTEP_GET_AND_CLEAR_FULL | 337 | #define __HAVE_ARCH_PTEP_GET_AND_CLEAR_FULL |
328 | static inline pte_t ptep_get_and_clear_full(struct mm_struct *mm, unsigned long addr, pte_t *ptep, int full) | 338 | static inline pte_t ptep_get_and_clear_full(struct mm_struct *mm, unsigned long addr, pte_t *ptep, int full) |
329 | { | 339 | { |