URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
Compare Revisions
- This comparison shows the changes necessary to convert path
/openrisc/trunk/rtos/rtems/c/src/tests/sptests/sp21
- from Rev 30 to Rev 173
- ↔ Reverse comparison
Rev 30 → Rev 173
/init.c
0,0 → 1,52
/* Init |
* |
* This routine is the initialization task for this test program. |
* It is a user initialization task and has the responsibility for creating |
* and starting the tasks that make up the test. If the time of day |
* clock is required for the test, it should also be set to a known |
* value by this function. |
* |
* Input parameters: |
* argument - task argument |
* |
* Output parameters: NONE |
* |
* COPYRIGHT (c) 1989-1999. |
* On-Line Applications Research Corporation (OAR). |
* |
* The license and distribution terms for this file may be |
* found in the file LICENSE in this distribution or at |
* http://www.OARcorp.com/rtems/license.html. |
* |
* $Id: init.c,v 1.2 2001-09-27 12:02:35 chris Exp $ |
*/ |
|
#define TEST_INIT |
#include "system.h" |
|
rtems_task Init( |
rtems_task_argument argument |
) |
{ |
rtems_status_code status; |
|
puts( "\n\n*** TEST 21 ***" ); |
|
Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' ); |
|
status = rtems_task_create( |
Task_name[ 1 ], |
1, |
RTEMS_MINIMUM_STACK_SIZE, |
RTEMS_DEFAULT_MODES, |
RTEMS_DEFAULT_ATTRIBUTES, |
&Task_id[ 1 ] |
); |
directive_failed( status, "rtems_task_create of TA1" ); |
|
status = rtems_task_start( Task_id[ 1 ], Task_1, 0 ); |
directive_failed( status, "rtems_task_start of TA1" ); |
|
status = rtems_task_delete( RTEMS_SELF ); |
directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); |
} |
/task1.c
0,0 → 1,104
/* Task_1 |
* |
* This routine serves as a test task. It tests the I/O manager. |
* |
* Input parameters: |
* argument - task argument |
* |
* Output parameters: NONE |
* |
* COPYRIGHT (c) 1989-1999. |
* On-Line Applications Research Corporation (OAR). |
* |
* The license and distribution terms for this file may be |
* found in the file LICENSE in this distribution or at |
* http://www.OARcorp.com/rtems/license.html. |
* |
* $Id: task1.c,v 1.2 2001-09-27 12:02:35 chris Exp $ |
*/ |
|
#include "system.h" |
|
#define STUB_DRIVER_MAJOR 0x2 |
#define NO_DRIVER_MAJOR 0x3 |
#define INVALID_DRIVER_MAJOR 0x5 |
|
rtems_task Task_1( |
rtems_task_argument argument |
) |
{ |
rtems_status_code status; |
|
puts( "----- TESTING THE NULL DRIVER CHECKS -----" ); |
|
status = rtems_io_initialize( NO_DRIVER_MAJOR, 0, NULL ); |
directive_failed( status, "rtems_io_initialize" ); |
puts( "TA1 - rtems_io_initialize - NULL DRIVER RTEMS_SUCCESSFUL" ); |
|
status = rtems_io_open( NO_DRIVER_MAJOR, 0, NULL ); |
directive_failed( status, "rtems_io_open" ); |
puts( "TA1 - rtems_io_open - NULL DRIVER RTEMS_SUCCESSFUL" ); |
|
status = rtems_io_close( NO_DRIVER_MAJOR, 0, NULL ); |
directive_failed( status, "rtems_io_close" ); |
puts( "TA1 - rtems_io_close - NULL DRIVER RTEMS_SUCCESSFUL" ); |
|
status = rtems_io_read( NO_DRIVER_MAJOR, 0, NULL ); |
directive_failed( status, "rtems_io_read" ); |
puts( "TA1 - rtems_io_read - NULL DRIVER RTEMS_SUCCESSFUL" ); |
|
status = rtems_io_write( NO_DRIVER_MAJOR, 0, NULL ); |
directive_failed( status, "rtems_io_write" ); |
puts( "TA1 - rtems_io_write - NULL DRIVER RTEMS_SUCCESSFUL" ); |
|
status = rtems_io_control( NO_DRIVER_MAJOR, 0, NULL ); |
directive_failed( status, "rtems_io_control" ); |
puts( "TA1 - rtems_io_control - NULL DRIVER RTEMS_SUCCESSFUL" ); |
|
puts( "----- TESTING THE I/O MANAGER DIRECTIVES -----" ); |
|
status = rtems_io_initialize( STUB_DRIVER_MAJOR, 0, NULL ); |
directive_failed( status, "rtems_io_initialize" ); |
puts( "TA1 - rtems_io_initialize - STUB DRIVER RTEMS_SUCCESSFUL" ); |
|
status = rtems_io_open( STUB_DRIVER_MAJOR, 0, NULL ); |
directive_failed( status, "rtems_io_open" ); |
puts( "TA1 - rtems_io_open - STUB DRIVER RTEMS_SUCCESSFUL" ); |
|
status = rtems_io_close( STUB_DRIVER_MAJOR, 0, NULL ); |
directive_failed( status, "rtems_io_close" ); |
puts( "TA1 - rtems_io_close - STUB DRIVER RTEMS_SUCCESSFUL" ); |
|
status = rtems_io_read( STUB_DRIVER_MAJOR, 0, NULL ); |
directive_failed( status, "rtems_io_read" ); |
puts( "TA1 - rtems_io_read - STUB DRIVER RTEMS_SUCCESSFUL" ); |
|
status = rtems_io_write( STUB_DRIVER_MAJOR, 0, NULL ); |
directive_failed( status, "rtems_io_write" ); |
puts( "TA1 - rtems_io_write - STUB DRIVER RTEMS_SUCCESSFUL" ); |
|
status = rtems_io_control( STUB_DRIVER_MAJOR, 0, NULL ); |
directive_failed( status, "rtems_io_control" ); |
puts( "TA1 - rtems_io_control - STUB DRIVER RTEMS_SUCCESSFUL" ); |
|
puts( "----- RETURNING INVALID MAJOR NUMBER -----" ); |
|
status = rtems_io_initialize( INVALID_DRIVER_MAJOR, 0, NULL ); |
fatal_directive_status( |
status, |
RTEMS_INVALID_NUMBER, |
"rtems_io_initialize" |
); |
puts( "TA1 - rtems_io_initialize - RTEMS_INVALID_NUMBER" ); |
|
status = rtems_io_open( INVALID_DRIVER_MAJOR, 0, NULL ); |
fatal_directive_status( |
status, |
RTEMS_INVALID_NUMBER, |
"rtems_io_open" |
); |
puts( "TA1 - rtems_io_open - RTEMS_INVALID_NUMBER" ); |
|
puts( "*** END OF TEST 21 ***" ); |
exit( 0 ); |
} |
/sp21.scn
0,0 → 1,19
*** TEST 21 *** |
----- TESTING THE NULL DRIVER CHECKS ----- |
TA1 - rtems_io_initialize - NULL DRIVER RTEMS_SUCCESSFUL |
TA1 - rtems_io_open - NULL DRIVER RTEMS_SUCCESSFUL |
TA1 - rtems_io_close - NULL DRIVER RTEMS_SUCCESSFUL |
TA1 - rtems_io_read - NULL DRIVER RTEMS_SUCCESSFUL |
TA1 - rtems_io_write - NULL DRIVER RTEMS_SUCCESSFUL |
TA1 - rtems_io_control - NULL DRIVER RTEMS_SUCCESSFUL |
----- TESTING THE I/O MANAGER DIRECTIVES ----- |
TA1 - rtems_io_initialize - STUB DRIVER RTEMS_SUCCESSFUL |
TA1 - rtems_io_open - STUB DRIVER RTEMS_SUCCESSFUL |
TA1 - rtems_io_close - STUB DRIVER RTEMS_SUCCESSFUL |
TA1 - rtems_io_read - STUB DRIVER RTEMS_SUCCESSFUL |
TA1 - rtems_io_write - STUB DRIVER RTEMS_SUCCESSFUL |
TA1 - rtems_io_control - STUB DRIVER RTEMS_SUCCESSFUL |
----- RETURNING INVALID MAJOR NUMBER ----- |
TA1 - rtems_io_initialize - RTEMS_INVALID_NUMBER |
TA1 - rtems_io_open - RTEMS_INVALID_NUMBER |
*** END OF TEST 21 *** |
/Makefile.am
0,0 → 1,40
## |
## $Id: Makefile.am,v 1.2 2001-09-27 12:02:35 chris Exp $ |
## |
|
AUTOMAKE_OPTIONS = foreign 1.4 |
|
TEST = sp21 |
|
MANAGERS = io |
|
C_FILES = init.c task1.c |
C_O_FILES = $(C_FILES:%.c=${ARCH}/%.o) |
|
H_FILES = system.h |
noinst_HEADERS = $(H_FILES) |
|
DOCTYPES = scn doc |
DOCS = $(DOCTYPES:%=$(TEST).%) |
|
SRCS = $(C_FILES) $(H_FILES) |
OBJS = $(C_O_FILES) |
|
PRINT_SRCS = $(DOCS) |
|
PGM = ${ARCH}/$(TEST).exe |
|
include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg |
include $(RTEMS_ROOT)/make/leaf.cfg |
include $(top_srcdir)/sptests.am |
|
LD_LIBS += $(PROJECT_RELEASE)/lib/libtest$(LIBSUFFIX_VA) |
|
${PGM}: $(OBJS) $(LINK_FILES) |
$(make-exe) |
|
all-local: $(ARCH) $(TMPINSTALL_FILES) |
|
EXTRA_DIST = $(C_FILES) $(DOCS) |
|
include $(top_srcdir)/../../../../automake/local.am |
/sp21.doc
0,0 → 1,27
# |
# $Id: sp21.doc,v 1.6 1999/11/17 17:51:33 joel Exp $ |
# |
# COPYRIGHT (c) 1989-1999. |
# On-Line Applications Research Corporation (OAR). |
# |
# The license and distribution terms for this file may be |
# found in the file LICENSE in this distribution or at |
# http://www.OARcorp.com/rtems/license.html. |
# |
|
|
This file describes the directives and concepts tested by this test set. |
|
test set name: test21 |
|
directives: |
ex_init, ex_start, t_create, t_start, tm_tick, i_return, t_delete |
de_init, de_open, de_close, de_read, de_write, de_cntrl |
|
concepts: |
|
a. Verifies all I/O manager directives always return successful for |
null drivers. |
|
b. Verifies all I/O manager directives call and return from the driver |
entry points in the driver address table. |
/system.h
0,0 → 1,45
/* system.h |
* |
* This include file contains information that is included in every |
* function in the test set. |
* |
* COPYRIGHT (c) 1989-1999. |
* On-Line Applications Research Corporation (OAR). |
* |
* The license and distribution terms for this file may be |
* found in the file LICENSE in this distribution or at |
* http://www.OARcorp.com/rtems/license.html. |
* |
* $Id: system.h,v 1.2 2001-09-27 12:02:35 chris Exp $ |
*/ |
|
#include <tmacros.h> |
|
/* functions */ |
|
rtems_task Init( |
rtems_task_argument argument |
); |
|
rtems_task Task_1( |
rtems_task_argument argument |
); |
|
/* configuration information */ |
|
#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER |
#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER |
#define CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER |
|
#define CONFIGURE_MAXIMUM_TASKS 2 |
|
#define CONFIGURE_RTEMS_INIT_TASKS_TABLE |
|
#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 */ |