Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 33
b: refs/heads/master
c: 7a1e335
h: refs/heads/master
i:
  31: decb105
v: v3
  • Loading branch information
Kumar Gala authored and Linus Torvalds committed Apr 16, 2005
1 parent f2b94e6 commit c313424
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0c541b4406a68e74d94ddb667c69d9e03bce8681
refs/heads/master: 7a1e335085ead05da08f791340f58b493126894d
29 changes: 25 additions & 4 deletions trunk/include/asm-ppc/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -526,10 +526,10 @@ extern void add_hash_page(unsigned context, unsigned long va,
* Atomic PTE updates.
*
* pte_update clears and sets bit atomically, and returns
* the old pte value.
* The ((unsigned long)(p+1) - 4) hack is to get to the least-significant
* 32 bits of the PTE regardless of whether PTEs are 32 or 64 bits.
* the old pte value. In the 64-bit PTE case we lock around the
* low PTE word since we expect ALL flag bits to be there
*/
#ifndef CONFIG_PTE_64BIT
static inline unsigned long pte_update(pte_t *p, unsigned long clr,
unsigned long set)
{
Expand All @@ -543,10 +543,31 @@ static inline unsigned long pte_update(pte_t *p, unsigned long clr,
" stwcx. %1,0,%3\n\
bne- 1b"
: "=&r" (old), "=&r" (tmp), "=m" (*p)
: "r" ((unsigned long)(p+1) - 4), "r" (clr), "r" (set), "m" (*p)
: "r" (p), "r" (clr), "r" (set), "m" (*p)
: "cc" );
return old;
}
#else
static inline unsigned long long pte_update(pte_t *p, unsigned long clr,
unsigned long set)
{
unsigned long long old;
unsigned long tmp;

__asm__ __volatile__("\
1: lwarx %L0,0,%4\n\
lwzx %0,0,%3\n\
andc %1,%L0,%5\n\
or %1,%1,%6\n"
PPC405_ERR77(0,%3)
" stwcx. %1,0,%4\n\
bne- 1b"
: "=&r" (old), "=&r" (tmp), "=m" (*p)
: "r" (p), "r" ((unsigned long)(p) + 4), "r" (clr), "r" (set), "m" (*p)
: "cc" );
return old;
}
#endif

/*
* set_pte stores a linux PTE into the linux page table.
Expand Down

0 comments on commit c313424

Please sign in to comment.