From: Thorsten Blum <thorsten.blum@linux.dev>
To: Paul Walmsley <pjw@kernel.org>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Alexandre Ghiti <alex@ghiti.fr>,
Eric Biggers <ebiggers@kernel.org>,
Ard Biesheuvel <ardb@kernel.org>
Cc: Thorsten Blum <thorsten.blum@linux.dev>,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 2/2] riscv/purgatory: add asm/purgatory.h
Date: Sat, 9 May 2026 09:38:51 +0200 [thread overview]
Message-ID: <20260509073850.44595-4-thorsten.blum@linux.dev> (raw)
In-Reply-To: <20260509073850.44595-3-thorsten.blum@linux.dev>
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@linux.dev>
---
No changes in patch 2/2.
---
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 745deeb6e3a5..3474e3abe5d7 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)) == 0;
}
-/* workaround for a warning with -Wmissing-prototypes */
-void purgatory(void);
-
void purgatory(void)
{
if (!verify_sha256_digest())
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
WARNING: multiple messages have this Message-ID (diff)
From: Thorsten Blum <thorsten.blum@linux.dev>
To: Paul Walmsley <pjw@kernel.org>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Alexandre Ghiti <alex@ghiti.fr>,
Eric Biggers <ebiggers@kernel.org>,
Ard Biesheuvel <ardb@kernel.org>
Cc: Thorsten Blum <thorsten.blum@linux.dev>,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 2/2] riscv/purgatory: add asm/purgatory.h
Date: Sat, 9 May 2026 09:38:51 +0200 [thread overview]
Message-ID: <20260509073850.44595-4-thorsten.blum@linux.dev> (raw)
In-Reply-To: <20260509073850.44595-3-thorsten.blum@linux.dev>
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@linux.dev>
---
No changes in patch 2/2.
---
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 745deeb6e3a5..3474e3abe5d7 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)) == 0;
}
-/* workaround for a warning with -Wmissing-prototypes */
-void purgatory(void);
-
void purgatory(void)
{
if (!verify_sha256_digest())
next prev parent reply other threads:[~2026-05-09 7:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-09 7:38 [PATCH v2 1/2] riscv/purgatory: return bool from verify_sha256_digest Thorsten Blum
2026-05-09 7:38 ` Thorsten Blum
2026-05-09 7:38 ` Thorsten Blum [this message]
2026-05-09 7:38 ` [PATCH v2 2/2] riscv/purgatory: add asm/purgatory.h Thorsten Blum
2026-05-13 22:58 ` Paul Walmsley
2026-05-13 22:58 ` Paul Walmsley
2026-05-13 22:57 ` [PATCH v2 1/2] riscv/purgatory: return bool from verify_sha256_digest Paul Walmsley
2026-05-13 22:57 ` Paul Walmsley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260509073850.44595-4-thorsten.blum@linux.dev \
--to=thorsten.blum@linux.dev \
--cc=alex@ghiti.fr \
--cc=aou@eecs.berkeley.edu \
--cc=ardb@kernel.org \
--cc=ebiggers@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=pjw@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.