summaryrefslogtreecommitdiff
path: root/libcpu/arm
diff options
context:
space:
mode:
authorShell <[email protected]>2024-05-26 22:00:17 +0800
committerGitHub <[email protected]>2024-05-26 22:00:17 +0800
commit397cdcd1320d096d41523cbbe0bf743e872d5e70 (patch)
tree2403a47fc109405e73269fe590bdc706e1730b55 /libcpu/arm
parent1a1514640a7bb1af107e400b4e27d07f7a7c444f (diff)
[libcpu] discard rt_current_thread (#8976)
* [libcpu] rv64: discard rt_current_thread * arm: using rt_thread_self to fetch current TCB
Diffstat (limited to 'libcpu/arm')
-rw-r--r--libcpu/arm/cortex-m33/context_gcc.S3
-rw-r--r--libcpu/arm/cortex-m7/context_gcc.S3
2 files changed, 2 insertions, 4 deletions
diff --git a/libcpu/arm/cortex-m33/context_gcc.S b/libcpu/arm/cortex-m33/context_gcc.S
index c0bc32222e..adf162f2d3 100644
--- a/libcpu/arm/cortex-m33/context_gcc.S
+++ b/libcpu/arm/cortex-m33/context_gcc.S
@@ -196,8 +196,7 @@ contex_ns_load:
#if defined (RT_USING_MEM_PROTECTION)
PUSH {r0-r3, r12, lr}
- LDR r1, =rt_current_thread
- LDR r0, [r1]
+ BL rt_thread_self
BL rt_hw_mpu_table_switch
POP {r0-r3, r12, lr}
#endif
diff --git a/libcpu/arm/cortex-m7/context_gcc.S b/libcpu/arm/cortex-m7/context_gcc.S
index 14fd3711b3..cbc03e0553 100644
--- a/libcpu/arm/cortex-m7/context_gcc.S
+++ b/libcpu/arm/cortex-m7/context_gcc.S
@@ -156,8 +156,7 @@ switch_to_thread:
#if defined (RT_USING_MEM_PROTECTION)
PUSH {r0-r3, r12, lr}
- LDR r1, =rt_current_thread
- LDR r0, [r1]
+ BL rt_thread_self
BL rt_hw_mpu_table_switch
POP {r0-r3, r12, lr}
#endif