From 0600e86f616de2d1b8d60b88775b8e34360c3111 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 15 Aug 1996 21:05:21 +0000 Subject: _Thread_Start_multitasking: added code to initialize the floating point context of the first thread to execute. --- cpukit/score/src/thread.c | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'cpukit/score/src') 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 -- cgit v1.2.3