diff options
Diffstat (limited to 'arch/arm/include/asm/mcs_spinlock.h')
-rw-r--r-- | arch/arm/include/asm/mcs_spinlock.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/arm/include/asm/mcs_spinlock.h b/arch/arm/include/asm/mcs_spinlock.h new file mode 100644 index 000000000000..f652ad65840a --- /dev/null +++ b/arch/arm/include/asm/mcs_spinlock.h | |||
@@ -0,0 +1,23 @@ | |||
1 | #ifndef __ASM_MCS_LOCK_H | ||
2 | #define __ASM_MCS_LOCK_H | ||
3 | |||
4 | #ifdef CONFIG_SMP | ||
5 | #include <asm/spinlock.h> | ||
6 | |||
7 | /* MCS spin-locking. */ | ||
8 | #define arch_mcs_spin_lock_contended(lock) \ | ||
9 | do { \ | ||
10 | /* Ensure prior stores are observed before we enter wfe. */ \ | ||
11 | smp_mb(); \ | ||
12 | while (!(smp_load_acquire(lock))) \ | ||
13 | wfe(); \ | ||
14 | } while (0) \ | ||
15 | |||
16 | #define arch_mcs_spin_unlock_contended(lock) \ | ||
17 | do { \ | ||
18 | smp_store_release(lock, 1); \ | ||
19 | dsb_sev(); \ | ||
20 | } while (0) | ||
21 | |||
22 | #endif /* CONFIG_SMP */ | ||
23 | #endif /* __ASM_MCS_LOCK_H */ | ||