mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-05-16 11:38:11 +08:00
[libcpu][cortex-m4]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:
@@ -238,10 +238,23 @@ HardFault_Handler:
|
||||
MRS r0, psp /* get fault context from thread. */
|
||||
_get_sp_done:
|
||||
|
||||
STMFD r0!, {r4 - r11} /* push r4 - r11 register */
|
||||
#if defined (__VFP_FP__) && !defined(__SOFTFP__)
|
||||
STMFD r0!, {lr} /* push dummy for flag */
|
||||
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 */
|
||||
|
||||
#if defined (__VFP_FP__) && !defined(__SOFTFP__)
|
||||
MOV r4, #0x00 /* flag = 0 */
|
||||
|
||||
TST lr, #0x10 /* if(!EXC_RETURN[4]) */
|
||||
IT EQ
|
||||
MOVEQ r4, #0x01 /* flag = 1 */
|
||||
STMFD r0!, {r4} /* push flag */
|
||||
#endif
|
||||
|
||||
STMFD r0!, {lr} /* push exec_return register */
|
||||
|
||||
TST lr, #0x04 /* if(!EXC_RETURN[2]) */
|
||||
|
||||
@@ -237,14 +237,28 @@ HardFault_Handler:
|
||||
MRS r0, psp ; get fault context from thread.
|
||||
_get_sp_done
|
||||
|
||||
STMFD r0!, {r4 - r11} ; push r4 - r11 register
|
||||
;STMFD r0!, {lr} ; push exec_return register
|
||||
#if defined ( __ARMVFP__ )
|
||||
SUB r0, r0, #0x04 ; push dummy for flag
|
||||
STR lr, [r0]
|
||||
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
|
||||
|
||||
#if defined ( __ARMVFP__ )
|
||||
MOV r4, #0x00 ; flag = 0
|
||||
|
||||
TST lr, #0x10 ; if(!EXC_RETURN[4])
|
||||
BNE push_flag
|
||||
MOV r4, #0x01 ; flag = 1
|
||||
push_flag
|
||||
SUB r0, r0, #0x04
|
||||
STR lr, [r0]
|
||||
STR r4, [r0] ; push flag
|
||||
#endif
|
||||
|
||||
SUB r0, r0, #0x04
|
||||
STR lr, [r0] ; push exec_return register
|
||||
|
||||
TST lr, #0x04 ; if(!EXC_RETURN[2])
|
||||
BEQ _update_msp
|
||||
|
||||
@@ -236,10 +236,21 @@ HardFault_Handler PROC
|
||||
MRSEQ r0, msp ; [2]=0 ==> Z=1, get fault context from handler.
|
||||
MRSNE r0, psp ; [2]=1 ==> Z=0, get fault context from thread.
|
||||
|
||||
STMFD r0!, {r4 - r11} ; push r4 - r11 register
|
||||
IF {FPU} != "SoftVFP"
|
||||
STMFD r0!, {lr} ; push dummy for flag
|
||||
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
|
||||
|
||||
IF {FPU} != "SoftVFP"
|
||||
MOV r4, #0x00 ; flag = 0
|
||||
|
||||
TST lr, #0x10 ; if(!EXC_RETURN[4])
|
||||
MOVEQ r4, #0x01 ; flag = 1
|
||||
STMFD r0!, {r4} ; push flag
|
||||
ENDIF
|
||||
|
||||
STMFD r0!, {lr} ; push exec_return register
|
||||
|
||||
TST lr, #0x04 ; if(!EXC_RETURN[2])
|
||||
|
||||
Reference in New Issue
Block a user