From eb8bfd0828d0789782bec9422c68943d6d329031 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Sun, 19 Jul 2020 22:24:17 +0300 Subject: smp/spinlock: Do not define barrier() globally MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's not stricly related to spinlocks. If defined, a better location should be found and the name collisions with other barrier() defined in nb/intel solved. Change-Id: Iae187b5bcc249c2a4bc7bee80d37e34c13d9e63d Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/coreboot/+/43810 Reviewed-by: Angel Pons Tested-by: build bot (Jenkins) --- src/arch/x86/include/arch/smp/spinlock.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/arch/x86/include') diff --git a/src/arch/x86/include/arch/smp/spinlock.h b/src/arch/x86/include/arch/smp/spinlock.h index a05d47a233..799ac2c8b8 100644 --- a/src/arch/x86/include/arch/smp/spinlock.h +++ b/src/arch/x86/include/arch/smp/spinlock.h @@ -29,6 +29,7 @@ typedef struct { #define barrier() __asm__ __volatile__("" : : : "memory") #define spin_is_locked(x) (*(volatile char *)(&(x)->lock) <= 0) #define spin_unlock_wait(x) do { barrier(); } while (spin_is_locked(x)) +#undef barrier #define spin_lock_string \ "\n1:\t" \ @@ -65,7 +66,6 @@ static __always_inline void spin_unlock(spinlock_t *lock) #else #define DECLARE_SPIN_LOCK(x) -#define barrier() do {} while (0) #define spin_is_locked(lock) 0 #define spin_unlock_wait(lock) do {} while (0) #define spin_lock(lock) do {} while (0) -- cgit v1.2.3