diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2019-04-05 08:16:05 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2019-04-09 08:06:46 +0200 |
commit | f9219db2a95c8285d1be22092572b4236bfe6488 (patch) | |
tree | c168ac7fdf7458cea6d7146584b2adb38d47f6a1 /testsuites/smptests/smp03/init.c | |
parent | rtems: Add rtems_scheduler_get_processor() (diff) | |
download | rtems-f9219db2a95c8285d1be22092572b4236bfe6488.tar.bz2 |
rtems: Add rtems_scheduler_get_processor_maximum()
Add rtems_scheduler_get_processor_maximum() as a replacement for
rtems_get_processor_count(). The rtems_get_processor_count() is a bit
orphaned. Adopt it by the Scheduler Manager. The count is also
misleading, since the processor set may have gaps and the actual count
of online processors may be less than the value returned by
rtems_get_processor_count().
Update #3732.
Diffstat (limited to 'testsuites/smptests/smp03/init.c')
-rw-r--r-- | testsuites/smptests/smp03/init.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/testsuites/smptests/smp03/init.c b/testsuites/smptests/smp03/init.c index 1e9bb69f7a..9f5171128c 100644 --- a/testsuites/smptests/smp03/init.c +++ b/testsuites/smptests/smp03/init.c @@ -50,20 +50,22 @@ rtems_task Init( char ch = '0'; rtems_id id; rtems_status_code status; + uint32_t cpu_max; Loop(); TEST_BEGIN(); locked_print_initialize(); + cpu_max = rtems_scheduler_get_processor_maximum(); - if ( rtems_get_processor_count() == 1 ) { + if ( cpu_max == 1 ) { success(); } /* Initialize the TaskRan array */ TaskRan[0] = true; - for ( i=1; i<rtems_get_processor_count() ; i++ ) { + for ( i=1; i<cpu_max ; i++ ) { TaskRan[i] = false; } @@ -71,7 +73,7 @@ rtems_task Init( PrintTaskInfo( "Init" ); /* for each remaining cpu create and start a task */ - for ( i=1; i < rtems_get_processor_count(); i++ ){ + for ( i=1; i < cpu_max; i++ ){ ch = '0' + i; @@ -104,13 +106,13 @@ rtems_task Init( &id ); directive_failed( status, "rtems_task_create" ); - status = rtems_task_start(id,Test_task,rtems_get_processor_count()); + status = rtems_task_start(id,Test_task,cpu_max); directive_failed( status, "rtems_task_start" ); /* Wait on all tasks to run */ while (1) { TestFinished = true; - for ( i=1; i < (rtems_get_processor_count()+1) ; i++ ) { + for ( i=1; i < (cpu_max+1) ; i++ ) { if (TaskRan[i] == false) TestFinished = false; } |