summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1996-08-15 21:05:21 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1996-08-15 21:05:21 +0000
commit0600e86f616de2d1b8d60b88775b8e34360c3111 (patch)
treeddf019905312908797a04f471476c6454b259f8c /cpukit/score/src
parentchanged ENOMEM error message (diff)
downloadrtems-0600e86f616de2d1b8d60b88775b8e34360c3111.tar.bz2
_Thread_Start_multitasking: added code to initialize the floating point
context of the first thread to execute.
Diffstat (limited to 'cpukit/score/src')
-rw-r--r--cpukit/score/src/thread.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/cpukit/score/src/thread.c b/cpukit/score/src/thread.c
index 679c168e39..9060185348 100644
--- a/cpukit/score/src/thread.c
+++ b/cpukit/score/src/thread.c
@@ -197,7 +197,31 @@ void _Thread_Start_multitasking( void )
_Thread_Executing = _Thread_Heir;
- _Context_Switch( &_Thread_BSP_context, &_Thread_Executing->Registers );
+ /*
+ * Get the init task(s) running.
+ *
+ * Note: Thread_Dispatch() is normally used to dispatch threads. As
+ * part of its work, Thread_Dispatch() restores floating point
+ * state for the heir task.
+ *
+ * This code avoids Thread_Dispatch(), and so we have to restore
+ * (actually initialize) the floating point state "by hand".
+ *
+ * Ignore the CPU_USE_DEFERRED_FP_SWITCH because we must always
+ * switch in the first thread if it is FP.
+ */
+
+
+#if ( CPU_HARDWARE_FP == TRUE )
+ /*
+ * don't need to worry about saving BSP's floating point state
+ */
+
+ if ( _Thread_Heir->fp_context != NULL )
+ _Context_Restore_fp( &_Thread_Heir->fp_context );
+#endif
+
+ _Context_Switch( &_Thread_BSP_context, &_Thread_Heir->Registers );
}
/*PAGE