diff options
Diffstat (limited to 'testsuites/ada/sptests/sp23')
-rw-r--r-- | testsuites/ada/sptests/sp23/Makefile.am | 16 | ||||
-rw-r--r-- | testsuites/ada/sptests/sp23/ada_sp23.scn | 9 | ||||
-rw-r--r-- | testsuites/ada/sptests/sp23/config.h | 31 | ||||
-rw-r--r-- | testsuites/ada/sptests/sp23/sp23.adb | 55 | ||||
-rw-r--r-- | testsuites/ada/sptests/sp23/sptest.adb | 175 | ||||
-rw-r--r-- | testsuites/ada/sptests/sp23/sptest.ads | 118 |
6 files changed, 404 insertions, 0 deletions
diff --git a/testsuites/ada/sptests/sp23/Makefile.am b/testsuites/ada/sptests/sp23/Makefile.am new file mode 100644 index 0000000000..ccd4bfe4ec --- /dev/null +++ b/testsuites/ada/sptests/sp23/Makefile.am @@ -0,0 +1,16 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +noinst_PROGRAMS = ada_sp23 +ada_sp23_SOURCES = sp23.adb config.h sptest.adb sptest.ads +ada_sp23_SOURCES += ../../support/init.c + +ada_sp23$(EXEEXT): sp23.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_sp23.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/sptests/sp23/ada_sp23.scn b/testsuites/ada/sptests/sp23/ada_sp23.scn new file mode 100644 index 0000000000..2fc1e74582 --- /dev/null +++ b/testsuites/ada/sptests/sp23/ada_sp23.scn @@ -0,0 +1,9 @@ +*** TEST 23 *** +INIT - port_create - DP1 - internal = 16#1000# external = 16#2000# +TA1 - port_ident - 16#3A010001# +TA1 - port_external_to_internal - external: 16#200E# => internal: 16#100E# +TA1 - port_internal_to_external - internal: 16#100E# => external: 16#200E# +TA1 - port_external_to_internal - external: 16#300E# => internal: 16#300E# +TA1 - port_internal_to_external - internal: 16#50E# => external: 16#50E# +TA1 - port_delete - DP1 +*** END OF TEST 23 *** diff --git a/testsuites/ada/sptests/sp23/config.h b/testsuites/ada/sptests/sp23/config.h new file mode 100644 index 0000000000..277e38b708 --- /dev/null +++ b/testsuites/ada/sptests/sp23/config.h @@ -0,0 +1,31 @@ +/* config.h + * + * This include file defines the Configuration Table for this test. + * + * COPYRIGHT (c) 1989-2007. + * On-Line Applications Research Corporation (OAR). + * + * The license and distribution terms for this file may in + * the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + + +/* configuration information */ + +#define CONFIGURE_SPTEST + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER + +#define CONFIGURE_MAXIMUM_TASKS 2 +#define CONFIGURE_MAXIMUM_PORTS 1 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include <rtems/confdefs.h> + +/* end of include file */ diff --git a/testsuites/ada/sptests/sp23/sp23.adb b/testsuites/ada/sptests/sp23/sp23.adb new file mode 100644 index 0000000000..5a6a728e1d --- /dev/null +++ b/testsuites/ada/sptests/sp23/sp23.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test SP23 of the Single Processor Test Suite. +-- +-- DEPENDENCIES: +-- +-- +-- +-- COPYRIGHT (c) 1989-2011. +-- On-Line Applications Research Corporation (OAR). +-- +-- The license and distribution terms for this file may in +-- the file LICENSE in this distribution or at +-- http://www.rtems.org/license/LICENSE. +-- + +with RTEMS; +with RTEMS.TASKS; +with SPTEST; +with TEST_SUPPORT; + +procedure SP23 is + INIT_ID : RTEMS.ID; + STATUS : RTEMS.STATUS_CODES; +begin + + RTEMS.TASKS.CREATE( + RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ), + 1, + RTEMS.MINIMUM_STACK_SIZE, + RTEMS.NO_PREEMPT, + RTEMS.DEFAULT_ATTRIBUTES, + INIT_ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" ); + + + RTEMS.TASKS.START( + INIT_ID, + SPTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end SP23; + diff --git a/testsuites/ada/sptests/sp23/sptest.adb b/testsuites/ada/sptests/sp23/sptest.adb new file mode 100644 index 0000000000..e3a2871ab6 --- /dev/null +++ b/testsuites/ada/sptests/sp23/sptest.adb @@ -0,0 +1,175 @@ +-- +-- SPTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 23 of the RTEMS +-- Single Processor Test Suite. +-- +-- DEPENDENCIES: +-- +-- +-- +-- COPYRIGHT (c) 1989-2011. +-- On-Line Applications Research Corporation (OAR). +-- +-- The license and distribution terms for this file may in +-- the file LICENSE in this distribution or at +-- http://www.rtems.org/license/LICENSE. +-- + +with ADDRESS_IO; +with TEST_SUPPORT; +with TEXT_IO; +with UNSIGNED32_IO; +with RTEMS.PORT; + +package body SPTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + INTERNAL_AREA : RTEMS.ADDRESS; + EXTERNAL_AREA : RTEMS.ADDRESS; + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TEST 23 ***" ); + + SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 1 ), + 1, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 1 ), + SPTEST.TASK_1'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); + + SPTEST.PORT_NAME( 1 ) := RTEMS.BUILD_NAME( 'D', 'P', '1', ' ' ); + + INTERNAL_AREA := SPTEST.INTERNAL_PORT_AREA( 0 )'ADDRESS; + EXTERNAL_AREA := SPTEST.EXTERNAL_PORT_AREA( 0 )'ADDRESS; + RTEMS.PORT.CREATE( + SPTEST.PORT_NAME( 1 ), + INTERNAL_AREA, + EXTERNAL_AREA, + SPTEST.INTERNAL_PORT_AREA'LENGTH, + SPTEST.PORT_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PORT_CREATE OF DP1" ); + TEXT_IO.PUT( "INIT - port_create - DP1 - internal = " ); + ADDRESS_IO.PUT( INTERNAL_AREA, WIDTH => 8, BASE => 16 ); + TEXT_IO.PUT( " external = " ); + ADDRESS_IO.PUT( EXTERNAL_AREA, WIDTH => 8, BASE => 16 ); + TEXT_IO.NEW_LINE; + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- TASK_1 +-- + + procedure TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + DPID : RTEMS.ID; + TO_BE_CONVERTED : RTEMS.ADDRESS; + CONVERTED : RTEMS.ADDRESS; + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.PORT.IDENT( SPTEST.PORT_NAME( 1 ), DPID, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PORT_IDENT" ); + TEXT_IO.PUT( "TA1 - port_ident - " ); + UNSIGNED32_IO.PUT( DPID, WIDTH => 8, BASE => 16 ); + TEXT_IO.NEW_LINE; + + TO_BE_CONVERTED := SPTEST.EXTERNAL_PORT_AREA( 16#E# )'ADDRESS; + RTEMS.PORT.EXTERNAL_TO_INTERNAL( + SPTEST.PORT_ID( 1 ), + TO_BE_CONVERTED, + CONVERTED, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PORT_EXTERNAL_TO_INTERNAL" ); + TEXT_IO.PUT( "TA1 - port_external_to_internal - external: " ); + ADDRESS_IO.PUT( TO_BE_CONVERTED, WIDTH => 8, BASE => 16 ); + TEXT_IO.PUT( " => internal: " ); + ADDRESS_IO.PUT( CONVERTED, WIDTH => 8, BASE => 16 ); + TEXT_IO.NEW_LINE; + + TO_BE_CONVERTED := SPTEST.INTERNAL_PORT_AREA( 16#E# )'ADDRESS; + RTEMS.PORT.INTERNAL_TO_EXTERNAL( + SPTEST.PORT_ID( 1 ), + TO_BE_CONVERTED, + CONVERTED, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PORT_INTERNAL_TO_EXTERNAL" ); + TEXT_IO.PUT( "TA1 - port_internal_to_external - internal: " ); + ADDRESS_IO.PUT( TO_BE_CONVERTED, WIDTH => 8, BASE => 16 ); + TEXT_IO.PUT( " => external: " ); + ADDRESS_IO.PUT( CONVERTED, WIDTH => 8, BASE => 16 ); + TEXT_IO.NEW_LINE; + + TO_BE_CONVERTED := SPTEST.ABOVE_PORT_AREA( 16#E# )'ADDRESS; + RTEMS.PORT.EXTERNAL_TO_INTERNAL( + SPTEST.PORT_ID( 1 ), + TO_BE_CONVERTED, + CONVERTED, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PORT_EXTERNAL_TO_INTERNAL" ); + TEXT_IO.PUT( "TA1 - port_external_to_internal - external: " ); + ADDRESS_IO.PUT( TO_BE_CONVERTED, WIDTH => 8, BASE => 16 ); + TEXT_IO.PUT( " => internal: " ); + ADDRESS_IO.PUT( CONVERTED, WIDTH => 8, BASE => 16 ); + TEXT_IO.NEW_LINE; + + TO_BE_CONVERTED := SPTEST.BELOW_PORT_AREA( 16#E# )'ADDRESS; + RTEMS.PORT.INTERNAL_TO_EXTERNAL( + SPTEST.PORT_ID( 1 ), + TO_BE_CONVERTED, + CONVERTED, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PORT_INTERNAL_TO_EXTERNAL" ); + TEXT_IO.PUT( "TA1 - port_internal_to_external - internal: " ); + ADDRESS_IO.PUT( TO_BE_CONVERTED, WIDTH => 8, BASE => 16 ); + TEXT_IO.PUT( " => external: " ); + ADDRESS_IO.PUT( CONVERTED, WIDTH => 8, BASE => 16 ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT_LINE( "TA1 - port_delete - DP1" ); + RTEMS.PORT.DELETE( SPTEST.PORT_ID( 1 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PORT_DELETE" ); + + TEXT_IO.PUT_LINE( "*** END OF TEST 23 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end TASK_1; + +end SPTEST; diff --git a/testsuites/ada/sptests/sp23/sptest.ads b/testsuites/ada/sptests/sp23/sptest.ads new file mode 100644 index 0000000000..b5faf7b87a --- /dev/null +++ b/testsuites/ada/sptests/sp23/sptest.ads @@ -0,0 +1,118 @@ +-- +-- SPTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 23 of the RTEMS +-- Single Processor Test Suite. +-- +-- DEPENDENCIES: +-- +-- +-- +-- COPYRIGHT (c) 1989-2011. +-- On-Line Applications Research Corporation (OAR). +-- +-- The license and distribution terms for this file may in +-- the file LICENSE in this distribution or at +-- http://www.rtems.org/license/LICENSE. +-- + +with RTEMS; +with RTEMS.TASKS; +with SYSTEM; +with System.Storage_Elements; + +package SPTEST is + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS tasks created +-- by this test. +-- + + TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 1 ) of RTEMS.ID; + TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 1 ) of RTEMS.NAME; + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS ports created +-- by this test. +-- + + PORT_ID : array ( RTEMS.UNSIGNED32 range 1 .. 1 ) of RTEMS.ID; + PORT_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 1 ) of RTEMS.NAME; + +-- +-- The following area defines a memory area to be used as the +-- internal address space of the port. +-- + + INTERNAL_PORT_AREA_ADDRESS : constant System.Address := + System.Storage_Elements.To_Address(16#00001000#); + + INTERNAL_PORT_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 255 ) + of RTEMS.UNSIGNED8; + for INTERNAL_PORT_AREA'Address use INTERNAL_PORT_AREA_ADDRESS; + +-- +-- The following area defines a memory area to be used as the +-- external address space of the port. +-- + + EXTERNAL_PORT_AREA_ADDRESS : constant System.Address := + System.Storage_Elements.To_Address(16#00002000#); + + EXTERNAL_PORT_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 255 ) + of RTEMS.UNSIGNED8; + for EXTERNAL_PORT_AREA'Address use EXTERNAL_PORT_AREA_ADDRESS; + +-- +-- The following area defines a memory area to be used for +-- addresses which are below the address space of the port. +-- + + BELOW_PORT_AREA_ADDRESS : constant System.Address := + System.Storage_Elements.To_Address(16#00000500#); + + BELOW_PORT_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 255 ) + of RTEMS.UNSIGNED8; + for BELOW_PORT_AREA'Address use BELOW_PORT_AREA_ADDRESS; + +-- +-- The following area defines a memory area to be used for +-- addresses which are above the address space of the port. +-- + + ABOVE_PORT_AREA_ADDRESS : constant System.Address := + System.Storage_Elements.To_Address(16#00003000#); + + ABOVE_PORT_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 255 ) + of RTEMS.UNSIGNED8; + for ABOVE_PORT_AREA'Address use ABOVE_PORT_AREA_ADDRESS; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- TASK_1 +-- +-- DESCRIPTION: +-- +-- This RTEMS task tests the Dual Ported Memory Manager. +-- + + procedure TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_1); + +end SPTEST; |