aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-i386/pgtable.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-i386/pgtable.h')
-rw-r--r--include/asm-i386/pgtable.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/include/asm-i386/pgtable.h b/include/asm-i386/pgtable.h
index bfee7ddfff53..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>
@@ -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
275do { \ 277do { \
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
330static 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
328static inline pte_t ptep_get_and_clear_full(struct mm_struct *mm, unsigned long addr, pte_t *ptep, int full) 338static inline pte_t ptep_get_and_clear_full(struct mm_struct *mm, unsigned long addr, pte_t *ptep, int full)
329{ 339{