From 2539ba1c01236490eab9c03eeb17c4221c837346 Mon Sep 17 00:00:00 2001 From: lipengfei28 Date: Thu, 12 Sep 2024 17:51:32 +0800 Subject: [PATCH] Kernel build: enter exception save sp_sl0,exit exception restroe sp_el0 Signed-off-by: lipengfei28 --- 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 21b70d2575207..34d77f787dc92 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 x0, x1, [sp, #8 * REG_ELR] + mrs x0, sp_el0 + mrs x1, tpidrro_el0 + stp x0, x1, [sp, #8 * REG_SP_EL0] + /* Increment exception depth */ mrs x0, tpidrro_el0 @@ -262,6 +266,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