From: Thorsten Blum Date: Sun, 7 Jun 2026 02:17:52 +0000 (-0600) Subject: riscv/purgatory: add asm/purgatory.h X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a24c7f3523ff1112e8dc6c45cea7d9397345a627;p=thirdparty%2Flinux.git riscv/purgatory: add asm/purgatory.h Add arch/riscv/include/asm/purgatory.h and provide the purgatory() prototype via the architecture header, mirroring the x86 layout. Remove the workaround from arch/riscv/purgatory/purgatory.c. Signed-off-by: Thorsten Blum Link: https://patch.msgid.link/20260509073850.44595-4-thorsten.blum@linux.dev [pjw@kernel.org: drop superfluous extern in header file] Signed-off-by: Paul Walmsley --- diff --git a/arch/riscv/include/asm/purgatory.h b/arch/riscv/include/asm/purgatory.h new file mode 100644 index 0000000000000..5a827e6752b7f --- /dev/null +++ b/arch/riscv/include/asm/purgatory.h @@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _ASM_RISCV_PURGATORY_H +#define _ASM_RISCV_PURGATORY_H + +#ifndef __ASSEMBLER__ +#include + +void purgatory(void); +#endif /* __ASSEMBLER__ */ + +#endif /* _ASM_RISCV_PURGATORY_H */ diff --git a/arch/riscv/purgatory/purgatory.c b/arch/riscv/purgatory/purgatory.c index 745deeb6e3a5f..3474e3abe5d78 100644 --- a/arch/riscv/purgatory/purgatory.c +++ b/arch/riscv/purgatory/purgatory.c @@ -8,9 +8,9 @@ * */ -#include #include #include +#include #include u8 purgatory_sha256_digest[SHA256_DIGEST_SIZE] __section(".kexec-purgatory"); @@ -32,9 +32,6 @@ static bool verify_sha256_digest(void) return memcmp(digest, purgatory_sha256_digest, sizeof(digest)) == 0; } -/* workaround for a warning with -Wmissing-prototypes */ -void purgatory(void); - void purgatory(void) { if (!verify_sha256_digest())