[PATCH 14/25] rtems: Error for task variables on SMP

Sebastian Huber sebastian.huber at embedded-brains.de
Thu Jul 18 14:26:02 UTC 2013


Task variables are not supported on SMP.
---
 cpukit/rtems/src/taskvariableadd.c          |    7 +++++++
 cpukit/rtems/src/taskvariabledelete.c       |    7 +++++++
 cpukit/rtems/src/taskvariableget.c          |    7 +++++++
 testsuites/smptests/smpunsupported01/init.c |    9 +++++++++
 4 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/cpukit/rtems/src/taskvariableadd.c b/cpukit/rtems/src/taskvariableadd.c
index 7e03b66..5443bf2 100644
--- a/cpukit/rtems/src/taskvariableadd.c
+++ b/cpukit/rtems/src/taskvariableadd.c
@@ -19,6 +19,7 @@
 #endif
 
 #include <rtems/system.h>
+#include <rtems/config.h>
 #include <rtems/rtems/tasks.h>
 #include <rtems/score/wkspace.h>
 
@@ -32,6 +33,12 @@ rtems_status_code rtems_task_variable_add(
   Objects_Locations      location;
   rtems_task_variable_t *tvp, *new;
 
+#if defined( RTEMS_SMP )
+  if ( rtems_configuration_is_smp_enabled() ) {
+    return RTEMS_NOT_IMPLEMENTED;
+  }
+#endif
+
   if ( !ptr )
     return RTEMS_INVALID_ADDRESS;
 
diff --git a/cpukit/rtems/src/taskvariabledelete.c b/cpukit/rtems/src/taskvariabledelete.c
index 02f2bf0..65efecb 100644
--- a/cpukit/rtems/src/taskvariabledelete.c
+++ b/cpukit/rtems/src/taskvariabledelete.c
@@ -19,6 +19,7 @@
 #endif
 
 #include <rtems/system.h>
+#include <rtems/config.h>
 #include <rtems/rtems/tasks.h>
 #include <rtems/score/wkspace.h>
 
@@ -31,6 +32,12 @@ rtems_status_code rtems_task_variable_delete(
   Objects_Locations      location;
   rtems_task_variable_t *tvp, *prev;
 
+#if defined( RTEMS_SMP )
+  if ( rtems_configuration_is_smp_enabled() ) {
+    return RTEMS_NOT_IMPLEMENTED;
+  }
+#endif
+
   if ( !ptr )
     return RTEMS_INVALID_ADDRESS;
 
diff --git a/cpukit/rtems/src/taskvariableget.c b/cpukit/rtems/src/taskvariableget.c
index 338e108..c1524a4 100644
--- a/cpukit/rtems/src/taskvariableget.c
+++ b/cpukit/rtems/src/taskvariableget.c
@@ -19,6 +19,7 @@
 #endif
 
 #include <rtems/system.h>
+#include <rtems/config.h>
 #include <rtems/rtems/tasks.h>
 #include <rtems/score/wkspace.h>
 
@@ -38,6 +39,12 @@ rtems_status_code rtems_task_variable_get(
   Objects_Locations      location;
   rtems_task_variable_t *tvp;
 
+#if defined( RTEMS_SMP )
+  if ( rtems_configuration_is_smp_enabled() ) {
+    return RTEMS_NOT_IMPLEMENTED;
+  }
+#endif
+
   if ( !ptr )
     return RTEMS_INVALID_ADDRESS;
 
diff --git a/testsuites/smptests/smpunsupported01/init.c b/testsuites/smptests/smpunsupported01/init.c
index 3724cd4..3379de6 100644
--- a/testsuites/smptests/smpunsupported01/init.c
+++ b/testsuites/smptests/smpunsupported01/init.c
@@ -26,6 +26,15 @@ static void test(void)
 
   sc = rtems_task_delete(RTEMS_SELF);
   rtems_test_assert(sc == RTEMS_NOT_IMPLEMENTED);
+
+  sc = rtems_task_variable_add(RTEMS_SELF, NULL, NULL);
+  rtems_test_assert(sc == RTEMS_NOT_IMPLEMENTED);
+
+  sc = rtems_task_variable_delete(RTEMS_SELF, NULL);
+  rtems_test_assert(sc == RTEMS_NOT_IMPLEMENTED);
+
+  sc = rtems_task_variable_get(RTEMS_SELF, NULL, NULL);
+  rtems_test_assert(sc == RTEMS_NOT_IMPLEMENTED);
 }
 
 static void Init(rtems_task_argument arg)
-- 
1.7.7




More information about the devel mailing list