[PATCH 13/25] rtems: Error for task delete on SMP

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


Task deletion is currently not implemented on SMP configurations.
---
 cpukit/rtems/src/taskdelete.c               |   11 +++++++----
 testsuites/smptests/smpunsupported01/init.c |    5 +++++
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/cpukit/rtems/src/taskdelete.c b/cpukit/rtems/src/taskdelete.c
index 492f3e7..47ee2d1 100644
--- a/cpukit/rtems/src/taskdelete.c
+++ b/cpukit/rtems/src/taskdelete.c
@@ -19,6 +19,7 @@
 #endif
 
 #include <rtems/system.h>
+#include <rtems/config.h>
 #include <rtems/rtems/status.h>
 #include <rtems/rtems/support.h>
 #include <rtems/rtems/modes.h>
@@ -38,13 +39,16 @@ rtems_status_code rtems_task_delete(
   rtems_id id
 )
 {
-#ifdef RTEMS_SMP
-  return rtems_task_suspend( id );
-#else /* RTEMS_SMP */
   register Thread_Control *the_thread;
   Objects_Locations        location;
   Objects_Information     *the_information;
 
+#if defined( RTEMS_SMP )
+  if ( rtems_configuration_is_smp_enabled() ) {
+    return RTEMS_NOT_IMPLEMENTED;
+  }
+#endif
+
   _RTEMS_Lock_allocator();
 
   the_thread = _Thread_Get( id, &location );
@@ -94,5 +98,4 @@ rtems_status_code rtems_task_delete(
 
   _RTEMS_Unlock_allocator();
   return RTEMS_INVALID_ID;
-#endif /* RTEMS_SMP */
 }
diff --git a/testsuites/smptests/smpunsupported01/init.c b/testsuites/smptests/smpunsupported01/init.c
index 0f1a102..3724cd4 100644
--- a/testsuites/smptests/smpunsupported01/init.c
+++ b/testsuites/smptests/smpunsupported01/init.c
@@ -20,7 +20,12 @@
 
 static void test(void)
 {
+  rtems_status_code sc;
+
   rtems_test_assert(rtems_configuration_is_smp_enabled());
+
+  sc = rtems_task_delete(RTEMS_SELF);
+  rtems_test_assert(sc == RTEMS_NOT_IMPLEMENTED);
 }
 
 static void Init(rtems_task_argument arg)
-- 
1.7.7




More information about the devel mailing list