[rtems commit] score: PR1782: CPU_USE_DEFERRED_FP_SWITCH
Sebastian Huber
sebh at rtems.org
Tue Jul 23 15:14:21 UTC 2013
Module: rtems
Branch: master
Commit: 965ef82015a8bb1c04c8066c65af7feab5e68ed6
Changeset: http://git.rtems.org/rtems/commit/?id=965ef82015a8bb1c04c8066c65af7feab5e68ed6
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Tue Jul 23 16:45:54 2013 +0200
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 5bd14c3..30a9a64 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 c0a8d0a..20040a9 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 383202c..d44c7a1 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 9ce8ad1..4300d1a 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
More information about the vc
mailing list