OpenCores
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/sp15
    from Rev 30 to Rev 173
    Reverse comparison

Rev 30 → Rev 173

/init.c
0,0 → 1,77
/* 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:33 chris Exp $
*/
 
#define TEST_INIT
#include "system.h"
 
rtems_task Init(
rtems_task_argument argument
)
{
rtems_status_code status;
 
puts( "\n\n*** TEST 15 ***" );
 
Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' );
 
Partition_name[ 1 ] = rtems_build_name( 'P', 'T', '1', ' ' );
Partition_name[ 2 ] = rtems_build_name( 'P', 'T', '2', ' ' );
 
status = rtems_task_create(
Task_name[ 1 ],
4,
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" );
 
puts("INIT - rtems_partition_create - partition 1");
status = rtems_partition_create(
Partition_name[ 1 ],
Area_1,
4096,
512,
RTEMS_DEFAULT_ATTRIBUTES,
&Partition_id[ 1 ]
);
directive_failed( status, "rtems_partition_create of PT1" );
 
puts("INIT - rtems_partition_create - partition 2");
status = rtems_partition_create(
Partition_name[ 2 ],
Area_2,
274,
128,
RTEMS_DEFAULT_ATTRIBUTES,
&Partition_id[ 2 ]
);
directive_failed( status, "rtems_partition_create of PT2" );
 
status = rtems_task_delete( RTEMS_SELF );
directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
}
/task1.c
0,0 → 1,128
/* Task_1
*
* This routine serves as a test task. It tests the partition 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:33 chris Exp $
*/
 
#include "system.h"
 
rtems_task Task_1(
rtems_task_argument argument
)
{
rtems_id ptid_1;
rtems_id ptid_2;
void *buffer_address_1;
void *buffer_address_2;
void *buffer_address_3;
void *buffer_address_4;
rtems_status_code status;
 
puts_nocr( "TA1 - rtems_partition_ident - partition 1 id = " );
status = rtems_partition_ident(
Partition_name[ 1 ],
RTEMS_SEARCH_ALL_NODES,
&ptid_1
);
directive_failed( status, "rtems_partition_ident of PT1" );
printf( "%08x\n", ptid_1 );
 
puts_nocr( "TA1 - rtems_partition_ident - partition 2 id = " );
status = rtems_partition_ident(
Partition_name[ 2 ],
RTEMS_SEARCH_ALL_NODES,
&ptid_2
);
directive_failed( status, "rtems_partition_ident of PT2" );
printf( "%08x\n", ptid_2 );
 
puts_nocr(
"TA1 - rtems_partition_get_buffer - buffer 1 from partition 1 - "
);
status = rtems_partition_get_buffer( ptid_1, &buffer_address_1 );
directive_failed( status, "rtems_partition_get_buffer" );
Put_address_from_area_1( buffer_address_1 );
new_line;
 
puts_nocr(
"TA1 - rtems_partition_get_buffer - buffer 2 from partition 1 - "
);
status = rtems_partition_get_buffer( ptid_1, &buffer_address_2 );
directive_failed( status, "rtems_partition_get_buffer" );
Put_address_from_area_1( buffer_address_2 );
new_line;
 
puts_nocr(
"TA1 - rtems_partition_get_buffer - buffer 1 from partition 2 - "
);
status = rtems_partition_get_buffer( ptid_2, &buffer_address_3 );
directive_failed( status, "rtems_partition_get_buffer" );
Put_address_from_area_2( buffer_address_3 );
new_line;
 
puts_nocr(
"TA1 - rtems_partition_get_buffer - buffer 2 from partition 2 - "
);
status = rtems_partition_get_buffer( ptid_2, &buffer_address_4 );
directive_failed( status, "rtems_partition_get_buffer" );
Put_address_from_area_2( buffer_address_4 );
new_line;
 
puts_nocr(
"TA1 - rtems_partition_return_buffer - buffer 1 to partition 1 - "
);
Put_address_from_area_1( buffer_address_1 );
new_line;
status = rtems_partition_return_buffer( ptid_1, buffer_address_1 );
directive_failed( status, "rtems_partition_return_buffer" );
 
puts_nocr(
"TA1 - rtems_partition_return_buffer - buffer 2 to partition 1 - "
);
Put_address_from_area_1( buffer_address_2 );
new_line;
status = rtems_partition_return_buffer( ptid_1, buffer_address_2 );
directive_failed( status, "rtems_partition_return_buffer" );
 
puts_nocr(
"TA1 - rtems_partition_return_buffer - buffer 1 to partition 2 - "
);
Put_address_from_area_2( buffer_address_3 );
new_line;
status = rtems_partition_return_buffer( ptid_2, buffer_address_3 );
directive_failed( status, "rtems_partition_return_buffer" );
 
puts_nocr(
"TA1 - rtems_partition_return_buffer - buffer 2 to partition 2 - "
);
Put_address_from_area_2( buffer_address_4 );
new_line;
status = rtems_partition_return_buffer( ptid_2, buffer_address_4 );
directive_failed( status, "rtems_partition_return_buffer" );
 
puts( "TA1 - rtems_partition_delete - delete partition 1"
);
status = rtems_partition_delete( ptid_1 );
directive_failed( status, "rtems_partition_delete" );
 
puts( "TA1 - rtems_partition_delete - delete partition 2"
);
status = rtems_partition_delete( ptid_2 );
directive_failed( status, "rtems_partition_delete" );
 
puts( "*** END OF TEST 15 ***" );
exit( 0 );
}
/Makefile.am
0,0 → 1,38
##
## $Id: Makefile.am,v 1.2 2001-09-27 12:02:33 chris Exp $
##
 
AUTOMAKE_OPTIONS = foreign 1.4
 
TEST = sp15
 
MANAGERS = io partition
 
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
 
${PGM}: $(OBJS) $(LINK_FILES)
$(make-exe)
 
all-local: $(ARCH) $(TMPINSTALL_FILES)
 
EXTRA_DIST = $(C_FILES) $(DOCS)
 
include $(top_srcdir)/../../../../automake/local.am
/sp15.scn
0,0 → 1,16
*** TEST 15 ***
INIT - rtems_partition_create - partition 1
INIT - rtems_partition_create - partition 2
TA1 - rtems_partition_ident - partition 1 id = 20010001
TA1 - rtems_partition_ident - partition 2 id = 20010002
TA1 - rtems_partition_get_buffer - buffer 1 from partition 1 - 0x00000000
TA1 - rtems_partition_get_buffer - buffer 2 from partition 1 - 0x00000200
TA1 - rtems_partition_get_buffer - buffer 1 from partition 2 - 0x00000000
TA1 - rtems_partition_get_buffer - buffer 2 from partition 2 - 0x00000080
TA1 - rtems_partition_return_buffer - buffer 1 to partition 1 - 0x00000000
TA1 - rtems_partition_return_buffer - buffer 2 to partition 1 - 0x00000200
TA1 - rtems_partition_return_buffer - buffer 1 to partition 2 - 0x00000000
TA1 - rtems_partition_return_buffer - buffer 2 to partition 2 - 0x00000080
TA1 - rtems_partition_delete - delete partition 1
TA1 - rtems_partition_delete - delete partition 2
*** END OF TEST 15 ***
/system.h
0,0 → 1,60
/* 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:33 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_MAXIMUM_TASKS 2
#define CONFIGURE_MAXIMUM_PARTITIONS 2
#define CONFIGURE_TICKS_PER_TIMESLICE 100
 
#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 */
 
TEST_EXTERN rtems_name Partition_id[ 4 ]; /* array of partition ids */
TEST_EXTERN rtems_name Partition_name[ 4 ]; /* array of partition names */
TEST_EXTERN rtems_unsigned8 Area_1[4096] CPU_STRUCTURE_ALIGNMENT;
TEST_EXTERN rtems_unsigned8 Area_2[274] CPU_STRUCTURE_ALIGNMENT;
#define Put_address_from_area_1( _to_be_printed ) \
printf( "0x%08lx", \
(unsigned long)((rtems_unsigned8 *)(_to_be_printed) - Area_1 ) )
#define Put_address_from_area_2( _to_be_printed ) \
printf( "0x%08lx", \
(unsigned long)((rtems_unsigned8 *)(_to_be_printed) - Area_2 ) )
/* end of include file */
/sp15.doc
0,0 → 1,23
#
# $Id: sp15.doc,v 1.7 1999/11/17 17:51:32 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: test15
 
directives:
ex_init, ex_start, t_create, t_start, t_delete, tm_tick, i_return,
pt_create, pt_ident, pt_getbuf, pt_retbuf, pt_delete
 
concepts:
 
a. This test checks out the partition manager.

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.