summaryrefslogtreecommitdiffstats
path: root/testsuites/smptests/smpcache01
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2019-04-05 08:16:05 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2019-04-09 08:06:46 +0200
commitf9219db2a95c8285d1be22092572b4236bfe6488 (patch)
treec168ac7fdf7458cea6d7146584b2adb38d47f6a1 /testsuites/smptests/smpcache01
parentrtems: Add rtems_scheduler_get_processor() (diff)
downloadrtems-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/smpcache01')
-rw-r--r--testsuites/smptests/smpcache01/init.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/testsuites/smptests/smpcache01/init.c b/testsuites/smptests/smpcache01/init.c
index a679764d5d..313a3df2e4 100644
--- a/testsuites/smptests/smpcache01/init.c
+++ b/testsuites/smptests/smpcache01/init.c
@@ -82,7 +82,11 @@ static void test_cache_invalidate_multiple_instruction_lines(
static void barrier( SMP_barrier_State *bs )
{
- _SMP_barrier_Wait( &ctx.barrier, bs, rtems_get_processor_count() );
+ _SMP_barrier_Wait(
+ &ctx.barrier,
+ bs,
+ rtems_scheduler_get_processor_maximum()
+ );
}
static void broadcast_test_init( void )
@@ -101,7 +105,8 @@ static void broadcast_test_body(
static void broadcast_test_fini( void )
{
rtems_test_assert(
- ctx.count[rtems_scheduler_get_processor()] == rtems_get_processor_count()
+ ctx.count[rtems_scheduler_get_processor()]
+ == rtems_scheduler_get_processor_maximum()
);
}
@@ -175,9 +180,9 @@ static void cmlog( const char* str )
static void all_tests( void )
{
- uint32_t cpu_count = rtems_get_processor_count();
- size_t set_size = CPU_ALLOC_SIZE( rtems_get_processor_count() );
- cpu_set_t *cpu_set = CPU_ALLOC( rtems_get_processor_count() );
+ uint32_t cpu_count = rtems_scheduler_get_processor_maximum();
+ size_t set_size = CPU_ALLOC_SIZE( cpu_count );
+ cpu_set_t *cpu_set = CPU_ALLOC( cpu_count );
SMP_barrier_State bs = SMP_BARRIER_STATE_INITIALIZER;
/* Send message to all available CPUs */
@@ -217,7 +222,7 @@ static void test_smp_cache_manager( void )
{
rtems_status_code sc;
size_t worker_index;
- uint32_t cpu_count = rtems_get_processor_count();
+ uint32_t cpu_count = rtems_scheduler_get_processor_maximum();
for (worker_index = 1; worker_index < cpu_count; ++worker_index) {
rtems_id worker_id;