]> git.kernelconcepts.de Git - karo-tx-linux.git/blob - arch/metag/include/asm/spinlock.h
Merge branch 'for-4.8/core' of git://git.kernel.dk/linux-block
[karo-tx-linux.git] / arch / metag / include / asm / spinlock.h
1 #ifndef __ASM_SPINLOCK_H
2 #define __ASM_SPINLOCK_H
3
4 #include <asm/barrier.h>
5 #include <asm/processor.h>
6
7 #ifdef CONFIG_METAG_ATOMICITY_LOCK1
8 #include <asm/spinlock_lock1.h>
9 #else
10 #include <asm/spinlock_lnkget.h>
11 #endif
12
13 /*
14  * both lock1 and lnkget are test-and-set spinlocks with 0 unlocked and 1
15  * locked.
16  */
17
18 static inline void arch_spin_unlock_wait(arch_spinlock_t *lock)
19 {
20         smp_cond_load_acquire(&lock->lock, !VAL);
21 }
22
23 #define arch_spin_lock_flags(lock, flags) arch_spin_lock(lock)
24
25 #define arch_read_lock_flags(lock, flags) arch_read_lock(lock)
26 #define arch_write_lock_flags(lock, flags) arch_write_lock(lock)
27
28 #define arch_spin_relax(lock)   cpu_relax()
29 #define arch_read_relax(lock)   cpu_relax()
30 #define arch_write_relax(lock)  cpu_relax()
31
32 #endif /* __ASM_SPINLOCK_H */