testsuites/tmtests: reformat with clang-format

Updates #3860.

Updates #5358.
This commit is contained in:
Gedare Bloom
2026-02-02 14:35:59 -06:00
committed by Kinsey Moore
parent 7c24bcced0
commit 834a0350b5
67 changed files with 2123 additions and 2702 deletions
+23 -17
View File
@@ -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 */
+5 -8
View File
@@ -29,27 +29,24 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <tmacros.h>
/* functions */
rtems_task Init(
rtems_task_argument argument
);
rtems_task Init( rtems_task_argument argument );
#include <timesys.h>
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
+48 -63
View File
@@ -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;
+3 -6
View File
@@ -29,14 +29,11 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <tmacros.h>
/* functions */
rtems_task Init(
rtems_task_argument argument
);
rtems_task Init( rtems_task_argument argument );
#include <timesys.h>
@@ -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
+26 -39
View File
@@ -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;
+3 -6
View File
@@ -29,14 +29,11 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <tmacros.h>
/* functions */
rtems_task Init(
rtems_task_argument argument
);
rtems_task Init( rtems_task_argument argument );
#include <timesys.h>
@@ -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
+26 -40
View File
@@ -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;
+3 -6
View File
@@ -29,14 +29,11 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <tmacros.h>
/* functions */
rtems_task Init(
rtems_task_argument argument
);
rtems_task Init( rtems_task_argument argument );
#include <timesys.h>
@@ -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
+69 -80
View File
@@ -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
);
}
}
+2 -5
View File
@@ -29,14 +29,11 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <tmacros.h>
/* functions */
rtems_task Init(
rtems_task_argument argument
);
rtems_task Init( rtems_task_argument argument );
#include <timesys.h>
@@ -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
+22 -32
View File
@@ -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;
+2 -5
View File
@@ -29,14 +29,11 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <tmacros.h>
/* functions */
rtems_task Init(
rtems_task_argument argument
);
rtems_task Init( rtems_task_argument argument );
#include <timesys.h>
@@ -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
+29 -40
View File
@@ -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 );
}
+2 -5
View File
@@ -29,14 +29,11 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <tmacros.h>
/* functions */
rtems_task Init(
rtems_task_argument argument
);
rtems_task Init( rtems_task_argument argument );
#include <timesys.h>
@@ -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
+29 -36
View File
@@ -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;
+2 -5
View File
@@ -29,14 +29,11 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <tmacros.h>
/* functions */
rtems_task Init(
rtems_task_argument argument
);
rtems_task Init( rtems_task_argument argument );
#include <timesys.h>
@@ -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
+43 -58
View File
@@ -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;
+7 -10
View File
@@ -29,34 +29,31 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <tmacros.h>
/* 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 <timesys.h>
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 <rtems/confdefs.h>
+78 -91
View File
@@ -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
);
}
+4 -7
View File
@@ -29,14 +29,11 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <tmacros.h>
/* functions */
rtems_task Init(
rtems_task_argument argument
);
rtems_task Init( rtems_task_argument argument );
#include <timesys.h>
@@ -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
+49 -58
View File
@@ -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;
+3 -6
View File
@@ -29,14 +29,11 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <tmacros.h>
/* functions */
rtems_task Init(
rtems_task_argument argument
);
rtems_task Init( rtems_task_argument argument );
#include <timesys.h>
@@ -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
+39 -49
View File
@@ -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();
+3 -6
View File
@@ -29,14 +29,11 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <tmacros.h>
/* functions */
rtems_task Init(
rtems_task_argument argument
);
rtems_task Init( rtems_task_argument argument );
#include <timesys.h>
@@ -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
+38 -47
View File
@@ -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
);
}
+3 -6
View File
@@ -29,14 +29,11 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <tmacros.h>
/* functions */
rtems_task Init(
rtems_task_argument argument
);
rtems_task Init( rtems_task_argument argument );
#include <timesys.h>
@@ -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
+40 -49
View File
@@ -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();
+3 -6
View File
@@ -29,14 +29,11 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <tmacros.h>
/* functions */
rtems_task Init(
rtems_task_argument argument
);
rtems_task Init( rtems_task_argument argument );
#include <timesys.h>
@@ -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
+38 -46
View File
@@ -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
);
}
+3 -6
View File
@@ -29,25 +29,22 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <tmacros.h>
/* functions */
rtems_task Init(
rtems_task_argument argument
);
rtems_task Init( rtems_task_argument argument );
#include <timesys.h>
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
+49 -64
View File
@@ -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();
+3 -6
View File
@@ -29,25 +29,22 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <tmacros.h>
/* functions */
rtems_task Init(
rtems_task_argument argument
);
rtems_task Init( rtems_task_argument argument );
#include <timesys.h>
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
+20 -30
View File
@@ -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;
+3 -6
View File
@@ -29,25 +29,22 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <tmacros.h>
/* functions */
rtems_task Init(
rtems_task_argument argument
);
rtems_task Init( rtems_task_argument argument );
#include <timesys.h>
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
+31 -39
View File
@@ -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(
+2 -5
View File
@@ -29,14 +29,11 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <tmacros.h>
/* functions */
rtems_task Init(
rtems_task_argument argument
);
rtems_task Init( rtems_task_argument argument );
#include <timesys.h>
@@ -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
+20 -33
View File
@@ -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;
+3 -6
View File
@@ -29,25 +29,22 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <tmacros.h>
/* functions */
rtems_task Init(
rtems_task_argument argument
);
rtems_task Init( rtems_task_argument argument );
#include <timesys.h>
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
+23 -67
View File
@@ -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;
+5 -8
View File
@@ -29,18 +29,15 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <tmacros.h>
/* functions */
rtems_task Init(
rtems_task_argument argument
);
rtems_task Init( rtems_task_argument argument );
#include <timesys.h>
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
+115 -164
View File
@@ -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(
+11 -15
View File
@@ -29,35 +29,31 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <tmacros.h>
/* functions */
rtems_task Init(
rtems_task_argument argument
);
rtems_task Init( rtems_task_argument argument );
#include <timesys.h>
/* 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
+37 -34
View File
@@ -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(
+5 -9
View File
@@ -29,16 +29,13 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <tmacros.h>
/* 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 <timesys.h>
@@ -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 <rtems/confdefs.h>
+29 -54
View File
@@ -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 */
}
+3 -6
View File
@@ -29,14 +29,11 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <tmacros.h>
/* functions */
rtems_task Init(
rtems_task_argument argument
);
rtems_task Init( rtems_task_argument argument );
#include <timesys.h>
@@ -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
+89 -75
View File
@@ -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<OPERATION_COUNT ; i++ )
benchmark_timer_initialize();
for ( index=1 ; index <= OPERATION_COUNT ; index++ )
(void) rtems_timer_cancel( Timer_id[ index ] );
for ( benchmark_timer_initialize(), i = 0; i < OPERATION_COUNT; i++ ) {
benchmark_timer_initialize();
}
for ( index = 1; index <= OPERATION_COUNT; index++ ) {
(void) rtems_timer_cancel( Timer_id[ index ] );
}
end_time = benchmark_timer_read();
put_time(
@@ -203,10 +200,12 @@ rtems_task High_task(
0
);
for ( benchmark_timer_initialize(), i=0 ; i<OPERATION_COUNT ; i++ )
benchmark_timer_initialize();
for ( index=1 ; index <= OPERATION_COUNT ; index++ )
(void) rtems_timer_reset( Timer_id[ index ] );
for ( benchmark_timer_initialize(), i = 0; i < OPERATION_COUNT; i++ ) {
benchmark_timer_initialize();
}
for ( index = 1; index <= OPERATION_COUNT; index++ ) {
(void) rtems_timer_reset( Timer_id[ index ] );
}
end_time = benchmark_timer_read();
put_time(
@@ -218,8 +217,9 @@ rtems_task High_task(
);
benchmark_timer_initialize();
for ( index=1 ; index <= OPERATION_COUNT ; index++ )
(void) rtems_timer_reset( Timer_id[ index ] );
for ( index = 1; index <= OPERATION_COUNT; index++ ) {
(void) rtems_timer_reset( Timer_id[ index ] );
}
end_time = benchmark_timer_read();
put_time(
@@ -230,8 +230,9 @@ rtems_task High_task(
0
);
for ( index=1 ; index <= OPERATION_COUNT ; index++ )
for ( index = 1; index <= OPERATION_COUNT; index++ ) {
(void) rtems_timer_reset( Timer_id[ index ] );
}
build_time( &time_of_day, 12, 31, 1988, 9, 0, 0, 0 );
@@ -241,9 +242,14 @@ rtems_task High_task(
time_of_day.year = 1989;
benchmark_timer_initialize();
for ( index=1 ; index <= OPERATION_COUNT ; index++ )
(void) rtems_timer_fire_when(
Timer_id[ index ], &time_of_day, null_delay, NULL );
for ( index = 1; index <= OPERATION_COUNT; index++ ) {
(void) rtems_timer_fire_when(
Timer_id[ index ],
&time_of_day,
null_delay,
NULL
);
}
end_time = benchmark_timer_read();
put_time(
@@ -255,9 +261,14 @@ rtems_task High_task(
);
benchmark_timer_initialize();
for ( index=1 ; index <= OPERATION_COUNT ; index++ )
(void) rtems_timer_fire_when(
Timer_id[ index ], &time_of_day, null_delay, NULL );
for ( index = 1; index <= OPERATION_COUNT; index++ ) {
(void) rtems_timer_fire_when(
Timer_id[ index ],
&time_of_day,
null_delay,
NULL
);
}
end_time = benchmark_timer_read();
put_time(
@@ -269,8 +280,9 @@ rtems_task High_task(
);
benchmark_timer_initialize();
for ( index=1 ; index <= OPERATION_COUNT ; index++ )
(void) rtems_timer_delete( Timer_id[ index ] );
for ( index = 1; index <= OPERATION_COUNT; index++ ) {
(void) rtems_timer_delete( Timer_id[ index ] );
}
end_time = benchmark_timer_read();
put_time(
@@ -282,11 +294,16 @@ rtems_task High_task(
);
benchmark_timer_initialize();
for ( index=1 ; index <= OPERATION_COUNT ; index++ ) {
for ( index = 1; index <= OPERATION_COUNT; index++ ) {
status = rtems_timer_create( index, &Timer_id[ index ] );
directive_failed( status, "rtems_timer_create" );
status = rtems_timer_fire_after( Timer_id[ index ], 500, null_delay, NULL );
status = rtems_timer_fire_after(
Timer_id[ index ],
500,
null_delay,
NULL
);
directive_failed( status, "rtems_timer_fire_after" );
status = rtems_timer_cancel( Timer_id[ index ] );
@@ -294,8 +311,9 @@ rtems_task High_task(
}
benchmark_timer_initialize();
for ( index=1 ; index <= OPERATION_COUNT ; index++ )
(void) rtems_timer_delete( Timer_id[ index ] );
for ( index = 1; index <= OPERATION_COUNT; index++ ) {
(void) rtems_timer_delete( Timer_id[ index ] );
}
end_time = benchmark_timer_read();
put_time(
@@ -307,21 +325,17 @@ rtems_task High_task(
);
benchmark_timer_initialize();
(void) rtems_task_wake_when( &time_of_day );
(void) rtems_task_wake_when( &time_of_day );
}
rtems_task Middle_tasks(
rtems_task_argument argument
)
rtems_task Middle_tasks( rtems_task_argument argument )
{
(void) argument;
(void) rtems_task_wake_when( &time_of_day );
}
rtems_task Low_task(
rtems_task_argument argument
)
rtems_task Low_task( rtems_task_argument argument )
{
(void) argument;
+2 -5
View File
@@ -29,14 +29,11 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <tmacros.h>
/* functions */
rtems_task Init(
rtems_task_argument argument
);
rtems_task Init( rtems_task_argument argument );
#include <timesys.h>
@@ -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
+20 -28
View File
@@ -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 );
+3 -6
View File
@@ -29,14 +29,11 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <tmacros.h>
/* functions */
rtems_task Init(
rtems_task_argument argument
);
rtems_task Init( rtems_task_argument argument );
#include <timesys.h>
@@ -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

Some files were not shown because too many files have changed in this diff Show More