File tree Expand file tree Collapse file tree 3 files changed +21
-3
lines changed Expand file tree Collapse file tree 3 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -281,6 +281,12 @@ HardFault_Handler:
281
281
MRS r0 , psp / * get fault context from thread. * /
282
282
get_sp_done:
283
283
284
+ #if defined (__VFP_FP__) && !defined(__SOFTFP__)
285
+ TST lr , # 0x10 / * if(!EXC_RETURN [ 4 ] ) * /
286
+ IT EQ
287
+ VSTMDBEQ r0! , {d8 - d15} / * push FPU register s16~s31 * /
288
+ #endif
289
+
284
290
STMFD r0! , {r4 - r11 } / * push r4 - r11 register * /
285
291
286
292
LDR r2 , =rt_trustzone_current_context / * r2 = &rt_secure_current_context * /
Original file line number Diff line number Diff line change @@ -275,6 +275,13 @@ HardFault_Handler:
275
275
MRS r0 , psp ; get fault context from thread.
276
276
get_sp_done
277
277
278
+ #if defined ( __ARMVFP__ )
279
+ TST lr , # 0x10 ; if(!EXC_RETURN[4])
280
+ BNE skip_push_fpu
281
+ VSTMDB r0! , {d8 - d15} ; push FPU register s16~s31
282
+ skip_push_fpu
283
+ #endif
284
+
278
285
STMFD r0! , {r4 - r11 } ; push r4 - r11 register
279
286
280
287
LDR r2 , =rt_trustzone_current_context ; r2 = &rt_secure_current_context
Original file line number Diff line number Diff line change @@ -272,12 +272,17 @@ rt_hw_interrupt_thread_switch PROC
272
272
HardFault_Handler PROC
273
273
274
274
; get current context
275
- MRS r0 , msp ;get fault context from handler
276
- TST lr , # 0x04 ;if(!EXC_RETURN[2])
275
+ MRS r0 , msp ; get fault context from handler
276
+ TST lr , # 0x04 ; if(!EXC_RETURN[2])
277
277
BEQ get_sp_done
278
- MRS r0 , psp ;get fault context from thread
278
+ MRS r0 , psp ; get fault context from thread
279
279
get_sp_done
280
280
281
+ IF {FPU} != "SoftVFP"
282
+ TST lr , # 0x10 ; if(!EXC_RETURN[4])
283
+ VSTMFDEQ r0! , {d8 - d15} ; push FPU register s16~s31
284
+ ENDIF
285
+
281
286
STMFD r0! , {r4 - r11 } ; push r4 - r11 register
282
287
283
288
LDR r2 , =rt_trustzone_current_context ; r2 = &rt_secure_current_context
You can’t perform that action at this time.
0 commit comments