From 46c23871813618e7a16050068041b3d33551cd0d Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Tue, 16 Jun 2020 07:28:58 +0200 Subject: rtems: Remove RTEMS_MP_NOT_CONFIGURED error Some objects can be created with a local or global scope in a multiprocessing network. In non-multiprocessing configurations setting the scope to local or global had no effect since such a system can be viewed as a multiprocessing network with just one node. One and all nodes is the same in such a network. However, if multiprocessing was configured, creation of a global object in a single node network resulted in an RTEMS_MP_NOT_CONFIGURED error. Remove this error condition for symmetry to the non-multiprocessing setup. This is in line with the task affinity behaviour in SMP systems. Update #4005. --- cpukit/rtems/src/msgqcreate.c | 8 +++++--- cpukit/rtems/src/partcreate.c | 6 +++--- cpukit/rtems/src/semcreate.c | 7 ++----- cpukit/rtems/src/taskcreate.c | 12 ++++-------- testsuites/sptests/sp04/init.c | 2 +- testsuites/sptests/sp12/init.c | 2 +- testsuites/sptests/sp13/init.c | 2 +- testsuites/sptests/sp15/init.c | 2 +- testsuites/sptests/spmsgq_err01/init.c | 21 --------------------- testsuites/sptests/spmsgq_err01/spmsgq_err01.scn | 1 - testsuites/sptests/sppartition_err01/init.c | 22 ---------------------- .../sppartition_err01/sppartition_err01.scn | 1 - testsuites/sptests/spsem_err01/init.c | 21 --------------------- testsuites/sptests/spsem_err01/spsem_err01.scn | 1 - testsuites/sptests/sptask_err03/init.c | 22 ---------------------- testsuites/sptests/sptask_err03/sptask_err03.scn | 1 - 16 files changed, 18 insertions(+), 113 deletions(-) diff --git a/cpukit/rtems/src/msgqcreate.c b/cpukit/rtems/src/msgqcreate.c index 9d4e8cdfd6..3741347cc9 100644 --- a/cpukit/rtems/src/msgqcreate.c +++ b/cpukit/rtems/src/msgqcreate.c @@ -52,9 +52,11 @@ rtems_status_code rtems_message_queue_create( return RTEMS_INVALID_ADDRESS; #if defined(RTEMS_MULTIPROCESSING) - if ( (is_global = _Attributes_Is_global( attribute_set ) ) && - !_System_state_Is_multiprocessing ) - return RTEMS_MP_NOT_CONFIGURED; + if ( !_System_state_Is_multiprocessing ) { + attribute_set = _Attributes_Clear( attribute_set, RTEMS_GLOBAL ); + } + + is_global = _Attributes_Is_global( attribute_set ); #endif if ( count == 0 ) diff --git a/cpukit/rtems/src/partcreate.c b/cpukit/rtems/src/partcreate.c index 2aefce8067..9aa5e80bf1 100644 --- a/cpukit/rtems/src/partcreate.c +++ b/cpukit/rtems/src/partcreate.c @@ -66,9 +66,9 @@ rtems_status_code rtems_partition_create( return RTEMS_INVALID_ADDRESS; #if defined(RTEMS_MULTIPROCESSING) - if ( _Attributes_Is_global( attribute_set ) && - !_System_state_Is_multiprocessing ) - return RTEMS_MP_NOT_CONFIGURED; + if ( !_System_state_Is_multiprocessing ) { + attribute_set = _Attributes_Clear( attribute_set, RTEMS_GLOBAL ); + } #endif the_partition = _Partition_Allocate(); diff --git a/cpukit/rtems/src/semcreate.c b/cpukit/rtems/src/semcreate.c index 6cdd877cce..b57b635d85 100644 --- a/cpukit/rtems/src/semcreate.c +++ b/cpukit/rtems/src/semcreate.c @@ -57,11 +57,8 @@ rtems_status_code rtems_semaphore_create( return RTEMS_INVALID_ADDRESS; #if defined(RTEMS_MULTIPROCESSING) - if ( - _Attributes_Is_global( attribute_set ) - && !_System_state_Is_multiprocessing - ) { - return RTEMS_MP_NOT_CONFIGURED; + if ( !_System_state_Is_multiprocessing ) { + attribute_set = _Attributes_Clear( attribute_set, RTEMS_GLOBAL ); } #endif diff --git a/cpukit/rtems/src/taskcreate.c b/cpukit/rtems/src/taskcreate.c index 288eafa5c7..b430d3c705 100644 --- a/cpukit/rtems/src/taskcreate.c +++ b/cpukit/rtems/src/taskcreate.c @@ -111,15 +111,11 @@ rtems_status_code rtems_task_create( } #if defined(RTEMS_MULTIPROCESSING) - if ( _Attributes_Is_global( the_attribute_set ) ) { - - is_global = true; - - if ( !_System_state_Is_multiprocessing ) - return RTEMS_MP_NOT_CONFIGURED; + if ( !_System_state_Is_multiprocessing ) { + the_attribute_set = _Attributes_Clear( the_attribute_set, RTEMS_GLOBAL ); + } - } else - is_global = false; + is_global = _Attributes_Is_global( the_attribute_set ); #endif /* diff --git a/testsuites/sptests/sp04/init.c b/testsuites/sptests/sp04/init.c index 11aae46ea3..b163aec8ed 100644 --- a/testsuites/sptests/sp04/init.c +++ b/testsuites/sptests/sp04/init.c @@ -84,7 +84,7 @@ rtems_task Init( 1, RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_PREEMPT|RTEMS_TIMESLICE, - RTEMS_DEFAULT_ATTRIBUTES, + RTEMS_GLOBAL, &Task_id[ 2 ] ); directive_failed( status, "rtems_task_create of TA2" ); diff --git a/testsuites/sptests/sp12/init.c b/testsuites/sptests/sp12/init.c index 789f7e3249..7aa09d3676 100644 --- a/testsuites/sptests/sp12/init.c +++ b/testsuites/sptests/sp12/init.c @@ -73,7 +73,7 @@ rtems_task Init( status = rtems_semaphore_create( Semaphore_name[ 3 ], 1, - RTEMS_DEFAULT_ATTRIBUTES, + RTEMS_GLOBAL, RTEMS_NO_PRIORITY, &Semaphore_id[ 3 ] ); diff --git a/testsuites/sptests/sp13/init.c b/testsuites/sptests/sp13/init.c index 7ed8dabc53..a23d369001 100644 --- a/testsuites/sptests/sp13/init.c +++ b/testsuites/sptests/sp13/init.c @@ -105,7 +105,7 @@ rtems_task Init( Queue_name[ 3 ], 100, MESSAGE_SIZE, - RTEMS_DEFAULT_ATTRIBUTES, + RTEMS_GLOBAL, &Queue_id[ 3 ] ); directive_failed( status, "rtems_message_queue_create of Q3" ); diff --git a/testsuites/sptests/sp15/init.c b/testsuites/sptests/sp15/init.c index 25be0425e2..2565495a06 100644 --- a/testsuites/sptests/sp15/init.c +++ b/testsuites/sptests/sp15/init.c @@ -71,7 +71,7 @@ rtems_task Init( Area_2, 274, 128, - RTEMS_DEFAULT_ATTRIBUTES, + RTEMS_GLOBAL, &Partition_id[ 2 ] ); directive_failed( status, "rtems_partition_create of PT2" ); diff --git a/testsuites/sptests/spmsgq_err01/init.c b/testsuites/sptests/spmsgq_err01/init.c index 24537725dc..1ff8490d1a 100644 --- a/testsuites/sptests/spmsgq_err01/init.c +++ b/testsuites/sptests/spmsgq_err01/init.c @@ -98,27 +98,6 @@ rtems_task Init( ); puts( "TA1 - rtems_message_queue_create - Q 1 - RTEMS_INVALID_NAME" ); - /* - * The check for an object being global is only made if - * multiprocessing is enabled. - */ - -#if defined(RTEMS_MULTIPROCESSING) - status = rtems_message_queue_create( - Queue_name[ 1 ], - 1, - MESSAGE_SIZE, - RTEMS_GLOBAL, - &Junk_id - ); - fatal_directive_status( - status, - RTEMS_MP_NOT_CONFIGURED, - "rtems_message_queue_create of mp not configured" - ); -#endif - puts( "TA1 - rtems_message_queue_create - Q 1 - RTEMS_MP_NOT_CONFIGURED" ); - /* not enough memory for messages */ status = rtems_message_queue_create( Queue_name[ 1 ], diff --git a/testsuites/sptests/spmsgq_err01/spmsgq_err01.scn b/testsuites/sptests/spmsgq_err01/spmsgq_err01.scn index 7bd31fc744..26add5eb82 100644 --- a/testsuites/sptests/spmsgq_err01/spmsgq_err01.scn +++ b/testsuites/sptests/spmsgq_err01/spmsgq_err01.scn @@ -4,7 +4,6 @@ TA1 - rtems_message_queue_create - NULL Id - RTEMS_INVALID_ADDRESS TA1 - rtems_message_queue_create - count = 0 - RTEMS_INVALID_NUMBER TA1 - rtems_message_queue_create - size = 0 - RTEMS_INVALID_SIZE TA1 - rtems_message_queue_create - Q 1 - RTEMS_INVALID_NAME -TA1 - rtems_message_queue_create - Q 1 - RTEMS_MP_NOT_CONFIGURED TA1 - rtems_message_queue_create - Q 2 - RTEMS_UNSATISFIED TA1 - rtems_message_queue_create - Q 2 - RTEMS_UNSATISFIED #2 TA1 - rtems_message_queue_create - Q 1 - 2 DEEP - RTEMS_SUCCESSFUL diff --git a/testsuites/sptests/sppartition_err01/init.c b/testsuites/sptests/sppartition_err01/init.c index 39ee700daa..39373852fb 100644 --- a/testsuites/sptests/sppartition_err01/init.c +++ b/testsuites/sptests/sppartition_err01/init.c @@ -126,28 +126,6 @@ void test_partition_errors(void) ); } - /* - * The check for an object being global is only made if - * multiprocessing is enabled. - */ - -#if defined(RTEMS_MULTIPROCESSING) - status = rtems_partition_create( - Partition_name[ 1 ], - Partition_good_area, - 128, - 64, - RTEMS_GLOBAL, - &junk_id - ); - fatal_directive_status( - status, - RTEMS_MP_NOT_CONFIGURED, - "rtems_partition_create of global" - ); -#endif - puts( "TA1 - rtems_partition_create - RTEMS_MP_NOT_CONFIGURED" ); - #if defined(_C3x) || defined(_C4x) puts( "TA1 - rtems_partition_create - RTEMS_INVALID_ADDRESS - SKIPPED" ); #else diff --git a/testsuites/sptests/sppartition_err01/sppartition_err01.scn b/testsuites/sptests/sppartition_err01/sppartition_err01.scn index 2b010ee6d4..01319353e7 100644 --- a/testsuites/sptests/sppartition_err01/sppartition_err01.scn +++ b/testsuites/sptests/sppartition_err01/sppartition_err01.scn @@ -4,7 +4,6 @@ TA1 - rtems_partition_create - length - RTEMS_INVALID_SIZE TA1 - rtems_partition_create - buffer size - RTEMS_INVALID_SIZE TA1 - rtems_partition_create - length < buffer size - RTEMS_INVALID_SIZE TA1 - rtems_partition_create - buffer size < overhead - RTEMS_INVALID_SIZE -TA1 - rtems_partition_create - RTEMS_MP_NOT_CONFIGURED TA1 - rtems_partition_create - RTEMS_INVALID_ADDRESS TA1 - rtems_partition_create - RTEMS_INVALID_SIZE TA1 - rtems_partition_delete - unknown RTEMS_INVALID_ID diff --git a/testsuites/sptests/spsem_err01/init.c b/testsuites/sptests/spsem_err01/init.c index 39a366b41a..f1f1592ebf 100644 --- a/testsuites/sptests/spsem_err01/init.c +++ b/testsuites/sptests/spsem_err01/init.c @@ -199,27 +199,6 @@ rtems_task Init( ); puts( "TA1 - rtems_semaphore_create - RTEMS_INVALID_NUMBER" ); - /* - * The check for an object being global is only made if - * multiprocessing is enabled. - */ - -#if defined(RTEMS_MULTIPROCESSING) - status = rtems_semaphore_create( - Semaphore_name[ 3 ], - 1, - RTEMS_GLOBAL, - RTEMS_NO_PRIORITY, - &Junk_id - ); - fatal_directive_status( - status, - RTEMS_MP_NOT_CONFIGURED, - "rtems_semaphore_create of mp not configured" - ); -#endif - puts( "TA1 - rtems_semaphore_create - RTEMS_MP_NOT_CONFIGURED" ); - status = rtems_semaphore_delete( 100 ); fatal_directive_status( status, diff --git a/testsuites/sptests/spsem_err01/spsem_err01.scn b/testsuites/sptests/spsem_err01/spsem_err01.scn index b6172196b0..5adf40f865 100644 --- a/testsuites/sptests/spsem_err01/spsem_err01.scn +++ b/testsuites/sptests/spsem_err01/spsem_err01.scn @@ -12,7 +12,6 @@ TA1 - rtems_semaphore_create - FIFO and ceiling - RTEMS_NOT_DEFINED TA1 - rtems_semaphore_create - ceiling and inherit - RTEMS_NOT_DEFINED TA1 - rtems_semaphore_create - RTEMS_NOT_DEFINED TA1 - rtems_semaphore_create - RTEMS_INVALID_NUMBER -TA1 - rtems_semaphore_create - RTEMS_MP_NOT_CONFIGURED TA1 - rtems_semaphore_delete - RTEMS_INVALID_ID TA1 - rtems_semaphore_delete - local RTEMS_INVALID_ID TA1 - rtems_semaphore_ident - global RTEMS_INVALID_NAME diff --git a/testsuites/sptests/sptask_err03/init.c b/testsuites/sptests/sptask_err03/init.c index 2ac54b9037..bda2cd4a1f 100644 --- a/testsuites/sptests/sptask_err03/init.c +++ b/testsuites/sptests/sptask_err03/init.c @@ -228,27 +228,5 @@ rtems_task Init( ); puts( "TA1 - rtems_task_create - 11 - RTEMS_TOO_MANY" ); - /* - * The check for an object being global is only made if - * multiprocessing is enabled. - */ - -#if defined(RTEMS_MULTIPROCESSING) - status = rtems_task_create( - task_name, - 4, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_GLOBAL, - &Junk_id - ); - fatal_directive_status( - status, - RTEMS_MP_NOT_CONFIGURED, - "rtems_task_create of global task in a single cpu system" - ); -#endif - puts( "TA1 - rtems_task_create - RTEMS_MP_NOT_CONFIGURED" ); - TEST_END(); } diff --git a/testsuites/sptests/sptask_err03/sptask_err03.scn b/testsuites/sptests/sptask_err03/sptask_err03.scn index 2787bafba5..e6047e4476 100644 --- a/testsuites/sptests/sptask_err03/sptask_err03.scn +++ b/testsuites/sptests/sptask_err03/sptask_err03.scn @@ -14,5 +14,4 @@ TA1 - rtems_task_create - 8 created - RTEMS_SUCCESSFUL TA1 - rtems_task_create - 9 created - RTEMS_SUCCESSFUL TA1 - rtems_task_create - 10 created - RTEMS_SUCCESSFUL TA1 - rtems_task_create - 11 - RTEMS_TOO_MANY -TA1 - rtems_task_create - RTEMS_MP_NOT_CONFIGURED *** END TEST TASK ERROR 03 *** -- cgit v1.2.3