summaryrefslogtreecommitdiffstats
path: root/c/src/exec/score/src/threaddispatch.c
diff options
context:
space:
mode:
Diffstat (limited to 'c/src/exec/score/src/threaddispatch.c')
-rw-r--r--c/src/exec/score/src/threaddispatch.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/c/src/exec/score/src/threaddispatch.c b/c/src/exec/score/src/threaddispatch.c
index 66a8996a12..18953ae596 100644
--- a/c/src/exec/score/src/threaddispatch.c
+++ b/c/src/exec/score/src/threaddispatch.c
@@ -93,24 +93,28 @@ void _Thread_Dispatch( void )
*/
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
+#if ( CPU_USE_DEFERRED_FP_SWITCH != TRUE )
+ if ( executing->fp_context != NULL )
+ _Context_Save_fp( &executing->fp_context );
+#endif
+#endif
+
+ _Context_Switch( &executing->Registers, &heir->Registers );
+
+#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
#if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE )
- if ( (heir->fp_context != NULL) && !_Thread_Is_allocated_fp( heir ) ) {
+ if ( (executing->fp_context != NULL) && !_Thread_Is_allocated_fp( executing ) ) {
if ( _Thread_Allocated_fp != NULL )
_Context_Save_fp( &_Thread_Allocated_fp->fp_context );
- _Context_Restore_fp( &heir->fp_context );
- _Thread_Allocated_fp = heir;
+ _Context_Restore_fp( &executing->fp_context );
+ _Thread_Allocated_fp = executing;
}
#else
if ( executing->fp_context != NULL )
- _Context_Save_fp( &executing->fp_context );
-
- if ( heir->fp_context != NULL )
- _Context_Restore_fp( &heir->fp_context );
+ _Context_Restore_fp( &executing->fp_context );
#endif
#endif
- _Context_Switch( &executing->Registers, &heir->Registers );
-
executing = _Thread_Executing;
_ISR_Disable( level );