[PATCH 2/2] riscv/purgatory: add asm/purgatory.h
From: Thorsten Blum
Date: Sun Apr 12 2026 - 15:45:33 EST
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 <thorsten.blum@xxxxxxxxx>
---
arch/riscv/include/asm/purgatory.h | 11 +++++++++++
arch/riscv/purgatory/purgatory.c | 5 +----
2 files changed, 12 insertions(+), 4 deletions(-)
create mode 100644 arch/riscv/include/asm/purgatory.h
diff --git a/arch/riscv/include/asm/purgatory.h b/arch/riscv/include/asm/purgatory.h
new file mode 100644
index 000000000000..a63687be2517
--- /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 <linux/purgatory.h>
+
+extern 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 15c72dafa3d8..6a6e6f611a56 100644
--- a/arch/riscv/purgatory/purgatory.c
+++ b/arch/riscv/purgatory/purgatory.c
@@ -8,9 +8,9 @@
*
*/
-#include <linux/purgatory.h>
#include <linux/kernel.h>
#include <linux/string.h>
+#include <asm/purgatory.h>
#include <asm/string.h>
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));
}
-/* workaround for a warning with -Wmissing-prototypes */
-void purgatory(void);
-
void purgatory(void)
{
if (verify_sha256_digest())