forked from Imagelibrary/rtems
Gutted test of rtems api calls and added comments to indicate what the test
should do in their place. It now compiles and links.
This commit is contained in:
@@ -22,65 +22,21 @@
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#define TEST_INIT
|
||||
#define CONFIGURE_INIT
|
||||
#include "system.h"
|
||||
|
||||
rtems_task Init(
|
||||
rtems_task_argument argument
|
||||
void Init(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
rtems_time_of_day time;
|
||||
rtems_status_code status;
|
||||
|
||||
puts( "\n\n*** TEST 1 ***" );
|
||||
puts( "\n\n*** POSIX TEST 1 ***" );
|
||||
|
||||
build_time( &time, 12, 31, 1988, 9, 0, 0, 0 );
|
||||
status = rtems_clock_set( &time );
|
||||
directive_failed( status, "rtems_clock_set" );
|
||||
/* set the time of day */
|
||||
|
||||
Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' );
|
||||
Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' );
|
||||
Task_name[ 3 ] = rtems_build_name( 'T', 'A', '3', ' ' );
|
||||
/* create the three tasks */
|
||||
|
||||
status = rtems_task_create(
|
||||
Task_name[ 1 ],
|
||||
1,
|
||||
RTEMS_MINIMUM_STACK_SIZE,
|
||||
RTEMS_INTERRUPT_LEVEL(31),
|
||||
RTEMS_DEFAULT_ATTRIBUTES,
|
||||
&Task_id[ 1 ]
|
||||
);
|
||||
directive_failed( status, "rtems_task_create of TA1" );
|
||||
/* exit */
|
||||
|
||||
status = rtems_task_create(
|
||||
Task_name[ 2 ],
|
||||
1,
|
||||
RTEMS_MINIMUM_STACK_SIZE * 2,
|
||||
RTEMS_DEFAULT_MODES,
|
||||
RTEMS_DEFAULT_ATTRIBUTES,
|
||||
&Task_id[ 2 ]
|
||||
);
|
||||
directive_failed( status, "rtems_task_create of TA2" );
|
||||
|
||||
status = rtems_task_create(
|
||||
Task_name[ 3 ],
|
||||
1,
|
||||
RTEMS_MINIMUM_STACK_SIZE * 3,
|
||||
RTEMS_DEFAULT_MODES,
|
||||
RTEMS_DEFAULT_ATTRIBUTES,
|
||||
&Task_id[ 3 ]
|
||||
);
|
||||
directive_failed( status, "rtems_task_create of TA3" );
|
||||
|
||||
status = rtems_task_start( Task_id[ 1 ], Task_1_through_3, 0 );
|
||||
directive_failed( status, "rtems_task_start of TA1" );
|
||||
|
||||
status = rtems_task_start( Task_id[ 2 ], Task_1_through_3, 0 );
|
||||
directive_failed( status, "rtems_task_start of TA2" );
|
||||
|
||||
status = rtems_task_start( Task_id[ 3 ], Task_1_through_3, 0 );
|
||||
directive_failed( status, "rtems_task_start of TA3" );
|
||||
|
||||
status = rtems_task_delete( RTEMS_SELF );
|
||||
directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
|
||||
pthread_exit( NULL );
|
||||
}
|
||||
|
||||
@@ -14,16 +14,18 @@
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <tmacros.h>
|
||||
|
||||
/* functions */
|
||||
|
||||
rtems_task Init(
|
||||
rtems_task_argument argument
|
||||
#include <bsp.h>
|
||||
#include <pthread.h>
|
||||
#include <stdio.h>
|
||||
|
||||
void Init(
|
||||
void *argument
|
||||
);
|
||||
|
||||
rtems_task Task_1_through_3(
|
||||
rtems_task_argument argument
|
||||
void Task_1_through_3(
|
||||
void *argument
|
||||
);
|
||||
|
||||
/* configuration information */
|
||||
@@ -33,11 +35,12 @@ rtems_task Task_1_through_3(
|
||||
#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
|
||||
|
||||
#define CONFIGURE_HAS_OWN_INIT_TASK_TABLE
|
||||
#define CONFIGURE_INIT_TASK_TABLE_SIZE 0
|
||||
#define CONFIGURE_INIT_TASK_TABLE NULL
|
||||
|
||||
#include <confdefs.h>
|
||||
|
||||
/* global variables */
|
||||
|
||||
TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
|
||||
TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
|
||||
|
||||
/* end of include file */
|
||||
|
||||
@@ -21,30 +21,25 @@
|
||||
|
||||
#include "system.h"
|
||||
|
||||
rtems_task Task_1_through_3(
|
||||
rtems_task_argument argument
|
||||
void Task_1_through_3(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
rtems_id tid;
|
||||
rtems_time_of_day time;
|
||||
rtems_status_code status;
|
||||
int seconds;
|
||||
|
||||
status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
|
||||
directive_failed( status, "rtems_task_ident" );
|
||||
for ( ; ; ) {
|
||||
/* grab the tod */
|
||||
|
||||
while( FOREVER ) {
|
||||
status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
|
||||
directive_failed( status, "rtems_clock_get" );
|
||||
/* if we have run longer 35 seconds exit */
|
||||
|
||||
if ( time.second >= 35 ) {
|
||||
puts( "*** END OF TEST 1 ***" );
|
||||
if ( seconds >= 35 ) {
|
||||
puts( "*** END OF POSIX TEST 1 ***" );
|
||||
exit( 0 );
|
||||
}
|
||||
|
||||
put_name( Task_name[ task_number( tid ) ], FALSE );
|
||||
print_time( " - rtems_clock_get - ", &time, "\n" );
|
||||
/* put our task number and the current time */
|
||||
|
||||
status = rtems_task_wake_after( task_number( tid ) * 5 * TICKS_PER_SECOND );
|
||||
directive_failed( status, "rtems_task_wake_after" );
|
||||
/* delay based on our thread number */
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,65 +22,21 @@
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#define TEST_INIT
|
||||
#define CONFIGURE_INIT
|
||||
#include "system.h"
|
||||
|
||||
rtems_task Init(
|
||||
rtems_task_argument argument
|
||||
void Init(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
rtems_time_of_day time;
|
||||
rtems_status_code status;
|
||||
|
||||
puts( "\n\n*** TEST 1 ***" );
|
||||
puts( "\n\n*** POSIX TEST 1 ***" );
|
||||
|
||||
build_time( &time, 12, 31, 1988, 9, 0, 0, 0 );
|
||||
status = rtems_clock_set( &time );
|
||||
directive_failed( status, "rtems_clock_set" );
|
||||
/* set the time of day */
|
||||
|
||||
Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' );
|
||||
Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' );
|
||||
Task_name[ 3 ] = rtems_build_name( 'T', 'A', '3', ' ' );
|
||||
/* create the three tasks */
|
||||
|
||||
status = rtems_task_create(
|
||||
Task_name[ 1 ],
|
||||
1,
|
||||
RTEMS_MINIMUM_STACK_SIZE,
|
||||
RTEMS_INTERRUPT_LEVEL(31),
|
||||
RTEMS_DEFAULT_ATTRIBUTES,
|
||||
&Task_id[ 1 ]
|
||||
);
|
||||
directive_failed( status, "rtems_task_create of TA1" );
|
||||
/* exit */
|
||||
|
||||
status = rtems_task_create(
|
||||
Task_name[ 2 ],
|
||||
1,
|
||||
RTEMS_MINIMUM_STACK_SIZE * 2,
|
||||
RTEMS_DEFAULT_MODES,
|
||||
RTEMS_DEFAULT_ATTRIBUTES,
|
||||
&Task_id[ 2 ]
|
||||
);
|
||||
directive_failed( status, "rtems_task_create of TA2" );
|
||||
|
||||
status = rtems_task_create(
|
||||
Task_name[ 3 ],
|
||||
1,
|
||||
RTEMS_MINIMUM_STACK_SIZE * 3,
|
||||
RTEMS_DEFAULT_MODES,
|
||||
RTEMS_DEFAULT_ATTRIBUTES,
|
||||
&Task_id[ 3 ]
|
||||
);
|
||||
directive_failed( status, "rtems_task_create of TA3" );
|
||||
|
||||
status = rtems_task_start( Task_id[ 1 ], Task_1_through_3, 0 );
|
||||
directive_failed( status, "rtems_task_start of TA1" );
|
||||
|
||||
status = rtems_task_start( Task_id[ 2 ], Task_1_through_3, 0 );
|
||||
directive_failed( status, "rtems_task_start of TA2" );
|
||||
|
||||
status = rtems_task_start( Task_id[ 3 ], Task_1_through_3, 0 );
|
||||
directive_failed( status, "rtems_task_start of TA3" );
|
||||
|
||||
status = rtems_task_delete( RTEMS_SELF );
|
||||
directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
|
||||
pthread_exit( NULL );
|
||||
}
|
||||
|
||||
@@ -14,16 +14,18 @@
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include <tmacros.h>
|
||||
|
||||
/* functions */
|
||||
|
||||
rtems_task Init(
|
||||
rtems_task_argument argument
|
||||
#include <bsp.h>
|
||||
#include <pthread.h>
|
||||
#include <stdio.h>
|
||||
|
||||
void Init(
|
||||
void *argument
|
||||
);
|
||||
|
||||
rtems_task Task_1_through_3(
|
||||
rtems_task_argument argument
|
||||
void Task_1_through_3(
|
||||
void *argument
|
||||
);
|
||||
|
||||
/* configuration information */
|
||||
@@ -33,11 +35,12 @@ rtems_task Task_1_through_3(
|
||||
#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
|
||||
#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
|
||||
|
||||
#define CONFIGURE_HAS_OWN_INIT_TASK_TABLE
|
||||
#define CONFIGURE_INIT_TASK_TABLE_SIZE 0
|
||||
#define CONFIGURE_INIT_TASK_TABLE NULL
|
||||
|
||||
#include <confdefs.h>
|
||||
|
||||
/* global variables */
|
||||
|
||||
TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */
|
||||
TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */
|
||||
|
||||
/* end of include file */
|
||||
|
||||
@@ -21,30 +21,25 @@
|
||||
|
||||
#include "system.h"
|
||||
|
||||
rtems_task Task_1_through_3(
|
||||
rtems_task_argument argument
|
||||
void Task_1_through_3(
|
||||
void *argument
|
||||
)
|
||||
{
|
||||
rtems_id tid;
|
||||
rtems_time_of_day time;
|
||||
rtems_status_code status;
|
||||
int seconds;
|
||||
|
||||
status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
|
||||
directive_failed( status, "rtems_task_ident" );
|
||||
for ( ; ; ) {
|
||||
/* grab the tod */
|
||||
|
||||
while( FOREVER ) {
|
||||
status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
|
||||
directive_failed( status, "rtems_clock_get" );
|
||||
/* if we have run longer 35 seconds exit */
|
||||
|
||||
if ( time.second >= 35 ) {
|
||||
puts( "*** END OF TEST 1 ***" );
|
||||
if ( seconds >= 35 ) {
|
||||
puts( "*** END OF POSIX TEST 1 ***" );
|
||||
exit( 0 );
|
||||
}
|
||||
|
||||
put_name( Task_name[ task_number( tid ) ], FALSE );
|
||||
print_time( " - rtems_clock_get - ", &time, "\n" );
|
||||
/* put our task number and the current time */
|
||||
|
||||
status = rtems_task_wake_after( task_number( tid ) * 5 * TICKS_PER_SECOND );
|
||||
directive_failed( status, "rtems_task_wake_after" );
|
||||
/* delay based on our thread number */
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user