summaryrefslogtreecommitdiffstats
path: root/testsuites/smptests/smpcapture02/init.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-12 10:57:15 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-12 13:24:42 +0200
commit1379d840a483ccdce109fa8e45ef63d51a6e8e00 (patch)
treed03e638db4735c36c8c987be65f4b4744066196f /testsuites/smptests/smpcapture02/init.c
parentrtems: Add rtems_interrupt_lock_interrupt_disable (diff)
downloadrtems-1379d840a483ccdce109fa8e45ef63d51a6e8e00.tar.bz2
smptests/smpcapture02: Adjust for clock changes
Fix overall clock tick count. Change introduced by 90d8567d34a6d80da04b1cb37b667a3173f584c4. Update #2554.
Diffstat (limited to 'testsuites/smptests/smpcapture02/init.c')
-rw-r--r--testsuites/smptests/smpcapture02/init.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/testsuites/smptests/smpcapture02/init.c b/testsuites/smptests/smpcapture02/init.c
index bd912ee8e7..787b7f339f 100644
--- a/testsuites/smptests/smpcapture02/init.c
+++ b/testsuites/smptests/smpcapture02/init.c
@@ -155,10 +155,9 @@ static void task(rtems_task_argument arg)
rtems_task_suspend(rtems_task_self());
}
-static void test(void)
+static void test(uint32_t cpu_count)
{
rtems_status_code sc;
- uint32_t cpu_count;
uint32_t t;
uint32_t c;
rtems_task_argument idx;
@@ -171,9 +170,6 @@ static void test(void)
RTEMS_NO_PRIORITY_CEILING |
RTEMS_FIFO, 0, &finished_sem);
- /* Get the number of processors that we are using. */
- cpu_count = rtems_get_processor_count();
-
/*
* Create a set of tasks per CPU. Chain them together using
* semaphores so that only one task can be active at any given
@@ -266,6 +262,7 @@ static void Init(rtems_task_argument arg)
rtems_status_code sc;
uint32_t i;
uint32_t cpu;
+ uint32_t cpu_count;
uint32_t read;
uint32_t enter_count;
uint32_t exit_count;
@@ -282,6 +279,9 @@ static void Init(rtems_task_argument arg)
TEST_BEGIN();
+ /* Get the number of processors that we are using. */
+ cpu_count = rtems_get_processor_count();
+
sc = rtems_capture_open(50000, NULL);
rtems_test_assert(sc == RTEMS_SUCCESSFUL);
@@ -292,7 +292,7 @@ static void Init(rtems_task_argument arg)
rtems_test_assert(sc == RTEMS_SUCCESSFUL);
/* Run main test */
- test();
+ test(cpu_count);
/* Try to find the clock interrupt handler */
for ( vec=BSP_INTERRUPT_VECTOR_MIN; vec<BSP_INTERRUPT_VECTOR_MAX; vec++ ) {
@@ -322,7 +322,7 @@ static void Init(rtems_task_argument arg)
clock_tick_count = 0;
/* Read out the trace from all processors */
- for ( cpu = 0; cpu < rtems_get_processor_count(); cpu++ ) {
+ for ( cpu = 0; cpu < cpu_count; cpu++ ) {
sc = rtems_capture_read(cpu, &read, &recs);
rtems_test_assert(sc == RTEMS_SUCCESSFUL);
@@ -400,7 +400,7 @@ static void Init(rtems_task_argument arg)
}
if( cih.found )
- rtems_test_assert(clock_tick_count == CLOCK_TICKS);
+ rtems_test_assert(clock_tick_count == cpu_count * CLOCK_TICKS);
TEST_END();
rtems_test_exit(0);