diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-07-18 11:34:29 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-07-22 16:46:01 +0200 |
commit | 50ccf988c2a6116aef41885366141e0f8f96a95b (patch) | |
tree | 75390c60fc6f9d47b0f55a145cdf556602d9d96b | |
parent | sapi: Add rtems_configuration_is_smp_enabled() (diff) | |
download | rtems-50ccf988c2a6116aef41885366141e0f8f96a95b.tar.bz2 |
rtems: Error for task delete on SMP
Task deletion is currently not implemented on SMP configurations.
-rw-r--r-- | cpukit/rtems/src/taskdelete.c | 11 | ||||
-rw-r--r-- | testsuites/smptests/smp08/init.c | 3 | ||||
-rw-r--r-- | testsuites/smptests/smpunsupported01/init.c | 5 |
3 files changed, 14 insertions, 5 deletions
diff --git a/cpukit/rtems/src/taskdelete.c b/cpukit/rtems/src/taskdelete.c index 492f3e73f4..47ee2d156f 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/smp08/init.c b/testsuites/smptests/smp08/init.c index 897fe98a36..9da1b4238d 100644 --- a/testsuites/smptests/smp08/init.c +++ b/testsuites/smptests/smp08/init.c @@ -90,5 +90,6 @@ rtems_task Init( directive_failed( status, "task start" ); } - status = rtems_task_delete( RTEMS_SELF ); + /* FIXME: Task deletion currently not supported */ + (void) rtems_task_suspend( RTEMS_SELF ); } diff --git a/testsuites/smptests/smpunsupported01/init.c b/testsuites/smptests/smpunsupported01/init.c index 0f1a1023a0..3724cd4058 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) |