1
0
mirror of https://github.com/physwizz/a155-U-u1.git synced 2025-10-07 10:09:34 +00:00
Files
a155-U-u1/kernel-5.10/arch/arm/include/asm/mcs_spinlock.h
physwizz 99537be4e2 first
2024-03-11 06:53:12 +11:00

25 lines
570 B
C

/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __ASM_MCS_LOCK_H
#define __ASM_MCS_LOCK_H
#ifdef CONFIG_SMP
#include <asm/spinlock.h>
/* MCS spin-locking. */
#define arch_mcs_spin_lock_contended(lock) \
do { \
/* Ensure prior stores are observed before we enter wfe. */ \
smp_mb(); \
while (!(smp_load_acquire(lock))) \
wfe(); \
} while (0) \
#define arch_mcs_spin_unlock_contended(lock) \
do { \
smp_store_release(lock, 1); \
dsb_sev(); \
} while (0)
#endif /* CONFIG_SMP */
#endif /* __ASM_MCS_LOCK_H */