From a010b7f614dbdf5155e380c49fd07bc440b5a769 Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Tue, 17 Oct 2023 11:36:11 -0700 Subject: [PATCH] arch/ppc64: Fix inline assembly for clang Use macros from the Linux kernel 6.5 to make the inline assembly also compile on clang. TEST: See that the generated code is identical on GCC and compiles on clang. Signed-off-by: Arthur Heymans Change-Id: I516033c69e62dfdb38f83285c156d5527917ad55 Reviewed-on: https://review.coreboot.org/c/coreboot/+/78446 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons Reviewed-by: Martin L Roth --- src/arch/ppc64/stages.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/arch/ppc64/stages.c b/src/arch/ppc64/stages.c index 01b9efaba8..c6d35ed452 100644 --- a/src/arch/ppc64/stages.c +++ b/src/arch/ppc64/stages.c @@ -25,10 +25,15 @@ void stage_entry(uintptr_t stage_arg) _cbmem_top_ptr = stage_arg; #if ENV_RAMSTAGE +#define __stringify_in_c(...) #__VA_ARGS__ +#define stringify_in_c(...) __stringify_in_c(__VA_ARGS__) " " +#define PPC_RAW_SLBIA(IH) (0x7c0003e4 | (((IH) & 0x7) << 21)) +#define PPC_SLBIA(IH) stringify_in_c(.long PPC_RAW_SLBIA(IH)) + hrmor = read_spr(SPR_HRMOR); asm volatile("sync; isync" ::: "memory"); write_spr(SPR_HRMOR, 0); - asm volatile("or 1,1,%0; slbia 7; sync; isync" :: "r"(hrmor) : "memory"); + asm volatile("or 1,1,%0;" PPC_SLBIA(7)"; sync; isync" :: "r"(hrmor) : "memory"); #endif main();