Kyösti Mälkki has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/43810 )
Change subject: smp/spinlock: Do not define barrier() globally ......................................................................
smp/spinlock: Do not define barrier() globally
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 kyosti.malkki@gmail.com --- M src/arch/arm/include/armv4/arch/smp/spinlock.h M src/arch/x86/include/arch/smp/spinlock.h M src/include/smp/spinlock.h M src/soc/amd/picasso/psp_verstage/include/arch/smp/spinlock.h 4 files changed, 1 insertion(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/10/43810/1
diff --git a/src/arch/arm/include/armv4/arch/smp/spinlock.h b/src/arch/arm/include/armv4/arch/smp/spinlock.h index 4d40f33..0a3a4d4 100644 --- a/src/arch/arm/include/armv4/arch/smp/spinlock.h +++ b/src/arch/arm/include/armv4/arch/smp/spinlock.h @@ -4,7 +4,6 @@ #define _ARCH_SMP_SPINLOCK_H
#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) diff --git a/src/arch/x86/include/arch/smp/spinlock.h b/src/arch/x86/include/arch/smp/spinlock.h index a05d47a..799ac2c 100644 --- a/src/arch/x86/include/arch/smp/spinlock.h +++ b/src/arch/x86/include/arch/smp/spinlock.h @@ -29,6 +29,7 @@ #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 @@ #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) diff --git a/src/include/smp/spinlock.h b/src/include/smp/spinlock.h index 40dd602..8554aa05 100644 --- a/src/include/smp/spinlock.h +++ b/src/include/smp/spinlock.h @@ -6,7 +6,6 @@ #else /* !CONFIG_SMP */
#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) diff --git a/src/soc/amd/picasso/psp_verstage/include/arch/smp/spinlock.h b/src/soc/amd/picasso/psp_verstage/include/arch/smp/spinlock.h index 4d40f33..0a3a4d4 100644 --- a/src/soc/amd/picasso/psp_verstage/include/arch/smp/spinlock.h +++ b/src/soc/amd/picasso/psp_verstage/include/arch/smp/spinlock.h @@ -4,7 +4,6 @@ #define _ARCH_SMP_SPINLOCK_H
#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)