#define ATOMIC_HASH_SIZE 4
#define ATOMIC_HASH(a) (&__atomic_hash[(((unsigned long)a)>>8) & (ATOMIC_HASH_SIZE-1)])
-static raw_spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] = {
- [0 ... (ATOMIC_HASH_SIZE-1)] = __RAW_SPIN_LOCK_UNLOCKED
+spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] = {
+ [0 ... (ATOMIC_HASH_SIZE-1)] = SPIN_LOCK_UNLOCKED
};
#else /* SMP */
{
int ret;
unsigned long flags;
- __raw_spin_lock_irqsave(ATOMIC_HASH(v), flags);
+ spin_lock_irqsave(ATOMIC_HASH(v), flags);
ret = (v->counter += i);
- __raw_spin_unlock_irqrestore(ATOMIC_HASH(v), flags);
+ spin_unlock_irqrestore(ATOMIC_HASH(v), flags);
return ret;
}
EXPORT_SYMBOL(__atomic_add_return);
int ret;
unsigned long flags;
- __raw_spin_lock_irqsave(ATOMIC_HASH(v), flags);
+ spin_lock_irqsave(ATOMIC_HASH(v), flags);
ret = v->counter;
if (likely(ret == old))
v->counter = new;
- __raw_spin_unlock_irqrestore(ATOMIC_HASH(v), flags);
+ spin_unlock_irqrestore(ATOMIC_HASH(v), flags);
return ret;
}
EXPORT_SYMBOL(atomic_cmpxchg);
int ret;
unsigned long flags;
- __raw_spin_lock_irqsave(ATOMIC_HASH(v), flags);
+ spin_lock_irqsave(ATOMIC_HASH(v), flags);
ret = v->counter;
if (ret != u)
v->counter += a;
- __raw_spin_unlock_irqrestore(ATOMIC_HASH(v), flags);
+ spin_unlock_irqrestore(ATOMIC_HASH(v), flags);
return ret != u;
}
EXPORT_SYMBOL(atomic_add_unless);
{
unsigned long flags;
- __raw_spin_lock_irqsave(ATOMIC_HASH(v), flags);
+ spin_lock_irqsave(ATOMIC_HASH(v), flags);
v->counter = i;
- __raw_spin_unlock_irqrestore(ATOMIC_HASH(v), flags);
+ spin_unlock_irqrestore(ATOMIC_HASH(v), flags);
}
EXPORT_SYMBOL(atomic_set);
{
unsigned long old, flags;
- __raw_spin_lock_irqsave(ATOMIC_HASH(addr), flags);
+ spin_lock_irqsave(ATOMIC_HASH(addr), flags);
old = *addr;
*addr = old | mask;
- __raw_spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);
+ spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);
return old & mask;
}
{
unsigned long old, flags;
- __raw_spin_lock_irqsave(ATOMIC_HASH(addr), flags);
+ spin_lock_irqsave(ATOMIC_HASH(addr), flags);
old = *addr;
*addr = old & ~mask;
- __raw_spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);
+ spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);
return old & mask;
}
{
unsigned long old, flags;
- __raw_spin_lock_irqsave(ATOMIC_HASH(addr), flags);
+ spin_lock_irqsave(ATOMIC_HASH(addr), flags);
old = *addr;
*addr = old ^ mask;
- __raw_spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);
+ spin_unlock_irqrestore(ATOMIC_HASH(addr), flags);
return old & mask;
}
unsigned long flags;
u32 prev;
- __raw_spin_lock_irqsave(ATOMIC_HASH(ptr), flags);
+ spin_lock_irqsave(ATOMIC_HASH(ptr), flags);
if ((prev = *ptr) == old)
*ptr = new;
- __raw_spin_unlock_irqrestore(ATOMIC_HASH(ptr), flags);
+ spin_unlock_irqrestore(ATOMIC_HASH(ptr), flags);
return (unsigned long)prev;
}