@@ -955,7 +955,12 @@ _xt_coproc_exc:
955
955
956
956
/ * Get co - processor state save area of new owner thread. * /
957
957
call0 XT_RTOS_CP_STATE / * a15 = new owner's save area * /
958
- beqz a15 , .L_goto_invalid / * not in a thread (invalid) * /
958
+
959
+ #ifndef CONFIG_FREERTOS_FPU_IN_ISR
960
+ beqz a15 , .L_goto_invalid
961
+ #endif
962
+
963
+ / * When FPU in ISR is enabled we could deal with zeroed a15 * /
959
964
960
965
/ * Enable the co - processor's bit in CPENABLE. * /
961
966
movi a0 , _xt_coproc_mask
@@ -997,7 +1002,13 @@ locking.
997
1002
rsync / * ensure wsr.CPENABLE is complete * /
998
1003
999
1004
/ * Only need to context switch if new owner != old owner. * /
1005
+ / * If float is necessary on ISR , we need to remove this check * /
1006
+ / * below , because on restoring from ISR we may have new == old condition used
1007
+ * to force cp restore to next thread
1008
+ * /
1009
+ #ifndef CONFIG_FREERTOS_FPU_IN_ISR
1000
1010
beq a15 , a2 , .L_goto_done / * new owner == old , we're done * /
1011
+ #endif
1001
1012
1002
1013
/ * If no old owner then nothing to save. * /
1003
1014
beqz a2 , .L_check_new
@@ -1039,6 +1050,7 @@ locking.
1039
1050
.L_check_new:
1040
1051
/ * Check if any state has to be restored for new owner. * /
1041
1052
/ * NOTE: a15 = new owner's save area , cannot be zero when we get here. * /
1053
+ beqz a15 , .L_xt_coproc_done
1042
1054
1043
1055
l16ui a3 , a15 , XT_CPSTORED / * a3 = new owner's CPSTORED * /
1044
1056
movi a4 , _xt_coproc_sa_offset
@@ -1133,7 +1145,6 @@ _xt_lowint1:
1133
1145
#endif
1134
1146
#endif
1135
1147
1136
-
1137
1148
/ * Save rest of interrupt context and enter RTOS. * /
1138
1149
call0 XT_RTOS_INT_ENTER / * common RTOS interrupt entry * /
1139
1150
0 commit comments