Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/59546 )
Change subject: arch/{arm,arm64,ppc64,riscv}: Add noop cpu_relax ......................................................................
arch/{arm,arm64,ppc64,riscv}: Add noop cpu_relax
The cpu_relax method is defined for x86. This CL adds a no-op method so that it can be used in common code.
BUG=b:179699789 TEST=none
Signed-off-by: Raul E Rangel rrangel@chromium.org Change-Id: Ifcb4546ceb2894eeb37589d0282b7e076d7a4747 Reviewed-on: https://review.coreboot.org/c/coreboot/+/59546 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Julius Werner jwerner@chromium.org --- M src/arch/arm/include/armv4/arch/cpu.h M src/arch/arm/include/armv7/arch/cpu.h M src/arch/arm64/include/armv8/arch/cpu.h M src/arch/ppc64/include/arch/cpu.h M src/arch/riscv/include/arch/cpu.h 5 files changed, 11 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Julius Werner: Looks good to me, approved
diff --git a/src/arch/arm/include/armv4/arch/cpu.h b/src/arch/arm/include/armv4/arch/cpu.h index 8a1b00e..4c6cdf8 100644 --- a/src/arch/arm/include/armv4/arch/cpu.h +++ b/src/arch/arm/include/armv4/arch/cpu.h @@ -3,6 +3,8 @@ #ifndef __ARCH_CPU_H__ #define __ARCH_CPU_H__
+static inline void cpu_relax(void) { } + #define asmlinkage
#endif /* __ARCH_CPU_H__ */ diff --git a/src/arch/arm/include/armv7/arch/cpu.h b/src/arch/arm/include/armv7/arch/cpu.h index 3f1f1ae..e3154e9 100644 --- a/src/arch/arm/include/armv7/arch/cpu.h +++ b/src/arch/arm/include/armv7/arch/cpu.h @@ -6,6 +6,8 @@ #include <stdint.h> #include <device/device.h>
+static inline void cpu_relax(void) { } + #define asmlinkage
struct cpu_driver { diff --git a/src/arch/arm64/include/armv8/arch/cpu.h b/src/arch/arm64/include/armv8/arch/cpu.h index 15b2065..e5e8a7c 100644 --- a/src/arch/arm64/include/armv8/arch/cpu.h +++ b/src/arch/arm64/include/armv8/arch/cpu.h @@ -3,6 +3,9 @@ #ifndef __ARCH_CPU_H__ #define __ARCH_CPU_H__
+/* TODO: Implement using SEV/WFE if this is ever actually used. */ +static inline void cpu_relax(void) { } + #define asmlinkage
struct cpu_driver { }; diff --git a/src/arch/ppc64/include/arch/cpu.h b/src/arch/ppc64/include/arch/cpu.h index 5e5ba30..638406d 100644 --- a/src/arch/ppc64/include/arch/cpu.h +++ b/src/arch/ppc64/include/arch/cpu.h @@ -5,6 +5,8 @@
#include <device/device.h>
+static inline void cpu_relax(void) { } + #define asmlinkage
struct cpu_driver { diff --git a/src/arch/riscv/include/arch/cpu.h b/src/arch/riscv/include/arch/cpu.h index 7cf9461..d51d8a9 100644 --- a/src/arch/riscv/include/arch/cpu.h +++ b/src/arch/riscv/include/arch/cpu.h @@ -6,6 +6,8 @@ #include <arch/encoding.h> #include <device/device.h>
+static inline void cpu_relax(void) { } + #define asmlinkage
struct cpu_driver {