Merge pull request #1201 from aozima/cortex-m
[libcpu]: fixed #1196 FPU FPCA issue.
This commit is contained in:
commit
a2f20dde4c
|
@ -145,16 +145,16 @@ switch_to_thread:
|
|||
|
||||
MSR psp, r1 /* update stack pointer */
|
||||
|
||||
pendsv_exit:
|
||||
/* restore interrupt */
|
||||
MSR PRIMASK, r2
|
||||
|
||||
#if defined (__VFP_FP__) && !defined(__SOFTFP__)
|
||||
ORR lr, lr, #0x10 /* lr |= (1 << 4), clean FPCA. */
|
||||
CMP r3, #0 /* if(flag_r3 != 0) */
|
||||
BICNE lr, lr, #0x10 /* lr &= ~(1 << 4), set FPCA. */
|
||||
#endif
|
||||
|
||||
pendsv_exit:
|
||||
/* restore interrupt */
|
||||
MSR PRIMASK, r2
|
||||
|
||||
ORR lr, lr, #0x04
|
||||
BX lr
|
||||
|
||||
|
|
|
@ -149,10 +149,6 @@ skip_pop_fpu
|
|||
|
||||
MSR psp, r1 ; update stack pointer
|
||||
|
||||
pendsv_exit
|
||||
; restore interrupt
|
||||
MSR PRIMASK, r2
|
||||
|
||||
#if defined ( __ARMVFP__ )
|
||||
ORR lr, lr, #0x10 ; lr |= (1 << 4), clean FPCA.
|
||||
CBZ r3, return_without_fpu ; if(flag_r3 != 0)
|
||||
|
@ -160,6 +156,10 @@ pendsv_exit
|
|||
return_without_fpu
|
||||
#endif
|
||||
|
||||
pendsv_exit
|
||||
; restore interrupt
|
||||
MSR PRIMASK, r2
|
||||
|
||||
ORR lr, lr, #0x04
|
||||
BX lr
|
||||
|
||||
|
|
|
@ -147,16 +147,16 @@ switch_to_thread
|
|||
|
||||
MSR psp, r1 ; update stack pointer
|
||||
|
||||
pendsv_exit
|
||||
; restore interrupt
|
||||
MSR PRIMASK, r2
|
||||
|
||||
IF {FPU} != "SoftVFP"
|
||||
ORR lr, lr, #0x10 ; lr |= (1 << 4), clean FPCA.
|
||||
CMP r3, #0 ; if(flag_r3 != 0)
|
||||
BICNE lr, lr, #0x10 ; lr &= ~(1 << 4), set FPCA.
|
||||
ENDIF
|
||||
|
||||
pendsv_exit
|
||||
; restore interrupt
|
||||
MSR PRIMASK, r2
|
||||
|
||||
ORR lr, lr, #0x04
|
||||
BX lr
|
||||
ENDP
|
||||
|
|
|
@ -145,16 +145,16 @@ switch_to_thread:
|
|||
|
||||
MSR psp, r1 /* update stack pointer */
|
||||
|
||||
pendsv_exit:
|
||||
/* restore interrupt */
|
||||
MSR PRIMASK, r2
|
||||
|
||||
#if defined (__VFP_FP__) && !defined(__SOFTFP__)
|
||||
ORR lr, lr, #0x10 /* lr |= (1 << 4), clean FPCA. */
|
||||
CMP r3, #0 /* if(flag_r3 != 0) */
|
||||
BICNE lr, lr, #0x10 /* lr &= ~(1 << 4), set FPCA. */
|
||||
#endif
|
||||
|
||||
pendsv_exit:
|
||||
/* restore interrupt */
|
||||
MSR PRIMASK, r2
|
||||
|
||||
ORR lr, lr, #0x04
|
||||
BX lr
|
||||
|
||||
|
|
|
@ -149,10 +149,6 @@ skip_pop_fpu
|
|||
|
||||
MSR psp, r1 ; update stack pointer
|
||||
|
||||
pendsv_exit
|
||||
; restore interrupt
|
||||
MSR PRIMASK, r2
|
||||
|
||||
#if defined ( __ARMVFP__ )
|
||||
ORR lr, lr, #0x10 ; lr |= (1 << 4), clean FPCA.
|
||||
CBZ r3, return_without_fpu ; if(flag_r3 != 0)
|
||||
|
@ -160,6 +156,10 @@ pendsv_exit
|
|||
return_without_fpu
|
||||
#endif
|
||||
|
||||
pendsv_exit
|
||||
; restore interrupt
|
||||
MSR PRIMASK, r2
|
||||
|
||||
ORR lr, lr, #0x04
|
||||
BX lr
|
||||
|
||||
|
|
|
@ -147,16 +147,16 @@ switch_to_thread
|
|||
|
||||
MSR psp, r1 ; update stack pointer
|
||||
|
||||
pendsv_exit
|
||||
; restore interrupt
|
||||
MSR PRIMASK, r2
|
||||
|
||||
IF {FPU} != "SoftVFP"
|
||||
ORR lr, lr, #0x10 ; lr |= (1 << 4), clean FPCA.
|
||||
CMP r3, #0 ; if(flag_r3 != 0)
|
||||
BICNE lr, lr, #0x10 ; lr &= ~(1 << 4), set FPCA.
|
||||
ENDIF
|
||||
|
||||
pendsv_exit
|
||||
; restore interrupt
|
||||
MSR PRIMASK, r2
|
||||
|
||||
ORR lr, lr, #0x04
|
||||
BX lr
|
||||
ENDP
|
||||
|
|
Loading…
Reference in New Issue