[PATCH 05/12] score: Add rtems_processors_get_count()

Sebastian Huber sebastian.huber at embedded-brains.de
Wed Jun 12 15:12:31 UTC 2013


Delete rtems_smp_get_number_of_processors().  Rename
_SMP_Processor_count to _Processors_Count and move definition to
<rtems/score/percpu.h>.  This value 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.
---
 c/src/lib/libbsp/sparc/leon3/smp/smp_leon3.c |    2 +-
 cpukit/libmisc/cpuuse/cpuusagereport.c       |    2 +-
 cpukit/rtems/include/rtems.h                 |   17 +++++++++++++++++
 cpukit/rtems/include/rtems/rtems/smp.h       |   12 ------------
 cpukit/score/include/rtems/score/percpu.h    |   18 ++++++++++++++++++
 cpukit/score/include/rtems/score/smp.h       |    8 --------
 cpukit/score/src/percpu.c                    |    2 +-
 cpukit/score/src/smp.c                       |    8 ++++----
 cpukit/score/src/threadcreateidle.c          |    2 +-
 testsuites/smptests/smp01/init.c             |    6 +++---
 testsuites/smptests/smp02/init.c             |    2 +-
 testsuites/smptests/smp03/init.c             |    8 ++++----
 testsuites/smptests/smp04/init.c             |   12 ++++++------
 testsuites/smptests/smp05/init.c             |    2 +-
 testsuites/smptests/smp06/init.c             |    2 +-
 testsuites/smptests/smp08/init.c             |    2 +-
 testsuites/smptests/smp09/init.c             |    2 +-
 testsuites/smptests/smpatomic01/init.c       |    6 +++---
 testsuites/smptests/smpatomic02/init.c       |    6 +++---
 testsuites/smptests/smpatomic03/init.c       |    6 +++---
 testsuites/smptests/smpatomic04/init.c       |    6 +++---
 testsuites/smptests/smpatomic05/init.c       |    6 +++---
 testsuites/smptests/smpatomic06/init.c       |    6 +++---
 testsuites/smptests/smpatomic07/init.c       |    6 +++---
 testsuites/smptests/smplock01/init.c         |    4 ++--
 testsuites/sptests/spsize/size.c             |    2 +-
 26 files changed, 85 insertions(+), 70 deletions(-)

diff --git a/c/src/lib/libbsp/sparc/leon3/smp/smp_leon3.c b/c/src/lib/libbsp/sparc/leon3/smp/smp_leon3.c
index 9081819..e961cdd 100644
--- a/c/src/lib/libbsp/sparc/leon3/smp/smp_leon3.c
+++ b/c/src/lib/libbsp/sparc/leon3/smp/smp_leon3.c
@@ -130,7 +130,7 @@ void bsp_smp_broadcast_interrupt(void)
   int max_cpus;
 
   cpu = bsp_smp_processor_id();
-  max_cpus = rtems_smp_get_number_of_processors();
+  max_cpus = rtems_processors_get_count();
 
   for ( dest_cpu=0 ; dest_cpu < max_cpus ; dest_cpu++ ) {
     if ( cpu == dest_cpu )
diff --git a/cpukit/libmisc/cpuuse/cpuusagereport.c b/cpukit/libmisc/cpuuse/cpuusagereport.c
index 0255c19..3464486 100644
--- a/cpukit/libmisc/cpuuse/cpuusagereport.c
+++ b/cpukit/libmisc/cpuuse/cpuusagereport.c
@@ -39,7 +39,7 @@
       }
     #else
       int  cpu;
-      for ( cpu=0 ; cpu < rtems_smp_get_number_of_processors() ; cpu++ ) {
+      for ( cpu=0 ; cpu < rtems_processors_get_count() ; cpu++ ) {
         Per_CPU_Control *p = &_Per_CPU_Information[cpu];
         if ( p->executing->Object.id == the_thread->Object.id ) {
           *time_of_context_switch = p->time_of_last_context_switch;
diff --git a/cpukit/rtems/include/rtems.h b/cpukit/rtems/include/rtems.h
index a644fa0..a2f7c6e 100644
--- a/cpukit/rtems/include/rtems.h
+++ b/cpukit/rtems/include/rtems.h
@@ -200,6 +200,23 @@ const char *rtems_get_version_string(void);
  */
 #define RTEMS_MINIMUN_HETERO_CONVERSION  MP_PACKET_MINIMUN_HETERO_CONVERSION
 
+/**
+ * @brief Returns the count of processors in the system.
+ *
+ * On uni-processor configurations this is a compile time constant and defined
+ * to be one.
+ *
+ * On SMP configurations this is a global variable set during system
+ * initialization to indicate the count of processors.  The processor count
+ * depends on the hardware and application configuration.  The value will
+ * always be less than or equal to the maximum count of application configured
+ * processors.
+ *
+ * @return The count of processors in the system.
+ */
+#define rtems_processors_get_count() \
+  _Processors_Count
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/cpukit/rtems/include/rtems/rtems/smp.h b/cpukit/rtems/include/rtems/rtems/smp.h
index 1b0618e..3b31bbb 100644
--- a/cpukit/rtems/include/rtems/rtems/smp.h
+++ b/cpukit/rtems/include/rtems/rtems/smp.h
@@ -37,18 +37,6 @@ extern "C" {
 /**@{*/
 
 /**
- * @brief Obtain Number of Cores in System
- *
- * This method returns the number of CPU cores that are currently in
- * the system. This will always be less than or equal to the number
- * of maximum number of cores which were configured.
- *
- * @retval This method returns the number of cores in this system.
- */
-#define rtems_smp_get_number_of_processors() \
-    (_SMP_Processor_count)
-
-/**
  * @brief Obtain Current Core Number
  *
  * This method returns the id of the current CPU core.
diff --git a/cpukit/score/include/rtems/score/percpu.h b/cpukit/score/include/rtems/score/percpu.h
index bb565d9..98ceb45 100644
--- a/cpukit/score/include/rtems/score/percpu.h
+++ b/cpukit/score/include/rtems/score/percpu.h
@@ -234,6 +234,24 @@ typedef struct {
  */
 extern Per_CPU_Control _Per_CPU_Information[] CPU_STRUCTURE_ALIGNMENT;
 
+/**
+ * @brief Count of processors in the system.
+ *
+ * On uni-processor configurations this is a compile time constant and defined
+ * to be one.
+ *
+ * On SMP configurations this is a global variable set during system
+ * initialization to indicate the count of processors.  The processor count
+ * depends on the hardware and application configuration.  The value will
+ * always be less than or equal to the maximum count of application configured
+ * processors.
+ */
+#if defined( RTEMS_SMP )
+  SCORE_EXTERN uint32_t _Processors_Count;
+#else
+  #define _Processors_Count 1U
+#endif
+
 #if defined(RTEMS_SMP)
 /**
  *  @brief Set of Pointers to Per CPU Core Information
diff --git a/cpukit/score/include/rtems/score/smp.h b/cpukit/score/include/rtems/score/smp.h
index c7de6d6..145e5e9 100644
--- a/cpukit/score/include/rtems/score/smp.h
+++ b/cpukit/score/include/rtems/score/smp.h
@@ -60,14 +60,6 @@ extern "C" {
 
 #ifndef ASM
 /**
- *  @brief Number of CPUs in a SMP system.
- *
- *  This variable is set during the SMP initialization sequence to
- *  indicate the number of CPUs in this system.
- */
-SCORE_EXTERN uint32_t _SMP_Processor_count;
-
-/**
  *  @brief Sends a SMP message to a processor.
  *
  *  The target processor may be the sending processor.
diff --git a/cpukit/score/src/percpu.c b/cpukit/score/src/percpu.c
index a957053..d6d056f 100644
--- a/cpukit/score/src/percpu.c
+++ b/cpukit/score/src/percpu.c
@@ -63,7 +63,7 @@
      */
     max_cpus = bsp_smp_initialize( max_cpus );
 
-    _SMP_Processor_count = max_cpus;
+    _Processors_Count = max_cpus;
 
     for ( cpu = 1 ; cpu < max_cpus; ++cpu ) {
       _Per_CPU_Wait_for_state(
diff --git a/cpukit/score/src/smp.c b/cpukit/score/src/smp.c
index a8d8f49..4ef538d 100644
--- a/cpukit/score/src/smp.c
+++ b/cpukit/score/src/smp.c
@@ -126,7 +126,7 @@ void _SMP_Send_message( int cpu, uint32_t message )
 void _SMP_Broadcast_message( uint32_t message )
 {
   int self = bsp_smp_processor_id();
-  int ncpus = _SMP_Processor_count;
+  int ncpus = _Processors_Count;
   int cpu;
 
   for ( cpu = 0 ; cpu < ncpus ; ++cpu ) {
@@ -146,7 +146,7 @@ void _SMP_Broadcast_message( uint32_t message )
 void _SMP_Request_other_cores_to_perform_first_context_switch( void )
 {
   int self = bsp_smp_processor_id();
-  int ncpus = _SMP_Processor_count;
+  int ncpus = _Processors_Count;
   int cpu;
 
   for ( cpu = 0 ; cpu < ncpus ; ++cpu ) {
@@ -165,7 +165,7 @@ void _SMP_Request_other_cores_to_dispatch( void )
 {
   if ( _System_state_Is_up( _System_state_Get() ) ) {
     int self = bsp_smp_processor_id();
-    int ncpus = _SMP_Processor_count;
+    int ncpus = _Processors_Count;
     int cpu;
 
     for ( cpu = 0 ; cpu < ncpus ; ++cpu ) {
@@ -185,7 +185,7 @@ void _SMP_Request_other_cores_to_dispatch( void )
 void _SMP_Request_other_cores_to_shutdown( void )
 {
   int self = bsp_smp_processor_id();
-  int ncpus = _SMP_Processor_count;
+  int ncpus = _Processors_Count;
   int cpu;
 
   _SMP_Broadcast_message( RTEMS_BSP_SMP_SHUTDOWN );
diff --git a/cpukit/score/src/threadcreateidle.c b/cpukit/score/src/threadcreateidle.c
index e4581c8..e588657 100644
--- a/cpukit/score/src/threadcreateidle.c
+++ b/cpukit/score/src/threadcreateidle.c
@@ -89,7 +89,7 @@ void _Thread_Create_idle( void )
   #if defined(RTEMS_SMP)
     int cpu;
 
-    for ( cpu=0 ; cpu < _SMP_Processor_count ; cpu++ ) {
+    for ( cpu=0 ; cpu < _Processors_Count ; cpu++ ) {
       _Thread_Create_idle_helper(
         _Objects_Build_name( 'I', 'D', 'L', 'E' ),
         cpu
diff --git a/testsuites/smptests/smp01/init.c b/testsuites/smptests/smp01/init.c
index af2a367..2662a5e 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_processors_get_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_processors_get_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_processors_get_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 968d90c..11f0686 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_processors_get_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 5371d49..679bd4c 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_processors_get_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_processors_get_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_processors_get_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_processors_get_count()+1) ; i++ ) {
       if (TaskRan[i] == false)
         TestFinished = false;
     }
diff --git a/testsuites/smptests/smp04/init.c b/testsuites/smptests/smp04/init.c
index c61e81f..9b8056a 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_processors_get_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_processors_get_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_processors_get_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_processors_get_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_processors_get_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_processors_get_count() ; i++ ) {
       if (TaskRan[i] == false)
         allDone = false;
     }
diff --git a/testsuites/smptests/smp05/init.c b/testsuites/smptests/smp05/init.c
index 1078ffd..f1922b9 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_processors_get_count() ; i++ ) {
     ch = '1' + i;
 
     status = rtems_task_create(
diff --git a/testsuites/smptests/smp06/init.c b/testsuites/smptests/smp06/init.c
index f524b1f..453618d 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_processors_get_count()  > 1 );
 
   cpu_num = bsp_smp_processor_id();
 
diff --git a/testsuites/smptests/smp08/init.c b/testsuites/smptests/smp08/init.c
index 8e8de7c..ab8e482 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_processors_get_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 c599a7f..64f227c 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_processors_get_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 7d70860..02734e1 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_processors_get_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_processors_get_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_processors_get_count() ; i++ ) {
       if (TaskRan[i] == false)
         allDone = false;
     }
diff --git a/testsuites/smptests/smpatomic02/init.c b/testsuites/smptests/smpatomic02/init.c
index 75d0ea0..8cb19e2 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_processors_get_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_processors_get_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_processors_get_count() ; i++ ) {
       if (TaskRan[i] == false)
         allDone = false;
     }
diff --git a/testsuites/smptests/smpatomic03/init.c b/testsuites/smptests/smpatomic03/init.c
index 5fe16f1..03d9b70 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_processors_get_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_processors_get_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_processors_get_count() ; i++ ) {
       if (TaskRan[i] == false)
         allDone = false;
     }
diff --git a/testsuites/smptests/smpatomic04/init.c b/testsuites/smptests/smpatomic04/init.c
index 630e9a2..b50b2da 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_processors_get_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_processors_get_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_processors_get_count() ; i++ ) {
       if (TaskRan[i] == false)
         allDone = false;
     }
diff --git a/testsuites/smptests/smpatomic05/init.c b/testsuites/smptests/smpatomic05/init.c
index 42515d8..46fa668 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_processors_get_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_processors_get_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_processors_get_count() ; i++ ) {
       if (TaskRan[i] == false)
         allDone = false;
     }
diff --git a/testsuites/smptests/smpatomic06/init.c b/testsuites/smptests/smpatomic06/init.c
index c75c629..7c5c530 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_processors_get_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_processors_get_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_processors_get_count() ; i++ ) {
       if (TaskRan[i] == false)
         allDone = false;
     }
diff --git a/testsuites/smptests/smpatomic07/init.c b/testsuites/smptests/smpatomic07/init.c
index 570a1a8..457c532 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_processors_get_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_processors_get_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_processors_get_count() ; i++ ) {
       if (TaskRan[i] == false)
         allDone = false;
     }
diff --git a/testsuites/smptests/smplock01/init.c b/testsuites/smptests/smplock01/init.c
index 88ef985..5b5d9db 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_processors_get_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_processors_get_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 09a881a..4e7ec7f 100644
--- a/testsuites/sptests/spsize/size.c
+++ b/testsuites/sptests/spsize/size.c
@@ -342,7 +342,7 @@ uninitialized =
 #endif
 
 #if defined(RTEMS_SMP)
-/*percpu.h*/    (_SMP_Processor_count * sizeof(Per_CPU_Control))  +
+/*percpu.h*/    (_Processors_Count * sizeof(Per_CPU_Control))  +
 #else
 /*percpu.h*/    (sizeof (Per_CPU_Control) )                       +
 #endif
-- 
1.7.7




More information about the devel mailing list