summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/arch/arm/include/armv4/arch/smp/spinlock.h1
-rw-r--r--src/arch/x86/include/arch/cpu.h6
-rw-r--r--src/arch/x86/include/arch/smp/spinlock.h7
-rw-r--r--src/cpu/x86/tsc/delay_tsc.c3
-rw-r--r--src/include/smp/spinlock.h1
-rw-r--r--src/soc/amd/picasso/psp_verstage/include/arch/smp/spinlock.h1
6 files changed, 7 insertions, 12 deletions
diff --git a/src/arch/arm/include/armv4/arch/smp/spinlock.h b/src/arch/arm/include/armv4/arch/smp/spinlock.h
index 5245bd1a02..4d40f3304f 100644
--- a/src/arch/arm/include/armv4/arch/smp/spinlock.h
+++ b/src/arch/arm/include/armv4/arch/smp/spinlock.h
@@ -9,7 +9,6 @@
#define spin_unlock_wait(lock) do {} while (0)
#define spin_lock(lock) do {} while (0)
#define spin_unlock(lock) do {} while (0)
-#define cpu_relax() do {} while (0)
#include <smp/node.h>
#define boot_cpu() 1
diff --git a/src/arch/x86/include/arch/cpu.h b/src/arch/x86/include/arch/cpu.h
index 82f470ec2d..b622465a25 100644
--- a/src/arch/x86/include/arch/cpu.h
+++ b/src/arch/x86/include/arch/cpu.h
@@ -269,6 +269,12 @@ static inline void get_fms(struct cpuinfo_x86 *c, uint32_t tfms)
}
+/* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */
+static __always_inline void cpu_relax(void)
+{
+ __asm__ __volatile__("rep;nop" : : : "memory");
+}
+
#define asmlinkage __attribute__((regparm(0)))
/*
diff --git a/src/arch/x86/include/arch/smp/spinlock.h b/src/arch/x86/include/arch/smp/spinlock.h
index 41189933d9..a05d47a233 100644
--- a/src/arch/x86/include/arch/smp/spinlock.h
+++ b/src/arch/x86/include/arch/smp/spinlock.h
@@ -62,12 +62,6 @@ static __always_inline void spin_unlock(spinlock_t *lock)
: "=m" (lock->lock) : : "memory");
}
-/* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */
-static __always_inline void cpu_relax(void)
-{
- __asm__ __volatile__("rep;nop" : : : "memory");
-}
-
#else
#define DECLARE_SPIN_LOCK(x)
@@ -76,7 +70,6 @@ static __always_inline void cpu_relax(void)
#define spin_unlock_wait(lock) do {} while (0)
#define spin_lock(lock) do {} while (0)
#define spin_unlock(lock) do {} while (0)
-#define cpu_relax() do {} while (0)
#endif
diff --git a/src/cpu/x86/tsc/delay_tsc.c b/src/cpu/x86/tsc/delay_tsc.c
index 893d41dc3b..9607c2c6eb 100644
--- a/src/cpu/x86/tsc/delay_tsc.c
+++ b/src/cpu/x86/tsc/delay_tsc.c
@@ -1,8 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0-only */
+#include <arch/cpu.h>
#include <cpu/x86/tsc.h>
-#include <pc80/i8254.h>
-#include <smp/spinlock.h>
#include <delay.h>
#include <thread.h>
diff --git a/src/include/smp/spinlock.h b/src/include/smp/spinlock.h
index 98ab3a778a..40dd602c03 100644
--- a/src/include/smp/spinlock.h
+++ b/src/include/smp/spinlock.h
@@ -11,7 +11,6 @@
#define spin_unlock_wait(lock) do {} while (0)
#define spin_lock(lock) do {} while (0)
#define spin_unlock(lock) do {} while (0)
-#define cpu_relax() do {} while (0)
#endif
#endif /* SMP_SPINLOCK_H */
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 5245bd1a02..4d40f3304f 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
@@ -9,7 +9,6 @@
#define spin_unlock_wait(lock) do {} while (0)
#define spin_lock(lock) do {} while (0)
#define spin_unlock(lock) do {} while (0)
-#define cpu_relax() do {} while (0)
#include <smp/node.h>
#define boot_cpu() 1