Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 170399
b: refs/heads/master
c: 4df286e
h: refs/heads/master
i:
  170397: e85fa1e
  170395: 95ed71b
  170391: 50337ab
  170383: 9a3cee6
  170367: 84777e6
v: v3
  • Loading branch information
Thomas Gleixner authored and David S. Miller committed Nov 7, 2009
1 parent 240bffa commit 79fe305
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 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: ddaf1b27edf72372242d752730d526b79312a44e
refs/heads/master: 4df286e52917c95c415400367cfd523dfbb0f93a
36 changes: 18 additions & 18 deletions trunk/arch/sparc/lib/atomic32.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#define ATOMIC_HASH_SIZE 4
#define ATOMIC_HASH(a) (&__atomic_hash[(((unsigned long)a)>>8) & (ATOMIC_HASH_SIZE-1)])

spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] = {
[0 ... (ATOMIC_HASH_SIZE-1)] = SPIN_LOCK_UNLOCKED
static raw_spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] = {
[0 ... (ATOMIC_HASH_SIZE-1)] = __RAW_SPIN_LOCK_UNLOCKED
};

#else /* SMP */
Expand All @@ -31,11 +31,11 @@ int __atomic_add_return(int i, atomic_t *v)
{
int ret;
unsigned long flags;
spin_lock_irqsave(ATOMIC_HASH(v), flags);
__raw_spin_lock_irqsave(ATOMIC_HASH(v), flags);

ret = (v->counter += i);

spin_unlock_irqrestore(ATOMIC_HASH(v), flags);
__raw_spin_unlock_irqrestore(ATOMIC_HASH(v), flags);
return ret;
}
EXPORT_SYMBOL(__atomic_add_return);
Expand All @@ -45,12 +45,12 @@ int atomic_cmpxchg(atomic_t *v, int old, int new)
int ret;
unsigned long flags;

spin_lock_irqsave(ATOMIC_HASH(v), flags);
__raw_spin_lock_irqsave(ATOMIC_HASH(v), flags);
ret = v->counter;
if (likely(ret == old))
v->counter = new;

spin_unlock_irqrestore(ATOMIC_HASH(v), flags);
__raw_spin_unlock_irqrestore(ATOMIC_HASH(v), flags);
return ret;
}
EXPORT_SYMBOL(atomic_cmpxchg);
Expand All @@ -60,11 +60,11 @@ int atomic_add_unless(atomic_t *v, int a, int u)
int ret;
unsigned long flags;

spin_lock_irqsave(ATOMIC_HASH(v), flags);
__raw_spin_lock_irqsave(ATOMIC_HASH(v), flags);
ret = v->counter;
if (ret != u)
v->counter += a;
spin_unlock_irqrestore(ATOMIC_HASH(v), flags);
__raw_spin_unlock_irqrestore(ATOMIC_HASH(v), flags);
return ret != u;
}
EXPORT_SYMBOL(atomic_add_unless);
Expand All @@ -74,20 +74,20 @@ void atomic_set(atomic_t *v, int i)
{
unsigned long flags;

spin_lock_irqsave(ATOMIC_HASH(v), flags);
__raw_spin_lock_irqsave(ATOMIC_HASH(v), flags);
v->counter = i;
spin_unlock_irqrestore(ATOMIC_HASH(v), flags);
__raw_spin_unlock_irqrestore(ATOMIC_HASH(v), flags);
}
EXPORT_SYMBOL(atomic_set);

unsigned long ___set_bit(unsigned long *addr, unsigned long mask)
{
unsigned long old, flags;

spin_lock_irqsave(ATOMIC_HASH(addr), flags);
__raw_spin_lock_irqsave(ATOMIC_HASH(addr), flags);
old = *addr;
*addr = old | mask;
spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);
__raw_spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);

return old & mask;
}
Expand All @@ -97,10 +97,10 @@ unsigned long ___clear_bit(unsigned long *addr, unsigned long mask)
{
unsigned long old, flags;

spin_lock_irqsave(ATOMIC_HASH(addr), flags);
__raw_spin_lock_irqsave(ATOMIC_HASH(addr), flags);
old = *addr;
*addr = old & ~mask;
spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);
__raw_spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);

return old & mask;
}
Expand All @@ -110,10 +110,10 @@ unsigned long ___change_bit(unsigned long *addr, unsigned long mask)
{
unsigned long old, flags;

spin_lock_irqsave(ATOMIC_HASH(addr), flags);
__raw_spin_lock_irqsave(ATOMIC_HASH(addr), flags);
old = *addr;
*addr = old ^ mask;
spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);
__raw_spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);

return old & mask;
}
Expand All @@ -124,10 +124,10 @@ unsigned long __cmpxchg_u32(volatile u32 *ptr, u32 old, u32 new)
unsigned long flags;
u32 prev;

spin_lock_irqsave(ATOMIC_HASH(ptr), flags);
__raw_spin_lock_irqsave(ATOMIC_HASH(ptr), flags);
if ((prev = *ptr) == old)
*ptr = new;
spin_unlock_irqrestore(ATOMIC_HASH(ptr), flags);
__raw_spin_unlock_irqrestore(ATOMIC_HASH(ptr), flags);

return (unsigned long)prev;
}
Expand Down

0 comments on commit 79fe305

Please sign in to comment.