forked from Imagelibrary/rtems
smptests: Be successful on one processor
This commit is contained in:
@@ -17,6 +17,12 @@
|
||||
#include <stdio.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
static void success(void)
|
||||
{
|
||||
locked_printf( "*** END OF TEST SMP02 ***\n" );
|
||||
rtems_test_exit( 0 );
|
||||
}
|
||||
|
||||
rtems_task Init(
|
||||
rtems_task_argument argument
|
||||
)
|
||||
@@ -31,6 +37,10 @@ rtems_task Init(
|
||||
locked_print_initialize();
|
||||
locked_printf( "\n\n*** SMP02 TEST ***\n" );
|
||||
|
||||
if ( rtems_smp_get_processor_count() == 1 ) {
|
||||
success();
|
||||
}
|
||||
|
||||
/* Create/verify synchronisation semaphore */
|
||||
status = rtems_semaphore_create(
|
||||
rtems_build_name ('S', 'E', 'M', '1'),
|
||||
@@ -95,6 +105,5 @@ rtems_task Init(
|
||||
}
|
||||
}
|
||||
|
||||
locked_printf( "*** END OF TEST SMP02 ***\n" );
|
||||
rtems_test_exit( 0 );
|
||||
success();
|
||||
}
|
||||
|
||||
@@ -17,6 +17,12 @@
|
||||
#include <stdio.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
static void success(void)
|
||||
{
|
||||
locked_printf( "*** END OF TEST SMP03 ***\n" );
|
||||
rtems_test_exit( 0 );
|
||||
}
|
||||
|
||||
void Loop() {
|
||||
volatile int i;
|
||||
|
||||
@@ -48,6 +54,10 @@ rtems_task Init(
|
||||
|
||||
locked_printf( "\n\n*** SMP03 TEST ***\n" );
|
||||
|
||||
if ( rtems_smp_get_processor_count() == 1 ) {
|
||||
success();
|
||||
}
|
||||
|
||||
/* Initialize the TaskRan array */
|
||||
TaskRan[0] = true;
|
||||
for ( i=1; i<rtems_smp_get_processor_count() ; i++ ) {
|
||||
@@ -98,8 +108,7 @@ rtems_task Init(
|
||||
TestFinished = false;
|
||||
}
|
||||
if (TestFinished) {
|
||||
locked_printf( "*** END OF TEST SMP03 ***\n" );
|
||||
rtems_test_exit( 0 );
|
||||
success();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,13 +14,18 @@
|
||||
#include <tmacros.h>
|
||||
#include "test_support.h"
|
||||
|
||||
static void success(void)
|
||||
{
|
||||
locked_printf( "*** END OF TEST SMP05 ***\n" );
|
||||
rtems_test_exit( 0 );
|
||||
}
|
||||
|
||||
rtems_task Test_task(
|
||||
rtems_task_argument argument
|
||||
)
|
||||
{
|
||||
locked_printf( "Shut down from CPU %" PRIu32 "\n", rtems_smp_get_current_processor() );
|
||||
locked_printf( "*** END OF TEST SMP05 ***\n" );
|
||||
rtems_test_exit(0);
|
||||
success();
|
||||
}
|
||||
|
||||
rtems_task Init(
|
||||
@@ -36,6 +41,10 @@ rtems_task Init(
|
||||
locked_print_initialize();
|
||||
locked_printf( "\n\n*** TEST SMP05 ***\n" );
|
||||
|
||||
if ( rtems_smp_get_processor_count() == 1 ) {
|
||||
success();
|
||||
}
|
||||
|
||||
for ( i=0; i<rtems_smp_get_processor_count() ; i++ ) {
|
||||
ch = '1' + i;
|
||||
|
||||
|
||||
@@ -16,6 +16,12 @@
|
||||
|
||||
volatile bool Ran;
|
||||
|
||||
static void success(void)
|
||||
{
|
||||
locked_printf( "*** END OF TEST SMP06 ***\n" );
|
||||
rtems_test_exit( 0 );
|
||||
}
|
||||
|
||||
rtems_task Test_task(
|
||||
rtems_task_argument do_exit
|
||||
)
|
||||
@@ -33,8 +39,7 @@ rtems_task Test_task(
|
||||
Ran = true;
|
||||
|
||||
if ( do_exit ) {
|
||||
locked_printf( "*** END OF TEST SMP06 ***\n" );
|
||||
rtems_test_exit(0);
|
||||
success();
|
||||
}
|
||||
while(1)
|
||||
;
|
||||
@@ -50,11 +55,16 @@ rtems_task Init(
|
||||
|
||||
locked_print_initialize();
|
||||
locked_printf( "\n\n*** TEST SMP06 ***\n" );
|
||||
locked_printf( "rtems_clock_tick - so this task has run longer\n" );
|
||||
status = rtems_clock_tick();
|
||||
directive_failed( status, "clock tick" );
|
||||
|
||||
rtems_test_assert( rtems_smp_get_processor_count() > 1 );
|
||||
if ( rtems_smp_get_processor_count() == 1 ) {
|
||||
success();
|
||||
}
|
||||
|
||||
locked_printf( "rtems_clock_tick - so this task has run longer\n" );
|
||||
_Thread_Disable_dispatch();
|
||||
status = rtems_clock_tick();
|
||||
_Thread_Enable_dispatch();
|
||||
directive_failed( status, "clock tick" );
|
||||
|
||||
cpu_num = rtems_smp_get_current_processor();
|
||||
|
||||
|
||||
@@ -18,6 +18,12 @@ volatile bool TaskRan = false;
|
||||
volatile bool TSRFired = false;
|
||||
rtems_id Semaphore;
|
||||
|
||||
static void success(void)
|
||||
{
|
||||
locked_printf( "*** END OF TEST SMP07 ***\n" );
|
||||
rtems_test_exit( 0 );
|
||||
}
|
||||
|
||||
rtems_task Test_task(
|
||||
rtems_task_argument argument
|
||||
)
|
||||
@@ -83,6 +89,10 @@ rtems_task Init(
|
||||
locked_print_initialize();
|
||||
locked_printf( "\n\n*** TEST SMP07 ***\n" );
|
||||
|
||||
if ( rtems_smp_get_processor_count() == 1 ) {
|
||||
success();
|
||||
}
|
||||
|
||||
/* Create/verify semaphore */
|
||||
status = rtems_semaphore_create(
|
||||
rtems_build_name ('S', 'E', 'M', '1'),
|
||||
@@ -147,8 +157,7 @@ rtems_task Init(
|
||||
}
|
||||
|
||||
/* End the program */
|
||||
locked_printf( "*** END OF TEST SMP07 ***\n" );
|
||||
rtems_test_exit(0);
|
||||
success();
|
||||
}
|
||||
|
||||
/* configuration information */
|
||||
|
||||
Reference in New Issue
Block a user