Merge remote-tracking branch 'asoc/topic/core' into asoc-next
[sfrench/cifs-2.6.git] / arch / arm / include / asm / mcs_spinlock.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __ASM_MCS_LOCK_H
3 #define __ASM_MCS_LOCK_H
4
5 #ifdef CONFIG_SMP
6 #include <asm/spinlock.h>
7
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)                                                             \
16
17 #define arch_mcs_spin_unlock_contended(lock)                            \
18 do {                                                                    \
19         smp_store_release(lock, 1);                                     \
20         dsb_sev();                                                      \
21 } while (0)
22
23 #endif  /* CONFIG_SMP */
24 #endif  /* __ASM_MCS_LOCK_H */