Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 53914
b: refs/heads/master
c: 142dd97
h: refs/heads/master
v: v3
  • Loading branch information
Zachary Amsden authored and Andi Kleen committed May 2, 2007
1 parent 047bf27 commit 4f5f2a6
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c2c1accd4b2f9c82fb89d40611c7f581948db255
refs/heads/master: 142dd975911fdd82b1b6f6617cd20ac90a8ccf00
14 changes: 14 additions & 0 deletions trunk/include/asm-i386/pgtable-2level.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,24 @@ static inline void native_pte_clear(struct mm_struct *mm, unsigned long addr, pt
*xp = __pte(0);
}

/* local pte updates need not use xchg for locking */
static inline pte_t native_local_ptep_get_and_clear(pte_t *ptep)
{
pte_t res;

res = *ptep;
native_pte_clear(NULL, 0, ptep);
return res;
}

#ifdef CONFIG_SMP
static inline pte_t native_ptep_get_and_clear(pte_t *xp)
{
return __pte(xchg(&xp->pte_low, 0));
}
#else
#define native_ptep_get_and_clear(xp) native_local_ptep_get_and_clear(xp)
#endif

#define pte_page(x) pfn_to_page(pte_pfn(x))
#define pte_none(x) (!(x).pte_low)
Expand Down
14 changes: 14 additions & 0 deletions trunk/include/asm-i386/pgtable-3level.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,17 @@ static inline void pud_clear (pud_t * pud) { }
#define pmd_offset(pud, address) ((pmd_t *) pud_page(*(pud)) + \
pmd_index(address))

/* local pte updates need not use xchg for locking */
static inline pte_t native_local_ptep_get_and_clear(pte_t *ptep)
{
pte_t res;

res = *ptep;
native_pte_clear(NULL, 0, ptep);
return res;
}

#ifdef CONFIG_SMP
static inline pte_t native_ptep_get_and_clear(pte_t *ptep)
{
pte_t res;
Expand All @@ -150,6 +161,9 @@ static inline pte_t native_ptep_get_and_clear(pte_t *ptep)

return res;
}
#else
#define native_ptep_get_and_clear(xp) native_local_ptep_get_and_clear(xp)
#endif

#define __HAVE_ARCH_PTE_SAME
static inline int pte_same(pte_t a, pte_t b)
Expand Down

0 comments on commit 4f5f2a6

Please sign in to comment.