diff --git a/testsuites/tmtests/include/timesys.h b/testsuites/tmtests/include/timesys.h index 0543329dd1..96664a119c 100644 --- a/testsuites/tmtests/include/timesys.h +++ b/testsuites/tmtests/include/timesys.h @@ -55,23 +55,29 @@ /* functions */ -#define put_time( _message, _total_time, \ - _iterations, _loop_overhead, _overhead ) \ - printf( \ - "%s - %" PRId32 "\n", \ - (_message), \ - (((_total_time) - (_loop_overhead)) / (_iterations)) - (_overhead) \ - ) +#define put_time( \ + _message, \ + _total_time, \ + _iterations, \ + _loop_overhead, \ + _overhead \ +) \ + printf( \ + "%s - %" PRId32 "\n", \ + ( _message ), \ + ( ( ( _total_time ) - ( _loop_overhead ) ) / ( _iterations ) ) - \ + ( _overhead ) \ + ) -#if defined(CONFIGURE_STACK_CHECKER_ENABLED) || defined(RTEMS_DEBUG) -#define Print_Warning() \ - do { \ - puts( \ - "\n" \ +#if defined( CONFIGURE_STACK_CHECKER_ENABLED ) || defined( RTEMS_DEBUG ) +#define Print_Warning() \ + do { \ + puts( \ + "\n" \ "THE TIMES REPORTED BY THIS TEST INCLUDE DEBUG CODE!\n" \ - "\n" \ - ); \ - } while (0) + "\n" \ + ); \ + } while ( 0 ) #else #define Print_Warning() @@ -79,7 +85,7 @@ /* variables */ -TEST_EXTERN volatile uint32_t end_time; /* ending time variable */ -TEST_EXTERN volatile uint32_t overhead; /* loop overhead variable */ +TEST_EXTERN volatile uint32_t end_time; /* ending time variable */ +TEST_EXTERN volatile uint32_t overhead; /* loop overhead variable */ /* end of include file */ diff --git a/testsuites/tmtests/tm01/system.h b/testsuites/tmtests/tm01/system.h index d5f60d3c83..8cb45ab761 100644 --- a/testsuites/tmtests/tm01/system.h +++ b/testsuites/tmtests/tm01/system.h @@ -29,27 +29,24 @@ * POSSIBILITY OF SUCH DAMAGE. */ - #include /* functions */ -rtems_task Init( - rtems_task_argument argument -); +rtems_task Init( rtems_task_argument argument ); #include -rtems_name Task_name[ OPERATION_COUNT+1 ]; /* array of task names */ -rtems_id Task_id[ OPERATION_COUNT+1 ]; /* array of task ids */ +rtems_name Task_name[ OPERATION_COUNT + 1 ]; /* array of task names */ +rtems_id Task_id[ OPERATION_COUNT + 1 ]; /* array of task ids */ /* configuration information */ #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER -#define CONFIGURE_MAXIMUM_TASKS 2 -#define CONFIGURE_MAXIMUM_SEMAPHORES 1 +#define CONFIGURE_MAXIMUM_TASKS 2 +#define CONFIGURE_MAXIMUM_SEMAPHORES 1 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE diff --git a/testsuites/tmtests/tm01/task1.c b/testsuites/tmtests/tm01/task1.c index 35bb97a651..bd4d80d1e1 100644 --- a/testsuites/tmtests/tm01/task1.c +++ b/testsuites/tmtests/tm01/task1.c @@ -26,7 +26,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#if !defined(OPERATION_COUNT) +#if !defined( OPERATION_COUNT ) #define OPERATION_COUNT 100 #endif @@ -41,13 +41,9 @@ const char rtems_test_name[] = "TIME TEST"; -rtems_task Test_task( - rtems_task_argument argument -); +rtems_task Test_task( rtems_task_argument argument ); -rtems_task Init( - rtems_task_argument argument -) +rtems_task Init( rtems_task_argument argument ) { (void) argument; @@ -63,7 +59,7 @@ rtems_task Init( status = rtems_task_create( Task_name[ 1 ], - (RTEMS_MAXIMUM_PRIORITY / 2u) + 1u, + ( RTEMS_MAXIMUM_PRIORITY / 2u ) + 1u, RTEMS_MINIMUM_STACK_SIZE, RTEMS_DEFAULT_MODES, RTEMS_DEFAULT_ATTRIBUTES, @@ -77,63 +73,48 @@ rtems_task Init( rtems_task_exit(); } -rtems_task Test_task( - rtems_task_argument argument -) +rtems_task Test_task( rtems_task_argument argument ) { (void) argument; - uint32_t semaphore_obtain_time; - uint32_t semaphore_release_time; - uint32_t semaphore_obtain_no_wait_time; - uint32_t semaphore_obtain_loop_time; - uint32_t semaphore_release_loop_time; - uint32_t index; - uint32_t iterations; + uint32_t semaphore_obtain_time; + uint32_t semaphore_release_time; + uint32_t semaphore_obtain_no_wait_time; + uint32_t semaphore_obtain_loop_time; + uint32_t semaphore_release_loop_time; + uint32_t index; + uint32_t iterations; rtems_name name; rtems_id smid; rtems_status_code status; name = rtems_build_name( 'S', 'M', '1', ' ' ); - semaphore_obtain_time = 0; - semaphore_release_time = 0; - semaphore_obtain_no_wait_time = 0; - semaphore_obtain_loop_time = 0; - semaphore_release_loop_time = 0; - + semaphore_obtain_time = 0; + semaphore_release_time = 0; + semaphore_obtain_no_wait_time = 0; + semaphore_obtain_loop_time = 0; + semaphore_release_loop_time = 0; /* Time one invocation of rtems_semaphore_create */ benchmark_timer_initialize(); - (void) rtems_semaphore_create( - name, - OPERATION_COUNT, - RTEMS_DEFAULT_MODES, - RTEMS_NO_PRIORITY, - &smid - ); - end_time = benchmark_timer_read(); - put_time( - "rtems_semaphore_create: only case", - end_time, - 1, - 0, - 0 + (void) rtems_semaphore_create( + name, + OPERATION_COUNT, + RTEMS_DEFAULT_MODES, + RTEMS_NO_PRIORITY, + &smid ); + end_time = benchmark_timer_read(); + put_time( "rtems_semaphore_create: only case", end_time, 1, 0, 0 ); /* Time one invocation of rtems_semaphore_delete */ benchmark_timer_initialize(); - (void) rtems_semaphore_delete( smid ); + (void) rtems_semaphore_delete( smid ); end_time = benchmark_timer_read(); - put_time( - "rtems_semaphore_delete: only case", - end_time, - 1, - 0, - 0 - ); + put_time( "rtems_semaphore_delete: only case", end_time, 1, 0, 0 ); status = rtems_semaphore_create( name, @@ -144,25 +125,26 @@ rtems_task Test_task( ); directive_failed( status, "rtems_task_create of TA1" ); - for ( iterations=OPERATION_COUNT ; iterations ; iterations-- ) { - + for ( iterations = OPERATION_COUNT; iterations; iterations-- ) { benchmark_timer_initialize(); - for ( index = 1 ; index<=OPERATION_COUNT ; index++ ) - (void) benchmark_timer_empty_function(); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) benchmark_timer_empty_function(); + } end_time = benchmark_timer_read(); - semaphore_obtain_loop_time += end_time; + semaphore_obtain_loop_time += end_time; semaphore_release_loop_time += end_time; /* rtems_semaphore_obtain (available) */ benchmark_timer_initialize(); - for ( index = 1 ; index<=OPERATION_COUNT ; index++ ) - (void) rtems_semaphore_obtain( - smid, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) rtems_semaphore_obtain( + smid, + RTEMS_DEFAULT_OPTIONS, + RTEMS_NO_TIMEOUT + ); + } end_time = benchmark_timer_read(); semaphore_obtain_time += end_time; @@ -170,21 +152,24 @@ rtems_task Test_task( /* rtems_semaphore_release */ benchmark_timer_initialize(); - for ( index = 1 ; index<=OPERATION_COUNT ; index++ ) - (void) rtems_semaphore_release( smid ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) rtems_semaphore_release( smid ); + } end_time = benchmark_timer_read(); semaphore_release_time += end_time; /* semaphore obtain (RTEMS_NO_WAIT) */ benchmark_timer_initialize(); - for ( index = 1 ; index<=OPERATION_COUNT ; index++ ) - rtems_semaphore_obtain( smid, RTEMS_NO_WAIT, RTEMS_NO_TIMEOUT ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + rtems_semaphore_obtain( smid, RTEMS_NO_WAIT, RTEMS_NO_TIMEOUT ); + } semaphore_obtain_no_wait_time += benchmark_timer_read(); benchmark_timer_initialize(); - for ( index = 1 ; index<=OPERATION_COUNT ; index++ ) - rtems_semaphore_release( smid ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + rtems_semaphore_release( smid ); + } end_time = benchmark_timer_read(); semaphore_release_time += end_time; diff --git a/testsuites/tmtests/tm02/system.h b/testsuites/tmtests/tm02/system.h index 66d3912f5a..e49f72e6d1 100644 --- a/testsuites/tmtests/tm02/system.h +++ b/testsuites/tmtests/tm02/system.h @@ -29,14 +29,11 @@ * POSSIBILITY OF SUCH DAMAGE. */ - #include /* functions */ -rtems_task Init( - rtems_task_argument argument -); +rtems_task Init( rtems_task_argument argument ); #include @@ -45,8 +42,8 @@ rtems_task Init( #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER -#define CONFIGURE_MAXIMUM_TASKS (3 + OPERATION_COUNT) -#define CONFIGURE_MAXIMUM_SEMAPHORES 1 +#define CONFIGURE_MAXIMUM_TASKS ( 3 + OPERATION_COUNT ) +#define CONFIGURE_MAXIMUM_SEMAPHORES 1 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE diff --git a/testsuites/tmtests/tm02/tm02impl.h b/testsuites/tmtests/tm02/tm02impl.h index 3006a8483c..e8c7472f91 100644 --- a/testsuites/tmtests/tm02/tm02impl.h +++ b/testsuites/tmtests/tm02/tm02impl.h @@ -26,7 +26,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#if !defined(OPERATION_COUNT) +#if !defined( OPERATION_COUNT ) #define OPERATION_COUNT 100 #endif @@ -39,25 +39,25 @@ #define CONFIGURE_INIT #include "system.h" -#if defined(TM02) +#if defined( TM02 ) const char rtems_test_name[] = "TIME TEST 2"; -#define SEMAPHORE_ATTRIBUTES (RTEMS_COUNTING_SEMAPHORE | RTEMS_FIFO) -#define ATTR_DESC "counting/FIFO" +#define SEMAPHORE_ATTRIBUTES ( RTEMS_COUNTING_SEMAPHORE | RTEMS_FIFO ) +#define ATTR_DESC "counting/FIFO" -#elif defined(TM31) +#elif defined( TM31 ) const char rtems_test_name[] = "TIME TEST 31"; -#define SEMAPHORE_ATTRIBUTES (RTEMS_COUNTING_SEMAPHORE | RTEMS_PRIORITY) -#define ATTR_DESC "counting/priority" +#define SEMAPHORE_ATTRIBUTES ( RTEMS_COUNTING_SEMAPHORE | RTEMS_PRIORITY ) +#define ATTR_DESC "counting/priority" -#elif defined(TM33) +#elif defined( TM33 ) const char rtems_test_name[] = "TIME TEST 33"; #define SEMAPHORE_ATTRIBUTES RTEMS_BINARY_SEMAPHORE -#define ATTR_DESC "binary/FIFO" +#define ATTR_DESC "binary/FIFO" -#elif defined(TM35) +#elif defined( TM35 ) const char rtems_test_name[] = "TIME TEST 35"; -#define SEMAPHORE_ATTRIBUTES (RTEMS_BINARY_SEMAPHORE | RTEMS_PRIORITY) -#define ATTR_DESC "binary/priority" +#define SEMAPHORE_ATTRIBUTES ( RTEMS_BINARY_SEMAPHORE | RTEMS_PRIORITY ) +#define ATTR_DESC "binary/priority" #else #error "Unknown test configuration" @@ -67,25 +67,17 @@ rtems_id High_id; rtems_id Low_id; rtems_id Semaphore_id; -rtems_task High_task( - rtems_task_argument argument -); +rtems_task High_task( rtems_task_argument argument ); -rtems_task Middle_tasks( - rtems_task_argument argument -); +rtems_task Middle_tasks( rtems_task_argument argument ); -rtems_task Low_task( - rtems_task_argument argument -); +rtems_task Low_task( rtems_task_argument argument ); int operation_count = OPERATION_COUNT; -void test_init(void); +void test_init( void ); -rtems_task Init( - rtems_task_argument argument -) +rtems_task Init( rtems_task_argument argument ) { (void) argument; @@ -101,7 +93,7 @@ rtems_task Init( directive_failed( status, "rtems_task_suspend" ); } -void test_init(void) +void test_init( void ) { rtems_status_code status; int index; @@ -124,9 +116,10 @@ void test_init(void) status = rtems_task_start( High_id, High_task, 0 ); directive_failed( status, "rtems_task_start of high task" ); - if ( OPERATION_COUNT > RTEMS_MAXIMUM_PRIORITY - 2u ) - operation_count = (int) (RTEMS_MAXIMUM_PRIORITY - 2u); - for ( index=2 ; index < operation_count ; index++ ) { + if ( OPERATION_COUNT > RTEMS_MAXIMUM_PRIORITY - 2u ) { + operation_count = (int) ( RTEMS_MAXIMUM_PRIORITY - 2u ); + } + for ( index = 2; index < operation_count; index++ ) { status = rtems_task_create( rtems_build_name( 'M', 'I', 'D', ' ' ), priority, @@ -157,7 +150,7 @@ void test_init(void) directive_failed( status, "rtems_task_start low" ); status = rtems_semaphore_create( - rtems_build_name( 'S', 'M', '1', ' '), + rtems_build_name( 'S', 'M', '1', ' ' ), 0, SEMAPHORE_ATTRIBUTES, RTEMS_NO_PRIORITY, @@ -166,9 +159,7 @@ void test_init(void) directive_failed( status, "rtems_semaphore_create of SM1" ); } -rtems_task High_task( - rtems_task_argument argument -) +rtems_task High_task( rtems_task_argument argument ) { (void) argument; @@ -182,9 +173,7 @@ rtems_task High_task( ); } -rtems_task Middle_tasks( - rtems_task_argument argument -) +rtems_task Middle_tasks( rtems_task_argument argument ) { (void) argument; @@ -195,9 +184,7 @@ rtems_task Middle_tasks( ); } -rtems_task Low_task( - rtems_task_argument argument -) +rtems_task Low_task( rtems_task_argument argument ) { (void) argument; diff --git a/testsuites/tmtests/tm03/system.h b/testsuites/tmtests/tm03/system.h index 66d3912f5a..e49f72e6d1 100644 --- a/testsuites/tmtests/tm03/system.h +++ b/testsuites/tmtests/tm03/system.h @@ -29,14 +29,11 @@ * POSSIBILITY OF SUCH DAMAGE. */ - #include /* functions */ -rtems_task Init( - rtems_task_argument argument -); +rtems_task Init( rtems_task_argument argument ); #include @@ -45,8 +42,8 @@ rtems_task Init( #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER -#define CONFIGURE_MAXIMUM_TASKS (3 + OPERATION_COUNT) -#define CONFIGURE_MAXIMUM_SEMAPHORES 1 +#define CONFIGURE_MAXIMUM_TASKS ( 3 + OPERATION_COUNT ) +#define CONFIGURE_MAXIMUM_SEMAPHORES 1 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE diff --git a/testsuites/tmtests/tm03/tm03impl.h b/testsuites/tmtests/tm03/tm03impl.h index 5385aa7025..7200682da3 100644 --- a/testsuites/tmtests/tm03/tm03impl.h +++ b/testsuites/tmtests/tm03/tm03impl.h @@ -26,7 +26,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#if !defined(OPERATION_COUNT) +#if !defined( OPERATION_COUNT ) #define OPERATION_COUNT 100 #endif @@ -39,49 +39,40 @@ #define CONFIGURE_INIT #include "system.h" -#if defined(TM03) +#if defined( TM03 ) const char rtems_test_name[] = "TIME TEST 3"; -#define SEMAPHORE_ATTRIBUTES (RTEMS_COUNTING_SEMAPHORE | RTEMS_FIFO) -#define ATTR_DESC "counting/FIFO" +#define SEMAPHORE_ATTRIBUTES ( RTEMS_COUNTING_SEMAPHORE | RTEMS_FIFO ) +#define ATTR_DESC "counting/FIFO" -#elif defined(TM32) +#elif defined( TM32 ) const char rtems_test_name[] = "TIME TEST 32"; -#define SEMAPHORE_ATTRIBUTES (RTEMS_COUNTING_SEMAPHORE | RTEMS_PRIORITY) -#define ATTR_DESC "counting/priority" +#define SEMAPHORE_ATTRIBUTES ( RTEMS_COUNTING_SEMAPHORE | RTEMS_PRIORITY ) +#define ATTR_DESC "counting/priority" -#elif defined(TM34) +#elif defined( TM34 ) const char rtems_test_name[] = "TIME TEST 34"; #define SEMAPHORE_ATTRIBUTES RTEMS_BINARY_SEMAPHORE -#define ATTR_DESC "binary/FIFO" +#define ATTR_DESC "binary/FIFO" -#elif defined(TM36) +#elif defined( TM36 ) const char rtems_test_name[] = "TIME TEST 36"; -#define SEMAPHORE_ATTRIBUTES (RTEMS_BINARY_SEMAPHORE | RTEMS_PRIORITY) -#define ATTR_DESC "binary/priority" +#define SEMAPHORE_ATTRIBUTES ( RTEMS_BINARY_SEMAPHORE | RTEMS_PRIORITY ) +#define ATTR_DESC "binary/priority" #else #error "Unknown test configuration" #endif +rtems_id Semaphore_id; +rtems_task test_init( rtems_task_argument argument ); -rtems_id Semaphore_id; -rtems_task test_init( - rtems_task_argument argument -); +rtems_task Middle_tasks( rtems_task_argument argument ); -rtems_task Middle_tasks( - rtems_task_argument argument -); - -rtems_task High_task( - rtems_task_argument argument -); +rtems_task High_task( rtems_task_argument argument ); int operation_count = OPERATION_COUNT; -rtems_task Init( - rtems_task_argument argument -) +rtems_task Init( rtems_task_argument argument ) { (void) argument; @@ -107,9 +98,7 @@ rtems_task Init( rtems_task_exit(); } -rtems_task test_init( - rtems_task_argument argument -) +rtems_task test_init( rtems_task_argument argument ) { (void) argument; @@ -121,7 +110,7 @@ rtems_task test_init( priority = RTEMS_MAXIMUM_PRIORITY - 2u; status = rtems_semaphore_create( - rtems_build_name( 'S', 'M', '1', '\0'), + rtems_build_name( 'S', 'M', '1', '\0' ), 0, SEMAPHORE_ATTRIBUTES, RTEMS_NO_PRIORITY, @@ -129,9 +118,10 @@ rtems_task test_init( ); directive_failed( status, "rtems_semaphore_create of SM1" ); - if ( OPERATION_COUNT > RTEMS_MAXIMUM_PRIORITY - 2u ) - operation_count = (int) (RTEMS_MAXIMUM_PRIORITY - 2u); - for ( index = 2 ; index < operation_count ; index ++ ) { + if ( OPERATION_COUNT > RTEMS_MAXIMUM_PRIORITY - 2u ) { + operation_count = (int) ( RTEMS_MAXIMUM_PRIORITY - 2u ); + } + for ( index = 2; index < operation_count; index++ ) { rtems_task_create( rtems_build_name( 'M', 'I', 'D', ' ' ), priority, @@ -161,13 +151,11 @@ rtems_task test_init( status = rtems_task_start( task_id, High_task, 0 ); directive_failed( status, "rtems_task_start of high task" ); - benchmark_timer_initialize(); /* start the timer */ + benchmark_timer_initialize(); /* start the timer */ status = rtems_semaphore_release( Semaphore_id ); } -rtems_task Middle_tasks( - rtems_task_argument argument -) +rtems_task Middle_tasks( rtems_task_argument argument ) { (void) argument; @@ -180,9 +168,7 @@ rtems_task Middle_tasks( (void) rtems_semaphore_release( Semaphore_id ); } -rtems_task High_task( - rtems_task_argument argument -) +rtems_task High_task( rtems_task_argument argument ) { (void) argument; diff --git a/testsuites/tmtests/tm04/system.h b/testsuites/tmtests/tm04/system.h index a330fde825..dc39b4cce3 100644 --- a/testsuites/tmtests/tm04/system.h +++ b/testsuites/tmtests/tm04/system.h @@ -29,14 +29,11 @@ * POSSIBILITY OF SUCH DAMAGE. */ - #include /* functions */ -rtems_task Init( - rtems_task_argument argument -); +rtems_task Init( rtems_task_argument argument ); #include @@ -45,8 +42,8 @@ rtems_task Init( #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER -#define CONFIGURE_MAXIMUM_TASKS (4 + OPERATION_COUNT) -#define CONFIGURE_MAXIMUM_SEMAPHORES 1 +#define CONFIGURE_MAXIMUM_TASKS ( 4 + OPERATION_COUNT ) +#define CONFIGURE_MAXIMUM_SEMAPHORES 1 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE diff --git a/testsuites/tmtests/tm04/task1.c b/testsuites/tmtests/tm04/task1.c index 705fc4994b..7325e2112a 100644 --- a/testsuites/tmtests/tm04/task1.c +++ b/testsuites/tmtests/tm04/task1.c @@ -26,7 +26,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#if !defined(OPERATION_COUNT) +#if !defined( OPERATION_COUNT ) #define OPERATION_COUNT 100 #endif @@ -41,32 +41,22 @@ const char rtems_test_name[] = "TIME TEST 4"; -rtems_id Semaphore_id; -rtems_id Task_id[OPERATION_COUNT+1]; -uint32_t task_count; -rtems_id Highest_id; +rtems_id Semaphore_id; +rtems_id Task_id[ OPERATION_COUNT + 1 ]; +uint32_t task_count; +rtems_id Highest_id; -rtems_task Low_tasks( - rtems_task_argument argument -); +rtems_task Low_tasks( rtems_task_argument argument ); -rtems_task High_task( - rtems_task_argument argument -); +rtems_task High_task( rtems_task_argument argument ); -rtems_task Highest_task( - rtems_task_argument argument -); +rtems_task Highest_task( rtems_task_argument argument ); -rtems_task Restart_task( - rtems_task_argument argument -); +rtems_task Restart_task( rtems_task_argument argument ); -void test_init(void); +void test_init( void ); -rtems_task Init( - rtems_task_argument argument -) +rtems_task Init( rtems_task_argument argument ) { (void) argument; @@ -79,15 +69,14 @@ rtems_task Init( rtems_task_exit(); } -void test_init(void) +void test_init( void ) { rtems_status_code status; int index; task_count = OPERATION_COUNT; - for ( index = 1 ; index <= OPERATION_COUNT ; index++ ) { - + for ( index = 1; index <= OPERATION_COUNT; index++ ) { status = rtems_task_create( rtems_build_name( 'T', 'I', 'M', 'E' ), 10, @@ -112,9 +101,7 @@ void test_init(void) directive_failed( status, "rtems_semaphore_create of SM1" ); } -rtems_task Highest_task( - rtems_task_argument argument -) +rtems_task Highest_task( rtems_task_argument argument ) { (void) argument; @@ -122,7 +109,6 @@ rtems_task Highest_task( rtems_status_code status; if ( argument == 1 ) { - end_time = benchmark_timer_read(); put_time( @@ -140,9 +126,8 @@ rtems_task Highest_task( ); directive_failed( status, "rtems_task_set_priority" ); - } else if ( argument == 2 ) { - - end_time = benchmark_timer_read(); + } else if ( argument == 2 ) { + end_time = benchmark_timer_read(); put_time( "rtems_task_restart: ready task -- preempts caller", @@ -153,42 +138,42 @@ rtems_task Highest_task( ); rtems_task_exit(); - } else + } else { (void) rtems_semaphore_obtain( Semaphore_id, RTEMS_DEFAULT_OPTIONS, RTEMS_NO_TIMEOUT ); - + } } -rtems_task High_task( - rtems_task_argument argument -) +rtems_task High_task( rtems_task_argument argument ) { (void) argument; rtems_status_code status; - uint32_t index; + uint32_t index; rtems_name name; rtems_task_priority old_priority; benchmark_timer_initialize(); - (void) rtems_task_restart( Highest_id, 1 ); + (void) rtems_task_restart( Highest_id, 1 ); /* preempted by Higher_task */ benchmark_timer_initialize(); - (void) rtems_task_restart( Highest_id, 2 ); + (void) rtems_task_restart( Highest_id, 2 ); /* preempted by Higher_task */ benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) benchmark_timer_empty_function(); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) benchmark_timer_empty_function(); + } overhead = benchmark_timer_read(); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - rtems_semaphore_release( Semaphore_id ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + rtems_semaphore_release( Semaphore_id ); + } end_time = benchmark_timer_read(); put_time( @@ -201,21 +186,22 @@ rtems_task High_task( name = rtems_build_name( 'T', 'I', 'M', 'E' ); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) { - status = rtems_task_delete( Task_id[index] ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + status = rtems_task_delete( Task_id[ index ] ); directive_failed( status, "rtems_task_delete" ); } benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - rtems_task_create( - name, - 10, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_NO_PREEMPT, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ index ] - ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + rtems_task_create( + name, + 10, + RTEMS_MINIMUM_STACK_SIZE, + RTEMS_NO_PREEMPT, + RTEMS_DEFAULT_ATTRIBUTES, + &Task_id[ index ] + ); + } end_time = benchmark_timer_read(); put_time( @@ -227,8 +213,9 @@ rtems_task High_task( ); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - rtems_task_start( Task_id[ index ], Low_tasks, 0 ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + rtems_task_start( Task_id[ index ], Low_tasks, 0 ); + } end_time = benchmark_timer_read(); @@ -240,12 +227,12 @@ rtems_task High_task( 0 ); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) { + for ( index = 1; index <= OPERATION_COUNT; index++ ) { status = rtems_task_delete( Task_id[ index ] ); directive_failed( status, "rtems_task_delete" ); } - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) { + for ( index = 1; index <= OPERATION_COUNT; index++ ) { status = rtems_task_create( name, RTEMS_MAXIMUM_PRIORITY - 4u, @@ -264,8 +251,9 @@ rtems_task High_task( } benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_task_restart( Task_id[ index ], 0 ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) rtems_task_restart( Task_id[ index ], 0 ); + } end_time = benchmark_timer_read(); put_time( @@ -276,12 +264,14 @@ rtems_task High_task( 0 ); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) + for ( index = 1; index <= OPERATION_COUNT; index++ ) { (void) rtems_task_suspend( Task_id[ index ] ); + } benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_task_delete( Task_id[ index ] ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) rtems_task_delete( Task_id[ index ] ); + } end_time = benchmark_timer_read(); put_time( @@ -292,7 +282,7 @@ rtems_task High_task( 0 ); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) { + for ( index = 1; index <= OPERATION_COUNT; index++ ) { status = rtems_task_create( name, RTEMS_MAXIMUM_PRIORITY - 4u, @@ -308,8 +298,9 @@ rtems_task High_task( } benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_task_restart( Task_id[ index ], 1 ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) rtems_task_restart( Task_id[ index ], 1 ); + } end_time = benchmark_timer_read(); put_time( @@ -320,7 +311,7 @@ rtems_task High_task( 0 ); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) { + for ( index = 1; index <= OPERATION_COUNT; index++ ) { status = rtems_task_set_priority( Task_id[ index ], 5, &old_priority ); directive_failed( status, "rtems_task_set_priority loop" ); } @@ -330,8 +321,9 @@ rtems_task High_task( directive_failed( status, "rtems_task_wake_after" ); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_task_restart( Task_id[ index ], 1 ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) rtems_task_restart( Task_id[ index ], 1 ); + } end_time = benchmark_timer_read(); put_time( @@ -347,8 +339,9 @@ rtems_task High_task( directive_failed( status, "rtems_task_wake_after" ); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_task_delete( Task_id[ index ] ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) rtems_task_delete( Task_id[ index ] ); + } end_time = benchmark_timer_read(); put_time( @@ -363,9 +356,7 @@ rtems_task High_task( rtems_test_exit( 0 ); } -rtems_task Low_tasks( - rtems_task_argument argument -) +rtems_task Low_tasks( rtems_task_argument argument ) { (void) argument; @@ -401,7 +392,6 @@ rtems_task Low_tasks( status = rtems_task_start( Highest_id, Highest_task, 0 ); directive_failed( status, "rtems_task_start HIGH" ); - } (void) rtems_semaphore_obtain( Semaphore_id, @@ -409,19 +399,18 @@ rtems_task Low_tasks( RTEMS_NO_TIMEOUT ); - rtems_task_mode(RTEMS_PREEMPT, RTEMS_PREEMPT_MASK, &prev); + rtems_task_mode( RTEMS_PREEMPT, RTEMS_PREEMPT_MASK, &prev ); } -rtems_task Restart_task( - rtems_task_argument argument -) +rtems_task Restart_task( rtems_task_argument argument ) { (void) argument; - if ( argument == 1 ) + if ( argument == 1 ) { (void) rtems_semaphore_obtain( Semaphore_id, RTEMS_DEFAULT_OPTIONS, RTEMS_NO_TIMEOUT ); + } } diff --git a/testsuites/tmtests/tm05/system.h b/testsuites/tmtests/tm05/system.h index 28263f3051..58c1df667e 100644 --- a/testsuites/tmtests/tm05/system.h +++ b/testsuites/tmtests/tm05/system.h @@ -29,14 +29,11 @@ * POSSIBILITY OF SUCH DAMAGE. */ - #include /* functions */ -rtems_task Init( - rtems_task_argument argument -); +rtems_task Init( rtems_task_argument argument ); #include @@ -45,7 +42,7 @@ rtems_task Init( #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER -#define CONFIGURE_MAXIMUM_TASKS (2 + OPERATION_COUNT) +#define CONFIGURE_MAXIMUM_TASKS ( 2 + OPERATION_COUNT ) #define CONFIGURE_RTEMS_INIT_TASKS_TABLE diff --git a/testsuites/tmtests/tm05/task1.c b/testsuites/tmtests/tm05/task1.c index 1ab1aff277..1f3c755bd7 100644 --- a/testsuites/tmtests/tm05/task1.c +++ b/testsuites/tmtests/tm05/task1.c @@ -37,28 +37,20 @@ const char rtems_test_name[] = "TIME TEST 5"; -rtems_id Task_id[OPERATION_COUNT+1]; -uint32_t Task_index; +rtems_id Task_id[ OPERATION_COUNT + 1 ]; +uint32_t Task_index; -rtems_task High_task( - rtems_task_argument argument -); +rtems_task High_task( rtems_task_argument argument ); -rtems_task Middle_tasks( - rtems_task_argument argument -); +rtems_task Middle_tasks( rtems_task_argument argument ); -rtems_task Low_task( - rtems_task_argument argument -); +rtems_task Low_task( rtems_task_argument argument ); -extern void test_init(void); +extern void test_init( void ); uint32_t operation_count = OPERATION_COUNT; -rtems_task Init( - rtems_task_argument argument -) +rtems_task Init( rtems_task_argument argument ) { (void) argument; @@ -71,7 +63,7 @@ rtems_task Init( rtems_task_exit(); } -void test_init(void) +void test_init( void ) { rtems_status_code status; rtems_task_entry task_entry; @@ -80,11 +72,11 @@ void test_init(void) priority = RTEMS_MAXIMUM_PRIORITY - 1; - if ( OPERATION_COUNT > RTEMS_MAXIMUM_PRIORITY - 2 ) - operation_count = RTEMS_MAXIMUM_PRIORITY - 2; - - for( index = 0; index <= operation_count ; index++ ) { + if ( OPERATION_COUNT > RTEMS_MAXIMUM_PRIORITY - 2 ) { + operation_count = RTEMS_MAXIMUM_PRIORITY - 2; + } + for ( index = 0; index <= operation_count; index++ ) { status = rtems_task_create( rtems_build_name( 'T', 'I', 'M', 'E' ), priority, @@ -97,18 +89,20 @@ void test_init(void) priority--; - if ( index==0 ) task_entry = Low_task; - else if ( index==operation_count ) task_entry = High_task; - else task_entry = Middle_tasks; + if ( index == 0 ) { + task_entry = Low_task; + } else if ( index == operation_count ) { + task_entry = High_task; + } else { + task_entry = Middle_tasks; + } status = rtems_task_start( Task_id[ index ], task_entry, 0 ); directive_failed( status, "rtems_task_start loop" ); } } -rtems_task High_task( - rtems_task_argument argument -) +rtems_task High_task( rtems_task_argument argument ) { (void) argument; @@ -130,9 +124,7 @@ rtems_task High_task( rtems_test_exit( 0 ); } -rtems_task Middle_tasks( - rtems_task_argument argument -) +rtems_task Middle_tasks( rtems_task_argument argument ) { (void) argument; @@ -142,9 +134,7 @@ rtems_task Middle_tasks( (void) rtems_task_resume( Task_id[ Task_index ] ); } -rtems_task Low_task( - rtems_task_argument argument -) +rtems_task Low_task( rtems_task_argument argument ) { (void) argument; diff --git a/testsuites/tmtests/tm06/system.h b/testsuites/tmtests/tm06/system.h index 28263f3051..58c1df667e 100644 --- a/testsuites/tmtests/tm06/system.h +++ b/testsuites/tmtests/tm06/system.h @@ -29,14 +29,11 @@ * POSSIBILITY OF SUCH DAMAGE. */ - #include /* functions */ -rtems_task Init( - rtems_task_argument argument -); +rtems_task Init( rtems_task_argument argument ); #include @@ -45,7 +42,7 @@ rtems_task Init( #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER -#define CONFIGURE_MAXIMUM_TASKS (2 + OPERATION_COUNT) +#define CONFIGURE_MAXIMUM_TASKS ( 2 + OPERATION_COUNT ) #define CONFIGURE_RTEMS_INIT_TASKS_TABLE diff --git a/testsuites/tmtests/tm06/task1.c b/testsuites/tmtests/tm06/task1.c index de0a3aab67..70a416ad2a 100644 --- a/testsuites/tmtests/tm06/task1.c +++ b/testsuites/tmtests/tm06/task1.c @@ -26,7 +26,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#if !defined(OPERATION_COUNT) +#if !defined( OPERATION_COUNT ) #define OPERATION_COUNT 100 #endif @@ -43,21 +43,15 @@ const char rtems_test_name[] = "TIME TEST 6"; rtems_id Task_id[ OPERATION_COUNT + 1 ]; -uint32_t Task_restarted; +uint32_t Task_restarted; -rtems_task null_task( - rtems_task_argument argument -); +rtems_task null_task( rtems_task_argument argument ); -rtems_task Task_1( - rtems_task_argument argument -); +rtems_task Task_1( rtems_task_argument argument ); void test_init( void ); -rtems_task Init( - rtems_task_argument argument -) +rtems_task Init( rtems_task_argument argument ) { (void) argument; @@ -79,7 +73,7 @@ void test_init( void ) status = rtems_task_create( rtems_build_name( 'T', 'I', 'M', 'E' ), - (RTEMS_MAXIMUM_PRIORITY / 2u) + 1u, + ( RTEMS_MAXIMUM_PRIORITY / 2u ) + 1u, RTEMS_MINIMUM_STACK_SIZE, RTEMS_DEFAULT_MODES, RTEMS_DEFAULT_ATTRIBUTES, @@ -91,28 +85,29 @@ void test_init( void ) directive_failed( status, "rtems_task_start" ); } -rtems_task Task_1( - rtems_task_argument argument -) +rtems_task Task_1( rtems_task_argument argument ) { (void) argument; rtems_status_code status; - uint32_t index; + uint32_t index; - if ( Task_restarted == OPERATION_COUNT ) - benchmark_timer_initialize(); + if ( Task_restarted == OPERATION_COUNT ) { + benchmark_timer_initialize(); + } Task_restarted--; - if ( Task_restarted != 0 ) + if ( Task_restarted != 0 ) { (void) rtems_task_restart( RTEMS_SELF, 0 ); + } end_time = benchmark_timer_read(); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) benchmark_timer_empty_function(); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) benchmark_timer_empty_function(); + } overhead = benchmark_timer_read(); put_time( @@ -123,7 +118,7 @@ rtems_task Task_1( 0 ); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) { + for ( index = 1; index <= OPERATION_COUNT; index++ ) { status = rtems_task_create( rtems_build_name( 'T', 'I', 'M', 'E' ), RTEMS_MAXIMUM_PRIORITY - 1u, @@ -139,8 +134,9 @@ rtems_task Task_1( } benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_task_suspend( Task_id[ index ] ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) rtems_task_suspend( Task_id[ index ] ); + } end_time = benchmark_timer_read(); put_time( @@ -152,8 +148,9 @@ rtems_task Task_1( ); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_task_resume( Task_id[ index ] ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) rtems_task_resume( Task_id[ index ] ); + } end_time = benchmark_timer_read(); put_time( @@ -165,28 +162,20 @@ rtems_task Task_1( ); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_task_delete( Task_id[ index ] ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) rtems_task_delete( Task_id[ index ] ); + } end_time = benchmark_timer_read(); - put_time( - "rtems_task_delete: ready task", - end_time, - OPERATION_COUNT, - 0, - 0 - ); + put_time( "rtems_task_delete: ready task", end_time, OPERATION_COUNT, 0, 0 ); TEST_END(); rtems_test_exit( 0 ); } -rtems_task null_task( - rtems_task_argument argument -) +rtems_task null_task( rtems_task_argument argument ) { (void) argument; - while ( FOREVER ) - ; + while ( FOREVER ); } diff --git a/testsuites/tmtests/tm07/system.h b/testsuites/tmtests/tm07/system.h index 28263f3051..58c1df667e 100644 --- a/testsuites/tmtests/tm07/system.h +++ b/testsuites/tmtests/tm07/system.h @@ -29,14 +29,11 @@ * POSSIBILITY OF SUCH DAMAGE. */ - #include /* functions */ -rtems_task Init( - rtems_task_argument argument -); +rtems_task Init( rtems_task_argument argument ); #include @@ -45,7 +42,7 @@ rtems_task Init( #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER -#define CONFIGURE_MAXIMUM_TASKS (2 + OPERATION_COUNT) +#define CONFIGURE_MAXIMUM_TASKS ( 2 + OPERATION_COUNT ) #define CONFIGURE_RTEMS_INIT_TASKS_TABLE diff --git a/testsuites/tmtests/tm07/task1.c b/testsuites/tmtests/tm07/task1.c index 8a83cd417f..cc11c55d9a 100644 --- a/testsuites/tmtests/tm07/task1.c +++ b/testsuites/tmtests/tm07/task1.c @@ -26,7 +26,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#if !defined(OPERATION_COUNT) +#if !defined( OPERATION_COUNT ) #define OPERATION_COUNT 100 #endif @@ -41,27 +41,19 @@ const char rtems_test_name[] = "TIME TEST 7"; -rtems_id Task_id[ OPERATION_COUNT+1 ], task_index; +rtems_id Task_id[ OPERATION_COUNT + 1 ], task_index; -rtems_task High_task( - rtems_task_argument argument -); +rtems_task High_task( rtems_task_argument argument ); -rtems_task Middle_tasks( - rtems_task_argument argument -); +rtems_task Middle_tasks( rtems_task_argument argument ); -rtems_task Low_task( - rtems_task_argument argument -); +rtems_task Low_task( rtems_task_argument argument ); -void test_init(void); +void test_init( void ); int operation_count = OPERATION_COUNT; -rtems_task Init( - rtems_task_argument argument -) +rtems_task Init( rtems_task_argument argument ) { (void) argument; @@ -74,7 +66,7 @@ rtems_task Init( rtems_task_exit(); } -void test_init(void) +void test_init( void ) { rtems_status_code status; rtems_task_priority priority; @@ -83,33 +75,36 @@ void test_init(void) priority = RTEMS_MAXIMUM_PRIORITY - 1u; - if ( OPERATION_COUNT > RTEMS_MAXIMUM_PRIORITY - 2u ) - operation_count = (int) (RTEMS_MAXIMUM_PRIORITY - 2u); + if ( OPERATION_COUNT > RTEMS_MAXIMUM_PRIORITY - 2u ) { + operation_count = (int) ( RTEMS_MAXIMUM_PRIORITY - 2u ); + } - for( index=0 ; index <= operation_count ; index++ ) { + for ( index = 0; index <= operation_count; index++ ) { status = rtems_task_create( rtems_build_name( 'T', 'I', 'M', 'E' ), priority, RTEMS_MINIMUM_STACK_SIZE, RTEMS_DEFAULT_MODES, RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[index] + &Task_id[ index ] ); directive_failed( status, "rtems_task_create" ); priority--; - if ( index == 0 ) task_entry = Low_task; - else if ( index == operation_count ) task_entry = High_task; - else task_entry = Middle_tasks; + if ( index == 0 ) { + task_entry = Low_task; + } else if ( index == operation_count ) { + task_entry = High_task; + } else { + task_entry = Middle_tasks; + } - status = rtems_task_start( Task_id[index], task_entry, 0 ); + status = rtems_task_start( Task_id[ index ], task_entry, 0 ); directive_failed( status, "rtems_task_start" ); } } -rtems_task High_task( - rtems_task_argument argument -) +rtems_task High_task( rtems_task_argument argument ) { (void) argument; @@ -123,30 +118,28 @@ rtems_task High_task( 0, 0 ); - } else + } else { (void) rtems_task_suspend( RTEMS_SELF ); + } TEST_END(); rtems_test_exit( 0 ); } -rtems_task Middle_tasks( - rtems_task_argument argument -) +rtems_task Middle_tasks( rtems_task_argument argument ) { (void) argument; task_index++; - if ( argument != 0 ) + if ( argument != 0 ) { (void) rtems_task_restart( Task_id[ task_index ], 0xffffffff ); - else + } else { (void) rtems_task_suspend( RTEMS_SELF ); + } } -rtems_task Low_task( - rtems_task_argument argument -) +rtems_task Low_task( rtems_task_argument argument ) { (void) argument; diff --git a/testsuites/tmtests/tm08/system.h b/testsuites/tmtests/tm08/system.h index 7d642bd0a8..f8b0cf2346 100644 --- a/testsuites/tmtests/tm08/system.h +++ b/testsuites/tmtests/tm08/system.h @@ -29,14 +29,11 @@ * POSSIBILITY OF SUCH DAMAGE. */ - #include /* functions */ -rtems_task Init( - rtems_task_argument argument -); +rtems_task Init( rtems_task_argument argument ); #include @@ -45,7 +42,7 @@ rtems_task Init( #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER -#define CONFIGURE_MAXIMUM_TASKS 3 +#define CONFIGURE_MAXIMUM_TASKS 3 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE diff --git a/testsuites/tmtests/tm08/task1.c b/testsuites/tmtests/tm08/task1.c index 5c160e8c0e..bea2d4422f 100644 --- a/testsuites/tmtests/tm08/task1.c +++ b/testsuites/tmtests/tm08/task1.c @@ -26,7 +26,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#if !defined(OPERATION_COUNT) +#if !defined( OPERATION_COUNT ) #define OPERATION_COUNT 100 #endif @@ -43,17 +43,11 @@ const char rtems_test_name[] = "TIME TEST 8"; rtems_id Test_task_id; -rtems_task test_task( - rtems_task_argument argument -); -rtems_task test_task1( - rtems_task_argument argument -); -void test_init(void); +rtems_task test_task( rtems_task_argument argument ); +rtems_task test_task1( rtems_task_argument argument ); +void test_init( void ); -rtems_task Init( - rtems_task_argument argument -) +rtems_task Init( rtems_task_argument argument ) { (void) argument; @@ -66,13 +60,13 @@ rtems_task Init( rtems_task_exit(); } -void test_init(void) +void test_init( void ) { rtems_status_code status; status = rtems_task_create( 1, - (RTEMS_MAXIMUM_PRIORITY / 2u) + 1u, + ( RTEMS_MAXIMUM_PRIORITY / 2u ) + 1u, RTEMS_MINIMUM_STACK_SIZE, RTEMS_DEFAULT_MODES, RTEMS_DEFAULT_ATTRIBUTES, @@ -97,9 +91,7 @@ void test_init(void) directive_failed( status, "rtems_task_start" ); } -rtems_task test_task( - rtems_task_argument argument -) +rtems_task test_task( rtems_task_argument argument ) { (void) argument; @@ -111,17 +103,19 @@ rtems_task test_task( rtems_mode desired_mode; benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) benchmark_timer_empty_function(); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) benchmark_timer_empty_function(); + } overhead = benchmark_timer_read(); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_task_set_priority( - Test_task_id, - RTEMS_CURRENT_PRIORITY, - &old_priority - ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) rtems_task_set_priority( + Test_task_id, + RTEMS_CURRENT_PRIORITY, + &old_priority + ); + } end_time = benchmark_timer_read(); put_time( @@ -133,12 +127,13 @@ rtems_task test_task( ); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_task_set_priority( - Test_task_id, - RTEMS_MAXIMUM_PRIORITY - 2u, - &old_priority - ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) rtems_task_set_priority( + Test_task_id, + RTEMS_MAXIMUM_PRIORITY - 2u, + &old_priority + ); + } end_time = benchmark_timer_read(); @@ -151,12 +146,10 @@ rtems_task test_task( ); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_task_mode( - RTEMS_CURRENT_MODE, - RTEMS_CURRENT_MODE, - &old_mode - ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) + rtems_task_mode( RTEMS_CURRENT_MODE, RTEMS_CURRENT_MODE, &old_mode ); + } end_time = benchmark_timer_read(); put_time( @@ -170,18 +163,10 @@ rtems_task test_task( desired_mode = old_mode; benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) { - (void) rtems_task_mode( - RTEMS_TIMESLICE_MASK, - desired_mode, - &old_mode - ); - (void) rtems_task_mode( - RTEMS_TIMESLICE_MASK, - desired_mode, - &old_mode - ); - } + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) rtems_task_mode( RTEMS_TIMESLICE_MASK, desired_mode, &old_mode ); + (void) rtems_task_mode( RTEMS_TIMESLICE_MASK, desired_mode, &old_mode ); + } end_time = benchmark_timer_read(); put_time( @@ -192,8 +177,8 @@ rtems_task test_task( 0 ); - benchmark_timer_initialize(); /* must be one host */ - (void) rtems_task_mode( RTEMS_NO_ASR, RTEMS_ASR_MASK, &old_mode ); + benchmark_timer_initialize(); /* must be one host */ + (void) rtems_task_mode( RTEMS_NO_ASR, RTEMS_ASR_MASK, &old_mode ); end_time = benchmark_timer_read(); put_time( @@ -212,13 +197,14 @@ rtems_task test_task( /* preempted by test_task1 */ benchmark_timer_initialize(); - (void) rtems_task_mode( RTEMS_PREEMPT, RTEMS_PREEMPT_MASK, &old_mode ); + (void) rtems_task_mode( RTEMS_PREEMPT, RTEMS_PREEMPT_MASK, &old_mode ); build_time( &time, 1, 1, 1988, 0, 0, 0, 0 ); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_clock_set( &time ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) rtems_clock_set( &time ); + } end_time = benchmark_timer_read(); put_time( @@ -230,8 +216,9 @@ rtems_task test_task( ); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_clock_get_tod( &time ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) rtems_clock_get_tod( &time ); + } end_time = benchmark_timer_read(); put_time( @@ -246,9 +233,7 @@ rtems_task test_task( rtems_test_exit( 0 ); } -rtems_task test_task1( - rtems_task_argument argument -) +rtems_task test_task1( rtems_task_argument argument ) { (void) argument; diff --git a/testsuites/tmtests/tm09/system.h b/testsuites/tmtests/tm09/system.h index da2da0b2ec..a7943ed961 100644 --- a/testsuites/tmtests/tm09/system.h +++ b/testsuites/tmtests/tm09/system.h @@ -29,34 +29,31 @@ * POSSIBILITY OF SUCH DAMAGE. */ - #include /* functions */ -#define MESSAGE_SIZE (sizeof(long) * 4) +#define MESSAGE_SIZE ( sizeof( long ) * 4 ) -rtems_task Init( - rtems_task_argument argument -); +rtems_task Init( rtems_task_argument argument ); #include -rtems_id Task_id[ OPERATION_COUNT+1 ]; /* array of task ids */ +rtems_id Task_id[ OPERATION_COUNT + 1 ]; /* array of task ids */ /* configuration information */ #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER -#define CONFIGURE_MAXIMUM_TASKS 2 -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 +#define CONFIGURE_MAXIMUM_TASKS 2 +#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 #define CONFIGURE_MESSAGE_BUFFER_MEMORY \ - CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(OPERATION_COUNT, MESSAGE_SIZE) + CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE( OPERATION_COUNT, MESSAGE_SIZE ) #define CONFIGURE_RTEMS_INIT_TASKS_TABLE -#define CONFIGURE_EXTRA_TASK_STACKS (1 * RTEMS_MINIMUM_STACK_SIZE) +#define CONFIGURE_EXTRA_TASK_STACKS ( 1 * RTEMS_MINIMUM_STACK_SIZE ) #include diff --git a/testsuites/tmtests/tm09/task1.c b/testsuites/tmtests/tm09/task1.c index 8802ac9857..9f8b6f4983 100644 --- a/testsuites/tmtests/tm09/task1.c +++ b/testsuites/tmtests/tm09/task1.c @@ -26,7 +26,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#if !defined(OPERATION_COUNT) +#if !defined( OPERATION_COUNT ) #define OPERATION_COUNT 100 #endif @@ -43,14 +43,10 @@ const char rtems_test_name[] = "TIME TEST 9"; rtems_id Queue_id; -rtems_task Test_task( - rtems_task_argument argument -); -void queue_test(void); +rtems_task Test_task( rtems_task_argument argument ); +void queue_test( void ); -rtems_task Init( - rtems_task_argument argument -) +rtems_task Init( rtems_task_argument argument ) { (void) argument; @@ -62,7 +58,7 @@ rtems_task Init( status = rtems_task_create( 1, - (RTEMS_MAXIMUM_PRIORITY / 2u) + 1u, + ( RTEMS_MAXIMUM_PRIORITY / 2u ) + 1u, RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_DEFAULT_MODES, RTEMS_DEFAULT_ATTRIBUTES, @@ -76,140 +72,132 @@ rtems_task Init( rtems_task_exit(); } -rtems_task Test_task ( - rtems_task_argument argument -) +rtems_task Test_task( rtems_task_argument argument ) { (void) argument; benchmark_timer_initialize(); - rtems_message_queue_create( - 1, - OPERATION_COUNT, - MESSAGE_SIZE, - RTEMS_DEFAULT_ATTRIBUTES, - &Queue_id - ); + rtems_message_queue_create( + 1, + OPERATION_COUNT, + MESSAGE_SIZE, + RTEMS_DEFAULT_ATTRIBUTES, + &Queue_id + ); end_time = benchmark_timer_read(); - put_time( - "rtems_message_queue_create: only case", - end_time, - 1, - 0, - 0 - ); + put_time( "rtems_message_queue_create: only case", end_time, 1, 0, 0 ); queue_test(); benchmark_timer_initialize(); - rtems_message_queue_delete( Queue_id ); + rtems_message_queue_delete( Queue_id ); end_time = benchmark_timer_read(); - put_time( - "rtems_message_queue_delete: only case", - end_time, - 1, - 0, - 0 - ); + put_time( "rtems_message_queue_delete: only case", end_time, 1, 0, 0 ); TEST_END(); rtems_test_exit( 0 ); } -void queue_test(void) +void queue_test( void ) { - uint32_t send_loop_time; - uint32_t urgent_loop_time; - uint32_t receive_loop_time; - uint32_t send_time; - uint32_t urgent_time; - uint32_t receive_time; - uint32_t empty_flush_time; - uint32_t flush_time; - uint32_t empty_flush_count; - uint32_t flush_count; - uint32_t index; - uint32_t iterations; - long buffer[4]; + uint32_t send_loop_time; + uint32_t urgent_loop_time; + uint32_t receive_loop_time; + uint32_t send_time; + uint32_t urgent_time; + uint32_t receive_time; + uint32_t empty_flush_time; + uint32_t flush_time; + uint32_t empty_flush_count; + uint32_t flush_count; + uint32_t index; + uint32_t iterations; + long buffer[ 4 ]; rtems_status_code status; - size_t size; + size_t size; - send_loop_time = 0; - urgent_loop_time = 0; + send_loop_time = 0; + urgent_loop_time = 0; receive_loop_time = 0; - send_time = 0; - urgent_time = 0; - receive_time = 0; - empty_flush_time = 0; - flush_time = 0; - flush_count = 0; + send_time = 0; + urgent_time = 0; + receive_time = 0; + empty_flush_time = 0; + flush_time = 0; + flush_count = 0; empty_flush_count = 0; - for ( iterations = 1 ; iterations <= OPERATION_COUNT ; iterations++ ) { - + for ( iterations = 1; iterations <= OPERATION_COUNT; iterations++ ) { benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) benchmark_timer_empty_function(); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) benchmark_timer_empty_function(); + } send_loop_time += benchmark_timer_read(); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) benchmark_timer_empty_function(); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) benchmark_timer_empty_function(); + } urgent_loop_time += benchmark_timer_read(); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) benchmark_timer_empty_function(); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) benchmark_timer_empty_function(); + } receive_loop_time += benchmark_timer_read(); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_message_queue_send( Queue_id, buffer, MESSAGE_SIZE ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) rtems_message_queue_send( Queue_id, buffer, MESSAGE_SIZE ); + } send_time += benchmark_timer_read(); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_message_queue_receive( - Queue_id, - (long (*)[4])buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) rtems_message_queue_receive( + Queue_id, + (long ( * )[ 4 ]) buffer, + &size, + RTEMS_DEFAULT_OPTIONS, + RTEMS_NO_TIMEOUT + ); + } receive_time += benchmark_timer_read(); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_message_queue_urgent( Queue_id, buffer, MESSAGE_SIZE ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) rtems_message_queue_urgent( Queue_id, buffer, MESSAGE_SIZE ); + } urgent_time += benchmark_timer_read(); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_message_queue_receive( - Queue_id, - (long (*)[4])buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) rtems_message_queue_receive( + Queue_id, + (long ( * )[ 4 ]) buffer, + &size, + RTEMS_DEFAULT_OPTIONS, + RTEMS_NO_TIMEOUT + ); + } receive_time += benchmark_timer_read(); benchmark_timer_initialize(); - rtems_message_queue_flush( Queue_id, &empty_flush_count ); + rtems_message_queue_flush( Queue_id, &empty_flush_count ); empty_flush_time += benchmark_timer_read(); /* send one message to flush */ status = rtems_message_queue_send( - Queue_id, - (long (*)[4])buffer, - MESSAGE_SIZE + Queue_id, + (long ( * )[ 4 ]) buffer, + MESSAGE_SIZE ); directive_failed( status, "rtems_message_queue_send" ); benchmark_timer_initialize(); - rtems_message_queue_flush( Queue_id, &flush_count ); + rtems_message_queue_flush( Queue_id, &flush_count ); flush_time += benchmark_timer_read(); } @@ -252,5 +240,4 @@ void queue_test(void) 0, 0 ); - } diff --git a/testsuites/tmtests/tm10/system.h b/testsuites/tmtests/tm10/system.h index e4c296f625..95ec512d35 100644 --- a/testsuites/tmtests/tm10/system.h +++ b/testsuites/tmtests/tm10/system.h @@ -29,14 +29,11 @@ * POSSIBILITY OF SUCH DAMAGE. */ - #include /* functions */ -rtems_task Init( - rtems_task_argument argument -); +rtems_task Init( rtems_task_argument argument ); #include @@ -45,10 +42,10 @@ rtems_task Init( #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER -#define CONFIGURE_MAXIMUM_TASKS (2 + OPERATION_COUNT) -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 +#define CONFIGURE_MAXIMUM_TASKS ( 2 + OPERATION_COUNT ) +#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 #define CONFIGURE_MESSAGE_BUFFER_MEMORY \ - CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(OPERATION_COUNT, 16) + CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE( OPERATION_COUNT, 16 ) #define CONFIGURE_RTEMS_INIT_TASKS_TABLE diff --git a/testsuites/tmtests/tm10/task1.c b/testsuites/tmtests/tm10/task1.c index cb61d112eb..3c6ed2239b 100644 --- a/testsuites/tmtests/tm10/task1.c +++ b/testsuites/tmtests/tm10/task1.c @@ -26,7 +26,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#if !defined(OPERATION_COUNT) +#if !defined( OPERATION_COUNT ) #define OPERATION_COUNT 100 #endif @@ -42,27 +42,19 @@ const char rtems_test_name[] = "TIME TEST 10"; rtems_id Queue_id; -long Buffer[4]; +long Buffer[ 4 ]; -rtems_task High_task( - rtems_task_argument argument -); +rtems_task High_task( rtems_task_argument argument ); -rtems_task Middle_tasks( - rtems_task_argument argument -); +rtems_task Middle_tasks( rtems_task_argument argument ); -rtems_task Low_task( - rtems_task_argument argument -); +rtems_task Low_task( rtems_task_argument argument ); -void test_init(void); +void test_init( void ); int operation_count = OPERATION_COUNT; -rtems_task Init( - rtems_task_argument argument -) +rtems_task Init( rtems_task_argument argument ) { (void) argument; @@ -86,10 +78,11 @@ void test_init() priority = 2; - if ( OPERATION_COUNT > RTEMS_MAXIMUM_PRIORITY - 2 ) - operation_count = RTEMS_MAXIMUM_PRIORITY - 2; + if ( OPERATION_COUNT > RTEMS_MAXIMUM_PRIORITY - 2 ) { + operation_count = RTEMS_MAXIMUM_PRIORITY - 2; + } - for( index = 0; index < operation_count ; index++ ) { + for ( index = 0; index < operation_count; index++ ) { status = rtems_task_create( rtems_build_name( 'T', 'I', 'M', 'E' ), priority, @@ -102,9 +95,13 @@ void test_init() priority++; - if ( index==0 ) task_entry = High_task; - else if ( index==operation_count-1 ) task_entry = Low_task; - else task_entry = Middle_tasks; + if ( index == 0 ) { + task_entry = High_task; + } else if ( index == operation_count - 1 ) { + task_entry = Low_task; + } else { + task_entry = Middle_tasks; + } status = rtems_task_start( task_id, task_entry, 0 ); directive_failed( status, "rtems_task_start LOOP" ); @@ -112,7 +109,7 @@ void test_init() status = rtems_message_queue_create( 1, - (uint32_t)operation_count, + (uint32_t) operation_count, 16, RTEMS_DEFAULT_ATTRIBUTES, &Queue_id @@ -120,19 +117,21 @@ void test_init() directive_failed( status, "rtems_message_queue_create" ); benchmark_timer_initialize(); - for ( index=1 ; index < operation_count ; index++ ) - (void) benchmark_timer_empty_function(); + for ( index = 1; index < operation_count; index++ ) { + (void) benchmark_timer_empty_function(); + } overhead = benchmark_timer_read(); benchmark_timer_initialize(); - for ( index=1 ; index < operation_count ; index++ ) - (void) rtems_message_queue_receive( - Queue_id, - (long (*)[4]) Buffer, - &size, - RTEMS_NO_WAIT, - RTEMS_NO_TIMEOUT - ); + for ( index = 1; index < operation_count; index++ ) { + (void) rtems_message_queue_receive( + Queue_id, + (long ( * )[ 4 ]) Buffer, + &size, + RTEMS_NO_WAIT, + RTEMS_NO_TIMEOUT + ); + } end_time = benchmark_timer_read(); put_time( @@ -142,48 +141,40 @@ void test_init() overhead, 0 ); - } -rtems_task High_task( - rtems_task_argument argument -) +rtems_task High_task( rtems_task_argument argument ) { (void) argument; - size_t size; + size_t size; benchmark_timer_initialize(); - (void) rtems_message_queue_receive( - Queue_id, - (long (*)[4]) Buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); + (void) rtems_message_queue_receive( + Queue_id, + (long ( * )[ 4 ]) Buffer, + &size, + RTEMS_DEFAULT_OPTIONS, + RTEMS_NO_TIMEOUT + ); } -rtems_task Middle_tasks( - rtems_task_argument argument -) +rtems_task Middle_tasks( rtems_task_argument argument ) { (void) argument; - size_t size; + size_t size; (void) rtems_message_queue_receive( - Queue_id, - (long (*)[4]) Buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); + Queue_id, + (long ( * )[ 4 ]) Buffer, + &size, + RTEMS_DEFAULT_OPTIONS, + RTEMS_NO_TIMEOUT + ); } - -rtems_task Low_task( - rtems_task_argument argument -) +rtems_task Low_task( rtems_task_argument argument ) { (void) argument; diff --git a/testsuites/tmtests/tm11/system.h b/testsuites/tmtests/tm11/system.h index 9a2fc14aab..91bbe1a65a 100644 --- a/testsuites/tmtests/tm11/system.h +++ b/testsuites/tmtests/tm11/system.h @@ -29,14 +29,11 @@ * POSSIBILITY OF SUCH DAMAGE. */ - #include /* functions */ -rtems_task Init( - rtems_task_argument argument -); +rtems_task Init( rtems_task_argument argument ); #include @@ -45,8 +42,8 @@ rtems_task Init( #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER -#define CONFIGURE_MAXIMUM_TASKS (3 + OPERATION_COUNT) -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 +#define CONFIGURE_MAXIMUM_TASKS ( 3 + OPERATION_COUNT ) +#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE diff --git a/testsuites/tmtests/tm11/task1.c b/testsuites/tmtests/tm11/task1.c index 500bde139c..58cb627349 100644 --- a/testsuites/tmtests/tm11/task1.c +++ b/testsuites/tmtests/tm11/task1.c @@ -26,7 +26,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#if !defined(OPERATION_COUNT) +#if !defined( OPERATION_COUNT ) #define OPERATION_COUNT 100 #endif @@ -43,30 +43,22 @@ const char rtems_test_name[] = "TIME TEST 11"; rtems_id Queue_id; -long Buffer[4]; +long Buffer[ 4 ]; -rtems_task test_init( - rtems_task_argument argument -); +rtems_task test_init( rtems_task_argument argument ); -rtems_task Middle_tasks( - rtems_task_argument argument -); +rtems_task Middle_tasks( rtems_task_argument argument ); -rtems_task High_task( - rtems_task_argument argument -); +rtems_task High_task( rtems_task_argument argument ); int operation_count = OPERATION_COUNT; -void Init( - rtems_task_argument argument -) +void Init( rtems_task_argument argument ) { (void) argument; rtems_status_code status; - rtems_id id; + rtems_id id; Print_Warning(); @@ -88,11 +80,9 @@ void Init( rtems_task_exit(); } -#define MESSAGE_SIZE (sizeof(long) * 4) +#define MESSAGE_SIZE ( sizeof( long ) * 4 ) -rtems_task test_init( - rtems_task_argument argument -) +rtems_task test_init( rtems_task_argument argument ) { (void) argument; @@ -102,13 +92,13 @@ rtems_task test_init( rtems_id task_id; rtems_status_code status; -/* As each task is started, it preempts this task and + /* As each task is started, it preempts this task and * performs a blocking rtems_message_queue_receive. Upon completion of * this loop all created tasks are blocked. */ status = rtems_message_queue_create( - rtems_build_name( 'M', 'Q', '1', ' ' ), + rtems_build_name( 'M', 'Q', '1', ' ' ), OPERATION_COUNT, MESSAGE_SIZE, RTEMS_DEFAULT_ATTRIBUTES, @@ -118,11 +108,12 @@ rtems_task test_init( priority = RTEMS_MAXIMUM_PRIORITY - 2u; - if ( OPERATION_COUNT > RTEMS_MAXIMUM_PRIORITY - 2u ) - operation_count = RTEMS_MAXIMUM_PRIORITY - 2u; - for( index = 0; index < operation_count ; index++ ) { + if ( OPERATION_COUNT > RTEMS_MAXIMUM_PRIORITY - 2u ) { + operation_count = RTEMS_MAXIMUM_PRIORITY - 2u; + } + for ( index = 0; index < operation_count; index++ ) { status = rtems_task_create( - rtems_build_name( 'T', 'I', 'M', 'E' ), + rtems_build_name( 'T', 'I', 'M', 'E' ), priority, RTEMS_MINIMUM_STACK_SIZE, RTEMS_DEFAULT_MODES, @@ -133,51 +124,50 @@ rtems_task test_init( priority--; - if ( index==operation_count-1 ) task_entry = High_task; - else task_entry = Middle_tasks; + if ( index == operation_count - 1 ) { + task_entry = High_task; + } else { + task_entry = Middle_tasks; + } status = rtems_task_start( task_id, task_entry, 0 ); directive_failed( status, "rtems_task_start LOOP" ); } benchmark_timer_initialize(); - (void) rtems_message_queue_send( Queue_id, Buffer, MESSAGE_SIZE ); + (void) rtems_message_queue_send( Queue_id, Buffer, MESSAGE_SIZE ); } -rtems_task Middle_tasks( - rtems_task_argument argument -) +rtems_task Middle_tasks( rtems_task_argument argument ) { (void) argument; - size_t size; + size_t size; (void) rtems_message_queue_receive( - Queue_id, - (long (*)[4]) Buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); + Queue_id, + (long ( * )[ 4 ]) Buffer, + &size, + RTEMS_DEFAULT_OPTIONS, + RTEMS_NO_TIMEOUT + ); - (void) rtems_message_queue_send( Queue_id, (long (*)[4]) Buffer, size ); + (void) rtems_message_queue_send( Queue_id, (long ( * )[ 4 ]) Buffer, size ); } -rtems_task High_task( - rtems_task_argument argument -) +rtems_task High_task( rtems_task_argument argument ) { (void) argument; - size_t size; + size_t size; (void) rtems_message_queue_receive( - Queue_id, - (long (*)[4]) Buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); + Queue_id, + (long ( * )[ 4 ]) Buffer, + &size, + RTEMS_DEFAULT_OPTIONS, + RTEMS_NO_TIMEOUT + ); end_time = benchmark_timer_read(); diff --git a/testsuites/tmtests/tm12/system.h b/testsuites/tmtests/tm12/system.h index 9a2fc14aab..91bbe1a65a 100644 --- a/testsuites/tmtests/tm12/system.h +++ b/testsuites/tmtests/tm12/system.h @@ -29,14 +29,11 @@ * POSSIBILITY OF SUCH DAMAGE. */ - #include /* functions */ -rtems_task Init( - rtems_task_argument argument -); +rtems_task Init( rtems_task_argument argument ); #include @@ -45,8 +42,8 @@ rtems_task Init( #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER -#define CONFIGURE_MAXIMUM_TASKS (3 + OPERATION_COUNT) -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 +#define CONFIGURE_MAXIMUM_TASKS ( 3 + OPERATION_COUNT ) +#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE diff --git a/testsuites/tmtests/tm12/task1.c b/testsuites/tmtests/tm12/task1.c index 0f5eb44660..c5064448bf 100644 --- a/testsuites/tmtests/tm12/task1.c +++ b/testsuites/tmtests/tm12/task1.c @@ -26,7 +26,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#if !defined(OPERATION_COUNT) +#if !defined( OPERATION_COUNT ) #define OPERATION_COUNT 100 #endif @@ -43,27 +43,19 @@ const char rtems_test_name[] = "TIME TEST 12"; rtems_id Queue_id; -long Buffer[4]; +long Buffer[ 4 ]; -rtems_task test_init( - rtems_task_argument argument -); +rtems_task test_init( rtems_task_argument argument ); -rtems_task High_task( - rtems_task_argument argument -); +rtems_task High_task( rtems_task_argument argument ); -rtems_task Low_tasks( - rtems_task_argument argument -); +rtems_task Low_tasks( rtems_task_argument argument ); -#define MESSAGE_SIZE (sizeof(long) * 4) +#define MESSAGE_SIZE ( sizeof( long ) * 4 ) int operation_count = OPERATION_COUNT; -rtems_task Init( - rtems_task_argument argument -) +rtems_task Init( rtems_task_argument argument ) { (void) argument; @@ -90,18 +82,15 @@ rtems_task Init( rtems_task_exit(); } -rtems_task test_init( - rtems_task_argument argument -) +rtems_task test_init( rtems_task_argument argument ) { (void) argument; - int index; - rtems_task_entry task_entry; - rtems_task_priority priority; - rtems_id task_id; - rtems_status_code status; - + int index; + rtems_task_entry task_entry; + rtems_task_priority priority; + rtems_id task_id; + rtems_status_code status; status = rtems_message_queue_create( rtems_build_name( 'M', 'Q', '1', ' ' ), @@ -114,10 +103,11 @@ rtems_task test_init( priority = RTEMS_MAXIMUM_PRIORITY - 1u; - if ( OPERATION_COUNT > RTEMS_MAXIMUM_PRIORITY - 2 ) - operation_count = RTEMS_MAXIMUM_PRIORITY - 2; + if ( OPERATION_COUNT > RTEMS_MAXIMUM_PRIORITY - 2 ) { + operation_count = RTEMS_MAXIMUM_PRIORITY - 2; + } - for( index = 0; index < operation_count ; index++ ) { + for ( index = 0; index < operation_count; index++ ) { status = rtems_task_create( rtems_build_name( 'T', 'I', 'M', 'E' ), priority, @@ -130,30 +120,33 @@ rtems_task test_init( priority--; - if ( index == operation_count-1 ) task_entry = High_task; - else task_entry = Low_tasks; + if ( index == operation_count - 1 ) { + task_entry = High_task; + } else { + task_entry = Low_tasks; + } status = rtems_task_start( task_id, task_entry, 0 ); directive_failed( status, "rtems_task_start LOOP" ); } } -rtems_task High_task( - rtems_task_argument argument -) +rtems_task High_task( rtems_task_argument argument ) { (void) argument; - int index; + int index; benchmark_timer_initialize(); - for ( index=1 ; index < operation_count ; index++ ) - (void) benchmark_timer_empty_function(); + for ( index = 1; index < operation_count; index++ ) { + (void) benchmark_timer_empty_function(); + } overhead = benchmark_timer_read(); benchmark_timer_initialize(); - for ( index=1 ; index < operation_count ; index++ ) - (void) rtems_message_queue_send( Queue_id, Buffer, MESSAGE_SIZE ); + for ( index = 1; index < operation_count; index++ ) { + (void) rtems_message_queue_send( Queue_id, Buffer, MESSAGE_SIZE ); + } end_time = benchmark_timer_read(); put_time( @@ -168,19 +161,17 @@ rtems_task High_task( rtems_test_exit( 0 ); } -rtems_task Low_tasks( - rtems_task_argument argument -) +rtems_task Low_tasks( rtems_task_argument argument ) { (void) argument; - size_t size; + size_t size; (void) rtems_message_queue_receive( - Queue_id, - (long (*)[4]) Buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); + Queue_id, + (long ( * )[ 4 ]) Buffer, + &size, + RTEMS_DEFAULT_OPTIONS, + RTEMS_NO_TIMEOUT + ); } diff --git a/testsuites/tmtests/tm13/system.h b/testsuites/tmtests/tm13/system.h index 9a2fc14aab..91bbe1a65a 100644 --- a/testsuites/tmtests/tm13/system.h +++ b/testsuites/tmtests/tm13/system.h @@ -29,14 +29,11 @@ * POSSIBILITY OF SUCH DAMAGE. */ - #include /* functions */ -rtems_task Init( - rtems_task_argument argument -); +rtems_task Init( rtems_task_argument argument ); #include @@ -45,8 +42,8 @@ rtems_task Init( #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER -#define CONFIGURE_MAXIMUM_TASKS (3 + OPERATION_COUNT) -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 +#define CONFIGURE_MAXIMUM_TASKS ( 3 + OPERATION_COUNT ) +#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE diff --git a/testsuites/tmtests/tm13/task1.c b/testsuites/tmtests/tm13/task1.c index 123cadfaaa..491931fc72 100644 --- a/testsuites/tmtests/tm13/task1.c +++ b/testsuites/tmtests/tm13/task1.c @@ -26,7 +26,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#if !defined(OPERATION_COUNT) +#if !defined( OPERATION_COUNT ) #define OPERATION_COUNT 100 #endif @@ -43,32 +43,24 @@ const char rtems_test_name[] = "TIME TEST 13"; rtems_id Queue_id; -long Buffer[4]; +long Buffer[ 4 ]; -rtems_task test_init( - rtems_task_argument argument -); +rtems_task test_init( rtems_task_argument argument ); -rtems_task Middle_tasks( - rtems_task_argument argument -); +rtems_task Middle_tasks( rtems_task_argument argument ); -rtems_task High_task( - rtems_task_argument argument -); +rtems_task High_task( rtems_task_argument argument ); -#define MESSAGE_SIZE (sizeof(long) * 4) +#define MESSAGE_SIZE ( sizeof( long ) * 4 ) int operation_count = OPERATION_COUNT; -void Init( - rtems_task_argument argument -) +void Init( rtems_task_argument argument ) { (void) argument; rtems_status_code status; - rtems_id id; + rtems_id id; Print_Warning(); @@ -90,9 +82,7 @@ void Init( rtems_task_exit(); } -rtems_task test_init( - rtems_task_argument argument -) +rtems_task test_init( rtems_task_argument argument ) { (void) argument; @@ -102,13 +92,13 @@ rtems_task test_init( rtems_id task_id; rtems_status_code status; -/* As each task is started, it preempts this task and + /* As each task is started, it preempts this task and * performs a blocking rtems_message_queue_receive. Upon completion of * this loop all created tasks are blocked. */ status = rtems_message_queue_create( - rtems_build_name( 'M', 'Q', '1', ' ' ), + rtems_build_name( 'M', 'Q', '1', ' ' ), OPERATION_COUNT, MESSAGE_SIZE, RTEMS_DEFAULT_ATTRIBUTES, @@ -118,12 +108,13 @@ rtems_task test_init( priority = RTEMS_MAXIMUM_PRIORITY - 2u; - if ( OPERATION_COUNT > RTEMS_MAXIMUM_PRIORITY - 2u ) - operation_count = (int)(RTEMS_MAXIMUM_PRIORITY - 2u); + if ( OPERATION_COUNT > RTEMS_MAXIMUM_PRIORITY - 2u ) { + operation_count = (int) ( RTEMS_MAXIMUM_PRIORITY - 2u ); + } - for( index = 0; index < operation_count ; index++ ) { + for ( index = 0; index < operation_count; index++ ) { status = rtems_task_create( - rtems_build_name( 'T', 'I', 'M', 'E' ), + rtems_build_name( 'T', 'I', 'M', 'E' ), priority, RTEMS_MINIMUM_STACK_SIZE, RTEMS_DEFAULT_MODES, @@ -134,51 +125,51 @@ rtems_task test_init( priority--; - if ( index==operation_count-1 ) task_entry = High_task; - else task_entry = Middle_tasks; + if ( index == operation_count - 1 ) { + task_entry = High_task; + } else { + task_entry = Middle_tasks; + } status = rtems_task_start( task_id, task_entry, 0 ); directive_failed( status, "rtems_task_start LOOP" ); } benchmark_timer_initialize(); - (void) rtems_message_queue_urgent( Queue_id, Buffer, MESSAGE_SIZE ); + (void) rtems_message_queue_urgent( Queue_id, Buffer, MESSAGE_SIZE ); } -rtems_task Middle_tasks( - rtems_task_argument argument -) +rtems_task Middle_tasks( rtems_task_argument argument ) { (void) argument; - size_t size; + size_t size; (void) rtems_message_queue_receive( - Queue_id, - (long (*)[4]) Buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); + Queue_id, + (long ( * )[ 4 ]) Buffer, + &size, + RTEMS_DEFAULT_OPTIONS, + RTEMS_NO_TIMEOUT + ); - (void) rtems_message_queue_urgent( Queue_id, (long (*)[4]) Buffer, size ); + (void) + rtems_message_queue_urgent( Queue_id, (long ( * )[ 4 ]) Buffer, size ); } -rtems_task High_task( - rtems_task_argument argument -) +rtems_task High_task( rtems_task_argument argument ) { (void) argument; - size_t size; + size_t size; (void) rtems_message_queue_receive( - Queue_id, - (long (*)[4]) Buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); + Queue_id, + (long ( * )[ 4 ]) Buffer, + &size, + RTEMS_DEFAULT_OPTIONS, + RTEMS_NO_TIMEOUT + ); end_time = benchmark_timer_read(); diff --git a/testsuites/tmtests/tm14/system.h b/testsuites/tmtests/tm14/system.h index 9a2fc14aab..91bbe1a65a 100644 --- a/testsuites/tmtests/tm14/system.h +++ b/testsuites/tmtests/tm14/system.h @@ -29,14 +29,11 @@ * POSSIBILITY OF SUCH DAMAGE. */ - #include /* functions */ -rtems_task Init( - rtems_task_argument argument -); +rtems_task Init( rtems_task_argument argument ); #include @@ -45,8 +42,8 @@ rtems_task Init( #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER -#define CONFIGURE_MAXIMUM_TASKS (3 + OPERATION_COUNT) -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 +#define CONFIGURE_MAXIMUM_TASKS ( 3 + OPERATION_COUNT ) +#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE diff --git a/testsuites/tmtests/tm14/task1.c b/testsuites/tmtests/tm14/task1.c index 9666af50a0..e030e930d1 100644 --- a/testsuites/tmtests/tm14/task1.c +++ b/testsuites/tmtests/tm14/task1.c @@ -26,7 +26,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#if !defined(OPERATION_COUNT) +#if !defined( OPERATION_COUNT ) #define OPERATION_COUNT 100 #endif @@ -43,27 +43,19 @@ const char rtems_test_name[] = "TIME TEST 14"; rtems_id Queue_id; -long Buffer[4]; +long Buffer[ 4 ]; -rtems_task test_init( - rtems_task_argument argument -); +rtems_task test_init( rtems_task_argument argument ); -rtems_task High_task( - rtems_task_argument argument -); +rtems_task High_task( rtems_task_argument argument ); -rtems_task Low_tasks( - rtems_task_argument argument -); +rtems_task Low_tasks( rtems_task_argument argument ); -#define MESSAGE_SIZE (sizeof(long) * 4) +#define MESSAGE_SIZE ( sizeof( long ) * 4 ) int operation_count = OPERATION_COUNT; -rtems_task Init( - rtems_task_argument argument -) +rtems_task Init( rtems_task_argument argument ) { (void) argument; @@ -90,17 +82,15 @@ rtems_task Init( rtems_task_exit(); } -rtems_task test_init( - rtems_task_argument argument -) +rtems_task test_init( rtems_task_argument argument ) { (void) argument; - int index; - rtems_task_entry task_entry; - rtems_task_priority priority; - rtems_id task_id; - rtems_status_code status; + int index; + rtems_task_entry task_entry; + rtems_task_priority priority; + rtems_id task_id; + rtems_status_code status; status = rtems_message_queue_create( rtems_build_name( 'M', 'Q', '1', ' ' ), @@ -112,10 +102,11 @@ rtems_task test_init( directive_failed( status, "rtems_message_queue_create" ); priority = RTEMS_MAXIMUM_PRIORITY - 2u; - if ( OPERATION_COUNT > RTEMS_MAXIMUM_PRIORITY - 2u ) - operation_count = (int) (RTEMS_MAXIMUM_PRIORITY - 2u); + if ( OPERATION_COUNT > RTEMS_MAXIMUM_PRIORITY - 2u ) { + operation_count = (int) ( RTEMS_MAXIMUM_PRIORITY - 2u ); + } - for( index = 0; index < operation_count ; index++ ) { + for ( index = 0; index < operation_count; index++ ) { status = rtems_task_create( rtems_build_name( 'T', 'I', 'M', 'E' ), priority, @@ -128,30 +119,33 @@ rtems_task test_init( priority--; - if ( index==operation_count-1 ) task_entry = High_task; - else task_entry = Low_tasks; + if ( index == operation_count - 1 ) { + task_entry = High_task; + } else { + task_entry = Low_tasks; + } status = rtems_task_start( task_id, task_entry, 0 ); directive_failed( status, "rtems_task_start LOOP" ); } } -rtems_task High_task( - rtems_task_argument argument -) +rtems_task High_task( rtems_task_argument argument ) { (void) argument; - int index; + int index; benchmark_timer_initialize(); - for ( index=1 ; index < operation_count ; index++ ) - (void) benchmark_timer_empty_function(); + for ( index = 1; index < operation_count; index++ ) { + (void) benchmark_timer_empty_function(); + } overhead = benchmark_timer_read(); benchmark_timer_initialize(); - for ( index=1 ; index <= operation_count ; index++ ) - (void) rtems_message_queue_urgent( Queue_id, Buffer, MESSAGE_SIZE ); + for ( index = 1; index <= operation_count; index++ ) { + (void) rtems_message_queue_urgent( Queue_id, Buffer, MESSAGE_SIZE ); + } end_time = benchmark_timer_read(); put_time( @@ -166,19 +160,17 @@ rtems_task High_task( rtems_test_exit( 0 ); } -rtems_task Low_tasks( - rtems_task_argument argument -) +rtems_task Low_tasks( rtems_task_argument argument ) { (void) argument; - size_t size; + size_t size; (void) rtems_message_queue_receive( - Queue_id, - (long (*)[4]) Buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); + Queue_id, + (long ( * )[ 4 ]) Buffer, + &size, + RTEMS_DEFAULT_OPTIONS, + RTEMS_NO_TIMEOUT + ); } diff --git a/testsuites/tmtests/tm15/system.h b/testsuites/tmtests/tm15/system.h index fffabdf844..f66631e8e6 100644 --- a/testsuites/tmtests/tm15/system.h +++ b/testsuites/tmtests/tm15/system.h @@ -29,25 +29,22 @@ * POSSIBILITY OF SUCH DAMAGE. */ - #include /* functions */ -rtems_task Init( - rtems_task_argument argument -); +rtems_task Init( rtems_task_argument argument ); #include -rtems_id Task_id[ OPERATION_COUNT+1 ]; /* array of task ids */ +rtems_id Task_id[ OPERATION_COUNT + 1 ]; /* array of task ids */ /* configuration information */ #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER -#define CONFIGURE_MAXIMUM_TASKS (2 + OPERATION_COUNT) +#define CONFIGURE_MAXIMUM_TASKS ( 2 + OPERATION_COUNT ) #define CONFIGURE_RTEMS_INIT_TASKS_TABLE diff --git a/testsuites/tmtests/tm15/task1.c b/testsuites/tmtests/tm15/task1.c index acdf70c58f..642fc3ad0c 100644 --- a/testsuites/tmtests/tm15/task1.c +++ b/testsuites/tmtests/tm15/task1.c @@ -26,7 +26,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#if !defined(OPERATION_COUNT) +#if !defined( OPERATION_COUNT ) #define OPERATION_COUNT 100 #endif @@ -44,19 +44,13 @@ const char rtems_test_name[] = "TIME TEST 15"; bool time_set; uint32_t eventout; -rtems_task High_tasks( - rtems_task_argument argument -); +rtems_task High_tasks( rtems_task_argument argument ); -rtems_task Low_task( - rtems_task_argument argument -); +rtems_task Low_task( rtems_task_argument argument ); -void test_init(void); +void test_init( void ); -rtems_task Init( - rtems_task_argument argument -) +rtems_task Init( rtems_task_argument argument ) { (void) argument; @@ -69,10 +63,10 @@ rtems_task Init( rtems_task_exit(); } -void test_init(void) +void test_init( void ) { rtems_id id; - uint32_t index; + uint32_t index; rtems_event_set event_out; rtems_status_code status; @@ -91,7 +85,7 @@ void test_init(void) status = rtems_task_start( id, Low_task, 0 ); directive_failed( status, "rtems_task_start LOW" ); - for ( index = 1 ; index <= OPERATION_COUNT ; index++ ) { + for ( index = 1; index <= OPERATION_COUNT; index++ ) { status = rtems_task_create( rtems_build_name( 'H', 'I', 'G', 'H' ), 5, @@ -107,20 +101,20 @@ void test_init(void) } benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) benchmark_timer_empty_function(); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) benchmark_timer_empty_function(); + } overhead = benchmark_timer_read(); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - { - (void) rtems_event_receive( - RTEMS_PENDING_EVENTS, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &event_out - ); - } + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) rtems_event_receive( + RTEMS_PENDING_EVENTS, + RTEMS_DEFAULT_OPTIONS, + RTEMS_NO_TIMEOUT, + &event_out + ); + } end_time = benchmark_timer_read(); @@ -132,17 +126,15 @@ void test_init(void) 0 ); - benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - { - (void) rtems_event_receive( - RTEMS_ALL_EVENTS, - RTEMS_NO_WAIT, - RTEMS_NO_TIMEOUT, - &event_out - ); - } + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) rtems_event_receive( + RTEMS_ALL_EVENTS, + RTEMS_NO_WAIT, + RTEMS_NO_TIMEOUT, + &event_out + ); + } end_time = benchmark_timer_read(); put_time( @@ -154,14 +146,12 @@ void test_init(void) ); } -rtems_task Low_task( - rtems_task_argument argument -) +rtems_task Low_task( rtems_task_argument argument ) { (void) argument; - uint32_t index; - rtems_event_set event_out; + uint32_t index; + rtems_event_set event_out; end_time = benchmark_timer_read(); @@ -174,13 +164,15 @@ rtems_task Low_task( ); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) benchmark_timer_empty_function(); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) benchmark_timer_empty_function(); + } overhead = benchmark_timer_read(); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_event_send( RTEMS_SELF, RTEMS_EVENT_16 ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) rtems_event_send( RTEMS_SELF, RTEMS_EVENT_16 ); + } end_time = benchmark_timer_read(); put_time( @@ -192,25 +184,20 @@ rtems_task Low_task( ); benchmark_timer_initialize(); - (void) rtems_event_receive( - RTEMS_EVENT_16, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &event_out - ); + (void) rtems_event_receive( + RTEMS_EVENT_16, + RTEMS_DEFAULT_OPTIONS, + RTEMS_NO_TIMEOUT, + &event_out + ); end_time = benchmark_timer_read(); - put_time( - "rtems_event_receive: available", - end_time, - 1, - 0, - 0 - ); + put_time( "rtems_event_receive: available", end_time, 1, 0, 0 ); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_event_send( Task_id[ index ], RTEMS_EVENT_16 ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) rtems_event_send( Task_id[ index ], RTEMS_EVENT_16 ); + } end_time = benchmark_timer_read(); put_time( @@ -225,20 +212,18 @@ rtems_task Low_task( rtems_test_exit( 0 ); } -rtems_task High_tasks( - rtems_task_argument argument -) +rtems_task High_tasks( rtems_task_argument argument ) { (void) argument; - if ( time_set ) + if ( time_set ) { (void) rtems_event_receive( RTEMS_EVENT_16, RTEMS_DEFAULT_OPTIONS, RTEMS_NO_TIMEOUT, &eventout ); - else { + } else { time_set = true; /* start blocking rtems_event_receive time */ benchmark_timer_initialize(); diff --git a/testsuites/tmtests/tm16/system.h b/testsuites/tmtests/tm16/system.h index 9eb6d69e85..17d6e051e3 100644 --- a/testsuites/tmtests/tm16/system.h +++ b/testsuites/tmtests/tm16/system.h @@ -29,25 +29,22 @@ * POSSIBILITY OF SUCH DAMAGE. */ - #include /* functions */ -rtems_task Init( - rtems_task_argument argument -); +rtems_task Init( rtems_task_argument argument ); #include -rtems_id Task_id[ OPERATION_COUNT+1 ]; /* array of task ids */ +rtems_id Task_id[ OPERATION_COUNT + 1 ]; /* array of task ids */ /* configuration information */ #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER -#define CONFIGURE_MAXIMUM_TASKS (3 + OPERATION_COUNT) +#define CONFIGURE_MAXIMUM_TASKS ( 3 + OPERATION_COUNT ) #define CONFIGURE_RTEMS_INIT_TASKS_TABLE diff --git a/testsuites/tmtests/tm16/task1.c b/testsuites/tmtests/tm16/task1.c index 1060359fa1..674910cba4 100644 --- a/testsuites/tmtests/tm16/task1.c +++ b/testsuites/tmtests/tm16/task1.c @@ -26,7 +26,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#if !defined(OPERATION_COUNT) +#if !defined( OPERATION_COUNT ) #define OPERATION_COUNT 100 #endif @@ -41,25 +41,17 @@ const char rtems_test_name[] = "TIME TEST 16"; -uint32_t Task_count; +uint32_t Task_count; -rtems_task test_init( - rtems_task_argument argument -); +rtems_task test_init( rtems_task_argument argument ); -rtems_task Middle_tasks( - rtems_task_argument argument -); +rtems_task Middle_tasks( rtems_task_argument argument ); -rtems_task High_task( - rtems_task_argument argument -); +rtems_task High_task( rtems_task_argument argument ); int operation_count = OPERATION_COUNT; -rtems_task Init( - rtems_task_argument argument -) +rtems_task Init( rtems_task_argument argument ) { (void) argument; @@ -86,9 +78,7 @@ rtems_task Init( rtems_task_exit(); } -rtems_task test_init( - rtems_task_argument argument -) +rtems_task test_init( rtems_task_argument argument ) { (void) argument; @@ -97,16 +87,17 @@ rtems_task test_init( int index; rtems_task_entry task_entry; -/* As each task is started, it preempts this task and + /* As each task is started, it preempts this task and * performs a blocking rtems_event_receive. Upon completion of * this loop all created tasks are blocked. */ priority = RTEMS_MAXIMUM_PRIORITY - 2u; - if ( OPERATION_COUNT > RTEMS_MAXIMUM_PRIORITY - 2u ) - operation_count = (int) (RTEMS_MAXIMUM_PRIORITY - 2u); + if ( OPERATION_COUNT > RTEMS_MAXIMUM_PRIORITY - 2u ) { + operation_count = (int) ( RTEMS_MAXIMUM_PRIORITY - 2u ); + } - for( index = 0 ; index < operation_count ; index++ ) { + for ( index = 0; index < operation_count; index++ ) { status = rtems_task_create( rtems_build_name( 'M', 'I', 'D', ' ' ), priority, @@ -117,8 +108,11 @@ rtems_task test_init( ); directive_failed( status, "rtems_task_create LOOP" ); - if ( index == operation_count-1 ) task_entry = High_task; - else task_entry = Middle_tasks; + if ( index == operation_count - 1 ) { + task_entry = High_task; + } else { + task_entry = Middle_tasks; + } status = rtems_task_start( Task_id[ index ], task_entry, 0 ); directive_failed( status, "rtems_task_start LOOP" ); @@ -129,13 +123,11 @@ rtems_task test_init( Task_count = 0; benchmark_timer_initialize(); - (void) rtems_event_send( Task_id[ Task_count ], RTEMS_EVENT_16 ); + (void) rtems_event_send( Task_id[ Task_count ], RTEMS_EVENT_16 ); /* preempts task */ } -rtems_task Middle_tasks( - rtems_task_argument argument -) +rtems_task Middle_tasks( rtems_task_argument argument ) { (void) argument; @@ -156,9 +148,7 @@ rtems_task Middle_tasks( ); } -rtems_task High_task( - rtems_task_argument argument -) +rtems_task High_task( rtems_task_argument argument ) { (void) argument; diff --git a/testsuites/tmtests/tm17/system.h b/testsuites/tmtests/tm17/system.h index fffabdf844..f66631e8e6 100644 --- a/testsuites/tmtests/tm17/system.h +++ b/testsuites/tmtests/tm17/system.h @@ -29,25 +29,22 @@ * POSSIBILITY OF SUCH DAMAGE. */ - #include /* functions */ -rtems_task Init( - rtems_task_argument argument -); +rtems_task Init( rtems_task_argument argument ); #include -rtems_id Task_id[ OPERATION_COUNT+1 ]; /* array of task ids */ +rtems_id Task_id[ OPERATION_COUNT + 1 ]; /* array of task ids */ /* configuration information */ #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER -#define CONFIGURE_MAXIMUM_TASKS (2 + OPERATION_COUNT) +#define CONFIGURE_MAXIMUM_TASKS ( 2 + OPERATION_COUNT ) #define CONFIGURE_RTEMS_INIT_TASKS_TABLE diff --git a/testsuites/tmtests/tm17/task1.c b/testsuites/tmtests/tm17/task1.c index 907e22f7af..d9000dd171 100644 --- a/testsuites/tmtests/tm17/task1.c +++ b/testsuites/tmtests/tm17/task1.c @@ -26,7 +26,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#if !defined(OPERATION_COUNT) +#if !defined( OPERATION_COUNT ) #define OPERATION_COUNT 100 #endif @@ -41,26 +41,18 @@ const char rtems_test_name[] = "TIME TEST 17"; -uint32_t Task_count; +uint32_t Task_count; rtems_task_priority Task_priority; -rtems_task First_task( - rtems_task_argument argument -); +rtems_task First_task( rtems_task_argument argument ); -rtems_task Middle_tasks( - rtems_task_argument argument -); +rtems_task Middle_tasks( rtems_task_argument argument ); -rtems_task Last_task( - rtems_task_argument argument -); +rtems_task Last_task( rtems_task_argument argument ); int operation_count = OPERATION_COUNT; -rtems_task Init( - rtems_task_argument argument -) +rtems_task Init( rtems_task_argument argument ) { (void) argument; @@ -73,10 +65,11 @@ rtems_task Init( TEST_BEGIN(); Task_priority = RTEMS_MAXIMUM_PRIORITY - 1u; - if ( OPERATION_COUNT > RTEMS_MAXIMUM_PRIORITY - 2u ) - operation_count = (int) (RTEMS_MAXIMUM_PRIORITY - 2u); + if ( OPERATION_COUNT > RTEMS_MAXIMUM_PRIORITY - 2u ) { + operation_count = (int) ( RTEMS_MAXIMUM_PRIORITY - 2u ); + } - for( index = 0; index < operation_count ; index++ ) { + for ( index = 0; index < operation_count; index++ ) { status = rtems_task_create( rtems_build_name( 'T', 'I', 'M', 'E' ), Task_priority, @@ -87,9 +80,13 @@ rtems_task Init( ); directive_failed( status, "rtems_task_create loop" ); - if ( index == operation_count-1 ) task_entry = Last_task; - else if ( index == 0 ) task_entry = First_task; - else task_entry = Middle_tasks; + if ( index == operation_count - 1 ) { + task_entry = Last_task; + } else if ( index == 0 ) { + task_entry = First_task; + } else { + task_entry = Middle_tasks; + } status = rtems_task_start( Task_id[ index ], task_entry, 0 ); directive_failed( status, "rtems_task_start loop" ); @@ -99,9 +96,7 @@ rtems_task Init( rtems_task_exit(); } -rtems_task First_task( - rtems_task_argument argument -) +rtems_task First_task( rtems_task_argument argument ) { (void) argument; @@ -113,15 +108,13 @@ rtems_task First_task( Task_count++; (void) rtems_task_set_priority( - Task_id[ Task_count ], - Task_priority, - &previous_priority - ); + Task_id[ Task_count ], + Task_priority, + &previous_priority + ); } -rtems_task Middle_tasks( - rtems_task_argument argument -) +rtems_task Middle_tasks( rtems_task_argument argument ) { (void) argument; @@ -131,15 +124,13 @@ rtems_task Middle_tasks( Task_count++; (void) rtems_task_set_priority( - Task_id[ Task_count ], - Task_priority, - &previous_priority - ); + Task_id[ Task_count ], + Task_priority, + &previous_priority + ); } -rtems_task Last_task( - rtems_task_argument argument -) +rtems_task Last_task( rtems_task_argument argument ) { (void) argument; @@ -148,8 +139,9 @@ rtems_task Last_task( end_time = benchmark_timer_read(); benchmark_timer_initialize(); - for ( index=1 ; index < operation_count ; index++ ) - (void) benchmark_timer_empty_function(); + for ( index = 1; index < operation_count; index++ ) { + (void) benchmark_timer_empty_function(); + } overhead = benchmark_timer_read(); put_time( diff --git a/testsuites/tmtests/tm18/system.h b/testsuites/tmtests/tm18/system.h index 28263f3051..58c1df667e 100644 --- a/testsuites/tmtests/tm18/system.h +++ b/testsuites/tmtests/tm18/system.h @@ -29,14 +29,11 @@ * POSSIBILITY OF SUCH DAMAGE. */ - #include /* functions */ -rtems_task Init( - rtems_task_argument argument -); +rtems_task Init( rtems_task_argument argument ); #include @@ -45,7 +42,7 @@ rtems_task Init( #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER -#define CONFIGURE_MAXIMUM_TASKS (2 + OPERATION_COUNT) +#define CONFIGURE_MAXIMUM_TASKS ( 2 + OPERATION_COUNT ) #define CONFIGURE_RTEMS_INIT_TASKS_TABLE diff --git a/testsuites/tmtests/tm18/task1.c b/testsuites/tmtests/tm18/task1.c index ba0127f9c6..2bd633cbeb 100644 --- a/testsuites/tmtests/tm18/task1.c +++ b/testsuites/tmtests/tm18/task1.c @@ -26,7 +26,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#if !defined(OPERATION_COUNT) +#if !defined( OPERATION_COUNT ) #define OPERATION_COUNT 100 #endif @@ -41,27 +41,18 @@ const char rtems_test_name[] = "TIME TEST 18"; -uint32_t taskcount; +uint32_t taskcount; rtems_task_priority taskpri; -extern void test_init(void); +extern void test_init( void ); -rtems_task First_task( - rtems_task_argument argument -); +rtems_task First_task( rtems_task_argument argument ); -rtems_task Middle_tasks( - rtems_task_argument argument -); +rtems_task Middle_tasks( rtems_task_argument argument ); -rtems_task Last_task( - rtems_task_argument argument -); +rtems_task Last_task( rtems_task_argument argument ); - -rtems_task Init( - rtems_task_argument argument -) +rtems_task Init( rtems_task_argument argument ) { (void) argument; @@ -74,17 +65,17 @@ rtems_task Init( rtems_task_exit(); } -void test_init(void) +void test_init( void ) { rtems_id id; rtems_task_entry task_entry; uint32_t index; rtems_status_code status; - for ( index = 0 ; index <= OPERATION_COUNT ; index++ ) { + for ( index = 0; index <= OPERATION_COUNT; index++ ) { status = rtems_task_create( rtems_build_name( 'T', 'I', 'M', 'E' ), - (RTEMS_MAXIMUM_PRIORITY / 2u) + 1u, + ( RTEMS_MAXIMUM_PRIORITY / 2u ) + 1u, RTEMS_MINIMUM_STACK_SIZE, RTEMS_DEFAULT_MODES, RTEMS_DEFAULT_ATTRIBUTES, @@ -92,20 +83,20 @@ void test_init(void) ); directive_failed( status, "rtems_task_create loop" ); - if ( index == OPERATION_COUNT ) task_entry = Last_task; - else if ( index == 0 ) task_entry = First_task; - else task_entry = Middle_tasks; - + if ( index == OPERATION_COUNT ) { + task_entry = Last_task; + } else if ( index == 0 ) { + task_entry = First_task; + } else { + task_entry = Middle_tasks; + } status = rtems_task_start( id, task_entry, 0 ); directive_failed( status, "rtems_task_start loop" ); } - } -rtems_task First_task( - rtems_task_argument argument -) +rtems_task First_task( rtems_task_argument argument ) { (void) argument; @@ -114,18 +105,14 @@ rtems_task First_task( rtems_task_exit(); } -rtems_task Middle_tasks( - rtems_task_argument argument -) +rtems_task Middle_tasks( rtems_task_argument argument ) { (void) argument; rtems_task_exit(); } -rtems_task Last_task( - rtems_task_argument argument -) +rtems_task Last_task( rtems_task_argument argument ) { (void) argument; diff --git a/testsuites/tmtests/tm19/system.h b/testsuites/tmtests/tm19/system.h index bbae1e537f..9d4acd08c5 100644 --- a/testsuites/tmtests/tm19/system.h +++ b/testsuites/tmtests/tm19/system.h @@ -29,25 +29,22 @@ * POSSIBILITY OF SUCH DAMAGE. */ - #include /* functions */ -rtems_task Init( - rtems_task_argument argument -); +rtems_task Init( rtems_task_argument argument ); #include -rtems_id Task_id[ OPERATION_COUNT+1 ]; /* array of task ids */ +rtems_id Task_id[ OPERATION_COUNT + 1 ]; /* array of task ids */ /* configuration information */ #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER -#define CONFIGURE_MAXIMUM_TASKS 4 +#define CONFIGURE_MAXIMUM_TASKS 4 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE diff --git a/testsuites/tmtests/tm19/task1.c b/testsuites/tmtests/tm19/task1.c index 4144e9a25a..fd1c3eb704 100644 --- a/testsuites/tmtests/tm19/task1.c +++ b/testsuites/tmtests/tm19/task1.c @@ -37,29 +37,17 @@ const char rtems_test_name[] = "TIME TEST 19"; -rtems_asr Process_asr_for_pass_1( - rtems_signal_set signals -); +rtems_asr Process_asr_for_pass_1( rtems_signal_set signals ); -rtems_asr Process_asr_for_pass_2( - rtems_signal_set signals -); +rtems_asr Process_asr_for_pass_2( rtems_signal_set signals ); -rtems_task Task_1( - rtems_task_argument argument -); +rtems_task Task_1( rtems_task_argument argument ); -rtems_task Task_2( - rtems_task_argument argument -); +rtems_task Task_2( rtems_task_argument argument ); -rtems_task Task_3( - rtems_task_argument argument -); +rtems_task Task_3( rtems_task_argument argument ); -rtems_task Init( - rtems_task_argument argument -) +rtems_task Init( rtems_task_argument argument ) { (void) argument; @@ -71,7 +59,7 @@ rtems_task Init( status = rtems_task_create( rtems_build_name( 'T', 'I', 'M', 'E' ), - (RTEMS_MAXIMUM_PRIORITY / 2u) + 1u, + ( RTEMS_MAXIMUM_PRIORITY / 2u ) + 1u, RTEMS_MINIMUM_STACK_SIZE, RTEMS_DEFAULT_MODES, RTEMS_DEFAULT_ATTRIBUTES, @@ -84,7 +72,7 @@ rtems_task Init( status = rtems_task_create( rtems_build_name( 'T', 'I', 'M', 'E' ), - (RTEMS_MAXIMUM_PRIORITY / 2), + ( RTEMS_MAXIMUM_PRIORITY / 2 ), RTEMS_MINIMUM_STACK_SIZE, RTEMS_DEFAULT_MODES, RTEMS_DEFAULT_ATTRIBUTES, @@ -97,7 +85,7 @@ rtems_task Init( status = rtems_task_create( rtems_build_name( 'T', 'I', 'M', 'E' ), - (RTEMS_MAXIMUM_PRIORITY / 2u) - 1u, + ( RTEMS_MAXIMUM_PRIORITY / 2u ) - 1u, RTEMS_MINIMUM_STACK_SIZE, RTEMS_DEFAULT_MODES, RTEMS_DEFAULT_ATTRIBUTES, @@ -111,28 +99,18 @@ rtems_task Init( rtems_task_exit(); } -rtems_asr Process_asr_for_pass_1( - rtems_signal_set signals -) +rtems_asr Process_asr_for_pass_1( rtems_signal_set signals ) { (void) signals; end_time = benchmark_timer_read(); - put_time( - "rtems_signal_send: signal to self", - end_time, - 1, - 0, - 0 - ); + put_time( "rtems_signal_send: signal to self", end_time, 1, 0, 0 ); benchmark_timer_initialize(); } -rtems_asr Process_asr_for_pass_2( - rtems_signal_set signals -) +rtems_asr Process_asr_for_pass_2( rtems_signal_set signals ) { (void) signals; @@ -144,40 +122,26 @@ rtems_asr Process_asr_for_pass_2( benchmark_timer_initialize(); } -rtems_task Task_1( - rtems_task_argument argument -) +rtems_task Task_1( rtems_task_argument argument ) { (void) argument; rtems_status_code status; benchmark_timer_initialize(); - (void) rtems_signal_catch( Process_asr_for_pass_1, RTEMS_DEFAULT_MODES ); + (void) rtems_signal_catch( Process_asr_for_pass_1, RTEMS_DEFAULT_MODES ); end_time = benchmark_timer_read(); - put_time( - "rtems_signal_catch: only case", - end_time, - 1, - 0, - 0 - ); + put_time( "rtems_signal_catch: only case", end_time, 1, 0, 0 ); benchmark_timer_initialize(); - rtems_signal_send( Task_id[ 2 ], 1 ); + rtems_signal_send( Task_id[ 2 ], 1 ); end_time = benchmark_timer_read(); - put_time( - "rtems_signal_send: returns to caller", - end_time, - 1, - 0, - 0 - ); + put_time( "rtems_signal_send: returns to caller", end_time, 1, 0, 0 ); benchmark_timer_initialize(); - (void) rtems_signal_send( RTEMS_SELF, RTEMS_SIGNAL_1 ); + (void) rtems_signal_send( RTEMS_SELF, RTEMS_SIGNAL_1 ); /* end time is done is RTEMS_ASR */ @@ -195,26 +159,20 @@ rtems_task Task_1( directive_failed( status, "rtems_signal_catch" ); benchmark_timer_initialize(); - (void) rtems_signal_send( RTEMS_SELF, RTEMS_SIGNAL_1 ); + (void) rtems_signal_send( RTEMS_SELF, RTEMS_SIGNAL_1 ); } /* avoid warnings for no prototype */ -rtems_asr Process_asr_for_task_2( - rtems_signal_set signals -); +rtems_asr Process_asr_for_task_2( rtems_signal_set signals ); -rtems_asr Process_asr_for_task_2( - rtems_signal_set signals -) +rtems_asr Process_asr_for_task_2( rtems_signal_set signals ) { (void) signals; ; } -rtems_task Task_2( - rtems_task_argument argument -) +rtems_task Task_2( rtems_task_argument argument ) { (void) argument; @@ -226,9 +184,7 @@ rtems_task Task_2( (void) rtems_task_suspend( RTEMS_SELF ); } -rtems_task Task_3( - rtems_task_argument argument -) +rtems_task Task_3( rtems_task_argument argument ) { (void) argument; diff --git a/testsuites/tmtests/tm20/system.h b/testsuites/tmtests/tm20/system.h index 145477232d..271d80d6fa 100644 --- a/testsuites/tmtests/tm20/system.h +++ b/testsuites/tmtests/tm20/system.h @@ -29,18 +29,15 @@ * POSSIBILITY OF SUCH DAMAGE. */ - #include /* functions */ -rtems_task Init( - rtems_task_argument argument -); +rtems_task Init( rtems_task_argument argument ); #include -rtems_id Task_id[ OPERATION_COUNT+1 ]; /* array of task ids */ +rtems_id Task_id[ OPERATION_COUNT + 1 ]; /* array of task ids */ /* configuration information */ @@ -48,9 +45,9 @@ rtems_id Task_id[ OPERATION_COUNT+1 ]; /* array of task ids */ #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER #define CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER -#define CONFIGURE_MAXIMUM_TASKS 3 -#define CONFIGURE_MAXIMUM_PARTITIONS 1 -#define CONFIGURE_MAXIMUM_REGIONS 1 +#define CONFIGURE_MAXIMUM_TASKS 3 +#define CONFIGURE_MAXIMUM_PARTITIONS 1 +#define CONFIGURE_MAXIMUM_REGIONS 1 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE diff --git a/testsuites/tmtests/tm20/task1.c b/testsuites/tmtests/tm20/task1.c index 63d0824fc7..08b7d60167 100644 --- a/testsuites/tmtests/tm20/task1.c +++ b/testsuites/tmtests/tm20/task1.c @@ -26,7 +26,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#if !defined(OPERATION_COUNT) +#if !defined( OPERATION_COUNT ) #define OPERATION_COUNT 100 #endif @@ -43,39 +43,33 @@ const char rtems_test_name[] = "TIME TEST 20"; rtems_device_major_number _STUB_major = 1; -rtems_id Region_id; -rtems_name Region_name; +rtems_id Region_id; +rtems_name Region_name; uint8_t Region_area[ 2048 ] CPU_STRUCTURE_ALIGNMENT; #define PARTITION_SIZE 2048 -#define PARTITION_ELEMENT_SIZE 128 +#define PARTITION_ELEMENT_SIZE 128 #define PARTITION_BUFFER_POINTERS \ - ((PARTITION_SIZE / PARTITION_ELEMENT_SIZE) + 2) + ( ( PARTITION_SIZE / PARTITION_ELEMENT_SIZE ) + 2 ) -rtems_id Partition_id; -rtems_name Partition_name; +rtems_id Partition_id; +rtems_name Partition_name; uint8_t Partition_area[ PARTITION_SIZE ] CPU_STRUCTURE_ALIGNMENT; -void *Buffer_address_1; -void *Buffer_address_2; -void *Buffer_address_3; -void *Buffer_address_4; +void *Buffer_address_1; +void *Buffer_address_2; +void *Buffer_address_3; +void *Buffer_address_4; -uint32_t buffer_count; +uint32_t buffer_count; -void *Buffer_addresses[ PARTITION_BUFFER_POINTERS ]; +void *Buffer_addresses[ PARTITION_BUFFER_POINTERS ]; -rtems_task Task_1( - rtems_task_argument argument -); +rtems_task Task_1( rtems_task_argument argument ); -rtems_task Task_2( - rtems_task_argument argument -); +rtems_task Task_2( rtems_task_argument argument ); -rtems_task Init( - rtems_task_argument argument -) +rtems_task Init( rtems_task_argument argument ) { (void) argument; @@ -87,7 +81,7 @@ rtems_task Init( status = rtems_task_create( rtems_build_name( 'T', 'I', 'M', '1' ), - (RTEMS_MAXIMUM_PRIORITY / 2u) + 1u, + ( RTEMS_MAXIMUM_PRIORITY / 2u ) + 1u, RTEMS_MINIMUM_STACK_SIZE, RTEMS_DEFAULT_MODES, RTEMS_DEFAULT_ATTRIBUTES, @@ -100,7 +94,7 @@ rtems_task Init( status = rtems_task_create( rtems_build_name( 'T', 'I', 'M', '2' ), - (RTEMS_MAXIMUM_PRIORITY / 2u) + 2u, + ( RTEMS_MAXIMUM_PRIORITY / 2u ) + 2u, RTEMS_MINIMUM_STACK_SIZE, RTEMS_DEFAULT_MODES, RTEMS_DEFAULT_ATTRIBUTES, @@ -114,13 +108,11 @@ rtems_task Init( rtems_task_exit(); } -rtems_task Task_1( - rtems_task_argument argument -) +rtems_task Task_1( rtems_task_argument argument ) { (void) argument; - uint32_t index; + uint32_t index; rtems_mode previous_mode; rtems_task_priority previous_priority; rtems_status_code status; @@ -128,66 +120,49 @@ rtems_task Task_1( Partition_name = rtems_build_name( 'P', 'A', 'R', 'T' ); benchmark_timer_initialize(); - rtems_partition_create( - Partition_name, - Partition_area, - PARTITION_SIZE, - 128, - RTEMS_DEFAULT_ATTRIBUTES, - &Partition_id - ); + rtems_partition_create( + Partition_name, + Partition_area, + PARTITION_SIZE, + 128, + RTEMS_DEFAULT_ATTRIBUTES, + &Partition_id + ); end_time = benchmark_timer_read(); - put_time( - "rtems_partition_create: only case", - end_time, - 1, - 0, - 0 - ); + put_time( "rtems_partition_create: only case", end_time, 1, 0, 0 ); Region_name = rtems_build_name( 'R', 'E', 'G', 'N' ); benchmark_timer_initialize(); - rtems_region_create( - Region_name, - Region_area, - 2048, - 16, - RTEMS_DEFAULT_ATTRIBUTES, - &Region_id - ); + rtems_region_create( + Region_name, + Region_area, + 2048, + 16, + RTEMS_DEFAULT_ATTRIBUTES, + &Region_id + ); end_time = benchmark_timer_read(); - put_time( - "rtems_region_create: only case", - end_time, - 1, - 0, - 0 - ); + put_time( "rtems_region_create: only case", end_time, 1, 0, 0 ); benchmark_timer_initialize(); - (void) rtems_partition_get_buffer( Partition_id, &Buffer_address_1 ); + (void) rtems_partition_get_buffer( Partition_id, &Buffer_address_1 ); end_time = benchmark_timer_read(); - put_time( - "rtems_partition_get_buffer: available", - end_time, - 1, - 0, - 0 - ); + put_time( "rtems_partition_get_buffer: available", end_time, 1, 0, 0 ); buffer_count = 0; while ( FOREVER ) { - status = rtems_partition_get_buffer( - Partition_id, - &Buffer_addresses[ buffer_count ] - ); + Partition_id, + &Buffer_addresses[ buffer_count ] + ); - if ( status == RTEMS_UNSATISFIED ) break; + if ( status == RTEMS_UNSATISFIED ) { + break; + } buffer_count++; @@ -195,86 +170,60 @@ rtems_task Task_1( } benchmark_timer_initialize(); - (void) rtems_partition_get_buffer( Partition_id, &Buffer_address_2 ); + (void) rtems_partition_get_buffer( Partition_id, &Buffer_address_2 ); end_time = benchmark_timer_read(); - put_time( - "rtems_partition_get_buffer: not available", - end_time, - 1, - 0, - 0 - ); + put_time( "rtems_partition_get_buffer: not available", end_time, 1, 0, 0 ); benchmark_timer_initialize(); - (void) rtems_partition_return_buffer( Partition_id, Buffer_address_1 ); + (void) rtems_partition_return_buffer( Partition_id, Buffer_address_1 ); end_time = benchmark_timer_read(); - put_time( - "rtems_partition_return_buffer: only case", - end_time, - 1, - 0, - 0 - ); - - for ( index = 0 ; index < buffer_count ; index++ ) { + put_time( "rtems_partition_return_buffer: only case", end_time, 1, 0, 0 ); + for ( index = 0; index < buffer_count; index++ ) { status = rtems_partition_return_buffer( - Partition_id, - Buffer_addresses[ index ] - ); + Partition_id, + Buffer_addresses[ index ] + ); directive_failed( status, "rtems_partition_return_buffer" ); - } benchmark_timer_initialize(); - (void) rtems_partition_delete( Partition_id ); + (void) rtems_partition_delete( Partition_id ); end_time = benchmark_timer_read(); - put_time( - "rtems_partition_delete: only case", - end_time, - 1, - 0, - 0 - ); + put_time( "rtems_partition_delete: only case", end_time, 1, 0, 0 ); status = rtems_region_get_segment( - Region_id, - 400, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &Buffer_address_2 - ); + Region_id, + 400, + RTEMS_DEFAULT_OPTIONS, + RTEMS_NO_TIMEOUT, + &Buffer_address_2 + ); directive_failed( status, "region_get_segment" ); benchmark_timer_initialize(); - (void) rtems_region_get_segment( - Region_id, - 400, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &Buffer_address_3 - ); + (void) rtems_region_get_segment( + Region_id, + 400, + RTEMS_DEFAULT_OPTIONS, + RTEMS_NO_TIMEOUT, + &Buffer_address_3 + ); end_time = benchmark_timer_read(); - put_time( - "rtems_region_get_segment: available", - end_time, - 1, - 0, - 0 - ); + put_time( "rtems_region_get_segment: available", end_time, 1, 0, 0 ); benchmark_timer_initialize(); - (void) rtems_region_get_segment( - Region_id, - 1700, - RTEMS_NO_WAIT, - RTEMS_NO_TIMEOUT, - &Buffer_address_4 - ); + (void) rtems_region_get_segment( + Region_id, + 1700, + RTEMS_NO_WAIT, + RTEMS_NO_TIMEOUT, + &Buffer_address_4 + ); end_time = benchmark_timer_read(); put_time( @@ -289,7 +238,7 @@ rtems_task Task_1( directive_failed( status, "rtems_region_return_segment" ); benchmark_timer_initialize(); - (void) rtems_region_return_segment( Region_id, Buffer_address_2 ); + (void) rtems_region_return_segment( Region_id, Buffer_address_2 ); end_time = benchmark_timer_read(); put_time( @@ -310,13 +259,13 @@ rtems_task Task_1( directive_failed( status, "rtems_region_get_segment" ); benchmark_timer_initialize(); - (void) rtems_region_get_segment( - Region_id, - 1700, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &Buffer_address_2 - ); + (void) rtems_region_get_segment( + Region_id, + 1700, + RTEMS_DEFAULT_OPTIONS, + RTEMS_NO_TIMEOUT, + &Buffer_address_2 + ); /* execute Task_2 */ @@ -341,7 +290,10 @@ rtems_task Task_1( directive_failed( status, "rtems_task_mode" ); status = rtems_task_set_priority( - RTEMS_SELF, RTEMS_MAXIMUM_PRIORITY - 1u, &previous_priority ); + RTEMS_SELF, + RTEMS_MAXIMUM_PRIORITY - 1u, + &previous_priority + ); directive_failed( status, "rtems_task_set_priority" ); status = rtems_region_get_segment( @@ -368,25 +320,21 @@ rtems_task Task_1( directive_failed( status, "rtems_region_return_segment" ); benchmark_timer_initialize(); - (void) rtems_region_delete( Region_id ); + (void) rtems_region_delete( Region_id ); end_time = benchmark_timer_read(); - put_time( - "rtems_region_delete: only case", - end_time, - 1, - 0, - 0 - ); + put_time( "rtems_region_delete: only case", end_time, 1, 0, 0 ); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) benchmark_timer_empty_function(); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) benchmark_timer_empty_function(); + } overhead = benchmark_timer_read(); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_io_initialize( _STUB_major, 0, NULL ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) rtems_io_initialize( _STUB_major, 0, NULL ); + } end_time = benchmark_timer_read(); put_time( @@ -398,8 +346,9 @@ rtems_task Task_1( ); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_io_open( _STUB_major, 0, NULL ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) rtems_io_open( _STUB_major, 0, NULL ); + } end_time = benchmark_timer_read(); put_time( @@ -411,8 +360,9 @@ rtems_task Task_1( ); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_io_close( _STUB_major, 0, NULL ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) rtems_io_close( _STUB_major, 0, NULL ); + } end_time = benchmark_timer_read(); put_time( @@ -424,8 +374,9 @@ rtems_task Task_1( ); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_io_read( _STUB_major, 0, NULL ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) rtems_io_read( _STUB_major, 0, NULL ); + } end_time = benchmark_timer_read(); put_time( @@ -437,8 +388,9 @@ rtems_task Task_1( ); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_io_write( _STUB_major, 0, NULL ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) rtems_io_write( _STUB_major, 0, NULL ); + } end_time = benchmark_timer_read(); put_time( @@ -450,8 +402,9 @@ rtems_task Task_1( ); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_io_control( _STUB_major, 0, NULL ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) rtems_io_control( _STUB_major, 0, NULL ); + } end_time = benchmark_timer_read(); put_time( @@ -466,9 +419,7 @@ rtems_task Task_1( rtems_test_exit( 0 ); } -rtems_task Task_2( - rtems_task_argument argument -) +rtems_task Task_2( rtems_task_argument argument ) { (void) argument; @@ -483,12 +434,12 @@ rtems_task Task_2( ); benchmark_timer_initialize(); - (void) rtems_region_return_segment( Region_id, Buffer_address_1 ); + (void) rtems_region_return_segment( Region_id, Buffer_address_1 ); /* preempt back to Task_1 */ benchmark_timer_initialize(); - (void) rtems_region_return_segment( Region_id, Buffer_address_1 ); + (void) rtems_region_return_segment( Region_id, Buffer_address_1 ); end_time = benchmark_timer_read(); put_time( diff --git a/testsuites/tmtests/tm21/system.h b/testsuites/tmtests/tm21/system.h index ef4e35fc7d..6116112f36 100644 --- a/testsuites/tmtests/tm21/system.h +++ b/testsuites/tmtests/tm21/system.h @@ -29,35 +29,31 @@ * POSSIBILITY OF SUCH DAMAGE. */ - #include /* functions */ -rtems_task Init( - rtems_task_argument argument -); +rtems_task Init( rtems_task_argument argument ); #include /* configuration information */ -#define MESSAGE_SIZE (sizeof(long) * 4) +#define MESSAGE_SIZE ( sizeof( long ) * 4 ) #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER -#define CONFIGURE_MAXIMUM_TASKS (2 + OPERATION_COUNT) -#define CONFIGURE_MAXIMUM_TIMERS OPERATION_COUNT -#define CONFIGURE_MAXIMUM_SEMAPHORES OPERATION_COUNT -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES OPERATION_COUNT +#define CONFIGURE_MAXIMUM_TASKS ( 2 + OPERATION_COUNT ) +#define CONFIGURE_MAXIMUM_TIMERS OPERATION_COUNT +#define CONFIGURE_MAXIMUM_SEMAPHORES OPERATION_COUNT +#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES OPERATION_COUNT #define CONFIGURE_MESSAGE_BUFFER_MEMORY \ - CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(OPERATION_COUNT, MESSAGE_SIZE) -#define CONFIGURE_MAXIMUM_PARTITIONS OPERATION_COUNT -#define CONFIGURE_MAXIMUM_REGIONS OPERATION_COUNT -#define CONFIGURE_MAXIMUM_PORTS OPERATION_COUNT -#define CONFIGURE_MAXIMUM_PERIODS OPERATION_COUNT - + CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE( OPERATION_COUNT, MESSAGE_SIZE ) +#define CONFIGURE_MAXIMUM_PARTITIONS OPERATION_COUNT +#define CONFIGURE_MAXIMUM_REGIONS OPERATION_COUNT +#define CONFIGURE_MAXIMUM_PORTS OPERATION_COUNT +#define CONFIGURE_MAXIMUM_PERIODS OPERATION_COUNT #define CONFIGURE_RTEMS_INIT_TASKS_TABLE diff --git a/testsuites/tmtests/tm21/task1.c b/testsuites/tmtests/tm21/task1.c index 56976bd2ca..281a0c9e41 100644 --- a/testsuites/tmtests/tm21/task1.c +++ b/testsuites/tmtests/tm21/task1.c @@ -26,7 +26,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#if !defined(OPERATION_COUNT) +#if !defined( OPERATION_COUNT ) #define OPERATION_COUNT 100 #endif @@ -41,16 +41,12 @@ const char rtems_test_name[] = "TIME TEST 21"; -uint8_t Region_area[ 2048 ] CPU_STRUCTURE_ALIGNMENT; -uint8_t Partition_area[ 2048 ] CPU_STRUCTURE_ALIGNMENT; +uint8_t Region_area[ 2048 ] CPU_STRUCTURE_ALIGNMENT; +uint8_t Partition_area[ 2048 ] CPU_STRUCTURE_ALIGNMENT; -rtems_task Task_1( - rtems_task_argument argument -); +rtems_task Task_1( rtems_task_argument argument ); -rtems_task Init( - rtems_task_argument argument -) +rtems_task Init( rtems_task_argument argument ) { (void) argument; @@ -77,18 +73,16 @@ rtems_task Init( rtems_task_exit(); } -rtems_task Task_1( - rtems_task_argument argument -) +rtems_task Task_1( rtems_task_argument argument ) { (void) argument; - uint32_t index; + uint32_t index; rtems_id id; rtems_status_code status; - for( index = 1 ; index <= OPERATION_COUNT ; index++ ) { - status = rtems_task_create ( + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + status = rtems_task_create( index, RTEMS_MAXIMUM_PRIORITY - 1u, RTEMS_MINIMUM_STACK_SIZE, @@ -100,7 +94,7 @@ rtems_task Task_1( status = rtems_message_queue_create( index, - 1, /* only going to ident this queue */ + 1, /* only going to ident this queue */ MESSAGE_SIZE, RTEMS_DEFAULT_ATTRIBUTES, &id @@ -153,13 +147,15 @@ rtems_task Task_1( } benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) benchmark_timer_empty_function(); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) benchmark_timer_empty_function(); + } overhead = benchmark_timer_read(); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_task_ident( index, RTEMS_SEARCH_ALL_NODES, &id ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) rtems_task_ident( index, RTEMS_SEARCH_ALL_NODES, &id ); + } end_time = benchmark_timer_read(); put_time( @@ -171,8 +167,9 @@ rtems_task Task_1( ); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_message_queue_ident( index, RTEMS_SEARCH_ALL_NODES, &id ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) rtems_message_queue_ident( index, RTEMS_SEARCH_ALL_NODES, &id ); + } end_time = benchmark_timer_read(); put_time( @@ -184,8 +181,9 @@ rtems_task Task_1( ); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_semaphore_ident( index, RTEMS_SEARCH_ALL_NODES, &id ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) rtems_semaphore_ident( index, RTEMS_SEARCH_ALL_NODES, &id ); + } end_time = benchmark_timer_read(); put_time( @@ -197,8 +195,9 @@ rtems_task Task_1( ); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_partition_ident( index, RTEMS_SEARCH_ALL_NODES, &id ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) rtems_partition_ident( index, RTEMS_SEARCH_ALL_NODES, &id ); + } end_time = benchmark_timer_read(); put_time( @@ -210,8 +209,9 @@ rtems_task Task_1( ); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_region_ident( index, &id ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) rtems_region_ident( index, &id ); + } end_time = benchmark_timer_read(); put_time( @@ -223,8 +223,9 @@ rtems_task Task_1( ); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_port_ident( index, &id ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) rtems_port_ident( index, &id ); + } end_time = benchmark_timer_read(); put_time( @@ -236,8 +237,9 @@ rtems_task Task_1( ); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_timer_ident( index, &id ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) rtems_timer_ident( index, &id ); + } end_time = benchmark_timer_read(); put_time( @@ -249,8 +251,9 @@ rtems_task Task_1( ); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_rate_monotonic_ident( index, &id ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) rtems_rate_monotonic_ident( index, &id ); + } end_time = benchmark_timer_read(); put_time( diff --git a/testsuites/tmtests/tm22/system.h b/testsuites/tmtests/tm22/system.h index 621043dc7c..5dfd285345 100644 --- a/testsuites/tmtests/tm22/system.h +++ b/testsuites/tmtests/tm22/system.h @@ -29,16 +29,13 @@ * POSSIBILITY OF SUCH DAMAGE. */ - #include /* functions */ -rtems_task Init( - rtems_task_argument argument -); +rtems_task Init( rtems_task_argument argument ); -#define MESSAGE_SIZE (sizeof(long) * 4) +#define MESSAGE_SIZE ( sizeof( long ) * 4 ) #include @@ -47,12 +44,11 @@ rtems_task Init( #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER -#define CONFIGURE_MAXIMUM_TASKS 4 -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 - +#define CONFIGURE_MAXIMUM_TASKS 4 +#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 #define CONFIGURE_MESSAGE_BUFFER_MEMORY \ - CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(100, MESSAGE_SIZE ) + CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE( 100, MESSAGE_SIZE ) #define CONFIGURE_RTEMS_INIT_TASKS_TABLE #include diff --git a/testsuites/tmtests/tm22/task1.c b/testsuites/tmtests/tm22/task1.c index 0b570c516e..729f5c29fb 100644 --- a/testsuites/tmtests/tm22/task1.c +++ b/testsuites/tmtests/tm22/task1.c @@ -27,7 +27,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#if !defined(OPERATION_COUNT) +#if !defined( OPERATION_COUNT ) #define OPERATION_COUNT 100 #endif @@ -44,23 +44,15 @@ const char rtems_test_name[] = "TIME TEST 22"; rtems_id Queue_id; -long Buffer[4]; +long Buffer[ 4 ]; -rtems_task Low_task( - rtems_task_argument argument -); +rtems_task Low_task( rtems_task_argument argument ); -rtems_task High_task( - rtems_task_argument argument -); +rtems_task High_task( rtems_task_argument argument ); -rtems_task Preempt_task( - rtems_task_argument argument -); +rtems_task Preempt_task( rtems_task_argument argument ); -rtems_task Init( - rtems_task_argument argument -) +rtems_task Init( rtems_task_argument argument ) { (void) argument; @@ -72,7 +64,7 @@ rtems_task Init( TEST_BEGIN(); status = rtems_message_queue_create( - rtems_build_name( 'M', 'Q', '1', ' '), + rtems_build_name( 'M', 'Q', '1', ' ' ), 100, MESSAGE_SIZE, RTEMS_DEFAULT_ATTRIBUTES, @@ -109,22 +101,16 @@ rtems_task Init( rtems_task_exit(); } -rtems_task High_task( - rtems_task_argument argument -) +rtems_task High_task( rtems_task_argument argument ) { (void) argument; - uint32_t count; + uint32_t count; rtems_status_code status; benchmark_timer_initialize(); - (void) rtems_message_queue_broadcast( - Queue_id, - Buffer, - MESSAGE_SIZE, - &count - ); + (void) + rtems_message_queue_broadcast( Queue_id, Buffer, MESSAGE_SIZE, &count ); end_time = benchmark_timer_read(); put_time( @@ -135,13 +121,11 @@ rtems_task High_task( 0 ); - status = rtems_task_suspend(RTEMS_SELF); + status = rtems_task_suspend( RTEMS_SELF ); directive_failed( status, "rtems_task_suspend" ); } -rtems_task Low_task( - rtems_task_argument argument -) +rtems_task Low_task( rtems_task_argument argument ) { (void) argument; @@ -166,7 +150,7 @@ rtems_task Low_task( status = rtems_message_queue_receive( Queue_id, - (long (*)[4]) Buffer, + (long ( * )[ 4 ]) Buffer, &size, RTEMS_DEFAULT_OPTIONS, RTEMS_NO_TIMEOUT @@ -174,13 +158,10 @@ rtems_task Low_task( directive_failed( status, "message_queu_receive" ); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_message_queue_broadcast( - Queue_id, - Buffer, - MESSAGE_SIZE, - &count - ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) + rtems_message_queue_broadcast( Queue_id, Buffer, MESSAGE_SIZE, &count ); + } end_time = benchmark_timer_read(); put_time( @@ -192,12 +173,12 @@ rtems_task Low_task( ); (void) rtems_message_queue_receive( - Queue_id, - (long (*)[4]) Buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); + Queue_id, + (long ( * )[ 4 ]) Buffer, + &size, + RTEMS_DEFAULT_OPTIONS, + RTEMS_NO_TIMEOUT + ); /* should go to Preempt_task here */ @@ -215,21 +196,15 @@ rtems_task Low_task( rtems_test_exit( 0 ); } -rtems_task Preempt_task( - rtems_task_argument argument -) +rtems_task Preempt_task( rtems_task_argument argument ) { (void) argument; - uint32_t count; + uint32_t count; benchmark_timer_initialize(); - (void) rtems_message_queue_broadcast( - Queue_id, - Buffer, - MESSAGE_SIZE, - &count - ); + (void) + rtems_message_queue_broadcast( Queue_id, Buffer, MESSAGE_SIZE, &count ); - /* should be preempted by low task */ + /* should be preempted by low task */ } diff --git a/testsuites/tmtests/tm23/system.h b/testsuites/tmtests/tm23/system.h index 41722a2c39..b152ab7f26 100644 --- a/testsuites/tmtests/tm23/system.h +++ b/testsuites/tmtests/tm23/system.h @@ -29,14 +29,11 @@ * POSSIBILITY OF SUCH DAMAGE. */ - #include /* functions */ -rtems_task Init( - rtems_task_argument argument -); +rtems_task Init( rtems_task_argument argument ); #include @@ -45,8 +42,8 @@ rtems_task Init( #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER -#define CONFIGURE_MAXIMUM_TASKS (1 + OPERATION_COUNT) -#define CONFIGURE_MAXIMUM_TIMERS OPERATION_COUNT +#define CONFIGURE_MAXIMUM_TASKS ( 1 + OPERATION_COUNT ) +#define CONFIGURE_MAXIMUM_TIMERS OPERATION_COUNT #define CONFIGURE_RTEMS_INIT_TASKS_TABLE diff --git a/testsuites/tmtests/tm23/task1.c b/testsuites/tmtests/tm23/task1.c index 88e0df88b8..49c8dbd5f7 100644 --- a/testsuites/tmtests/tm23/task1.c +++ b/testsuites/tmtests/tm23/task1.c @@ -26,7 +26,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#if !defined(OPERATION_COUNT) +#if !defined( OPERATION_COUNT ) #define OPERATION_COUNT 100 #endif @@ -41,32 +41,21 @@ const char rtems_test_name[] = "TIME TEST 23"; -rtems_id Timer_id[ OPERATION_COUNT+1 ]; +rtems_id Timer_id[ OPERATION_COUNT + 1 ]; rtems_time_of_day time_of_day; -void null_delay( - rtems_id ignored_id, - void *ignored_address -); +void null_delay( rtems_id ignored_id, void *ignored_address ); -rtems_task Low_task( - rtems_task_argument argument -); +rtems_task Low_task( rtems_task_argument argument ); -rtems_task Middle_tasks( - rtems_task_argument argument -); +rtems_task Middle_tasks( rtems_task_argument argument ); -rtems_task High_task( - rtems_task_argument argument -); +rtems_task High_task( rtems_task_argument argument ); int operation_count = OPERATION_COUNT; -rtems_task Init( - rtems_task_argument argument -) +rtems_task Init( rtems_task_argument argument ) { (void) argument; @@ -81,15 +70,17 @@ rtems_task Init( TEST_BEGIN(); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) benchmark_timer_empty_function(); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) benchmark_timer_empty_function(); + } overhead = benchmark_timer_read(); priority = 2; - if ( OPERATION_COUNT > RTEMS_MAXIMUM_PRIORITY - 2 ) - operation_count = RTEMS_MAXIMUM_PRIORITY - 2; + if ( OPERATION_COUNT > RTEMS_MAXIMUM_PRIORITY - 2 ) { + operation_count = RTEMS_MAXIMUM_PRIORITY - 2; + } - for( index=1 ; index <= operation_count ; index++ ) { + for ( index = 1; index <= operation_count; index++ ) { status = rtems_task_create( rtems_build_name( 'T', 'I', 'M', 'E' ), priority, @@ -100,9 +91,13 @@ rtems_task Init( ); directive_failed( status, "rtems_task_create LOOP" ); - if ( index == 1 ) task_entry = High_task; - else if ( index == operation_count ) task_entry = Low_task; - else task_entry = Middle_tasks; + if ( index == 1 ) { + task_entry = High_task; + } else if ( index == operation_count ) { + task_entry = Low_task; + } else { + task_entry = Middle_tasks; + } status = rtems_task_start( id, task_entry, 0 ); directive_failed( status, "rtems_task_start LOOP" ); @@ -113,33 +108,30 @@ rtems_task Init( rtems_task_exit(); } -void null_delay( - rtems_id ignored_id, - void *ignored_address -) +void null_delay( rtems_id ignored_id, void *ignored_address ) { (void) ignored_id; (void) ignored_address; } -rtems_task High_task( - rtems_task_argument argument -) +rtems_task High_task( rtems_task_argument argument ) { (void) argument; - uint32_t index; + uint32_t index; rtems_status_code status; - int i; + int i; benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) benchmark_timer_empty_function(); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) benchmark_timer_empty_function(); + } overhead = benchmark_timer_read(); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_timer_create( index, &Timer_id[ index ] ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) rtems_timer_create( index, &Timer_id[ index ] ); + } end_time = benchmark_timer_read(); put_time( @@ -151,8 +143,9 @@ rtems_task High_task( ); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_timer_fire_after( Timer_id[ index ], 500, null_delay, NULL ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) rtems_timer_fire_after( Timer_id[ index ], 500, null_delay, NULL ); + } end_time = benchmark_timer_read(); put_time( @@ -164,8 +157,9 @@ rtems_task High_task( ); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_timer_fire_after( Timer_id[ index ], 500, null_delay, NULL ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) rtems_timer_fire_after( Timer_id[ index ], 500, null_delay, NULL ); + } end_time = benchmark_timer_read(); put_time( @@ -177,8 +171,9 @@ rtems_task High_task( ); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_timer_cancel( Timer_id[ index ] ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) rtems_timer_cancel( Timer_id[ index ] ); + } end_time = benchmark_timer_read(); put_time( @@ -189,10 +184,12 @@ rtems_task High_task( 0 ); - for ( benchmark_timer_initialize(), i=0 ; i /* functions */ -rtems_task Init( - rtems_task_argument argument -); +rtems_task Init( rtems_task_argument argument ); #include @@ -45,7 +42,7 @@ rtems_task Init( #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER -#define CONFIGURE_MAXIMUM_TASKS (2 + OPERATION_COUNT) +#define CONFIGURE_MAXIMUM_TASKS ( 2 + OPERATION_COUNT ) #define CONFIGURE_RTEMS_INIT_TASKS_TABLE diff --git a/testsuites/tmtests/tm24/task1.c b/testsuites/tmtests/tm24/task1.c index e3906aad10..7edacd4f1d 100644 --- a/testsuites/tmtests/tm24/task1.c +++ b/testsuites/tmtests/tm24/task1.c @@ -26,7 +26,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#if !defined(OPERATION_COUNT) +#if !defined( OPERATION_COUNT ) #define OPERATION_COUNT 100 #endif @@ -41,24 +41,18 @@ const char rtems_test_name[] = "TIME TEST 24"; -uint32_t Task_count; +uint32_t Task_count; -rtems_task Tasks( - rtems_task_argument argument -); +rtems_task Tasks( rtems_task_argument argument ); -rtems_task High_task( - rtems_task_argument argument -); +rtems_task High_task( rtems_task_argument argument ); -rtems_task Init( - rtems_task_argument argument -) +rtems_task Init( rtems_task_argument argument ) { (void) argument; rtems_id id; - uint32_t index; + uint32_t index; rtems_status_code status; Print_Warning(); @@ -78,10 +72,10 @@ rtems_task Init( status = rtems_task_start( id, High_task, 0 ); directive_failed( status, "rtems_task_create HIGH" ); - for ( index = 1 ; index <= OPERATION_COUNT ; index++ ) { + for ( index = 1; index <= OPERATION_COUNT; index++ ) { status = rtems_task_create( rtems_build_name( 'R', 'E', 'S', 'T' ), - (RTEMS_MAXIMUM_PRIORITY / 2u) + 1u, + ( RTEMS_MAXIMUM_PRIORITY / 2u ) + 1u, RTEMS_MINIMUM_STACK_SIZE, RTEMS_DEFAULT_MODES, RTEMS_DEFAULT_ATTRIBUTES, @@ -95,22 +89,22 @@ rtems_task Init( rtems_task_exit(); } -rtems_task High_task( - rtems_task_argument argument -) +rtems_task High_task( rtems_task_argument argument ) { (void) argument; - uint32_t index; + uint32_t index; benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) benchmark_timer_empty_function(); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) benchmark_timer_empty_function(); + } overhead = benchmark_timer_read(); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_task_wake_after( RTEMS_YIELD_PROCESSOR ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) rtems_task_wake_after( RTEMS_YIELD_PROCESSOR ); + } end_time = benchmark_timer_read(); put_time( @@ -126,17 +120,15 @@ rtems_task High_task( rtems_task_exit(); } -rtems_task Tasks( - rtems_task_argument argument -) +rtems_task Tasks( rtems_task_argument argument ) { (void) argument; Task_count++; - if ( Task_count == 1 ) + if ( Task_count == 1 ) { benchmark_timer_initialize(); - else if ( Task_count == OPERATION_COUNT ) { + } else if ( Task_count == OPERATION_COUNT ) { end_time = benchmark_timer_read(); put_time( @@ -147,7 +139,7 @@ rtems_task Tasks( 0 ); - TEST_END(); + TEST_END(); rtems_test_exit( 0 ); } (void) rtems_task_wake_after( RTEMS_YIELD_PROCESSOR ); diff --git a/testsuites/tmtests/tm25/system.h b/testsuites/tmtests/tm25/system.h index 423a30eba8..7cb50f6adb 100644 --- a/testsuites/tmtests/tm25/system.h +++ b/testsuites/tmtests/tm25/system.h @@ -29,14 +29,11 @@ * POSSIBILITY OF SUCH DAMAGE. */ - #include /* functions */ -rtems_task Init( - rtems_task_argument argument -); +rtems_task Init( rtems_task_argument argument ); #include @@ -45,8 +42,8 @@ rtems_task Init( #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER -#define CONFIGURE_MAXIMUM_TASKS (2 + OPERATION_COUNT) -#define CONFIGURE_MAXIMUM_SEMAPHORES 1 +#define CONFIGURE_MAXIMUM_TASKS ( 2 + OPERATION_COUNT ) +#define CONFIGURE_MAXIMUM_SEMAPHORES 1 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE diff --git a/testsuites/tmtests/tm25/task1.c b/testsuites/tmtests/tm25/task1.c index 21eaa8d161..1f238c7e76 100644 --- a/testsuites/tmtests/tm25/task1.c +++ b/testsuites/tmtests/tm25/task1.c @@ -26,7 +26,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#if !defined(OPERATION_COUNT) +#if !defined( OPERATION_COUNT ) #define OPERATION_COUNT 100 #endif @@ -43,22 +43,16 @@ const char rtems_test_name[] = "TIME TEST 25"; rtems_id Semaphore_id; -rtems_task High_tasks( - rtems_task_argument argument -); +rtems_task High_tasks( rtems_task_argument argument ); -rtems_task Low_task( - rtems_task_argument argument -); +rtems_task Low_task( rtems_task_argument argument ); -rtems_task Init( - rtems_task_argument argument -) +rtems_task Init( rtems_task_argument argument ) { (void) argument; rtems_id task_id; - uint32_t index; + uint32_t index; rtems_status_code status; Print_Warning(); @@ -66,7 +60,7 @@ rtems_task Init( TEST_BEGIN(); status = rtems_semaphore_create( - rtems_build_name( 'S', 'M', '1', ' ') , + rtems_build_name( 'S', 'M', '1', ' ' ), 0, RTEMS_DEFAULT_ATTRIBUTES, RTEMS_NO_PRIORITY, @@ -87,10 +81,10 @@ rtems_task Init( status = rtems_task_start( task_id, Low_task, 0 ); directive_failed( status, "rtems_task_start LOW" ); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) { + for ( index = 1; index <= OPERATION_COUNT; index++ ) { status = rtems_task_create( rtems_build_name( 'T', 'I', 'M', 'E' ), - (RTEMS_MAXIMUM_PRIORITY / 2u) + 1u, + ( RTEMS_MAXIMUM_PRIORITY / 2u ) + 1u, RTEMS_MINIMUM_STACK_SIZE, RTEMS_DEFAULT_MODES, RTEMS_DEFAULT_ATTRIBUTES, @@ -105,36 +99,23 @@ rtems_task Init( rtems_task_exit(); } -rtems_task High_tasks( - rtems_task_argument argument -) +rtems_task High_tasks( rtems_task_argument argument ) { (void) argument; - (void) rtems_semaphore_obtain( - Semaphore_id, - RTEMS_DEFAULT_OPTIONS, - 0xffffffff - ); + (void) + rtems_semaphore_obtain( Semaphore_id, RTEMS_DEFAULT_OPTIONS, 0xffffffff ); } -rtems_task Low_task( - rtems_task_argument argument -) +rtems_task Low_task( rtems_task_argument argument ) { (void) argument; benchmark_timer_initialize(); - (void) rtems_clock_tick(); + (void) rtems_clock_tick(); end_time = benchmark_timer_read(); - put_time( - "rtems_clock_tick: only case", - end_time, - 1, - 0, - 0 - ); + put_time( "rtems_clock_tick: only case", end_time, 1, 0, 0 ); TEST_END(); rtems_test_exit( 0 ); diff --git a/testsuites/tmtests/tm26/fptest.h b/testsuites/tmtests/tm26/fptest.h index fc3a90fb1e..5f83fdc2b9 100644 --- a/testsuites/tmtests/tm26/fptest.h +++ b/testsuites/tmtests/tm26/fptest.h @@ -41,7 +41,6 @@ * POSSIBILITY OF SUCH DAMAGE. */ - #ifndef __FPTEST_h #define __FPTEST_h @@ -59,122 +58,125 @@ #else -#define FP_DECLARE \ - double fp01 = 1.0; \ - double fp02 = 2.0; \ - double fp03 = 3.0; \ - double fp04 = 4.0; \ - double fp05 = 5.0; \ - double fp06 = 6.0; \ - double fp07 = 7.0; \ - double fp08 = 8.0; \ - double fp09 = 9.0; \ - double fp10 = 10.0; \ - double fp11 = 11.0; \ - double fp12 = 12.0; \ - double fp13 = 13.0; \ - double fp14 = 14.0; \ - double fp15 = 15.0; \ - double fp16 = 16.0; \ - double fp17 = 17.0; \ - double fp18 = 18.0; \ - double fp19 = 19.0; \ - double fp20 = 20.0; \ - double fp21 = 21.0; \ - double fp22 = 22.0; \ - double fp23 = 23.0; \ - double fp24 = 24.0; \ - double fp25 = 25.0; \ - double fp26 = 26.0; \ - double fp27 = 27.0; \ - double fp28 = 28.0; \ - double fp29 = 29.0; \ - double fp30 = 30.0; \ - double fp31 = 31.0; \ - double fp32 = 32.0 +#define FP_DECLARE \ + double fp01 = 1.0; \ + double fp02 = 2.0; \ + double fp03 = 3.0; \ + double fp04 = 4.0; \ + double fp05 = 5.0; \ + double fp06 = 6.0; \ + double fp07 = 7.0; \ + double fp08 = 8.0; \ + double fp09 = 9.0; \ + double fp10 = 10.0; \ + double fp11 = 11.0; \ + double fp12 = 12.0; \ + double fp13 = 13.0; \ + double fp14 = 14.0; \ + double fp15 = 15.0; \ + double fp16 = 16.0; \ + double fp17 = 17.0; \ + double fp18 = 18.0; \ + double fp19 = 19.0; \ + double fp20 = 20.0; \ + double fp21 = 21.0; \ + double fp22 = 22.0; \ + double fp23 = 23.0; \ + double fp24 = 24.0; \ + double fp25 = 25.0; \ + double fp26 = 26.0; \ + double fp27 = 27.0; \ + double fp28 = 28.0; \ + double fp29 = 29.0; \ + double fp30 = 30.0; \ + double fp31 = 31.0; \ + double fp32 = 32.0 #define FP_LOAD( _factor ) \ - do { \ - fp01 += _factor; \ - fp02 += _factor; \ - fp03 += _factor; \ - fp04 += _factor; \ - fp05 += _factor; \ - fp06 += _factor; \ - fp07 += _factor; \ - fp08 += _factor; \ - fp09 += _factor; \ - fp10 += _factor; \ - fp11 += _factor; \ - fp12 += _factor; \ - fp13 += _factor; \ - fp14 += _factor; \ - fp15 += _factor; \ - fp16 += _factor; \ - fp17 += _factor; \ - fp18 += _factor; \ - fp19 += _factor; \ - fp20 += _factor; \ - fp21 += _factor; \ - fp22 += _factor; \ - fp23 += _factor; \ - fp24 += _factor; \ - fp25 += _factor; \ - fp26 += _factor; \ - fp27 += _factor; \ - fp28 += _factor; \ - fp29 += _factor; \ - fp30 += _factor; \ - fp31 += _factor; \ - fp32 += _factor; \ - } while (0) + do { \ + fp01 += _factor; \ + fp02 += _factor; \ + fp03 += _factor; \ + fp04 += _factor; \ + fp05 += _factor; \ + fp06 += _factor; \ + fp07 += _factor; \ + fp08 += _factor; \ + fp09 += _factor; \ + fp10 += _factor; \ + fp11 += _factor; \ + fp12 += _factor; \ + fp13 += _factor; \ + fp14 += _factor; \ + fp15 += _factor; \ + fp16 += _factor; \ + fp17 += _factor; \ + fp18 += _factor; \ + fp19 += _factor; \ + fp20 += _factor; \ + fp21 += _factor; \ + fp22 += _factor; \ + fp23 += _factor; \ + fp24 += _factor; \ + fp25 += _factor; \ + fp26 += _factor; \ + fp27 += _factor; \ + fp28 += _factor; \ + fp29 += _factor; \ + fp30 += _factor; \ + fp31 += _factor; \ + fp32 += _factor; \ + } while ( 0 ) -#define EPSILON (0.0005) -#define FPABS(d) (((d) < 0.0) ? -(d) : (d)) -#define FPNEQ(a,b) (FPABS((a)-(b)) > EPSILON) +#define EPSILON ( 0.0005 ) +#define FPABS( d ) ( ( ( d ) < 0.0 ) ? -( d ) : ( d ) ) +#define FPNEQ( a, b ) ( FPABS( ( a ) - ( b ) ) > EPSILON ) -#define FP_CHECK_ONE( _v, _base, _factor ) \ - if ( FPNEQ( (_v), ((_base) + (_factor)) ) ) { \ - printf("%" PRIu32 ": " #_v " wrong -- (%g not %g)\n", \ - task_index, (_v), (_base + _factor)); \ - } +#define FP_CHECK_ONE( _v, _base, _factor ) \ + if ( FPNEQ( ( _v ), ( ( _base ) + ( _factor ) ) ) ) { \ + printf( \ + "%" PRIu32 ": " #_v " wrong -- (%g not %g)\n", \ + task_index, \ + ( _v ), \ + ( _base + _factor ) \ + ); \ + } - -#define FP_CHECK( _factor ) \ - do { \ - FP_CHECK_ONE( fp01, 1.0, (_factor) ); \ - FP_CHECK_ONE( fp02, 2.0, (_factor) ); \ - FP_CHECK_ONE( fp03, 3.0, (_factor) ); \ - FP_CHECK_ONE( fp04, 4.0, (_factor) ); \ - FP_CHECK_ONE( fp05, 5.0, (_factor) ); \ - FP_CHECK_ONE( fp06, 6.0, (_factor) ); \ - FP_CHECK_ONE( fp07, 7.0, (_factor) ); \ - FP_CHECK_ONE( fp08, 8.0, (_factor) ); \ - FP_CHECK_ONE( fp09, 9.0, (_factor) ); \ - FP_CHECK_ONE( fp10, 10.0, (_factor) ); \ - FP_CHECK_ONE( fp11, 11.0, (_factor) ); \ - FP_CHECK_ONE( fp12, 12.0, (_factor) ); \ - FP_CHECK_ONE( fp13, 13.0, (_factor) ); \ - FP_CHECK_ONE( fp14, 14.0, (_factor) ); \ - FP_CHECK_ONE( fp15, 15.0, (_factor) ); \ - FP_CHECK_ONE( fp16, 16.0, (_factor) ); \ - FP_CHECK_ONE( fp17, 17.0, (_factor) ); \ - FP_CHECK_ONE( fp18, 18.0, (_factor) ); \ - FP_CHECK_ONE( fp19, 19.0, (_factor) ); \ - FP_CHECK_ONE( fp20, 20.0, (_factor) ); \ - FP_CHECK_ONE( fp21, 21.0, (_factor) ); \ - FP_CHECK_ONE( fp22, 22.0, (_factor) ); \ - FP_CHECK_ONE( fp23, 23.0, (_factor) ); \ - FP_CHECK_ONE( fp24, 24.0, (_factor) ); \ - FP_CHECK_ONE( fp25, 25.0, (_factor) ); \ - FP_CHECK_ONE( fp26, 26.0, (_factor) ); \ - FP_CHECK_ONE( fp27, 27.0, (_factor) ); \ - FP_CHECK_ONE( fp28, 28.0, (_factor) ); \ - FP_CHECK_ONE( fp29, 29.0, (_factor) ); \ - FP_CHECK_ONE( fp30, 30.0, (_factor) ); \ - FP_CHECK_ONE( fp31, 31.0, (_factor) ); \ - FP_CHECK_ONE( fp32, 32.0, (_factor) ); \ - } while (0) +#define FP_CHECK( _factor ) \ + do { \ + FP_CHECK_ONE( fp01, 1.0, ( _factor ) ); \ + FP_CHECK_ONE( fp02, 2.0, ( _factor ) ); \ + FP_CHECK_ONE( fp03, 3.0, ( _factor ) ); \ + FP_CHECK_ONE( fp04, 4.0, ( _factor ) ); \ + FP_CHECK_ONE( fp05, 5.0, ( _factor ) ); \ + FP_CHECK_ONE( fp06, 6.0, ( _factor ) ); \ + FP_CHECK_ONE( fp07, 7.0, ( _factor ) ); \ + FP_CHECK_ONE( fp08, 8.0, ( _factor ) ); \ + FP_CHECK_ONE( fp09, 9.0, ( _factor ) ); \ + FP_CHECK_ONE( fp10, 10.0, ( _factor ) ); \ + FP_CHECK_ONE( fp11, 11.0, ( _factor ) ); \ + FP_CHECK_ONE( fp12, 12.0, ( _factor ) ); \ + FP_CHECK_ONE( fp13, 13.0, ( _factor ) ); \ + FP_CHECK_ONE( fp14, 14.0, ( _factor ) ); \ + FP_CHECK_ONE( fp15, 15.0, ( _factor ) ); \ + FP_CHECK_ONE( fp16, 16.0, ( _factor ) ); \ + FP_CHECK_ONE( fp17, 17.0, ( _factor ) ); \ + FP_CHECK_ONE( fp18, 18.0, ( _factor ) ); \ + FP_CHECK_ONE( fp19, 19.0, ( _factor ) ); \ + FP_CHECK_ONE( fp20, 20.0, ( _factor ) ); \ + FP_CHECK_ONE( fp21, 21.0, ( _factor ) ); \ + FP_CHECK_ONE( fp22, 22.0, ( _factor ) ); \ + FP_CHECK_ONE( fp23, 23.0, ( _factor ) ); \ + FP_CHECK_ONE( fp24, 24.0, ( _factor ) ); \ + FP_CHECK_ONE( fp25, 25.0, ( _factor ) ); \ + FP_CHECK_ONE( fp26, 26.0, ( _factor ) ); \ + FP_CHECK_ONE( fp27, 27.0, ( _factor ) ); \ + FP_CHECK_ONE( fp28, 28.0, ( _factor ) ); \ + FP_CHECK_ONE( fp29, 29.0, ( _factor ) ); \ + FP_CHECK_ONE( fp30, 30.0, ( _factor ) ); \ + FP_CHECK_ONE( fp31, 31.0, ( _factor ) ); \ + FP_CHECK_ONE( fp32, 32.0, ( _factor ) ); \ + } while ( 0 ) #endif diff --git a/testsuites/tmtests/tm26/system.h b/testsuites/tmtests/tm26/system.h index d66dfa81dd..b44a04cf35 100644 --- a/testsuites/tmtests/tm26/system.h +++ b/testsuites/tmtests/tm26/system.h @@ -29,14 +29,11 @@ * POSSIBILITY OF SUCH DAMAGE. */ - #include /* functions */ -rtems_task Init( - rtems_task_argument argument -); +rtems_task Init( rtems_task_argument argument ); #include @@ -45,11 +42,11 @@ rtems_task Init( #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER -#define CONFIGURE_MAXIMUM_TASKS (6 + OPERATION_COUNT) -#define CONFIGURE_MAXIMUM_SEMAPHORES 1 +#define CONFIGURE_MAXIMUM_TASKS ( 6 + OPERATION_COUNT ) +#define CONFIGURE_MAXIMUM_SEMAPHORES 1 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE -#define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_FLOATING_POINT +#define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_FLOATING_POINT #define CONFIGURE_SCHEDULER_PRIORITY diff --git a/testsuites/tmtests/tm26/task1.c b/testsuites/tmtests/tm26/task1.c index a73fd96837..77ff1172a3 100644 --- a/testsuites/tmtests/tm26/task1.c +++ b/testsuites/tmtests/tm26/task1.c @@ -26,7 +26,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#if !defined(OPERATION_COUNT) +#if !defined( OPERATION_COUNT ) #define OPERATION_COUNT 100 #endif @@ -54,59 +54,47 @@ const char rtems_test_name[] = "TIME TEST 26"; /* TEST DATA */ rtems_id Semaphore_id; -Thread_Control *Middle_tcb; /* uses internal RTEMS type */ +Thread_Control *Middle_tcb; /* uses internal RTEMS type */ -Thread_Control *Low_tcb; /* uses internal RTEMS type */ +Thread_Control *Low_tcb; /* uses internal RTEMS type */ /* * Variables to hold execution times until they are printed * at the end of the test. */ -uint32_t isr_disable_time; -uint32_t isr_flash_time; -uint32_t isr_enable_time; -uint32_t thread_disable_dispatch_time; -uint32_t thread_enable_dispatch_time; -uint32_t thread_set_state_time; -uint32_t thread_dispatch_no_fp_time; -uint32_t context_switch_no_fp_time; -uint32_t context_switch_self_time; -uint32_t context_switch_another_task_time; -uint32_t context_switch_restore_1st_fp_time; -uint32_t context_switch_save_idle_restore_initted_time; -uint32_t context_switch_save_restore_idle_time; -uint32_t context_switch_save_restore_initted_time; -uint32_t thread_resume_time; -uint32_t thread_unblock_time; -uint32_t thread_ready_time; -uint32_t thread_get_time; -uint32_t semaphore_get_time; -uint32_t thread_get_invalid_time; +uint32_t isr_disable_time; +uint32_t isr_flash_time; +uint32_t isr_enable_time; +uint32_t thread_disable_dispatch_time; +uint32_t thread_enable_dispatch_time; +uint32_t thread_set_state_time; +uint32_t thread_dispatch_no_fp_time; +uint32_t context_switch_no_fp_time; +uint32_t context_switch_self_time; +uint32_t context_switch_another_task_time; +uint32_t context_switch_restore_1st_fp_time; +uint32_t context_switch_save_idle_restore_initted_time; +uint32_t context_switch_save_restore_idle_time; +uint32_t context_switch_save_restore_initted_time; +uint32_t thread_resume_time; +uint32_t thread_unblock_time; +uint32_t thread_ready_time; +uint32_t thread_get_time; +uint32_t semaphore_get_time; +uint32_t thread_get_invalid_time; -rtems_task null_task( - rtems_task_argument argument -); +rtems_task null_task( rtems_task_argument argument ); -rtems_task High_task( - rtems_task_argument argument -); +rtems_task High_task( rtems_task_argument argument ); -rtems_task Middle_task( - rtems_task_argument argument -); +rtems_task Middle_task( rtems_task_argument argument ); -rtems_task Low_task( - rtems_task_argument argument -); +rtems_task Low_task( rtems_task_argument argument ); -rtems_task Floating_point_task_1( - rtems_task_argument argument -); +rtems_task Floating_point_task_1( rtems_task_argument argument ); -rtems_task Floating_point_task_2( - rtems_task_argument argument -); +rtems_task Floating_point_task_2( rtems_task_argument argument ); void complete_test( void ); @@ -154,39 +142,35 @@ static void thread_resume( Thread_Control *thread ) _Thread_Clear_state( thread, STATES_SUSPENDED ); } -rtems_task null_task( - rtems_task_argument argument -) +rtems_task null_task( rtems_task_argument argument ) { (void) argument; } -rtems_task Init( - rtems_task_argument argument -) +rtems_task Init( rtems_task_argument argument ) { (void) argument; - uint32_t index; + uint32_t index; rtems_id task_id; rtems_status_code status; - rtems_print_printer_fprintf_putc(&rtems_test_printer); + rtems_print_printer_fprintf_putc( &rtems_test_printer ); Print_Warning(); TEST_BEGIN(); if ( - _Scheduler_Table[ 0 ].Operations.initialize - != _Scheduler_priority_Initialize + _Scheduler_Table[ 0 ].Operations.initialize != + _Scheduler_priority_Initialize ) { - puts(" Error ==> " ); - puts("Test only supported for deterministic priority scheduler\n" ); + puts( " Error ==> " ); + puts( "Test only supported for deterministic priority scheduler\n" ); TEST_END(); rtems_test_exit( 0 ); } -#define FP1_PRIORITY (RTEMS_MAXIMUM_PRIORITY - 3u) /* 201, */ +#define FP1_PRIORITY ( RTEMS_MAXIMUM_PRIORITY - 3u ) /* 201, */ status = rtems_task_create( rtems_build_name( 'F', 'P', '1', ' ' ), FP1_PRIORITY, @@ -200,7 +184,7 @@ rtems_task Init( status = rtems_task_start( task_id, Floating_point_task_1, 0 ); directive_failed( status, "rtems_task_start of FP1" ); -#define FP2_PRIORITY (RTEMS_MAXIMUM_PRIORITY - 2u) /* 202, */ +#define FP2_PRIORITY ( RTEMS_MAXIMUM_PRIORITY - 2u ) /* 202, */ status = rtems_task_create( rtems_build_name( 'F', 'P', '2', ' ' ), FP2_PRIORITY, @@ -214,7 +198,7 @@ rtems_task Init( status = rtems_task_start( task_id, Floating_point_task_2, 0 ); directive_failed( status, "rtems_task_start of FP2" ); -#define LOW_PRIORITY (RTEMS_MAXIMUM_PRIORITY - 4u) /* 200, */ +#define LOW_PRIORITY ( RTEMS_MAXIMUM_PRIORITY - 4u ) /* 200, */ status = rtems_task_create( rtems_build_name( 'L', 'O', 'W', ' ' ), LOW_PRIORITY, @@ -228,7 +212,7 @@ rtems_task Init( status = rtems_task_start( task_id, Low_task, 0 ); directive_failed( status, "rtems_task_start of LOW" ); -#define MIDDLE_PRIORITY (RTEMS_MAXIMUM_PRIORITY - 5u) /* 128, */ +#define MIDDLE_PRIORITY ( RTEMS_MAXIMUM_PRIORITY - 5u ) /* 128, */ status = rtems_task_create( rtems_build_name( 'M', 'I', 'D', ' ' ), MIDDLE_PRIORITY, @@ -264,10 +248,10 @@ rtems_task Init( ); directive_failed( status, "rtems_semaphore_create" ); - for ( index = 1 ; index <= OPERATION_COUNT ; index++ ) { + for ( index = 1; index <= OPERATION_COUNT; index++ ) { status = rtems_task_create( rtems_build_name( 'N', 'U', 'L', 'L' ), - RTEMS_MAXIMUM_PRIORITY - 1u, /* 254, */ + RTEMS_MAXIMUM_PRIORITY - 1u, /* 254, */ RTEMS_MINIMUM_STACK_SIZE, RTEMS_DEFAULT_MODES, RTEMS_DEFAULT_ATTRIBUTES, @@ -282,9 +266,7 @@ rtems_task Init( rtems_task_exit(); } -rtems_task High_task( - rtems_task_argument argument -) +rtems_task High_task( rtems_task_argument argument ) { (void) argument; @@ -293,60 +275,60 @@ rtems_task High_task( _Thread_Dispatch_disable(); benchmark_timer_initialize(); - rtems_interrupt_local_disable( level ); + rtems_interrupt_local_disable( level ); isr_disable_time = benchmark_timer_read(); benchmark_timer_initialize(); -#if defined(RTEMS_SMP) - rtems_interrupt_local_enable( level ); - rtems_interrupt_local_disable( level ); +#if defined( RTEMS_SMP ) + rtems_interrupt_local_enable( level ); + rtems_interrupt_local_disable( level ); #else - rtems_interrupt_flash( level ); + rtems_interrupt_flash( level ); #endif isr_flash_time = benchmark_timer_read(); benchmark_timer_initialize(); - rtems_interrupt_local_enable( level ); + rtems_interrupt_local_enable( level ); isr_enable_time = benchmark_timer_read(); _Thread_Dispatch_enable( _Per_CPU_Get() ); benchmark_timer_initialize(); - _Thread_Dispatch_disable(); + _Thread_Dispatch_disable(); thread_disable_dispatch_time = benchmark_timer_read(); benchmark_timer_initialize(); - _Thread_Dispatch_enable( _Per_CPU_Get() ); + _Thread_Dispatch_enable( _Per_CPU_Get() ); thread_enable_dispatch_time = benchmark_timer_read(); benchmark_timer_initialize(); - _Thread_Set_state( _Thread_Get_executing(), STATES_SUSPENDED ); + _Thread_Set_state( _Thread_Get_executing(), STATES_SUSPENDED ); thread_set_state_time = benchmark_timer_read(); set_thread_dispatch_necessary( true ); benchmark_timer_initialize(); - _Thread_Dispatch(); /* dispatches Middle_task */ + _Thread_Dispatch(); /* dispatches Middle_task */ } -rtems_task Middle_task( - rtems_task_argument argument -) +rtems_task Middle_task( rtems_task_argument argument ) { (void) argument; - Scheduler_priority_Context *scheduler_context = - _Scheduler_priority_Get_context( _Thread_Scheduler_get_home( _Thread_Get_executing() ) ); + Scheduler_priority_Context + *scheduler_context = _Scheduler_priority_Get_context( + _Thread_Scheduler_get_home( _Thread_Get_executing() ) + ); thread_dispatch_no_fp_time = benchmark_timer_read(); _Thread_Set_state( _Thread_Get_executing(), STATES_SUSPENDED ); - Middle_tcb = _Thread_Get_executing(); + Middle_tcb = _Thread_Get_executing(); - set_thread_executing( - (Thread_Control *) _Chain_First(&scheduler_context->Ready[LOW_PRIORITY]) - ); + set_thread_executing( (Thread_Control *) _Chain_First( + &scheduler_context->Ready[ LOW_PRIORITY ] + ) ); /* do not force context switch */ @@ -355,43 +337,43 @@ rtems_task Middle_task( _Thread_Dispatch_disable(); benchmark_timer_initialize(); - _Context_Switch( - &Middle_tcb->Registers, - &_Thread_Get_executing()->Registers - ); + _Context_Switch( + &Middle_tcb->Registers, + &_Thread_Get_executing()->Registers + ); benchmark_timer_initialize(); - _Context_Switch(&Middle_tcb->Registers, &Low_tcb->Registers); + _Context_Switch( &Middle_tcb->Registers, &Low_tcb->Registers ); } -rtems_task Low_task( - rtems_task_argument argument -) +rtems_task Low_task( rtems_task_argument argument ) { (void) argument; - Scheduler_priority_Context *scheduler_context = - _Scheduler_priority_Get_context( _Thread_Scheduler_get_home( _Thread_Get_executing() ) ); - Thread_Control *executing; + Scheduler_priority_Context + *scheduler_context = _Scheduler_priority_Get_context( + _Thread_Scheduler_get_home( _Thread_Get_executing() ) + ); + Thread_Control *executing; context_switch_no_fp_time = benchmark_timer_read(); - executing = _Thread_Get_executing(); + executing = _Thread_Get_executing(); Low_tcb = executing; benchmark_timer_initialize(); - _Context_Switch( &executing->Registers, &executing->Registers ); + _Context_Switch( &executing->Registers, &executing->Registers ); context_switch_self_time = benchmark_timer_read(); - _Context_Switch(&executing->Registers, &Middle_tcb->Registers); + _Context_Switch( &executing->Registers, &Middle_tcb->Registers ); context_switch_another_task_time = benchmark_timer_read(); - set_thread_executing( - (Thread_Control *) _Chain_First(&scheduler_context->Ready[FP1_PRIORITY]) - ); + set_thread_executing( (Thread_Control *) _Chain_First( + &scheduler_context->Ready[ FP1_PRIORITY ] + ) ); /* do not force context switch */ @@ -400,30 +382,30 @@ rtems_task Low_task( _Thread_Dispatch_disable(); benchmark_timer_initialize(); - _Context_Switch( - &executing->Registers, - &_Thread_Get_executing()->Registers - ); + _Context_Switch( + &executing->Registers, + &_Thread_Get_executing()->Registers + ); } -rtems_task Floating_point_task_1( - rtems_task_argument argument -) +rtems_task Floating_point_task_1( rtems_task_argument argument ) { (void) argument; - Scheduler_priority_Context *scheduler_context = - _Scheduler_priority_Get_context( _Thread_Scheduler_get_home( _Thread_Get_executing() ) ); - Thread_Control *executing; + Scheduler_priority_Context + *scheduler_context = _Scheduler_priority_Get_context( + _Thread_Scheduler_get_home( _Thread_Get_executing() ) + ); + Thread_Control *executing; FP_DECLARE; context_switch_restore_1st_fp_time = benchmark_timer_read(); executing = _Thread_Get_executing(); - set_thread_executing( - (Thread_Control *) _Chain_First(&scheduler_context->Ready[FP2_PRIORITY]) - ); + set_thread_executing( (Thread_Control *) _Chain_First( + &scheduler_context->Ready[ FP2_PRIORITY ] + ) ); /* do not force context switch */ @@ -432,14 +414,14 @@ rtems_task Floating_point_task_1( _Thread_Dispatch_disable(); benchmark_timer_initialize(); -#if (CPU_HARDWARE_FP == 1) || (CPU_SOFTWARE_FP == 1) - _Context_Save_fp( &executing->fp_context ); - _Context_Restore_fp( &_Thread_Get_executing()->fp_context ); +#if ( CPU_HARDWARE_FP == 1 ) || ( CPU_SOFTWARE_FP == 1 ) + _Context_Save_fp( &executing->fp_context ); + _Context_Restore_fp( &_Thread_Get_executing()->fp_context ); #endif - _Context_Switch( - &executing->Registers, - &_Thread_Get_executing()->Registers - ); + _Context_Switch( + &executing->Registers, + &_Thread_Get_executing()->Registers + ); /* switch to Floating_point_task_2 */ context_switch_save_idle_restore_initted_time = benchmark_timer_read(); @@ -448,52 +430,52 @@ rtems_task Floating_point_task_1( executing = _Thread_Get_executing(); - set_thread_executing( - (Thread_Control *) _Chain_First(&scheduler_context->Ready[FP2_PRIORITY]) - ); + set_thread_executing( (Thread_Control *) _Chain_First( + &scheduler_context->Ready[ FP2_PRIORITY ] + ) ); benchmark_timer_initialize(); -#if (CPU_HARDWARE_FP == 1) || (CPU_SOFTWARE_FP == 1) - _Context_Save_fp( &executing->fp_context ); - _Context_Restore_fp( &_Thread_Get_executing()->fp_context ); +#if ( CPU_HARDWARE_FP == 1 ) || ( CPU_SOFTWARE_FP == 1 ) + _Context_Save_fp( &executing->fp_context ); + _Context_Restore_fp( &_Thread_Get_executing()->fp_context ); #endif - _Context_Switch( - &executing->Registers, - &_Thread_Get_executing()->Registers - ); + _Context_Switch( + &executing->Registers, + &_Thread_Get_executing()->Registers + ); /* switch to Floating_point_task_2 */ } -rtems_task Floating_point_task_2( - rtems_task_argument argument -) +rtems_task Floating_point_task_2( rtems_task_argument argument ) { (void) argument; - Scheduler_priority_Context *scheduler_context = - _Scheduler_priority_Get_context( _Thread_Scheduler_get_home( _Thread_Get_executing() ) ); - Thread_Control *executing; + Scheduler_priority_Context + *scheduler_context = _Scheduler_priority_Get_context( + _Thread_Scheduler_get_home( _Thread_Get_executing() ) + ); + Thread_Control *executing; FP_DECLARE; context_switch_save_restore_idle_time = benchmark_timer_read(); executing = _Thread_Get_executing(); - set_thread_executing( - (Thread_Control *) _Chain_First(&scheduler_context->Ready[FP1_PRIORITY]) - ); + set_thread_executing( (Thread_Control *) _Chain_First( + &scheduler_context->Ready[ FP1_PRIORITY ] + ) ); FP_LOAD( 1.0 ); benchmark_timer_initialize(); -#if (CPU_HARDWARE_FP == 1) || (CPU_SOFTWARE_FP == 1) - _Context_Save_fp( &executing->fp_context ); - _Context_Restore_fp( &_Thread_Get_executing()->fp_context ); +#if ( CPU_HARDWARE_FP == 1 ) || ( CPU_SOFTWARE_FP == 1 ) + _Context_Save_fp( &executing->fp_context ); + _Context_Restore_fp( &_Thread_Get_executing()->fp_context ); #endif - _Context_Switch( - &executing->Registers, - &_Thread_Get_executing()->Registers - ); + _Context_Switch( + &executing->Registers, + &_Thread_Get_executing()->Registers + ); /* switch to Floating_point_task_1 */ context_switch_save_restore_initted_time = benchmark_timer_read(); @@ -509,47 +491,48 @@ void complete_test( void ) Thread_queue_Context queue_context; benchmark_timer_initialize(); - thread_resume( Middle_tcb ); + thread_resume( Middle_tcb ); thread_resume_time = benchmark_timer_read(); _Thread_Set_state( Middle_tcb, STATES_WAITING_FOR_MESSAGE ); benchmark_timer_initialize(); - _Thread_Unblock( Middle_tcb ); + _Thread_Unblock( Middle_tcb ); thread_unblock_time = benchmark_timer_read(); _Thread_Set_state( Middle_tcb, STATES_WAITING_FOR_MESSAGE ); benchmark_timer_initialize(); - _Thread_Clear_state( Middle_tcb, STATES_WAITING_FOR_MESSAGE ); + _Thread_Clear_state( Middle_tcb, STATES_WAITING_FOR_MESSAGE ); thread_ready_time = benchmark_timer_read(); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) benchmark_timer_empty_function(); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) benchmark_timer_empty_function(); + } overhead = benchmark_timer_read(); task_id = Middle_tcb->Object.id; benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) { - (void) _Thread_Get( task_id, &lock_context ); - _ISR_lock_ISR_enable( &lock_context ); - } + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) _Thread_Get( task_id, &lock_context ); + _ISR_lock_ISR_enable( &lock_context ); + } thread_get_time = benchmark_timer_read(); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) { - (void) _Semaphore_Get( Semaphore_id, &queue_context ); - _ISR_lock_ISR_enable( &queue_context.Lock_context.Lock_context ); - } + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) _Semaphore_Get( Semaphore_id, &queue_context ); + _ISR_lock_ISR_enable( &queue_context.Lock_context.Lock_context ); + } semaphore_get_time = benchmark_timer_read(); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) { - (void) _Thread_Get( 0x3, &lock_context ); - _ISR_lock_ISR_enable( &lock_context ); - } + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) _Thread_Get( 0x3, &lock_context ); + _ISR_lock_ISR_enable( &lock_context ); + } thread_get_invalid_time = benchmark_timer_read(); /* @@ -564,29 +547,11 @@ void complete_test( void ) * Now dump all the times */ - put_time( - "rtems interrupt: _ISR_Local_disable", - isr_disable_time, - 1, - 0, - 0 - ); + put_time( "rtems interrupt: _ISR_Local_disable", isr_disable_time, 1, 0, 0 ); - put_time( - "rtems interrupt: _ISR_Local_flash", - isr_flash_time, - 1, - 0, - 0 - ); + put_time( "rtems interrupt: _ISR_Local_flash", isr_flash_time, 1, 0, 0 ); - put_time( - "rtems interrupt: _ISR_Local_enable", - isr_enable_time, - 1, - 0, - 0 - ); + put_time( "rtems interrupt: _ISR_Local_enable", isr_enable_time, 1, 0, 0 ); put_time( "rtems internal: _Thread_Dispatch_disable", @@ -644,7 +609,7 @@ void complete_test( void ) 0 ); -#if (CPU_HARDWARE_FP == 1) || (CPU_SOFTWARE_FP == 1) +#if ( CPU_HARDWARE_FP == 1 ) || ( CPU_SOFTWARE_FP == 1 ) put_time( "rtems internal: fp context switch restore 1st FP task", context_switch_restore_1st_fp_time, @@ -677,38 +642,20 @@ void complete_test( void ) 0 ); #else - puts( - "rtems internal: fp context switch restore 1st FP task - NA\n" - "rtems internal: fp context switch save idle restore initialized - NA\n" - "rtems internal: fp context switch save idle restore idle - NA\n" - "rtems internal: fp context switch save initialized\n" - " restore initialized - NA" - ); + puts( + "rtems internal: fp context switch restore 1st FP task - NA\n" + "rtems internal: fp context switch save idle restore initialized - NA\n" + "rtems internal: fp context switch save idle restore idle - NA\n" + "rtems internal: fp context switch save initialized\n" + " restore initialized - NA" + ); #endif - put_time( - "rtems internal: _Thread_Resume", - thread_resume_time, - 1, - 0, - 0 - ); + put_time( "rtems internal: _Thread_Resume", thread_resume_time, 1, 0, 0 ); - put_time( - "rtems internal: _Thread_Unblock", - thread_unblock_time, - 1, - 0, - 0 - ); + put_time( "rtems internal: _Thread_Unblock", thread_unblock_time, 1, 0, 0 ); - put_time( - "rtems internal: _Thread_Ready", - thread_ready_time, - 1, - 0, - 0 - ); + put_time( "rtems internal: _Thread_Ready", thread_ready_time, 1, 0, 0 ); put_time( "rtems internal: _Thread_Get", diff --git a/testsuites/tmtests/tm27/system.h b/testsuites/tmtests/tm27/system.h index 4a2723bcd4..33ec04de8e 100644 --- a/testsuites/tmtests/tm27/system.h +++ b/testsuites/tmtests/tm27/system.h @@ -29,25 +29,22 @@ * POSSIBILITY OF SUCH DAMAGE. */ - #include /* functions */ -rtems_task Init( - rtems_task_argument argument -); +rtems_task Init( rtems_task_argument argument ); #include -rtems_id Task_id[ OPERATION_COUNT+1 ]; /* array of task ids */ +rtems_id Task_id[ OPERATION_COUNT + 1 ]; /* array of task ids */ /* configuration information */ #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER -#define CONFIGURE_MAXIMUM_TASKS 3 +#define CONFIGURE_MAXIMUM_TASKS 3 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE diff --git a/testsuites/tmtests/tm27/task1.c b/testsuites/tmtests/tm27/task1.c index 96317b3040..0426027560 100644 --- a/testsuites/tmtests/tm27/task1.c +++ b/testsuites/tmtests/tm27/task1.c @@ -48,28 +48,22 @@ const char rtems_test_name[] = "TIME TEST 27"; -rtems_task Task_1( - rtems_task_argument argument -); +rtems_task Task_1( rtems_task_argument argument ); -rtems_task Task_2( - rtems_task_argument argument -); +rtems_task Task_2( rtems_task_argument argument ); -volatile uint32_t Interrupt_occurred; -volatile uint32_t Interrupt_enter_time, Interrupt_enter_nested_time; -volatile uint32_t Interrupt_return_time, Interrupt_return_nested_time; -uint32_t Interrupt_nest; -uint32_t timer_overhead; +volatile uint32_t Interrupt_occurred; +volatile uint32_t Interrupt_enter_time, Interrupt_enter_nested_time; +volatile uint32_t Interrupt_return_time, Interrupt_return_nested_time; +uint32_t Interrupt_nest; +uint32_t timer_overhead; static void set_thread_executing( Thread_Control *thread ) { _Per_CPU_Get_snapshot()->executing = thread; } -rtems_task Init( - rtems_task_argument argument -) +rtems_task Init( rtems_task_argument argument ) { (void) argument; @@ -80,16 +74,16 @@ rtems_task Init( TEST_BEGIN(); if ( - _Scheduler_Table[ 0 ].Operations.initialize - != _Scheduler_priority_Initialize + _Scheduler_Table[ 0 ].Operations.initialize != + _Scheduler_priority_Initialize ) { - puts(" Error ==> " ); - puts("Test only supported for deterministic priority scheduler\n" ); + puts( " Error ==> " ); + puts( "Test only supported for deterministic priority scheduler\n" ); TEST_END(); rtems_test_exit( 0 ); } -#define LOW_PRIORITY (RTEMS_MAXIMUM_PRIORITY - 1u) +#define LOW_PRIORITY ( RTEMS_MAXIMUM_PRIORITY - 1u ) status = rtems_task_create( rtems_build_name( 'T', 'A', '1', ' ' ), LOW_PRIORITY, @@ -131,7 +125,6 @@ rtems_task Init( static void Isr_handler_inner( void ) { - /*enable_tracing();*/ Clear_tm27_intr(); switch ( Interrupt_nest ) { @@ -146,8 +139,8 @@ static void Isr_handler_inner( void ) benchmark_timer_initialize(); Cause_tm27_intr(); /* goes to a nested copy of Isr_handler */ -#if (MUST_WAIT_FOR_INTERRUPT == 1) - while ( Interrupt_occurred == 0 ); +#if ( MUST_WAIT_FOR_INTERRUPT == 1 ) + while ( Interrupt_occurred == 0 ); #endif Interrupt_return_nested_time = benchmark_timer_read(); break; @@ -173,15 +166,15 @@ static void Isr_handler( void *arg ) Isr_handler_inner(); } -rtems_task Task_1( - rtems_task_argument argument -) +rtems_task Task_1( rtems_task_argument argument ) { (void) argument; - Scheduler_priority_Context *scheduler_context = - _Scheduler_priority_Get_context( _Thread_Scheduler_get_home( _Thread_Get_executing() ) ); -#if defined(RTEMS_SMP) + Scheduler_priority_Context + *scheduler_context = _Scheduler_priority_Get_context( + _Thread_Scheduler_get_home( _Thread_Get_executing() ) + ); +#if defined( RTEMS_SMP ) rtems_interrupt_level level; #endif @@ -199,7 +192,7 @@ rtems_task Task_1( Cause_tm27_intr(); /* goes to Isr_handler */ -#if (MUST_WAIT_FOR_INTERRUPT == 1) +#if ( MUST_WAIT_FOR_INTERRUPT == 1 ) while ( Interrupt_occurred == 0 ); #endif Interrupt_return_time = benchmark_timer_read(); @@ -233,7 +226,7 @@ rtems_task Task_1( Cause_tm27_intr(); /* goes to Isr_handler */ -#if (MUST_WAIT_FOR_INTERRUPT == 1) +#if ( MUST_WAIT_FOR_INTERRUPT == 1 ) while ( Interrupt_occurred == 0 ); #endif Interrupt_return_time = benchmark_timer_read(); @@ -260,18 +253,18 @@ rtems_task Task_1( * Does a preempt .. not nested */ -#if defined(RTEMS_SMP) - _ISR_Local_disable(level); +#if defined( RTEMS_SMP ) + _ISR_Local_disable( level ); #endif - set_thread_executing( - (Thread_Control *) _Chain_First(&scheduler_context->Ready[LOW_PRIORITY]) - ); + set_thread_executing( (Thread_Control *) _Chain_First( + &scheduler_context->Ready[ LOW_PRIORITY ] + ) ); _Thread_Dispatch_necessary = 1; -#if defined(RTEMS_SMP) - _ISR_Local_enable(level); +#if defined( RTEMS_SMP ) + _ISR_Local_enable( level ); #endif Interrupt_occurred = 0; @@ -294,24 +287,22 @@ rtems_task Task_1( * has been violated. */ -rtems_task Task_2( - rtems_task_argument argument -) +rtems_task Task_2( rtems_task_argument argument ) { (void) argument; - Thread_Control *executing = _Thread_Get_executing(); + Thread_Control *executing = _Thread_Get_executing(); const Scheduler_Control *scheduler; Scheduler_priority_Context *scheduler_context; - ISR_lock_Context state_lock_context; - ISR_lock_Context scheduler_lock_context; + ISR_lock_Context state_lock_context; + ISR_lock_Context scheduler_lock_context; _Thread_State_acquire( executing, &state_lock_context ); scheduler = _Thread_Scheduler_get_home( executing ); scheduler_context = _Scheduler_priority_Get_context( scheduler ); _Thread_State_release( executing, &state_lock_context ); -#if (MUST_WAIT_FOR_INTERRUPT == 1) +#if ( MUST_WAIT_FOR_INTERRUPT == 1 ) while ( Interrupt_occurred == 0 ); #endif end_time = benchmark_timer_read(); @@ -341,9 +332,9 @@ rtems_task Task_2( _Thread_State_acquire( executing, &state_lock_context ); _Scheduler_Acquire_critical( scheduler, &scheduler_lock_context ); - set_thread_executing( - (Thread_Control *) _Chain_First(&scheduler_context->Ready[LOW_PRIORITY]) - ); + set_thread_executing( (Thread_Control *) _Chain_First( + &scheduler_context->Ready[ LOW_PRIORITY ] + ) ); _Thread_Dispatch_necessary = 1; @@ -351,5 +342,4 @@ rtems_task Task_2( _Thread_State_release( executing, &state_lock_context ); _Thread_Dispatch(); - } diff --git a/testsuites/tmtests/tm28/system.h b/testsuites/tmtests/tm28/system.h index bec8393510..2ab89ad2f4 100644 --- a/testsuites/tmtests/tm28/system.h +++ b/testsuites/tmtests/tm28/system.h @@ -29,26 +29,23 @@ * POSSIBILITY OF SUCH DAMAGE. */ - #include /* functions */ -rtems_task Init( - rtems_task_argument argument -); +rtems_task Init( rtems_task_argument argument ); #include -rtems_id Task_id[ OPERATION_COUNT+1 ]; /* array of task ids */ +rtems_id Task_id[ OPERATION_COUNT + 1 ]; /* array of task ids */ /* configuration information */ #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER -#define CONFIGURE_MAXIMUM_TASKS 2 -#define CONFIGURE_MAXIMUM_PORTS 1 +#define CONFIGURE_MAXIMUM_TASKS 2 +#define CONFIGURE_MAXIMUM_PORTS 1 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE diff --git a/testsuites/tmtests/tm28/task1.c b/testsuites/tmtests/tm28/task1.c index 358c4cccb6..5c8f278223 100644 --- a/testsuites/tmtests/tm28/task1.c +++ b/testsuites/tmtests/tm28/task1.c @@ -26,7 +26,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#if !defined(OPERATION_COUNT) +#if !defined( OPERATION_COUNT ) #define OPERATION_COUNT 100 #endif @@ -43,16 +43,12 @@ const char rtems_test_name[] = "TIME TEST 28"; rtems_id Port_id; -uint8_t Internal_area[ 256 ] CPU_STRUCTURE_ALIGNMENT; -uint8_t External_area[ 256 ] CPU_STRUCTURE_ALIGNMENT; +uint8_t Internal_area[ 256 ] CPU_STRUCTURE_ALIGNMENT; +uint8_t External_area[ 256 ] CPU_STRUCTURE_ALIGNMENT; -rtems_task Test_task( - rtems_task_argument argument -); +rtems_task Test_task( rtems_task_argument argument ); -rtems_task Init( - rtems_task_argument argument -) +rtems_task Init( rtems_task_argument argument ) { (void) argument; @@ -64,7 +60,7 @@ rtems_task Init( status = rtems_task_create( rtems_build_name( 'T', 'I', 'M', 'E' ), - (RTEMS_MAXIMUM_PRIORITY / 2u) + 1u, + ( RTEMS_MAXIMUM_PRIORITY / 2u ) + 1u, RTEMS_MINIMUM_STACK_SIZE, RTEMS_DEFAULT_MODES, RTEMS_DEFAULT_ATTRIBUTES, @@ -78,48 +74,36 @@ rtems_task Init( rtems_task_exit(); } -rtems_task Test_task ( - rtems_task_argument argument -) +rtems_task Test_task( rtems_task_argument argument ) { (void) argument; - rtems_name name; - uint32_t index; - void *converted; + rtems_name name; + uint32_t index; + void *converted; benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) benchmark_timer_empty_function(); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) benchmark_timer_empty_function(); + } overhead = benchmark_timer_read(); name = rtems_build_name( 'P', 'O', 'R', 'T' ), benchmark_timer_initialize(); - rtems_port_create( - name, - Internal_area, - External_area, - 0xff, - &Port_id - ); + rtems_port_create( name, Internal_area, External_area, 0xff, &Port_id ); end_time = benchmark_timer_read(); - put_time( - "rtems_port_create: only case", - end_time, - 1, - 0, - 0 - ); + put_time( "rtems_port_create: only case", end_time, 1, 0, 0 ); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_port_external_to_internal( - Port_id, - &External_area[ 0xf ], - &converted - ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) rtems_port_external_to_internal( + Port_id, + &External_area[ 0xf ], + &converted + ); + } end_time = benchmark_timer_read(); put_time( @@ -131,12 +115,13 @@ rtems_task Test_task ( ); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_port_internal_to_external( - Port_id, - &Internal_area[ 0xf ], - &converted - ); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) rtems_port_internal_to_external( + Port_id, + &Internal_area[ 0xf ], + &converted + ); + } end_time = benchmark_timer_read(); put_time( @@ -148,16 +133,10 @@ rtems_task Test_task ( ); benchmark_timer_initialize(); - rtems_port_delete( Port_id ); + rtems_port_delete( Port_id ); end_time = benchmark_timer_read(); - put_time( - "rtems_port_delete: only case", - end_time, - 1, - 0, - 0 - ); + put_time( "rtems_port_delete: only case", end_time, 1, 0, 0 ); TEST_END(); rtems_test_exit( 0 ); diff --git a/testsuites/tmtests/tm29/system.h b/testsuites/tmtests/tm29/system.h index 380878abb0..413b70febe 100644 --- a/testsuites/tmtests/tm29/system.h +++ b/testsuites/tmtests/tm29/system.h @@ -29,14 +29,11 @@ * POSSIBILITY OF SUCH DAMAGE. */ - #include /* functions */ -rtems_task Init( - rtems_task_argument argument -); +rtems_task Init( rtems_task_argument argument ); #include @@ -45,11 +42,11 @@ rtems_task Init( #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER -#define CONFIGURE_MAXIMUM_TASKS (2 + OPERATION_COUNT) -#define CONFIGURE_MAXIMUM_PERIODS OPERATION_COUNT +#define CONFIGURE_MAXIMUM_TASKS ( 2 + OPERATION_COUNT ) +#define CONFIGURE_MAXIMUM_PERIODS OPERATION_COUNT #define CONFIGURE_RTEMS_INIT_TASKS_TABLE -#define CONFIGURE_INIT_TASK_STACK_SIZE (RTEMS_MINIMUM_STACK_SIZE * 2) +#define CONFIGURE_INIT_TASK_STACK_SIZE ( RTEMS_MINIMUM_STACK_SIZE * 2 ) #include diff --git a/testsuites/tmtests/tm29/task1.c b/testsuites/tmtests/tm29/task1.c index 06ac968120..e671951a89 100644 --- a/testsuites/tmtests/tm29/task1.c +++ b/testsuites/tmtests/tm29/task1.c @@ -26,7 +26,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#if !defined(OPERATION_COUNT) +#if !defined( OPERATION_COUNT ) #define OPERATION_COUNT 100 #endif @@ -43,24 +43,18 @@ const char rtems_test_name[] = "TIME TEST 29"; rtems_name Period_name; -rtems_task Tasks( - rtems_task_argument argument -); +rtems_task Tasks( rtems_task_argument argument ); -rtems_task Low_task( - rtems_task_argument argument -); +rtems_task Low_task( rtems_task_argument argument ); -uint32_t Task_count; +uint32_t Task_count; -rtems_task Init( - rtems_task_argument argument -) +rtems_task Init( rtems_task_argument argument ) { (void) argument; rtems_id id; - uint32_t index; + uint32_t index; rtems_status_code status; Print_Warning(); @@ -70,19 +64,13 @@ rtems_task Init( Period_name = rtems_build_name( 'P', 'R', 'D', ' ' ); benchmark_timer_initialize(); - (void) rtems_rate_monotonic_create( Period_name, &id ); + (void) rtems_rate_monotonic_create( Period_name, &id ); end_time = benchmark_timer_read(); - put_time( - "rtems_rate_monotonic_create: only case", - end_time, - 1, - 0, - 0 - ); + put_time( "rtems_rate_monotonic_create: only case", end_time, 1, 0, 0 ); benchmark_timer_initialize(); - (void) rtems_rate_monotonic_period( id, 10 ); + (void) rtems_rate_monotonic_period( id, 10 ); end_time = benchmark_timer_read(); put_time( @@ -94,40 +82,22 @@ rtems_task Init( ); benchmark_timer_initialize(); - (void) rtems_rate_monotonic_period( id, RTEMS_PERIOD_STATUS ); + (void) rtems_rate_monotonic_period( id, RTEMS_PERIOD_STATUS ); end_time = benchmark_timer_read(); - put_time( - "rtems_rate_monotonic_period: obtain status", - end_time, - 1, - 0, - 0 - ); + put_time( "rtems_rate_monotonic_period: obtain status", end_time, 1, 0, 0 ); benchmark_timer_initialize(); - (void) rtems_rate_monotonic_cancel( id ); + (void) rtems_rate_monotonic_cancel( id ); end_time = benchmark_timer_read(); - put_time( - "rtems_rate_monotonic_cancel: only case", - end_time, - 1, - 0, - 0 - ); + put_time( "rtems_rate_monotonic_cancel: only case", end_time, 1, 0, 0 ); benchmark_timer_initialize(); - (void) rtems_rate_monotonic_delete( id ); + (void) rtems_rate_monotonic_delete( id ); end_time = benchmark_timer_read(); - put_time( - "rtems_rate_monotonic_delete: inactive", - end_time, - 1, - 0, - 0 - ); + put_time( "rtems_rate_monotonic_delete: inactive", end_time, 1, 0, 0 ); status = rtems_rate_monotonic_create( Period_name, &id ); directive_failed( status, "rtems_rate_monotonic_create" ); @@ -136,19 +106,13 @@ rtems_task Init( directive_failed( status, "rtems_rate_monotonic_period" ); benchmark_timer_initialize(); - rtems_rate_monotonic_delete( id ); + rtems_rate_monotonic_delete( id ); end_time = benchmark_timer_read(); - put_time( - "rtems_rate_monotonic_delete: active", - end_time, - 1, - 0, - 0 - ); + put_time( "rtems_rate_monotonic_delete: active", end_time, 1, 0, 0 ); -#define LOOP_TASK_PRIORITY ((RTEMS_MAXIMUM_PRIORITY / 2u) + 1u) - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) { +#define LOOP_TASK_PRIORITY ( ( RTEMS_MAXIMUM_PRIORITY / 2u ) + 1u ) + for ( index = 1; index <= OPERATION_COUNT; index++ ) { status = rtems_task_create( rtems_build_name( 'T', 'E', 'S', 'T' ), LOOP_TASK_PRIORITY, @@ -163,7 +127,7 @@ rtems_task Init( directive_failed( status, "rtems_task_start LOOP" ); } -#define MIDDLE_PRIORITY (RTEMS_MAXIMUM_PRIORITY - 2u) +#define MIDDLE_PRIORITY ( RTEMS_MAXIMUM_PRIORITY - 2u ) status = rtems_task_create( rtems_build_name( 'L', 'O', 'W', ' ' ), MIDDLE_PRIORITY, @@ -182,9 +146,7 @@ rtems_task Init( rtems_task_exit(); } -rtems_task Tasks( - rtems_task_argument argument -) +rtems_task Tasks( rtems_task_argument argument ) { (void) argument; @@ -207,25 +169,25 @@ rtems_task Tasks( Task_count++; - if ( Task_count == 1 ) + if ( Task_count == 1 ) { benchmark_timer_initialize(); + } (void) rtems_rate_monotonic_period( id, 100 ); } -rtems_task Low_task( - rtems_task_argument argument -) +rtems_task Low_task( rtems_task_argument argument ) { (void) argument; - uint32_t index; + uint32_t index; end_time = benchmark_timer_read(); benchmark_timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) benchmark_timer_empty_function(); + for ( index = 1; index <= OPERATION_COUNT; index++ ) { + (void) benchmark_timer_empty_function(); + } overhead = benchmark_timer_read(); put_time( diff --git a/testsuites/tmtests/tm30/init.c b/testsuites/tmtests/tm30/init.c index e885d4659f..21d924f1ed 100644 --- a/testsuites/tmtests/tm30/init.c +++ b/testsuites/tmtests/tm30/init.c @@ -26,7 +26,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#if !defined(OPERATION_COUNT) +#if !defined( OPERATION_COUNT ) #define OPERATION_COUNT 100 #endif @@ -43,14 +43,9 @@ const char rtems_test_name[] = "TIME TEST 30"; rtems_id barrier[ OPERATION_COUNT ]; -rtems_task Init( - rtems_task_argument argument -); +rtems_task Init( rtems_task_argument argument ); -static void benchmark_barrier_create( - int iteration, - void *argument -) +static void benchmark_barrier_create( int iteration, void *argument ) { (void) argument; @@ -60,41 +55,33 @@ static void benchmark_barrier_create( iteration + 1, RTEMS_LOCAL | RTEMS_FIFO, 2, - &barrier[iteration] + &barrier[ iteration ] ); - directive_failed(status, "rtems_barrier_create"); + directive_failed( status, "rtems_barrier_create" ); } -static void benchmark_barrier_ident( - int iteration, - void *argument -) +static void benchmark_barrier_ident( int iteration, void *argument ) { (void) argument; rtems_status_code status; rtems_id id; - status = rtems_barrier_ident( iteration+1, &id ); - directive_failed(status, "rtems_barrier_ident"); + status = rtems_barrier_ident( iteration + 1, &id ); + directive_failed( status, "rtems_barrier_ident" ); } -static void benchmark_barrier_delete( - int iteration, - void *argument -) +static void benchmark_barrier_delete( int iteration, void *argument ) { (void) argument; rtems_status_code status; - status = rtems_barrier_delete( barrier[iteration] ); - directive_failed(status, "rtems_barrier_delete"); + status = rtems_barrier_delete( barrier[ iteration ] ); + directive_failed( status, "rtems_barrier_delete" ); } -rtems_task Init( - rtems_task_argument argument -) +rtems_task Init( rtems_task_argument argument ) { (void) argument; @@ -126,7 +113,7 @@ rtems_task Init( TEST_END(); - rtems_test_exit(0); + rtems_test_exit( 0 ); } /* configuration information */ @@ -134,8 +121,8 @@ rtems_task Init( #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER -#define CONFIGURE_MAXIMUM_TASKS 1 -#define CONFIGURE_MAXIMUM_BARRIERS OPERATION_COUNT +#define CONFIGURE_MAXIMUM_TASKS 1 +#define CONFIGURE_MAXIMUM_BARRIERS OPERATION_COUNT #define CONFIGURE_RTEMS_INIT_TASKS_TABLE #define CONFIGURE_INIT diff --git a/testsuites/tmtests/tmck/system.h b/testsuites/tmtests/tmck/system.h index 6fad74389e..c64a767447 100644 --- a/testsuites/tmtests/tmck/system.h +++ b/testsuites/tmtests/tmck/system.h @@ -29,25 +29,22 @@ * POSSIBILITY OF SUCH DAMAGE. */ - #include /* functions */ -rtems_task Init( - rtems_task_argument argument -); +rtems_task Init( rtems_task_argument argument ); #include -rtems_name Task_name[ OPERATION_COUNT+1 ]; /* array of task names */ +rtems_name Task_name[ OPERATION_COUNT + 1 ]; /* array of task names */ /* configuration information */ #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER #define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER -#define CONFIGURE_MAXIMUM_TASKS 2 +#define CONFIGURE_MAXIMUM_TASKS 2 #define CONFIGURE_RTEMS_INIT_TASKS_TABLE diff --git a/testsuites/tmtests/tmck/task1.c b/testsuites/tmtests/tmck/task1.c index 19118fc2d5..9d7dfa135b 100644 --- a/testsuites/tmtests/tmck/task1.c +++ b/testsuites/tmtests/tmck/task1.c @@ -26,7 +26,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#if !defined(OPERATION_COUNT) +#if !defined( OPERATION_COUNT ) #define OPERATION_COUNT 100 #endif @@ -39,7 +39,7 @@ #define CONFIGURE_INIT #include "system.h" -#if !defined(MAXIMUM_DISTRIBUTION) +#if !defined( MAXIMUM_DISTRIBUTION ) #define MAXIMUM_DISTRIBUTION 1000 #endif @@ -47,15 +47,11 @@ const char rtems_test_name[] = "TIME CHECKER"; uint32_t Distribution[ MAXIMUM_DISTRIBUTION + 1 ]; -rtems_task Task_1( - rtems_task_argument argument -); +rtems_task Task_1( rtems_task_argument argument ); void check_read_timer( void ); -rtems_task Init( - rtems_task_argument argument -) +rtems_task Init( rtems_task_argument argument ) { (void) argument; @@ -74,14 +70,14 @@ rtems_task Init( Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' ), - status = rtems_task_create( - 1, - 5, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &id - ); + status = rtems_task_create( + 1, + 5, + RTEMS_MINIMUM_STACK_SIZE, + RTEMS_DEFAULT_MODES, + RTEMS_DEFAULT_ATTRIBUTES, + &id + ); directive_failed( status, "rtems_task_create of TA1" ); status = rtems_task_start( id, Task_1, 0 ); @@ -90,78 +86,50 @@ rtems_task Init( rtems_task_exit(); } -rtems_task Task_1( - rtems_task_argument argument -) +rtems_task Task_1( rtems_task_argument argument ) { (void) argument; - uint32_t index; + uint32_t index; check_read_timer(); benchmark_timer_initialize(); end_time = benchmark_timer_read(); - put_time( - "Time Check: NULL timer stopped at", - end_time, - 1, - 0, - 0 - ); + put_time( "Time Check: NULL timer stopped at", end_time, 1, 0, 0 ); benchmark_timer_initialize(); - for ( index = 1 ; index <= 1000 ; index++ ) + for ( index = 1; index <= 1000; index++ ) { (void) benchmark_timer_empty_function(); + } end_time = benchmark_timer_read(); - put_time( - "Time Check: LOOP (1000) timer stopped at", - end_time, - 1, - 0, - 0 - ); + put_time( "Time Check: LOOP (1000) timer stopped at", end_time, 1, 0, 0 ); benchmark_timer_initialize(); - for ( index = 1 ; index <= 10000 ; index++ ) + for ( index = 1; index <= 10000; index++ ) { (void) benchmark_timer_empty_function(); + } end_time = benchmark_timer_read(); - put_time( - "Time Check: LOOP (10000) timer stopped at", - end_time, - 1, - 0, - 0 - ); + put_time( "Time Check: LOOP (10000) timer stopped at", end_time, 1, 0, 0 ); benchmark_timer_initialize(); - for ( index = 1 ; index <= 50000 ; index++ ) + for ( index = 1; index <= 50000; index++ ) { (void) benchmark_timer_empty_function(); + } end_time = benchmark_timer_read(); - put_time( - "Time Check: LOOP (50000) timer stopped at", - end_time, - 1, - 0, - 0 - ); + put_time( "Time Check: LOOP (50000) timer stopped at", end_time, 1, 0, 0 ); benchmark_timer_initialize(); - for ( index = 1 ; index <= 100000 ; index++ ) + for ( index = 1; index <= 100000; index++ ) { (void) benchmark_timer_empty_function(); + } end_time = benchmark_timer_read(); - put_time( - "Time Check: LOOP (100000) timer stopped at", - end_time, - 1, - 0, - 0 - ); + put_time( "Time Check: LOOP (100000) timer stopped at", end_time, 1, 0, 0 ); TEST_END(); rtems_test_exit( 0 ); @@ -169,13 +137,14 @@ rtems_task Task_1( void check_read_timer() { - uint32_t index; - uint32_t time; + uint32_t index; + uint32_t time; - for ( index = 1 ; index <= MAXIMUM_DISTRIBUTION ; index++ ) + for ( index = 1; index <= MAXIMUM_DISTRIBUTION; index++ ) { Distribution[ index ] = 0; + } - for ( index = 1 ; index <= OPERATION_COUNT ; ) { + for ( index = 1; index <= OPERATION_COUNT; ) { benchmark_timer_initialize(); end_time = benchmark_timer_read(); if ( end_time > MAXIMUM_DISTRIBUTION ) { @@ -183,7 +152,11 @@ void check_read_timer() * Under UNIX a simple process swap takes longer than we * consider valid for our testing purposes. */ - printf( "TOO LONG (%" PRIu32 ") at index %" PRIu32 "!!!\n", end_time, index ); + printf( + "TOO LONG (%" PRIu32 ") at index %" PRIu32 "!!!\n", + end_time, + index + ); continue; } Distribution[ end_time ]++; @@ -192,10 +165,11 @@ void check_read_timer() printf( "Units may not be in microseconds for this test!!!\n" ); time = 0; - for ( index = 0 ; index <= MAXIMUM_DISTRIBUTION ; index++ ) { - time += (Distribution[ index ] * index); - if ( Distribution[ index ] != 0 ) + for ( index = 0; index <= MAXIMUM_DISTRIBUTION; index++ ) { + time += ( Distribution[ index ] * index ); + if ( Distribution[ index ] != 0 ) { printf( "%" PRId32 " %" PRId32 "\n", index, Distribution[ index ] ); + } } printf( "Total time = %" PRId32 "\n", time ); printf( "Average time = %" PRId32 "\n", time / OPERATION_COUNT ); diff --git a/testsuites/tmtests/tmcontext01/init.c b/testsuites/tmtests/tmcontext01/init.c index dfda2239c2..a21a2beaac 100644 --- a/testsuites/tmtests/tmcontext01/init.c +++ b/testsuites/tmtests/tmcontext01/init.c @@ -47,7 +47,7 @@ const char rtems_test_name[] = "TMCONTEXT 1"; -static rtems_counter_ticks t[SAMPLES]; +static rtems_counter_ticks t[ SAMPLES ]; static size_t cache_line_size; @@ -57,39 +57,41 @@ static volatile int *main_data; static Context_Control ctx; -static int dirty_data_cache(volatile int *data, size_t n, size_t clsz, int j) +static int dirty_data_cache( volatile int *data, size_t n, size_t clsz, int j ) { - size_t m = n / sizeof(*data); - size_t k = clsz / sizeof(*data); + size_t m = n / sizeof( *data ); + size_t k = clsz / sizeof( *data ); size_t i; - for (i = 0; i < m; i += k) { - data[i] = i + j; + for ( i = 0; i < m; i += k ) { + data[ i ] = i + j; } return i + j; } -static __attribute__((__noipa__)) void call_at_level( +static __attribute__(( __noipa__ )) void call_at_level( int start, int fl, int s ) { -#if defined(__sparc__) - if (fl == start) { +#if defined( __sparc__ ) + if ( fl == start ) { /* Flush register windows */ - __asm__ volatile ("ta 3" : : : "memory"); + __asm__ volatile( "ta 3" + : + : + : "memory" ); } #endif - if (fl > 0) { - call_at_level( - start, - fl - 1, - s - ); - __asm__ volatile ("" : : : "memory"); + if ( fl > 0 ) { + call_at_level( start, fl - 1, s ); + __asm__ volatile( "" + : + : + : "memory" ); } else { char *volatile space; rtems_counter_ticks a; @@ -98,31 +100,31 @@ static __attribute__((__noipa__)) void call_at_level( a = rtems_counter_read(); /* Ensure that we use an untouched stack area */ - space = alloca(1024); + space = alloca( 1024 ); (void) space; - _Context_Switch(&ctx, &ctx); + _Context_Switch( &ctx, &ctx ); b = rtems_counter_read(); - t[s] = rtems_counter_difference(b, a); + t[ s ] = rtems_counter_difference( b, a ); } } -static void load_task(rtems_task_argument arg) +static void load_task( rtems_task_argument arg ) { (void) arg; volatile int *load_data = (volatile int *) arg; - size_t n = data_size; - size_t clsz = cache_line_size; - int j = (int) rtems_scheduler_get_processor(); + size_t n = data_size; + size_t clsz = cache_line_size; + int j = (int) rtems_scheduler_get_processor(); - while (true) { - j = dirty_data_cache(load_data, n, clsz, j); + while ( true ) { + j = dirty_data_cache( load_data, n, clsz, j ); } } -static int cmp(const void *ap, const void *bp) +static int cmp( const void *ap, const void *bp ) { const rtems_counter_ticks *a = ap; const rtems_counter_ticks *b = bp; @@ -130,57 +132,61 @@ static int cmp(const void *ap, const void *bp) return *a - *b; } -static void sort_t(void) +static void sort_t( void ) { - qsort(&t[0], SAMPLES, sizeof(t[0]), cmp); + qsort( &t[ 0 ], SAMPLES, sizeof( t[ 0 ] ), cmp ); } -static __attribute__((__noipa__)) void test_by_function_level(int fl, bool dirty) +static __attribute__(( __noipa__ )) void test_by_function_level( + int fl, + bool dirty +) { - RTEMS_INTERRUPT_LOCK_DECLARE(, lock) + RTEMS_INTERRUPT_LOCK_DECLARE(, lock ) rtems_interrupt_lock_context lock_context; - int s; - uint64_t min; - uint64_t q1; - uint64_t q2; - uint64_t q3; - uint64_t max; + int s; + uint64_t min; + uint64_t q1; + uint64_t q2; + uint64_t q3; + uint64_t max; - rtems_interrupt_lock_initialize(&lock, "test"); - rtems_interrupt_lock_acquire(&lock, &lock_context); + rtems_interrupt_lock_initialize( &lock, "test" ); + rtems_interrupt_lock_acquire( &lock, &lock_context ); - for (s = 0; s < SAMPLES; ++s) { - if (dirty) { - dirty_data_cache(main_data, data_size, cache_line_size, fl); + for ( s = 0; s < SAMPLES; ++s ) { + if ( dirty ) { + dirty_data_cache( main_data, data_size, cache_line_size, fl ); rtems_cache_invalidate_entire_instruction(); } - call_at_level(fl, fl, s); + call_at_level( fl, fl, s ); } - rtems_interrupt_lock_release(&lock, &lock_context); - rtems_interrupt_lock_destroy(&lock); + rtems_interrupt_lock_release( &lock, &lock_context ); + rtems_interrupt_lock_destroy( &lock ); sort_t(); - min = t[0]; - q1 = t[(1 * SAMPLES) / 4]; - q2 = t[SAMPLES / 2]; - q3 = t[(3 * SAMPLES) / 4]; - max = t[SAMPLES - 1]; + min = t[ 0 ]; + q1 = t[ ( 1 * SAMPLES ) / 4 ]; + q2 = t[ SAMPLES / 2 ]; + q3 = t[ ( 3 * SAMPLES ) / 4 ]; + max = t[ SAMPLES - 1 ]; printf( - "%s\n [%" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 "]", + "%s\n [%" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 ", %" PRIu64 + "]", fl == 0 ? "" : ",", - rtems_counter_ticks_to_nanoseconds(min), - rtems_counter_ticks_to_nanoseconds(q1), - rtems_counter_ticks_to_nanoseconds(q2), - rtems_counter_ticks_to_nanoseconds(q3), - rtems_counter_ticks_to_nanoseconds(max) + rtems_counter_ticks_to_nanoseconds( min ), + rtems_counter_ticks_to_nanoseconds( q1 ), + rtems_counter_ticks_to_nanoseconds( q2 ), + rtems_counter_ticks_to_nanoseconds( q3 ), + rtems_counter_ticks_to_nanoseconds( max ) ); } -static void test(bool first, bool dirty, uint32_t load) +static void test( bool first, bool dirty, uint32_t load ) { int fl; @@ -190,14 +196,14 @@ static void test(bool first, bool dirty, uint32_t load) first ? "" : "}, " ); - if (dirty) { - if (load > 0) { - printf("Load/%" PRIu32 "", load); + if ( dirty ) { + if ( load > 0 ) { + printf( "Load/%" PRIu32 "", load ); } else { - printf("DirtyCache"); + printf( "DirtyCache" ); } } else { - printf("HotCache"); + printf( "HotCache" ); } printf( @@ -205,16 +211,14 @@ static void test(bool first, bool dirty, uint32_t load) " \"stats-by-function-nest-level\": [" ); - for (fl = 0; fl < FUNCTION_LEVELS; ++fl) { - test_by_function_level(fl, dirty); + for ( fl = 0; fl < FUNCTION_LEVELS; ++fl ) { + test_by_function_level( fl, dirty ); } - printf( - "\n ]" - ); + printf( "\n ]" ); } -static void Init(rtems_task_argument arg) +static void Init( rtems_task_argument arg ) { (void) arg; @@ -222,54 +226,54 @@ static void Init(rtems_task_argument arg) TEST_BEGIN(); - printf("*** BEGIN OF JSON DATA ***\n["); + printf( "*** BEGIN OF JSON DATA ***\n[" ); cache_line_size = rtems_cache_get_data_line_size(); - if (cache_line_size == 0) { + if ( cache_line_size == 0 ) { cache_line_size = 32; } - data_size = rtems_cache_get_data_cache_size(0); - if (data_size == 0) { + data_size = rtems_cache_get_data_cache_size( 0 ); + if ( data_size == 0 ) { data_size = cache_line_size; } - main_data = malloc(data_size); - rtems_test_assert(main_data != NULL); + main_data = malloc( data_size ); + rtems_test_assert( main_data != NULL ); - test(true, false, load); - test(false, true, load); + test( true, false, load ); + test( false, true, load ); - for (load = 1; load < rtems_scheduler_get_processor_maximum(); ++load) { + for ( load = 1; load < rtems_scheduler_get_processor_maximum(); ++load ) { rtems_status_code sc; - rtems_id id; - volatile int *load_data = NULL; + rtems_id id; + volatile int *load_data = NULL; - load_data = malloc(data_size); - if (load_data == NULL) { + load_data = malloc( data_size ); + if ( load_data == NULL ) { load_data = main_data; } sc = rtems_task_create( - rtems_build_name('L', 'O', 'A', 'D'), + rtems_build_name( 'L', 'O', 'A', 'D' ), 1, RTEMS_MINIMUM_STACK_SIZE, RTEMS_DEFAULT_MODES, RTEMS_DEFAULT_ATTRIBUTES, &id ); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); + rtems_test_assert( sc == RTEMS_SUCCESSFUL ); - sc = rtems_task_start(id, load_task, (rtems_task_argument) load_data); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); + sc = rtems_task_start( id, load_task, (rtems_task_argument) load_data ); + rtems_test_assert( sc == RTEMS_SUCCESSFUL ); - test(false, true, load); + test( false, true, load ); } - printf("\n }\n]\n*** END OF JSON DATA ***\n"); + printf( "\n }\n]\n*** END OF JSON DATA ***\n" ); TEST_END(); - rtems_test_exit(0); + rtems_test_exit( 0 ); } /* @@ -280,9 +284,9 @@ static void Init(rtems_task_argument arg) #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER -#define CONFIGURE_MAXIMUM_TASKS (1 + CPU_COUNT) +#define CONFIGURE_MAXIMUM_TASKS ( 1 + CPU_COUNT ) -#define CONFIGURE_INIT_TASK_STACK_SIZE (32 * 1024) +#define CONFIGURE_INIT_TASK_STACK_SIZE ( 32 * 1024 ) #define CONFIGURE_MAXIMUM_PROCESSORS CPU_COUNT diff --git a/testsuites/tmtests/tmfine01/init.c b/testsuites/tmtests/tmfine01/init.c index 119edd92e1..cc2cf63132 100644 --- a/testsuites/tmtests/tmfine01/init.c +++ b/testsuites/tmtests/tmfine01/init.c @@ -41,7 +41,7 @@ const char rtems_test_name[] = "TMFINE 1"; -#if defined(RTEMS_SMP) +#if defined( RTEMS_SMP ) #define CPU_COUNT 32 #else #define CPU_COUNT 1 @@ -55,36 +55,36 @@ typedef struct { typedef struct { rtems_test_parallel_context base; - const char *test_sep; - const char *counter_sep; - rtems_id master; - rtems_id sema; - rtems_id mq[CPU_COUNT]; - uint32_t self_event_ops[CPU_COUNT][CPU_COUNT]; - uint32_t all_to_one_event_ops[CPU_COUNT][CPU_COUNT]; - uint32_t one_mutex_ops[CPU_COUNT][CPU_COUNT]; - uint32_t many_mutex_ops[CPU_COUNT][CPU_COUNT]; - uint32_t self_msg_ops[CPU_COUNT][CPU_COUNT]; - uint32_t many_to_one_msg_ops[CPU_COUNT][CPU_COUNT]; - uint32_t many_sys_lock_mutex_ops[CPU_COUNT][CPU_COUNT]; - uint32_t many_classic_ceiling_ops[CPU_COUNT][CPU_COUNT]; - uint32_t many_classic_mrsp_ops[CPU_COUNT][CPU_COUNT]; - uint32_t many_pthread_spinlock_ops[CPU_COUNT][CPU_COUNT]; - uint32_t many_pthread_mutex_inherit_ops[CPU_COUNT][CPU_COUNT]; - uint32_t many_pthread_mutex_protect_ops[CPU_COUNT][CPU_COUNT]; + const char *test_sep; + const char *counter_sep; + rtems_id master; + rtems_id sema; + rtems_id mq[ CPU_COUNT ]; + uint32_t self_event_ops[ CPU_COUNT ][ CPU_COUNT ]; + uint32_t all_to_one_event_ops[ CPU_COUNT ][ CPU_COUNT ]; + uint32_t one_mutex_ops[ CPU_COUNT ][ CPU_COUNT ]; + uint32_t many_mutex_ops[ CPU_COUNT ][ CPU_COUNT ]; + uint32_t self_msg_ops[ CPU_COUNT ][ CPU_COUNT ]; + uint32_t many_to_one_msg_ops[ CPU_COUNT ][ CPU_COUNT ]; + uint32_t many_sys_lock_mutex_ops[ CPU_COUNT ][ CPU_COUNT ]; + uint32_t many_classic_ceiling_ops[ CPU_COUNT ][ CPU_COUNT ]; + uint32_t many_classic_mrsp_ops[ CPU_COUNT ][ CPU_COUNT ]; + uint32_t many_pthread_spinlock_ops[ CPU_COUNT ][ CPU_COUNT ]; + uint32_t many_pthread_mutex_inherit_ops[ CPU_COUNT ][ CPU_COUNT ]; + uint32_t many_pthread_mutex_protect_ops[ CPU_COUNT ][ CPU_COUNT ]; } test_context; static test_context test_instance; -static rtems_interval test_duration(void) +static rtems_interval test_duration( void ) { return rtems_clock_get_ticks_per_second(); } static rtems_interval test_init( rtems_test_parallel_context *base, - void *arg, - size_t active_workers + void *arg, + size_t active_workers ) { (void) base; @@ -96,16 +96,16 @@ static rtems_interval test_init( static void test_fini( test_context *ctx, - const char *type, - const char *description, - uint32_t *counters, - size_t active_workers + const char *type, + const char *description, + uint32_t *counters, + size_t active_workers ) { const char *value_sep; - size_t i; + size_t i; - if (active_workers == 1) { + if ( active_workers == 1 ) { printf( "%s{\n" " \"type\": \"%s\",\n" @@ -119,45 +119,41 @@ static void test_fini( ctx->counter_sep = "\n "; } - printf("%s[", ctx->counter_sep); + printf( "%s[", ctx->counter_sep ); ctx->counter_sep = "],\n "; value_sep = ""; - for (i = 0; i < active_workers; ++i) { - printf( - "%s%" PRIu32, - value_sep, - counters[i] - ); + for ( i = 0; i < active_workers; ++i ) { + printf( "%s%" PRIu32, value_sep, counters[ i ] ); value_sep = ", "; } - if (active_workers == rtems_scheduler_get_processor_maximum()) { - printf("]\n ]\n }"); + if ( active_workers == rtems_scheduler_get_processor_maximum() ) { + printf( "]\n ]\n }" ); } } static void test_self_event_body( rtems_test_parallel_context *base, - void *arg, - size_t active_workers, - size_t worker_index + void *arg, + size_t active_workers, + size_t worker_index ) { (void) arg; test_context *ctx = (test_context *) base; - rtems_id id = rtems_task_self(); - uint32_t counter = 0; + rtems_id id = rtems_task_self(); + uint32_t counter = 0; - while (!rtems_test_parallel_stop_job(&ctx->base)) { + while ( !rtems_test_parallel_stop_job( &ctx->base ) ) { rtems_status_code sc; - rtems_event_set out; + rtems_event_set out; ++counter; - sc = rtems_event_send(id, RTEMS_EVENT_0); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); + sc = rtems_event_send( id, RTEMS_EVENT_0 ); + rtems_test_assert( sc == RTEMS_SUCCESSFUL ); sc = rtems_event_receive( RTEMS_EVENT_0, @@ -165,16 +161,16 @@ static void test_self_event_body( RTEMS_NO_TIMEOUT, &out ); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); + rtems_test_assert( sc == RTEMS_SUCCESSFUL ); } - ctx->self_event_ops[active_workers - 1][worker_index] = counter; + ctx->self_event_ops[ active_workers - 1 ][ worker_index ] = counter; } static void test_self_event_fini( rtems_test_parallel_context *base, - void *arg, - size_t active_workers + void *arg, + size_t active_workers ) { (void) arg; @@ -185,34 +181,34 @@ static void test_self_event_fini( ctx, "event", "Send Event to Self", - &ctx->self_event_ops[active_workers - 1][0], + &ctx->self_event_ops[ active_workers - 1 ][ 0 ], active_workers ); } static void test_all_to_one_event_body( rtems_test_parallel_context *base, - void *arg, - size_t active_workers, - size_t worker_index + void *arg, + size_t active_workers, + size_t worker_index ) { (void) arg; test_context *ctx = (test_context *) base; - rtems_id id = rtems_task_self(); - bool is_master = rtems_test_parallel_is_master_worker(worker_index); + rtems_id id = rtems_task_self(); + bool is_master = rtems_test_parallel_is_master_worker( worker_index ); uint32_t counter = 0; - while (!rtems_test_parallel_stop_job(&ctx->base)) { + while ( !rtems_test_parallel_stop_job( &ctx->base ) ) { rtems_status_code sc; ++counter; - sc = rtems_event_send(id, RTEMS_EVENT_0); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); + sc = rtems_event_send( id, RTEMS_EVENT_0 ); + rtems_test_assert( sc == RTEMS_SUCCESSFUL ); - if (is_master) { + if ( is_master ) { rtems_event_set out; sc = rtems_event_receive( @@ -221,17 +217,17 @@ static void test_all_to_one_event_body( RTEMS_NO_TIMEOUT, &out ); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); + rtems_test_assert( sc == RTEMS_SUCCESSFUL ); } } - ctx->all_to_one_event_ops[active_workers - 1][worker_index] = counter; + ctx->all_to_one_event_ops[ active_workers - 1 ][ worker_index ] = counter; } static void test_all_to_one_event_fini( rtems_test_parallel_context *base, - void *arg, - size_t active_workers + void *arg, + size_t active_workers ) { (void) arg; @@ -242,43 +238,43 @@ static void test_all_to_one_event_fini( ctx, "event", "Send Event to One", - &ctx->all_to_one_event_ops[active_workers - 1][0], + &ctx->all_to_one_event_ops[ active_workers - 1 ][ 0 ], active_workers ); } static void test_one_mutex_body( rtems_test_parallel_context *base, - void *arg, - size_t active_workers, - size_t worker_index + void *arg, + size_t active_workers, + size_t worker_index ) { (void) arg; test_context *ctx = (test_context *) base; - rtems_id id = ctx->sema; - uint32_t counter = 0; + rtems_id id = ctx->sema; + uint32_t counter = 0; - while (!rtems_test_parallel_stop_job(&ctx->base)) { + while ( !rtems_test_parallel_stop_job( &ctx->base ) ) { rtems_status_code sc; ++counter; - sc = rtems_semaphore_obtain(id, RTEMS_WAIT, RTEMS_NO_TIMEOUT); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); + sc = rtems_semaphore_obtain( id, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); + rtems_test_assert( sc == RTEMS_SUCCESSFUL ); - sc = rtems_semaphore_release(id); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); + sc = rtems_semaphore_release( id ); + rtems_test_assert( sc == RTEMS_SUCCESSFUL ); } - ctx->one_mutex_ops[active_workers - 1][worker_index] = counter; + ctx->one_mutex_ops[ active_workers - 1 ][ worker_index ] = counter; } static void test_one_mutex_fini( rtems_test_parallel_context *base, - void *arg, - size_t active_workers + void *arg, + size_t active_workers ) { (void) arg; @@ -289,56 +285,56 @@ static void test_one_mutex_fini( ctx, "contested-mutex", "Obtain/Release Contested Classic Inheritance Mutex", - &ctx->one_mutex_ops[active_workers - 1][0], + &ctx->one_mutex_ops[ active_workers - 1 ][ 0 ], active_workers ); } static void test_many_mutex_body( rtems_test_parallel_context *base, - void *arg, - size_t active_workers, - size_t worker_index + void *arg, + size_t active_workers, + size_t worker_index ) { (void) arg; - test_context *ctx = (test_context *) base; + test_context *ctx = (test_context *) base; rtems_status_code sc; - rtems_id id; - uint32_t counter = 0; + rtems_id id; + uint32_t counter = 0; sc = rtems_semaphore_create( - rtems_build_name('T', 'E', 'S', 'T'), + rtems_build_name( 'T', 'E', 'S', 'T' ), 1, RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY, 0, &id ); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); + rtems_test_assert( sc == RTEMS_SUCCESSFUL ); - while (!rtems_test_parallel_stop_job(&ctx->base)) { + while ( !rtems_test_parallel_stop_job( &ctx->base ) ) { rtems_status_code sc; ++counter; - sc = rtems_semaphore_obtain(id, RTEMS_WAIT, RTEMS_NO_TIMEOUT); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); + sc = rtems_semaphore_obtain( id, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); + rtems_test_assert( sc == RTEMS_SUCCESSFUL ); - sc = rtems_semaphore_release(id); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); + sc = rtems_semaphore_release( id ); + rtems_test_assert( sc == RTEMS_SUCCESSFUL ); } - ctx->many_mutex_ops[active_workers - 1][worker_index] = counter; + ctx->many_mutex_ops[ active_workers - 1 ][ worker_index ] = counter; - sc = rtems_semaphore_delete(id); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); + sc = rtems_semaphore_delete( id ); + rtems_test_assert( sc == RTEMS_SUCCESSFUL ); } static void test_many_mutex_fini( rtems_test_parallel_context *base, - void *arg, - size_t active_workers + void *arg, + size_t active_workers ) { (void) arg; @@ -349,35 +345,35 @@ static void test_many_mutex_fini( ctx, "private-mutex", "Obtain/Release Private Classic Inheritance Mutex", - &ctx->many_mutex_ops[active_workers - 1][0], + &ctx->many_mutex_ops[ active_workers - 1 ][ 0 ], active_workers ); } static void test_self_msg_body( rtems_test_parallel_context *base, - void *arg, - size_t active_workers, - size_t worker_index + void *arg, + size_t active_workers, + size_t worker_index ) { (void) arg; test_context *ctx = (test_context *) base; - rtems_id id = ctx->mq[worker_index]; - uint32_t counter = 0; + rtems_id id = ctx->mq[ worker_index ]; + uint32_t counter = 0; - while (!rtems_test_parallel_stop_job(&ctx->base)) { + while ( !rtems_test_parallel_stop_job( &ctx->base ) ) { rtems_status_code sc; - test_msg msg = { .value = 0 }; - size_t n; + test_msg msg = { .value = 0 }; + size_t n; ++counter; - sc = rtems_message_queue_send(id, &msg, sizeof(msg)); - rtems_test_assert(sc == RTEMS_SUCCESSFUL || sc == RTEMS_TOO_MANY); + sc = rtems_message_queue_send( id, &msg, sizeof( msg ) ); + rtems_test_assert( sc == RTEMS_SUCCESSFUL || sc == RTEMS_TOO_MANY ); - n = sizeof(msg); + n = sizeof( msg ); sc = rtems_message_queue_receive( id, &msg, @@ -385,17 +381,17 @@ static void test_self_msg_body( RTEMS_WAIT, RTEMS_NO_TIMEOUT ); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); - rtems_test_assert(n == sizeof(msg)); + rtems_test_assert( sc == RTEMS_SUCCESSFUL ); + rtems_test_assert( n == sizeof( msg ) ); } - ctx->self_msg_ops[active_workers - 1][worker_index] = counter; + ctx->self_msg_ops[ active_workers - 1 ][ worker_index ] = counter; } static void test_self_msg_fini( rtems_test_parallel_context *base, - void *arg, - size_t active_workers + void *arg, + size_t active_workers ) { (void) arg; @@ -406,37 +402,37 @@ static void test_self_msg_fini( ctx, "message", "Send Message to Self", - &ctx->self_msg_ops[active_workers - 1][0], + &ctx->self_msg_ops[ active_workers - 1 ][ 0 ], active_workers ); } static void test_many_to_one_msg_body( rtems_test_parallel_context *base, - void *arg, - size_t active_workers, - size_t worker_index + void *arg, + size_t active_workers, + size_t worker_index ) { (void) arg; test_context *ctx = (test_context *) base; - rtems_id id = ctx->mq[0]; - bool is_master = rtems_test_parallel_is_master_worker(worker_index); + rtems_id id = ctx->mq[ 0 ]; + bool is_master = rtems_test_parallel_is_master_worker( worker_index ); uint32_t counter = 0; - while (!rtems_test_parallel_stop_job(&ctx->base)) { + while ( !rtems_test_parallel_stop_job( &ctx->base ) ) { rtems_status_code sc; - test_msg msg = { .value = 0 }; - size_t n; + test_msg msg = { .value = 0 }; + size_t n; ++counter; - sc = rtems_message_queue_send(id, &msg, sizeof(msg)); - rtems_test_assert(sc == RTEMS_SUCCESSFUL || sc == RTEMS_TOO_MANY); + sc = rtems_message_queue_send( id, &msg, sizeof( msg ) ); + rtems_test_assert( sc == RTEMS_SUCCESSFUL || sc == RTEMS_TOO_MANY ); - if (is_master) { - n = sizeof(msg); + if ( is_master ) { + n = sizeof( msg ); sc = rtems_message_queue_receive( id, &msg, @@ -444,18 +440,18 @@ static void test_many_to_one_msg_body( RTEMS_WAIT, RTEMS_NO_TIMEOUT ); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); - rtems_test_assert(n == sizeof(msg)); + rtems_test_assert( sc == RTEMS_SUCCESSFUL ); + rtems_test_assert( n == sizeof( msg ) ); } } - ctx->many_to_one_msg_ops[active_workers - 1][worker_index] = counter; + ctx->many_to_one_msg_ops[ active_workers - 1 ][ worker_index ] = counter; } static void test_many_to_one_msg_fini( rtems_test_parallel_context *base, - void *arg, - size_t active_workers + void *arg, + size_t active_workers ) { (void) arg; @@ -466,40 +462,40 @@ static void test_many_to_one_msg_fini( ctx, "message", "Send Message to One Receiver", - &ctx->many_to_one_msg_ops[active_workers - 1][0], + &ctx->many_to_one_msg_ops[ active_workers - 1 ][ 0 ], active_workers ); } static void test_many_sys_lock_mutex_body( rtems_test_parallel_context *base, - void *arg, - size_t active_workers, - size_t worker_index + void *arg, + size_t active_workers, + size_t worker_index ) { (void) arg; - test_context *ctx = (test_context *) base; + test_context *ctx = (test_context *) base; struct _Mutex_Control mtx; - uint32_t counter = 0; + uint32_t counter = 0; - _Mutex_Initialize(&mtx); + _Mutex_Initialize( &mtx ); - while (!rtems_test_parallel_stop_job(&ctx->base)) { + while ( !rtems_test_parallel_stop_job( &ctx->base ) ) { ++counter; - _Mutex_Acquire(&mtx); - _Mutex_Release(&mtx); + _Mutex_Acquire( &mtx ); + _Mutex_Release( &mtx ); } - ctx->many_sys_lock_mutex_ops[active_workers - 1][worker_index] = counter; + ctx->many_sys_lock_mutex_ops[ active_workers - 1 ][ worker_index ] = counter; } static void test_many_sys_lock_mutex_fini( rtems_test_parallel_context *base, - void *arg, - size_t active_workers + void *arg, + size_t active_workers ) { (void) arg; @@ -510,56 +506,57 @@ static void test_many_sys_lock_mutex_fini( ctx, "private-mutex", "Obtain/Release Private Mutex", - &ctx->many_sys_lock_mutex_ops[active_workers - 1][0], + &ctx->many_sys_lock_mutex_ops[ active_workers - 1 ][ 0 ], active_workers ); } static void test_many_classic_ceiling_body( rtems_test_parallel_context *base, - void *arg, - size_t active_workers, - size_t worker_index + void *arg, + size_t active_workers, + size_t worker_index ) { (void) arg; - test_context *ctx = (test_context *) base; + test_context *ctx = (test_context *) base; rtems_status_code sc; - rtems_id id; - uint32_t counter = 0; + rtems_id id; + uint32_t counter = 0; sc = rtems_semaphore_create( - rtems_build_name('T', 'E', 'S', 'T'), + rtems_build_name( 'T', 'E', 'S', 'T' ), 1, RTEMS_BINARY_SEMAPHORE | RTEMS_PRIORITY_CEILING | RTEMS_PRIORITY, 1, &id ); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); + rtems_test_assert( sc == RTEMS_SUCCESSFUL ); - while (!rtems_test_parallel_stop_job(&ctx->base)) { + while ( !rtems_test_parallel_stop_job( &ctx->base ) ) { rtems_status_code sc; ++counter; - sc = rtems_semaphore_obtain(id, RTEMS_WAIT, RTEMS_NO_TIMEOUT); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); + sc = rtems_semaphore_obtain( id, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); + rtems_test_assert( sc == RTEMS_SUCCESSFUL ); - sc = rtems_semaphore_release(id); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); + sc = rtems_semaphore_release( id ); + rtems_test_assert( sc == RTEMS_SUCCESSFUL ); } - ctx->many_classic_ceiling_ops[active_workers - 1][worker_index] = counter; + ctx->many_classic_ceiling_ops[ active_workers - 1 ] + [ worker_index ] = counter; - sc = rtems_semaphore_delete(id); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); + sc = rtems_semaphore_delete( id ); + rtems_test_assert( sc == RTEMS_SUCCESSFUL ); } static void test_many_classic_ceiling_fini( rtems_test_parallel_context *base, - void *arg, - size_t active_workers + void *arg, + size_t active_workers ) { (void) arg; @@ -570,57 +567,57 @@ static void test_many_classic_ceiling_fini( ctx, "private-mutex", "Obtain/Release Private Classic Ceiling Mutex", - &ctx->many_classic_ceiling_ops[active_workers - 1][0], + &ctx->many_classic_ceiling_ops[ active_workers - 1 ][ 0 ], active_workers ); } static void test_many_classic_mrsp_body( rtems_test_parallel_context *base, - void *arg, - size_t active_workers, - size_t worker_index + void *arg, + size_t active_workers, + size_t worker_index ) { (void) arg; - test_context *ctx = (test_context *) base; + test_context *ctx = (test_context *) base; rtems_status_code sc; - rtems_id id; - uint32_t counter = 0; + rtems_id id; + uint32_t counter = 0; sc = rtems_semaphore_create( - rtems_build_name('T', 'E', 'S', 'T'), + rtems_build_name( 'T', 'E', 'S', 'T' ), 1, RTEMS_BINARY_SEMAPHORE | RTEMS_PRIORITY | RTEMS_MULTIPROCESSOR_RESOURCE_SHARING, 1, &id ); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); + rtems_test_assert( sc == RTEMS_SUCCESSFUL ); - while (!rtems_test_parallel_stop_job(&ctx->base)) { + while ( !rtems_test_parallel_stop_job( &ctx->base ) ) { rtems_status_code sc; ++counter; - sc = rtems_semaphore_obtain(id, RTEMS_WAIT, RTEMS_NO_TIMEOUT); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); + sc = rtems_semaphore_obtain( id, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); + rtems_test_assert( sc == RTEMS_SUCCESSFUL ); - sc = rtems_semaphore_release(id); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); + sc = rtems_semaphore_release( id ); + rtems_test_assert( sc == RTEMS_SUCCESSFUL ); } - ctx->many_classic_mrsp_ops[active_workers - 1][worker_index] = counter; + ctx->many_classic_mrsp_ops[ active_workers - 1 ][ worker_index ] = counter; - sc = rtems_semaphore_delete(id); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); + sc = rtems_semaphore_delete( id ); + rtems_test_assert( sc == RTEMS_SUCCESSFUL ); } static void test_many_classic_mrsp_fini( rtems_test_parallel_context *base, - void *arg, - size_t active_workers + void *arg, + size_t active_workers ) { (void) arg; @@ -631,45 +628,46 @@ static void test_many_classic_mrsp_fini( ctx, "private-mutex", "Obtain/Release Private Classic MrsP Mutex", - &ctx->many_classic_mrsp_ops[active_workers - 1][0], + &ctx->many_classic_mrsp_ops[ active_workers - 1 ][ 0 ], active_workers ); } static void test_many_pthread_spinlock_body( rtems_test_parallel_context *base, - void *arg, - size_t active_workers, - size_t worker_index + void *arg, + size_t active_workers, + size_t worker_index ) { (void) arg; - test_context *ctx = (test_context *) base; - int eno; + test_context *ctx = (test_context *) base; + int eno; pthread_spinlock_t spin; - uint32_t counter = 0; + uint32_t counter = 0; - eno = pthread_spin_init(&spin, 0); - rtems_test_assert(eno == 0); + eno = pthread_spin_init( &spin, 0 ); + rtems_test_assert( eno == 0 ); - while (!rtems_test_parallel_stop_job(&ctx->base)) { + while ( !rtems_test_parallel_stop_job( &ctx->base ) ) { ++counter; - pthread_spin_lock(&spin); - pthread_spin_unlock(&spin); + pthread_spin_lock( &spin ); + pthread_spin_unlock( &spin ); } - ctx->many_pthread_spinlock_ops[active_workers - 1][worker_index] = counter; + ctx->many_pthread_spinlock_ops[ active_workers - 1 ] + [ worker_index ] = counter; - eno = pthread_spin_destroy(&spin); - rtems_test_assert(eno == 0); + eno = pthread_spin_destroy( &spin ); + rtems_test_assert( eno == 0 ); } static void test_many_pthread_spinlock_fini( rtems_test_parallel_context *base, - void *arg, - size_t active_workers + void *arg, + size_t active_workers ) { (void) arg; @@ -680,56 +678,56 @@ static void test_many_pthread_spinlock_fini( ctx, "private-mutex", "Obtain/Release Private Pthread Spinlock", - &ctx->many_pthread_spinlock_ops[active_workers - 1][0], + &ctx->many_pthread_spinlock_ops[ active_workers - 1 ][ 0 ], active_workers ); } static void test_many_pthread_mutex_inherit_body( rtems_test_parallel_context *base, - void *arg, - size_t active_workers, - size_t worker_index + void *arg, + size_t active_workers, + size_t worker_index ) { (void) arg; - test_context *ctx = (test_context *) base; - int eno; + test_context *ctx = (test_context *) base; + int eno; pthread_mutexattr_t attr; - pthread_mutex_t mtx; - uint32_t counter = 0; + pthread_mutex_t mtx; + uint32_t counter = 0; - eno = pthread_mutexattr_init(&attr); - rtems_test_assert(eno == 0); + eno = pthread_mutexattr_init( &attr ); + rtems_test_assert( eno == 0 ); - eno = pthread_mutexattr_setprotocol(&attr, PTHREAD_PRIO_INHERIT); - rtems_test_assert(eno == 0); + eno = pthread_mutexattr_setprotocol( &attr, PTHREAD_PRIO_INHERIT ); + rtems_test_assert( eno == 0 ); - eno = pthread_mutex_init(&mtx, &attr); - rtems_test_assert(eno == 0); + eno = pthread_mutex_init( &mtx, &attr ); + rtems_test_assert( eno == 0 ); - while (!rtems_test_parallel_stop_job(&ctx->base)) { + while ( !rtems_test_parallel_stop_job( &ctx->base ) ) { ++counter; - pthread_mutex_lock(&mtx); - pthread_mutex_unlock(&mtx); + pthread_mutex_lock( &mtx ); + pthread_mutex_unlock( &mtx ); } - ctx->many_pthread_mutex_inherit_ops[active_workers - 1][worker_index] = - counter; + ctx->many_pthread_mutex_inherit_ops[ active_workers - 1 ] + [ worker_index ] = counter; - eno = pthread_mutex_destroy(&mtx); - rtems_test_assert(eno == 0); + eno = pthread_mutex_destroy( &mtx ); + rtems_test_assert( eno == 0 ); - eno = pthread_mutexattr_destroy(&attr); - rtems_test_assert(eno == 0); + eno = pthread_mutexattr_destroy( &attr ); + rtems_test_assert( eno == 0 ); } static void test_many_pthread_mutex_inherit_fini( rtems_test_parallel_context *base, - void *arg, - size_t active_workers + void *arg, + size_t active_workers ) { (void) arg; @@ -740,62 +738,62 @@ static void test_many_pthread_mutex_inherit_fini( ctx, "private-mutex", "Obtain/Release Private Pthread Inheritance Mutex", - &ctx->many_pthread_mutex_inherit_ops[active_workers - 1][0], + &ctx->many_pthread_mutex_inherit_ops[ active_workers - 1 ][ 0 ], active_workers ); } static void test_many_pthread_mutex_protect_body( rtems_test_parallel_context *base, - void *arg, - size_t active_workers, - size_t worker_index + void *arg, + size_t active_workers, + size_t worker_index ) { (void) arg; - test_context *ctx = (test_context *) base; - int eno; + test_context *ctx = (test_context *) base; + int eno; pthread_mutexattr_t attr; - pthread_mutex_t mtx; - uint32_t counter = 0; + pthread_mutex_t mtx; + uint32_t counter = 0; - eno = pthread_mutexattr_init(&attr); - rtems_test_assert(eno == 0); + eno = pthread_mutexattr_init( &attr ); + rtems_test_assert( eno == 0 ); - eno = pthread_mutexattr_setprotocol(&attr, PTHREAD_PRIO_PROTECT); - rtems_test_assert(eno == 0); + eno = pthread_mutexattr_setprotocol( &attr, PTHREAD_PRIO_PROTECT ); + rtems_test_assert( eno == 0 ); eno = pthread_mutexattr_setprioceiling( &attr, - sched_get_priority_max(SCHED_FIFO) + sched_get_priority_max( SCHED_FIFO ) ); - rtems_test_assert(eno == 0); + rtems_test_assert( eno == 0 ); - eno = pthread_mutex_init(&mtx, &attr); - rtems_test_assert(eno == 0); + eno = pthread_mutex_init( &mtx, &attr ); + rtems_test_assert( eno == 0 ); - while (!rtems_test_parallel_stop_job(&ctx->base)) { + while ( !rtems_test_parallel_stop_job( &ctx->base ) ) { ++counter; - pthread_mutex_lock(&mtx); - pthread_mutex_unlock(&mtx); + pthread_mutex_lock( &mtx ); + pthread_mutex_unlock( &mtx ); } - ctx->many_pthread_mutex_protect_ops[active_workers - 1][worker_index] = - counter; + ctx->many_pthread_mutex_protect_ops[ active_workers - 1 ] + [ worker_index ] = counter; - eno = pthread_mutex_destroy(&mtx); - rtems_test_assert(eno == 0); + eno = pthread_mutex_destroy( &mtx ); + rtems_test_assert( eno == 0 ); - eno = pthread_mutexattr_destroy(&attr); - rtems_test_assert(eno == 0); + eno = pthread_mutexattr_destroy( &attr ); + rtems_test_assert( eno == 0 ); } static void test_many_pthread_mutex_protect_fini( rtems_test_parallel_context *base, - void *arg, - size_t active_workers + void *arg, + size_t active_workers ) { (void) arg; @@ -806,121 +804,108 @@ static void test_many_pthread_mutex_protect_fini( ctx, "private-mutex", "Obtain/Release Private Pthread Ceiling Mutex", - &ctx->many_pthread_mutex_protect_ops[active_workers - 1][0], + &ctx->many_pthread_mutex_protect_ops[ active_workers - 1 ][ 0 ], active_workers ); } static const rtems_test_parallel_job test_jobs[] = { - { - .init = test_init, + { .init = test_init, .body = test_self_event_body, .fini = test_self_event_fini, - .cascade = true - }, { - .init = test_init, + .cascade = true }, + { .init = test_init, .body = test_all_to_one_event_body, .fini = test_all_to_one_event_fini, - .cascade = true - }, { - .init = test_init, + .cascade = true }, + { .init = test_init, .body = test_one_mutex_body, .fini = test_one_mutex_fini, - .cascade = true - }, { - .init = test_init, + .cascade = true }, + { .init = test_init, .body = test_self_msg_body, .fini = test_self_msg_fini, - .cascade = true - }, { - .init = test_init, + .cascade = true }, + { .init = test_init, .body = test_many_to_one_msg_body, .fini = test_many_to_one_msg_fini, - .cascade = true - }, { - .init = test_init, + .cascade = true }, + { .init = test_init, .body = test_many_pthread_spinlock_body, .fini = test_many_pthread_spinlock_fini, - .cascade = true - }, { - .init = test_init, + .cascade = true }, + { .init = test_init, .body = test_many_sys_lock_mutex_body, .fini = test_many_sys_lock_mutex_fini, - .cascade = true - }, { - .init = test_init, + .cascade = true }, + { .init = test_init, .body = test_many_pthread_mutex_inherit_body, .fini = test_many_pthread_mutex_inherit_fini, - .cascade = true - }, { - .init = test_init, + .cascade = true }, + { .init = test_init, .body = test_many_mutex_body, .fini = test_many_mutex_fini, - .cascade = true - }, { - .init = test_init, + .cascade = true }, + { .init = test_init, .body = test_many_pthread_mutex_protect_body, .fini = test_many_pthread_mutex_protect_fini, - .cascade = true - }, { - .init = test_init, + .cascade = true }, + { .init = test_init, .body = test_many_classic_ceiling_body, .fini = test_many_classic_ceiling_fini, - .cascade = true - }, { - .init = test_init, + .cascade = true }, + { .init = test_init, .body = test_many_classic_mrsp_body, .fini = test_many_classic_mrsp_fini, - .cascade = true - } + .cascade = true } }; -static void Init(rtems_task_argument arg) +static void Init( rtems_task_argument arg ) { (void) arg; - test_context *ctx = &test_instance; + test_context *ctx = &test_instance; rtems_status_code sc; - size_t i; + size_t i; TEST_BEGIN(); ctx->master = rtems_task_self(); sc = rtems_semaphore_create( - rtems_build_name('T', 'E', 'S', 'T'), + rtems_build_name( 'T', 'E', 'S', 'T' ), 1, RTEMS_BINARY_SEMAPHORE | RTEMS_INHERIT_PRIORITY | RTEMS_PRIORITY, 0, &ctx->sema ); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); + rtems_test_assert( sc == RTEMS_SUCCESSFUL ); - for (i = 0; i < CPU_COUNT; ++i) { + for ( i = 0; i < CPU_COUNT; ++i ) { sc = rtems_message_queue_create( - rtems_build_name('T', 'E', 'S', 'T'), + rtems_build_name( 'T', 'E', 'S', 'T' ), MSG_COUNT, - sizeof(test_msg), + sizeof( test_msg ), RTEMS_DEFAULT_ATTRIBUTES, - &ctx->mq[i] + &ctx->mq[ i ] ); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); + rtems_test_assert( sc == RTEMS_SUCCESSFUL ); } - printf("*** BEGIN OF JSON DATA ***\n[\n "); + printf( "*** BEGIN OF JSON DATA ***\n[\n " ); ctx->test_sep = ""; rtems_test_parallel( &ctx->base, NULL, - &test_jobs[0], - RTEMS_ARRAY_SIZE(test_jobs) + &test_jobs[ 0 ], + RTEMS_ARRAY_SIZE( test_jobs ) ); - printf("\n]\n*** END OF JSON DATA ***\n"); + printf( "\n]\n*** END OF JSON DATA ***\n" ); TEST_END(); - rtems_test_exit(0); + rtems_test_exit( 0 ); } #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER @@ -930,12 +915,12 @@ static void Init(rtems_task_argument arg) #define CONFIGURE_MAXIMUM_TIMERS 1 -#define CONFIGURE_MAXIMUM_SEMAPHORES (1 + CPU_COUNT) +#define CONFIGURE_MAXIMUM_SEMAPHORES ( 1 + CPU_COUNT ) #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES CPU_COUNT #define CONFIGURE_MESSAGE_BUFFER_MEMORY \ - CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE(MSG_COUNT, sizeof(test_msg)) + CONFIGURE_MESSAGE_BUFFERS_FOR_QUEUE( MSG_COUNT, sizeof( test_msg ) ) #define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION diff --git a/testsuites/tmtests/tmonetoone/init.c b/testsuites/tmtests/tmonetoone/init.c index c8185ff6d3..66b581ea1c 100644 --- a/testsuites/tmtests/tmonetoone/init.c +++ b/testsuites/tmtests/tmonetoone/init.c @@ -48,17 +48,17 @@ typedef enum { } test_variant; typedef struct { - volatile uint32_t counter; - test_variant variant; - rtems_id task; - rtems_binary_semaphore bsem; - rtems_id classic_fifo_bsem; - rtems_id classic_prio_bsem; - rtems_id other_task; + volatile uint32_t counter; + test_variant variant; + rtems_id task; + rtems_binary_semaphore bsem; + rtems_id classic_fifo_bsem; + rtems_id classic_prio_bsem; + rtems_id other_task; rtems_binary_semaphore *other_bsem; - rtems_id other_classic_fifo_bsem; - rtems_id other_classic_prio_bsem; -} task_context RTEMS_ALIGNED(CPU_CACHE_LINE_BYTES); + rtems_id other_classic_fifo_bsem; + rtems_id other_classic_prio_bsem; +} task_context RTEMS_ALIGNED( CPU_CACHE_LINE_BYTES ); typedef struct { task_context a; @@ -67,12 +67,12 @@ typedef struct { static test_context test_instance; -static void test_yield(task_context *tc) +static void test_yield( task_context *tc ) { rtems_event_set events; - uint32_t counter; + uint32_t counter; - (void)rtems_event_receive( + (void) rtems_event_receive( RTEMS_EVENT_0, RTEMS_WAIT | RTEMS_EVENT_ALL, RTEMS_NO_TIMEOUT, @@ -81,14 +81,14 @@ static void test_yield(task_context *tc) counter = 0; - while (true) { - (void)sched_yield(); + while ( true ) { + (void) sched_yield(); ++counter; tc->counter = counter; } } -static void test_events(task_context *tc) +static void test_events( task_context *tc ) { uint32_t counter; rtems_id other; @@ -96,38 +96,38 @@ static void test_events(task_context *tc) counter = 0; other = tc->other_task; - while (true) { + while ( true ) { rtems_event_set events; - (void)rtems_event_receive( + (void) rtems_event_receive( RTEMS_EVENT_0, RTEMS_WAIT | RTEMS_EVENT_ALL, RTEMS_NO_TIMEOUT, &events ); - (void)rtems_event_send(other, RTEMS_EVENT_0); + (void) rtems_event_send( other, RTEMS_EVENT_0 ); ++counter; tc->counter = counter; } } -static void test_bsem(task_context *tc) +static void test_bsem( task_context *tc ) { - uint32_t counter; + uint32_t counter; rtems_binary_semaphore *other; counter = 0; other = tc->other_bsem; - while (true) { - rtems_binary_semaphore_wait(&tc->bsem); - rtems_binary_semaphore_post(other); + while ( true ) { + rtems_binary_semaphore_wait( &tc->bsem ); + rtems_binary_semaphore_post( other ); ++counter; tc->counter = counter; } } -static void test_classic_fifo_bsem(task_context *tc) +static void test_classic_fifo_bsem( task_context *tc ) { uint32_t counter; rtems_id own; @@ -137,15 +137,15 @@ static void test_classic_fifo_bsem(task_context *tc) own = tc->classic_fifo_bsem; other = tc->other_classic_fifo_bsem; - while (true) { - (void)rtems_semaphore_obtain(own, RTEMS_WAIT, RTEMS_NO_TIMEOUT); - (void)rtems_semaphore_release(other); + while ( true ) { + (void) rtems_semaphore_obtain( own, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); + (void) rtems_semaphore_release( other ); ++counter; tc->counter = counter; } } -static void test_classic_prio_bsem(task_context *tc) +static void test_classic_prio_bsem( task_context *tc ) { uint32_t counter; rtems_id own; @@ -155,15 +155,15 @@ static void test_classic_prio_bsem(task_context *tc) own = tc->classic_prio_bsem; other = tc->other_classic_prio_bsem; - while (true) { - (void)rtems_semaphore_obtain(own, RTEMS_WAIT, RTEMS_NO_TIMEOUT); - (void)rtems_semaphore_release(other); + while ( true ) { + (void) rtems_semaphore_obtain( own, RTEMS_WAIT, RTEMS_NO_TIMEOUT ); + (void) rtems_semaphore_release( other ); ++counter; tc->counter = counter; } } -static void worker_task(rtems_task_argument arg) +static void worker_task( rtems_task_argument arg ) { (void) arg; @@ -171,67 +171,67 @@ static void worker_task(rtems_task_argument arg) tc = (task_context *) arg; - switch (tc->variant) { + switch ( tc->variant ) { case TEST_YIELD: - test_yield(tc); + test_yield( tc ); break; case TEST_EVENTS: - test_events(tc); + test_events( tc ); break; case TEST_BSEM: - test_bsem(tc); + test_bsem( tc ); break; case TEST_CLASSIC_FIFO_BSEM: - test_classic_fifo_bsem(tc); + test_classic_fifo_bsem( tc ); break; case TEST_CLASSIC_PRIO_BSEM: - test_classic_prio_bsem(tc); + test_classic_prio_bsem( tc ); break; default: - rtems_test_assert(0); + rtems_test_assert( 0 ); break; } } -static void create_task(task_context *tc) +static void create_task( task_context *tc ) { rtems_status_code sc; - rtems_binary_semaphore_init(&tc->bsem, "test"); + rtems_binary_semaphore_init( &tc->bsem, "test" ); sc = rtems_semaphore_create( - rtems_build_name('T', 'E', 'S', 'T'), + rtems_build_name( 'T', 'E', 'S', 'T' ), 0, RTEMS_SIMPLE_BINARY_SEMAPHORE | RTEMS_FIFO, 0, &tc->classic_fifo_bsem ); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); + rtems_test_assert( sc == RTEMS_SUCCESSFUL ); sc = rtems_semaphore_create( - rtems_build_name('T', 'E', 'S', 'T'), + rtems_build_name( 'T', 'E', 'S', 'T' ), 0, RTEMS_SIMPLE_BINARY_SEMAPHORE | RTEMS_PRIORITY, 0, &tc->classic_prio_bsem ); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); + rtems_test_assert( sc == RTEMS_SUCCESSFUL ); sc = rtems_task_create( - rtems_build_name('T', 'E', 'S', 'T'), + rtems_build_name( 'T', 'E', 'S', 'T' ), 2, RTEMS_MINIMUM_STACK_SIZE, RTEMS_DEFAULT_MODES, RTEMS_DEFAULT_ATTRIBUTES, &tc->task ); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); + rtems_test_assert( sc == RTEMS_SUCCESSFUL ); - sc = rtems_task_start(tc->task, worker_task, (rtems_task_argument) tc); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); + sc = rtems_task_start( tc->task, worker_task, (rtems_task_argument) tc ); + rtems_test_assert( sc == RTEMS_SUCCESSFUL ); } -static const char * const variant_names[] = { +static const char *const variant_names[] = { "yield", "event", "self-contained binary semaphore", @@ -239,11 +239,11 @@ static const char * const variant_names[] = { "Classic binary semaphore (priority)" }; -static void prepare(test_context *ctx, test_variant variant) +static void prepare( test_context *ctx, test_variant variant ) { rtems_status_code sc; - printf("%s\n", variant_names[variant]); + printf( "%s\n", variant_names[ variant ] ); ctx->a.variant = variant; ctx->b.variant = variant; @@ -251,37 +251,37 @@ static void prepare(test_context *ctx, test_variant variant) ctx->a.counter = 0; ctx->b.counter = 0; - sc = rtems_task_restart(ctx->a.task, (rtems_task_argument) &ctx->a); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); + sc = rtems_task_restart( ctx->a.task, (rtems_task_argument) &ctx->a ); + rtems_test_assert( sc == RTEMS_SUCCESSFUL ); - sc = rtems_task_restart(ctx->b.task, (rtems_task_argument) &ctx->b); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); + sc = rtems_task_restart( ctx->b.task, (rtems_task_argument) &ctx->b ); + rtems_test_assert( sc == RTEMS_SUCCESSFUL ); - sc = rtems_task_wake_after(2); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); + sc = rtems_task_wake_after( 2 ); + rtems_test_assert( sc == RTEMS_SUCCESSFUL ); } -static void run(test_context *ctx) +static void run( test_context *ctx ) { rtems_status_code sc; - sc = rtems_task_wake_after(rtems_clock_get_ticks_per_second()); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); + sc = rtems_task_wake_after( rtems_clock_get_ticks_per_second() ); + rtems_test_assert( sc == RTEMS_SUCCESSFUL ); - printf("a %" PRIu32 "\nb %" PRIu32 "\n", ctx->a.counter, ctx->b.counter); + printf( "a %" PRIu32 "\nb %" PRIu32 "\n", ctx->a.counter, ctx->b.counter ); } -static void Init(rtems_task_argument arg) +static void Init( rtems_task_argument arg ) { (void) arg; - test_context *ctx = &test_instance; + test_context *ctx = &test_instance; rtems_status_code sc; TEST_BEGIN(); - create_task(&ctx->a); - create_task(&ctx->b); + create_task( &ctx->a ); + create_task( &ctx->b ); ctx->a.other_task = ctx->b.task; ctx->a.other_bsem = &ctx->b.bsem; @@ -293,41 +293,41 @@ static void Init(rtems_task_argument arg) ctx->b.other_classic_fifo_bsem = ctx->a.classic_fifo_bsem; ctx->b.other_classic_prio_bsem = ctx->a.classic_prio_bsem; - prepare(ctx, TEST_YIELD); + prepare( ctx, TEST_YIELD ); - sc = rtems_event_send(ctx->a.task, RTEMS_EVENT_0); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); + sc = rtems_event_send( ctx->a.task, RTEMS_EVENT_0 ); + rtems_test_assert( sc == RTEMS_SUCCESSFUL ); - sc = rtems_event_send(ctx->b.task, RTEMS_EVENT_0); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); + sc = rtems_event_send( ctx->b.task, RTEMS_EVENT_0 ); + rtems_test_assert( sc == RTEMS_SUCCESSFUL ); - run(ctx); - prepare(ctx, TEST_EVENTS); + run( ctx ); + prepare( ctx, TEST_EVENTS ); - sc = rtems_event_send(ctx->a.task, RTEMS_EVENT_0); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); + sc = rtems_event_send( ctx->a.task, RTEMS_EVENT_0 ); + rtems_test_assert( sc == RTEMS_SUCCESSFUL ); - run(ctx); - prepare(ctx, TEST_BSEM); + run( ctx ); + prepare( ctx, TEST_BSEM ); - rtems_binary_semaphore_post(&ctx->a.bsem); + rtems_binary_semaphore_post( &ctx->a.bsem ); - run(ctx); - prepare(ctx, TEST_CLASSIC_FIFO_BSEM); + run( ctx ); + prepare( ctx, TEST_CLASSIC_FIFO_BSEM ); - sc = rtems_semaphore_release(ctx->a.classic_fifo_bsem); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); + sc = rtems_semaphore_release( ctx->a.classic_fifo_bsem ); + rtems_test_assert( sc == RTEMS_SUCCESSFUL ); - run(ctx); - prepare(ctx, TEST_CLASSIC_PRIO_BSEM); + run( ctx ); + prepare( ctx, TEST_CLASSIC_PRIO_BSEM ); - sc = rtems_semaphore_release(ctx->a.classic_prio_bsem); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); + sc = rtems_semaphore_release( ctx->a.classic_prio_bsem ); + rtems_test_assert( sc == RTEMS_SUCCESSFUL ); - run(ctx); + run( ctx ); TEST_END(); - rtems_test_exit(0); + rtems_test_exit( 0 ); } #define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER diff --git a/testsuites/tmtests/tmtimer01/init.c b/testsuites/tmtests/tmtimer01/init.c index 9d3f7c3eec..52ba28dd88 100644 --- a/testsuites/tmtests/tmtimer01/init.c +++ b/testsuites/tmtests/tmtimer01/init.c @@ -40,40 +40,40 @@ const char rtems_test_name[] = "TMTIMER 1"; typedef struct { - size_t cache_line_size; - size_t data_cache_size; - int dummy_value; + size_t cache_line_size; + size_t data_cache_size; + int dummy_value; volatile int *dummy_data; - rtems_id first; + rtems_id first; } test_context; static test_context test_instance; -static void prepare_cache(test_context *ctx) +static void prepare_cache( test_context *ctx ) { volatile int *data = ctx->dummy_data; - size_t m = ctx->data_cache_size / sizeof(*data); - size_t k = ctx->cache_line_size / sizeof(*data); - size_t j = ctx->dummy_value; - size_t i; + size_t m = ctx->data_cache_size / sizeof( *data ); + size_t k = ctx->cache_line_size / sizeof( *data ); + size_t j = ctx->dummy_value; + size_t i; - for (i = 0; i < m; i += k) { - data[i] = i + j; + for ( i = 0; i < m; i += k ) { + data[ i ] = i + j; } ctx->dummy_value = i + j; rtems_cache_invalidate_entire_instruction(); } -static void never(rtems_id id, void *arg) +static void never( rtems_id id, void *arg ) { (void) id; (void) arg; - rtems_test_assert(0); + rtems_test_assert( 0 ); } -static rtems_interval interval(size_t i) +static rtems_interval interval( size_t i ) { rtems_interval d = 50000; @@ -82,56 +82,61 @@ static rtems_interval interval(size_t i) static void test_fire_and_cancel( test_context *ctx, - size_t i, - size_t j, - const char *name + size_t i, + size_t j, + const char *name ) { - rtems_status_code sc; - rtems_status_code sc2; - rtems_counter_ticks a; - rtems_counter_ticks b; - rtems_counter_ticks d; - rtems_id id; + rtems_status_code sc; + rtems_status_code sc2; + rtems_counter_ticks a; + rtems_counter_ticks b; + rtems_counter_ticks d; + rtems_id id; rtems_interrupt_level level; id = ctx->first + i; - prepare_cache(ctx); + prepare_cache( ctx ); - rtems_interrupt_local_disable(level); + rtems_interrupt_local_disable( level ); a = rtems_counter_read(); - sc = rtems_timer_fire_after(id, interval(j), never, NULL); - sc2 = rtems_timer_cancel(id); + sc = rtems_timer_fire_after( id, interval( j ), never, NULL ); + sc2 = rtems_timer_cancel( id ); b = rtems_counter_read(); - rtems_interrupt_local_enable(level); + rtems_interrupt_local_enable( level ); - d = rtems_counter_difference(b, a); + d = rtems_counter_difference( b, a ); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); - rtems_test_assert(sc2 == RTEMS_SUCCESSFUL); + rtems_test_assert( sc == RTEMS_SUCCESSFUL ); + rtems_test_assert( sc2 == RTEMS_SUCCESSFUL ); printf( ",\n \"%s\": %" PRIu64, name, - rtems_counter_ticks_to_nanoseconds(d) + rtems_counter_ticks_to_nanoseconds( d ) ); } static const char *sep = "\n "; -static void test_case(test_context *ctx, size_t j, size_t k) +static void test_case( test_context *ctx, size_t j, size_t k ) { rtems_status_code sc; - size_t s; - size_t t; + size_t s; + size_t t; s = j - k; - for (t = 0; t < s; ++t) { + for ( t = 0; t < s; ++t ) { size_t u = k + t; - sc = rtems_timer_fire_after(ctx->first + u, interval(u + 1), never, NULL); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); + sc = rtems_timer_fire_after( + ctx->first + u, + interval( u + 1 ), + never, + NULL + ); + rtems_test_assert( sc == RTEMS_SUCCESSFUL ); } printf( @@ -142,50 +147,50 @@ static void test_case(test_context *ctx, size_t j, size_t k) ); sep = "\n }, "; - test_fire_and_cancel(ctx, j, 0, "first"); - test_fire_and_cancel(ctx, j, j / 2, "middle"); - test_fire_and_cancel(ctx, j, j + 1, "last"); + test_fire_and_cancel( ctx, j, 0, "first" ); + test_fire_and_cancel( ctx, j, j / 2, "middle" ); + test_fire_and_cancel( ctx, j, j + 1, "last" ); } -static void test(void) +static void test( void ) { - test_context *ctx = &test_instance; + test_context *ctx = &test_instance; rtems_status_code sc; - rtems_id id; - rtems_name n; - size_t j; - size_t k; - size_t timer_count; + rtems_id id; + rtems_name n; + size_t j; + size_t k; + size_t timer_count; ctx->cache_line_size = rtems_cache_get_data_line_size(); - if (ctx->cache_line_size == 0) { + if ( ctx->cache_line_size == 0 ) { ctx->cache_line_size = 32; } - ctx->data_cache_size = rtems_cache_get_data_cache_size(0); - if (ctx->data_cache_size == 0) { + ctx->data_cache_size = rtems_cache_get_data_cache_size( 0 ); + if ( ctx->data_cache_size == 0 ) { ctx->data_cache_size = ctx->cache_line_size; } - ctx->dummy_data = malloc(ctx->data_cache_size); - rtems_test_assert(ctx->dummy_data != NULL); + ctx->dummy_data = malloc( ctx->data_cache_size ); + rtems_test_assert( ctx->dummy_data != NULL ); n = 1; timer_count = 1; - sc = rtems_timer_create(n, &ctx->first); - rtems_test_assert(sc == RTEMS_SUCCESSFUL); - rtems_test_assert(rtems_object_id_get_index(ctx->first) == n); + sc = rtems_timer_create( n, &ctx->first ); + rtems_test_assert( sc == RTEMS_SUCCESSFUL ); + rtems_test_assert( rtems_object_id_get_index( ctx->first ) == n ); - while (true) { + while ( true ) { ++n; - sc = rtems_timer_create(n, &id); - if (sc != RTEMS_SUCCESSFUL) { + sc = rtems_timer_create( n, &id ); + if ( sc != RTEMS_SUCCESSFUL ) { break; } - rtems_test_assert(rtems_object_id_get_index(id) == n); + rtems_test_assert( rtems_object_id_get_index( id ) == n ); timer_count = n; } @@ -200,18 +205,18 @@ static void test(void) k = 0; j = 0; - while (j < timer_count) { - test_case(ctx, j, k); + while ( j < timer_count ) { + test_case( ctx, j, k ); k = j; - j = (123 * (j + 1) + 99) / 100; + j = ( 123 * ( j + 1 ) + 99 ) / 100; } - test_case(ctx, n - 2, k); + test_case( ctx, n - 2, k ); - printf("\n }\n ]\n}\n*** END OF JSON DATA ***\n"); + printf( "\n }\n ]\n}\n*** END OF JSON DATA ***\n" ); } -static void Init(rtems_task_argument arg) +static void Init( rtems_task_argument arg ) { (void) arg; @@ -220,7 +225,7 @@ static void Init(rtems_task_argument arg) test(); TEST_END(); - rtems_test_exit(0); + rtems_test_exit( 0 ); } #define CONFIGURE_MICROSECONDS_PER_TICK 50000 @@ -230,8 +235,8 @@ static void Init(rtems_task_argument arg) #define CONFIGURE_UNIFIED_WORK_AREAS -#define CONFIGURE_MAXIMUM_TASKS 1 -#define CONFIGURE_MAXIMUM_TIMERS rtems_resource_unlimited(32) +#define CONFIGURE_MAXIMUM_TASKS 1 +#define CONFIGURE_MAXIMUM_TIMERS rtems_resource_unlimited( 32 ) #define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION