From 965ef82015a8bb1c04c8066c65af7feab5e68ed6 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 23 Jul 2013 16:45:54 +0200 Subject: score: PR1782: CPU_USE_DEFERRED_FP_SWITCH Do not redefine CPU_USE_DEFERRED_FP_SWITCH. --- cpukit/score/cpu/i386/rtems/score/cpu.h | 6 +++++- cpukit/score/cpu/sparc/rtems/score/cpu.h | 6 +++++- cpukit/score/include/rtems/score/percpu.h | 4 ++++ cpukit/score/include/rtems/score/thread.h | 9 --------- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/cpukit/score/cpu/i386/rtems/score/cpu.h b/cpukit/score/cpu/i386/rtems/score/cpu.h index 5bd14c347a..30a9a641fb 100644 --- a/cpukit/score/cpu/i386/rtems/score/cpu.h +++ b/cpukit/score/cpu/i386/rtems/score/cpu.h @@ -93,7 +93,11 @@ extern "C" { #define CPU_ALL_TASKS_ARE_FP FALSE #define CPU_IDLE_TASK_IS_FP FALSE -#define CPU_USE_DEFERRED_FP_SWITCH TRUE +#if defined(RTEMS_SMP) + #define CPU_USE_DEFERRED_FP_SWITCH FALSE +#else + #define CPU_USE_DEFERRED_FP_SWITCH TRUE +#endif #endif /* __SSE__ */ #define CPU_STACK_GROWS_UP FALSE diff --git a/cpukit/score/cpu/sparc/rtems/score/cpu.h b/cpukit/score/cpu/sparc/rtems/score/cpu.h index c0a8d0a9e8..20040a9485 100644 --- a/cpukit/score/cpu/sparc/rtems/score/cpu.h +++ b/cpukit/score/cpu/sparc/rtems/score/cpu.h @@ -168,7 +168,11 @@ extern "C" { * On the SPARC, we can disable the FPU for integer only tasks so * it is safe to defer floating point context switches. */ -#define CPU_USE_DEFERRED_FP_SWITCH TRUE +#if defined(RTEMS_SMP) + #define CPU_USE_DEFERRED_FP_SWITCH FALSE +#else + #define CPU_USE_DEFERRED_FP_SWITCH TRUE +#endif /** * Does this port provide a CPU dependent IDLE task implementation? diff --git a/cpukit/score/include/rtems/score/percpu.h b/cpukit/score/include/rtems/score/percpu.h index 383202c328..d44c7a19ff 100644 --- a/cpukit/score/include/rtems/score/percpu.h +++ b/cpukit/score/include/rtems/score/percpu.h @@ -55,6 +55,10 @@ typedef struct Thread_Control_struct Thread_Control; #ifdef RTEMS_SMP +#if CPU_USE_DEFERRED_FP_SWITCH == TRUE + #error "deferred FP switch not implemented for SMP" +#endif + typedef enum { /** * @brief The per CPU controls are initialized to zero. diff --git a/cpukit/score/include/rtems/score/thread.h b/cpukit/score/include/rtems/score/thread.h index 9ce8ad1fd1..4300d1a55d 100644 --- a/cpukit/score/include/rtems/score/thread.h +++ b/cpukit/score/include/rtems/score/thread.h @@ -50,15 +50,6 @@ #define RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API #endif -/* - * Deferred floating point context switches are not currently - * supported when in SMP configuration. - */ -#if defined(RTEMS_SMP) - #undef CPU_USE_DEFERRED_FP_SWITCH - #define CPU_USE_DEFERRED_FP_SWITCH FALSE -#endif - #ifdef __cplusplus extern "C" { #endif -- cgit v1.2.3