This is an automated email from the ASF dual-hosted git repository.
GUIDINGLI pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 6f0036b2b74 arch/arm64: not use tpidrro_el0 store exception_depth
6f0036b2b74 is described below
commit 6f0036b2b74fae33bb15cb9d94b6300ba6978d3c
Author: hujun5 <[email protected]>
AuthorDate: Wed Nov 19 10:20:39 2025 +0800
arch/arm64: not use tpidrro_el0 store exception_depth
not use tpidrro_el0 store exception_depth
Signed-off-by: hujun5 <[email protected]>
---
arch/arm64/src/common/arm64_arch.h | 15 ---------------
arch/arm64/src/common/arm64_cpustart.c | 3 ---
arch/arm64/src/common/arm64_initialstate.c | 5 +----
arch/arm64/src/common/arm64_vector_table.S | 18 ++----------------
4 files changed, 3 insertions(+), 38 deletions(-)
diff --git a/arch/arm64/src/common/arm64_arch.h
b/arch/arm64/src/common/arm64_arch.h
index 49f08cc0b4d..d80dc171248 100644
--- a/arch/arm64/src/common/arm64_arch.h
+++ b/arch/arm64/src/common/arm64_arch.h
@@ -425,21 +425,6 @@ void modifyreg8(unsigned int addr, uint8_t clearbits,
uint8_t setbits);
void modifyreg16(unsigned int addr, uint16_t clearbits, uint16_t setbits);
void modifyreg32(unsigned int addr, uint32_t clearbits, uint32_t setbits);
-/****************************************************************************
- * Name:
- * arch_get_exception_depth
- *
- * Description:
- * tpidrro_el0 is used to record exception depth, it's used for fpu trap
- * happened at exception context (like IRQ).
- *
- ****************************************************************************/
-
-static inline int arch_get_exception_depth(void)
-{
- return read_sysreg(tpidrro_el0);
-}
-
void arch_cpu_idle(void);
/****************************************************************************
diff --git a/arch/arm64/src/common/arm64_cpustart.c
b/arch/arm64/src/common/arm64_cpustart.c
index 92709b06a3c..7b460ff24fa 100644
--- a/arch/arm64/src/common/arm64_cpustart.c
+++ b/arch/arm64/src/common/arm64_cpustart.c
@@ -143,9 +143,6 @@ static void arm64_smp_init_top(void)
sched_note_cpu_started(tcb);
#endif
- /* core n, idle n */
-
- write_sysreg(0, tpidrro_el0);
UNUSED(tcb);
nx_idle_trampoline();
diff --git a/arch/arm64/src/common/arm64_initialstate.c
b/arch/arm64/src/common/arm64_initialstate.c
index ebd2ddea8a5..756acf108e3 100644
--- a/arch/arm64/src/common/arm64_initialstate.c
+++ b/arch/arm64/src/common/arm64_initialstate.c
@@ -152,11 +152,8 @@ void up_initial_state(struct tcb_s *tcb)
tcb->stack_base_ptr = tcb->stack_alloc_ptr;
tcb->adj_stack_size = CONFIG_IDLETHREAD_STACKSIZE;
- /* set initialize idle thread tcb and exception depth
- * core 0, idle0
- */
+ /* set initialize idle thread tcb core 0, idle0 */
- write_sysreg(0, tpidrro_el0);
write_sysreg(tcb->stack_alloc_ptr, tpidr_el0);
#ifdef CONFIG_STACK_COLORATION
diff --git a/arch/arm64/src/common/arm64_vector_table.S
b/arch/arm64/src/common/arm64_vector_table.S
index 588a38b9e47..dc9668ee0cb 100644
--- a/arch/arm64/src/common/arm64_vector_table.S
+++ b/arch/arm64/src/common/arm64_vector_table.S
@@ -122,13 +122,7 @@
str \xreg0, [sp, #8 * REG_SCTLR_EL1]
mrs \xreg0, sp_el0
- mrs \xreg1, tpidrro_el0
- stp \xreg0, \xreg1, [sp, #8 * REG_SP_EL0]
-
- /* Increment exception depth */
-
- add \xreg1, \xreg1, #1
- msr tpidrro_el0, \xreg1
+ str \xreg0, [sp, #8 * REG_SP_EL0]
/* Save the FPU registers */
@@ -416,16 +410,8 @@ SECTION_FUNC(text, arm64_exit_exception)
ldr x0, [sp, #8 * REG_TPIDR_EL0]
msr tpidr_el0, x0
- ldp x0, x1, [sp, #8 * REG_SP_EL0]
+ ldr x0, [sp, #8 * REG_SP_EL0]
msr sp_el0, x0
- msr tpidrro_el0, x1
-
- /* decrement exception depth */
-
- mrs x0, tpidrro_el0
- mov x1, #1
- sub x0, x0, x1
- msr tpidrro_el0, x0
ldp x0, x1, [sp, #8 * REG_X0]
ldp x2, x3, [sp, #8 * REG_X2]