Merge tag 'sched-urgent-2020-12-27' of git://git.kernel.org/pub/scm/linux/kernel...
[linux/fpc-iii.git] / arch / arm / include / asm / mcs_spinlock.h
blob529d2cf4d06f4adf88170ca6c84f3e39d3305188
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __ASM_MCS_LOCK_H
3 #define __ASM_MCS_LOCK_H
5 #ifdef CONFIG_SMP
6 #include <asm/spinlock.h>
8 /* MCS spin-locking. */
9 #define arch_mcs_spin_lock_contended(lock) \
10 do { \
11 /* Ensure prior stores are observed before we enter wfe. */ \
12 smp_mb(); \
13 while (!(smp_load_acquire(lock))) \
14 wfe(); \
15 } while (0) \
17 #define arch_mcs_spin_unlock_contended(lock) \
18 do { \
19 smp_store_release(lock, 1); \
20 dsb_sev(); \
21 } while (0)
23 #endif /* CONFIG_SMP */
24 #endif /* __ASM_MCS_LOCK_H */