leon1 Re: undefined reference to `_CPU_Context_restore_fp'

Joel Sherrill joel.sherrill at OARcorp.com
Thu Nov 15 18:05:30 UTC 2001



Jiri Gaisler wrote:
> 
> Joel Sherrill wrote:
> >
> > What version of RTEMS is this with?  Is it a standard OAR distribution
> > or Jiri Gaisler's 4.5.0+?  This sounds like a simple mistake in
> > thread.inl where restart is not honoring soft float. We just need to
> > know the version.
> >
> 
> I get the same problem on my version (4.5.0+). There seems to be
> two thread.inl:
> 
> exec/score/inline/rtems/score/thread.inl
> exec/score/macros/rtems/score/thread.inl
> 
> Both of them calls various FPU save/restore functions. I guess these
> functions should be define as empty if not FPU is configured....?

I think all FPU operations are protected in the CVS trunk source but
not in the 4.5 branch.  I have extracted the patch that was on the trunk.
Try applying it to the two files in question.  

Let me know if this works and I will merge the patch onto the 4.5-branch
so pre3 has it.

> Jiri.
> -------------------------------------------------------------------------
> Gaisler Research, Stora Nygatan 13, 411 08 Goteborg, Sweden, +46-31802405
> fax: +44-870-1361460 email: info at gaisler.com, home page: www.gaisler.com
> -------------------------------------------------------------------------

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel at OARcorp.com                 On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985
-------------- next part --------------
===================================================================
RCS file: /usr1/CVS/rtems/c/src/exec/score/macros/rtems/score/thread.inl,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- rtems/c/src/exec/score/macros/rtems/score/thread.inl	1999/11/17 17:50:38	1.10
+++ rtems/c/src/exec/score/macros/rtems/score/thread.inl	2000/07/26 19:26:27	1.11
@@ -10,7 +10,7 @@
  *  found in the file LICENSE in this distribution or at
  *  http://www.OARcorp.com/rtems/license.html.
  *
- *  $Id: thread.inl,v 1.10 1999/11/17 17:50:38 joel Exp $
+ *  $Id: thread.inl,v 1.11 2000/07/26 19:26:27 joel Exp $
  */
 
 #ifndef __THREAD_inl
@@ -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
  *
-------------- next part --------------
===================================================================
RCS file: /usr1/CVS/rtems/c/src/exec/score/inline/rtems/score/thread.inl,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- rtems/c/src/exec/score/inline/rtems/score/thread.inl	1999/11/17 17:50:37	1.14
+++ rtems/c/src/exec/score/inline/rtems/score/thread.inl	2000/07/26 19:26:27	1.15
@@ -10,7 +10,7 @@
  *  found in the file LICENSE in this distribution or at
  *  http://www.OARcorp.com/rtems/license.html.
  *
- *  $Id: thread.inl,v 1.14 1999/11/17 17:50:37 joel Exp $
+ *  $Id: thread.inl,v 1.15 2000/07/26 19:26:27 joel Exp $
  */
 
 #ifndef __THREAD_inl
@@ -111,8 +111,10 @@
 
 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 @@
  *  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 @@
  *  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
  *


More information about the users mailing list