RTEMS Logo

RTEMS 4.7.3 On-Line Library


Task Context Management CPU_ALL_TASKS_ARE_FP Macro Setting

PREV UP NEXT Bookshelf RTEMS Porting Guide

6.4.2: CPU_ALL_TASKS_ARE_FP Macro Setting

The CPU_ALL_TASKS_ARE_FP macro is set to TRUE or FALSE based upon the answer to the following question: Are all tasks RTEMS_FLOATING_POINT tasks implicitly? If this macro is set TRUE, then all tasks and threads are assumed to have a floating point context. In the Classic API, this is equivalent to setting the RTEMS_FLOATING_POINT task attribute on all rtems_task_create calls. If the CPU_ALL_TASKS_ARE_FP macro is set to FALSE, then the RTEMS_FLOATING_POINT task attribute in the Classic API is honored.

The rationale for this macro is that if a function that an application developer would not think utilize the FP unit DOES, then one can not easily predict which tasks will use the FP hardware. In this case, this option should be TRUE. So far, the only CPU families for which this macro has been to TRUE are the HP PA-RISC and PowerPC. For the HP PA-RISC, the HP C compiler and gcc both implicitly use the floating point registers to perform integer multiplies. For the PowerPC, this feature macro is set to TRUE because the printf routine saves a floating point register whether or not a floating point number is actually printed. If the newlib implementation of printf were restructured to avoid this, then the PowerPC port would not have to have this option set to TRUE.

The following example illustrates how the CPU_ALL_TASKS_ARE_FP is set on the PowerPC. On this CPU family, this macro is set to TRUE if the CPU model has hardware floating point.

#if (CPU_HARDWARE_FP == TRUE)
#define CPU_ALL_TASKS_ARE_FP     TRUE
#else
#define CPU_ALL_TASKS_ARE_FP     FALSE
#endif

NOTE: If CPU_HARDWARE_FP is FALSE, then this should be FALSE as well.


PREV UP NEXT Bookshelf RTEMS Porting Guide

Copyright © 1988-2004 OAR Corporation