blob: 31fa510eb0d9794043d77e348aa3aaa9bb0105b0 [file] [log] [blame]
#ifndef _ASM_GENERIC_SPINLOCK_H_
#define _ASM_GENERIC_SPINLOCK_H_
struct spinlock {
unsigned int v;
};
static inline void spin_lock(struct spinlock *lock)
{
while (__sync_lock_test_and_set(&lock->v, 1));
}
static inline void spin_unlock(struct spinlock *lock)
{
__sync_lock_release(&lock->v);
}
#endif