You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2024/10/02 06:09:31 UTC
(nuttx) 03/04: Kernel build: enter exception save sp_sl0,exit exception restroe sp_el0
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 8e200e69d46dfd95f4f340132bd79643895308d1
Author: lipengfei28 <li...@xiaomi.com>
AuthorDate: Thu Sep 12 17:51:32 2024 +0800
Kernel build: enter exception save sp_sl0,exit exception restroe sp_el0
Signed-off-by: lipengfei28 <li...@xiaomi.com>
---
arch/arm64/src/common/arm64_vector_table.S | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/arch/arm64/src/common/arm64_vector_table.S b/arch/arm64/src/common/arm64_vector_table.S
index 7ae82d7308..8f58891c54 100644
--- a/arch/arm64/src/common/arm64_vector_table.S
+++ b/arch/arm64/src/common/arm64_vector_table.S
@@ -78,6 +78,10 @@
#endif
stp \xreg0, \xreg1, [sp, #8 * REG_ELR]
+ mrs \xreg0, sp_el0
+ mrs \xreg1, tpidrro_el0
+ stp \xreg0, \xreg1, [sp, #8 * REG_SP_EL0]
+
/* Increment exception depth */
mrs \xreg0, tpidrro_el0
@@ -261,6 +265,10 @@ SECTION_FUNC(text, arm64_exit_exception)
msr spsr_el1, x1
#endif
+ ldp x0, x1, [sp, #8 * REG_SP_EL0]
+ msr sp_el0, x0
+ msr tpidrro_el0, x1
+
/* decrement exception depth */
mrs x0, tpidrro_el0