2001-11-27 Joel Sherrill <joel@OARcorp.com>,

This was tracked as PR89.
	* inline/rtems/score/thread.inl, macros/rtems/score/thread.inl,
	src/threadclose.c: Do not reference FP context if the CPU does
	not have an FPU.
This commit is contained in:
Joel Sherrill
2001-11-28 01:21:16 +00:00
parent f3dc8e62bc
commit 09b3a2facd
3 changed files with 20 additions and 1 deletions

View File

@@ -111,8 +111,10 @@ RTEMS_INLINE_ROUTINE void _Thread_Unblock (
RTEMS_INLINE_ROUTINE void _Thread_Restart_self( void )
{
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
if ( _Thread_Executing->fp_context != NULL )
_Context_Restore_fp( &_Thread_Executing->fp_context );
#endif
_CPU_Context_Restart_self( &_Thread_Executing->Registers );
}
@@ -144,12 +146,14 @@ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void )
* FALSE otherwise.
*/
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
RTEMS_INLINE_ROUTINE boolean _Thread_Is_allocated_fp (
Thread_Control *the_thread
)
{
return ( the_thread == _Thread_Allocated_fp );
}
#endif
/*PAGE
*
@@ -161,10 +165,12 @@ RTEMS_INLINE_ROUTINE boolean _Thread_Is_allocated_fp (
* point context is now longer associated with an active thread.
*/
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
RTEMS_INLINE_ROUTINE void _Thread_Deallocate_fp( void )
{
_Thread_Allocated_fp = NULL;
}
#endif
/*PAGE
*

View File

@@ -67,6 +67,7 @@
*
*/
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
#define _Thread_Restart_self() \
{ \
if ( _Thread_Executing->fp_context != NULL ) \
@@ -74,6 +75,12 @@
\
_CPU_Context_Restart_self( &_Thread_Executing->Registers ); \
}
#else
#define _Thread_Restart_self() \
{ \
_CPU_Context_Restart_self( &_Thread_Executing->Registers ); \
}
#endif
/*PAGE
*
@@ -96,8 +103,10 @@
*
*/
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
#define _Thread_Is_allocated_fp( _the_thread ) \
( (_the_thread) == _Thread_Allocated_fp )
#endif
/*PAGE
*
@@ -105,8 +114,10 @@
*
*/
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
#define _Thread_Deallocate_fp() \
_Thread_Allocated_fp = NULL
#endif
/*PAGE
*

View File

@@ -53,6 +53,7 @@ void _Thread_Close(
_User_extensions_Thread_delete( the_thread );
#if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE )
#if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE )
if ( _Thread_Is_allocated_fp( the_thread ) )
_Thread_Deallocate_fp();
@@ -61,6 +62,7 @@ void _Thread_Close(
if ( the_thread->Start.fp_context )
(void) _Workspace_Free( the_thread->Start.fp_context );
#endif
_Thread_Stack_Free( the_thread );