mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-05-29 02:28:35 +08:00
[libcpu][cortex-m33]Added HardFault_Handler to save floating point registers
ToolsCI / Tools (push) Has been cancelled
AutoTestCI / components/cpp11 (push) Has been cancelled
AutoTestCI / kernel/atomic (push) Has been cancelled
AutoTestCI / kernel/atomic/riscv64 (push) Has been cancelled
AutoTestCI / kernel/atomic_c11 (push) Has been cancelled
AutoTestCI / kernel/atomic_c11/riscv64 (push) Has been cancelled
AutoTestCI / kernel/device (push) Has been cancelled
AutoTestCI / kernel/ipc (push) Has been cancelled
AutoTestCI / kernel/irq (push) Has been cancelled
AutoTestCI / kernel/mem (push) Has been cancelled
AutoTestCI / kernel/mem/riscv64 (push) Has been cancelled
AutoTestCI / kernel/thread (push) Has been cancelled
AutoTestCI / kernel/timer (push) Has been cancelled
AutoTestCI / rtsmart/aarch64 (push) Has been cancelled
AutoTestCI / rtsmart/arm (push) Has been cancelled
AutoTestCI / rtsmart/riscv64 (push) Has been cancelled
AutoTestCI / components/utest (push) Has been cancelled
RT-Thread BSP Static Build Check / 🔍 Summary of Git Diff Changes (push) Has been cancelled
RT-Thread BSP Static Build Check / ${{ matrix.legs.RTT_BSP }} (push) Has been cancelled
RT-Thread BSP Static Build Check / collect-artifacts (push) Has been cancelled
pkgs_test / change (push) Has been cancelled
utest_auto_run / AARCH64-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / A9-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / RISCV-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / XUANTIE-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / AARCH64 :default.cfg (push) Has been cancelled
utest_auto_run / A9 :default.cfg (push) Has been cancelled
utest_auto_run / A9-smp :default.cfg (push) Has been cancelled
utest_auto_run / RISCV :default.cfg (push) Has been cancelled
ToolsCI / Tools (push) Has been cancelled
AutoTestCI / components/cpp11 (push) Has been cancelled
AutoTestCI / kernel/atomic (push) Has been cancelled
AutoTestCI / kernel/atomic/riscv64 (push) Has been cancelled
AutoTestCI / kernel/atomic_c11 (push) Has been cancelled
AutoTestCI / kernel/atomic_c11/riscv64 (push) Has been cancelled
AutoTestCI / kernel/device (push) Has been cancelled
AutoTestCI / kernel/ipc (push) Has been cancelled
AutoTestCI / kernel/irq (push) Has been cancelled
AutoTestCI / kernel/mem (push) Has been cancelled
AutoTestCI / kernel/mem/riscv64 (push) Has been cancelled
AutoTestCI / kernel/thread (push) Has been cancelled
AutoTestCI / kernel/timer (push) Has been cancelled
AutoTestCI / rtsmart/aarch64 (push) Has been cancelled
AutoTestCI / rtsmart/arm (push) Has been cancelled
AutoTestCI / rtsmart/riscv64 (push) Has been cancelled
AutoTestCI / components/utest (push) Has been cancelled
RT-Thread BSP Static Build Check / 🔍 Summary of Git Diff Changes (push) Has been cancelled
RT-Thread BSP Static Build Check / ${{ matrix.legs.RTT_BSP }} (push) Has been cancelled
RT-Thread BSP Static Build Check / collect-artifacts (push) Has been cancelled
pkgs_test / change (push) Has been cancelled
utest_auto_run / AARCH64-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / A9-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / RISCV-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / XUANTIE-rtsmart :default.cfg (push) Has been cancelled
utest_auto_run / AARCH64 :default.cfg (push) Has been cancelled
utest_auto_run / A9 :default.cfg (push) Has been cancelled
utest_auto_run / A9-smp :default.cfg (push) Has been cancelled
utest_auto_run / RISCV :default.cfg (push) Has been cancelled
This commit is contained in:
@@ -281,6 +281,12 @@ HardFault_Handler:
|
|||||||
MRS r0, psp /* get fault context from thread. */
|
MRS r0, psp /* get fault context from thread. */
|
||||||
get_sp_done:
|
get_sp_done:
|
||||||
|
|
||||||
|
#if defined (__VFP_FP__) && !defined(__SOFTFP__)
|
||||||
|
TST lr, #0x10 /* if(!EXC_RETURN[4]) */
|
||||||
|
IT EQ
|
||||||
|
VSTMDBEQ r0!, {d8 - d15} /* push FPU register s16~s31 */
|
||||||
|
#endif
|
||||||
|
|
||||||
STMFD r0!, {r4 - r11} /* push r4 - r11 register */
|
STMFD r0!, {r4 - r11} /* push r4 - r11 register */
|
||||||
|
|
||||||
LDR r2, =rt_trustzone_current_context /* r2 = &rt_secure_current_context */
|
LDR r2, =rt_trustzone_current_context /* r2 = &rt_secure_current_context */
|
||||||
|
|||||||
@@ -275,6 +275,13 @@ HardFault_Handler:
|
|||||||
MRS r0, psp ; get fault context from thread.
|
MRS r0, psp ; get fault context from thread.
|
||||||
get_sp_done
|
get_sp_done
|
||||||
|
|
||||||
|
#if defined ( __ARMVFP__ )
|
||||||
|
TST lr, #0x10 ; if(!EXC_RETURN[4])
|
||||||
|
BNE skip_push_fpu
|
||||||
|
VSTMDB r0!, {d8 - d15} ; push FPU register s16~s31
|
||||||
|
skip_push_fpu
|
||||||
|
#endif
|
||||||
|
|
||||||
STMFD r0!, {r4 - r11} ; push r4 - r11 register
|
STMFD r0!, {r4 - r11} ; push r4 - r11 register
|
||||||
|
|
||||||
LDR r2, =rt_trustzone_current_context ; r2 = &rt_secure_current_context
|
LDR r2, =rt_trustzone_current_context ; r2 = &rt_secure_current_context
|
||||||
|
|||||||
@@ -272,12 +272,17 @@ rt_hw_interrupt_thread_switch PROC
|
|||||||
HardFault_Handler PROC
|
HardFault_Handler PROC
|
||||||
|
|
||||||
; get current context
|
; get current context
|
||||||
MRS r0, msp ;get fault context from handler
|
MRS r0, msp ; get fault context from handler
|
||||||
TST lr, #0x04 ;if(!EXC_RETURN[2])
|
TST lr, #0x04 ; if(!EXC_RETURN[2])
|
||||||
BEQ get_sp_done
|
BEQ get_sp_done
|
||||||
MRS r0, psp ;get fault context from thread
|
MRS r0, psp ; get fault context from thread
|
||||||
get_sp_done
|
get_sp_done
|
||||||
|
|
||||||
|
IF {FPU} != "SoftVFP"
|
||||||
|
TST lr, #0x10 ; if(!EXC_RETURN[4])
|
||||||
|
VSTMFDEQ r0!, {d8 - d15} ; push FPU register s16~s31
|
||||||
|
ENDIF
|
||||||
|
|
||||||
STMFD r0!, {r4 - r11} ; push r4 - r11 register
|
STMFD r0!, {r4 - r11} ; push r4 - r11 register
|
||||||
|
|
||||||
LDR r2, =rt_trustzone_current_context ; r2 = &rt_secure_current_context
|
LDR r2, =rt_trustzone_current_context ; r2 = &rt_secure_current_context
|
||||||
|
|||||||
Reference in New Issue
Block a user