GNU Linux-libre 4.14.302-gnu1
[releases.git] / arch / metag / include / asm / spinlock.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __ASM_SPINLOCK_H
3 #define __ASM_SPINLOCK_H
4
5 #include <asm/barrier.h>
6 #include <asm/processor.h>
7
8 #ifdef CONFIG_METAG_ATOMICITY_LOCK1
9 #include <asm/spinlock_lock1.h>
10 #else
11 #include <asm/spinlock_lnkget.h>
12 #endif
13
14 /*
15  * both lock1 and lnkget are test-and-set spinlocks with 0 unlocked and 1
16  * locked.
17  */
18
19 #define arch_spin_lock_flags(lock, flags) arch_spin_lock(lock)
20
21 #define arch_read_lock_flags(lock, flags) arch_read_lock(lock)
22 #define arch_write_lock_flags(lock, flags) arch_write_lock(lock)
23
24 #define arch_spin_relax(lock)   cpu_relax()
25 #define arch_read_relax(lock)   cpu_relax()
26 #define arch_write_relax(lock)  cpu_relax()
27
28 #endif /* __ASM_SPINLOCK_H */