diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-06-14 14:26:34 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2013-06-14 16:26:07 +0200 |
commit | edde99bd213d20c55430dd29089e0d8a807ab6d8 (patch) | |
tree | 186fbfb97c296606a1584fd224777b3f6ed5f98e /testsuites | |
parent | score: Add and use _Thread_Dispatch_if_necessary() (diff) | |
download | rtems-edde99bd213d20c55430dd29089e0d8a807ab6d8.tar.bz2 |
score: Rename rtems_smp_get_number_of_processors()
Rename in rtems_smp_get_processor_count(). Always provide
<rtems/score/smp.h> and <rtems/rtems/smp.h>. Add
_SMP_Get_processor_count(). This function will be a compile time
constant defined to be one on uni-processor configurations. This allows
iterations over all processors without overhead on uni-processor
configurations.
Diffstat (limited to 'testsuites')
-rw-r--r-- | testsuites/smptests/smp01/init.c | 6 | ||||
-rw-r--r-- | testsuites/smptests/smp02/init.c | 2 | ||||
-rw-r--r-- | testsuites/smptests/smp03/init.c | 8 | ||||
-rw-r--r-- | testsuites/smptests/smp04/init.c | 12 | ||||
-rw-r--r-- | testsuites/smptests/smp05/init.c | 2 | ||||
-rw-r--r-- | testsuites/smptests/smp06/init.c | 2 | ||||
-rw-r--r-- | testsuites/smptests/smp08/init.c | 2 | ||||
-rw-r--r-- | testsuites/smptests/smp09/init.c | 2 | ||||
-rw-r--r-- | testsuites/smptests/smpatomic01/init.c | 6 | ||||
-rw-r--r-- | testsuites/smptests/smpatomic02/init.c | 6 | ||||
-rw-r--r-- | testsuites/smptests/smpatomic03/init.c | 6 | ||||
-rw-r--r-- | testsuites/smptests/smpatomic04/init.c | 6 | ||||
-rw-r--r-- | testsuites/smptests/smpatomic05/init.c | 6 | ||||
-rw-r--r-- | testsuites/smptests/smpatomic06/init.c | 6 | ||||
-rw-r--r-- | testsuites/smptests/smpatomic07/init.c | 6 | ||||
-rw-r--r-- | testsuites/smptests/smplock01/init.c | 4 | ||||
-rw-r--r-- | testsuites/sptests/spsize/size.c | 6 |
17 files changed, 42 insertions, 46 deletions
diff --git a/testsuites/smptests/smp01/init.c b/testsuites/smptests/smp01/init.c index af2a36744a..b47f1b4f50 100644 --- a/testsuites/smptests/smp01/init.c +++ b/testsuites/smptests/smp01/init.c @@ -44,12 +44,12 @@ rtems_task Init( locked_printf( "\n\n*** SMP01 TEST ***\n" ); /* Initialize the TaskRan array */ - for ( i=0; i<rtems_smp_get_number_of_processors() ; i++ ) { + for ( i=0; i<rtems_smp_get_processor_count() ; i++ ) { TaskRan[i] = false; } /* Create and start tasks for each processor */ - for ( i=0; i< rtems_smp_get_number_of_processors() ; i++ ) { + for ( i=0; i< rtems_smp_get_processor_count() ; i++ ) { if ( i != cpu_self ) { ch = '0' + i; @@ -74,7 +74,7 @@ rtems_task Init( /* Wait on the all tasks to run */ while (1) { allDone = true; - for ( i=0; i<rtems_smp_get_number_of_processors() ; i++ ) { + for ( i=0; i<rtems_smp_get_processor_count() ; i++ ) { if ( i != cpu_self && TaskRan[i] == false) allDone = false; } diff --git a/testsuites/smptests/smp02/init.c b/testsuites/smptests/smp02/init.c index 968d90c8af..a5ad24bdf5 100644 --- a/testsuites/smptests/smp02/init.c +++ b/testsuites/smptests/smp02/init.c @@ -45,7 +45,7 @@ rtems_task Init( status = rtems_semaphore_obtain( Semaphore, RTEMS_WAIT, 0); directive_failed( status,"rtems_semaphore_obtain of SEM1\n"); - for ( i=1; i < rtems_smp_get_number_of_processors(); i++ ){ + for ( i=1; i < rtems_smp_get_processor_count(); i++ ){ /* Create and start tasks for each CPU */ ch = '0' + i; diff --git a/testsuites/smptests/smp03/init.c b/testsuites/smptests/smp03/init.c index 5371d49018..47441b3eec 100644 --- a/testsuites/smptests/smp03/init.c +++ b/testsuites/smptests/smp03/init.c @@ -49,7 +49,7 @@ rtems_task Init( /* Initialize the TaskRan array */ TaskRan[0] = true; - for ( i=1; i<rtems_smp_get_number_of_processors() ; i++ ) { + for ( i=1; i<rtems_smp_get_processor_count() ; i++ ) { TaskRan[i] = false; } @@ -57,7 +57,7 @@ rtems_task Init( PrintTaskInfo( "Init" ); /* for each remaining cpu create and start a task */ - for ( i=1; i < rtems_smp_get_number_of_processors(); i++ ){ + for ( i=1; i < rtems_smp_get_processor_count(); i++ ){ ch = '0' + i; @@ -87,12 +87,12 @@ rtems_task Init( RTEMS_DEFAULT_ATTRIBUTES, &id ); - status = rtems_task_start(id,Test_task,rtems_smp_get_number_of_processors()); + status = rtems_task_start(id,Test_task,rtems_smp_get_processor_count()); /* Wait on all tasks to run */ while (1) { TestFinished = true; - for ( i=1; i < (rtems_smp_get_number_of_processors()+1) ; i++ ) { + for ( i=1; i < (rtems_smp_get_processor_count()+1) ; i++ ) { if (TaskRan[i] == false) TestFinished = false; } diff --git a/testsuites/smptests/smp04/init.c b/testsuites/smptests/smp04/init.c index c61e81f2a7..a532d4604c 100644 --- a/testsuites/smptests/smp04/init.c +++ b/testsuites/smptests/smp04/init.c @@ -58,7 +58,7 @@ rtems_task Init( /* Set all Tasks to not ran except for the init task */ TaskRan[0] = true; - for ( i=1; i <= rtems_smp_get_number_of_processors() ; i++ ) + for ( i=1; i <= rtems_smp_get_processor_count() ; i++ ) TaskRan[i] = false; @@ -66,7 +66,7 @@ rtems_task Init( * For each processor create and start a task alternating * between RTEMS_PREEMPT and RTEMS_NO_PREEMPT. */ - for ( i=1; i < rtems_smp_get_number_of_processors() ; i++ ){ + for ( i=1; i < rtems_smp_get_processor_count() ; i++ ){ /* Create and start tasks for each CPU */ ch = '0' + i; @@ -79,7 +79,7 @@ rtems_task Init( status = rtems_task_create( rtems_build_name( 'T', 'A', ch, ' ' ), CONFIGURE_INIT_TASK_PRIORITY + - (2*rtems_smp_get_number_of_processors()) - (2*i), + (2*rtems_smp_get_processor_count()) - (2*i), RTEMS_MINIMUM_STACK_SIZE, ((i%2) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT), RTEMS_DEFAULT_ATTRIBUTES, @@ -106,7 +106,7 @@ rtems_task Init( * should preempt the longest running PREEMPTABLE * task and run on that cpu. */ - ch = '0' + rtems_smp_get_number_of_processors() ; + ch = '0' + rtems_smp_get_processor_count() ; locked_printf( "Create a TA%c a %s task\n", ch, @@ -128,7 +128,7 @@ rtems_task Init( status = rtems_task_start( id, Test_task, - rtems_smp_get_number_of_processors() + rtems_smp_get_processor_count() ); /* @@ -136,7 +136,7 @@ rtems_task Init( */ while (1) { allDone = true; - for ( i=1; i<=rtems_smp_get_number_of_processors() ; i++ ) { + for ( i=1; i<=rtems_smp_get_processor_count() ; i++ ) { if (TaskRan[i] == false) allDone = false; } diff --git a/testsuites/smptests/smp05/init.c b/testsuites/smptests/smp05/init.c index 1078ffd0ca..eaa08f5c02 100644 --- a/testsuites/smptests/smp05/init.c +++ b/testsuites/smptests/smp05/init.c @@ -36,7 +36,7 @@ rtems_task Init( locked_print_initialize(); locked_printf( "\n\n*** TEST SMP05 ***\n" ); - for ( i=0; i<rtems_smp_get_number_of_processors() ; i++ ) { + for ( i=0; i<rtems_smp_get_processor_count() ; i++ ) { ch = '1' + i; status = rtems_task_create( diff --git a/testsuites/smptests/smp06/init.c b/testsuites/smptests/smp06/init.c index f524b1f68b..170479b15d 100644 --- a/testsuites/smptests/smp06/init.c +++ b/testsuites/smptests/smp06/init.c @@ -54,7 +54,7 @@ rtems_task Init( status = rtems_clock_tick(); directive_failed( status, "clock tick" ); - rtems_test_assert( rtems_smp_get_number_of_processors() > 1 ); + rtems_test_assert( rtems_smp_get_processor_count() > 1 ); cpu_num = bsp_smp_processor_id(); diff --git a/testsuites/smptests/smp08/init.c b/testsuites/smptests/smp08/init.c index 8e8de7c052..0c7740b32e 100644 --- a/testsuites/smptests/smp08/init.c +++ b/testsuites/smptests/smp08/init.c @@ -73,7 +73,7 @@ rtems_task Init( /* Show that the init task is running on this cpu */ PrintTaskInfo( "Init", &time ); - for ( i=1; i <= rtems_smp_get_number_of_processors() *3; i++ ) { + for ( i=1; i <= rtems_smp_get_processor_count() *3; i++ ) { sprintf(ch, "%02" PRId32, i ); status = rtems_task_create( diff --git a/testsuites/smptests/smp09/init.c b/testsuites/smptests/smp09/init.c index c599a7f15e..976cb35195 100644 --- a/testsuites/smptests/smp09/init.c +++ b/testsuites/smptests/smp09/init.c @@ -42,7 +42,7 @@ rtems_task Init( for ( killtime=0; killtime<1000000; killtime++ ) ; - for ( i=0; i<rtems_smp_get_number_of_processors() -1; i++ ) { + for ( i=0; i<rtems_smp_get_processor_count() -1; i++ ) { ch = '1' + i; status = rtems_task_create( diff --git a/testsuites/smptests/smpatomic01/init.c b/testsuites/smptests/smpatomic01/init.c index 7d7086066f..f7dfa1170a 100644 --- a/testsuites/smptests/smpatomic01/init.c +++ b/testsuites/smptests/smpatomic01/init.c @@ -35,12 +35,12 @@ rtems_task Init( locked_printf( "\n\n*** SMPatomic01 TEST ***\n" ); /* Initialize the TaskRan array */ - for ( i=0; i<rtems_smp_get_number_of_processors() ; i++ ) { + for ( i=0; i<rtems_smp_get_processor_count() ; i++ ) { TaskRan[i] = false; } /* Create and start tasks for each processor */ - for ( i=1; i< rtems_smp_get_number_of_processors() ; i++ ) { + for ( i=1; i< rtems_smp_get_processor_count() ; i++ ) { ch = '0' + i; status = rtems_task_create( @@ -60,7 +60,7 @@ rtems_task Init( /* Wait on the all tasks to run */ while (1) { allDone = true; - for ( i=1; i<rtems_smp_get_number_of_processors() ; i++ ) { + for ( i=1; i<rtems_smp_get_processor_count() ; i++ ) { if (TaskRan[i] == false) allDone = false; } diff --git a/testsuites/smptests/smpatomic02/init.c b/testsuites/smptests/smpatomic02/init.c index 75d0ea00f9..9e0da4b624 100644 --- a/testsuites/smptests/smpatomic02/init.c +++ b/testsuites/smptests/smpatomic02/init.c @@ -35,12 +35,12 @@ rtems_task Init( locked_printf( "\n\n*** SMPatomic02 TEST ***\n" ); /* Initialize the TaskRan array */ - for ( i=0; i<rtems_smp_get_number_of_processors() ; i++ ) { + for ( i=0; i<rtems_smp_get_processor_count() ; i++ ) { TaskRan[i] = false; } /* Create and start tasks for each processor */ - for ( i=1; i< rtems_smp_get_number_of_processors() ; i++ ) { + for ( i=1; i< rtems_smp_get_processor_count() ; i++ ) { ch = '0' + i; status = rtems_task_create( @@ -60,7 +60,7 @@ rtems_task Init( /* Wait on the all tasks to run */ while (1) { allDone = true; - for ( i=1; i<rtems_smp_get_number_of_processors() ; i++ ) { + for ( i=1; i<rtems_smp_get_processor_count() ; i++ ) { if (TaskRan[i] == false) allDone = false; } diff --git a/testsuites/smptests/smpatomic03/init.c b/testsuites/smptests/smpatomic03/init.c index 5fe16f11e6..bf5b2a0e9e 100644 --- a/testsuites/smptests/smpatomic03/init.c +++ b/testsuites/smptests/smpatomic03/init.c @@ -35,12 +35,12 @@ rtems_task Init( locked_printf( "\n\n*** SMPatomic03 TEST ***\n" ); /* Initialize the TaskRan array */ - for ( i=0; i<rtems_smp_get_number_of_processors() ; i++ ) { + for ( i=0; i<rtems_smp_get_processor_count() ; i++ ) { TaskRan[i] = false; } /* Create and start tasks for each processor */ - for ( i=1; i< rtems_smp_get_number_of_processors() ; i++ ) { + for ( i=1; i< rtems_smp_get_processor_count() ; i++ ) { ch = '0' + i; status = rtems_task_create( @@ -60,7 +60,7 @@ rtems_task Init( /* Wait on the all tasks to run */ while (1) { allDone = true; - for ( i=1; i<rtems_smp_get_number_of_processors() ; i++ ) { + for ( i=1; i<rtems_smp_get_processor_count() ; i++ ) { if (TaskRan[i] == false) allDone = false; } diff --git a/testsuites/smptests/smpatomic04/init.c b/testsuites/smptests/smpatomic04/init.c index 630e9a2e9e..8398515d4f 100644 --- a/testsuites/smptests/smpatomic04/init.c +++ b/testsuites/smptests/smpatomic04/init.c @@ -35,12 +35,12 @@ rtems_task Init( locked_printf( "\n\n*** SMPatomic04 TEST ***\n" ); /* Initialize the TaskRan array */ - for ( i=0; i<rtems_smp_get_number_of_processors() ; i++ ) { + for ( i=0; i<rtems_smp_get_processor_count() ; i++ ) { TaskRan[i] = false; } /* Create and start tasks for each processor */ - for ( i=1; i< rtems_smp_get_number_of_processors() ; i++ ) { + for ( i=1; i< rtems_smp_get_processor_count() ; i++ ) { ch = '0' + i; status = rtems_task_create( @@ -60,7 +60,7 @@ rtems_task Init( /* Wait on the all tasks to run */ while (1) { allDone = true; - for ( i=1; i<rtems_smp_get_number_of_processors() ; i++ ) { + for ( i=1; i<rtems_smp_get_processor_count() ; i++ ) { if (TaskRan[i] == false) allDone = false; } diff --git a/testsuites/smptests/smpatomic05/init.c b/testsuites/smptests/smpatomic05/init.c index 42515d84ed..9a1947e0f8 100644 --- a/testsuites/smptests/smpatomic05/init.c +++ b/testsuites/smptests/smpatomic05/init.c @@ -35,12 +35,12 @@ rtems_task Init( locked_printf( "\n\n*** SMPatomic05 TEST ***\n" ); /* Initialize the TaskRan array */ - for ( i=0; i<rtems_smp_get_number_of_processors() ; i++ ) { + for ( i=0; i<rtems_smp_get_processor_count() ; i++ ) { TaskRan[i] = false; } /* Create and start tasks for each processor */ - for ( i=1; i< rtems_smp_get_number_of_processors() ; i++ ) { + for ( i=1; i< rtems_smp_get_processor_count() ; i++ ) { ch = '0' + i; status = rtems_task_create( @@ -60,7 +60,7 @@ rtems_task Init( /* Wait on the all tasks to run */ while (1) { allDone = true; - for ( i=1; i<rtems_smp_get_number_of_processors() ; i++ ) { + for ( i=1; i<rtems_smp_get_processor_count() ; i++ ) { if (TaskRan[i] == false) allDone = false; } diff --git a/testsuites/smptests/smpatomic06/init.c b/testsuites/smptests/smpatomic06/init.c index c75c629296..06f1f6140b 100644 --- a/testsuites/smptests/smpatomic06/init.c +++ b/testsuites/smptests/smpatomic06/init.c @@ -35,12 +35,12 @@ rtems_task Init( locked_printf( "\n\n*** SMPatomic06 TEST ***\n" ); /* Initialize the TaskRan array */ - for ( i=0; i<rtems_smp_get_number_of_processors() ; i++ ) { + for ( i=0; i<rtems_smp_get_processor_count() ; i++ ) { TaskRan[i] = false; } /* Create and start tasks for each processor */ - for ( i=1; i< rtems_smp_get_number_of_processors() ; i++ ) { + for ( i=1; i< rtems_smp_get_processor_count() ; i++ ) { ch = '0' + i; status = rtems_task_create( @@ -60,7 +60,7 @@ rtems_task Init( /* Wait on the all tasks to run */ while (1) { allDone = true; - for ( i=1; i<rtems_smp_get_number_of_processors() ; i++ ) { + for ( i=1; i<rtems_smp_get_processor_count() ; i++ ) { if (TaskRan[i] == false) allDone = false; } diff --git a/testsuites/smptests/smpatomic07/init.c b/testsuites/smptests/smpatomic07/init.c index 570a1a8e25..be9c21627b 100644 --- a/testsuites/smptests/smpatomic07/init.c +++ b/testsuites/smptests/smpatomic07/init.c @@ -35,12 +35,12 @@ rtems_task Init( locked_printf( "\n\n*** SMPatomic07 TEST ***\n" ); /* Initialize the TaskRan array */ - for ( i=0; i<rtems_smp_get_number_of_processors() ; i++ ) { + for ( i=0; i<rtems_smp_get_processor_count() ; i++ ) { TaskRan[i] = false; } /* Create and start tasks for each processor */ - for ( i=1; i< rtems_smp_get_number_of_processors() ; i++ ) { + for ( i=1; i< rtems_smp_get_processor_count() ; i++ ) { ch = '0' + i; status = rtems_task_create( @@ -60,7 +60,7 @@ rtems_task Init( /* Wait on the all tasks to run */ while (1) { allDone = true; - for ( i=1; i<rtems_smp_get_number_of_processors() ; i++ ) { + for ( i=1; i<rtems_smp_get_processor_count() ; i++ ) { if (TaskRan[i] == false) allDone = false; } diff --git a/testsuites/smptests/smplock01/init.c b/testsuites/smptests/smplock01/init.c index 88ef985386..2fcc507698 100644 --- a/testsuites/smptests/smplock01/init.c +++ b/testsuites/smptests/smplock01/init.c @@ -298,7 +298,7 @@ static void run_tests( static void task(rtems_task_argument arg) { global_context *ctx = (global_context *) arg; - int cpu_count = (int) rtems_smp_get_number_of_processors(); + int cpu_count = (int) rtems_smp_get_processor_count(); int cpu_self = rtems_smp_get_current_processor(); rtems_status_code sc; barrier_state bs = BARRIER_STATE_INITIALIZER; @@ -312,7 +312,7 @@ static void task(rtems_task_argument arg) static void test(void) { global_context *ctx = &context; - int cpu_count = (int) rtems_smp_get_number_of_processors(); + int cpu_count = (int) rtems_smp_get_processor_count(); int cpu_self = rtems_smp_get_current_processor(); int cpu; int test; diff --git a/testsuites/sptests/spsize/size.c b/testsuites/sptests/spsize/size.c index 09a881a80c..2a77927dda 100644 --- a/testsuites/sptests/spsize/size.c +++ b/testsuites/sptests/spsize/size.c @@ -341,11 +341,7 @@ uninitialized = /*partmp.h*/ 0 + #endif -#if defined(RTEMS_SMP) -/*percpu.h*/ (_SMP_Processor_count * sizeof(Per_CPU_Control)) + -#else -/*percpu.h*/ (sizeof (Per_CPU_Control) ) + -#endif +/*percpu.h*/ (_SMP_Get_processor_count() * sizeof(Per_CPU_Control)) + /*ratemon.h*/ (sizeof _Rate_monotonic_Information) + |