[PATCH v4 03/14] riscv: add initjmp()
Jerome Forissier
jerome.forissier at linaro.org
Tue Mar 18 11:46:39 CET 2025
Implement initjmp() for RISC-V.
Signed-off-by: Jerome Forissier <jerome.forissier at linaro.org>
---
arch/Kconfig | 1 +
arch/riscv/lib/setjmp.S | 11 +++++++++++
2 files changed, 12 insertions(+)
diff --git a/arch/Kconfig b/arch/Kconfig
index 7a3141e92b3..aa60c5ff03c 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -153,6 +153,7 @@ config RISCV
bool "RISC-V architecture"
select CREATE_ARCH_SYMLINK
select HAVE_SETJMP
+ select HAVE_INITJMP
select SUPPORT_ACPI
select SUPPORT_LITTLE_ENDIAN
select SUPPORT_OF_CONTROL
diff --git a/arch/riscv/lib/setjmp.S b/arch/riscv/lib/setjmp.S
index 99d6195827e..9e1f3d5749b 100644
--- a/arch/riscv/lib/setjmp.S
+++ b/arch/riscv/lib/setjmp.S
@@ -59,3 +59,14 @@ ENTRY(longjmp)
ret
ENDPROC(longjmp)
.popsection
+
+.pushsection .text.initjmp, "ax"
+ENTRY(initjmp)
+ /* a1: entry point address, a2: stack base, a3: stack size */
+ add a2, a2, a3
+ STORE_IDX(a1, 12)
+ STORE_IDX(a2, 13)
+ li a0, 0
+ ret
+ENDPROC(initjmp)
+.popsection
--
2.43.0
More information about the U-Boot
mailing list