From ee537ea3dd964d4de3565a36b4857af31fb5a3f4 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 12 Oct 2017 10:00:10 +0200 Subject: ada-tests: Move to testsuites/ada This solves a build dependency issue, e.g. building tests before librtemsbsp.a exists. Close #3079. --- c/src/ada-tests/Makefile.am | 13 - c/src/ada-tests/aclocal/prog-gnat.m4 | 44 - c/src/ada-tests/ada.am | 24 - c/src/ada-tests/ada_mvscn | 64 - c/src/ada-tests/configure.ac | 159 - c/src/ada-tests/mptests/Makefile.am | 17 - c/src/ada-tests/mptests/mp01/Makefile.am | 4 - c/src/ada-tests/mptests/mp01/config_base.h | 28 - c/src/ada-tests/mptests/mp01/mp01.adb | 55 - c/src/ada-tests/mptests/mp01/mptest.adb | 230 -- c/src/ada-tests/mptests/mp01/mptest.ads | 60 - c/src/ada-tests/mptests/mp01/node1/Makefile.am | 19 - .../mptests/mp01/node1/ada_mp01-node1.scn | 15 - c/src/ada-tests/mptests/mp01/node1/config.h | 21 - c/src/ada-tests/mptests/mp01/node1/mp01_node1.adb | 56 - c/src/ada-tests/mptests/mp01/node2/Makefile.am | 19 - .../mptests/mp01/node2/ada_mp01-node2.scn | 15 - c/src/ada-tests/mptests/mp01/node2/config.h | 21 - c/src/ada-tests/mptests/mp01/node2/mp01_node2.adb | 56 - c/src/ada-tests/mptests/mp03/Makefile.am | 4 - c/src/ada-tests/mptests/mp03/config_base.h | 28 - c/src/ada-tests/mptests/mp03/mptest.adb | 267 -- c/src/ada-tests/mptests/mp03/mptest.ads | 111 - c/src/ada-tests/mptests/mp03/node1/Makefile.am | 19 - .../mptests/mp03/node1/ada_mp03-node1.scn | 28 - c/src/ada-tests/mptests/mp03/node1/config.h | 21 - c/src/ada-tests/mptests/mp03/node1/mp03_node1.adb | 56 - c/src/ada-tests/mptests/mp03/node2/Makefile.am | 19 - .../mptests/mp03/node2/ada_mp03-node2.scn | 28 - c/src/ada-tests/mptests/mp03/node2/config.h | 21 - c/src/ada-tests/mptests/mp03/node2/mp03_node2.adb | 56 - c/src/ada-tests/mptests/mp04/Makefile.am | 4 - c/src/ada-tests/mptests/mp04/config_base.h | 28 - c/src/ada-tests/mptests/mp04/mptest.adb | 163 - c/src/ada-tests/mptests/mp04/mptest.ads | 74 - c/src/ada-tests/mptests/mp04/node1/Makefile.am | 19 - .../mptests/mp04/node1/ada_mp04-node1.scn | 8 - c/src/ada-tests/mptests/mp04/node1/config.h | 21 - c/src/ada-tests/mptests/mp04/node1/mp04_node1.adb | 56 - c/src/ada-tests/mptests/mp04/node2/Makefile.am | 19 - .../mptests/mp04/node2/ada_mp04-node2.scn | 8 - c/src/ada-tests/mptests/mp04/node2/config.h | 21 - c/src/ada-tests/mptests/mp04/node2/mp04_node2.adb | 56 - c/src/ada-tests/mptests/mp05/Makefile.am | 4 - c/src/ada-tests/mptests/mp05/config_base.h | 28 - c/src/ada-tests/mptests/mp05/mptest.adb | 247 -- c/src/ada-tests/mptests/mp05/mptest.ads | 142 - c/src/ada-tests/mptests/mp05/node1/Makefile.am | 19 - .../mptests/mp05/node1/ada_mp05-node1.scn | 11 - c/src/ada-tests/mptests/mp05/node1/config.h | 21 - c/src/ada-tests/mptests/mp05/node1/mp05_node1.adb | 56 - c/src/ada-tests/mptests/mp05/node2/Makefile.am | 19 - .../mptests/mp05/node2/ada_mp05-node2.scn | 10 - c/src/ada-tests/mptests/mp05/node2/config.h | 21 - c/src/ada-tests/mptests/mp05/node2/mp05_node2.adb | 56 - c/src/ada-tests/mptests/mp06/Makefile.am | 4 - c/src/ada-tests/mptests/mp06/config_base.h | 28 - c/src/ada-tests/mptests/mp06/mptest.adb | 252 -- c/src/ada-tests/mptests/mp06/mptest.ads | 148 - c/src/ada-tests/mptests/mp06/node1/Makefile.am | 19 - .../mptests/mp06/node1/ada_mp06-node1.scn | 10 - c/src/ada-tests/mptests/mp06/node1/config.h | 21 - c/src/ada-tests/mptests/mp06/node1/mp06_node1.adb | 56 - c/src/ada-tests/mptests/mp06/node2/Makefile.am | 19 - .../mptests/mp06/node2/ada_mp06-node2.scn | 11 - c/src/ada-tests/mptests/mp06/node2/config.h | 21 - c/src/ada-tests/mptests/mp06/node2/mp06_node2.adb | 56 - c/src/ada-tests/mptests/mp07/Makefile.am | 4 - c/src/ada-tests/mptests/mp07/config_base.h | 28 - c/src/ada-tests/mptests/mp07/mptest.adb | 204 -- c/src/ada-tests/mptests/mp07/mptest.ads | 107 - c/src/ada-tests/mptests/mp07/node1/Makefile.am | 19 - .../mptests/mp07/node1/ada_mp07-node1.scn | 10 - c/src/ada-tests/mptests/mp07/node1/config.h | 21 - c/src/ada-tests/mptests/mp07/node1/mp07_node1.adb | 56 - c/src/ada-tests/mptests/mp07/node2/Makefile.am | 19 - .../mptests/mp07/node2/ada_mp07-node2.scn | 9 - c/src/ada-tests/mptests/mp07/node2/config.h | 21 - c/src/ada-tests/mptests/mp07/node2/mp07_node2.adb | 56 - c/src/ada-tests/mptests/mp08/Makefile.am | 4 - c/src/ada-tests/mptests/mp08/config_base.h | 28 - c/src/ada-tests/mptests/mp08/mptest.adb | 203 -- c/src/ada-tests/mptests/mp08/mptest.ads | 88 - c/src/ada-tests/mptests/mp08/node1/Makefile.am | 19 - .../mptests/mp08/node1/ada_mp08-node1.scn | 9 - c/src/ada-tests/mptests/mp08/node1/config.h | 21 - c/src/ada-tests/mptests/mp08/node1/mp08_node1.adb | 56 - c/src/ada-tests/mptests/mp08/node2/Makefile.am | 19 - .../mptests/mp08/node2/ada_mp08-node2.scn | 10 - c/src/ada-tests/mptests/mp08/node2/config.h | 21 - c/src/ada-tests/mptests/mp08/node2/mp08_node2.adb | 56 - c/src/ada-tests/mptests/mp09/Makefile.am | 4 - c/src/ada-tests/mptests/mp09/config_base.h | 28 - c/src/ada-tests/mptests/mp09/mptest.adb | 373 --- c/src/ada-tests/mptests/mp09/mptest.ads | 150 - c/src/ada-tests/mptests/mp09/node1/Makefile.am | 19 - .../mptests/mp09/node1/ada_mp09-node1.scn | 20 - c/src/ada-tests/mptests/mp09/node1/config.h | 21 - c/src/ada-tests/mptests/mp09/node1/mp09_node1.adb | 56 - c/src/ada-tests/mptests/mp09/node2/Makefile.am | 19 - .../mptests/mp09/node2/ada_mp09-node2.scn | 26 - c/src/ada-tests/mptests/mp09/node2/config.h | 21 - c/src/ada-tests/mptests/mp09/node2/mp09_node2.adb | 56 - c/src/ada-tests/mptests/mp10/Makefile.am | 4 - c/src/ada-tests/mptests/mp10/config_base.h | 28 - c/src/ada-tests/mptests/mp10/mptest.adb | 295 -- c/src/ada-tests/mptests/mp10/mptest.ads | 122 - c/src/ada-tests/mptests/mp10/node1/Makefile.am | 19 - .../mptests/mp10/node1/ada_mp10-node1.scn | 4 - c/src/ada-tests/mptests/mp10/node1/config.h | 21 - c/src/ada-tests/mptests/mp10/node1/mp10_node1.adb | 56 - c/src/ada-tests/mptests/mp10/node2/Makefile.am | 19 - .../mptests/mp10/node2/ada_mp10-node2.scn | 18 - c/src/ada-tests/mptests/mp10/node2/config.h | 21 - c/src/ada-tests/mptests/mp10/node2/mp10_node2.adb | 56 - c/src/ada-tests/mptests/mp11/Makefile.am | 4 - c/src/ada-tests/mptests/mp11/config_base.h | 28 - c/src/ada-tests/mptests/mp11/mptest.adb | 136 - c/src/ada-tests/mptests/mp11/mptest.ads | 79 - c/src/ada-tests/mptests/mp11/node1/Makefile.am | 19 - .../mptests/mp11/node1/ada_mp11-node1.scn | 10 - c/src/ada-tests/mptests/mp11/node1/config.h | 21 - c/src/ada-tests/mptests/mp11/node1/mp11_node1.adb | 56 - c/src/ada-tests/mptests/mp11/node2/Makefile.am | 19 - .../mptests/mp11/node2/ada_mp11-node2.scn | 2 - c/src/ada-tests/mptests/mp11/node2/config.h | 21 - c/src/ada-tests/mptests/mp11/node2/mp11_node2.adb | 56 - c/src/ada-tests/mptests/mp12/Makefile.am | 4 - c/src/ada-tests/mptests/mp12/config_base.h | 28 - c/src/ada-tests/mptests/mp12/mptest.adb | 148 - c/src/ada-tests/mptests/mp12/mptest.ads | 77 - c/src/ada-tests/mptests/mp12/node1/Makefile.am | 19 - .../mptests/mp12/node1/ada_mp12-node1.scn | 6 - c/src/ada-tests/mptests/mp12/node1/config.h | 21 - c/src/ada-tests/mptests/mp12/node1/mp12_node1.adb | 56 - c/src/ada-tests/mptests/mp12/node2/Makefile.am | 19 - .../mptests/mp12/node2/ada_mp12-node2.scn | 9 - c/src/ada-tests/mptests/mp12/node2/config.h | 21 - c/src/ada-tests/mptests/mp12/node2/mp12_node2.adb | 56 - c/src/ada-tests/mptests/mp13/Makefile.am | 4 - c/src/ada-tests/mptests/mp13/config_base.h | 28 - c/src/ada-tests/mptests/mp13/mptest.adb | 323 -- c/src/ada-tests/mptests/mp13/mptest.ads | 103 - c/src/ada-tests/mptests/mp13/node1/Makefile.am | 19 - .../mptests/mp13/node1/ada_mp13-node1.scn | 14 - c/src/ada-tests/mptests/mp13/node1/config.h | 21 - c/src/ada-tests/mptests/mp13/node1/mp13_node1.adb | 56 - c/src/ada-tests/mptests/mp13/node2/Makefile.am | 19 - .../mptests/mp13/node2/ada_mp13-node2.scn | 16 - c/src/ada-tests/mptests/mp13/node2/config.h | 21 - c/src/ada-tests/mptests/mp13/node2/mp13_node2.adb | 56 - c/src/ada-tests/mptests/mp14/Makefile.am | 4 - c/src/ada-tests/mptests/mp14/config_base.h | 28 - c/src/ada-tests/mptests/mp14/mptest.adb | 766 ----- c/src/ada-tests/mptests/mp14/mptest.ads | 246 -- c/src/ada-tests/mptests/mp14/node1/Makefile.am | 19 - .../mptests/mp14/node1/ada_mp14-node1.scn | 33 - c/src/ada-tests/mptests/mp14/node1/config.h | 21 - c/src/ada-tests/mptests/mp14/node1/mp14_node1.adb | 56 - c/src/ada-tests/mptests/mp14/node2/Makefile.am | 19 - .../mptests/mp14/node2/ada_mp14-node2.scn | 28 - c/src/ada-tests/mptests/mp14/node2/config.h | 21 - c/src/ada-tests/mptests/mp14/node2/mp14_node2.adb | 56 - c/src/ada-tests/samples/Makefile.am | 9 - c/src/ada-tests/samples/base_mp/Makefile.am | 21 - c/src/ada-tests/samples/base_mp/config.h | 34 - c/src/ada-tests/samples/base_mp/mptest.adb | 100 - c/src/ada-tests/samples/base_mp/mptest.ads | 62 - c/src/ada-tests/samples/base_mp/node1/Makefile.am | 22 - .../samples/base_mp/node1/ada_base_mp-node1.scn | 5 - c/src/ada-tests/samples/base_mp/node2/Makefile.am | 22 - .../samples/base_mp/node2/ada_base_mp-node2.scn | 5 - c/src/ada-tests/samples/base_sp/Makefile.am | 19 - c/src/ada-tests/samples/base_sp/ada_base_sp.scn | 4 - c/src/ada-tests/samples/base_sp/base_sp.adb | 56 - c/src/ada-tests/samples/base_sp/config.h | 30 - c/src/ada-tests/samples/base_sp/sptest.adb | 93 - c/src/ada-tests/samples/base_sp/sptest.ads | 60 - c/src/ada-tests/samples/hello/Makefile.am | 19 - c/src/ada-tests/samples/hello/ada_hello.scn | 3 - c/src/ada-tests/samples/hello/config.h | 31 - c/src/ada-tests/samples/hello/hello.adb | 55 - c/src/ada-tests/samples/hello/sptest.adb | 44 - c/src/ada-tests/samples/hello/sptest.ads | 48 - c/src/ada-tests/samples/nsecs/Makefile.am | 19 - c/src/ada-tests/samples/nsecs/ada_nsecs.scn | 27 - c/src/ada-tests/samples/nsecs/config.h | 30 - c/src/ada-tests/samples/nsecs/nsecs.adb | 54 - c/src/ada-tests/samples/nsecs/sptest.adb | 153 - c/src/ada-tests/samples/nsecs/sptest.ads | 39 - c/src/ada-tests/samples/ticker/Makefile.am | 19 - c/src/ada-tests/samples/ticker/ada_ticker.scn | 16 - c/src/ada-tests/samples/ticker/config.h | 30 - c/src/ada-tests/samples/ticker/sptest.adb | 159 - c/src/ada-tests/samples/ticker/sptest.ads | 60 - c/src/ada-tests/samples/ticker/ticker.adb | 55 - c/src/ada-tests/sptests/Makefile.am | 28 - c/src/ada-tests/sptests/sp01/Makefile.am | 16 - c/src/ada-tests/sptests/sp01/ada_sp01.scn | 16 - c/src/ada-tests/sptests/sp01/config.h | 30 - c/src/ada-tests/sptests/sp01/sp01.adb | 55 - c/src/ada-tests/sptests/sp01/sptest.adb | 159 - c/src/ada-tests/sptests/sp01/sptest.ads | 60 - c/src/ada-tests/sptests/sp02/Makefile.am | 16 - c/src/ada-tests/sptests/sp02/ada_sp02.scn | 15 - c/src/ada-tests/sptests/sp02/config.h | 30 - c/src/ada-tests/sptests/sp02/sp02.adb | 55 - c/src/ada-tests/sptests/sp02/sptest.adb | 327 -- c/src/ada-tests/sptests/sp02/sptest.ads | 102 - c/src/ada-tests/sptests/sp03/Makefile.am | 16 - c/src/ada-tests/sptests/sp03/ada_sp03.scn | 26 - c/src/ada-tests/sptests/sp03/config.h | 30 - c/src/ada-tests/sptests/sp03/sp03.adb | 55 - c/src/ada-tests/sptests/sp03/sptest.adb | 169 -- c/src/ada-tests/sptests/sp03/sptest.ads | 75 - c/src/ada-tests/sptests/sp04/Makefile.am | 16 - c/src/ada-tests/sptests/sp04/README | 9 - c/src/ada-tests/sptests/sp04/ada_sp04.scn | 25 - c/src/ada-tests/sptests/sp04/config.h | 33 - c/src/ada-tests/sptests/sp04/sp04.adb | 55 - c/src/ada-tests/sptests/sp04/sptest.adb | 348 --- c/src/ada-tests/sptests/sp04/sptest.ads | 136 - c/src/ada-tests/sptests/sp05/Makefile.am | 16 - c/src/ada-tests/sptests/sp05/ada_sp05.scn | 47 - c/src/ada-tests/sptests/sp05/config.h | 32 - c/src/ada-tests/sptests/sp05/sp05.adb | 55 - c/src/ada-tests/sptests/sp05/sptest.adb | 224 -- c/src/ada-tests/sptests/sp05/sptest.ads | 86 - c/src/ada-tests/sptests/sp06/Makefile.am | 16 - c/src/ada-tests/sptests/sp06/ada_sp06.scn | 38 - c/src/ada-tests/sptests/sp06/config.h | 32 - c/src/ada-tests/sptests/sp06/sp06.adb | 55 - c/src/ada-tests/sptests/sp06/sptest.adb | 216 -- c/src/ada-tests/sptests/sp06/sptest.ads | 93 - c/src/ada-tests/sptests/sp07/Makefile.am | 17 - c/src/ada-tests/sptests/sp07/ada_sp07.scn | 23 - c/src/ada-tests/sptests/sp07/config.h | 33 - c/src/ada-tests/sptests/sp07/sp07.adb | 55 - c/src/ada-tests/sptests/sp07/sptest.adb | 513 ---- c/src/ada-tests/sptests/sp07/sptest.ads | 194 -- c/src/ada-tests/sptests/sp08/Makefile.am | 16 - c/src/ada-tests/sptests/sp08/ada_sp08.scn | 20 - c/src/ada-tests/sptests/sp08/config.h | 32 - c/src/ada-tests/sptests/sp08/sp08.adb | 55 - c/src/ada-tests/sptests/sp08/sptest.adb | 346 --- c/src/ada-tests/sptests/sp08/sptest.ads | 74 - c/src/ada-tests/sptests/sp09/Makefile.am | 21 - c/src/ada-tests/sptests/sp09/ada_sp09.scn | 246 -- c/src/ada-tests/sptests/sp09/config.h | 38 - c/src/ada-tests/sptests/sp09/sp09.adb | 55 - c/src/ada-tests/sptests/sp09/sptest.adb | 3117 -------------------- c/src/ada-tests/sptests/sp09/sptest.ads | 393 --- c/src/ada-tests/sptests/sp11/Makefile.am | 16 - c/src/ada-tests/sptests/sp11/ada_sp11.scn | 74 - c/src/ada-tests/sptests/sp11/config.h | 32 - c/src/ada-tests/sptests/sp11/sp11.adb | 55 - c/src/ada-tests/sptests/sp11/sptest.adb | 906 ------ c/src/ada-tests/sptests/sp11/sptest.ads | 186 -- c/src/ada-tests/sptests/sp12/Makefile.am | 16 - c/src/ada-tests/sptests/sp12/ada_sp12.scn | 78 - c/src/ada-tests/sptests/sp12/config.h | 32 - c/src/ada-tests/sptests/sp12/sp12.adb | 56 - c/src/ada-tests/sptests/sp12/sptest.adb | 809 ----- c/src/ada-tests/sptests/sp12/sptest.ads | 147 - c/src/ada-tests/sptests/sp13/Makefile.am | 16 - c/src/ada-tests/sptests/sp13/ada_sp13.scn | 78 - c/src/ada-tests/sptests/sp13/config.h | 32 - c/src/ada-tests/sptests/sp13/sp13.adb | 55 - c/src/ada-tests/sptests/sp13/sptest.adb | 891 ------ c/src/ada-tests/sptests/sp13/sptest.ads | 134 - c/src/ada-tests/sptests/sp14/Makefile.am | 16 - c/src/ada-tests/sptests/sp14/ada_sp14.scn | 33 - c/src/ada-tests/sptests/sp14/config.h | 32 - c/src/ada-tests/sptests/sp14/sp14.adb | 55 - c/src/ada-tests/sptests/sp14/sptest.adb | 325 -- c/src/ada-tests/sptests/sp14/sptest.ads | 134 - c/src/ada-tests/sptests/sp15/Makefile.am | 16 - c/src/ada-tests/sptests/sp15/ada_sp15.scn | 16 - c/src/ada-tests/sptests/sp15/config.h | 32 - c/src/ada-tests/sptests/sp15/sp15.adb | 55 - c/src/ada-tests/sptests/sp15/sptest.adb | 278 -- c/src/ada-tests/sptests/sp15/sptest.ads | 118 - c/src/ada-tests/sptests/sp16/Makefile.am | 16 - c/src/ada-tests/sptests/sp16/ada_sp16.scn | 58 - c/src/ada-tests/sptests/sp16/config.h | 32 - c/src/ada-tests/sptests/sp16/sp16.adb | 55 - c/src/ada-tests/sptests/sp16/sptest.adb | 789 ----- c/src/ada-tests/sptests/sp16/sptest.ads | 202 -- c/src/ada-tests/sptests/sp17/Makefile.am | 16 - c/src/ada-tests/sptests/sp17/ada_sp17.scn | 8 - c/src/ada-tests/sptests/sp17/config.h | 32 - c/src/ada-tests/sptests/sp17/sp17.adb | 55 - c/src/ada-tests/sptests/sp17/sptest.adb | 170 -- c/src/ada-tests/sptests/sp17/sptest.ads | 95 - c/src/ada-tests/sptests/sp19/Makefile.am | 20 - c/src/ada-tests/sptests/sp19/README | 19 - c/src/ada-tests/sptests/sp19/ada_sp19.scn | 55 - c/src/ada-tests/sptests/sp19/config.h | 30 - c/src/ada-tests/sptests/sp19/sp19.adb | 55 - c/src/ada-tests/sptests/sp19/sptest.adp | 397 --- c/src/ada-tests/sptests/sp19/sptest.ads | 119 - c/src/ada-tests/sptests/sp20/Makefile.am | 16 - c/src/ada-tests/sptests/sp20/ada_sp20.scn | 40 - c/src/ada-tests/sptests/sp20/config.h | 31 - c/src/ada-tests/sptests/sp20/sp20.adb | 54 - c/src/ada-tests/sptests/sp20/sptest.adb | 310 -- c/src/ada-tests/sptests/sp20/sptest.ads | 105 - c/src/ada-tests/sptests/sp22/Makefile.am | 16 - c/src/ada-tests/sptests/sp22/ada_sp22.scn | 29 - c/src/ada-tests/sptests/sp22/config.h | 31 - c/src/ada-tests/sptests/sp22/sp22.adb | 55 - c/src/ada-tests/sptests/sp22/sptest.adb | 297 -- c/src/ada-tests/sptests/sp22/sptest.ads | 93 - c/src/ada-tests/sptests/sp23/Makefile.am | 16 - c/src/ada-tests/sptests/sp23/ada_sp23.scn | 9 - c/src/ada-tests/sptests/sp23/config.h | 31 - c/src/ada-tests/sptests/sp23/sp23.adb | 55 - c/src/ada-tests/sptests/sp23/sptest.adb | 175 -- c/src/ada-tests/sptests/sp23/sptest.ads | 118 - c/src/ada-tests/sptests/sp24/Makefile.am | 16 - c/src/ada-tests/sptests/sp24/ada_sp24.scn | 16 - c/src/ada-tests/sptests/sp24/config.h | 31 - c/src/ada-tests/sptests/sp24/sp24.adb | 55 - c/src/ada-tests/sptests/sp24/sptest.adb | 167 -- c/src/ada-tests/sptests/sp24/sptest.ads | 83 - c/src/ada-tests/sptests/sp25/Makefile.am | 16 - c/src/ada-tests/sptests/sp25/ada_sp25.scn | 29 - c/src/ada-tests/sptests/sp25/config.h | 31 - c/src/ada-tests/sptests/sp25/sp25.adb | 55 - c/src/ada-tests/sptests/sp25/sptest.adb | 362 --- c/src/ada-tests/sptests/sp25/sptest.ads | 103 - c/src/ada-tests/sptests/spatcb01/Makefile.am | 16 - c/src/ada-tests/sptests/spatcb01/ada_spatcb01.scn | 3 - c/src/ada-tests/sptests/spatcb01/config.h | 16 - c/src/ada-tests/sptests/spatcb01/spatcb01.adb | 26 - c/src/ada-tests/sptests/spname01/Makefile.am | 18 - c/src/ada-tests/sptests/spname01/ada_spname01.scn | 3 - c/src/ada-tests/sptests/spname01/config.h | 31 - c/src/ada-tests/sptests/spname01/spname01.adb | 28 - c/src/ada-tests/sptests/spname01/sptest.adb | 62 - c/src/ada-tests/sptests/spname01/sptest.ads | 25 - c/src/ada-tests/support/Makefile.am | 18 - c/src/ada-tests/support/address_io.adb | 43 - c/src/ada-tests/support/address_io.ads | 32 - c/src/ada-tests/support/float_io.ads | 24 - c/src/ada-tests/support/fp.inc | 151 - c/src/ada-tests/support/init.c | 82 - c/src/ada-tests/support/integer.inc | 142 - c/src/ada-tests/support/rtems_calling_overhead.ads | 102 - c/src/ada-tests/support/status_io.ads | 25 - c/src/ada-tests/support/test_support.adb | 266 -- c/src/ada-tests/support/test_support.ads | 195 -- c/src/ada-tests/support/time_test_support.adb | 73 - c/src/ada-tests/support/time_test_support.ads | 51 - c/src/ada-tests/support/timer_driver.adb | 59 - c/src/ada-tests/support/timer_driver.ads | 77 - c/src/ada-tests/support/unsigned32_io.ads | 25 - c/src/ada-tests/tmtests/Makefile.am | 33 - c/src/ada-tests/tmtests/tm01/Makefile.am | 13 - c/src/ada-tests/tmtests/tm01/config.h | 32 - c/src/ada-tests/tmtests/tm01/tm01.adb | 55 - c/src/ada-tests/tmtests/tm01/tmtest.adb | 273 -- c/src/ada-tests/tmtests/tm01/tmtest.ads | 67 - c/src/ada-tests/tmtests/tm02/Makefile.am | 13 - c/src/ada-tests/tmtests/tm02/config.h | 33 - c/src/ada-tests/tmtests/tm02/tm02.adb | 55 - c/src/ada-tests/tmtests/tm02/tmtest.adb | 206 -- c/src/ada-tests/tmtests/tm02/tmtest.ads | 104 - c/src/ada-tests/tmtests/tm03/Makefile.am | 13 - c/src/ada-tests/tmtests/tm03/config.h | 33 - c/src/ada-tests/tmtests/tm03/tm03.adb | 55 - c/src/ada-tests/tmtests/tm03/tmtest.adb | 190 -- c/src/ada-tests/tmtests/tm03/tmtest.ads | 96 - c/src/ada-tests/tmtests/tm04/Makefile.am | 13 - c/src/ada-tests/tmtests/tm04/config.h | 32 - c/src/ada-tests/tmtests/tm04/tm04.adb | 55 - c/src/ada-tests/tmtests/tm04/tmtest.adb | 494 ---- c/src/ada-tests/tmtests/tm04/tmtest.ads | 163 - c/src/ada-tests/tmtests/tm05/Makefile.am | 13 - c/src/ada-tests/tmtests/tm05/config.h | 33 - c/src/ada-tests/tmtests/tm05/tm05.adb | 55 - c/src/ada-tests/tmtests/tm05/tmtest.adb | 170 -- c/src/ada-tests/tmtests/tm05/tmtest.ads | 114 - c/src/ada-tests/tmtests/tm06/Makefile.am | 13 - c/src/ada-tests/tmtests/tm06/config.h | 33 - c/src/ada-tests/tmtests/tm06/tm06.adb | 55 - c/src/ada-tests/tmtests/tm06/tmtest.adb | 202 -- c/src/ada-tests/tmtests/tm06/tmtest.ads | 104 - c/src/ada-tests/tmtests/tm07/Makefile.am | 13 - c/src/ada-tests/tmtests/tm07/config.h | 33 - c/src/ada-tests/tmtests/tm07/tm07.adb | 55 - c/src/ada-tests/tmtests/tm07/tmtest.adb | 170 -- c/src/ada-tests/tmtests/tm07/tmtest.ads | 112 - c/src/ada-tests/tmtests/tm08/Makefile.am | 13 - c/src/ada-tests/tmtests/tm08/config.h | 33 - c/src/ada-tests/tmtests/tm08/tm08.adb | 55 - c/src/ada-tests/tmtests/tm08/tmtest.adb | 299 -- c/src/ada-tests/tmtests/tm08/tmtest.ads | 96 - c/src/ada-tests/tmtests/tm09/Makefile.am | 13 - c/src/ada-tests/tmtests/tm09/config.h | 32 - c/src/ada-tests/tmtests/tm09/tm09.adb | 55 - c/src/ada-tests/tmtests/tm09/tmtest.adb | 297 -- c/src/ada-tests/tmtests/tm09/tmtest.ads | 99 - c/src/ada-tests/tmtests/tm10/Makefile.am | 13 - c/src/ada-tests/tmtests/tm10/config.h | 32 - c/src/ada-tests/tmtests/tm10/tm10.adb | 55 - c/src/ada-tests/tmtests/tm10/tmtest.adb | 220 -- c/src/ada-tests/tmtests/tm10/tmtest.ads | 118 - c/src/ada-tests/tmtests/tm11/Makefile.am | 13 - c/src/ada-tests/tmtests/tm11/config.h | 32 - c/src/ada-tests/tmtests/tm11/tm11.adb | 55 - c/src/ada-tests/tmtests/tm11/tmtest.adb | 218 -- c/src/ada-tests/tmtests/tm11/tmtest.ads | 115 - c/src/ada-tests/tmtests/tm12/Makefile.am | 13 - c/src/ada-tests/tmtests/tm12/config.h | 32 - c/src/ada-tests/tmtests/tm12/tm12.adb | 55 - c/src/ada-tests/tmtests/tm12/tmtest.adb | 204 -- c/src/ada-tests/tmtests/tm12/tmtest.ads | 106 - c/src/ada-tests/tmtests/tm13/Makefile.am | 13 - c/src/ada-tests/tmtests/tm13/config.h | 32 - c/src/ada-tests/tmtests/tm13/tm13.adb | 55 - c/src/ada-tests/tmtests/tm13/tmtest.adb | 216 -- c/src/ada-tests/tmtests/tm13/tmtest.ads | 115 - c/src/ada-tests/tmtests/tm14/Makefile.am | 13 - c/src/ada-tests/tmtests/tm14/config.h | 32 - c/src/ada-tests/tmtests/tm14/tm14.adb | 55 - c/src/ada-tests/tmtests/tm14/tmtest.adb | 214 -- c/src/ada-tests/tmtests/tm14/tmtest.ads | 106 - c/src/ada-tests/tmtests/tm15/Makefile.am | 13 - c/src/ada-tests/tmtests/tm15/config.h | 32 - c/src/ada-tests/tmtests/tm15/tm15.adb | 55 - c/src/ada-tests/tmtests/tm15/tmtest.adb | 267 -- c/src/ada-tests/tmtests/tm15/tmtest.ads | 109 - c/src/ada-tests/tmtests/tm16/Makefile.am | 13 - c/src/ada-tests/tmtests/tm16/config.h | 32 - c/src/ada-tests/tmtests/tm16/tm16.adb | 55 - c/src/ada-tests/tmtests/tm16/tmtest.adb | 196 -- c/src/ada-tests/tmtests/tm16/tmtest.ads | 112 - c/src/ada-tests/tmtests/tm17/Makefile.am | 13 - c/src/ada-tests/tmtests/tm17/config.h | 32 - c/src/ada-tests/tmtests/tm17/tm17.adb | 55 - c/src/ada-tests/tmtests/tm17/tmtest.adb | 155 - c/src/ada-tests/tmtests/tm17/tmtest.ads | 110 - c/src/ada-tests/tmtests/tm18/Makefile.am | 13 - c/src/ada-tests/tmtests/tm18/config.h | 32 - c/src/ada-tests/tmtests/tm18/tm18.adb | 55 - c/src/ada-tests/tmtests/tm18/tmtest.adb | 151 - c/src/ada-tests/tmtests/tm18/tmtest.ads | 97 - c/src/ada-tests/tmtests/tm19/Makefile.am | 13 - c/src/ada-tests/tmtests/tm19/config.h | 32 - c/src/ada-tests/tmtests/tm19/tm19.adb | 55 - c/src/ada-tests/tmtests/tm19/tmtest.adb | 287 -- c/src/ada-tests/tmtests/tm19/tmtest.ads | 147 - c/src/ada-tests/tmtests/tm20/Makefile.am | 13 - c/src/ada-tests/tmtests/tm20/config.h | 33 - c/src/ada-tests/tmtests/tm20/tm20.adb | 55 - c/src/ada-tests/tmtests/tm20/tmtest.adb | 455 --- c/src/ada-tests/tmtests/tm20/tmtest.ads | 151 - c/src/ada-tests/tmtests/tm21/Makefile.am | 13 - c/src/ada-tests/tmtests/tm21/config.h | 38 - c/src/ada-tests/tmtests/tm21/tm21.adb | 55 - c/src/ada-tests/tmtests/tm21/tmtest.adb | 304 -- c/src/ada-tests/tmtests/tm21/tmtest.ads | 121 - c/src/ada-tests/tmtests/tm22/Makefile.am | 13 - c/src/ada-tests/tmtests/tm22/config.h | 32 - c/src/ada-tests/tmtests/tm22/tm22.adb | 55 - c/src/ada-tests/tmtests/tm22/tmtest.adb | 252 -- c/src/ada-tests/tmtests/tm22/tmtest.ads | 120 - c/src/ada-tests/tmtests/tm23/Makefile.am | 13 - c/src/ada-tests/tmtests/tm23/config.h | 32 - c/src/ada-tests/tmtests/tm23/tm23.adb | 55 - c/src/ada-tests/tmtests/tm23/tmtest.adb | 388 --- c/src/ada-tests/tmtests/tm23/tmtest.ads | 132 - c/src/ada-tests/tmtests/tm24/Makefile.am | 13 - c/src/ada-tests/tmtests/tm24/config.h | 31 - c/src/ada-tests/tmtests/tm24/tm24.adb | 55 - c/src/ada-tests/tmtests/tm24/tmtest.adb | 161 - c/src/ada-tests/tmtests/tm24/tmtest.ads | 99 - c/src/ada-tests/tmtests/tm25/Makefile.am | 13 - c/src/ada-tests/tmtests/tm25/config.h | 32 - c/src/ada-tests/tmtests/tm25/tm25.adb | 55 - c/src/ada-tests/tmtests/tm25/tmtest.adb | 155 - c/src/ada-tests/tmtests/tm25/tmtest.ads | 80 - c/src/ada-tests/tmtests/tm28/Makefile.am | 13 - c/src/ada-tests/tmtests/tm28/config.h | 32 - c/src/ada-tests/tmtests/tm28/tm28.adb | 55 - c/src/ada-tests/tmtests/tm28/tmtest.adb | 171 -- c/src/ada-tests/tmtests/tm28/tmtest.ads | 105 - c/src/ada-tests/tmtests/tm29/Makefile.am | 13 - c/src/ada-tests/tmtests/tm29/config.h | 32 - c/src/ada-tests/tmtests/tm29/tm29.adb | 55 - c/src/ada-tests/tmtests/tm29/tmtest.adb | 236 -- c/src/ada-tests/tmtests/tm29/tmtest.ads | 96 - c/src/ada-tests/tmtests/tmck/Makefile.am | 13 - c/src/ada-tests/tmtests/tmck/config.h | 32 - c/src/ada-tests/tmtests/tmck/tmck.adb | 55 - c/src/ada-tests/tmtests/tmck/tmtest.adb | 214 -- c/src/ada-tests/tmtests/tmck/tmtest.ads | 96 - c/src/ada-tests/tmtests/tmoverhd/Makefile.am | 14 - c/src/ada-tests/tmtests/tmoverhd/README | 5 - c/src/ada-tests/tmtests/tmoverhd/config.h | 32 - c/src/ada-tests/tmtests/tmoverhd/dummy_rtems.adb | 891 ------ c/src/ada-tests/tmtests/tmoverhd/dummy_rtems.ads | 445 --- c/src/ada-tests/tmtests/tmoverhd/tmoverhd.adb | 55 - c/src/ada-tests/tmtests/tmoverhd/tmtest.adb | 1363 --------- c/src/ada-tests/tmtests/tmoverhd/tmtest.ads | 156 - c/src/configure.ac | 9 - testsuites/ada/Makefile.am | 13 + testsuites/ada/aclocal/prog-gnat.m4 | 44 + testsuites/ada/ada.am | 24 + testsuites/ada/ada_mvscn | 64 + testsuites/ada/configure.ac | 157 + testsuites/ada/mptests/Makefile.am | 17 + testsuites/ada/mptests/mp01/Makefile.am | 4 + testsuites/ada/mptests/mp01/config_base.h | 28 + testsuites/ada/mptests/mp01/mp01.adb | 55 + testsuites/ada/mptests/mp01/mptest.adb | 230 ++ testsuites/ada/mptests/mp01/mptest.ads | 60 + testsuites/ada/mptests/mp01/node1/Makefile.am | 19 + .../ada/mptests/mp01/node1/ada_mp01-node1.scn | 15 + testsuites/ada/mptests/mp01/node1/config.h | 21 + testsuites/ada/mptests/mp01/node1/mp01_node1.adb | 56 + testsuites/ada/mptests/mp01/node2/Makefile.am | 19 + .../ada/mptests/mp01/node2/ada_mp01-node2.scn | 15 + testsuites/ada/mptests/mp01/node2/config.h | 21 + testsuites/ada/mptests/mp01/node2/mp01_node2.adb | 56 + testsuites/ada/mptests/mp03/Makefile.am | 4 + testsuites/ada/mptests/mp03/config_base.h | 28 + testsuites/ada/mptests/mp03/mptest.adb | 267 ++ testsuites/ada/mptests/mp03/mptest.ads | 111 + testsuites/ada/mptests/mp03/node1/Makefile.am | 19 + .../ada/mptests/mp03/node1/ada_mp03-node1.scn | 28 + testsuites/ada/mptests/mp03/node1/config.h | 21 + testsuites/ada/mptests/mp03/node1/mp03_node1.adb | 56 + testsuites/ada/mptests/mp03/node2/Makefile.am | 19 + .../ada/mptests/mp03/node2/ada_mp03-node2.scn | 28 + testsuites/ada/mptests/mp03/node2/config.h | 21 + testsuites/ada/mptests/mp03/node2/mp03_node2.adb | 56 + testsuites/ada/mptests/mp04/Makefile.am | 4 + testsuites/ada/mptests/mp04/config_base.h | 28 + testsuites/ada/mptests/mp04/mptest.adb | 163 + testsuites/ada/mptests/mp04/mptest.ads | 74 + testsuites/ada/mptests/mp04/node1/Makefile.am | 19 + .../ada/mptests/mp04/node1/ada_mp04-node1.scn | 8 + testsuites/ada/mptests/mp04/node1/config.h | 21 + testsuites/ada/mptests/mp04/node1/mp04_node1.adb | 56 + testsuites/ada/mptests/mp04/node2/Makefile.am | 19 + .../ada/mptests/mp04/node2/ada_mp04-node2.scn | 8 + testsuites/ada/mptests/mp04/node2/config.h | 21 + testsuites/ada/mptests/mp04/node2/mp04_node2.adb | 56 + testsuites/ada/mptests/mp05/Makefile.am | 4 + testsuites/ada/mptests/mp05/config_base.h | 28 + testsuites/ada/mptests/mp05/mptest.adb | 247 ++ testsuites/ada/mptests/mp05/mptest.ads | 142 + testsuites/ada/mptests/mp05/node1/Makefile.am | 19 + .../ada/mptests/mp05/node1/ada_mp05-node1.scn | 11 + testsuites/ada/mptests/mp05/node1/config.h | 21 + testsuites/ada/mptests/mp05/node1/mp05_node1.adb | 56 + testsuites/ada/mptests/mp05/node2/Makefile.am | 19 + .../ada/mptests/mp05/node2/ada_mp05-node2.scn | 10 + testsuites/ada/mptests/mp05/node2/config.h | 21 + testsuites/ada/mptests/mp05/node2/mp05_node2.adb | 56 + testsuites/ada/mptests/mp06/Makefile.am | 4 + testsuites/ada/mptests/mp06/config_base.h | 28 + testsuites/ada/mptests/mp06/mptest.adb | 252 ++ testsuites/ada/mptests/mp06/mptest.ads | 148 + testsuites/ada/mptests/mp06/node1/Makefile.am | 19 + .../ada/mptests/mp06/node1/ada_mp06-node1.scn | 10 + testsuites/ada/mptests/mp06/node1/config.h | 21 + testsuites/ada/mptests/mp06/node1/mp06_node1.adb | 56 + testsuites/ada/mptests/mp06/node2/Makefile.am | 19 + .../ada/mptests/mp06/node2/ada_mp06-node2.scn | 11 + testsuites/ada/mptests/mp06/node2/config.h | 21 + testsuites/ada/mptests/mp06/node2/mp06_node2.adb | 56 + testsuites/ada/mptests/mp07/Makefile.am | 4 + testsuites/ada/mptests/mp07/config_base.h | 28 + testsuites/ada/mptests/mp07/mptest.adb | 204 ++ testsuites/ada/mptests/mp07/mptest.ads | 107 + testsuites/ada/mptests/mp07/node1/Makefile.am | 19 + .../ada/mptests/mp07/node1/ada_mp07-node1.scn | 10 + testsuites/ada/mptests/mp07/node1/config.h | 21 + testsuites/ada/mptests/mp07/node1/mp07_node1.adb | 56 + testsuites/ada/mptests/mp07/node2/Makefile.am | 19 + .../ada/mptests/mp07/node2/ada_mp07-node2.scn | 9 + testsuites/ada/mptests/mp07/node2/config.h | 21 + testsuites/ada/mptests/mp07/node2/mp07_node2.adb | 56 + testsuites/ada/mptests/mp08/Makefile.am | 4 + testsuites/ada/mptests/mp08/config_base.h | 28 + testsuites/ada/mptests/mp08/mptest.adb | 203 ++ testsuites/ada/mptests/mp08/mptest.ads | 88 + testsuites/ada/mptests/mp08/node1/Makefile.am | 19 + .../ada/mptests/mp08/node1/ada_mp08-node1.scn | 9 + testsuites/ada/mptests/mp08/node1/config.h | 21 + testsuites/ada/mptests/mp08/node1/mp08_node1.adb | 56 + testsuites/ada/mptests/mp08/node2/Makefile.am | 19 + .../ada/mptests/mp08/node2/ada_mp08-node2.scn | 10 + testsuites/ada/mptests/mp08/node2/config.h | 21 + testsuites/ada/mptests/mp08/node2/mp08_node2.adb | 56 + testsuites/ada/mptests/mp09/Makefile.am | 4 + testsuites/ada/mptests/mp09/config_base.h | 28 + testsuites/ada/mptests/mp09/mptest.adb | 373 +++ testsuites/ada/mptests/mp09/mptest.ads | 150 + testsuites/ada/mptests/mp09/node1/Makefile.am | 19 + .../ada/mptests/mp09/node1/ada_mp09-node1.scn | 20 + testsuites/ada/mptests/mp09/node1/config.h | 21 + testsuites/ada/mptests/mp09/node1/mp09_node1.adb | 56 + testsuites/ada/mptests/mp09/node2/Makefile.am | 19 + .../ada/mptests/mp09/node2/ada_mp09-node2.scn | 26 + testsuites/ada/mptests/mp09/node2/config.h | 21 + testsuites/ada/mptests/mp09/node2/mp09_node2.adb | 56 + testsuites/ada/mptests/mp10/Makefile.am | 4 + testsuites/ada/mptests/mp10/config_base.h | 28 + testsuites/ada/mptests/mp10/mptest.adb | 295 ++ testsuites/ada/mptests/mp10/mptest.ads | 122 + testsuites/ada/mptests/mp10/node1/Makefile.am | 19 + .../ada/mptests/mp10/node1/ada_mp10-node1.scn | 4 + testsuites/ada/mptests/mp10/node1/config.h | 21 + testsuites/ada/mptests/mp10/node1/mp10_node1.adb | 56 + testsuites/ada/mptests/mp10/node2/Makefile.am | 19 + .../ada/mptests/mp10/node2/ada_mp10-node2.scn | 18 + testsuites/ada/mptests/mp10/node2/config.h | 21 + testsuites/ada/mptests/mp10/node2/mp10_node2.adb | 56 + testsuites/ada/mptests/mp11/Makefile.am | 4 + testsuites/ada/mptests/mp11/config_base.h | 28 + testsuites/ada/mptests/mp11/mptest.adb | 136 + testsuites/ada/mptests/mp11/mptest.ads | 79 + testsuites/ada/mptests/mp11/node1/Makefile.am | 19 + .../ada/mptests/mp11/node1/ada_mp11-node1.scn | 10 + testsuites/ada/mptests/mp11/node1/config.h | 21 + testsuites/ada/mptests/mp11/node1/mp11_node1.adb | 56 + testsuites/ada/mptests/mp11/node2/Makefile.am | 19 + .../ada/mptests/mp11/node2/ada_mp11-node2.scn | 2 + testsuites/ada/mptests/mp11/node2/config.h | 21 + testsuites/ada/mptests/mp11/node2/mp11_node2.adb | 56 + testsuites/ada/mptests/mp12/Makefile.am | 4 + testsuites/ada/mptests/mp12/config_base.h | 28 + testsuites/ada/mptests/mp12/mptest.adb | 148 + testsuites/ada/mptests/mp12/mptest.ads | 77 + testsuites/ada/mptests/mp12/node1/Makefile.am | 19 + .../ada/mptests/mp12/node1/ada_mp12-node1.scn | 6 + testsuites/ada/mptests/mp12/node1/config.h | 21 + testsuites/ada/mptests/mp12/node1/mp12_node1.adb | 56 + testsuites/ada/mptests/mp12/node2/Makefile.am | 19 + .../ada/mptests/mp12/node2/ada_mp12-node2.scn | 9 + testsuites/ada/mptests/mp12/node2/config.h | 21 + testsuites/ada/mptests/mp12/node2/mp12_node2.adb | 56 + testsuites/ada/mptests/mp13/Makefile.am | 4 + testsuites/ada/mptests/mp13/config_base.h | 28 + testsuites/ada/mptests/mp13/mptest.adb | 323 ++ testsuites/ada/mptests/mp13/mptest.ads | 103 + testsuites/ada/mptests/mp13/node1/Makefile.am | 19 + .../ada/mptests/mp13/node1/ada_mp13-node1.scn | 14 + testsuites/ada/mptests/mp13/node1/config.h | 21 + testsuites/ada/mptests/mp13/node1/mp13_node1.adb | 56 + testsuites/ada/mptests/mp13/node2/Makefile.am | 19 + .../ada/mptests/mp13/node2/ada_mp13-node2.scn | 16 + testsuites/ada/mptests/mp13/node2/config.h | 21 + testsuites/ada/mptests/mp13/node2/mp13_node2.adb | 56 + testsuites/ada/mptests/mp14/Makefile.am | 4 + testsuites/ada/mptests/mp14/config_base.h | 28 + testsuites/ada/mptests/mp14/mptest.adb | 766 +++++ testsuites/ada/mptests/mp14/mptest.ads | 246 ++ testsuites/ada/mptests/mp14/node1/Makefile.am | 19 + .../ada/mptests/mp14/node1/ada_mp14-node1.scn | 33 + testsuites/ada/mptests/mp14/node1/config.h | 21 + testsuites/ada/mptests/mp14/node1/mp14_node1.adb | 56 + testsuites/ada/mptests/mp14/node2/Makefile.am | 19 + .../ada/mptests/mp14/node2/ada_mp14-node2.scn | 28 + testsuites/ada/mptests/mp14/node2/config.h | 21 + testsuites/ada/mptests/mp14/node2/mp14_node2.adb | 56 + testsuites/ada/samples/Makefile.am | 9 + testsuites/ada/samples/base_mp/Makefile.am | 21 + testsuites/ada/samples/base_mp/config.h | 34 + testsuites/ada/samples/base_mp/mptest.adb | 100 + testsuites/ada/samples/base_mp/mptest.ads | 62 + testsuites/ada/samples/base_mp/node1/Makefile.am | 22 + .../samples/base_mp/node1/ada_base_mp-node1.scn | 5 + testsuites/ada/samples/base_mp/node2/Makefile.am | 22 + .../samples/base_mp/node2/ada_base_mp-node2.scn | 5 + testsuites/ada/samples/base_sp/Makefile.am | 19 + testsuites/ada/samples/base_sp/ada_base_sp.scn | 4 + testsuites/ada/samples/base_sp/base_sp.adb | 56 + testsuites/ada/samples/base_sp/config.h | 30 + testsuites/ada/samples/base_sp/sptest.adb | 93 + testsuites/ada/samples/base_sp/sptest.ads | 60 + testsuites/ada/samples/hello/Makefile.am | 19 + testsuites/ada/samples/hello/ada_hello.scn | 3 + testsuites/ada/samples/hello/config.h | 31 + testsuites/ada/samples/hello/hello.adb | 55 + testsuites/ada/samples/hello/sptest.adb | 44 + testsuites/ada/samples/hello/sptest.ads | 48 + testsuites/ada/samples/nsecs/Makefile.am | 19 + testsuites/ada/samples/nsecs/ada_nsecs.scn | 27 + testsuites/ada/samples/nsecs/config.h | 30 + testsuites/ada/samples/nsecs/nsecs.adb | 54 + testsuites/ada/samples/nsecs/sptest.adb | 153 + testsuites/ada/samples/nsecs/sptest.ads | 39 + testsuites/ada/samples/ticker/Makefile.am | 19 + testsuites/ada/samples/ticker/ada_ticker.scn | 16 + testsuites/ada/samples/ticker/config.h | 30 + testsuites/ada/samples/ticker/sptest.adb | 159 + testsuites/ada/samples/ticker/sptest.ads | 60 + testsuites/ada/samples/ticker/ticker.adb | 55 + testsuites/ada/sptests/Makefile.am | 28 + testsuites/ada/sptests/sp01/Makefile.am | 16 + testsuites/ada/sptests/sp01/ada_sp01.scn | 16 + testsuites/ada/sptests/sp01/config.h | 30 + testsuites/ada/sptests/sp01/sp01.adb | 55 + testsuites/ada/sptests/sp01/sptest.adb | 159 + testsuites/ada/sptests/sp01/sptest.ads | 60 + testsuites/ada/sptests/sp02/Makefile.am | 16 + testsuites/ada/sptests/sp02/ada_sp02.scn | 15 + testsuites/ada/sptests/sp02/config.h | 30 + testsuites/ada/sptests/sp02/sp02.adb | 55 + testsuites/ada/sptests/sp02/sptest.adb | 327 ++ testsuites/ada/sptests/sp02/sptest.ads | 102 + testsuites/ada/sptests/sp03/Makefile.am | 16 + testsuites/ada/sptests/sp03/ada_sp03.scn | 26 + testsuites/ada/sptests/sp03/config.h | 30 + testsuites/ada/sptests/sp03/sp03.adb | 55 + testsuites/ada/sptests/sp03/sptest.adb | 169 ++ testsuites/ada/sptests/sp03/sptest.ads | 75 + testsuites/ada/sptests/sp04/Makefile.am | 16 + testsuites/ada/sptests/sp04/README | 9 + testsuites/ada/sptests/sp04/ada_sp04.scn | 25 + testsuites/ada/sptests/sp04/config.h | 33 + testsuites/ada/sptests/sp04/sp04.adb | 55 + testsuites/ada/sptests/sp04/sptest.adb | 348 +++ testsuites/ada/sptests/sp04/sptest.ads | 136 + testsuites/ada/sptests/sp05/Makefile.am | 16 + testsuites/ada/sptests/sp05/ada_sp05.scn | 47 + testsuites/ada/sptests/sp05/config.h | 32 + testsuites/ada/sptests/sp05/sp05.adb | 55 + testsuites/ada/sptests/sp05/sptest.adb | 224 ++ testsuites/ada/sptests/sp05/sptest.ads | 86 + testsuites/ada/sptests/sp06/Makefile.am | 16 + testsuites/ada/sptests/sp06/ada_sp06.scn | 38 + testsuites/ada/sptests/sp06/config.h | 32 + testsuites/ada/sptests/sp06/sp06.adb | 55 + testsuites/ada/sptests/sp06/sptest.adb | 216 ++ testsuites/ada/sptests/sp06/sptest.ads | 93 + testsuites/ada/sptests/sp07/Makefile.am | 17 + testsuites/ada/sptests/sp07/ada_sp07.scn | 23 + testsuites/ada/sptests/sp07/config.h | 33 + testsuites/ada/sptests/sp07/sp07.adb | 55 + testsuites/ada/sptests/sp07/sptest.adb | 513 ++++ testsuites/ada/sptests/sp07/sptest.ads | 194 ++ testsuites/ada/sptests/sp08/Makefile.am | 16 + testsuites/ada/sptests/sp08/ada_sp08.scn | 20 + testsuites/ada/sptests/sp08/config.h | 32 + testsuites/ada/sptests/sp08/sp08.adb | 55 + testsuites/ada/sptests/sp08/sptest.adb | 346 +++ testsuites/ada/sptests/sp08/sptest.ads | 74 + testsuites/ada/sptests/sp09/Makefile.am | 21 + testsuites/ada/sptests/sp09/ada_sp09.scn | 246 ++ testsuites/ada/sptests/sp09/config.h | 38 + testsuites/ada/sptests/sp09/sp09.adb | 55 + testsuites/ada/sptests/sp09/sptest.adb | 3117 ++++++++++++++++++++ testsuites/ada/sptests/sp09/sptest.ads | 393 +++ testsuites/ada/sptests/sp11/Makefile.am | 16 + testsuites/ada/sptests/sp11/ada_sp11.scn | 74 + testsuites/ada/sptests/sp11/config.h | 32 + testsuites/ada/sptests/sp11/sp11.adb | 55 + testsuites/ada/sptests/sp11/sptest.adb | 906 ++++++ testsuites/ada/sptests/sp11/sptest.ads | 186 ++ testsuites/ada/sptests/sp12/Makefile.am | 16 + testsuites/ada/sptests/sp12/ada_sp12.scn | 78 + testsuites/ada/sptests/sp12/config.h | 32 + testsuites/ada/sptests/sp12/sp12.adb | 56 + testsuites/ada/sptests/sp12/sptest.adb | 809 +++++ testsuites/ada/sptests/sp12/sptest.ads | 147 + testsuites/ada/sptests/sp13/Makefile.am | 16 + testsuites/ada/sptests/sp13/ada_sp13.scn | 78 + testsuites/ada/sptests/sp13/config.h | 32 + testsuites/ada/sptests/sp13/sp13.adb | 55 + testsuites/ada/sptests/sp13/sptest.adb | 891 ++++++ testsuites/ada/sptests/sp13/sptest.ads | 134 + testsuites/ada/sptests/sp14/Makefile.am | 16 + testsuites/ada/sptests/sp14/ada_sp14.scn | 33 + testsuites/ada/sptests/sp14/config.h | 32 + testsuites/ada/sptests/sp14/sp14.adb | 55 + testsuites/ada/sptests/sp14/sptest.adb | 325 ++ testsuites/ada/sptests/sp14/sptest.ads | 134 + testsuites/ada/sptests/sp15/Makefile.am | 16 + testsuites/ada/sptests/sp15/ada_sp15.scn | 16 + testsuites/ada/sptests/sp15/config.h | 32 + testsuites/ada/sptests/sp15/sp15.adb | 55 + testsuites/ada/sptests/sp15/sptest.adb | 278 ++ testsuites/ada/sptests/sp15/sptest.ads | 118 + testsuites/ada/sptests/sp16/Makefile.am | 16 + testsuites/ada/sptests/sp16/ada_sp16.scn | 58 + testsuites/ada/sptests/sp16/config.h | 32 + testsuites/ada/sptests/sp16/sp16.adb | 55 + testsuites/ada/sptests/sp16/sptest.adb | 789 +++++ testsuites/ada/sptests/sp16/sptest.ads | 202 ++ testsuites/ada/sptests/sp17/Makefile.am | 16 + testsuites/ada/sptests/sp17/ada_sp17.scn | 8 + testsuites/ada/sptests/sp17/config.h | 32 + testsuites/ada/sptests/sp17/sp17.adb | 55 + testsuites/ada/sptests/sp17/sptest.adb | 170 ++ testsuites/ada/sptests/sp17/sptest.ads | 95 + testsuites/ada/sptests/sp19/Makefile.am | 20 + testsuites/ada/sptests/sp19/README | 19 + testsuites/ada/sptests/sp19/ada_sp19.scn | 55 + testsuites/ada/sptests/sp19/config.h | 30 + testsuites/ada/sptests/sp19/sp19.adb | 55 + testsuites/ada/sptests/sp19/sptest.adp | 397 +++ testsuites/ada/sptests/sp19/sptest.ads | 119 + testsuites/ada/sptests/sp20/Makefile.am | 16 + testsuites/ada/sptests/sp20/ada_sp20.scn | 40 + testsuites/ada/sptests/sp20/config.h | 31 + testsuites/ada/sptests/sp20/sp20.adb | 54 + testsuites/ada/sptests/sp20/sptest.adb | 310 ++ testsuites/ada/sptests/sp20/sptest.ads | 105 + testsuites/ada/sptests/sp22/Makefile.am | 16 + testsuites/ada/sptests/sp22/ada_sp22.scn | 29 + testsuites/ada/sptests/sp22/config.h | 31 + testsuites/ada/sptests/sp22/sp22.adb | 55 + testsuites/ada/sptests/sp22/sptest.adb | 297 ++ testsuites/ada/sptests/sp22/sptest.ads | 93 + testsuites/ada/sptests/sp23/Makefile.am | 16 + testsuites/ada/sptests/sp23/ada_sp23.scn | 9 + testsuites/ada/sptests/sp23/config.h | 31 + testsuites/ada/sptests/sp23/sp23.adb | 55 + testsuites/ada/sptests/sp23/sptest.adb | 175 ++ testsuites/ada/sptests/sp23/sptest.ads | 118 + testsuites/ada/sptests/sp24/Makefile.am | 16 + testsuites/ada/sptests/sp24/ada_sp24.scn | 16 + testsuites/ada/sptests/sp24/config.h | 31 + testsuites/ada/sptests/sp24/sp24.adb | 55 + testsuites/ada/sptests/sp24/sptest.adb | 167 ++ testsuites/ada/sptests/sp24/sptest.ads | 83 + testsuites/ada/sptests/sp25/Makefile.am | 16 + testsuites/ada/sptests/sp25/ada_sp25.scn | 29 + testsuites/ada/sptests/sp25/config.h | 31 + testsuites/ada/sptests/sp25/sp25.adb | 55 + testsuites/ada/sptests/sp25/sptest.adb | 362 +++ testsuites/ada/sptests/sp25/sptest.ads | 103 + testsuites/ada/sptests/spatcb01/Makefile.am | 16 + testsuites/ada/sptests/spatcb01/ada_spatcb01.scn | 3 + testsuites/ada/sptests/spatcb01/config.h | 16 + testsuites/ada/sptests/spatcb01/spatcb01.adb | 26 + testsuites/ada/sptests/spname01/Makefile.am | 18 + testsuites/ada/sptests/spname01/ada_spname01.scn | 3 + testsuites/ada/sptests/spname01/config.h | 31 + testsuites/ada/sptests/spname01/spname01.adb | 28 + testsuites/ada/sptests/spname01/sptest.adb | 62 + testsuites/ada/sptests/spname01/sptest.ads | 25 + testsuites/ada/support/Makefile.am | 18 + testsuites/ada/support/address_io.adb | 43 + testsuites/ada/support/address_io.ads | 32 + testsuites/ada/support/float_io.ads | 24 + testsuites/ada/support/fp.inc | 151 + testsuites/ada/support/init.c | 82 + testsuites/ada/support/integer.inc | 142 + testsuites/ada/support/rtems_calling_overhead.ads | 102 + testsuites/ada/support/status_io.ads | 25 + testsuites/ada/support/test_support.adb | 266 ++ testsuites/ada/support/test_support.ads | 195 ++ testsuites/ada/support/time_test_support.adb | 73 + testsuites/ada/support/time_test_support.ads | 51 + testsuites/ada/support/timer_driver.adb | 59 + testsuites/ada/support/timer_driver.ads | 77 + testsuites/ada/support/unsigned32_io.ads | 25 + testsuites/ada/tmtests/Makefile.am | 33 + testsuites/ada/tmtests/tm01/Makefile.am | 13 + testsuites/ada/tmtests/tm01/config.h | 32 + testsuites/ada/tmtests/tm01/tm01.adb | 55 + testsuites/ada/tmtests/tm01/tmtest.adb | 273 ++ testsuites/ada/tmtests/tm01/tmtest.ads | 67 + testsuites/ada/tmtests/tm02/Makefile.am | 13 + testsuites/ada/tmtests/tm02/config.h | 33 + testsuites/ada/tmtests/tm02/tm02.adb | 55 + testsuites/ada/tmtests/tm02/tmtest.adb | 206 ++ testsuites/ada/tmtests/tm02/tmtest.ads | 104 + testsuites/ada/tmtests/tm03/Makefile.am | 13 + testsuites/ada/tmtests/tm03/config.h | 33 + testsuites/ada/tmtests/tm03/tm03.adb | 55 + testsuites/ada/tmtests/tm03/tmtest.adb | 190 ++ testsuites/ada/tmtests/tm03/tmtest.ads | 96 + testsuites/ada/tmtests/tm04/Makefile.am | 13 + testsuites/ada/tmtests/tm04/config.h | 32 + testsuites/ada/tmtests/tm04/tm04.adb | 55 + testsuites/ada/tmtests/tm04/tmtest.adb | 494 ++++ testsuites/ada/tmtests/tm04/tmtest.ads | 163 + testsuites/ada/tmtests/tm05/Makefile.am | 13 + testsuites/ada/tmtests/tm05/config.h | 33 + testsuites/ada/tmtests/tm05/tm05.adb | 55 + testsuites/ada/tmtests/tm05/tmtest.adb | 170 ++ testsuites/ada/tmtests/tm05/tmtest.ads | 114 + testsuites/ada/tmtests/tm06/Makefile.am | 13 + testsuites/ada/tmtests/tm06/config.h | 33 + testsuites/ada/tmtests/tm06/tm06.adb | 55 + testsuites/ada/tmtests/tm06/tmtest.adb | 202 ++ testsuites/ada/tmtests/tm06/tmtest.ads | 104 + testsuites/ada/tmtests/tm07/Makefile.am | 13 + testsuites/ada/tmtests/tm07/config.h | 33 + testsuites/ada/tmtests/tm07/tm07.adb | 55 + testsuites/ada/tmtests/tm07/tmtest.adb | 170 ++ testsuites/ada/tmtests/tm07/tmtest.ads | 112 + testsuites/ada/tmtests/tm08/Makefile.am | 13 + testsuites/ada/tmtests/tm08/config.h | 33 + testsuites/ada/tmtests/tm08/tm08.adb | 55 + testsuites/ada/tmtests/tm08/tmtest.adb | 299 ++ testsuites/ada/tmtests/tm08/tmtest.ads | 96 + testsuites/ada/tmtests/tm09/Makefile.am | 13 + testsuites/ada/tmtests/tm09/config.h | 32 + testsuites/ada/tmtests/tm09/tm09.adb | 55 + testsuites/ada/tmtests/tm09/tmtest.adb | 297 ++ testsuites/ada/tmtests/tm09/tmtest.ads | 99 + testsuites/ada/tmtests/tm10/Makefile.am | 13 + testsuites/ada/tmtests/tm10/config.h | 32 + testsuites/ada/tmtests/tm10/tm10.adb | 55 + testsuites/ada/tmtests/tm10/tmtest.adb | 220 ++ testsuites/ada/tmtests/tm10/tmtest.ads | 118 + testsuites/ada/tmtests/tm11/Makefile.am | 13 + testsuites/ada/tmtests/tm11/config.h | 32 + testsuites/ada/tmtests/tm11/tm11.adb | 55 + testsuites/ada/tmtests/tm11/tmtest.adb | 218 ++ testsuites/ada/tmtests/tm11/tmtest.ads | 115 + testsuites/ada/tmtests/tm12/Makefile.am | 13 + testsuites/ada/tmtests/tm12/config.h | 32 + testsuites/ada/tmtests/tm12/tm12.adb | 55 + testsuites/ada/tmtests/tm12/tmtest.adb | 204 ++ testsuites/ada/tmtests/tm12/tmtest.ads | 106 + testsuites/ada/tmtests/tm13/Makefile.am | 13 + testsuites/ada/tmtests/tm13/config.h | 32 + testsuites/ada/tmtests/tm13/tm13.adb | 55 + testsuites/ada/tmtests/tm13/tmtest.adb | 216 ++ testsuites/ada/tmtests/tm13/tmtest.ads | 115 + testsuites/ada/tmtests/tm14/Makefile.am | 13 + testsuites/ada/tmtests/tm14/config.h | 32 + testsuites/ada/tmtests/tm14/tm14.adb | 55 + testsuites/ada/tmtests/tm14/tmtest.adb | 214 ++ testsuites/ada/tmtests/tm14/tmtest.ads | 106 + testsuites/ada/tmtests/tm15/Makefile.am | 13 + testsuites/ada/tmtests/tm15/config.h | 32 + testsuites/ada/tmtests/tm15/tm15.adb | 55 + testsuites/ada/tmtests/tm15/tmtest.adb | 267 ++ testsuites/ada/tmtests/tm15/tmtest.ads | 109 + testsuites/ada/tmtests/tm16/Makefile.am | 13 + testsuites/ada/tmtests/tm16/config.h | 32 + testsuites/ada/tmtests/tm16/tm16.adb | 55 + testsuites/ada/tmtests/tm16/tmtest.adb | 196 ++ testsuites/ada/tmtests/tm16/tmtest.ads | 112 + testsuites/ada/tmtests/tm17/Makefile.am | 13 + testsuites/ada/tmtests/tm17/config.h | 32 + testsuites/ada/tmtests/tm17/tm17.adb | 55 + testsuites/ada/tmtests/tm17/tmtest.adb | 155 + testsuites/ada/tmtests/tm17/tmtest.ads | 110 + testsuites/ada/tmtests/tm18/Makefile.am | 13 + testsuites/ada/tmtests/tm18/config.h | 32 + testsuites/ada/tmtests/tm18/tm18.adb | 55 + testsuites/ada/tmtests/tm18/tmtest.adb | 151 + testsuites/ada/tmtests/tm18/tmtest.ads | 97 + testsuites/ada/tmtests/tm19/Makefile.am | 13 + testsuites/ada/tmtests/tm19/config.h | 32 + testsuites/ada/tmtests/tm19/tm19.adb | 55 + testsuites/ada/tmtests/tm19/tmtest.adb | 287 ++ testsuites/ada/tmtests/tm19/tmtest.ads | 147 + testsuites/ada/tmtests/tm20/Makefile.am | 13 + testsuites/ada/tmtests/tm20/config.h | 33 + testsuites/ada/tmtests/tm20/tm20.adb | 55 + testsuites/ada/tmtests/tm20/tmtest.adb | 455 +++ testsuites/ada/tmtests/tm20/tmtest.ads | 151 + testsuites/ada/tmtests/tm21/Makefile.am | 13 + testsuites/ada/tmtests/tm21/config.h | 38 + testsuites/ada/tmtests/tm21/tm21.adb | 55 + testsuites/ada/tmtests/tm21/tmtest.adb | 304 ++ testsuites/ada/tmtests/tm21/tmtest.ads | 121 + testsuites/ada/tmtests/tm22/Makefile.am | 13 + testsuites/ada/tmtests/tm22/config.h | 32 + testsuites/ada/tmtests/tm22/tm22.adb | 55 + testsuites/ada/tmtests/tm22/tmtest.adb | 252 ++ testsuites/ada/tmtests/tm22/tmtest.ads | 120 + testsuites/ada/tmtests/tm23/Makefile.am | 13 + testsuites/ada/tmtests/tm23/config.h | 32 + testsuites/ada/tmtests/tm23/tm23.adb | 55 + testsuites/ada/tmtests/tm23/tmtest.adb | 388 +++ testsuites/ada/tmtests/tm23/tmtest.ads | 132 + testsuites/ada/tmtests/tm24/Makefile.am | 13 + testsuites/ada/tmtests/tm24/config.h | 31 + testsuites/ada/tmtests/tm24/tm24.adb | 55 + testsuites/ada/tmtests/tm24/tmtest.adb | 161 + testsuites/ada/tmtests/tm24/tmtest.ads | 99 + testsuites/ada/tmtests/tm25/Makefile.am | 13 + testsuites/ada/tmtests/tm25/config.h | 32 + testsuites/ada/tmtests/tm25/tm25.adb | 55 + testsuites/ada/tmtests/tm25/tmtest.adb | 155 + testsuites/ada/tmtests/tm25/tmtest.ads | 80 + testsuites/ada/tmtests/tm28/Makefile.am | 13 + testsuites/ada/tmtests/tm28/config.h | 32 + testsuites/ada/tmtests/tm28/tm28.adb | 55 + testsuites/ada/tmtests/tm28/tmtest.adb | 171 ++ testsuites/ada/tmtests/tm28/tmtest.ads | 105 + testsuites/ada/tmtests/tm29/Makefile.am | 13 + testsuites/ada/tmtests/tm29/config.h | 32 + testsuites/ada/tmtests/tm29/tm29.adb | 55 + testsuites/ada/tmtests/tm29/tmtest.adb | 236 ++ testsuites/ada/tmtests/tm29/tmtest.ads | 96 + testsuites/ada/tmtests/tmck/Makefile.am | 13 + testsuites/ada/tmtests/tmck/config.h | 32 + testsuites/ada/tmtests/tmck/tmck.adb | 55 + testsuites/ada/tmtests/tmck/tmtest.adb | 214 ++ testsuites/ada/tmtests/tmck/tmtest.ads | 96 + testsuites/ada/tmtests/tmoverhd/Makefile.am | 14 + testsuites/ada/tmtests/tmoverhd/README | 5 + testsuites/ada/tmtests/tmoverhd/config.h | 32 + testsuites/ada/tmtests/tmoverhd/dummy_rtems.adb | 891 ++++++ testsuites/ada/tmtests/tmoverhd/dummy_rtems.ads | 445 +++ testsuites/ada/tmtests/tmoverhd/tmoverhd.adb | 55 + testsuites/ada/tmtests/tmoverhd/tmtest.adb | 1363 +++++++++ testsuites/ada/tmtests/tmoverhd/tmtest.ads | 156 + testsuites/configure.ac | 11 + 1014 files changed, 44887 insertions(+), 44887 deletions(-) delete mode 100644 c/src/ada-tests/Makefile.am delete mode 100644 c/src/ada-tests/aclocal/prog-gnat.m4 delete mode 100644 c/src/ada-tests/ada.am delete mode 100644 c/src/ada-tests/ada_mvscn delete mode 100644 c/src/ada-tests/configure.ac delete mode 100644 c/src/ada-tests/mptests/Makefile.am delete mode 100644 c/src/ada-tests/mptests/mp01/Makefile.am delete mode 100644 c/src/ada-tests/mptests/mp01/config_base.h delete mode 100644 c/src/ada-tests/mptests/mp01/mp01.adb delete mode 100644 c/src/ada-tests/mptests/mp01/mptest.adb delete mode 100644 c/src/ada-tests/mptests/mp01/mptest.ads delete mode 100644 c/src/ada-tests/mptests/mp01/node1/Makefile.am delete mode 100644 c/src/ada-tests/mptests/mp01/node1/ada_mp01-node1.scn delete mode 100644 c/src/ada-tests/mptests/mp01/node1/config.h delete mode 100644 c/src/ada-tests/mptests/mp01/node1/mp01_node1.adb delete mode 100644 c/src/ada-tests/mptests/mp01/node2/Makefile.am delete mode 100644 c/src/ada-tests/mptests/mp01/node2/ada_mp01-node2.scn delete mode 100644 c/src/ada-tests/mptests/mp01/node2/config.h delete mode 100644 c/src/ada-tests/mptests/mp01/node2/mp01_node2.adb delete mode 100644 c/src/ada-tests/mptests/mp03/Makefile.am delete mode 100644 c/src/ada-tests/mptests/mp03/config_base.h delete mode 100644 c/src/ada-tests/mptests/mp03/mptest.adb delete mode 100644 c/src/ada-tests/mptests/mp03/mptest.ads delete mode 100644 c/src/ada-tests/mptests/mp03/node1/Makefile.am delete mode 100644 c/src/ada-tests/mptests/mp03/node1/ada_mp03-node1.scn delete mode 100644 c/src/ada-tests/mptests/mp03/node1/config.h delete mode 100644 c/src/ada-tests/mptests/mp03/node1/mp03_node1.adb delete mode 100644 c/src/ada-tests/mptests/mp03/node2/Makefile.am delete mode 100644 c/src/ada-tests/mptests/mp03/node2/ada_mp03-node2.scn delete mode 100644 c/src/ada-tests/mptests/mp03/node2/config.h delete mode 100644 c/src/ada-tests/mptests/mp03/node2/mp03_node2.adb delete mode 100644 c/src/ada-tests/mptests/mp04/Makefile.am delete mode 100644 c/src/ada-tests/mptests/mp04/config_base.h delete mode 100644 c/src/ada-tests/mptests/mp04/mptest.adb delete mode 100644 c/src/ada-tests/mptests/mp04/mptest.ads delete mode 100644 c/src/ada-tests/mptests/mp04/node1/Makefile.am delete mode 100644 c/src/ada-tests/mptests/mp04/node1/ada_mp04-node1.scn delete mode 100644 c/src/ada-tests/mptests/mp04/node1/config.h delete mode 100644 c/src/ada-tests/mptests/mp04/node1/mp04_node1.adb delete mode 100644 c/src/ada-tests/mptests/mp04/node2/Makefile.am delete mode 100644 c/src/ada-tests/mptests/mp04/node2/ada_mp04-node2.scn delete mode 100644 c/src/ada-tests/mptests/mp04/node2/config.h delete mode 100644 c/src/ada-tests/mptests/mp04/node2/mp04_node2.adb delete mode 100644 c/src/ada-tests/mptests/mp05/Makefile.am delete mode 100644 c/src/ada-tests/mptests/mp05/config_base.h delete mode 100644 c/src/ada-tests/mptests/mp05/mptest.adb delete mode 100644 c/src/ada-tests/mptests/mp05/mptest.ads delete mode 100644 c/src/ada-tests/mptests/mp05/node1/Makefile.am delete mode 100644 c/src/ada-tests/mptests/mp05/node1/ada_mp05-node1.scn delete mode 100644 c/src/ada-tests/mptests/mp05/node1/config.h delete mode 100644 c/src/ada-tests/mptests/mp05/node1/mp05_node1.adb delete mode 100644 c/src/ada-tests/mptests/mp05/node2/Makefile.am delete mode 100644 c/src/ada-tests/mptests/mp05/node2/ada_mp05-node2.scn delete mode 100644 c/src/ada-tests/mptests/mp05/node2/config.h delete mode 100644 c/src/ada-tests/mptests/mp05/node2/mp05_node2.adb delete mode 100644 c/src/ada-tests/mptests/mp06/Makefile.am delete mode 100644 c/src/ada-tests/mptests/mp06/config_base.h delete mode 100644 c/src/ada-tests/mptests/mp06/mptest.adb delete mode 100644 c/src/ada-tests/mptests/mp06/mptest.ads delete mode 100644 c/src/ada-tests/mptests/mp06/node1/Makefile.am delete mode 100644 c/src/ada-tests/mptests/mp06/node1/ada_mp06-node1.scn delete mode 100644 c/src/ada-tests/mptests/mp06/node1/config.h delete mode 100644 c/src/ada-tests/mptests/mp06/node1/mp06_node1.adb delete mode 100644 c/src/ada-tests/mptests/mp06/node2/Makefile.am delete mode 100644 c/src/ada-tests/mptests/mp06/node2/ada_mp06-node2.scn delete mode 100644 c/src/ada-tests/mptests/mp06/node2/config.h delete mode 100644 c/src/ada-tests/mptests/mp06/node2/mp06_node2.adb delete mode 100644 c/src/ada-tests/mptests/mp07/Makefile.am delete mode 100644 c/src/ada-tests/mptests/mp07/config_base.h delete mode 100644 c/src/ada-tests/mptests/mp07/mptest.adb delete mode 100644 c/src/ada-tests/mptests/mp07/mptest.ads delete mode 100644 c/src/ada-tests/mptests/mp07/node1/Makefile.am delete mode 100644 c/src/ada-tests/mptests/mp07/node1/ada_mp07-node1.scn delete mode 100644 c/src/ada-tests/mptests/mp07/node1/config.h delete mode 100644 c/src/ada-tests/mptests/mp07/node1/mp07_node1.adb delete mode 100644 c/src/ada-tests/mptests/mp07/node2/Makefile.am delete mode 100644 c/src/ada-tests/mptests/mp07/node2/ada_mp07-node2.scn delete mode 100644 c/src/ada-tests/mptests/mp07/node2/config.h delete mode 100644 c/src/ada-tests/mptests/mp07/node2/mp07_node2.adb delete mode 100644 c/src/ada-tests/mptests/mp08/Makefile.am delete mode 100644 c/src/ada-tests/mptests/mp08/config_base.h delete mode 100644 c/src/ada-tests/mptests/mp08/mptest.adb delete mode 100644 c/src/ada-tests/mptests/mp08/mptest.ads delete mode 100644 c/src/ada-tests/mptests/mp08/node1/Makefile.am delete mode 100644 c/src/ada-tests/mptests/mp08/node1/ada_mp08-node1.scn delete mode 100644 c/src/ada-tests/mptests/mp08/node1/config.h delete mode 100644 c/src/ada-tests/mptests/mp08/node1/mp08_node1.adb delete mode 100644 c/src/ada-tests/mptests/mp08/node2/Makefile.am delete mode 100644 c/src/ada-tests/mptests/mp08/node2/ada_mp08-node2.scn delete mode 100644 c/src/ada-tests/mptests/mp08/node2/config.h delete mode 100644 c/src/ada-tests/mptests/mp08/node2/mp08_node2.adb delete mode 100644 c/src/ada-tests/mptests/mp09/Makefile.am delete mode 100644 c/src/ada-tests/mptests/mp09/config_base.h delete mode 100644 c/src/ada-tests/mptests/mp09/mptest.adb delete mode 100644 c/src/ada-tests/mptests/mp09/mptest.ads delete mode 100644 c/src/ada-tests/mptests/mp09/node1/Makefile.am delete mode 100644 c/src/ada-tests/mptests/mp09/node1/ada_mp09-node1.scn delete mode 100644 c/src/ada-tests/mptests/mp09/node1/config.h delete mode 100644 c/src/ada-tests/mptests/mp09/node1/mp09_node1.adb delete mode 100644 c/src/ada-tests/mptests/mp09/node2/Makefile.am delete mode 100644 c/src/ada-tests/mptests/mp09/node2/ada_mp09-node2.scn delete mode 100644 c/src/ada-tests/mptests/mp09/node2/config.h delete mode 100644 c/src/ada-tests/mptests/mp09/node2/mp09_node2.adb delete mode 100644 c/src/ada-tests/mptests/mp10/Makefile.am delete mode 100644 c/src/ada-tests/mptests/mp10/config_base.h delete mode 100644 c/src/ada-tests/mptests/mp10/mptest.adb delete mode 100644 c/src/ada-tests/mptests/mp10/mptest.ads delete mode 100644 c/src/ada-tests/mptests/mp10/node1/Makefile.am delete mode 100644 c/src/ada-tests/mptests/mp10/node1/ada_mp10-node1.scn delete mode 100644 c/src/ada-tests/mptests/mp10/node1/config.h delete mode 100644 c/src/ada-tests/mptests/mp10/node1/mp10_node1.adb delete mode 100644 c/src/ada-tests/mptests/mp10/node2/Makefile.am delete mode 100644 c/src/ada-tests/mptests/mp10/node2/ada_mp10-node2.scn delete mode 100644 c/src/ada-tests/mptests/mp10/node2/config.h delete mode 100644 c/src/ada-tests/mptests/mp10/node2/mp10_node2.adb delete mode 100644 c/src/ada-tests/mptests/mp11/Makefile.am delete mode 100644 c/src/ada-tests/mptests/mp11/config_base.h delete mode 100644 c/src/ada-tests/mptests/mp11/mptest.adb delete mode 100644 c/src/ada-tests/mptests/mp11/mptest.ads delete mode 100644 c/src/ada-tests/mptests/mp11/node1/Makefile.am delete mode 100644 c/src/ada-tests/mptests/mp11/node1/ada_mp11-node1.scn delete mode 100644 c/src/ada-tests/mptests/mp11/node1/config.h delete mode 100644 c/src/ada-tests/mptests/mp11/node1/mp11_node1.adb delete mode 100644 c/src/ada-tests/mptests/mp11/node2/Makefile.am delete mode 100644 c/src/ada-tests/mptests/mp11/node2/ada_mp11-node2.scn delete mode 100644 c/src/ada-tests/mptests/mp11/node2/config.h delete mode 100644 c/src/ada-tests/mptests/mp11/node2/mp11_node2.adb delete mode 100644 c/src/ada-tests/mptests/mp12/Makefile.am delete mode 100644 c/src/ada-tests/mptests/mp12/config_base.h delete mode 100644 c/src/ada-tests/mptests/mp12/mptest.adb delete mode 100644 c/src/ada-tests/mptests/mp12/mptest.ads delete mode 100644 c/src/ada-tests/mptests/mp12/node1/Makefile.am delete mode 100644 c/src/ada-tests/mptests/mp12/node1/ada_mp12-node1.scn delete mode 100644 c/src/ada-tests/mptests/mp12/node1/config.h delete mode 100644 c/src/ada-tests/mptests/mp12/node1/mp12_node1.adb delete mode 100644 c/src/ada-tests/mptests/mp12/node2/Makefile.am delete mode 100644 c/src/ada-tests/mptests/mp12/node2/ada_mp12-node2.scn delete mode 100644 c/src/ada-tests/mptests/mp12/node2/config.h delete mode 100644 c/src/ada-tests/mptests/mp12/node2/mp12_node2.adb delete mode 100644 c/src/ada-tests/mptests/mp13/Makefile.am delete mode 100644 c/src/ada-tests/mptests/mp13/config_base.h delete mode 100644 c/src/ada-tests/mptests/mp13/mptest.adb delete mode 100644 c/src/ada-tests/mptests/mp13/mptest.ads delete mode 100644 c/src/ada-tests/mptests/mp13/node1/Makefile.am delete mode 100644 c/src/ada-tests/mptests/mp13/node1/ada_mp13-node1.scn delete mode 100644 c/src/ada-tests/mptests/mp13/node1/config.h delete mode 100644 c/src/ada-tests/mptests/mp13/node1/mp13_node1.adb delete mode 100644 c/src/ada-tests/mptests/mp13/node2/Makefile.am delete mode 100644 c/src/ada-tests/mptests/mp13/node2/ada_mp13-node2.scn delete mode 100644 c/src/ada-tests/mptests/mp13/node2/config.h delete mode 100644 c/src/ada-tests/mptests/mp13/node2/mp13_node2.adb delete mode 100644 c/src/ada-tests/mptests/mp14/Makefile.am delete mode 100644 c/src/ada-tests/mptests/mp14/config_base.h delete mode 100644 c/src/ada-tests/mptests/mp14/mptest.adb delete mode 100644 c/src/ada-tests/mptests/mp14/mptest.ads delete mode 100644 c/src/ada-tests/mptests/mp14/node1/Makefile.am delete mode 100644 c/src/ada-tests/mptests/mp14/node1/ada_mp14-node1.scn delete mode 100644 c/src/ada-tests/mptests/mp14/node1/config.h delete mode 100644 c/src/ada-tests/mptests/mp14/node1/mp14_node1.adb delete mode 100644 c/src/ada-tests/mptests/mp14/node2/Makefile.am delete mode 100644 c/src/ada-tests/mptests/mp14/node2/ada_mp14-node2.scn delete mode 100644 c/src/ada-tests/mptests/mp14/node2/config.h delete mode 100644 c/src/ada-tests/mptests/mp14/node2/mp14_node2.adb delete mode 100644 c/src/ada-tests/samples/Makefile.am delete mode 100644 c/src/ada-tests/samples/base_mp/Makefile.am delete mode 100644 c/src/ada-tests/samples/base_mp/config.h delete mode 100644 c/src/ada-tests/samples/base_mp/mptest.adb delete mode 100644 c/src/ada-tests/samples/base_mp/mptest.ads delete mode 100644 c/src/ada-tests/samples/base_mp/node1/Makefile.am delete mode 100644 c/src/ada-tests/samples/base_mp/node1/ada_base_mp-node1.scn delete mode 100644 c/src/ada-tests/samples/base_mp/node2/Makefile.am delete mode 100644 c/src/ada-tests/samples/base_mp/node2/ada_base_mp-node2.scn delete mode 100644 c/src/ada-tests/samples/base_sp/Makefile.am delete mode 100644 c/src/ada-tests/samples/base_sp/ada_base_sp.scn delete mode 100644 c/src/ada-tests/samples/base_sp/base_sp.adb delete mode 100644 c/src/ada-tests/samples/base_sp/config.h delete mode 100644 c/src/ada-tests/samples/base_sp/sptest.adb delete mode 100644 c/src/ada-tests/samples/base_sp/sptest.ads delete mode 100644 c/src/ada-tests/samples/hello/Makefile.am delete mode 100644 c/src/ada-tests/samples/hello/ada_hello.scn delete mode 100644 c/src/ada-tests/samples/hello/config.h delete mode 100644 c/src/ada-tests/samples/hello/hello.adb delete mode 100644 c/src/ada-tests/samples/hello/sptest.adb delete mode 100644 c/src/ada-tests/samples/hello/sptest.ads delete mode 100644 c/src/ada-tests/samples/nsecs/Makefile.am delete mode 100644 c/src/ada-tests/samples/nsecs/ada_nsecs.scn delete mode 100644 c/src/ada-tests/samples/nsecs/config.h delete mode 100644 c/src/ada-tests/samples/nsecs/nsecs.adb delete mode 100644 c/src/ada-tests/samples/nsecs/sptest.adb delete mode 100644 c/src/ada-tests/samples/nsecs/sptest.ads delete mode 100644 c/src/ada-tests/samples/ticker/Makefile.am delete mode 100644 c/src/ada-tests/samples/ticker/ada_ticker.scn delete mode 100644 c/src/ada-tests/samples/ticker/config.h delete mode 100644 c/src/ada-tests/samples/ticker/sptest.adb delete mode 100644 c/src/ada-tests/samples/ticker/sptest.ads delete mode 100644 c/src/ada-tests/samples/ticker/ticker.adb delete mode 100644 c/src/ada-tests/sptests/Makefile.am delete mode 100644 c/src/ada-tests/sptests/sp01/Makefile.am delete mode 100644 c/src/ada-tests/sptests/sp01/ada_sp01.scn delete mode 100644 c/src/ada-tests/sptests/sp01/config.h delete mode 100644 c/src/ada-tests/sptests/sp01/sp01.adb delete mode 100644 c/src/ada-tests/sptests/sp01/sptest.adb delete mode 100644 c/src/ada-tests/sptests/sp01/sptest.ads delete mode 100644 c/src/ada-tests/sptests/sp02/Makefile.am delete mode 100644 c/src/ada-tests/sptests/sp02/ada_sp02.scn delete mode 100644 c/src/ada-tests/sptests/sp02/config.h delete mode 100644 c/src/ada-tests/sptests/sp02/sp02.adb delete mode 100644 c/src/ada-tests/sptests/sp02/sptest.adb delete mode 100644 c/src/ada-tests/sptests/sp02/sptest.ads delete mode 100644 c/src/ada-tests/sptests/sp03/Makefile.am delete mode 100644 c/src/ada-tests/sptests/sp03/ada_sp03.scn delete mode 100644 c/src/ada-tests/sptests/sp03/config.h delete mode 100644 c/src/ada-tests/sptests/sp03/sp03.adb delete mode 100644 c/src/ada-tests/sptests/sp03/sptest.adb delete mode 100644 c/src/ada-tests/sptests/sp03/sptest.ads delete mode 100644 c/src/ada-tests/sptests/sp04/Makefile.am delete mode 100644 c/src/ada-tests/sptests/sp04/README delete mode 100644 c/src/ada-tests/sptests/sp04/ada_sp04.scn delete mode 100644 c/src/ada-tests/sptests/sp04/config.h delete mode 100644 c/src/ada-tests/sptests/sp04/sp04.adb delete mode 100644 c/src/ada-tests/sptests/sp04/sptest.adb delete mode 100644 c/src/ada-tests/sptests/sp04/sptest.ads delete mode 100644 c/src/ada-tests/sptests/sp05/Makefile.am delete mode 100644 c/src/ada-tests/sptests/sp05/ada_sp05.scn delete mode 100644 c/src/ada-tests/sptests/sp05/config.h delete mode 100644 c/src/ada-tests/sptests/sp05/sp05.adb delete mode 100644 c/src/ada-tests/sptests/sp05/sptest.adb delete mode 100644 c/src/ada-tests/sptests/sp05/sptest.ads delete mode 100644 c/src/ada-tests/sptests/sp06/Makefile.am delete mode 100644 c/src/ada-tests/sptests/sp06/ada_sp06.scn delete mode 100644 c/src/ada-tests/sptests/sp06/config.h delete mode 100644 c/src/ada-tests/sptests/sp06/sp06.adb delete mode 100644 c/src/ada-tests/sptests/sp06/sptest.adb delete mode 100644 c/src/ada-tests/sptests/sp06/sptest.ads delete mode 100644 c/src/ada-tests/sptests/sp07/Makefile.am delete mode 100644 c/src/ada-tests/sptests/sp07/ada_sp07.scn delete mode 100644 c/src/ada-tests/sptests/sp07/config.h delete mode 100644 c/src/ada-tests/sptests/sp07/sp07.adb delete mode 100644 c/src/ada-tests/sptests/sp07/sptest.adb delete mode 100644 c/src/ada-tests/sptests/sp07/sptest.ads delete mode 100644 c/src/ada-tests/sptests/sp08/Makefile.am delete mode 100644 c/src/ada-tests/sptests/sp08/ada_sp08.scn delete mode 100644 c/src/ada-tests/sptests/sp08/config.h delete mode 100644 c/src/ada-tests/sptests/sp08/sp08.adb delete mode 100644 c/src/ada-tests/sptests/sp08/sptest.adb delete mode 100644 c/src/ada-tests/sptests/sp08/sptest.ads delete mode 100644 c/src/ada-tests/sptests/sp09/Makefile.am delete mode 100644 c/src/ada-tests/sptests/sp09/ada_sp09.scn delete mode 100644 c/src/ada-tests/sptests/sp09/config.h delete mode 100644 c/src/ada-tests/sptests/sp09/sp09.adb delete mode 100644 c/src/ada-tests/sptests/sp09/sptest.adb delete mode 100644 c/src/ada-tests/sptests/sp09/sptest.ads delete mode 100644 c/src/ada-tests/sptests/sp11/Makefile.am delete mode 100644 c/src/ada-tests/sptests/sp11/ada_sp11.scn delete mode 100644 c/src/ada-tests/sptests/sp11/config.h delete mode 100644 c/src/ada-tests/sptests/sp11/sp11.adb delete mode 100644 c/src/ada-tests/sptests/sp11/sptest.adb delete mode 100644 c/src/ada-tests/sptests/sp11/sptest.ads delete mode 100644 c/src/ada-tests/sptests/sp12/Makefile.am delete mode 100644 c/src/ada-tests/sptests/sp12/ada_sp12.scn delete mode 100644 c/src/ada-tests/sptests/sp12/config.h delete mode 100644 c/src/ada-tests/sptests/sp12/sp12.adb delete mode 100644 c/src/ada-tests/sptests/sp12/sptest.adb delete mode 100644 c/src/ada-tests/sptests/sp12/sptest.ads delete mode 100644 c/src/ada-tests/sptests/sp13/Makefile.am delete mode 100644 c/src/ada-tests/sptests/sp13/ada_sp13.scn delete mode 100644 c/src/ada-tests/sptests/sp13/config.h delete mode 100644 c/src/ada-tests/sptests/sp13/sp13.adb delete mode 100644 c/src/ada-tests/sptests/sp13/sptest.adb delete mode 100644 c/src/ada-tests/sptests/sp13/sptest.ads delete mode 100644 c/src/ada-tests/sptests/sp14/Makefile.am delete mode 100644 c/src/ada-tests/sptests/sp14/ada_sp14.scn delete mode 100644 c/src/ada-tests/sptests/sp14/config.h delete mode 100644 c/src/ada-tests/sptests/sp14/sp14.adb delete mode 100644 c/src/ada-tests/sptests/sp14/sptest.adb delete mode 100644 c/src/ada-tests/sptests/sp14/sptest.ads delete mode 100644 c/src/ada-tests/sptests/sp15/Makefile.am delete mode 100644 c/src/ada-tests/sptests/sp15/ada_sp15.scn delete mode 100644 c/src/ada-tests/sptests/sp15/config.h delete mode 100644 c/src/ada-tests/sptests/sp15/sp15.adb delete mode 100644 c/src/ada-tests/sptests/sp15/sptest.adb delete mode 100644 c/src/ada-tests/sptests/sp15/sptest.ads delete mode 100644 c/src/ada-tests/sptests/sp16/Makefile.am delete mode 100644 c/src/ada-tests/sptests/sp16/ada_sp16.scn delete mode 100644 c/src/ada-tests/sptests/sp16/config.h delete mode 100644 c/src/ada-tests/sptests/sp16/sp16.adb delete mode 100644 c/src/ada-tests/sptests/sp16/sptest.adb delete mode 100644 c/src/ada-tests/sptests/sp16/sptest.ads delete mode 100644 c/src/ada-tests/sptests/sp17/Makefile.am delete mode 100644 c/src/ada-tests/sptests/sp17/ada_sp17.scn delete mode 100644 c/src/ada-tests/sptests/sp17/config.h delete mode 100644 c/src/ada-tests/sptests/sp17/sp17.adb delete mode 100644 c/src/ada-tests/sptests/sp17/sptest.adb delete mode 100644 c/src/ada-tests/sptests/sp17/sptest.ads delete mode 100644 c/src/ada-tests/sptests/sp19/Makefile.am delete mode 100644 c/src/ada-tests/sptests/sp19/README delete mode 100644 c/src/ada-tests/sptests/sp19/ada_sp19.scn delete mode 100644 c/src/ada-tests/sptests/sp19/config.h delete mode 100644 c/src/ada-tests/sptests/sp19/sp19.adb delete mode 100644 c/src/ada-tests/sptests/sp19/sptest.adp delete mode 100644 c/src/ada-tests/sptests/sp19/sptest.ads delete mode 100644 c/src/ada-tests/sptests/sp20/Makefile.am delete mode 100644 c/src/ada-tests/sptests/sp20/ada_sp20.scn delete mode 100644 c/src/ada-tests/sptests/sp20/config.h delete mode 100644 c/src/ada-tests/sptests/sp20/sp20.adb delete mode 100644 c/src/ada-tests/sptests/sp20/sptest.adb delete mode 100644 c/src/ada-tests/sptests/sp20/sptest.ads delete mode 100644 c/src/ada-tests/sptests/sp22/Makefile.am delete mode 100644 c/src/ada-tests/sptests/sp22/ada_sp22.scn delete mode 100644 c/src/ada-tests/sptests/sp22/config.h delete mode 100644 c/src/ada-tests/sptests/sp22/sp22.adb delete mode 100644 c/src/ada-tests/sptests/sp22/sptest.adb delete mode 100644 c/src/ada-tests/sptests/sp22/sptest.ads delete mode 100644 c/src/ada-tests/sptests/sp23/Makefile.am delete mode 100644 c/src/ada-tests/sptests/sp23/ada_sp23.scn delete mode 100644 c/src/ada-tests/sptests/sp23/config.h delete mode 100644 c/src/ada-tests/sptests/sp23/sp23.adb delete mode 100644 c/src/ada-tests/sptests/sp23/sptest.adb delete mode 100644 c/src/ada-tests/sptests/sp23/sptest.ads delete mode 100644 c/src/ada-tests/sptests/sp24/Makefile.am delete mode 100644 c/src/ada-tests/sptests/sp24/ada_sp24.scn delete mode 100644 c/src/ada-tests/sptests/sp24/config.h delete mode 100644 c/src/ada-tests/sptests/sp24/sp24.adb delete mode 100644 c/src/ada-tests/sptests/sp24/sptest.adb delete mode 100644 c/src/ada-tests/sptests/sp24/sptest.ads delete mode 100644 c/src/ada-tests/sptests/sp25/Makefile.am delete mode 100644 c/src/ada-tests/sptests/sp25/ada_sp25.scn delete mode 100644 c/src/ada-tests/sptests/sp25/config.h delete mode 100644 c/src/ada-tests/sptests/sp25/sp25.adb delete mode 100644 c/src/ada-tests/sptests/sp25/sptest.adb delete mode 100644 c/src/ada-tests/sptests/sp25/sptest.ads delete mode 100644 c/src/ada-tests/sptests/spatcb01/Makefile.am delete mode 100644 c/src/ada-tests/sptests/spatcb01/ada_spatcb01.scn delete mode 100644 c/src/ada-tests/sptests/spatcb01/config.h delete mode 100644 c/src/ada-tests/sptests/spatcb01/spatcb01.adb delete mode 100644 c/src/ada-tests/sptests/spname01/Makefile.am delete mode 100644 c/src/ada-tests/sptests/spname01/ada_spname01.scn delete mode 100644 c/src/ada-tests/sptests/spname01/config.h delete mode 100644 c/src/ada-tests/sptests/spname01/spname01.adb delete mode 100644 c/src/ada-tests/sptests/spname01/sptest.adb delete mode 100644 c/src/ada-tests/sptests/spname01/sptest.ads delete mode 100644 c/src/ada-tests/support/Makefile.am delete mode 100644 c/src/ada-tests/support/address_io.adb delete mode 100644 c/src/ada-tests/support/address_io.ads delete mode 100644 c/src/ada-tests/support/float_io.ads delete mode 100644 c/src/ada-tests/support/fp.inc delete mode 100644 c/src/ada-tests/support/init.c delete mode 100644 c/src/ada-tests/support/integer.inc delete mode 100644 c/src/ada-tests/support/rtems_calling_overhead.ads delete mode 100644 c/src/ada-tests/support/status_io.ads delete mode 100644 c/src/ada-tests/support/test_support.adb delete mode 100644 c/src/ada-tests/support/test_support.ads delete mode 100644 c/src/ada-tests/support/time_test_support.adb delete mode 100644 c/src/ada-tests/support/time_test_support.ads delete mode 100644 c/src/ada-tests/support/timer_driver.adb delete mode 100644 c/src/ada-tests/support/timer_driver.ads delete mode 100644 c/src/ada-tests/support/unsigned32_io.ads delete mode 100644 c/src/ada-tests/tmtests/Makefile.am delete mode 100644 c/src/ada-tests/tmtests/tm01/Makefile.am delete mode 100644 c/src/ada-tests/tmtests/tm01/config.h delete mode 100644 c/src/ada-tests/tmtests/tm01/tm01.adb delete mode 100644 c/src/ada-tests/tmtests/tm01/tmtest.adb delete mode 100644 c/src/ada-tests/tmtests/tm01/tmtest.ads delete mode 100644 c/src/ada-tests/tmtests/tm02/Makefile.am delete mode 100644 c/src/ada-tests/tmtests/tm02/config.h delete mode 100644 c/src/ada-tests/tmtests/tm02/tm02.adb delete mode 100644 c/src/ada-tests/tmtests/tm02/tmtest.adb delete mode 100644 c/src/ada-tests/tmtests/tm02/tmtest.ads delete mode 100644 c/src/ada-tests/tmtests/tm03/Makefile.am delete mode 100644 c/src/ada-tests/tmtests/tm03/config.h delete mode 100644 c/src/ada-tests/tmtests/tm03/tm03.adb delete mode 100644 c/src/ada-tests/tmtests/tm03/tmtest.adb delete mode 100644 c/src/ada-tests/tmtests/tm03/tmtest.ads delete mode 100644 c/src/ada-tests/tmtests/tm04/Makefile.am delete mode 100644 c/src/ada-tests/tmtests/tm04/config.h delete mode 100644 c/src/ada-tests/tmtests/tm04/tm04.adb delete mode 100644 c/src/ada-tests/tmtests/tm04/tmtest.adb delete mode 100644 c/src/ada-tests/tmtests/tm04/tmtest.ads delete mode 100644 c/src/ada-tests/tmtests/tm05/Makefile.am delete mode 100644 c/src/ada-tests/tmtests/tm05/config.h delete mode 100644 c/src/ada-tests/tmtests/tm05/tm05.adb delete mode 100644 c/src/ada-tests/tmtests/tm05/tmtest.adb delete mode 100644 c/src/ada-tests/tmtests/tm05/tmtest.ads delete mode 100644 c/src/ada-tests/tmtests/tm06/Makefile.am delete mode 100644 c/src/ada-tests/tmtests/tm06/config.h delete mode 100644 c/src/ada-tests/tmtests/tm06/tm06.adb delete mode 100644 c/src/ada-tests/tmtests/tm06/tmtest.adb delete mode 100644 c/src/ada-tests/tmtests/tm06/tmtest.ads delete mode 100644 c/src/ada-tests/tmtests/tm07/Makefile.am delete mode 100644 c/src/ada-tests/tmtests/tm07/config.h delete mode 100644 c/src/ada-tests/tmtests/tm07/tm07.adb delete mode 100644 c/src/ada-tests/tmtests/tm07/tmtest.adb delete mode 100644 c/src/ada-tests/tmtests/tm07/tmtest.ads delete mode 100644 c/src/ada-tests/tmtests/tm08/Makefile.am delete mode 100644 c/src/ada-tests/tmtests/tm08/config.h delete mode 100644 c/src/ada-tests/tmtests/tm08/tm08.adb delete mode 100644 c/src/ada-tests/tmtests/tm08/tmtest.adb delete mode 100644 c/src/ada-tests/tmtests/tm08/tmtest.ads delete mode 100644 c/src/ada-tests/tmtests/tm09/Makefile.am delete mode 100644 c/src/ada-tests/tmtests/tm09/config.h delete mode 100644 c/src/ada-tests/tmtests/tm09/tm09.adb delete mode 100644 c/src/ada-tests/tmtests/tm09/tmtest.adb delete mode 100644 c/src/ada-tests/tmtests/tm09/tmtest.ads delete mode 100644 c/src/ada-tests/tmtests/tm10/Makefile.am delete mode 100644 c/src/ada-tests/tmtests/tm10/config.h delete mode 100644 c/src/ada-tests/tmtests/tm10/tm10.adb delete mode 100644 c/src/ada-tests/tmtests/tm10/tmtest.adb delete mode 100644 c/src/ada-tests/tmtests/tm10/tmtest.ads delete mode 100644 c/src/ada-tests/tmtests/tm11/Makefile.am delete mode 100644 c/src/ada-tests/tmtests/tm11/config.h delete mode 100644 c/src/ada-tests/tmtests/tm11/tm11.adb delete mode 100644 c/src/ada-tests/tmtests/tm11/tmtest.adb delete mode 100644 c/src/ada-tests/tmtests/tm11/tmtest.ads delete mode 100644 c/src/ada-tests/tmtests/tm12/Makefile.am delete mode 100644 c/src/ada-tests/tmtests/tm12/config.h delete mode 100644 c/src/ada-tests/tmtests/tm12/tm12.adb delete mode 100644 c/src/ada-tests/tmtests/tm12/tmtest.adb delete mode 100644 c/src/ada-tests/tmtests/tm12/tmtest.ads delete mode 100644 c/src/ada-tests/tmtests/tm13/Makefile.am delete mode 100644 c/src/ada-tests/tmtests/tm13/config.h delete mode 100644 c/src/ada-tests/tmtests/tm13/tm13.adb delete mode 100644 c/src/ada-tests/tmtests/tm13/tmtest.adb delete mode 100644 c/src/ada-tests/tmtests/tm13/tmtest.ads delete mode 100644 c/src/ada-tests/tmtests/tm14/Makefile.am delete mode 100644 c/src/ada-tests/tmtests/tm14/config.h delete mode 100644 c/src/ada-tests/tmtests/tm14/tm14.adb delete mode 100644 c/src/ada-tests/tmtests/tm14/tmtest.adb delete mode 100644 c/src/ada-tests/tmtests/tm14/tmtest.ads delete mode 100644 c/src/ada-tests/tmtests/tm15/Makefile.am delete mode 100644 c/src/ada-tests/tmtests/tm15/config.h delete mode 100644 c/src/ada-tests/tmtests/tm15/tm15.adb delete mode 100644 c/src/ada-tests/tmtests/tm15/tmtest.adb delete mode 100644 c/src/ada-tests/tmtests/tm15/tmtest.ads delete mode 100644 c/src/ada-tests/tmtests/tm16/Makefile.am delete mode 100644 c/src/ada-tests/tmtests/tm16/config.h delete mode 100644 c/src/ada-tests/tmtests/tm16/tm16.adb delete mode 100644 c/src/ada-tests/tmtests/tm16/tmtest.adb delete mode 100644 c/src/ada-tests/tmtests/tm16/tmtest.ads delete mode 100644 c/src/ada-tests/tmtests/tm17/Makefile.am delete mode 100644 c/src/ada-tests/tmtests/tm17/config.h delete mode 100644 c/src/ada-tests/tmtests/tm17/tm17.adb delete mode 100644 c/src/ada-tests/tmtests/tm17/tmtest.adb delete mode 100644 c/src/ada-tests/tmtests/tm17/tmtest.ads delete mode 100644 c/src/ada-tests/tmtests/tm18/Makefile.am delete mode 100644 c/src/ada-tests/tmtests/tm18/config.h delete mode 100644 c/src/ada-tests/tmtests/tm18/tm18.adb delete mode 100644 c/src/ada-tests/tmtests/tm18/tmtest.adb delete mode 100644 c/src/ada-tests/tmtests/tm18/tmtest.ads delete mode 100644 c/src/ada-tests/tmtests/tm19/Makefile.am delete mode 100644 c/src/ada-tests/tmtests/tm19/config.h delete mode 100644 c/src/ada-tests/tmtests/tm19/tm19.adb delete mode 100644 c/src/ada-tests/tmtests/tm19/tmtest.adb delete mode 100644 c/src/ada-tests/tmtests/tm19/tmtest.ads delete mode 100644 c/src/ada-tests/tmtests/tm20/Makefile.am delete mode 100644 c/src/ada-tests/tmtests/tm20/config.h delete mode 100644 c/src/ada-tests/tmtests/tm20/tm20.adb delete mode 100644 c/src/ada-tests/tmtests/tm20/tmtest.adb delete mode 100644 c/src/ada-tests/tmtests/tm20/tmtest.ads delete mode 100644 c/src/ada-tests/tmtests/tm21/Makefile.am delete mode 100644 c/src/ada-tests/tmtests/tm21/config.h delete mode 100644 c/src/ada-tests/tmtests/tm21/tm21.adb delete mode 100644 c/src/ada-tests/tmtests/tm21/tmtest.adb delete mode 100644 c/src/ada-tests/tmtests/tm21/tmtest.ads delete mode 100644 c/src/ada-tests/tmtests/tm22/Makefile.am delete mode 100644 c/src/ada-tests/tmtests/tm22/config.h delete mode 100644 c/src/ada-tests/tmtests/tm22/tm22.adb delete mode 100644 c/src/ada-tests/tmtests/tm22/tmtest.adb delete mode 100644 c/src/ada-tests/tmtests/tm22/tmtest.ads delete mode 100644 c/src/ada-tests/tmtests/tm23/Makefile.am delete mode 100644 c/src/ada-tests/tmtests/tm23/config.h delete mode 100644 c/src/ada-tests/tmtests/tm23/tm23.adb delete mode 100644 c/src/ada-tests/tmtests/tm23/tmtest.adb delete mode 100644 c/src/ada-tests/tmtests/tm23/tmtest.ads delete mode 100644 c/src/ada-tests/tmtests/tm24/Makefile.am delete mode 100644 c/src/ada-tests/tmtests/tm24/config.h delete mode 100644 c/src/ada-tests/tmtests/tm24/tm24.adb delete mode 100644 c/src/ada-tests/tmtests/tm24/tmtest.adb delete mode 100644 c/src/ada-tests/tmtests/tm24/tmtest.ads delete mode 100644 c/src/ada-tests/tmtests/tm25/Makefile.am delete mode 100644 c/src/ada-tests/tmtests/tm25/config.h delete mode 100644 c/src/ada-tests/tmtests/tm25/tm25.adb delete mode 100644 c/src/ada-tests/tmtests/tm25/tmtest.adb delete mode 100644 c/src/ada-tests/tmtests/tm25/tmtest.ads delete mode 100644 c/src/ada-tests/tmtests/tm28/Makefile.am delete mode 100644 c/src/ada-tests/tmtests/tm28/config.h delete mode 100644 c/src/ada-tests/tmtests/tm28/tm28.adb delete mode 100644 c/src/ada-tests/tmtests/tm28/tmtest.adb delete mode 100644 c/src/ada-tests/tmtests/tm28/tmtest.ads delete mode 100644 c/src/ada-tests/tmtests/tm29/Makefile.am delete mode 100644 c/src/ada-tests/tmtests/tm29/config.h delete mode 100644 c/src/ada-tests/tmtests/tm29/tm29.adb delete mode 100644 c/src/ada-tests/tmtests/tm29/tmtest.adb delete mode 100644 c/src/ada-tests/tmtests/tm29/tmtest.ads delete mode 100644 c/src/ada-tests/tmtests/tmck/Makefile.am delete mode 100644 c/src/ada-tests/tmtests/tmck/config.h delete mode 100644 c/src/ada-tests/tmtests/tmck/tmck.adb delete mode 100644 c/src/ada-tests/tmtests/tmck/tmtest.adb delete mode 100644 c/src/ada-tests/tmtests/tmck/tmtest.ads delete mode 100644 c/src/ada-tests/tmtests/tmoverhd/Makefile.am delete mode 100644 c/src/ada-tests/tmtests/tmoverhd/README delete mode 100644 c/src/ada-tests/tmtests/tmoverhd/config.h delete mode 100644 c/src/ada-tests/tmtests/tmoverhd/dummy_rtems.adb delete mode 100644 c/src/ada-tests/tmtests/tmoverhd/dummy_rtems.ads delete mode 100644 c/src/ada-tests/tmtests/tmoverhd/tmoverhd.adb delete mode 100644 c/src/ada-tests/tmtests/tmoverhd/tmtest.adb delete mode 100644 c/src/ada-tests/tmtests/tmoverhd/tmtest.ads create mode 100644 testsuites/ada/Makefile.am create mode 100644 testsuites/ada/aclocal/prog-gnat.m4 create mode 100644 testsuites/ada/ada.am create mode 100644 testsuites/ada/ada_mvscn create mode 100644 testsuites/ada/configure.ac create mode 100644 testsuites/ada/mptests/Makefile.am create mode 100644 testsuites/ada/mptests/mp01/Makefile.am create mode 100644 testsuites/ada/mptests/mp01/config_base.h create mode 100644 testsuites/ada/mptests/mp01/mp01.adb create mode 100644 testsuites/ada/mptests/mp01/mptest.adb create mode 100644 testsuites/ada/mptests/mp01/mptest.ads create mode 100644 testsuites/ada/mptests/mp01/node1/Makefile.am create mode 100644 testsuites/ada/mptests/mp01/node1/ada_mp01-node1.scn create mode 100644 testsuites/ada/mptests/mp01/node1/config.h create mode 100644 testsuites/ada/mptests/mp01/node1/mp01_node1.adb create mode 100644 testsuites/ada/mptests/mp01/node2/Makefile.am create mode 100644 testsuites/ada/mptests/mp01/node2/ada_mp01-node2.scn create mode 100644 testsuites/ada/mptests/mp01/node2/config.h create mode 100644 testsuites/ada/mptests/mp01/node2/mp01_node2.adb create mode 100644 testsuites/ada/mptests/mp03/Makefile.am create mode 100644 testsuites/ada/mptests/mp03/config_base.h create mode 100644 testsuites/ada/mptests/mp03/mptest.adb create mode 100644 testsuites/ada/mptests/mp03/mptest.ads create mode 100644 testsuites/ada/mptests/mp03/node1/Makefile.am create mode 100644 testsuites/ada/mptests/mp03/node1/ada_mp03-node1.scn create mode 100644 testsuites/ada/mptests/mp03/node1/config.h create mode 100644 testsuites/ada/mptests/mp03/node1/mp03_node1.adb create mode 100644 testsuites/ada/mptests/mp03/node2/Makefile.am create mode 100644 testsuites/ada/mptests/mp03/node2/ada_mp03-node2.scn create mode 100644 testsuites/ada/mptests/mp03/node2/config.h create mode 100644 testsuites/ada/mptests/mp03/node2/mp03_node2.adb create mode 100644 testsuites/ada/mptests/mp04/Makefile.am create mode 100644 testsuites/ada/mptests/mp04/config_base.h create mode 100644 testsuites/ada/mptests/mp04/mptest.adb create mode 100644 testsuites/ada/mptests/mp04/mptest.ads create mode 100644 testsuites/ada/mptests/mp04/node1/Makefile.am create mode 100644 testsuites/ada/mptests/mp04/node1/ada_mp04-node1.scn create mode 100644 testsuites/ada/mptests/mp04/node1/config.h create mode 100644 testsuites/ada/mptests/mp04/node1/mp04_node1.adb create mode 100644 testsuites/ada/mptests/mp04/node2/Makefile.am create mode 100644 testsuites/ada/mptests/mp04/node2/ada_mp04-node2.scn create mode 100644 testsuites/ada/mptests/mp04/node2/config.h create mode 100644 testsuites/ada/mptests/mp04/node2/mp04_node2.adb create mode 100644 testsuites/ada/mptests/mp05/Makefile.am create mode 100644 testsuites/ada/mptests/mp05/config_base.h create mode 100644 testsuites/ada/mptests/mp05/mptest.adb create mode 100644 testsuites/ada/mptests/mp05/mptest.ads create mode 100644 testsuites/ada/mptests/mp05/node1/Makefile.am create mode 100644 testsuites/ada/mptests/mp05/node1/ada_mp05-node1.scn create mode 100644 testsuites/ada/mptests/mp05/node1/config.h create mode 100644 testsuites/ada/mptests/mp05/node1/mp05_node1.adb create mode 100644 testsuites/ada/mptests/mp05/node2/Makefile.am create mode 100644 testsuites/ada/mptests/mp05/node2/ada_mp05-node2.scn create mode 100644 testsuites/ada/mptests/mp05/node2/config.h create mode 100644 testsuites/ada/mptests/mp05/node2/mp05_node2.adb create mode 100644 testsuites/ada/mptests/mp06/Makefile.am create mode 100644 testsuites/ada/mptests/mp06/config_base.h create mode 100644 testsuites/ada/mptests/mp06/mptest.adb create mode 100644 testsuites/ada/mptests/mp06/mptest.ads create mode 100644 testsuites/ada/mptests/mp06/node1/Makefile.am create mode 100644 testsuites/ada/mptests/mp06/node1/ada_mp06-node1.scn create mode 100644 testsuites/ada/mptests/mp06/node1/config.h create mode 100644 testsuites/ada/mptests/mp06/node1/mp06_node1.adb create mode 100644 testsuites/ada/mptests/mp06/node2/Makefile.am create mode 100644 testsuites/ada/mptests/mp06/node2/ada_mp06-node2.scn create mode 100644 testsuites/ada/mptests/mp06/node2/config.h create mode 100644 testsuites/ada/mptests/mp06/node2/mp06_node2.adb create mode 100644 testsuites/ada/mptests/mp07/Makefile.am create mode 100644 testsuites/ada/mptests/mp07/config_base.h create mode 100644 testsuites/ada/mptests/mp07/mptest.adb create mode 100644 testsuites/ada/mptests/mp07/mptest.ads create mode 100644 testsuites/ada/mptests/mp07/node1/Makefile.am create mode 100644 testsuites/ada/mptests/mp07/node1/ada_mp07-node1.scn create mode 100644 testsuites/ada/mptests/mp07/node1/config.h create mode 100644 testsuites/ada/mptests/mp07/node1/mp07_node1.adb create mode 100644 testsuites/ada/mptests/mp07/node2/Makefile.am create mode 100644 testsuites/ada/mptests/mp07/node2/ada_mp07-node2.scn create mode 100644 testsuites/ada/mptests/mp07/node2/config.h create mode 100644 testsuites/ada/mptests/mp07/node2/mp07_node2.adb create mode 100644 testsuites/ada/mptests/mp08/Makefile.am create mode 100644 testsuites/ada/mptests/mp08/config_base.h create mode 100644 testsuites/ada/mptests/mp08/mptest.adb create mode 100644 testsuites/ada/mptests/mp08/mptest.ads create mode 100644 testsuites/ada/mptests/mp08/node1/Makefile.am create mode 100644 testsuites/ada/mptests/mp08/node1/ada_mp08-node1.scn create mode 100644 testsuites/ada/mptests/mp08/node1/config.h create mode 100644 testsuites/ada/mptests/mp08/node1/mp08_node1.adb create mode 100644 testsuites/ada/mptests/mp08/node2/Makefile.am create mode 100644 testsuites/ada/mptests/mp08/node2/ada_mp08-node2.scn create mode 100644 testsuites/ada/mptests/mp08/node2/config.h create mode 100644 testsuites/ada/mptests/mp08/node2/mp08_node2.adb create mode 100644 testsuites/ada/mptests/mp09/Makefile.am create mode 100644 testsuites/ada/mptests/mp09/config_base.h create mode 100644 testsuites/ada/mptests/mp09/mptest.adb create mode 100644 testsuites/ada/mptests/mp09/mptest.ads create mode 100644 testsuites/ada/mptests/mp09/node1/Makefile.am create mode 100644 testsuites/ada/mptests/mp09/node1/ada_mp09-node1.scn create mode 100644 testsuites/ada/mptests/mp09/node1/config.h create mode 100644 testsuites/ada/mptests/mp09/node1/mp09_node1.adb create mode 100644 testsuites/ada/mptests/mp09/node2/Makefile.am create mode 100644 testsuites/ada/mptests/mp09/node2/ada_mp09-node2.scn create mode 100644 testsuites/ada/mptests/mp09/node2/config.h create mode 100644 testsuites/ada/mptests/mp09/node2/mp09_node2.adb create mode 100644 testsuites/ada/mptests/mp10/Makefile.am create mode 100644 testsuites/ada/mptests/mp10/config_base.h create mode 100644 testsuites/ada/mptests/mp10/mptest.adb create mode 100644 testsuites/ada/mptests/mp10/mptest.ads create mode 100644 testsuites/ada/mptests/mp10/node1/Makefile.am create mode 100644 testsuites/ada/mptests/mp10/node1/ada_mp10-node1.scn create mode 100644 testsuites/ada/mptests/mp10/node1/config.h create mode 100644 testsuites/ada/mptests/mp10/node1/mp10_node1.adb create mode 100644 testsuites/ada/mptests/mp10/node2/Makefile.am create mode 100644 testsuites/ada/mptests/mp10/node2/ada_mp10-node2.scn create mode 100644 testsuites/ada/mptests/mp10/node2/config.h create mode 100644 testsuites/ada/mptests/mp10/node2/mp10_node2.adb create mode 100644 testsuites/ada/mptests/mp11/Makefile.am create mode 100644 testsuites/ada/mptests/mp11/config_base.h create mode 100644 testsuites/ada/mptests/mp11/mptest.adb create mode 100644 testsuites/ada/mptests/mp11/mptest.ads create mode 100644 testsuites/ada/mptests/mp11/node1/Makefile.am create mode 100644 testsuites/ada/mptests/mp11/node1/ada_mp11-node1.scn create mode 100644 testsuites/ada/mptests/mp11/node1/config.h create mode 100644 testsuites/ada/mptests/mp11/node1/mp11_node1.adb create mode 100644 testsuites/ada/mptests/mp11/node2/Makefile.am create mode 100644 testsuites/ada/mptests/mp11/node2/ada_mp11-node2.scn create mode 100644 testsuites/ada/mptests/mp11/node2/config.h create mode 100644 testsuites/ada/mptests/mp11/node2/mp11_node2.adb create mode 100644 testsuites/ada/mptests/mp12/Makefile.am create mode 100644 testsuites/ada/mptests/mp12/config_base.h create mode 100644 testsuites/ada/mptests/mp12/mptest.adb create mode 100644 testsuites/ada/mptests/mp12/mptest.ads create mode 100644 testsuites/ada/mptests/mp12/node1/Makefile.am create mode 100644 testsuites/ada/mptests/mp12/node1/ada_mp12-node1.scn create mode 100644 testsuites/ada/mptests/mp12/node1/config.h create mode 100644 testsuites/ada/mptests/mp12/node1/mp12_node1.adb create mode 100644 testsuites/ada/mptests/mp12/node2/Makefile.am create mode 100644 testsuites/ada/mptests/mp12/node2/ada_mp12-node2.scn create mode 100644 testsuites/ada/mptests/mp12/node2/config.h create mode 100644 testsuites/ada/mptests/mp12/node2/mp12_node2.adb create mode 100644 testsuites/ada/mptests/mp13/Makefile.am create mode 100644 testsuites/ada/mptests/mp13/config_base.h create mode 100644 testsuites/ada/mptests/mp13/mptest.adb create mode 100644 testsuites/ada/mptests/mp13/mptest.ads create mode 100644 testsuites/ada/mptests/mp13/node1/Makefile.am create mode 100644 testsuites/ada/mptests/mp13/node1/ada_mp13-node1.scn create mode 100644 testsuites/ada/mptests/mp13/node1/config.h create mode 100644 testsuites/ada/mptests/mp13/node1/mp13_node1.adb create mode 100644 testsuites/ada/mptests/mp13/node2/Makefile.am create mode 100644 testsuites/ada/mptests/mp13/node2/ada_mp13-node2.scn create mode 100644 testsuites/ada/mptests/mp13/node2/config.h create mode 100644 testsuites/ada/mptests/mp13/node2/mp13_node2.adb create mode 100644 testsuites/ada/mptests/mp14/Makefile.am create mode 100644 testsuites/ada/mptests/mp14/config_base.h create mode 100644 testsuites/ada/mptests/mp14/mptest.adb create mode 100644 testsuites/ada/mptests/mp14/mptest.ads create mode 100644 testsuites/ada/mptests/mp14/node1/Makefile.am create mode 100644 testsuites/ada/mptests/mp14/node1/ada_mp14-node1.scn create mode 100644 testsuites/ada/mptests/mp14/node1/config.h create mode 100644 testsuites/ada/mptests/mp14/node1/mp14_node1.adb create mode 100644 testsuites/ada/mptests/mp14/node2/Makefile.am create mode 100644 testsuites/ada/mptests/mp14/node2/ada_mp14-node2.scn create mode 100644 testsuites/ada/mptests/mp14/node2/config.h create mode 100644 testsuites/ada/mptests/mp14/node2/mp14_node2.adb create mode 100644 testsuites/ada/samples/Makefile.am create mode 100644 testsuites/ada/samples/base_mp/Makefile.am create mode 100644 testsuites/ada/samples/base_mp/config.h create mode 100644 testsuites/ada/samples/base_mp/mptest.adb create mode 100644 testsuites/ada/samples/base_mp/mptest.ads create mode 100644 testsuites/ada/samples/base_mp/node1/Makefile.am create mode 100644 testsuites/ada/samples/base_mp/node1/ada_base_mp-node1.scn create mode 100644 testsuites/ada/samples/base_mp/node2/Makefile.am create mode 100644 testsuites/ada/samples/base_mp/node2/ada_base_mp-node2.scn create mode 100644 testsuites/ada/samples/base_sp/Makefile.am create mode 100644 testsuites/ada/samples/base_sp/ada_base_sp.scn create mode 100644 testsuites/ada/samples/base_sp/base_sp.adb create mode 100644 testsuites/ada/samples/base_sp/config.h create mode 100644 testsuites/ada/samples/base_sp/sptest.adb create mode 100644 testsuites/ada/samples/base_sp/sptest.ads create mode 100644 testsuites/ada/samples/hello/Makefile.am create mode 100644 testsuites/ada/samples/hello/ada_hello.scn create mode 100644 testsuites/ada/samples/hello/config.h create mode 100644 testsuites/ada/samples/hello/hello.adb create mode 100644 testsuites/ada/samples/hello/sptest.adb create mode 100644 testsuites/ada/samples/hello/sptest.ads create mode 100644 testsuites/ada/samples/nsecs/Makefile.am create mode 100644 testsuites/ada/samples/nsecs/ada_nsecs.scn create mode 100644 testsuites/ada/samples/nsecs/config.h create mode 100644 testsuites/ada/samples/nsecs/nsecs.adb create mode 100644 testsuites/ada/samples/nsecs/sptest.adb create mode 100644 testsuites/ada/samples/nsecs/sptest.ads create mode 100644 testsuites/ada/samples/ticker/Makefile.am create mode 100644 testsuites/ada/samples/ticker/ada_ticker.scn create mode 100644 testsuites/ada/samples/ticker/config.h create mode 100644 testsuites/ada/samples/ticker/sptest.adb create mode 100644 testsuites/ada/samples/ticker/sptest.ads create mode 100644 testsuites/ada/samples/ticker/ticker.adb create mode 100644 testsuites/ada/sptests/Makefile.am create mode 100644 testsuites/ada/sptests/sp01/Makefile.am create mode 100644 testsuites/ada/sptests/sp01/ada_sp01.scn create mode 100644 testsuites/ada/sptests/sp01/config.h create mode 100644 testsuites/ada/sptests/sp01/sp01.adb create mode 100644 testsuites/ada/sptests/sp01/sptest.adb create mode 100644 testsuites/ada/sptests/sp01/sptest.ads create mode 100644 testsuites/ada/sptests/sp02/Makefile.am create mode 100644 testsuites/ada/sptests/sp02/ada_sp02.scn create mode 100644 testsuites/ada/sptests/sp02/config.h create mode 100644 testsuites/ada/sptests/sp02/sp02.adb create mode 100644 testsuites/ada/sptests/sp02/sptest.adb create mode 100644 testsuites/ada/sptests/sp02/sptest.ads create mode 100644 testsuites/ada/sptests/sp03/Makefile.am create mode 100644 testsuites/ada/sptests/sp03/ada_sp03.scn create mode 100644 testsuites/ada/sptests/sp03/config.h create mode 100644 testsuites/ada/sptests/sp03/sp03.adb create mode 100644 testsuites/ada/sptests/sp03/sptest.adb create mode 100644 testsuites/ada/sptests/sp03/sptest.ads create mode 100644 testsuites/ada/sptests/sp04/Makefile.am create mode 100644 testsuites/ada/sptests/sp04/README create mode 100644 testsuites/ada/sptests/sp04/ada_sp04.scn create mode 100644 testsuites/ada/sptests/sp04/config.h create mode 100644 testsuites/ada/sptests/sp04/sp04.adb create mode 100644 testsuites/ada/sptests/sp04/sptest.adb create mode 100644 testsuites/ada/sptests/sp04/sptest.ads create mode 100644 testsuites/ada/sptests/sp05/Makefile.am create mode 100644 testsuites/ada/sptests/sp05/ada_sp05.scn create mode 100644 testsuites/ada/sptests/sp05/config.h create mode 100644 testsuites/ada/sptests/sp05/sp05.adb create mode 100644 testsuites/ada/sptests/sp05/sptest.adb create mode 100644 testsuites/ada/sptests/sp05/sptest.ads create mode 100644 testsuites/ada/sptests/sp06/Makefile.am create mode 100644 testsuites/ada/sptests/sp06/ada_sp06.scn create mode 100644 testsuites/ada/sptests/sp06/config.h create mode 100644 testsuites/ada/sptests/sp06/sp06.adb create mode 100644 testsuites/ada/sptests/sp06/sptest.adb create mode 100644 testsuites/ada/sptests/sp06/sptest.ads create mode 100644 testsuites/ada/sptests/sp07/Makefile.am create mode 100644 testsuites/ada/sptests/sp07/ada_sp07.scn create mode 100644 testsuites/ada/sptests/sp07/config.h create mode 100644 testsuites/ada/sptests/sp07/sp07.adb create mode 100644 testsuites/ada/sptests/sp07/sptest.adb create mode 100644 testsuites/ada/sptests/sp07/sptest.ads create mode 100644 testsuites/ada/sptests/sp08/Makefile.am create mode 100644 testsuites/ada/sptests/sp08/ada_sp08.scn create mode 100644 testsuites/ada/sptests/sp08/config.h create mode 100644 testsuites/ada/sptests/sp08/sp08.adb create mode 100644 testsuites/ada/sptests/sp08/sptest.adb create mode 100644 testsuites/ada/sptests/sp08/sptest.ads create mode 100644 testsuites/ada/sptests/sp09/Makefile.am create mode 100644 testsuites/ada/sptests/sp09/ada_sp09.scn create mode 100644 testsuites/ada/sptests/sp09/config.h create mode 100644 testsuites/ada/sptests/sp09/sp09.adb create mode 100644 testsuites/ada/sptests/sp09/sptest.adb create mode 100644 testsuites/ada/sptests/sp09/sptest.ads create mode 100644 testsuites/ada/sptests/sp11/Makefile.am create mode 100644 testsuites/ada/sptests/sp11/ada_sp11.scn create mode 100644 testsuites/ada/sptests/sp11/config.h create mode 100644 testsuites/ada/sptests/sp11/sp11.adb create mode 100644 testsuites/ada/sptests/sp11/sptest.adb create mode 100644 testsuites/ada/sptests/sp11/sptest.ads create mode 100644 testsuites/ada/sptests/sp12/Makefile.am create mode 100644 testsuites/ada/sptests/sp12/ada_sp12.scn create mode 100644 testsuites/ada/sptests/sp12/config.h create mode 100644 testsuites/ada/sptests/sp12/sp12.adb create mode 100644 testsuites/ada/sptests/sp12/sptest.adb create mode 100644 testsuites/ada/sptests/sp12/sptest.ads create mode 100644 testsuites/ada/sptests/sp13/Makefile.am create mode 100644 testsuites/ada/sptests/sp13/ada_sp13.scn create mode 100644 testsuites/ada/sptests/sp13/config.h create mode 100644 testsuites/ada/sptests/sp13/sp13.adb create mode 100644 testsuites/ada/sptests/sp13/sptest.adb create mode 100644 testsuites/ada/sptests/sp13/sptest.ads create mode 100644 testsuites/ada/sptests/sp14/Makefile.am create mode 100644 testsuites/ada/sptests/sp14/ada_sp14.scn create mode 100644 testsuites/ada/sptests/sp14/config.h create mode 100644 testsuites/ada/sptests/sp14/sp14.adb create mode 100644 testsuites/ada/sptests/sp14/sptest.adb create mode 100644 testsuites/ada/sptests/sp14/sptest.ads create mode 100644 testsuites/ada/sptests/sp15/Makefile.am create mode 100644 testsuites/ada/sptests/sp15/ada_sp15.scn create mode 100644 testsuites/ada/sptests/sp15/config.h create mode 100644 testsuites/ada/sptests/sp15/sp15.adb create mode 100644 testsuites/ada/sptests/sp15/sptest.adb create mode 100644 testsuites/ada/sptests/sp15/sptest.ads create mode 100644 testsuites/ada/sptests/sp16/Makefile.am create mode 100644 testsuites/ada/sptests/sp16/ada_sp16.scn create mode 100644 testsuites/ada/sptests/sp16/config.h create mode 100644 testsuites/ada/sptests/sp16/sp16.adb create mode 100644 testsuites/ada/sptests/sp16/sptest.adb create mode 100644 testsuites/ada/sptests/sp16/sptest.ads create mode 100644 testsuites/ada/sptests/sp17/Makefile.am create mode 100644 testsuites/ada/sptests/sp17/ada_sp17.scn create mode 100644 testsuites/ada/sptests/sp17/config.h create mode 100644 testsuites/ada/sptests/sp17/sp17.adb create mode 100644 testsuites/ada/sptests/sp17/sptest.adb create mode 100644 testsuites/ada/sptests/sp17/sptest.ads create mode 100644 testsuites/ada/sptests/sp19/Makefile.am create mode 100644 testsuites/ada/sptests/sp19/README create mode 100644 testsuites/ada/sptests/sp19/ada_sp19.scn create mode 100644 testsuites/ada/sptests/sp19/config.h create mode 100644 testsuites/ada/sptests/sp19/sp19.adb create mode 100644 testsuites/ada/sptests/sp19/sptest.adp create mode 100644 testsuites/ada/sptests/sp19/sptest.ads create mode 100644 testsuites/ada/sptests/sp20/Makefile.am create mode 100644 testsuites/ada/sptests/sp20/ada_sp20.scn create mode 100644 testsuites/ada/sptests/sp20/config.h create mode 100644 testsuites/ada/sptests/sp20/sp20.adb create mode 100644 testsuites/ada/sptests/sp20/sptest.adb create mode 100644 testsuites/ada/sptests/sp20/sptest.ads create mode 100644 testsuites/ada/sptests/sp22/Makefile.am create mode 100644 testsuites/ada/sptests/sp22/ada_sp22.scn create mode 100644 testsuites/ada/sptests/sp22/config.h create mode 100644 testsuites/ada/sptests/sp22/sp22.adb create mode 100644 testsuites/ada/sptests/sp22/sptest.adb create mode 100644 testsuites/ada/sptests/sp22/sptest.ads create mode 100644 testsuites/ada/sptests/sp23/Makefile.am create mode 100644 testsuites/ada/sptests/sp23/ada_sp23.scn create mode 100644 testsuites/ada/sptests/sp23/config.h create mode 100644 testsuites/ada/sptests/sp23/sp23.adb create mode 100644 testsuites/ada/sptests/sp23/sptest.adb create mode 100644 testsuites/ada/sptests/sp23/sptest.ads create mode 100644 testsuites/ada/sptests/sp24/Makefile.am create mode 100644 testsuites/ada/sptests/sp24/ada_sp24.scn create mode 100644 testsuites/ada/sptests/sp24/config.h create mode 100644 testsuites/ada/sptests/sp24/sp24.adb create mode 100644 testsuites/ada/sptests/sp24/sptest.adb create mode 100644 testsuites/ada/sptests/sp24/sptest.ads create mode 100644 testsuites/ada/sptests/sp25/Makefile.am create mode 100644 testsuites/ada/sptests/sp25/ada_sp25.scn create mode 100644 testsuites/ada/sptests/sp25/config.h create mode 100644 testsuites/ada/sptests/sp25/sp25.adb create mode 100644 testsuites/ada/sptests/sp25/sptest.adb create mode 100644 testsuites/ada/sptests/sp25/sptest.ads create mode 100644 testsuites/ada/sptests/spatcb01/Makefile.am create mode 100644 testsuites/ada/sptests/spatcb01/ada_spatcb01.scn create mode 100644 testsuites/ada/sptests/spatcb01/config.h create mode 100644 testsuites/ada/sptests/spatcb01/spatcb01.adb create mode 100644 testsuites/ada/sptests/spname01/Makefile.am create mode 100644 testsuites/ada/sptests/spname01/ada_spname01.scn create mode 100644 testsuites/ada/sptests/spname01/config.h create mode 100644 testsuites/ada/sptests/spname01/spname01.adb create mode 100644 testsuites/ada/sptests/spname01/sptest.adb create mode 100644 testsuites/ada/sptests/spname01/sptest.ads create mode 100644 testsuites/ada/support/Makefile.am create mode 100644 testsuites/ada/support/address_io.adb create mode 100644 testsuites/ada/support/address_io.ads create mode 100644 testsuites/ada/support/float_io.ads create mode 100644 testsuites/ada/support/fp.inc create mode 100644 testsuites/ada/support/init.c create mode 100644 testsuites/ada/support/integer.inc create mode 100644 testsuites/ada/support/rtems_calling_overhead.ads create mode 100644 testsuites/ada/support/status_io.ads create mode 100644 testsuites/ada/support/test_support.adb create mode 100644 testsuites/ada/support/test_support.ads create mode 100644 testsuites/ada/support/time_test_support.adb create mode 100644 testsuites/ada/support/time_test_support.ads create mode 100644 testsuites/ada/support/timer_driver.adb create mode 100644 testsuites/ada/support/timer_driver.ads create mode 100644 testsuites/ada/support/unsigned32_io.ads create mode 100644 testsuites/ada/tmtests/Makefile.am create mode 100644 testsuites/ada/tmtests/tm01/Makefile.am create mode 100644 testsuites/ada/tmtests/tm01/config.h create mode 100644 testsuites/ada/tmtests/tm01/tm01.adb create mode 100644 testsuites/ada/tmtests/tm01/tmtest.adb create mode 100644 testsuites/ada/tmtests/tm01/tmtest.ads create mode 100644 testsuites/ada/tmtests/tm02/Makefile.am create mode 100644 testsuites/ada/tmtests/tm02/config.h create mode 100644 testsuites/ada/tmtests/tm02/tm02.adb create mode 100644 testsuites/ada/tmtests/tm02/tmtest.adb create mode 100644 testsuites/ada/tmtests/tm02/tmtest.ads create mode 100644 testsuites/ada/tmtests/tm03/Makefile.am create mode 100644 testsuites/ada/tmtests/tm03/config.h create mode 100644 testsuites/ada/tmtests/tm03/tm03.adb create mode 100644 testsuites/ada/tmtests/tm03/tmtest.adb create mode 100644 testsuites/ada/tmtests/tm03/tmtest.ads create mode 100644 testsuites/ada/tmtests/tm04/Makefile.am create mode 100644 testsuites/ada/tmtests/tm04/config.h create mode 100644 testsuites/ada/tmtests/tm04/tm04.adb create mode 100644 testsuites/ada/tmtests/tm04/tmtest.adb create mode 100644 testsuites/ada/tmtests/tm04/tmtest.ads create mode 100644 testsuites/ada/tmtests/tm05/Makefile.am create mode 100644 testsuites/ada/tmtests/tm05/config.h create mode 100644 testsuites/ada/tmtests/tm05/tm05.adb create mode 100644 testsuites/ada/tmtests/tm05/tmtest.adb create mode 100644 testsuites/ada/tmtests/tm05/tmtest.ads create mode 100644 testsuites/ada/tmtests/tm06/Makefile.am create mode 100644 testsuites/ada/tmtests/tm06/config.h create mode 100644 testsuites/ada/tmtests/tm06/tm06.adb create mode 100644 testsuites/ada/tmtests/tm06/tmtest.adb create mode 100644 testsuites/ada/tmtests/tm06/tmtest.ads create mode 100644 testsuites/ada/tmtests/tm07/Makefile.am create mode 100644 testsuites/ada/tmtests/tm07/config.h create mode 100644 testsuites/ada/tmtests/tm07/tm07.adb create mode 100644 testsuites/ada/tmtests/tm07/tmtest.adb create mode 100644 testsuites/ada/tmtests/tm07/tmtest.ads create mode 100644 testsuites/ada/tmtests/tm08/Makefile.am create mode 100644 testsuites/ada/tmtests/tm08/config.h create mode 100644 testsuites/ada/tmtests/tm08/tm08.adb create mode 100644 testsuites/ada/tmtests/tm08/tmtest.adb create mode 100644 testsuites/ada/tmtests/tm08/tmtest.ads create mode 100644 testsuites/ada/tmtests/tm09/Makefile.am create mode 100644 testsuites/ada/tmtests/tm09/config.h create mode 100644 testsuites/ada/tmtests/tm09/tm09.adb create mode 100644 testsuites/ada/tmtests/tm09/tmtest.adb create mode 100644 testsuites/ada/tmtests/tm09/tmtest.ads create mode 100644 testsuites/ada/tmtests/tm10/Makefile.am create mode 100644 testsuites/ada/tmtests/tm10/config.h create mode 100644 testsuites/ada/tmtests/tm10/tm10.adb create mode 100644 testsuites/ada/tmtests/tm10/tmtest.adb create mode 100644 testsuites/ada/tmtests/tm10/tmtest.ads create mode 100644 testsuites/ada/tmtests/tm11/Makefile.am create mode 100644 testsuites/ada/tmtests/tm11/config.h create mode 100644 testsuites/ada/tmtests/tm11/tm11.adb create mode 100644 testsuites/ada/tmtests/tm11/tmtest.adb create mode 100644 testsuites/ada/tmtests/tm11/tmtest.ads create mode 100644 testsuites/ada/tmtests/tm12/Makefile.am create mode 100644 testsuites/ada/tmtests/tm12/config.h create mode 100644 testsuites/ada/tmtests/tm12/tm12.adb create mode 100644 testsuites/ada/tmtests/tm12/tmtest.adb create mode 100644 testsuites/ada/tmtests/tm12/tmtest.ads create mode 100644 testsuites/ada/tmtests/tm13/Makefile.am create mode 100644 testsuites/ada/tmtests/tm13/config.h create mode 100644 testsuites/ada/tmtests/tm13/tm13.adb create mode 100644 testsuites/ada/tmtests/tm13/tmtest.adb create mode 100644 testsuites/ada/tmtests/tm13/tmtest.ads create mode 100644 testsuites/ada/tmtests/tm14/Makefile.am create mode 100644 testsuites/ada/tmtests/tm14/config.h create mode 100644 testsuites/ada/tmtests/tm14/tm14.adb create mode 100644 testsuites/ada/tmtests/tm14/tmtest.adb create mode 100644 testsuites/ada/tmtests/tm14/tmtest.ads create mode 100644 testsuites/ada/tmtests/tm15/Makefile.am create mode 100644 testsuites/ada/tmtests/tm15/config.h create mode 100644 testsuites/ada/tmtests/tm15/tm15.adb create mode 100644 testsuites/ada/tmtests/tm15/tmtest.adb create mode 100644 testsuites/ada/tmtests/tm15/tmtest.ads create mode 100644 testsuites/ada/tmtests/tm16/Makefile.am create mode 100644 testsuites/ada/tmtests/tm16/config.h create mode 100644 testsuites/ada/tmtests/tm16/tm16.adb create mode 100644 testsuites/ada/tmtests/tm16/tmtest.adb create mode 100644 testsuites/ada/tmtests/tm16/tmtest.ads create mode 100644 testsuites/ada/tmtests/tm17/Makefile.am create mode 100644 testsuites/ada/tmtests/tm17/config.h create mode 100644 testsuites/ada/tmtests/tm17/tm17.adb create mode 100644 testsuites/ada/tmtests/tm17/tmtest.adb create mode 100644 testsuites/ada/tmtests/tm17/tmtest.ads create mode 100644 testsuites/ada/tmtests/tm18/Makefile.am create mode 100644 testsuites/ada/tmtests/tm18/config.h create mode 100644 testsuites/ada/tmtests/tm18/tm18.adb create mode 100644 testsuites/ada/tmtests/tm18/tmtest.adb create mode 100644 testsuites/ada/tmtests/tm18/tmtest.ads create mode 100644 testsuites/ada/tmtests/tm19/Makefile.am create mode 100644 testsuites/ada/tmtests/tm19/config.h create mode 100644 testsuites/ada/tmtests/tm19/tm19.adb create mode 100644 testsuites/ada/tmtests/tm19/tmtest.adb create mode 100644 testsuites/ada/tmtests/tm19/tmtest.ads create mode 100644 testsuites/ada/tmtests/tm20/Makefile.am create mode 100644 testsuites/ada/tmtests/tm20/config.h create mode 100644 testsuites/ada/tmtests/tm20/tm20.adb create mode 100644 testsuites/ada/tmtests/tm20/tmtest.adb create mode 100644 testsuites/ada/tmtests/tm20/tmtest.ads create mode 100644 testsuites/ada/tmtests/tm21/Makefile.am create mode 100644 testsuites/ada/tmtests/tm21/config.h create mode 100644 testsuites/ada/tmtests/tm21/tm21.adb create mode 100644 testsuites/ada/tmtests/tm21/tmtest.adb create mode 100644 testsuites/ada/tmtests/tm21/tmtest.ads create mode 100644 testsuites/ada/tmtests/tm22/Makefile.am create mode 100644 testsuites/ada/tmtests/tm22/config.h create mode 100644 testsuites/ada/tmtests/tm22/tm22.adb create mode 100644 testsuites/ada/tmtests/tm22/tmtest.adb create mode 100644 testsuites/ada/tmtests/tm22/tmtest.ads create mode 100644 testsuites/ada/tmtests/tm23/Makefile.am create mode 100644 testsuites/ada/tmtests/tm23/config.h create mode 100644 testsuites/ada/tmtests/tm23/tm23.adb create mode 100644 testsuites/ada/tmtests/tm23/tmtest.adb create mode 100644 testsuites/ada/tmtests/tm23/tmtest.ads create mode 100644 testsuites/ada/tmtests/tm24/Makefile.am create mode 100644 testsuites/ada/tmtests/tm24/config.h create mode 100644 testsuites/ada/tmtests/tm24/tm24.adb create mode 100644 testsuites/ada/tmtests/tm24/tmtest.adb create mode 100644 testsuites/ada/tmtests/tm24/tmtest.ads create mode 100644 testsuites/ada/tmtests/tm25/Makefile.am create mode 100644 testsuites/ada/tmtests/tm25/config.h create mode 100644 testsuites/ada/tmtests/tm25/tm25.adb create mode 100644 testsuites/ada/tmtests/tm25/tmtest.adb create mode 100644 testsuites/ada/tmtests/tm25/tmtest.ads create mode 100644 testsuites/ada/tmtests/tm28/Makefile.am create mode 100644 testsuites/ada/tmtests/tm28/config.h create mode 100644 testsuites/ada/tmtests/tm28/tm28.adb create mode 100644 testsuites/ada/tmtests/tm28/tmtest.adb create mode 100644 testsuites/ada/tmtests/tm28/tmtest.ads create mode 100644 testsuites/ada/tmtests/tm29/Makefile.am create mode 100644 testsuites/ada/tmtests/tm29/config.h create mode 100644 testsuites/ada/tmtests/tm29/tm29.adb create mode 100644 testsuites/ada/tmtests/tm29/tmtest.adb create mode 100644 testsuites/ada/tmtests/tm29/tmtest.ads create mode 100644 testsuites/ada/tmtests/tmck/Makefile.am create mode 100644 testsuites/ada/tmtests/tmck/config.h create mode 100644 testsuites/ada/tmtests/tmck/tmck.adb create mode 100644 testsuites/ada/tmtests/tmck/tmtest.adb create mode 100644 testsuites/ada/tmtests/tmck/tmtest.ads create mode 100644 testsuites/ada/tmtests/tmoverhd/Makefile.am create mode 100644 testsuites/ada/tmtests/tmoverhd/README create mode 100644 testsuites/ada/tmtests/tmoverhd/config.h create mode 100644 testsuites/ada/tmtests/tmoverhd/dummy_rtems.adb create mode 100644 testsuites/ada/tmtests/tmoverhd/dummy_rtems.ads create mode 100644 testsuites/ada/tmtests/tmoverhd/tmoverhd.adb create mode 100644 testsuites/ada/tmtests/tmoverhd/tmtest.adb create mode 100644 testsuites/ada/tmtests/tmoverhd/tmtest.ads diff --git a/c/src/ada-tests/Makefile.am b/c/src/ada-tests/Makefile.am deleted file mode 100644 index f097f9fa0c..0000000000 --- a/c/src/ada-tests/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -ACLOCAL_AMFLAGS = -I aclocal -I ../../../testsuites/aclocal - -_SUBDIRS = support samples sptests tmtests -if HAS_MP -_SUBDIRS += mptests -endif - -DIST_SUBDIRS = support samples sptests tmtests mptests - -EXTRA_DIST = ada.am - -include $(top_srcdir)/../../../testsuites/automake/subdirs.am -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/aclocal/prog-gnat.m4 b/c/src/ada-tests/aclocal/prog-gnat.m4 deleted file mode 100644 index a2b2879c7d..0000000000 --- a/c/src/ada-tests/aclocal/prog-gnat.m4 +++ /dev/null @@ -1,44 +0,0 @@ -## -## Partially borrowed from gcc-3.2 -## -## WARNING: All the stuff below is pretty immature. - -AC_DEFUN([RTEMS_PROG_GNAT], -[AC_REQUIRE([AC_CHECK_TOOL_PREFIX]) -AC_REQUIRE([RTEMS_PROG_CC_FOR_TARGET]) - -AC_CHECK_TOOL([GNATMAKE],[gnatmake],[]) -AC_CACHE_CHECK([for compiler driver that understands Ada], - [rtems_cv_prog_CCADA], -[cat >conftest.adb <&1 || echo failure` - AS_IF([test -z "$errors"], - [rtems_cv_prog_CCADA=$cand - break]) -done -rm -f conftest.*]) -AC_SUBST([CCADA],[$rtems_cv_prog_CCADA]) - -AS_IF([test -n "$GNATMAKE" && test -n "$CCADA"], - [HAVE_GNAT=yes], - [HAVE_GNAT=no]) -]) diff --git a/c/src/ada-tests/ada.am b/c/src/ada-tests/ada.am deleted file mode 100644 index 17084fb753..0000000000 --- a/c/src/ada-tests/ada.am +++ /dev/null @@ -1,24 +0,0 @@ -SUFFIXES = .adb .ali .ads .adp - -GNATMAKE = @GNATMAKE@ - -AM_ADAFLAGS = -I$(PROJECT_ROOT)/lib/include/adainclude \ --I$(PROJECT_ROOT)/@RTEMS_BSP@/lib/include/adainclude \ --I$(top_srcdir)/support - -GNATCOMPILE = $(GNATMAKE) \ --bargs -Mgnat_main \ --margs $(AM_ADAFLAGS) $(ADAFLAGS) \ --cargs $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) \ - $(GCCSPECS) \ --largs $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) \ - $(GCCSPECS) \ -$(AM_LDFLAGS) $(LDFLAGS) init.o - -CLEANFILES += *.ali *.o b~*.adb b~*.ads - -#%.o: %.c -# $(CC) $(CFLAGS) -I@srcdir@ -c $< -o $@ - -.adp.adb: - pwd=`pwd` && cd $(srcdir) && $(M4) < $*.adp > $${pwd}/$*.adb diff --git a/c/src/ada-tests/ada_mvscn b/c/src/ada-tests/ada_mvscn deleted file mode 100644 index 8c6a5b0a5b..0000000000 --- a/c/src/ada-tests/ada_mvscn +++ /dev/null @@ -1,64 +0,0 @@ -while read f -do - bname=`basename $f` - # mv $f `dirname $f`/ada_`basename $f` - cvs rm -f $f - cvs add `dirname $f`/ada_`basename $f` -done < - -/* end of include file */ diff --git a/c/src/ada-tests/mptests/mp01/mp01.adb b/c/src/ada-tests/mptests/mp01/mp01.adb deleted file mode 100644 index 6e89f9306d..0000000000 --- a/c/src/ada-tests/mptests/mp01/mp01.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test MP01 of the Multiprocessor 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 MPTEST; -with TEST_SUPPORT; - -procedure MP01 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.GLOBAL, - INIT_ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" ); - - - RTEMS.TASKS.START( - INIT_ID, - MPTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end MP01; - diff --git a/c/src/ada-tests/mptests/mp01/mptest.adb b/c/src/ada-tests/mptests/mp01/mptest.adb deleted file mode 100644 index b76a1af8dc..0000000000 --- a/c/src/ada-tests/mptests/mp01/mptest.adb +++ /dev/null @@ -1,230 +0,0 @@ --- --- MPTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation for Test 1 of the RTEMS --- Multiprocessor 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 INTERFACES; use INTERFACES; -with RTEMS; -with RTEMS.CLOCK; -with RTEMS.TASKS; -with TEST_SUPPORT; -with TEXT_IO; -with UNSIGNED32_IO; - -package body MPTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - C : CHARACTER; - TIME : RTEMS.TIME_OF_DAY; - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT( "*** TEST 1 -- NODE " ); - UNSIGNED32_IO.PUT( - TEST_SUPPORT.NODE, - WIDTH => 1 - ); - TEXT_IO.PUT_LINE( " ***" ); - - if TEST_SUPPORT.NODE /= 1 then - C := 'S'; - else - C := 'M'; - end if; - - MPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( C, 'A', '1', ' ' ); - MPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( C, 'A', '2', ' ' ); - MPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( C, 'A', '3', ' ' ); - - TIME := ( 1988, 12, 31, 9, 0, 0, 0 ); - - RTEMS.CLOCK.SET( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET" ); - - TEXT_IO.PUT_LINE( "Creating task 1 (Global)" ); - - RTEMS.TASKS.CREATE( - MPTEST.TASK_NAME( 1 ), - 1, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.GLOBAL, - MPTEST.TASK_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" ); - - TEXT_IO.PUT_LINE( "Creating task 2 (Global)" ); - - RTEMS.TASKS.CREATE( - MPTEST.TASK_NAME( 2 ), - 1, - 2048, - RTEMS.TIMESLICE, - RTEMS.GLOBAL, - MPTEST.TASK_ID( 2 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" ); - - TEXT_IO.PUT_LINE( "Creating task 3 (Local)" ); - - RTEMS.TASKS.CREATE( - MPTEST.TASK_NAME( 3 ), - 1, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - MPTEST.TASK_ID( 3 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA3" ); - - RTEMS.TASKS.START( - MPTEST.TASK_ID( 1 ), - MPTEST.TEST_TASK'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); - - RTEMS.TASKS.START( - MPTEST.TASK_ID( 2 ), - MPTEST.TEST_TASK'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" ); - - RTEMS.TASKS.START( - MPTEST.TASK_ID( 3 ), - MPTEST.TEST_TASK'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA3" ); - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- TEST_TASK --- - - procedure TEST_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - TIME : RTEMS.TIME_OF_DAY; - TID : RTEMS.ID; - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.TASKS.IDENT( RTEMS.SELF, RTEMS.SEARCH_ALL_NODES, TID, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF SELF" ); - - RTEMS.CLOCK.GET_TOD( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); - - TEST_SUPPORT.PUT_NAME( - MPTEST.TASK_NAME( TEST_SUPPORT.TASK_NUMBER( TID ) ), - FALSE - ); - - TEST_SUPPORT.PRINT_TIME( "- clock_get - ", TIME, "" ); - TEXT_IO.NEW_LINE; - - RTEMS.TASKS.WAKE_AFTER( - TEST_SUPPORT.TASK_NUMBER( TID ) * 5 * - TEST_SUPPORT.TICKS_PER_SECOND, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - RTEMS.CLOCK.GET_TOD( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); - - TEST_SUPPORT.PUT_NAME( - MPTEST.TASK_NAME( TEST_SUPPORT.TASK_NUMBER( TID ) ), - FALSE - ); - - TEST_SUPPORT.PRINT_TIME( "- clock_get - ", TIME, "" ); - TEXT_IO.NEW_LINE; - - if TEST_SUPPORT.TASK_NUMBER( TID ) = 1 then -- TASK 1 - - TEST_SUPPORT.PUT_NAME( - MPTEST.TASK_NAME( TEST_SUPPORT.TASK_NUMBER( TID ) ), - FALSE - ); - - TEXT_IO.PUT_LINE( " - deleting self" ); - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - else if TEST_SUPPORT.TASK_NUMBER( TID ) = 2 then -- TASK 2 - - TEST_SUPPORT.PUT_NAME( MPTEST.TASK_NAME( 2 ), FALSE ); - TEXT_IO.PUT( " - waiting to be deleted by " ); - TEST_SUPPORT.PUT_NAME( MPTEST.TASK_NAME( 3 ), TRUE ); - - loop - TEST_SUPPORT.DO_NOTHING; -- can't be optimized away - end loop; - - else -- TASK 3 - - TEST_SUPPORT.PUT_NAME( MPTEST.TASK_NAME( 3 ), FALSE ); - TEXT_IO.PUT( " - getting TID of " ); - TEST_SUPPORT.PUT_NAME( MPTEST.TASK_NAME( 2 ), TRUE ); - - RTEMS.TASKS.IDENT( - MPTEST.TASK_NAME( 2 ), - RTEMS.SEARCH_ALL_NODES, - TID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF TA2" ); - - TEST_SUPPORT.PUT_NAME( MPTEST.TASK_NAME( 3 ), FALSE ); - TEXT_IO.PUT( " - deleting " ); - TEST_SUPPORT.PUT_NAME( MPTEST.TASK_NAME( 2 ), TRUE ); - - RTEMS.TASKS.DELETE( TID, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA2" ); - - end if; - end if; - - TEXT_IO.PUT_LINE( "*** END OF TEST 1 ***" ); - - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end TEST_TASK; - -end MPTEST; diff --git a/c/src/ada-tests/mptests/mp01/mptest.ads b/c/src/ada-tests/mptests/mp01/mptest.ads deleted file mode 100644 index 81f004a8e3..0000000000 --- a/c/src/ada-tests/mptests/mp01/mptest.ads +++ /dev/null @@ -1,60 +0,0 @@ --- --- MPTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 1 of the RTEMS --- Multiprocessor 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; - -package MPTEST is - --- --- These arrays contain the IDs and NAMEs of all RTEMS tasks created --- by this test. --- - - TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; - TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- TEST_TASK --- --- DESCRIPTION: --- --- This is the body of the RTEMS tasks which constitute this test. --- - - procedure TEST_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TEST_TASK); - -end MPTEST; diff --git a/c/src/ada-tests/mptests/mp01/node1/Makefile.am b/c/src/ada-tests/mptests/mp01/node1/Makefile.am deleted file mode 100644 index 9a8744105d..0000000000 --- a/c/src/ada-tests/mptests/mp01/node1/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -AM_ADAFLAGS += -I$(srcdir)/.. - -noinst_PROGRAMS = mp01_ada_mp01_node1 -mp01_ada_mp01_node1_SOURCES = mp01_node1.adb ../mptest.adb config.h -mp01_ada_mp01_node1_SOURCES += ../mptest.ads -mp01_ada_mp01_node1_SOURCES += ../../../support/init.c - -mp01_ada_mp01_node1$(EXEEXT): mp01_node1.adb ../mptest.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_mp01-node1.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/mptests/mp01/node1/ada_mp01-node1.scn b/c/src/ada-tests/mptests/mp01/node1/ada_mp01-node1.scn deleted file mode 100644 index d7495bfa0d..0000000000 --- a/c/src/ada-tests/mptests/mp01/node1/ada_mp01-node1.scn +++ /dev/null @@ -1,15 +0,0 @@ -*** TEST 1 -- NODE 1 *** -Creating task 1 (Global) -Creating task 2 (Global) -Creating task 3 (Local) -MA1 - clock_get - 9: 0: 0 12/31/1988 -MA2 - clock_get - 9: 0: 0 12/31/1988 -MA3 - clock_get - 9: 0: 0 12/31/1988 -MA1 - clock_get - 9: 0: 5 12/31/1988 -MA1 - deleting self -MA2 - clock_get - 9: 0:10 12/31/1988 -MA2 - waiting to be deleted by MA3 -MA3 - clock_get - 9: 0:15 12/31/1988 -MA3 - getting TID of MA2 -MA3 - deleting MA2 -*** END OF TEST 1 *** diff --git a/c/src/ada-tests/mptests/mp01/node1/config.h b/c/src/ada-tests/mptests/mp01/node1/config.h deleted file mode 100644 index 36c9d133e8..0000000000 --- a/c/src/ada-tests/mptests/mp01/node1/config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* 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_MP_APPLICATION -#define CONFIGURE_MP_NODE_NUMBER 1 - -#include "../config_base.h" - -/* end of include file */ diff --git a/c/src/ada-tests/mptests/mp01/node1/mp01_node1.adb b/c/src/ada-tests/mptests/mp01/node1/mp01_node1.adb deleted file mode 100644 index c1f54ccd32..0000000000 --- a/c/src/ada-tests/mptests/mp01/node1/mp01_node1.adb +++ /dev/null @@ -1,56 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test MP01_NODE1 of the Multiprocessor --- 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 MPTEST; -with TEST_SUPPORT; - -procedure MP01_NODE1 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, - MPTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end MP01_NODE1; - diff --git a/c/src/ada-tests/mptests/mp01/node2/Makefile.am b/c/src/ada-tests/mptests/mp01/node2/Makefile.am deleted file mode 100644 index 1f25556519..0000000000 --- a/c/src/ada-tests/mptests/mp01/node2/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -AM_ADAFLAGS += -I$(srcdir)/.. - -noinst_PROGRAMS = mp01_ada_mp01_node2 -mp01_ada_mp01_node2_SOURCES = mp01_node2.adb ../mptest.adb config.h -mp01_ada_mp01_node2_SOURCES += ../mptest.ads -mp01_ada_mp01_node2_SOURCES += ../../../support/init.c - -mp01_ada_mp01_node2$(EXEEXT): mp01_node2.adb ../mptest.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_mp01-node2.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/mptests/mp01/node2/ada_mp01-node2.scn b/c/src/ada-tests/mptests/mp01/node2/ada_mp01-node2.scn deleted file mode 100644 index 98047240f3..0000000000 --- a/c/src/ada-tests/mptests/mp01/node2/ada_mp01-node2.scn +++ /dev/null @@ -1,15 +0,0 @@ -*** TEST 1 -- NODE 2 *** -Creating task 1 (Global) -Creating task 2 (Global) -Creating task 3 (Local) -SA1 - clock_get - 9: 0: 0 12/31/1988 -SA2 - clock_get - 9: 0: 0 12/31/1988 -SA3 - clock_get - 9: 0: 0 12/31/1988 -SA1 - clock_get - 9: 0: 5 12/31/1988 -SA1 - deleting self -SA2 - clock_get - 9: 0:10 12/31/1988 -SA2 - waiting to be deleted by SA3 -SA3 - clock_get - 9: 0:15 12/31/1988 -SA3 - getting TID of SA2 -SA3 - deleting SA2 -*** END OF TEST 1 *** diff --git a/c/src/ada-tests/mptests/mp01/node2/config.h b/c/src/ada-tests/mptests/mp01/node2/config.h deleted file mode 100644 index 47edf66149..0000000000 --- a/c/src/ada-tests/mptests/mp01/node2/config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* 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_MP_APPLICATION -#define CONFIGURE_MP_NODE_NUMBER 2 - -#include "../config_base.h" - -/* end of include file */ diff --git a/c/src/ada-tests/mptests/mp01/node2/mp01_node2.adb b/c/src/ada-tests/mptests/mp01/node2/mp01_node2.adb deleted file mode 100644 index 380df6c5fd..0000000000 --- a/c/src/ada-tests/mptests/mp01/node2/mp01_node2.adb +++ /dev/null @@ -1,56 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test MP01_NODE2 of the Multiprocessor --- 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 MPTEST; -with TEST_SUPPORT; - -procedure MP01_NODE2 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, - MPTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end MP01_NODE2; - diff --git a/c/src/ada-tests/mptests/mp03/Makefile.am b/c/src/ada-tests/mptests/mp03/Makefile.am deleted file mode 100644 index 43bba78abb..0000000000 --- a/c/src/ada-tests/mptests/mp03/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -_SUBDIRS = node1 node2 - -include $(top_srcdir)/../../../testsuites/automake/subdirs.am -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/mptests/mp03/config_base.h b/c/src/ada-tests/mptests/mp03/config_base.h deleted file mode 100644 index c1b8f24e86..0000000000 --- a/c/src/ada-tests/mptests/mp03/config_base.h +++ /dev/null @@ -1,28 +0,0 @@ -/* config_base.h - * - * This include file defines all of the Configuration Table for this test - * EXCEPT the NODE NUMBER. - * - * 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. - */ - - - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_TASKS 2 - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/mptests/mp03/mptest.adb b/c/src/ada-tests/mptests/mp03/mptest.adb deleted file mode 100644 index 170b62fd5d..0000000000 --- a/c/src/ada-tests/mptests/mp03/mptest.adb +++ /dev/null @@ -1,267 +0,0 @@ --- --- This package is the implementation for Test 3 of the RTEMS --- Multiprocessor 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 INTERFACES; use INTERFACES; -with RTEMS; -with RTEMS.EVENT; -with RTEMS.TASKS; -with RTEMS.TIMER; -with TEST_SUPPORT; -with TEXT_IO; -with UNSIGNED32_IO; - -package body MPTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT( "*** TEST 3 -- NODE " ); - UNSIGNED32_IO.PUT( - TEST_SUPPORT.NODE, - WIDTH => 1 - ); - TEXT_IO.PUT_LINE( " ***" ); - - MPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( '1', '1', '1', ' ' ); - MPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( '2', '2', '2', ' ' ); - - TEXT_IO.PUT_LINE( "Creating Test_task (Global)" ); - RTEMS.TASKS.CREATE( - MPTEST.TASK_NAME( TEST_SUPPORT.NODE ), - 1, - 2048, - RTEMS.NO_PREEMPT, - RTEMS.GLOBAL, - MPTEST.TASK_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); - - TEXT_IO.PUT_LINE( "Starting Test_task (Global)" ); - RTEMS.TASKS.START( - MPTEST.TASK_ID( 1 ), - MPTEST.TEST_TASK'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); - - MPTEST.TIMER_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'M', '1', ' ' ); - - RTEMS.TIMER.CREATE( - MPTEST.TIMER_NAME( 1 ), - MPTEST.TIMER_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE" ); - - TEXT_IO.PUT_LINE( "Deleting initialization task" ); - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- DELAYED_SEND_EVENT --- - - procedure DELAYED_SEND_EVENT ( - IGNORED_ID : in RTEMS.ID; - IGNORED_ADDRESS : in RTEMS.ADDRESS - ) is - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.EVENT.SEND( MPTEST.TASK_ID( 1 ), RTEMS.EVENT_16, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND" ); - - end DELAYED_SEND_EVENT; - --- --- TEST_TASK --- - - procedure TEST_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - TID : RTEMS.ID; - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.TASKS.IDENT( RTEMS.SELF, RTEMS.SEARCH_ALL_NODES, TID, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF SELF" ); - - TEXT_IO.PUT_LINE( "Getting TID of remote task" ); - if TEST_SUPPORT.NODE = 1 then - MPTEST.REMOTE_NODE := 2; - else - MPTEST.REMOTE_NODE := 1; - end if; - - TEXT_IO.PUT( "Remote task's name is : " ); - TEST_SUPPORT.PUT_NAME( MPTEST.TASK_NAME( MPTEST.REMOTE_NODE ), TRUE ); - - loop - - RTEMS.TASKS.IDENT( - MPTEST.TASK_NAME( MPTEST.REMOTE_NODE ), - RTEMS.SEARCH_ALL_NODES, - MPTEST.REMOTE_TID, - STATUS - ); - - exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS ); - - end loop; - - RTEMS.TIMER.FIRE_AFTER( - MPTEST.TIMER_ID( 1 ), - 10 * TEST_SUPPORT.TICKS_PER_SECOND, - MPTEST.DELAYED_SEND_EVENT'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER" ); - - MPTEST.TEST_TASK_SUPPORT( 1 ); - - RTEMS.TIMER.FIRE_AFTER( - MPTEST.TIMER_ID( 1 ), - 11 * TEST_SUPPORT.TICKS_PER_SECOND, - MPTEST.DELAYED_SEND_EVENT'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER" ); - - if TEST_SUPPORT.NODE = 2 then - - RTEMS.TASKS.WAKE_AFTER( - 2 * TEST_SUPPORT.TICKS_PER_SECOND, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - end if; - - MPTEST.TEST_TASK_SUPPORT( 2 ); - - TEXT_IO.PUT_LINE( "*** END OF TEST 3 ***" ); - - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end TEST_TASK; - --- --- TEST_TASK_SUPPORT --- - - - procedure TEST_TASK_SUPPORT ( - NODE : in RTEMS.UNSIGNED32 - ) is - EVENTS : RTEMS.EVENT_SET; - STATUS : RTEMS.STATUS_CODES; - begin - - if TEST_SUPPORT.NODE = NODE then - - loop - - RTEMS.EVENT.RECEIVE( - RTEMS.EVENT_16, - RTEMS.NO_WAIT, - RTEMS.NO_TIMEOUT, - EVENTS, - STATUS - ); - - exit when RTEMS.ARE_STATUSES_EQUAL( RTEMS.SUCCESSFUL, STATUS ); - - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.UNSATISFIED, - "EVENT_RECEIVE" - ); - - RTEMS.TASKS.WAKE_AFTER( - 2 * TEST_SUPPORT.TICKS_PER_SECOND, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - TEST_SUPPORT.PUT_NAME( MPTEST.TASK_NAME( NODE ), FALSE ); - TEXT_IO.PUT_LINE( " - Suspending remote task" ); - RTEMS.TASKS.SUSPEND( MPTEST.REMOTE_TID, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND" ); - - RTEMS.TASKS.WAKE_AFTER( - 2 * TEST_SUPPORT.TICKS_PER_SECOND, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - TEST_SUPPORT.PUT_NAME( MPTEST.TASK_NAME( NODE ), FALSE ); - TEXT_IO.PUT_LINE( " - Resuming remote task" ); - - RTEMS.TASKS.RESUME( MPTEST.REMOTE_TID, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESUME" ); - - end loop; - - else - - loop - - RTEMS.EVENT.RECEIVE( - RTEMS.EVENT_16, - RTEMS.NO_WAIT, - RTEMS.NO_TIMEOUT, - EVENTS, - STATUS - ); - - exit when RTEMS.ARE_STATUSES_EQUAL( RTEMS.SUCCESSFUL, STATUS ); - - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.UNSATISFIED, - "EVENT_RECEIVE" - ); - - TEST_SUPPORT.PUT_NAME( MPTEST.TASK_NAME( REMOTE_NODE ), FALSE ); - TEXT_IO.PUT_LINE( " - have I been suspended???" ); - RTEMS.TASKS.WAKE_AFTER( - TEST_SUPPORT.TICKS_PER_SECOND / 2, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - end loop; - - end if; - - end TEST_TASK_SUPPORT; - -end MPTEST; diff --git a/c/src/ada-tests/mptests/mp03/mptest.ads b/c/src/ada-tests/mptests/mp03/mptest.ads deleted file mode 100644 index 6e7f59947e..0000000000 --- a/c/src/ada-tests/mptests/mp03/mptest.ads +++ /dev/null @@ -1,111 +0,0 @@ --- --- MPTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 3 of the RTEMS --- Multiprocessor 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; - -package MPTEST is - --- --- These arrays contain the IDs and NAMEs of all RTEMS tasks created --- by this test. --- - - TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; - TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; - --- --- These arrays contain the IDs and NAMEs of all RTEMS timers created --- by this test. --- - - TIMER_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID; - TIMER_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME; - --- --- This variable contains the ID of the remote task with which this --- test interacts. --- - - REMOTE_TID : RTEMS.ID; - --- --- This variable contains the node on which the remote task with which --- this test interacts resides. --- - - REMOTE_NODE : RTEMS.UNSIGNED32; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- DELAYED_SEND_EVENT --- --- DESCRIPTION: --- --- This subprogram is a timer service routine which sends an --- event set to a waiting task. --- - - procedure DELAYED_SEND_EVENT ( - IGNORED_ID : in RTEMS.ID; - IGNORED_ADDRESS : in RTEMS.ADDRESS - ); - pragma Convention (C, DELAYED_SEND_EVENT); - --- --- TEST_TASK --- --- DESCRIPTION: --- --- This is the body of the RTEMS tasks which constitute this test. --- - - procedure TEST_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TEST_TASK); - --- --- TEST_TASK_SUPPORT --- --- DESCRIPTION: --- --- This subprogram performs the bulk of the test. Based on the NODE --- specified, this subprogram loops suspending/resuming a remote task --- or waiting for itself to be suspended/resumed. --- - - procedure TEST_TASK_SUPPORT ( - NODE : in RTEMS.UNSIGNED32 - ); - -end MPTEST; diff --git a/c/src/ada-tests/mptests/mp03/node1/Makefile.am b/c/src/ada-tests/mptests/mp03/node1/Makefile.am deleted file mode 100644 index 859fdb3702..0000000000 --- a/c/src/ada-tests/mptests/mp03/node1/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -AM_ADAFLAGS += -I$(srcdir)/.. - -noinst_PROGRAMS = mp03_ada_mp03_node1 -mp03_ada_mp03_node1_SOURCES = mp03_node1.adb ../mptest.adb config.h -mp03_ada_mp03_node1_SOURCES += ../mptest.ads -mp03_ada_mp03_node1_SOURCES += ../../../support/init.c - -mp03_ada_mp03_node1$(EXEEXT): mp03_node1.adb ../mptest.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_mp03-node1.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/mptests/mp03/node1/ada_mp03-node1.scn b/c/src/ada-tests/mptests/mp03/node1/ada_mp03-node1.scn deleted file mode 100644 index d749db49e2..0000000000 --- a/c/src/ada-tests/mptests/mp03/node1/ada_mp03-node1.scn +++ /dev/null @@ -1,28 +0,0 @@ -*** TEST 3 -- NODE 1 *** -Creating Test_task (Global) -Starting Test_task (Global) -Deleting initialization task -Getting TID of remote task -Remote task's name is : 222 -111 - Suspending remote task -111 - Resuming remote task -111 - Suspending remote task -111 - Resuming remote task -111 - Suspending remote task -111 - Resuming remote task -222 - have I been suspended??? -222 - have I been suspended??? -222 - have I been suspended??? -222 - have I been suspended??? -222 - have I been suspended??? -222 - have I been suspended??? -222 - have I been suspended??? -222 - have I been suspended??? -222 - have I been suspended??? -222 - have I been suspended??? -222 - have I been suspended??? -222 - have I been suspended??? -222 - have I been suspended??? -222 - have I been suspended??? -*** END OF TEST 3 *** - diff --git a/c/src/ada-tests/mptests/mp03/node1/config.h b/c/src/ada-tests/mptests/mp03/node1/config.h deleted file mode 100644 index 36c9d133e8..0000000000 --- a/c/src/ada-tests/mptests/mp03/node1/config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* 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_MP_APPLICATION -#define CONFIGURE_MP_NODE_NUMBER 1 - -#include "../config_base.h" - -/* end of include file */ diff --git a/c/src/ada-tests/mptests/mp03/node1/mp03_node1.adb b/c/src/ada-tests/mptests/mp03/node1/mp03_node1.adb deleted file mode 100644 index 80a67ffc94..0000000000 --- a/c/src/ada-tests/mptests/mp03/node1/mp03_node1.adb +++ /dev/null @@ -1,56 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test MP03_NODE1 of the Multiprocessor --- 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 MPTEST; -with TEST_SUPPORT; - -procedure MP03_NODE1 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, - MPTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end MP03_NODE1; - diff --git a/c/src/ada-tests/mptests/mp03/node2/Makefile.am b/c/src/ada-tests/mptests/mp03/node2/Makefile.am deleted file mode 100644 index b7088eb4a7..0000000000 --- a/c/src/ada-tests/mptests/mp03/node2/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -AM_ADAFLAGS += -I$(srcdir)/.. - -noinst_PROGRAMS = mp03_ada_mp03_node2 -mp03_ada_mp03_node2_SOURCES = mp03_node2.adb ../mptest.adb config.h -mp03_ada_mp03_node2_SOURCES += ../mptest.ads -mp03_ada_mp03_node2_SOURCES += ../../../support/init.c - -mp03_ada_mp03_node2$(EXEEXT): mp03_node2.adb ../mptest.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_mp03-node2.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/mptests/mp03/node2/ada_mp03-node2.scn b/c/src/ada-tests/mptests/mp03/node2/ada_mp03-node2.scn deleted file mode 100644 index 56298f5b8d..0000000000 --- a/c/src/ada-tests/mptests/mp03/node2/ada_mp03-node2.scn +++ /dev/null @@ -1,28 +0,0 @@ -*** TEST 3 -- NODE 2 *** -Creating Test_task (Global) -Starting Test_task (Global) -Deleting initialization task -Getting TID of remote task -Remote task's name is : 111 -111 - have I been suspended??? -111 - have I been suspended??? -111 - have I been suspended??? -111 - have I been suspended??? -111 - have I been suspended??? -111 - have I been suspended??? -111 - have I been suspended??? -111 - have I been suspended??? -111 - have I been suspended??? -111 - have I been suspended??? -111 - have I been suspended??? -111 - have I been suspended??? -111 - have I been suspended??? -111 - have I been suspended??? -222 - Suspending remote task -222 - Resuming remote task -222 - Suspending remote task -222 - Resuming remote task -222 - Suspending remote task -222 - Resuming remote task -*** END OF TEST 3 *** - diff --git a/c/src/ada-tests/mptests/mp03/node2/config.h b/c/src/ada-tests/mptests/mp03/node2/config.h deleted file mode 100644 index 47edf66149..0000000000 --- a/c/src/ada-tests/mptests/mp03/node2/config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* 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_MP_APPLICATION -#define CONFIGURE_MP_NODE_NUMBER 2 - -#include "../config_base.h" - -/* end of include file */ diff --git a/c/src/ada-tests/mptests/mp03/node2/mp03_node2.adb b/c/src/ada-tests/mptests/mp03/node2/mp03_node2.adb deleted file mode 100644 index aec5b91edd..0000000000 --- a/c/src/ada-tests/mptests/mp03/node2/mp03_node2.adb +++ /dev/null @@ -1,56 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test MP03_NODE2 of the Multiprocessor --- 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 MPTEST; -with TEST_SUPPORT; - -procedure MP03_NODE2 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, - MPTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end MP03_NODE2; - diff --git a/c/src/ada-tests/mptests/mp04/Makefile.am b/c/src/ada-tests/mptests/mp04/Makefile.am deleted file mode 100644 index 43bba78abb..0000000000 --- a/c/src/ada-tests/mptests/mp04/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -_SUBDIRS = node1 node2 - -include $(top_srcdir)/../../../testsuites/automake/subdirs.am -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/mptests/mp04/config_base.h b/c/src/ada-tests/mptests/mp04/config_base.h deleted file mode 100644 index c1b8f24e86..0000000000 --- a/c/src/ada-tests/mptests/mp04/config_base.h +++ /dev/null @@ -1,28 +0,0 @@ -/* config_base.h - * - * This include file defines all of the Configuration Table for this test - * EXCEPT the NODE NUMBER. - * - * 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. - */ - - - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_TASKS 2 - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/mptests/mp04/mptest.adb b/c/src/ada-tests/mptests/mp04/mptest.adb deleted file mode 100644 index a7a2bdd3ea..0000000000 --- a/c/src/ada-tests/mptests/mp04/mptest.adb +++ /dev/null @@ -1,163 +0,0 @@ --- --- MPTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation for Test 4 of the RTEMS --- Multiprocessor 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 INTERFACES; use INTERFACES; -with RTEMS; -with RTEMS.TASKS; -with TEST_SUPPORT; -with TEXT_IO; -with UNSIGNED32_IO; - -package body MPTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT( "*** TEST 4 -- NODE " ); - UNSIGNED32_IO.PUT( - TEST_SUPPORT.NODE, - WIDTH => 1 - ); - TEXT_IO.PUT_LINE( " ***" ); - - MPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( '1', '1', '1', ' ' ); - MPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( '2', '2', '2', ' ' ); - - TEXT_IO.PUT_LINE( "Creating Test_task (Global)" ); - - RTEMS.TASKS.CREATE( - MPTEST.TASK_NAME( TEST_SUPPORT.NODE ), - TEST_SUPPORT.NODE, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.GLOBAL, - MPTEST.TASK_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); - - TEXT_IO.PUT_LINE( "Starting Test_task (Global)" ); - - RTEMS.TASKS.START( - MPTEST.TASK_ID( 1 ), - MPTEST.TEST_TASK'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); - - TEXT_IO.PUT_LINE( "Deleting initialization task" ); - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- TEST_TASK --- - - procedure TEST_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - TID : RTEMS.ID; - PREVIOUS_PRIORITY : RTEMS.TASKS.PRIORITY; - PREVIOUS_PRIORITY_1 : RTEMS.TASKS.PRIORITY; - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.TASKS.IDENT( RTEMS.SELF, RTEMS.SEARCH_ALL_NODES, TID, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF SELF" ); - - TEXT_IO.PUT_LINE( "Getting TID of remote task" ); - if TEST_SUPPORT.NODE = 1 then - MPTEST.REMOTE_NODE := 2; - else - MPTEST.REMOTE_NODE := 1; - end if; - - TEXT_IO.PUT( "Remote task's name is : " ); - TEST_SUPPORT.PUT_NAME( MPTEST.TASK_NAME( MPTEST.REMOTE_NODE ), TRUE ); - - loop - - RTEMS.TASKS.IDENT( - MPTEST.TASK_NAME( MPTEST.REMOTE_NODE ), - RTEMS.SEARCH_ALL_NODES, - MPTEST.REMOTE_TID, - STATUS - ); - - exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS ); - - end loop; - - RTEMS.TASKS.SET_PRIORITY( - MPTEST.REMOTE_TID, - TEST_SUPPORT.NODE, - PREVIOUS_PRIORITY, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" ); - - if PREVIOUS_PRIORITY /= MPTEST.REMOTE_NODE then - - TEXT_IO.PUT( "Remote priority (0x" ); - UNSIGNED32_IO.PUT( PREVIOUS_PRIORITY, BASE => 16 ); - TEXT_IO.PUT( "does not match remote node (0x" ); - UNSIGNED32_IO.PUT( MPTEST.REMOTE_NODE, BASE => 16 ); - TEXT_IO.PUT_LINE( ")!!!" ); - - RTEMS.SHUTDOWN_EXECUTIVE( 16#F00000# ); - - end if; - - loop - - RTEMS.TASKS.SET_PRIORITY( - RTEMS.SELF, - RTEMS.TASKS.CURRENT_PRIORITY, - PREVIOUS_PRIORITY_1, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" ); - - exit when PREVIOUS_PRIORITY_1 = MPTEST.REMOTE_NODE; - - end loop; - - - TEXT_IO.PUT_LINE( "Local task priority has been set" ); - - TEXT_IO.PUT_LINE( "*** END OF TEST 4 ***" ); - - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end TEST_TASK; - -end MPTEST; diff --git a/c/src/ada-tests/mptests/mp04/mptest.ads b/c/src/ada-tests/mptests/mp04/mptest.ads deleted file mode 100644 index ddf2c82878..0000000000 --- a/c/src/ada-tests/mptests/mp04/mptest.ads +++ /dev/null @@ -1,74 +0,0 @@ --- --- MPTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 4 of the RTEMS --- Multiprocessor 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; - -package MPTEST is - --- --- These arrays contain the IDs and NAMEs of all RTEMS tasks created --- by this test. --- - - TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; - TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; - --- --- This variable contains the ID of the remote task with which this --- test interacts. --- - - REMOTE_TID : RTEMS.ID; - --- --- This variable contains the node on which the remote task with which --- this test interacts resides. --- - - REMOTE_NODE : RTEMS.UNSIGNED32; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- TEST_TASK --- --- DESCRIPTION: --- --- This is the body of the RTEMS tasks which constitute this test. --- - - procedure TEST_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TEST_TASK); - -end MPTEST; diff --git a/c/src/ada-tests/mptests/mp04/node1/Makefile.am b/c/src/ada-tests/mptests/mp04/node1/Makefile.am deleted file mode 100644 index 221ec1a2b8..0000000000 --- a/c/src/ada-tests/mptests/mp04/node1/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -AM_ADAFLAGS += -I$(srcdir)/.. - -noinst_PROGRAMS = mp04_ada_mp04_node1 -mp04_ada_mp04_node1_SOURCES = mp04_node1.adb ../mptest.adb config.h -mp04_ada_mp04_node1_SOURCES += ../mptest.ads -mp04_ada_mp04_node1_SOURCES += ../../../support/init.c - -mp04_ada_mp04_node1$(EXEEXT): mp04_node1.adb ../mptest.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_mp04-node1.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/mptests/mp04/node1/ada_mp04-node1.scn b/c/src/ada-tests/mptests/mp04/node1/ada_mp04-node1.scn deleted file mode 100644 index e9518f3ac2..0000000000 --- a/c/src/ada-tests/mptests/mp04/node1/ada_mp04-node1.scn +++ /dev/null @@ -1,8 +0,0 @@ -*** TEST 4 -- NODE 1 *** -Creating Test_task (Global) -Starting Test_task (Global) -Deleting initialization task -Getting TID of remote task -Remote task's name is : 222 -Local task priority has been set -*** END OF TEST 4 *** diff --git a/c/src/ada-tests/mptests/mp04/node1/config.h b/c/src/ada-tests/mptests/mp04/node1/config.h deleted file mode 100644 index 36c9d133e8..0000000000 --- a/c/src/ada-tests/mptests/mp04/node1/config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* 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_MP_APPLICATION -#define CONFIGURE_MP_NODE_NUMBER 1 - -#include "../config_base.h" - -/* end of include file */ diff --git a/c/src/ada-tests/mptests/mp04/node1/mp04_node1.adb b/c/src/ada-tests/mptests/mp04/node1/mp04_node1.adb deleted file mode 100644 index c88c019992..0000000000 --- a/c/src/ada-tests/mptests/mp04/node1/mp04_node1.adb +++ /dev/null @@ -1,56 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test MP04_NODE1 of the Multiprocessor --- 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 MPTEST; -with TEST_SUPPORT; - -procedure MP04_NODE1 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, - MPTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end MP04_NODE1; - diff --git a/c/src/ada-tests/mptests/mp04/node2/Makefile.am b/c/src/ada-tests/mptests/mp04/node2/Makefile.am deleted file mode 100644 index 377564a460..0000000000 --- a/c/src/ada-tests/mptests/mp04/node2/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -AM_ADAFLAGS += -I$(srcdir)/.. - -noinst_PROGRAMS = mp04_ada_mp04_node2 -mp04_ada_mp04_node2_SOURCES = mp04_node2.adb ../mptest.adb config.h -mp04_ada_mp04_node2_SOURCES += ../mptest.ads -mp04_ada_mp04_node2_SOURCES += ../../../support/init.c - -mp04_ada_mp04_node2$(EXEEXT): mp04_node2.adb ../mptest.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_mp04-node2.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/mptests/mp04/node2/ada_mp04-node2.scn b/c/src/ada-tests/mptests/mp04/node2/ada_mp04-node2.scn deleted file mode 100644 index 8ccfcfef79..0000000000 --- a/c/src/ada-tests/mptests/mp04/node2/ada_mp04-node2.scn +++ /dev/null @@ -1,8 +0,0 @@ -*** TEST 4 -- NODE 2 *** -Creating Test_task (Global) -Starting Test_task (Global) -Deleting initialization task -Getting TID of remote task -Remote task's name is : 111 -Local task priority has been set -*** END OF TEST 4 *** diff --git a/c/src/ada-tests/mptests/mp04/node2/config.h b/c/src/ada-tests/mptests/mp04/node2/config.h deleted file mode 100644 index 47edf66149..0000000000 --- a/c/src/ada-tests/mptests/mp04/node2/config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* 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_MP_APPLICATION -#define CONFIGURE_MP_NODE_NUMBER 2 - -#include "../config_base.h" - -/* end of include file */ diff --git a/c/src/ada-tests/mptests/mp04/node2/mp04_node2.adb b/c/src/ada-tests/mptests/mp04/node2/mp04_node2.adb deleted file mode 100644 index 4cd9f0e3b3..0000000000 --- a/c/src/ada-tests/mptests/mp04/node2/mp04_node2.adb +++ /dev/null @@ -1,56 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test MP04_NODE2 of the Multiprocessor --- 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 MPTEST; -with TEST_SUPPORT; - -procedure MP04_NODE2 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, - MPTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end MP04_NODE2; - diff --git a/c/src/ada-tests/mptests/mp05/Makefile.am b/c/src/ada-tests/mptests/mp05/Makefile.am deleted file mode 100644 index 43bba78abb..0000000000 --- a/c/src/ada-tests/mptests/mp05/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -_SUBDIRS = node1 node2 - -include $(top_srcdir)/../../../testsuites/automake/subdirs.am -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/mptests/mp05/config_base.h b/c/src/ada-tests/mptests/mp05/config_base.h deleted file mode 100644 index c1b8f24e86..0000000000 --- a/c/src/ada-tests/mptests/mp05/config_base.h +++ /dev/null @@ -1,28 +0,0 @@ -/* config_base.h - * - * This include file defines all of the Configuration Table for this test - * EXCEPT the NODE NUMBER. - * - * 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. - */ - - - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_TASKS 2 - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/mptests/mp05/mptest.adb b/c/src/ada-tests/mptests/mp05/mptest.adb deleted file mode 100644 index a206b80b85..0000000000 --- a/c/src/ada-tests/mptests/mp05/mptest.adb +++ /dev/null @@ -1,247 +0,0 @@ --- --- MPTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation for Test 5 of the RTEMS --- Multiprocessor 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 INTERFACES; use INTERFACES; -with RTEMS; -with RTEMS.FATAL; -with RTEMS.SIGNAL; -with RTEMS.TASKS; -with RTEMS.TIMER; -with TEST_SUPPORT; -with TEXT_IO; -with UNSIGNED32_IO; - -package body MPTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT( "*** TEST 5 -- NODE " ); - UNSIGNED32_IO.PUT( - TEST_SUPPORT.NODE, - WIDTH => 1 - ); - TEXT_IO.PUT_LINE( " ***" ); - - MPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( '1', '1', '1', ' ' ); - MPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( '2', '2', '2', ' ' ); - - TEXT_IO.PUT_LINE( "Creating Test_task (Global)" ); - - RTEMS.TASKS.CREATE( - MPTEST.TASK_NAME( TEST_SUPPORT.NODE ), - 1, - 2048, - RTEMS.TIMESLICE, - RTEMS.GLOBAL, - MPTEST.TASK_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); - - TEXT_IO.PUT_LINE( "Starting Test_task (Global)" ); - - RTEMS.TASKS.START( - MPTEST.TASK_ID( 1 ), - MPTEST.TEST_TASK'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); - - MPTEST.TIMER_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'M', '1', ' ' ); - MPTEST.TIMER_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'M', '2', ' ' ); - - RTEMS.TIMER.CREATE( - MPTEST.TIMER_NAME( TEST_SUPPORT.NODE ), - MPTEST.TIMER_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE" ); - - TEXT_IO.PUT_LINE( "Deleting initialization task" ); - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- PROCESS_ASR --- - - procedure PROCESS_ASR ( - SIGNAL : in RTEMS.SIGNAL_SET - ) - is - begin - - if SIGNAL /= MPTEST.EXPECTED_SIGNAL then - - TEXT_IO.PUT( "ERROR: I was expecting signal 0x" ); - UNSIGNED32_IO.PUT( EXPECTED_SIGNAL, BASE => 16 ); - TEXT_IO.PUT( " got 0x" ); - UNSIGNED32_IO.PUT( SIGNAL, BASE => 16 ); - TEXT_IO.NEW_LINE; - - RTEMS.FATAL.ERROR_OCCURRED( 16#000F_0000# ); - - end if; - - MPTEST.SIGNAL_CAUGHT := TRUE; - - end PROCESS_ASR; - --- --- STOP_TEST_TSR --- - - procedure STOP_TEST_TSR ( - IGNORED_ID : in RTEMS.ID; - IGNORED_ADDRESS : in RTEMS.ADDRESS - ) is - begin - - MPTEST.STOP_TEST := TRUE; - - end STOP_TEST_TSR; - --- --- TEST_TASK --- - - procedure TEST_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - STATUS : RTEMS.STATUS_CODES; - begin - - MPTEST.STOP_TEST := FALSE; - - MPTEST.SIGNAL_CAUGHT := FALSE; - MPTEST.SIGNAL_COUNT := 0; - - TEXT_IO.PUT_LINE( "signal_catch: initializing signal catcher" ); - RTEMS.SIGNAL.CATCH( - MPTEST.PROCESS_ASR'ACCESS, - RTEMS.NO_ASR + RTEMS.NO_PREEMPT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SIGNAL_CATCH" ); - - if TEST_SUPPORT.NODE = 1 then - MPTEST.REMOTE_NODE := 2; - MPTEST.REMOTE_SIGNAL := RTEMS.SIGNAL_18; - MPTEST.EXPECTED_SIGNAL := RTEMS.SIGNAL_17; - else - MPTEST.REMOTE_NODE := 1; - MPTEST.REMOTE_SIGNAL := RTEMS.SIGNAL_17; - MPTEST.EXPECTED_SIGNAL := RTEMS.SIGNAL_18; - end if; - - TEXT_IO.PUT( "Remote task's name is : " ); - TEST_SUPPORT.PUT_NAME( MPTEST.TASK_NAME( MPTEST.REMOTE_NODE ), TRUE ); - - TEXT_IO.PUT_LINE( "Getting TID of remote task" ); - loop - - RTEMS.TASKS.IDENT( - MPTEST.TASK_NAME( MPTEST.REMOTE_NODE ), - RTEMS.SEARCH_ALL_NODES, - MPTEST.REMOTE_TID, - STATUS - ); - - exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS ); - - end loop; - - RTEMS.TIMER.FIRE_AFTER( - MPTEST.TIMER_ID( 1 ), - 3 * TEST_SUPPORT.TICKS_PER_SECOND, - MPTEST.STOP_TEST_TSR'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER" ); - - if TEST_SUPPORT.NODE = 1 then - - TEXT_IO.PUT_LINE( "Sending signal to remote task" ); - loop - RTEMS.SIGNAL.SEND( - MPTEST.REMOTE_TID, - MPTEST.REMOTE_SIGNAL, - STATUS - ); - - exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS ); - - exit when not RTEMS.ARE_STATUSES_EQUAL(STATUS, RTEMS.NOT_DEFINED); - - end loop; - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SIGNAL_SEND" ); - - end if; - - loop - - exit when MPTEST.STOP_TEST = TRUE; - - if MPTEST.SIGNAL_CAUGHT = TRUE then - - MPTEST.SIGNAL_CAUGHT := FALSE; - MPTEST.SIGNAL_COUNT := MPTEST.SIGNAL_COUNT + 1; - - if MPTEST.SIGNAL_COUNT >= MPTEST.SIGNALS_PER_DOT then - - MPTEST.SIGNAL_COUNT := 0; - - TEST_SUPPORT.PUT_DOT( "." ); - - end if; - - RTEMS.SIGNAL.SEND( - MPTEST.REMOTE_TID, - MPTEST.REMOTE_SIGNAL, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SIGNAL_SEND" ); - - end if; - - end loop; - - TEXT_IO.NEW_LINE; - TEXT_IO.PUT_LINE( "*** END OF TEST 5 ***" ); - - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end TEST_TASK; - -end MPTEST; diff --git a/c/src/ada-tests/mptests/mp05/mptest.ads b/c/src/ada-tests/mptests/mp05/mptest.ads deleted file mode 100644 index 13d5ced1d6..0000000000 --- a/c/src/ada-tests/mptests/mp05/mptest.ads +++ /dev/null @@ -1,142 +0,0 @@ --- --- MPTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 5 of the RTEMS --- Multiprocessor 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.SIGNAL; -with RTEMS.TASKS; - -package MPTEST is - --- --- These arrays contain the IDs and NAMEs of all RTEMS tasks created --- by this test. --- - - TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; - TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; - --- --- These arrays contain the IDs and NAMEs of all RTEMS timers created --- by this test. --- - - TIMER_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID; - TIMER_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME; - --- --- This variable is set when the test should stop executing. --- - STOP_TEST : BOOLEAN; - --- --- This variable contains the ID of the remote task with which this --- test interacts. --- - - REMOTE_TID : RTEMS.ID; - --- --- This variable contains the node on which the remote task with which --- this test interacts resides. --- - - REMOTE_NODE : RTEMS.UNSIGNED32; - --- --- This is the signal set which is sent to the task on the other node. --- - - REMOTE_SIGNAL : RTEMS.SIGNAL_SET; - --- --- This is the signal set the task on this node expects to receive --- from the other node. --- - - EXPECTED_SIGNAL : RTEMS.SIGNAL_SET; - --- --- These keep track of if a signal set has been caught and how many --- signal sets have been caught cumulative. --- - - SIGNAL_CAUGHT : BOOLEAN; - SIGNAL_COUNT : RTEMS.UNSIGNED32; - --- --- The number of signals to process per dot printed out. --- - - SIGNALS_PER_DOT : constant RTEMS.UNSIGNED32 := 15; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- PROCESS_ASR --- --- DESCRIPTION: --- --- This subprogram is an ASR for TEST_TASK. --- - - procedure PROCESS_ASR ( - SIGNAL : in RTEMS.SIGNAL_SET - ); - pragma Convention (C, PROCESS_ASR); - --- --- STOP_TEST_TSR --- --- DESCRIPTION: --- --- This subprogram is a TSR which sets the "stop test" flag. --- - - procedure STOP_TEST_TSR ( - IGNORED_ID : in RTEMS.ID; - IGNORED_ADDRESS : in RTEMS.ADDRESS - ); - pragma Convention (C, STOP_TEST_TSR); - --- --- TEST_TASK --- --- DESCRIPTION: --- --- This is the body of the RTEMS tasks which constitute this test. --- - - procedure TEST_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TEST_TASK); - -end MPTEST; diff --git a/c/src/ada-tests/mptests/mp05/node1/Makefile.am b/c/src/ada-tests/mptests/mp05/node1/Makefile.am deleted file mode 100644 index be025c259b..0000000000 --- a/c/src/ada-tests/mptests/mp05/node1/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -AM_ADAFLAGS += -I$(srcdir)/.. - -noinst_PROGRAMS = mp05_ada_mp05_node1 -mp05_ada_mp05_node1_SOURCES = mp05_node1.adb ../mptest.adb config.h -mp05_ada_mp05_node1_SOURCES += ../mptest.ads -mp05_ada_mp05_node1_SOURCES += ../../../support/init.c - -mp05_ada_mp05_node1$(EXEEXT): mp05_node1.adb ../mptest.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_mp05-node1.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/mptests/mp05/node1/ada_mp05-node1.scn b/c/src/ada-tests/mptests/mp05/node1/ada_mp05-node1.scn deleted file mode 100644 index 6f0ea4b639..0000000000 --- a/c/src/ada-tests/mptests/mp05/node1/ada_mp05-node1.scn +++ /dev/null @@ -1,11 +0,0 @@ -*** TEST 5 -- NODE 1 *** -Creating Test_task (Global) -Starting Test_task (Global) -Deleting initialization task -signal_catch: initializing signal catcher -Remote task's name is : 222 -Getting TID of remote task -Sending signal to remote task -.................................................... -.................................................... -*** END OF TEST 5 *** diff --git a/c/src/ada-tests/mptests/mp05/node1/config.h b/c/src/ada-tests/mptests/mp05/node1/config.h deleted file mode 100644 index 36c9d133e8..0000000000 --- a/c/src/ada-tests/mptests/mp05/node1/config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* 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_MP_APPLICATION -#define CONFIGURE_MP_NODE_NUMBER 1 - -#include "../config_base.h" - -/* end of include file */ diff --git a/c/src/ada-tests/mptests/mp05/node1/mp05_node1.adb b/c/src/ada-tests/mptests/mp05/node1/mp05_node1.adb deleted file mode 100644 index 529406450b..0000000000 --- a/c/src/ada-tests/mptests/mp05/node1/mp05_node1.adb +++ /dev/null @@ -1,56 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test MP05_NODE1 of the Multiprocessor --- 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 MPTEST; -with TEST_SUPPORT; - -procedure MP05_NODE1 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, - MPTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end MP05_NODE1; - diff --git a/c/src/ada-tests/mptests/mp05/node2/Makefile.am b/c/src/ada-tests/mptests/mp05/node2/Makefile.am deleted file mode 100644 index 8f4be962ff..0000000000 --- a/c/src/ada-tests/mptests/mp05/node2/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -AM_ADAFLAGS += -I$(srcdir)/.. - -noinst_PROGRAMS = mp05_ada_mp05_node2 -mp05_ada_mp05_node2_SOURCES = mp05_node2.adb ../mptest.adb config.h -mp05_ada_mp05_node2_SOURCES += ../mptest.ads -mp05_ada_mp05_node2_SOURCES += ../../../support/init.c - -mp05_ada_mp05_node2$(EXEEXT): mp05_node2.adb ../mptest.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_mp05-node2.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/mptests/mp05/node2/ada_mp05-node2.scn b/c/src/ada-tests/mptests/mp05/node2/ada_mp05-node2.scn deleted file mode 100644 index 1fb18c132b..0000000000 --- a/c/src/ada-tests/mptests/mp05/node2/ada_mp05-node2.scn +++ /dev/null @@ -1,10 +0,0 @@ -*** TEST 5 -- NODE 2 *** -Creating Test_task (Global) -Starting Test_task (Global) -Deleting initialization task -signal_catch: initializing signal catcher -Remote task's name is : 111 -Getting TID of remote task -.................................................... -.................................................... -*** END OF TEST 5 *** diff --git a/c/src/ada-tests/mptests/mp05/node2/config.h b/c/src/ada-tests/mptests/mp05/node2/config.h deleted file mode 100644 index 47edf66149..0000000000 --- a/c/src/ada-tests/mptests/mp05/node2/config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* 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_MP_APPLICATION -#define CONFIGURE_MP_NODE_NUMBER 2 - -#include "../config_base.h" - -/* end of include file */ diff --git a/c/src/ada-tests/mptests/mp05/node2/mp05_node2.adb b/c/src/ada-tests/mptests/mp05/node2/mp05_node2.adb deleted file mode 100644 index faa4aa2266..0000000000 --- a/c/src/ada-tests/mptests/mp05/node2/mp05_node2.adb +++ /dev/null @@ -1,56 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test MP05_NODE2 of the Multiprocessor --- 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 MPTEST; -with TEST_SUPPORT; - -procedure MP05_NODE2 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, - MPTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end MP05_NODE2; - diff --git a/c/src/ada-tests/mptests/mp06/Makefile.am b/c/src/ada-tests/mptests/mp06/Makefile.am deleted file mode 100644 index 43bba78abb..0000000000 --- a/c/src/ada-tests/mptests/mp06/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -_SUBDIRS = node1 node2 - -include $(top_srcdir)/../../../testsuites/automake/subdirs.am -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/mptests/mp06/config_base.h b/c/src/ada-tests/mptests/mp06/config_base.h deleted file mode 100644 index c1b8f24e86..0000000000 --- a/c/src/ada-tests/mptests/mp06/config_base.h +++ /dev/null @@ -1,28 +0,0 @@ -/* config_base.h - * - * This include file defines all of the Configuration Table for this test - * EXCEPT the NODE NUMBER. - * - * 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. - */ - - - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_TASKS 2 - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/mptests/mp06/mptest.adb b/c/src/ada-tests/mptests/mp06/mptest.adb deleted file mode 100644 index d4522e653b..0000000000 --- a/c/src/ada-tests/mptests/mp06/mptest.adb +++ /dev/null @@ -1,252 +0,0 @@ --- --- MPTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation for Test 6 of the RTEMS --- Multiprocessor 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 INTERFACES; use INTERFACES; -with RTEMS; -with RTEMS.EVENT; -with RTEMS.TASKS; -with RTEMS.TIMER; -with TEST_SUPPORT; -with TEXT_IO; -with UNSIGNED32_IO; - -package body MPTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT( "*** TEST 6 -- NODE " ); - UNSIGNED32_IO.PUT( - TEST_SUPPORT.NODE, - WIDTH => 1 - ); - TEXT_IO.PUT_LINE( " ***" ); - - MPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( '1', '1', '1', ' ' ); - MPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( '2', '2', '2', ' ' ); - - TEXT_IO.PUT_LINE( "Creating Test_task (Global)" ); - - RTEMS.TASKS.CREATE( - MPTEST.TASK_NAME( TEST_SUPPORT.NODE ), - TEST_SUPPORT.NODE, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.GLOBAL, - MPTEST.TASK_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); - - TEXT_IO.PUT_LINE( "Starting Test_task (Global)" ); - - RTEMS.TASKS.START( - MPTEST.TASK_ID( 1 ), - MPTEST.TEST_TASK'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); - - MPTEST.TIMER_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'M', '1', ' ' ); - MPTEST.TIMER_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'M', '2', ' ' ); - - RTEMS.TIMER.CREATE( - MPTEST.TIMER_NAME( TEST_SUPPORT.NODE ), - MPTEST.TIMER_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE" ); - - TEXT_IO.PUT_LINE( "Deleting initialization task" ); - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- STOP_TEST_TSR --- - - procedure STOP_TEST_TSR ( - IGNORED1 : in RTEMS.ID; - IGNORED2 : in RTEMS.ADDRESS - ) is - begin - - MPTEST.STOP_TEST := TRUE; - - end STOP_TEST_TSR; - --- --- TEST_TASK --- - - procedure TEST_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - COUNT : RTEMS.UNSIGNED32; - EVENT_OUT : RTEMS.EVENT_SET; - EVENT_FOR_THIS_ITERATION : RTEMS.EVENT_SET; - STATUS : RTEMS.STATUS_CODES; - begin - - MPTEST.STOP_TEST := FALSE; - - if TEST_SUPPORT.NODE = 1 then - MPTEST.REMOTE_NODE := 2; - else - MPTEST.REMOTE_NODE := 1; - end if; - - TEXT_IO.PUT( "Remote task's name is : " ); - TEST_SUPPORT.PUT_NAME( MPTEST.TASK_NAME( MPTEST.REMOTE_NODE ), TRUE ); - - TEXT_IO.PUT_LINE( "Getting TID of remote task" ); - - loop - - RTEMS.TASKS.IDENT( - MPTEST.TASK_NAME( MPTEST.REMOTE_NODE ), - RTEMS.SEARCH_ALL_NODES, - MPTEST.REMOTE_TID, - STATUS - ); - - exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS ); - - end loop; - - if TEST_SUPPORT.NODE = 1 then - TEXT_IO.PUT_LINE( "Sending events to remote task" ); - else - TEXT_IO.PUT_LINE( "Receiving events from remote task" ); - end if; - - RTEMS.TIMER.FIRE_AFTER( - MPTEST.TIMER_ID( 1 ), - 5 * TEST_SUPPORT.TICKS_PER_SECOND, - MPTEST.STOP_TEST_TSR'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER" ); - - COUNT := 0; - - loop - - exit when MPTEST.STOP_TEST = TRUE; - - EVENT_FOR_THIS_ITERATION := - MPTEST.EVENT_SET_TABLE( - INTEGER( COUNT ) mod MPTEST.EVENT_SET_TABLE'LAST + 1 - ); - - if TEST_SUPPORT.NODE = 1 then - - RTEMS.EVENT.SEND( - MPTEST.REMOTE_TID, - EVENT_FOR_THIS_ITERATION, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND" ); - - else - - RTEMS.EVENT.RECEIVE( - EVENT_FOR_THIS_ITERATION, - RTEMS.DEFAULT_OPTIONS, - 1 * TEST_SUPPORT.TICKS_PER_SECOND, - EVENT_OUT, - STATUS - ); - - if RTEMS.ARE_STATUSES_EQUAL( STATUS, RTEMS.TIMEOUT ) then - TEXT_IO.NEW_LINE( 1 ); - - if TEST_SUPPORT.NODE = 2 then - TEXT_IO.PUT_LINE( - "Correct behavior if the other node exitted." - ); - else - TEXT_IO.PUT_LINE( - "ERROR... node 1 died" - ); - end if; - - exit; - - else - - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE" ); - - end if; - - end if; - - if (COUNT mod MPTEST.MAXIMUM_DOTS) = 0 then - - TEST_SUPPORT.PUT_DOT( "." ); - - end if; - - COUNT := COUNT + 1; - - end loop; - - TEXT_IO.NEW_LINE; - - if TEST_SUPPORT.NODE = 2 then - - RTEMS.EVENT.RECEIVE( - RTEMS.EVENT_16, - RTEMS.DEFAULT_OPTIONS, - 1 * TEST_SUPPORT.TICKS_PER_SECOND, - EVENT_OUT, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - RTEMS.TIMEOUT, - STATUS, - "EVENT_RECEIVE" - ); - - TEXT_IO.NEW_LINE; - TEXT_IO.PUT_LINE( "event_receive - correctly returned TIMEOUT" ); - - end if; - - TEXT_IO.PUT_LINE( "*** END OF TEST 6 ***" ); - - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end TEST_TASK; - -end MPTEST; diff --git a/c/src/ada-tests/mptests/mp06/mptest.ads b/c/src/ada-tests/mptests/mp06/mptest.ads deleted file mode 100644 index 5c3668d3ac..0000000000 --- a/c/src/ada-tests/mptests/mp06/mptest.ads +++ /dev/null @@ -1,148 +0,0 @@ --- --- MPTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 6 of the RTEMS --- Multiprocessor 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.EVENT; -with RTEMS.TASKS; - -package MPTEST is - --- --- These arrays contain the IDs and NAMEs of all RTEMS tasks created --- by this test. --- - - TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; - TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; - --- --- These arrays contain the IDs and NAMEs of all RTEMS timers created --- by this test. --- - - TIMER_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID; - TIMER_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME; - --- --- This variable is set when the test should stop executing. --- - STOP_TEST : BOOLEAN; - --- --- This variable contains the ID of the remote task with which this --- test interacts. --- - - REMOTE_TID : RTEMS.ID; - --- --- This variable contains the node on which the remote task with which --- this test interacts resides. --- - - REMOTE_NODE : RTEMS.UNSIGNED32; - --- --- The number of signals to process per dot printed out. --- - - MAXIMUM_DOTS : constant RTEMS.UNSIGNED32 := 25; - --- --- The following is a table of the event sets which consist of --- a single event. This test cycles through all of these --- events. --- - - EVENT_SET_TABLE : constant array ( 0 .. 30 ) of RTEMS.EVENT_SET := ( - RTEMS.EVENT_0, - RTEMS.EVENT_1, - RTEMS.EVENT_2, - RTEMS.EVENT_3, - RTEMS.EVENT_4, - RTEMS.EVENT_5, - RTEMS.EVENT_6, - RTEMS.EVENT_7, - RTEMS.EVENT_8, - RTEMS.EVENT_9, - RTEMS.EVENT_10, - RTEMS.EVENT_11, - RTEMS.EVENT_12, - RTEMS.EVENT_13, - RTEMS.EVENT_14, - RTEMS.EVENT_15, - RTEMS.EVENT_16, - RTEMS.EVENT_17, - RTEMS.EVENT_18, - RTEMS.EVENT_19, - RTEMS.EVENT_20, - RTEMS.EVENT_21, - RTEMS.EVENT_22, - RTEMS.EVENT_23, - RTEMS.EVENT_24, - RTEMS.EVENT_25, - RTEMS.EVENT_26, - RTEMS.EVENT_27, - RTEMS.EVENT_28, - RTEMS.EVENT_29, - RTEMS.EVENT_30 - ); - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- STOP_TEST_TSR --- --- DESCRIPTION: --- --- This subprogram is a TSR which sets the "stop test" flag. --- - - procedure STOP_TEST_TSR ( - IGNORED1 : in RTEMS.ID; - IGNORED2 : in RTEMS.ADDRESS - ); - pragma Convention (C, STOP_TEST_TSR); - --- --- TEST_TASK --- --- DESCRIPTION: --- --- This is the body of the RTEMS tasks which constitute this test. --- - - procedure TEST_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TEST_TASK); - -end MPTEST; diff --git a/c/src/ada-tests/mptests/mp06/node1/Makefile.am b/c/src/ada-tests/mptests/mp06/node1/Makefile.am deleted file mode 100644 index d5e2cd3671..0000000000 --- a/c/src/ada-tests/mptests/mp06/node1/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -AM_ADAFLAGS += -I$(srcdir)/.. - -noinst_PROGRAMS = mp06_ada_mp06_node1 -mp06_ada_mp06_node1_SOURCES = mp06_node1.adb ../mptest.adb config.h -mp06_ada_mp06_node1_SOURCES += ../mptest.ads -mp06_ada_mp06_node1_SOURCES += ../../../support/init.c - -mp06_ada_mp06_node1$(EXEEXT): mp06_node1.adb ../mptest.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_mp06-node1.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/mptests/mp06/node1/ada_mp06-node1.scn b/c/src/ada-tests/mptests/mp06/node1/ada_mp06-node1.scn deleted file mode 100644 index 71da651eca..0000000000 --- a/c/src/ada-tests/mptests/mp06/node1/ada_mp06-node1.scn +++ /dev/null @@ -1,10 +0,0 @@ -*** TEST 6 -- NODE 1 *** -Creating Test_task (Global) -Starting Test_task (Global) -Deleting initialization task -Remote task's name is : 222 -Getting TID of remote task -Sending events to remote task -.................................................... -.................................................... -*** END OF TEST 6 *** diff --git a/c/src/ada-tests/mptests/mp06/node1/config.h b/c/src/ada-tests/mptests/mp06/node1/config.h deleted file mode 100644 index 36c9d133e8..0000000000 --- a/c/src/ada-tests/mptests/mp06/node1/config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* 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_MP_APPLICATION -#define CONFIGURE_MP_NODE_NUMBER 1 - -#include "../config_base.h" - -/* end of include file */ diff --git a/c/src/ada-tests/mptests/mp06/node1/mp06_node1.adb b/c/src/ada-tests/mptests/mp06/node1/mp06_node1.adb deleted file mode 100644 index ebde32ca1c..0000000000 --- a/c/src/ada-tests/mptests/mp06/node1/mp06_node1.adb +++ /dev/null @@ -1,56 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test MP06_NODE1 of the Multiprocessor --- 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 MPTEST; -with TEST_SUPPORT; - -procedure MP06_NODE1 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, - MPTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end MP06_NODE1; - diff --git a/c/src/ada-tests/mptests/mp06/node2/Makefile.am b/c/src/ada-tests/mptests/mp06/node2/Makefile.am deleted file mode 100644 index 47c3d13d67..0000000000 --- a/c/src/ada-tests/mptests/mp06/node2/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -AM_ADAFLAGS += -I$(srcdir)/.. - -noinst_PROGRAMS = mp06_ada_mp06_node2 -mp06_ada_mp06_node2_SOURCES = mp06_node2.adb ../mptest.adb config.h -mp06_ada_mp06_node2_SOURCES += ../mptest.ads -mp06_ada_mp06_node2_SOURCES += ../../../support/init.c - -mp06_ada_mp06_node2$(EXEEXT): mp06_node2.adb ../mptest.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_mp06-node2.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/mptests/mp06/node2/ada_mp06-node2.scn b/c/src/ada-tests/mptests/mp06/node2/ada_mp06-node2.scn deleted file mode 100644 index da449041b4..0000000000 --- a/c/src/ada-tests/mptests/mp06/node2/ada_mp06-node2.scn +++ /dev/null @@ -1,11 +0,0 @@ -*** TEST 6 -- NODE 2 *** -Creating Test_task (Global) -Starting Test_task (Global) -Deleting initialization task -Remote task's name is : 111 -Getting TID of remote task -Receiving events from remote task -.................................................... -.................................................... -event_receive - correctly returned TIMEOUT -*** END OF TEST 6 *** diff --git a/c/src/ada-tests/mptests/mp06/node2/config.h b/c/src/ada-tests/mptests/mp06/node2/config.h deleted file mode 100644 index 47edf66149..0000000000 --- a/c/src/ada-tests/mptests/mp06/node2/config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* 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_MP_APPLICATION -#define CONFIGURE_MP_NODE_NUMBER 2 - -#include "../config_base.h" - -/* end of include file */ diff --git a/c/src/ada-tests/mptests/mp06/node2/mp06_node2.adb b/c/src/ada-tests/mptests/mp06/node2/mp06_node2.adb deleted file mode 100644 index 3637d8827e..0000000000 --- a/c/src/ada-tests/mptests/mp06/node2/mp06_node2.adb +++ /dev/null @@ -1,56 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test MP06_NODE2 of the Multiprocessor --- 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 MPTEST; -with TEST_SUPPORT; - -procedure MP06_NODE2 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, - MPTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end MP06_NODE2; - diff --git a/c/src/ada-tests/mptests/mp07/Makefile.am b/c/src/ada-tests/mptests/mp07/Makefile.am deleted file mode 100644 index 43bba78abb..0000000000 --- a/c/src/ada-tests/mptests/mp07/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -_SUBDIRS = node1 node2 - -include $(top_srcdir)/../../../testsuites/automake/subdirs.am -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/mptests/mp07/config_base.h b/c/src/ada-tests/mptests/mp07/config_base.h deleted file mode 100644 index c1b8f24e86..0000000000 --- a/c/src/ada-tests/mptests/mp07/config_base.h +++ /dev/null @@ -1,28 +0,0 @@ -/* config_base.h - * - * This include file defines all of the Configuration Table for this test - * EXCEPT the NODE NUMBER. - * - * 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. - */ - - - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_TASKS 2 - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/mptests/mp07/mptest.adb b/c/src/ada-tests/mptests/mp07/mptest.adb deleted file mode 100644 index 20dbc9cd84..0000000000 --- a/c/src/ada-tests/mptests/mp07/mptest.adb +++ /dev/null @@ -1,204 +0,0 @@ --- --- MPTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation for Test 7 of the RTEMS --- Multiprocessor 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 INTERFACES; use INTERFACES; -with RTEMS; -with RTEMS.EVENT; -with RTEMS.TASKS; -with RTEMS.TIMER; -with TEST_SUPPORT; -with TEXT_IO; -with UNSIGNED32_IO; - -package body MPTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT( "*** TEST 7 -- NODE " ); - UNSIGNED32_IO.PUT( - TEST_SUPPORT.NODE, - WIDTH => 1 - ); - TEXT_IO.PUT_LINE( " ***" ); - - MPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( '1', '1', '1', ' ' ); - MPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( '2', '2', '2', ' ' ); - - TEXT_IO.PUT_LINE( "Creating Test_task (Global)" ); - RTEMS.TASKS.CREATE( - MPTEST.TASK_NAME( TEST_SUPPORT.NODE ), - TEST_SUPPORT.NODE, - 2048, - RTEMS.TIMESLICE, - RTEMS.GLOBAL, - MPTEST.TASK_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); - - TEXT_IO.PUT_LINE( "Starting Test_task (Global)" ); - RTEMS.TASKS.START( - MPTEST.TASK_ID( 1 ), - MPTEST.TEST_TASK'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); - - MPTEST.TIMER_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'M', '1', ' ' ); - - RTEMS.TIMER.CREATE( - MPTEST.TIMER_NAME( 1 ), - MPTEST.TIMER_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE" ); - - TEXT_IO.PUT_LINE( "Deleting initialization task" ); - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- STOP_TEST_TSR --- - - procedure STOP_TEST_TSR ( - IGNORED1 : in RTEMS.ID; - IGNORED2 : in RTEMS.ADDRESS - ) is - begin - - MPTEST.STOP_TEST := TRUE; - - end STOP_TEST_TSR; - --- --- TEST_TASK --- - - procedure TEST_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - EVENT_OUT : RTEMS.EVENT_SET; - STATUS : RTEMS.STATUS_CODES; - begin - - MPTEST.STOP_TEST := FALSE; - - if TEST_SUPPORT.NODE = 1 then - MPTEST.REMOTE_NODE := 2; - else - MPTEST.REMOTE_NODE := 1; - end if; - - TEXT_IO.PUT( "Remote task's name is : " ); - TEST_SUPPORT.PUT_NAME( MPTEST.TASK_NAME( MPTEST.REMOTE_NODE ), TRUE ); - - TEXT_IO.PUT_LINE( "Getting TID of remote task" ); - loop - RTEMS.TASKS.IDENT( - MPTEST.TASK_NAME( MPTEST.REMOTE_NODE ), - RTEMS.SEARCH_ALL_NODES, - MPTEST.REMOTE_TID, - STATUS - ); - - exit when RTEMS.ARE_STATUSES_EQUAL( STATUS, RTEMS.SUCCESSFUL ); - - end loop; - - if TEST_SUPPORT.NODE = 1 then - - TEXT_IO.PUT_LINE( "Sending first event to remote task" ); - RTEMS.EVENT.SEND( - MPTEST.REMOTE_TID, - RTEMS.EVENT_16, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND" ); - - end if; - - RTEMS.TIMER.FIRE_AFTER( - MPTEST.TIMER_ID( 1 ), - 5 * TEST_SUPPORT.TICKS_PER_SECOND, - MPTEST.STOP_TEST_TSR'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER" ); - - loop - - exit when MPTEST.STOP_TEST = TRUE; - - for COUNT in 1 .. MPTEST.PER_DOT - loop - - RTEMS.EVENT.RECEIVE( - RTEMS.EVENT_16, - RTEMS.DEFAULT_OPTIONS, - TEST_SUPPORT.TICKS_PER_SECOND, - EVENT_OUT, - STATUS - ); - if RTEMS.ARE_STATUSES_EQUAL( STATUS, RTEMS.TIMEOUT ) then - TEXT_IO.NEW_LINE; - TEXT_IO.PUT_LINE( - "TA1 - TIMEOUT .. probably OK if the other node exits" - ); - exit; - else - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE" ); - end if; - - RTEMS.EVENT.SEND( - MPTEST.REMOTE_TID, - RTEMS.EVENT_16, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND" ); - - end loop; - - TEST_SUPPORT.PUT_DOT( "." ); - - end loop; - - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT_LINE( "*** END OF TEST 7 ***" ); - - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end TEST_TASK; - -end MPTEST; diff --git a/c/src/ada-tests/mptests/mp07/mptest.ads b/c/src/ada-tests/mptests/mp07/mptest.ads deleted file mode 100644 index 499628b5d0..0000000000 --- a/c/src/ada-tests/mptests/mp07/mptest.ads +++ /dev/null @@ -1,107 +0,0 @@ --- --- MPTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 7 of the RTEMS --- Multiprocessor 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; - -package MPTEST is - --- --- These arrays contain the IDs and NAMEs of all RTEMS tasks created --- by this test. --- - - TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; - TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; - --- --- These arrays contain the IDs and NAMEs of all RTEMS timers created --- by this test. --- - - TIMER_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID; - TIMER_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME; - --- --- This variable is set when the test should stop executing. --- - STOP_TEST : BOOLEAN; - --- --- This variable contains the ID of the remote task with which this --- test interacts. --- - - REMOTE_TID : RTEMS.ID; - --- --- This variable contains the node on which the remote task with which --- this test interacts resides. --- - - REMOTE_NODE : RTEMS.UNSIGNED32; - --- --- The number of events to process per dot printed out. --- - - PER_DOT : constant RTEMS.UNSIGNED32 := 100; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- STOP_TEST_TSR --- --- DESCRIPTION: --- --- This subprogram is a TSR which sets the "stop test" flag. --- - - procedure STOP_TEST_TSR ( - IGNORED1 : in RTEMS.ID; - IGNORED2 : in RTEMS.ADDRESS - ); - pragma Convention (C, STOP_TEST_TSR); - --- --- TEST_TASK --- --- DESCRIPTION: --- --- This is the body of the RTEMS tasks which constitute this test. --- - - procedure TEST_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TEST_TASK); - -end MPTEST; diff --git a/c/src/ada-tests/mptests/mp07/node1/Makefile.am b/c/src/ada-tests/mptests/mp07/node1/Makefile.am deleted file mode 100644 index 540e28f956..0000000000 --- a/c/src/ada-tests/mptests/mp07/node1/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -AM_ADAFLAGS += -I$(srcdir)/.. - -noinst_PROGRAMS = mp07_ada_mp07_node1 -mp07_ada_mp07_node1_SOURCES = mp07_node1.adb ../mptest.adb config.h -mp07_ada_mp07_node1_SOURCES += ../mptest.ads -mp07_ada_mp07_node1_SOURCES += ../../../support/init.c - -mp07_ada_mp07_node1$(EXEEXT): mp07_node1.adb ../mptest.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_mp07-node1.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/mptests/mp07/node1/ada_mp07-node1.scn b/c/src/ada-tests/mptests/mp07/node1/ada_mp07-node1.scn deleted file mode 100644 index 71e0956329..0000000000 --- a/c/src/ada-tests/mptests/mp07/node1/ada_mp07-node1.scn +++ /dev/null @@ -1,10 +0,0 @@ -*** TEST 7 -- NODE 1 *** -Creating Test_task (Global) -Starting Test_task (Global) -Deleting initialization task -Remote task's name is : 222 -Getting TID of remote task -Sending first event to remote task -.................................................... -.................................................... -*** END OF TEST 7 *** diff --git a/c/src/ada-tests/mptests/mp07/node1/config.h b/c/src/ada-tests/mptests/mp07/node1/config.h deleted file mode 100644 index 36c9d133e8..0000000000 --- a/c/src/ada-tests/mptests/mp07/node1/config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* 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_MP_APPLICATION -#define CONFIGURE_MP_NODE_NUMBER 1 - -#include "../config_base.h" - -/* end of include file */ diff --git a/c/src/ada-tests/mptests/mp07/node1/mp07_node1.adb b/c/src/ada-tests/mptests/mp07/node1/mp07_node1.adb deleted file mode 100644 index a6d9ef4db0..0000000000 --- a/c/src/ada-tests/mptests/mp07/node1/mp07_node1.adb +++ /dev/null @@ -1,56 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test MP07_NODE1 of the Multiprocessor --- 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 MPTEST; -with TEST_SUPPORT; - -procedure MP07_NODE1 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, - MPTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end MP07_NODE1; - diff --git a/c/src/ada-tests/mptests/mp07/node2/Makefile.am b/c/src/ada-tests/mptests/mp07/node2/Makefile.am deleted file mode 100644 index 9ef989f01f..0000000000 --- a/c/src/ada-tests/mptests/mp07/node2/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -AM_ADAFLAGS += -I$(srcdir)/.. - -noinst_PROGRAMS = mp07_ada_mp07_node2 -mp07_ada_mp07_node2_SOURCES = mp07_node2.adb ../mptest.adb config.h -mp07_ada_mp07_node2_SOURCES += ../mptest.ads -mp07_ada_mp07_node2_SOURCES += ../../../support/init.c - -mp07_ada_mp07_node2$(EXEEXT): mp07_node2.adb ../mptest.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_mp07-node2.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/mptests/mp07/node2/ada_mp07-node2.scn b/c/src/ada-tests/mptests/mp07/node2/ada_mp07-node2.scn deleted file mode 100644 index c31011e85c..0000000000 --- a/c/src/ada-tests/mptests/mp07/node2/ada_mp07-node2.scn +++ /dev/null @@ -1,9 +0,0 @@ -*** TEST 7 -- NODE 2 *** -Creating Test_task (Global) -Starting Test_task (Global) -Deleting initialization task -Remote task's name is : 111 -Getting TID of remote task -.................................................... -.................................................... -*** END OF TEST 7 *** diff --git a/c/src/ada-tests/mptests/mp07/node2/config.h b/c/src/ada-tests/mptests/mp07/node2/config.h deleted file mode 100644 index 47edf66149..0000000000 --- a/c/src/ada-tests/mptests/mp07/node2/config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* 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_MP_APPLICATION -#define CONFIGURE_MP_NODE_NUMBER 2 - -#include "../config_base.h" - -/* end of include file */ diff --git a/c/src/ada-tests/mptests/mp07/node2/mp07_node2.adb b/c/src/ada-tests/mptests/mp07/node2/mp07_node2.adb deleted file mode 100644 index 0e0db0bbdd..0000000000 --- a/c/src/ada-tests/mptests/mp07/node2/mp07_node2.adb +++ /dev/null @@ -1,56 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test MP07_NODE2 of the Multiprocessor --- 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 MPTEST; -with TEST_SUPPORT; - -procedure MP07_NODE2 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, - MPTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end MP07_NODE2; - diff --git a/c/src/ada-tests/mptests/mp08/Makefile.am b/c/src/ada-tests/mptests/mp08/Makefile.am deleted file mode 100644 index 43bba78abb..0000000000 --- a/c/src/ada-tests/mptests/mp08/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -_SUBDIRS = node1 node2 - -include $(top_srcdir)/../../../testsuites/automake/subdirs.am -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/mptests/mp08/config_base.h b/c/src/ada-tests/mptests/mp08/config_base.h deleted file mode 100644 index c1b8f24e86..0000000000 --- a/c/src/ada-tests/mptests/mp08/config_base.h +++ /dev/null @@ -1,28 +0,0 @@ -/* config_base.h - * - * This include file defines all of the Configuration Table for this test - * EXCEPT the NODE NUMBER. - * - * 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. - */ - - - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_TASKS 2 - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/mptests/mp08/mptest.adb b/c/src/ada-tests/mptests/mp08/mptest.adb deleted file mode 100644 index 2910ec83e7..0000000000 --- a/c/src/ada-tests/mptests/mp08/mptest.adb +++ /dev/null @@ -1,203 +0,0 @@ --- --- MPTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation for Test 8 of the RTEMS --- Multiprocessor 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 INTERFACES; use INTERFACES; -with RTEMS; -with RTEMS.OBJECT; -with RTEMS.SEMAPHORE; -with RTEMS.TASKS; -with TEST_SUPPORT; -with TEXT_IO; -with UNSIGNED32_IO; - -package body MPTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT( "*** TEST 8 -- NODE " ); - UNSIGNED32_IO.PUT( - TEST_SUPPORT.NODE, - WIDTH => 1 - ); - TEXT_IO.PUT_LINE( " ***" ); - - MPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( '1', '1', '1', ' ' ); - MPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( '2', '2', '2', ' ' ); - - MPTEST.SEMAPHORE_NAME( 1 ) := RTEMS.BUILD_NAME( 'S', 'E', 'M', ' ' ); - - if TEST_SUPPORT.NODE = 1 then - - TEXT_IO.PUT_LINE( "Creating Semaphore(Global)" ); - - RTEMS.SEMAPHORE.CREATE( - MPTEST.SEMAPHORE_NAME( 1 ), - 1, - RTEMS.GLOBAL, - MPTEST.SEMAPHORE_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE" ); - - end if; - - TEXT_IO.PUT_LINE( "Creating Test_task (Global)" ); - RTEMS.TASKS.CREATE( - MPTEST.TASK_NAME( TEST_SUPPORT.NODE ), - TEST_SUPPORT.NODE, - 2048, - RTEMS.TIMESLICE, - RTEMS.GLOBAL, - MPTEST.TASK_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); - - TEXT_IO.PUT_LINE( "Starting Test_task (Global)" ); - RTEMS.TASKS.START( - MPTEST.TASK_ID( 1 ), - MPTEST.TEST_TASK'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); - - TEXT_IO.PUT_LINE( "Deleting initialization task" ); - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- TEST_TASK --- - - procedure TEST_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - DOTS : RTEMS.UNSIGNED32; - COUNT : RTEMS.UNSIGNED32; - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.PUT_LINE( "Getting SMID of semaphore" ); - loop - - RTEMS.SEMAPHORE.IDENT( - MPTEST.SEMAPHORE_NAME( 1 ), - RTEMS.SEARCH_ALL_NODES, - MPTEST.SEMAPHORE_ID( 1 ), - STATUS - ); - - exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS ); - - end loop; - - if TEST_SUPPORT.NODE = 2 then - - RTEMS.SEMAPHORE.DELETE( - MPTEST.SEMAPHORE_ID( 1 ), - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.ILLEGAL_ON_REMOTE_OBJECT, - "SEMAPHORE_DELETE" - ); - - TEXT_IO.PUT_LINE( - "semaphore_delete correctly returned ILLEGAL_ON_REMOTE_OBJECT" - ); - - end if; - - COUNT := 0; - - loop - - TEST_SUPPORT.PUT_DOT( "p" ); - - RTEMS.SEMAPHORE.OBTAIN( - MPTEST.SEMAPHORE_ID( 1 ), - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - STATUS - ); - - if not RTEMS.IS_STATUS_SUCCESSFUL( STATUS ) then - - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.OBJECT_WAS_DELETED, - "SEMAPHORE_OBTAIN" - ); - - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT_LINE( "Global semaphore deleted" ); - - TEXT_IO.PUT_LINE( "*** END OF TEST 8 ***" ); - - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end if; - - COUNT := COUNT + 1; - - if TEST_SUPPORT.NODE = 1 and then - COUNT >= 1000 then - - RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT_LINE( "Deleting global semaphore" ); - - RTEMS.SEMAPHORE.DELETE( MPTEST.SEMAPHORE_ID( 1 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_DELETE" ); - - TEXT_IO.PUT_LINE( "*** END OF TEST 8 ***" ); - - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end if; - - TEST_SUPPORT.PUT_DOT( "v" ); - - RTEMS.SEMAPHORE.RELEASE( MPTEST.SEMAPHORE_ID( 1 ), STATUS ); - - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE" ); - - end loop; - - end TEST_TASK; - -end MPTEST; diff --git a/c/src/ada-tests/mptests/mp08/mptest.ads b/c/src/ada-tests/mptests/mp08/mptest.ads deleted file mode 100644 index 07df76322e..0000000000 --- a/c/src/ada-tests/mptests/mp08/mptest.ads +++ /dev/null @@ -1,88 +0,0 @@ --- --- MPTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 8 of the RTEMS --- Multiprocessor 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; - -package MPTEST is - --- --- These arrays contain the IDs and NAMEs of all RTEMS tasks created --- by this test. --- - - TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; - TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; - --- --- These arrays contain the IDs and NAMEs of all RTEMS semaphores created --- by this test. --- - - SEMAPHORE_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID; - SEMAPHORE_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME; - --- --- This variable contains the ID of the remote task with which this --- test interacts. --- - - REMOTE_TID : RTEMS.ID; - --- --- This variable contains the node on which the remote task with which --- this test interacts resides. --- - - REMOTE_NODE : RTEMS.UNSIGNED32; - --- --- The number of events to process per dot printed out. --- - - PER_DOT : constant RTEMS.UNSIGNED32 := 100; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- TEST_TASK --- --- DESCRIPTION: --- --- This is the body of the RTEMS tasks which constitute this test. --- - - procedure TEST_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TEST_TASK); - -end MPTEST; diff --git a/c/src/ada-tests/mptests/mp08/node1/Makefile.am b/c/src/ada-tests/mptests/mp08/node1/Makefile.am deleted file mode 100644 index 4e007f25a9..0000000000 --- a/c/src/ada-tests/mptests/mp08/node1/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -AM_ADAFLAGS += -I$(srcdir)/.. - -noinst_PROGRAMS = mp08_ada_mp08_node1 -mp08_ada_mp08_node1_SOURCES = mp08_node1.adb ../mptest.adb config.h -mp08_ada_mp08_node1_SOURCES += ../mptest.ads -mp08_ada_mp08_node1_SOURCES += ../../../support/init.c - -mp08_ada_mp08_node1$(EXEEXT): mp08_node1.adb ../mptest.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_mp08-node1.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/mptests/mp08/node1/ada_mp08-node1.scn b/c/src/ada-tests/mptests/mp08/node1/ada_mp08-node1.scn deleted file mode 100644 index ba9f089e96..0000000000 --- a/c/src/ada-tests/mptests/mp08/node1/ada_mp08-node1.scn +++ /dev/null @@ -1,9 +0,0 @@ -*** TEST 8 -- NODE 1 *** -Creating Test_task (Global) -Starting Test_task (Global) -Deleting initialization task -Getting SMID of semaphore -pvpvpvpvpvp....... -(continued) pvp -Deleting global semaphore -*** END OF TEST 8 *** diff --git a/c/src/ada-tests/mptests/mp08/node1/config.h b/c/src/ada-tests/mptests/mp08/node1/config.h deleted file mode 100644 index 36c9d133e8..0000000000 --- a/c/src/ada-tests/mptests/mp08/node1/config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* 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_MP_APPLICATION -#define CONFIGURE_MP_NODE_NUMBER 1 - -#include "../config_base.h" - -/* end of include file */ diff --git a/c/src/ada-tests/mptests/mp08/node1/mp08_node1.adb b/c/src/ada-tests/mptests/mp08/node1/mp08_node1.adb deleted file mode 100644 index 75a1a985be..0000000000 --- a/c/src/ada-tests/mptests/mp08/node1/mp08_node1.adb +++ /dev/null @@ -1,56 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test MP08_NODE1 of the Multiprocessor --- 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 MPTEST; -with TEST_SUPPORT; - -procedure MP08_NODE1 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, - MPTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end MP08_NODE1; - diff --git a/c/src/ada-tests/mptests/mp08/node2/Makefile.am b/c/src/ada-tests/mptests/mp08/node2/Makefile.am deleted file mode 100644 index 5a804c32e4..0000000000 --- a/c/src/ada-tests/mptests/mp08/node2/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -AM_ADAFLAGS += -I$(srcdir)/.. - -noinst_PROGRAMS = mp08_ada_mp08_node2 -mp08_ada_mp08_node2_SOURCES = mp08_node2.adb ../mptest.adb config.h -mp08_ada_mp08_node2_SOURCES += ../mptest.ads -mp08_ada_mp08_node2_SOURCES += ../../../support/init.c - -mp08_ada_mp08_node2$(EXEEXT): mp08_node2.adb ../mptest.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_mp08-node2.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/mptests/mp08/node2/ada_mp08-node2.scn b/c/src/ada-tests/mptests/mp08/node2/ada_mp08-node2.scn deleted file mode 100644 index 8ac712ae93..0000000000 --- a/c/src/ada-tests/mptests/mp08/node2/ada_mp08-node2.scn +++ /dev/null @@ -1,10 +0,0 @@ -*** TEST 8 -- NODE 2 *** -Creating Test_task (Global) -Starting Test_task (Global) -Deleting initialization task -Getting SMID of semaphore -semaphore_delete correctly returned ILLEGAL_ON_REMOTE_OBJECT -pvpvpvpvpvp....... -(continued) pvp -Global semaphore deleted -*** END OF TEST 8 *** diff --git a/c/src/ada-tests/mptests/mp08/node2/config.h b/c/src/ada-tests/mptests/mp08/node2/config.h deleted file mode 100644 index 47edf66149..0000000000 --- a/c/src/ada-tests/mptests/mp08/node2/config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* 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_MP_APPLICATION -#define CONFIGURE_MP_NODE_NUMBER 2 - -#include "../config_base.h" - -/* end of include file */ diff --git a/c/src/ada-tests/mptests/mp08/node2/mp08_node2.adb b/c/src/ada-tests/mptests/mp08/node2/mp08_node2.adb deleted file mode 100644 index 84dd6b5371..0000000000 --- a/c/src/ada-tests/mptests/mp08/node2/mp08_node2.adb +++ /dev/null @@ -1,56 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test MP08_NODE2 of the Multiprocessor --- 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 MPTEST; -with TEST_SUPPORT; - -procedure MP08_NODE2 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, - MPTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end MP08_NODE2; - diff --git a/c/src/ada-tests/mptests/mp09/Makefile.am b/c/src/ada-tests/mptests/mp09/Makefile.am deleted file mode 100644 index 43bba78abb..0000000000 --- a/c/src/ada-tests/mptests/mp09/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -_SUBDIRS = node1 node2 - -include $(top_srcdir)/../../../testsuites/automake/subdirs.am -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/mptests/mp09/config_base.h b/c/src/ada-tests/mptests/mp09/config_base.h deleted file mode 100644 index c1b8f24e86..0000000000 --- a/c/src/ada-tests/mptests/mp09/config_base.h +++ /dev/null @@ -1,28 +0,0 @@ -/* config_base.h - * - * This include file defines all of the Configuration Table for this test - * EXCEPT the NODE NUMBER. - * - * 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. - */ - - - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_TASKS 2 - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/mptests/mp09/mptest.adb b/c/src/ada-tests/mptests/mp09/mptest.adb deleted file mode 100644 index f68268788d..0000000000 --- a/c/src/ada-tests/mptests/mp09/mptest.adb +++ /dev/null @@ -1,373 +0,0 @@ --- --- MPTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation for Test 9 of the RTEMS --- Multiprocessor 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 INTERFACES; use INTERFACES; -with RTEMS; -with RTEMS.MESSAGE_QUEUE; -with RTEMS.OBJECT; -with RTEMS.TASKS; -with TEST_SUPPORT; -with TEXT_IO; -with UNSIGNED32_IO; - -package body MPTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT( "*** TEST 9 -- NODE " ); - UNSIGNED32_IO.PUT( - TEST_SUPPORT.NODE, - WIDTH => 1 - ); - TEXT_IO.PUT_LINE( " ***" ); - - MPTEST.RECEIVE_BUFFER := - RTEMS.TO_BUFFER_POINTER( MPTEST.RECEIVE_BUFFER_AREA'ADDRESS ); - - MPTEST.BUFFER_1 := - RTEMS.TO_BUFFER_POINTER( MPTEST.BUFFER_AREA_1'ADDRESS ); - - MPTEST.BUFFER_2 := - RTEMS.TO_BUFFER_POINTER( MPTEST.BUFFER_AREA_2'ADDRESS ); - - MPTEST.BUFFER_3 := - RTEMS.TO_BUFFER_POINTER( MPTEST.BUFFER_AREA_3'ADDRESS ); - - MPTEST.BUFFER_4 := - RTEMS.TO_BUFFER_POINTER( MPTEST.BUFFER_AREA_4'ADDRESS ); - - MPTEST.FILL_BUFFER( "123456789012345 ", MPTEST.BUFFER_AREA_1 ); - MPTEST.FILL_BUFFER( "abcdefghijklmno ", MPTEST.BUFFER_AREA_2 ); - MPTEST.FILL_BUFFER( "ABCDEFGHIJKLMNO ", MPTEST.BUFFER_AREA_3 ); - MPTEST.FILL_BUFFER( "PQRSTUVWXYZ(){} ", MPTEST.BUFFER_AREA_4 ); - - MPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( '1', '1', '1', ' ' ); - MPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( '2', '2', '2', ' ' ); - - MPTEST.QUEUE_NAME( 1 ) := RTEMS.BUILD_NAME( 'M', 'S', 'G', ' ' ); - - if TEST_SUPPORT.NODE = 1 then - - TEXT_IO.PUT_LINE( "Creating Message Queue (Global)" ); - RTEMS.MESSAGE_QUEUE.CREATE( - MPTEST.QUEUE_NAME( 1 ), - 3, - RTEMS.GLOBAL + RTEMS.LIMIT, - MPTEST.QUEUE_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_CREATE" ); - - end if; - - TEXT_IO.PUT_LINE( "Creating Test_task (local)" ); - RTEMS.TASKS.CREATE( - MPTEST.TASK_NAME( TEST_SUPPORT.NODE ), - TEST_SUPPORT.NODE, - 2048, - RTEMS.TIMESLICE, - RTEMS.DEFAULT_ATTRIBUTES, - MPTEST.TASK_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); - - TEXT_IO.PUT_LINE( "Starting Test_task (local)" ); - RTEMS.TASKS.START( - MPTEST.TASK_ID( 1 ), - MPTEST.TEST_TASK'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); - - TEXT_IO.PUT_LINE( "Deleting initialization task" ); - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- SEND_MESSAGES --- - - procedure SEND_MESSAGES is - BROADCAST_COUNT : RTEMS.UNSIGNED32; - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.PUT( "message_queue_send : " ); - MPTEST.PUT_BUFFER( MPTEST.BUFFER_AREA_1 ); - TEXT_IO.NEW_LINE; - - RTEMS.MESSAGE_QUEUE.SEND( - MPTEST.QUEUE_ID( 1 ), - MPTEST.BUFFER_1, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); - - TEXT_IO.PUT_LINE( "Delaying for a second" ); - RTEMS.TASKS.WAKE_AFTER( - 1 * TEST_SUPPORT.TICKS_PER_SECOND, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - TEXT_IO.PUT( "message_queue_urgent : " ); - MPTEST.PUT_BUFFER( MPTEST.BUFFER_AREA_2 ); - TEXT_IO.NEW_LINE; - - RTEMS.MESSAGE_QUEUE.URGENT( - MPTEST.QUEUE_ID( 1 ), - MPTEST.BUFFER_2, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_URGENT" ); - - TEXT_IO.PUT_LINE( "Delaying for a second" ); - RTEMS.TASKS.WAKE_AFTER( - 1 * TEST_SUPPORT.TICKS_PER_SECOND, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - TEXT_IO.PUT( "message_queue_broadcast : " ); - MPTEST.PUT_BUFFER( MPTEST.BUFFER_AREA_3 ); - TEXT_IO.NEW_LINE; - - RTEMS.MESSAGE_QUEUE.BROADCAST( - MPTEST.QUEUE_ID( 1 ), - MPTEST.BUFFER_3, - BROADCAST_COUNT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_BROADCAST" ); - - TEXT_IO.PUT_LINE( "Delaying for a second" ); - RTEMS.TASKS.WAKE_AFTER( - 1 * TEST_SUPPORT.TICKS_PER_SECOND, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - end SEND_MESSAGES; - --- --- RECEIVE_MESSAGES --- - - procedure RECEIVE_MESSAGES is - INDEX : RTEMS.UNSIGNED32; - STATUS : RTEMS.STATUS_CODES; - begin - - for INDEX in 1 .. 3 - loop - - TEXT_IO.PUT_LINE( "Receiving message ..." ); - RTEMS.MESSAGE_QUEUE.RECEIVE( - MPTEST.QUEUE_ID( 1 ), - MPTEST.RECEIVE_BUFFER, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" ); - - TEXT_IO.PUT( "Received : " ); - MPTEST.PUT_BUFFER( MPTEST.RECEIVE_BUFFER_AREA ); - TEXT_IO.NEW_LINE; - - end loop; - - TEXT_IO.PUT_LINE( "Receiver delaying for a second" ); - - RTEMS.TASKS.WAKE_AFTER( 1 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - end RECEIVE_MESSAGES; - --- --- FILL_BUFFER --- - --- --- Depends on tricks to make the copy work. --- - - procedure FILL_BUFFER ( - SOURCE : in STRING; - BUFFER : out RTEMS.BUFFER - ) is - SOURCE_BUFFER : RTEMS.BUFFER_POINTER; - begin - - SOURCE_BUFFER := RTEMS.TO_BUFFER_POINTER( - SOURCE( SOURCE'FIRST )'ADDRESS - ); - - BUFFER.FIELD1 := SOURCE_BUFFER.FIELD1; - BUFFER.FIELD2 := SOURCE_BUFFER.FIELD2; - BUFFER.FIELD3 := SOURCE_BUFFER.FIELD3; - BUFFER.FIELD4 := SOURCE_BUFFER.FIELD4; - - end FILL_BUFFER; - --- --- PUT_BUFFER --- - --- --- Depends on tricks to make the output work. --- - - procedure PUT_BUFFER ( - BUFFER : in RTEMS.BUFFER - ) is - begin - - TEST_SUPPORT.PUT_NAME( BUFFER.FIELD1, FALSE ); - TEST_SUPPORT.PUT_NAME( BUFFER.FIELD2, FALSE ); - TEST_SUPPORT.PUT_NAME( BUFFER.FIELD3, FALSE ); - TEST_SUPPORT.PUT_NAME( BUFFER.FIELD4, FALSE ); - - end PUT_BUFFER; - --- --- TEST_TASK --- - - procedure TEST_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - COUNT : RTEMS.UNSIGNED32; - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.TASKS.WAKE_AFTER( 1 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - TEXT_IO.PUT_LINE( "Getting QID of message queue" ); - - loop - - RTEMS.MESSAGE_QUEUE.IDENT( - MPTEST.QUEUE_NAME( 1 ), - RTEMS.SEARCH_ALL_NODES, - MPTEST.QUEUE_ID( 1 ), - STATUS - ); - - exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS ); - - end loop; - - if TEST_SUPPORT.NODE = 2 then - - RTEMS.MESSAGE_QUEUE.DELETE( MPTEST.QUEUE_ID( 1 ), STATUS ); - - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.ILLEGAL_ON_REMOTE_OBJECT, - "MESSAGE_QUEUE_DELETE" - ); - - TEXT_IO.PUT_LINE( - "message_queue_delete correctly returned ILLEGAL_ON_REMOTE_OBJECT" - ); - - MPTEST.SEND_MESSAGES; - - MPTEST.RECEIVE_MESSAGES; - - TEXT_IO.PUT_LINE( "Flushing remote empty queue" ); - RTEMS.MESSAGE_QUEUE.FLUSH( MPTEST.QUEUE_ID( 1 ), COUNT, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_FLUSH" ); - UNSIGNED32_IO.PUT( COUNT, WIDTH => 1 ); - TEXT_IO.PUT_LINE( - " messages were flushed from remote empty queue" - ); - - TEXT_IO.PUT_LINE( - "Send messages to be flushed from remote queue" - ); - RTEMS.MESSAGE_QUEUE.SEND( - MPTEST.QUEUE_ID( 1 ), - MPTEST.BUFFER_1, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); - - TEXT_IO.PUT_LINE( "Flushing remote queue" ); - RTEMS.MESSAGE_QUEUE.FLUSH( MPTEST.QUEUE_ID( 1 ), COUNT, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_FLUSH" ); - UNSIGNED32_IO.PUT( COUNT, WIDTH => 1 ); - TEXT_IO.PUT_LINE( - " messages were flushed from the remote queue" - ); - - TEXT_IO.PUT_LINE( "Waiting for message queue to be deleted" ); - RTEMS.MESSAGE_QUEUE.RECEIVE( - MPTEST.QUEUE_ID( 1 ), - MPTEST.RECEIVE_BUFFER, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.OBJECT_WAS_DELETED, - "MESSAGE_QUEUE_FLUSH" - ); - - else - - MPTEST.RECEIVE_MESSAGES; - - MPTEST.SEND_MESSAGES; - - RTEMS.TASKS.WAKE_AFTER( - 5 * TEST_SUPPORT.TICKS_PER_SECOND, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - RTEMS.MESSAGE_QUEUE.DELETE( MPTEST.QUEUE_ID( 1 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_DELETE" ); - - end if; - - TEXT_IO.PUT_LINE( "*** END OF TEST 9 ***" ); - - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end TEST_TASK; - -end MPTEST; diff --git a/c/src/ada-tests/mptests/mp09/mptest.ads b/c/src/ada-tests/mptests/mp09/mptest.ads deleted file mode 100644 index 360aebb491..0000000000 --- a/c/src/ada-tests/mptests/mp09/mptest.ads +++ /dev/null @@ -1,150 +0,0 @@ --- --- MPTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 9 of the RTEMS --- Multiprocessor 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; - -package MPTEST is - --- --- These arrays contain the IDs and NAMEs of all RTEMS tasks created --- by this test. --- - - TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; - TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; - --- --- These arrays contain the IDs and NAMEs of all RTEMS message --- queues created by this test. --- - - QUEUE_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID; - QUEUE_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME; - --- --- The following are message buffers used to contain the test messages --- and pointers to those buffers. --- - - RECEIVE_BUFFER_AREA : RTEMS.BUFFER; - BUFFER_AREA_1 : RTEMS.BUFFER; - BUFFER_AREA_2 : RTEMS.BUFFER; - BUFFER_AREA_3 : RTEMS.BUFFER; - BUFFER_AREA_4 : RTEMS.BUFFER; - - RECEIVE_BUFFER : RTEMS.BUFFER_POINTER; - BUFFER_1 : RTEMS.BUFFER_POINTER; - BUFFER_2 : RTEMS.BUFFER_POINTER; - BUFFER_3 : RTEMS.BUFFER_POINTER; - BUFFER_4 : RTEMS.BUFFER_POINTER; - --- --- This variable contains the ID of the remote task with which this --- test interacts. --- - - REMOTE_TID : RTEMS.ID; - --- --- This variable contains the node on which the remote task with which --- this test interacts resides. --- - - REMOTE_NODE : RTEMS.UNSIGNED32; - --- --- The number of events to process per dot printed out. --- - - PER_DOT : constant RTEMS.UNSIGNED32 := 100; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- SEND_MESSAGES --- --- This subprogram prints and sends a sequence of three test messages. --- One of the messages is sent, one is urgent, and one is broadcast. --- A one second pause is between each the sending of each message. --- - - procedure SEND_MESSAGES; - --- --- RECEIVE_MESSAGES --- --- This subprogram receives and prints a sequence of three test messages. --- - - procedure RECEIVE_MESSAGES; - --- --- FILL_BUFFER --- --- DESCRIPTION: --- --- This subprogram takes the SOURCE input string and places --- up to the first sixteen characters of that string into --- the message BUFFER. --- - - procedure FILL_BUFFER ( - SOURCE : in STRING; - BUFFER : out RTEMS.BUFFER - ); - --- --- PUT_BUFFER --- --- DESCRIPTION: --- --- This subprogram prints the specified message BUFFER. --- - - procedure PUT_BUFFER ( - BUFFER : in RTEMS.BUFFER - ); - --- --- TEST_TASK --- --- DESCRIPTION: --- --- This is the body of the RTEMS tasks which constitute this test. --- - - procedure TEST_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TEST_TASK); - -end MPTEST; diff --git a/c/src/ada-tests/mptests/mp09/node1/Makefile.am b/c/src/ada-tests/mptests/mp09/node1/Makefile.am deleted file mode 100644 index bf40a63d59..0000000000 --- a/c/src/ada-tests/mptests/mp09/node1/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -AM_ADAFLAGS += -I$(srcdir)/.. - -noinst_PROGRAMS = mp09_ada_mp09_node1 -mp09_ada_mp09_node1_SOURCES = mp09_node1.adb ../mptest.adb config.h -mp09_ada_mp09_node1_SOURCES += ../mptest.ads -mp09_ada_mp09_node1_SOURCES += ../../../support/init.c - -mp09_ada_mp09_node1$(EXEEXT): mp09_node1.adb ../mptest.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_mp09-node1.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/mptests/mp09/node1/ada_mp09-node1.scn b/c/src/ada-tests/mptests/mp09/node1/ada_mp09-node1.scn deleted file mode 100644 index 167d6e18a5..0000000000 --- a/c/src/ada-tests/mptests/mp09/node1/ada_mp09-node1.scn +++ /dev/null @@ -1,20 +0,0 @@ -*** TEST 9 -- NODE 1 *** -Creating Message Queue (Global) -Creating Test_task (local) -Starting Test_task (local) -Deleting initialization task -Getting QID of message queue -Receiving message ... -Received : 123456789012345 -Receiving message ... -Received : abcdefghijklmno -Receiving message ... -Received : ABCDEFGHIJKLMNO -Receiver delaying for a second -message_queue_send : 123456789012345 -Delaying for a second -message_queue_urgent : abcdefghijklmno -Delaying for a second -message_queue_broadcast : ABCDEFGHIJKLMNO -Delaying for a second -*** END OF TEST 9 *** diff --git a/c/src/ada-tests/mptests/mp09/node1/config.h b/c/src/ada-tests/mptests/mp09/node1/config.h deleted file mode 100644 index 36c9d133e8..0000000000 --- a/c/src/ada-tests/mptests/mp09/node1/config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* 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_MP_APPLICATION -#define CONFIGURE_MP_NODE_NUMBER 1 - -#include "../config_base.h" - -/* end of include file */ diff --git a/c/src/ada-tests/mptests/mp09/node1/mp09_node1.adb b/c/src/ada-tests/mptests/mp09/node1/mp09_node1.adb deleted file mode 100644 index df2a6ab344..0000000000 --- a/c/src/ada-tests/mptests/mp09/node1/mp09_node1.adb +++ /dev/null @@ -1,56 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test MP09_NODE1 of the Multiprocessor --- 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 MPTEST; -with TEST_SUPPORT; - -procedure MP09_NODE1 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, - MPTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end MP09_NODE1; - diff --git a/c/src/ada-tests/mptests/mp09/node2/Makefile.am b/c/src/ada-tests/mptests/mp09/node2/Makefile.am deleted file mode 100644 index b4b631cda2..0000000000 --- a/c/src/ada-tests/mptests/mp09/node2/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -AM_ADAFLAGS += -I$(srcdir)/.. - -noinst_PROGRAMS = mp09_ada_mp09_node2 -mp09_ada_mp09_node2_SOURCES = mp09_node2.adb ../mptest.adb config.h -mp09_ada_mp09_node2_SOURCES += ../mptest.ads -mp09_ada_mp09_node2_SOURCES += ../../../support/init.c - -mp09_ada_mp09_node2$(EXEEXT): mp09_node2.adb ../mptest.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_mp09-node2.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/mptests/mp09/node2/ada_mp09-node2.scn b/c/src/ada-tests/mptests/mp09/node2/ada_mp09-node2.scn deleted file mode 100644 index 4cd8a7bff7..0000000000 --- a/c/src/ada-tests/mptests/mp09/node2/ada_mp09-node2.scn +++ /dev/null @@ -1,26 +0,0 @@ -*** TEST 9 -- NODE 2 *** -Creating Test_task (local) -Starting Test_task (local) -Deleting initialization task -Getting QID of message queue -message_queue_delete correctly returned ILLEGAL_ON_REMOTE_OBJECT -message_queue_send : 123456789012345 -Delaying for a second -message_queue_urgent : abcdefghijklmno -Delaying for a second -message_queue_broadcast : ABCDEFGHIJKLMNO -Delaying for a second -Receiving message ... -Received : 123456789012345 -Receiving message ... -Received : abcdefghijklmno -Receiving message ... -Received : ABCDEFGHIJKLMNO -Receiver delaying for a second -Flushing remote empty queue -0 messages were flushed from remote empty queue -Send messages to be flushed from remote queue -Flushing remote queue -1 messages were flushed from the remote queue -Waiting for message queue to be deleted -*** END OF TEST 9 *** diff --git a/c/src/ada-tests/mptests/mp09/node2/config.h b/c/src/ada-tests/mptests/mp09/node2/config.h deleted file mode 100644 index 47edf66149..0000000000 --- a/c/src/ada-tests/mptests/mp09/node2/config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* 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_MP_APPLICATION -#define CONFIGURE_MP_NODE_NUMBER 2 - -#include "../config_base.h" - -/* end of include file */ diff --git a/c/src/ada-tests/mptests/mp09/node2/mp09_node2.adb b/c/src/ada-tests/mptests/mp09/node2/mp09_node2.adb deleted file mode 100644 index adedcd20c6..0000000000 --- a/c/src/ada-tests/mptests/mp09/node2/mp09_node2.adb +++ /dev/null @@ -1,56 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test MP09_NODE2 of the Multiprocessor --- 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 MPTEST; -with TEST_SUPPORT; - -procedure MP09_NODE2 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, - MPTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end MP09_NODE2; - diff --git a/c/src/ada-tests/mptests/mp10/Makefile.am b/c/src/ada-tests/mptests/mp10/Makefile.am deleted file mode 100644 index 43bba78abb..0000000000 --- a/c/src/ada-tests/mptests/mp10/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -_SUBDIRS = node1 node2 - -include $(top_srcdir)/../../../testsuites/automake/subdirs.am -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/mptests/mp10/config_base.h b/c/src/ada-tests/mptests/mp10/config_base.h deleted file mode 100644 index c1b8f24e86..0000000000 --- a/c/src/ada-tests/mptests/mp10/config_base.h +++ /dev/null @@ -1,28 +0,0 @@ -/* config_base.h - * - * This include file defines all of the Configuration Table for this test - * EXCEPT the NODE NUMBER. - * - * 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. - */ - - - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_TASKS 2 - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/mptests/mp10/mptest.adb b/c/src/ada-tests/mptests/mp10/mptest.adb deleted file mode 100644 index d773976a3e..0000000000 --- a/c/src/ada-tests/mptests/mp10/mptest.adb +++ /dev/null @@ -1,295 +0,0 @@ --- --- MPTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation for Test 10 of the RTEMS --- Multiprocessor 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 INTERFACES; use INTERFACES; -with RTEMS; -with RTEMS.MESSAGE_QUEUE; -with RTEMS.SEMAPHORE; -with RTEMS.TASKS; -with TEST_SUPPORT; -with TEXT_IO; -with UNSIGNED32_IO; - -package body MPTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT( "*** TEST 10 -- NODE " ); - UNSIGNED32_IO.PUT( - TEST_SUPPORT.NODE, - WIDTH => 1 - ); - TEXT_IO.PUT_LINE( " ***" ); - - - MPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); - MPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' ); - MPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'S', 'A', '3', ' ' ); - - MPTEST.QUEUE_NAME( 1 ) := RTEMS.BUILD_NAME( 'M', 'S', 'G', ' ' ); - - MPTEST.SEMAPHORE_NAME( 1 ) := RTEMS.BUILD_NAME( 'S', 'E', 'M', ' ' ); - - if TEST_SUPPORT.NODE = 1 then - - TEXT_IO.PUT_LINE( "Creating Message Queue (Global)" ); - RTEMS.MESSAGE_QUEUE.CREATE( - MPTEST.QUEUE_NAME( 1 ), - 3, - RTEMS.GLOBAL + RTEMS.LIMIT, - MPTEST.QUEUE_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_CREATE" ); - - TEXT_IO.PUT_LINE( "Creating Semaphore (Global)" ); - RTEMS.SEMAPHORE.CREATE( - MPTEST.SEMAPHORE_NAME( 1 ), - 0, - RTEMS.GLOBAL + RTEMS.PRIORITY, - MPTEST.SEMAPHORE_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE" ); - - RTEMS.TASKS.WAKE_AFTER( 10 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - else - - TEXT_IO.PUT_LINE( "Creating Test_task 1 (local)" ); - RTEMS.TASKS.CREATE( - MPTEST.TASK_NAME( 1 ), - 1, - 2048, - RTEMS.TIMESLICE, - RTEMS.DEFAULT_ATTRIBUTES, - MPTEST.TASK_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); - - TEXT_IO.PUT_LINE( "Starting Test_task 1 (local)" ); - RTEMS.TASKS.START( - MPTEST.TASK_ID( 1 ), - MPTEST.TEST_TASK_1'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); - - TEXT_IO.PUT_LINE( "Creating Test_task 2 (local)" ); - RTEMS.TASKS.CREATE( - MPTEST.TASK_NAME( 2 ), - 1, - 2048, - RTEMS.TIMESLICE, - RTEMS.DEFAULT_ATTRIBUTES, - MPTEST.TASK_ID( 2 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); - - TEXT_IO.PUT_LINE( "Starting Test_task 2 (local)" ); - RTEMS.TASKS.START( - MPTEST.TASK_ID( 2 ), - MPTEST.TEST_TASK_2'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); - - TEXT_IO.PUT_LINE( "Creating Test_task 3 (local)" ); - RTEMS.TASKS.CREATE( - MPTEST.TASK_NAME( 3 ), - 1, - 2048, - RTEMS.TIMESLICE, - RTEMS.DEFAULT_ATTRIBUTES, - MPTEST.TASK_ID( 3 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); - - TEXT_IO.PUT_LINE( "Starting Test_task 3 (local)" ); - RTEMS.TASKS.START( - MPTEST.TASK_ID( 3 ), - MPTEST.TEST_TASK_3'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); - - TEXT_IO.PUT_LINE( "Sleeping for 1 second ..." ); - RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - TEXT_IO.PUT_LINE( "Deleting Test_task 2" ); - RTEMS.TASKS.DELETE( MPTEST.TASK_ID( 2 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF 2" ); - - TEXT_IO.PUT_LINE( "Deleting Test_task 1" ); - RTEMS.TASKS.DELETE( MPTEST.TASK_ID( 1 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF 1" ); - - TEXT_IO.PUT_LINE( "Restarting Test_task 3" ); - RTEMS.TASKS.RESTART( MPTEST.TASK_ID( 3 ), 1, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESTART OF 3" ); - - end if; - - TEXT_IO.PUT_LINE( "*** END OF TEST 10 ***" ); - - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end INIT; - --- --- TEST_TASK_1 --- - - procedure TEST_TASK_1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - COUNT : RTEMS.UNSIGNED32; - RECEIVE_BUFFER_AREA : RTEMS.BUFFER; - RECEIVE_BUFFER : RTEMS.BUFFER_POINTER; - STATUS : RTEMS.STATUS_CODES; - begin - - RECEIVE_BUFFER := - RTEMS.TO_BUFFER_POINTER( RECEIVE_BUFFER_AREA'ADDRESS ); - - TEXT_IO.PUT_LINE( "Getting QID of message queue" ); - - loop - - RTEMS.MESSAGE_QUEUE.IDENT( - MPTEST.QUEUE_NAME( 1 ), - RTEMS.SEARCH_ALL_NODES, - MPTEST.QUEUE_ID( 1 ), - STATUS - ); - - exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS ); - - end loop; - - TEXT_IO.PUT_LINE( "Attempting to receive message ..." ); - RTEMS.MESSAGE_QUEUE.RECEIVE( - MPTEST.QUEUE_ID( 1 ), - RECEIVE_BUFFER, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" ); - - end TEST_TASK_1; - --- --- TEST_TASK_2 --- - - procedure TEST_TASK_2 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.PUT_LINE( "Getting SMID of semaphore" ); - - loop - - RTEMS.SEMAPHORE.IDENT( - MPTEST.SEMAPHORE_NAME( 1 ), - RTEMS.SEARCH_ALL_NODES, - MPTEST.SEMAPHORE_ID( 1 ), - STATUS - ); - - exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS ); - - end loop; - - TEXT_IO.PUT_LINE( "Attempting to acquire semaphore ..." ); - RTEMS.SEMAPHORE.OBTAIN( - MPTEST.SEMAPHORE_ID( 1 ), - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN" ); - - end TEST_TASK_2; - --- --- TEST_TASK_3 --- - - procedure TEST_TASK_3 ( - RESTART : in RTEMS.TASKS.ARGUMENT - ) is - STATUS : RTEMS.STATUS_CODES; - begin - - if RESTART = 1 then - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE" ); - - end if; - - TEXT_IO.PUT_LINE( "Getting SMID of semaphore" ); - - loop - - RTEMS.SEMAPHORE.IDENT( - MPTEST.SEMAPHORE_NAME( 1 ), - RTEMS.SEARCH_ALL_NODES, - MPTEST.SEMAPHORE_ID( 1 ), - STATUS - ); - - exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS ); - - end loop; - - TEXT_IO.PUT_LINE( "Attempting to acquire semaphore ..." ); - RTEMS.SEMAPHORE.OBTAIN( - MPTEST.SEMAPHORE_ID( 1 ), - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN" ); - - end TEST_TASK_3; - -end MPTEST; diff --git a/c/src/ada-tests/mptests/mp10/mptest.ads b/c/src/ada-tests/mptests/mp10/mptest.ads deleted file mode 100644 index 05764ebf0b..0000000000 --- a/c/src/ada-tests/mptests/mp10/mptest.ads +++ /dev/null @@ -1,122 +0,0 @@ --- --- MPTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 10 of the RTEMS --- Multiprocessor 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; - -package MPTEST is - --- --- These arrays contain the IDs and NAMEs of all RTEMS tasks created --- by this test. --- - - TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; - TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; - --- --- These arrays contain the IDs and NAMEs of all RTEMS message --- queues created by this test. --- - - QUEUE_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID; - QUEUE_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME; - --- --- These arrays contain the IDs and NAMEs of all RTEMS semaphore --- created by this test. --- - - SEMAPHORE_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID; - SEMAPHORE_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME; - --- --- This variable contains the ID of the remote task with which this --- test interacts. --- - - REMOTE_TID : RTEMS.ID; - --- --- This variable contains the node on which the remote task with which --- this test interacts resides. --- - - REMOTE_NODE : RTEMS.UNSIGNED32; - --- --- The number of events to process per dot printed out. --- - - PER_DOT : constant RTEMS.UNSIGNED32 := 100; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- TEST_TASK_1 --- --- DESCRIPTION: --- --- This is the body of one of the RTEMS tasks which constitute this test. --- - - procedure TEST_TASK_1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TEST_TASK_1); - --- --- TEST_TASK_2 --- --- DESCRIPTION: --- --- This is the body of one of the RTEMS tasks which constitute this test. --- - - procedure TEST_TASK_2 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TEST_TASK_2); - --- --- TEST_TASK_3 --- --- DESCRIPTION: --- --- This is the body of one of the RTEMS tasks which constitute this test. --- - - procedure TEST_TASK_3 ( - RESTART : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TEST_TASK_3); - -end MPTEST; diff --git a/c/src/ada-tests/mptests/mp10/node1/Makefile.am b/c/src/ada-tests/mptests/mp10/node1/Makefile.am deleted file mode 100644 index 49a7eadab7..0000000000 --- a/c/src/ada-tests/mptests/mp10/node1/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -AM_ADAFLAGS += -I$(srcdir)/.. - -noinst_PROGRAMS = mp10_ada_mp10_node1 -mp10_ada_mp10_node1_SOURCES = mp10_node1.adb ../mptest.adb config.h -mp10_ada_mp10_node1_SOURCES += ../mptest.ads -mp10_ada_mp10_node1_SOURCES += ../../../support/init.c - -mp10_ada_mp10_node1$(EXEEXT): mp10_node1.adb ../mptest.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_mp10-node1.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/mptests/mp10/node1/ada_mp10-node1.scn b/c/src/ada-tests/mptests/mp10/node1/ada_mp10-node1.scn deleted file mode 100644 index deeafc0a9a..0000000000 --- a/c/src/ada-tests/mptests/mp10/node1/ada_mp10-node1.scn +++ /dev/null @@ -1,4 +0,0 @@ -*** TEST 10 -- NODE 1 *** -Creating Message Queue (Global) -Creating Semaphore (Global) -*** END OF TEST 10 *** diff --git a/c/src/ada-tests/mptests/mp10/node1/config.h b/c/src/ada-tests/mptests/mp10/node1/config.h deleted file mode 100644 index 36c9d133e8..0000000000 --- a/c/src/ada-tests/mptests/mp10/node1/config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* 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_MP_APPLICATION -#define CONFIGURE_MP_NODE_NUMBER 1 - -#include "../config_base.h" - -/* end of include file */ diff --git a/c/src/ada-tests/mptests/mp10/node1/mp10_node1.adb b/c/src/ada-tests/mptests/mp10/node1/mp10_node1.adb deleted file mode 100644 index 9174d74a7d..0000000000 --- a/c/src/ada-tests/mptests/mp10/node1/mp10_node1.adb +++ /dev/null @@ -1,56 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test MP10_NODE1 of the Multiprocessor --- 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 MPTEST; -with TEST_SUPPORT; - -procedure MP10_NODE1 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, - MPTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end MP10_NODE1; - diff --git a/c/src/ada-tests/mptests/mp10/node2/Makefile.am b/c/src/ada-tests/mptests/mp10/node2/Makefile.am deleted file mode 100644 index 11e8f53b29..0000000000 --- a/c/src/ada-tests/mptests/mp10/node2/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -AM_ADAFLAGS += -I$(srcdir)/.. - -noinst_PROGRAMS = mp10_ada_mp10_node2 -mp10_ada_mp10_node2_SOURCES = mp10_node2.adb ../mptest.adb config.h -mp10_ada_mp10_node2_SOURCES += ../mptest.ads -mp10_ada_mp10_node2_SOURCES += ../../../support/init.c - -mp10_ada_mp10_node2$(EXEEXT): mp10_node2.adb ../mptest.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_mp10-node2.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/mptests/mp10/node2/ada_mp10-node2.scn b/c/src/ada-tests/mptests/mp10/node2/ada_mp10-node2.scn deleted file mode 100644 index c0337fdacf..0000000000 --- a/c/src/ada-tests/mptests/mp10/node2/ada_mp10-node2.scn +++ /dev/null @@ -1,18 +0,0 @@ -*** TEST 10 -- NODE 2 *** -Creating Test_task 1 (local) -Starting Test_task 1 (local) -Creating Test_task 2 (local) -Starting Test_task 2 (local) -Creating Test_task 3 (local) -Starting Test_task 3 (local) -Sleeping for 1 second ... -Getting QID of message queue -Attempting to receive message ... -Getting SMID of semaphore -Attempting to acquire semaphore ... -Getting SMID of semaphore -Attempting to acquire semaphore ... -Deleting Test_task 2 -Deleting Test_task 1 -Restarting Test_task 3 -*** END OF TEST 10 *** diff --git a/c/src/ada-tests/mptests/mp10/node2/config.h b/c/src/ada-tests/mptests/mp10/node2/config.h deleted file mode 100644 index 47edf66149..0000000000 --- a/c/src/ada-tests/mptests/mp10/node2/config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* 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_MP_APPLICATION -#define CONFIGURE_MP_NODE_NUMBER 2 - -#include "../config_base.h" - -/* end of include file */ diff --git a/c/src/ada-tests/mptests/mp10/node2/mp10_node2.adb b/c/src/ada-tests/mptests/mp10/node2/mp10_node2.adb deleted file mode 100644 index ee7bb6bcc8..0000000000 --- a/c/src/ada-tests/mptests/mp10/node2/mp10_node2.adb +++ /dev/null @@ -1,56 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test MP10_NODE2 of the Multiprocessor --- 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 MPTEST; -with TEST_SUPPORT; - -procedure MP10_NODE2 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, - MPTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end MP10_NODE2; - diff --git a/c/src/ada-tests/mptests/mp11/Makefile.am b/c/src/ada-tests/mptests/mp11/Makefile.am deleted file mode 100644 index 43bba78abb..0000000000 --- a/c/src/ada-tests/mptests/mp11/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -_SUBDIRS = node1 node2 - -include $(top_srcdir)/../../../testsuites/automake/subdirs.am -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/mptests/mp11/config_base.h b/c/src/ada-tests/mptests/mp11/config_base.h deleted file mode 100644 index c1b8f24e86..0000000000 --- a/c/src/ada-tests/mptests/mp11/config_base.h +++ /dev/null @@ -1,28 +0,0 @@ -/* config_base.h - * - * This include file defines all of the Configuration Table for this test - * EXCEPT the NODE NUMBER. - * - * 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. - */ - - - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_TASKS 2 - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/mptests/mp11/mptest.adb b/c/src/ada-tests/mptests/mp11/mptest.adb deleted file mode 100644 index 9ad9f52fca..0000000000 --- a/c/src/ada-tests/mptests/mp11/mptest.adb +++ /dev/null @@ -1,136 +0,0 @@ --- --- MPTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation for Test 11 of the RTEMS --- Multiprocessor 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 INTERFACES; use INTERFACES; -with RTEMS; -with RTEMS.MESSAGE_QUEUE; -with RTEMS.PARTITION; -with RTEMS.SEMAPHORE; -with RTEMS.TASKS; -with TEST_SUPPORT; -with TEXT_IO; -with UNSIGNED32_IO; - -package body MPTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT( "*** TEST 11 -- NODE " ); - UNSIGNED32_IO.PUT( - TEST_SUPPORT.NODE, - WIDTH => 1 - ); - TEXT_IO.PUT_LINE( " ***" ); - - MPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( '1', '1', '1', ' ' ); - MPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( '2', '2', '2', ' ' ); - - MPTEST.QUEUE_NAME( 1 ) := RTEMS.BUILD_NAME( 'M', 'S', 'G', ' ' ); - - MPTEST.SEMAPHORE_NAME( 1 ) := RTEMS.BUILD_NAME( 'S', 'E', 'M', ' ' ); - - MPTEST.PARTITION_NAME( 1 ) := RTEMS.BUILD_NAME( 'P', 'A', 'R', ' ' ); - - if TEST_SUPPORT.NODE = 1 then - - TEXT_IO.PUT_LINE( "Attempting to create Test_task (Global)" ); - RTEMS.TASKS.CREATE( - MPTEST.TASK_NAME( 1 ), - 1, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.GLOBAL, - MPTEST.TASK_ID( 1 ), - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.TOO_MANY, - "TASK_CREATE" - ); - TEXT_IO.PUT_LINE( "task_create correctly returned TOO_MANY" ); - - TEXT_IO.PUT_LINE( "Attempting to create Message Queue (Global)" ); - RTEMS.MESSAGE_QUEUE.CREATE( - MPTEST.QUEUE_NAME( 1 ), - 3, - RTEMS.GLOBAL + RTEMS.LIMIT, - MPTEST.QUEUE_ID( 1 ), - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.TOO_MANY, - "MESSAGE_QUEUE_CREATE" - ); - TEXT_IO.PUT_LINE( - "message_queue_create correctly returned TOO_MANY" - ); - - TEXT_IO.PUT_LINE( "Creating Semaphore (Global)" ); - RTEMS.SEMAPHORE.CREATE( - MPTEST.SEMAPHORE_NAME( 1 ), - 1, - RTEMS.GLOBAL, - MPTEST.SEMAPHORE_ID( 1 ), - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.TOO_MANY, - "SEMAPHORE_CREATE" - ); - TEXT_IO.PUT_LINE( "semaphore_create correctly returned TOO_MANY" ); - - TEXT_IO.PUT_LINE( "Creating Partition (Global)" ); - RTEMS.PARTITION.CREATE( - MPTEST.PARTITION_NAME( 1 ), - MPTEST.PARTITION_AREA( 0 )'ADDRESS, - 128, - 64, - RTEMS.GLOBAL, - MPTEST.PARTITION_ID( 1 ), - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.TOO_MANY, - "PARTITION_CREATE" - ); - TEXT_IO.PUT_LINE( "partition_create correctly returned TOO_MANY" ); - - end if; - - TEXT_IO.PUT_LINE( "*** END OF TEST 11 ***" ); - - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end INIT; - -end MPTEST; diff --git a/c/src/ada-tests/mptests/mp11/mptest.ads b/c/src/ada-tests/mptests/mp11/mptest.ads deleted file mode 100644 index 2899df8e34..0000000000 --- a/c/src/ada-tests/mptests/mp11/mptest.ads +++ /dev/null @@ -1,79 +0,0 @@ --- --- MPTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 11 of the RTEMS --- Multiprocessor 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; - -package MPTEST is - --- --- These arrays contain the IDs and NAMEs of all RTEMS tasks created --- by this test. --- - - TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; - TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; - --- --- These arrays contain the IDs and NAMEs of all RTEMS message --- queues created by this test. --- - - QUEUE_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID; - QUEUE_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME; - --- --- These arrays contain the IDs and NAMEs of all RTEMS semaphore --- created by this test. --- - - SEMAPHORE_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID; - SEMAPHORE_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME; - --- --- These arrays contain the IDs and NAMEs of all RTEMS partition --- created by this test. --- - - PARTITION_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID; - PARTITION_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME; - --- --- This is the area used for the partition. --- - - PARTITION_AREA : - array ( RTEMS.UNSIGNED32 range 0 .. 1023 ) of RTEMS.UNSIGNED8; - for PARTITION_AREA'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - -end MPTEST; diff --git a/c/src/ada-tests/mptests/mp11/node1/Makefile.am b/c/src/ada-tests/mptests/mp11/node1/Makefile.am deleted file mode 100644 index e791c4f219..0000000000 --- a/c/src/ada-tests/mptests/mp11/node1/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -AM_ADAFLAGS += -I$(srcdir)/.. - -noinst_PROGRAMS = mp11_ada_mp11_node1 -mp11_ada_mp11_node1_SOURCES = mp11_node1.adb ../mptest.adb config.h -mp11_ada_mp11_node1_SOURCES += ../mptest.ads -mp11_ada_mp11_node1_SOURCES += ../../../support/init.c - -mp11_ada_mp11_node1$(EXEEXT): mp11_node1.adb ../mptest.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_mp11-node1.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/mptests/mp11/node1/ada_mp11-node1.scn b/c/src/ada-tests/mptests/mp11/node1/ada_mp11-node1.scn deleted file mode 100644 index 013426bf91..0000000000 --- a/c/src/ada-tests/mptests/mp11/node1/ada_mp11-node1.scn +++ /dev/null @@ -1,10 +0,0 @@ -*** TEST 11 -- NODE 1 *** -Attempting to create Test_task (Global) -task_create correctly returned TOO_MANY -Attempting to create Message Queue (Global) -message_queue_create correctly returned TOO_MANY -Creating Semaphore (Global) -semaphore_create correctly returned TOO_MANY -Creating Partition (Global) -partition_create correctly returned TOO_MANY -*** END OF TEST 11 *** diff --git a/c/src/ada-tests/mptests/mp11/node1/config.h b/c/src/ada-tests/mptests/mp11/node1/config.h deleted file mode 100644 index 36c9d133e8..0000000000 --- a/c/src/ada-tests/mptests/mp11/node1/config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* 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_MP_APPLICATION -#define CONFIGURE_MP_NODE_NUMBER 1 - -#include "../config_base.h" - -/* end of include file */ diff --git a/c/src/ada-tests/mptests/mp11/node1/mp11_node1.adb b/c/src/ada-tests/mptests/mp11/node1/mp11_node1.adb deleted file mode 100644 index 859cbc4ac8..0000000000 --- a/c/src/ada-tests/mptests/mp11/node1/mp11_node1.adb +++ /dev/null @@ -1,56 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test MP11_NODE1 of the Multiprocessor --- 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 MPTEST; -with TEST_SUPPORT; - -procedure MP11_NODE1 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, - MPTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end MP11_NODE1; - diff --git a/c/src/ada-tests/mptests/mp11/node2/Makefile.am b/c/src/ada-tests/mptests/mp11/node2/Makefile.am deleted file mode 100644 index a216808867..0000000000 --- a/c/src/ada-tests/mptests/mp11/node2/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -AM_ADAFLAGS += -I$(srcdir)/.. - -noinst_PROGRAMS = mp11_ada_mp11_node2 -mp11_ada_mp11_node2_SOURCES = mp11_node2.adb ../mptest.adb config.h -mp11_ada_mp11_node2_SOURCES += ../mptest.ads -mp11_ada_mp11_node2_SOURCES += ../../../support/init.c - -mp11_ada_mp11_node2$(EXEEXT): mp11_node2.adb ../mptest.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_mp11-node2.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/mptests/mp11/node2/ada_mp11-node2.scn b/c/src/ada-tests/mptests/mp11/node2/ada_mp11-node2.scn deleted file mode 100644 index 49bd8a3219..0000000000 --- a/c/src/ada-tests/mptests/mp11/node2/ada_mp11-node2.scn +++ /dev/null @@ -1,2 +0,0 @@ -*** TEST 11 -- NODE 2 *** -*** END OF TEST 11 *** diff --git a/c/src/ada-tests/mptests/mp11/node2/config.h b/c/src/ada-tests/mptests/mp11/node2/config.h deleted file mode 100644 index 47edf66149..0000000000 --- a/c/src/ada-tests/mptests/mp11/node2/config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* 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_MP_APPLICATION -#define CONFIGURE_MP_NODE_NUMBER 2 - -#include "../config_base.h" - -/* end of include file */ diff --git a/c/src/ada-tests/mptests/mp11/node2/mp11_node2.adb b/c/src/ada-tests/mptests/mp11/node2/mp11_node2.adb deleted file mode 100644 index 601b21574b..0000000000 --- a/c/src/ada-tests/mptests/mp11/node2/mp11_node2.adb +++ /dev/null @@ -1,56 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test MP11_NODE2 of the Multiprocessor --- 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 MPTEST; -with TEST_SUPPORT; - -procedure MP11_NODE2 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, - MPTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end MP11_NODE2; - diff --git a/c/src/ada-tests/mptests/mp12/Makefile.am b/c/src/ada-tests/mptests/mp12/Makefile.am deleted file mode 100644 index 43bba78abb..0000000000 --- a/c/src/ada-tests/mptests/mp12/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -_SUBDIRS = node1 node2 - -include $(top_srcdir)/../../../testsuites/automake/subdirs.am -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/mptests/mp12/config_base.h b/c/src/ada-tests/mptests/mp12/config_base.h deleted file mode 100644 index c1b8f24e86..0000000000 --- a/c/src/ada-tests/mptests/mp12/config_base.h +++ /dev/null @@ -1,28 +0,0 @@ -/* config_base.h - * - * This include file defines all of the Configuration Table for this test - * EXCEPT the NODE NUMBER. - * - * 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. - */ - - - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_TASKS 2 - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/mptests/mp12/mptest.adb b/c/src/ada-tests/mptests/mp12/mptest.adb deleted file mode 100644 index 74dd2e86bd..0000000000 --- a/c/src/ada-tests/mptests/mp12/mptest.adb +++ /dev/null @@ -1,148 +0,0 @@ --- --- MPTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation for Test 12 of the RTEMS --- Multiprocessor 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 INTERFACES; use INTERFACES; -with RTEMS; -with RTEMS.PARTITION; -with RTEMS.TASKS; -with TEST_SUPPORT; -with TEXT_IO; -with UNSIGNED32_IO; - -package body MPTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - BUFFER_ADDRESS : RTEMS.ADDRESS; - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT( "*** TEST 12 -- NODE " ); - UNSIGNED32_IO.PUT( - TEST_SUPPORT.NODE, - WIDTH => 1 - ); - TEXT_IO.PUT_LINE( " ***" ); - - MPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( '1', '1', '1', ' ' ); - MPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( '2', '2', '2', ' ' ); - - MPTEST.PARTITION_NAME( 1 ) := RTEMS.BUILD_NAME( 'P', 'A', 'R', ' ' ); - - TEXT_IO.PUT_LINE( "Got to the initialization task" ); - - if TEST_SUPPORT.NODE = 2 then - - RTEMS.TASKS.WAKE_AFTER( 1 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - TEXT_IO.PUT_LINE( "Getting ID of remote Partition (Global)" ); - - loop - - RTEMS.PARTITION.IDENT( - MPTEST.PARTITION_NAME( 1 ), - RTEMS.SEARCH_ALL_NODES, - MPTEST.PARTITION_ID( 1 ), - STATUS - ); - - exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS ); - - end loop; - - TEXT_IO.PUT_LINE( - "Attempting to delete remote Partition (Global)" - ); - - RTEMS.PARTITION.DELETE( MPTEST.PARTITION_ID( 1 ), STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.ILLEGAL_ON_REMOTE_OBJECT, - "PARTITION_DELETE" - ); - - TEXT_IO.PUT_LINE( - "partition_delete correctly returned ILLEGAL_ON_REMOTE_OBJECT!!" - ); - - TEXT_IO.PUT_LINE( "Obtaining a buffer from the global partition" ); - - RTEMS.PARTITION.GET_BUFFER( - MPTEST.PARTITION_ID( 1 ), - BUFFER_ADDRESS, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_GET_BUFFER" ); - TEXT_IO.PUT( "Address returned was : " ); - UNSIGNED32_IO.PUT( - RTEMS.SUBTRACT( BUFFER_ADDRESS, RTEMS.NULL_ADDRESS ), - WIDTH => 8, - BASE => 16 - ); - TEXT_IO.NEW_LINE; - - RTEMS.PARTITION.RETURN_BUFFER( - MPTEST.PARTITION_ID( 1 ), - BUFFER_ADDRESS, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_RETURN_BUFFER" ); - - RTEMS.TASKS.WAKE_AFTER( 2 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - else - - TEXT_IO.PUT_LINE( "Creating Partition (Global)" ); - RTEMS.PARTITION.CREATE( - MPTEST.PARTITION_NAME( 1 ), - MPTEST.PARTITION_AREA( 0 )'ADDRESS, - 128, - 64, - RTEMS.GLOBAL, - MPTEST.PARTITION_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_CREATE" ); - - TEXT_IO.PUT_LINE( "Sleeping for three seconds" ); - RTEMS.TASKS.WAKE_AFTER( 3 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - TEXT_IO.PUT_LINE( "Deleting Partition (Global)" ); - RTEMS.PARTITION.DELETE( MPTEST.PARTITION_ID( 1 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_DELETE" ); - - end if; - - TEXT_IO.PUT_LINE( "*** END OF TEST 12 ***" ); - - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end INIT; - -end MPTEST; diff --git a/c/src/ada-tests/mptests/mp12/mptest.ads b/c/src/ada-tests/mptests/mp12/mptest.ads deleted file mode 100644 index dd33b558bb..0000000000 --- a/c/src/ada-tests/mptests/mp12/mptest.ads +++ /dev/null @@ -1,77 +0,0 @@ --- --- MPTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 12 of the RTEMS --- Multiprocessor 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; - -package MPTEST is - --- --- These arrays contain the IDs and NAMEs of all RTEMS tasks created --- by this test. --- - - TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; - TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; - --- --- These arrays contain the IDs and NAMEs of all RTEMS semaphore --- created by this test. --- - - PARTITION_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID; - PARTITION_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME; - --- --- This variable contains the ID of the remote task with which this --- test interacts. --- - - REMOTE_TID : RTEMS.ID; - --- --- This variable contains the node on which the remote task with which --- this test interacts resides. --- - - REMOTE_NODE : RTEMS.UNSIGNED32; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- This is the area used for the partition. --- - - PARTITION_AREA : - array ( RTEMS.UNSIGNED32 range 0 .. 1023 ) of RTEMS.UNSIGNED8; - for PARTITION_AREA'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT; - -end MPTEST; diff --git a/c/src/ada-tests/mptests/mp12/node1/Makefile.am b/c/src/ada-tests/mptests/mp12/node1/Makefile.am deleted file mode 100644 index 22eb8b7ea6..0000000000 --- a/c/src/ada-tests/mptests/mp12/node1/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -AM_ADAFLAGS += -I$(srcdir)/.. - -noinst_PROGRAMS = mp12_ada_mp12_node1 -mp12_ada_mp12_node1_SOURCES = mp12_node1.adb ../mptest.adb config.h -mp12_ada_mp12_node1_SOURCES += ../mptest.ads -mp12_ada_mp12_node1_SOURCES += ../../../support/init.c - -mp12_ada_mp12_node1$(EXEEXT): mp12_node1.adb ../mptest.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_mp12-node1.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/mptests/mp12/node1/ada_mp12-node1.scn b/c/src/ada-tests/mptests/mp12/node1/ada_mp12-node1.scn deleted file mode 100644 index 40646722eb..0000000000 --- a/c/src/ada-tests/mptests/mp12/node1/ada_mp12-node1.scn +++ /dev/null @@ -1,6 +0,0 @@ -*** TEST 12 -- NODE 1 *** -Got to the initialization task -Creating Partition (Global) -Sleeping for three seconds -Deleting Partition (Global) -*** END OF TEST 12 *** diff --git a/c/src/ada-tests/mptests/mp12/node1/config.h b/c/src/ada-tests/mptests/mp12/node1/config.h deleted file mode 100644 index 36c9d133e8..0000000000 --- a/c/src/ada-tests/mptests/mp12/node1/config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* 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_MP_APPLICATION -#define CONFIGURE_MP_NODE_NUMBER 1 - -#include "../config_base.h" - -/* end of include file */ diff --git a/c/src/ada-tests/mptests/mp12/node1/mp12_node1.adb b/c/src/ada-tests/mptests/mp12/node1/mp12_node1.adb deleted file mode 100644 index 04c049cb5d..0000000000 --- a/c/src/ada-tests/mptests/mp12/node1/mp12_node1.adb +++ /dev/null @@ -1,56 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test MP12_NODE1 of the Multiprocessor --- 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 MPTEST; -with TEST_SUPPORT; - -procedure MP12_NODE1 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, - MPTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end MP12_NODE1; - diff --git a/c/src/ada-tests/mptests/mp12/node2/Makefile.am b/c/src/ada-tests/mptests/mp12/node2/Makefile.am deleted file mode 100644 index 889f100010..0000000000 --- a/c/src/ada-tests/mptests/mp12/node2/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -AM_ADAFLAGS += -I$(srcdir)/.. - -noinst_PROGRAMS = mp12_ada_mp12_node2 -mp12_ada_mp12_node2_SOURCES = mp12_node2.adb ../mptest.adb config.h -mp12_ada_mp12_node2_SOURCES += ../mptest.ads -mp12_ada_mp12_node2_SOURCES += ../../../support/init.c - -mp12_ada_mp12_node2$(EXEEXT): mp12_node2.adb ../mptest.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_mp12-node2.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/mptests/mp12/node2/ada_mp12-node2.scn b/c/src/ada-tests/mptests/mp12/node2/ada_mp12-node2.scn deleted file mode 100644 index 2189ae9959..0000000000 --- a/c/src/ada-tests/mptests/mp12/node2/ada_mp12-node2.scn +++ /dev/null @@ -1,9 +0,0 @@ -*** TEST 12 -- NODE 2 *** -Got to the initialization task -Getting ID of remote Partition (Global) -Attempting to delete remote Partition (Global) -partition_delete correctly returned ILLEGAL_ON_REMOTE_OBJECT!! -Obtaining a buffer from the global partition -Address returned was : 0x200f0000 -NOTE: Address printed will probably differ!!! -*** END OF TEST 12 *** diff --git a/c/src/ada-tests/mptests/mp12/node2/config.h b/c/src/ada-tests/mptests/mp12/node2/config.h deleted file mode 100644 index 47edf66149..0000000000 --- a/c/src/ada-tests/mptests/mp12/node2/config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* 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_MP_APPLICATION -#define CONFIGURE_MP_NODE_NUMBER 2 - -#include "../config_base.h" - -/* end of include file */ diff --git a/c/src/ada-tests/mptests/mp12/node2/mp12_node2.adb b/c/src/ada-tests/mptests/mp12/node2/mp12_node2.adb deleted file mode 100644 index 0f046593d6..0000000000 --- a/c/src/ada-tests/mptests/mp12/node2/mp12_node2.adb +++ /dev/null @@ -1,56 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test MP12_NODE2 of the Multiprocessor --- 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 MPTEST; -with TEST_SUPPORT; - -procedure MP12_NODE2 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, - MPTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end MP12_NODE2; - diff --git a/c/src/ada-tests/mptests/mp13/Makefile.am b/c/src/ada-tests/mptests/mp13/Makefile.am deleted file mode 100644 index 43bba78abb..0000000000 --- a/c/src/ada-tests/mptests/mp13/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -_SUBDIRS = node1 node2 - -include $(top_srcdir)/../../../testsuites/automake/subdirs.am -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/mptests/mp13/config_base.h b/c/src/ada-tests/mptests/mp13/config_base.h deleted file mode 100644 index c1b8f24e86..0000000000 --- a/c/src/ada-tests/mptests/mp13/config_base.h +++ /dev/null @@ -1,28 +0,0 @@ -/* config_base.h - * - * This include file defines all of the Configuration Table for this test - * EXCEPT the NODE NUMBER. - * - * 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. - */ - - - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_TASKS 2 - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/mptests/mp13/mptest.adb b/c/src/ada-tests/mptests/mp13/mptest.adb deleted file mode 100644 index 6dc79ab486..0000000000 --- a/c/src/ada-tests/mptests/mp13/mptest.adb +++ /dev/null @@ -1,323 +0,0 @@ --- --- MPTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation for Test 13 of the RTEMS --- Multiprocessor 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 INTERFACES; use INTERFACES; -with RTEMS; -with RTEMS.MESSAGE_QUEUE; -with RTEMS.SEMAPHORE; -with RTEMS.TASKS; -with TEST_SUPPORT; -with TEXT_IO; -with UNSIGNED32_IO; - -package body MPTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT( "*** TEST 13 -- NODE " ); - UNSIGNED32_IO.PUT( - TEST_SUPPORT.NODE, - WIDTH => 1 - ); - TEXT_IO.PUT_LINE( " ***" ); - - MPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( '1', '1', '1', ' ' ); - MPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( '2', '2', '2', ' ' ); - - MPTEST.QUEUE_NAME( 1 ) := RTEMS.BUILD_NAME( 'M', 'S', 'G', ' ' ); - - MPTEST.SEMAPHORE_NAME( 1 ) := RTEMS.BUILD_NAME( 'S', 'E', 'M', ' ' ); - - if TEST_SUPPORT.NODE = 1 then - - TEXT_IO.PUT_LINE( "Creating Message Queue (Global)" ); - RTEMS.MESSAGE_QUEUE.CREATE( - MPTEST.QUEUE_NAME( 1 ), - 3, - RTEMS.GLOBAL + RTEMS.LIMIT, - MPTEST.QUEUE_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_CREATE" ); - - TEXT_IO.PUT_LINE( "Creating Semaphore (Global)" ); - RTEMS.SEMAPHORE.CREATE( - MPTEST.SEMAPHORE_NAME( 1 ), - 1, - RTEMS.GLOBAL + RTEMS.PRIORITY, - MPTEST.SEMAPHORE_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE" ); - - RTEMS.SEMAPHORE.OBTAIN( - MPTEST.SEMAPHORE_ID( 1 ), - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN" ); - - end if; - - TEXT_IO.PUT_LINE( "Creating Test_task 1 (local)" ); - RTEMS.TASKS.CREATE( - MPTEST.TASK_NAME( 1 ), - 1, - 2048, - RTEMS.TIMESLICE, - RTEMS.DEFAULT_ATTRIBUTES, - MPTEST.TASK_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); - - TEXT_IO.PUT_LINE( "Starting Test_task 1 (local)" ); - RTEMS.TASKS.START( - MPTEST.TASK_ID( 1 ), - MPTEST.TEST_TASK_1'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); - - TEXT_IO.PUT_LINE( "Creating Test_task 2 (local)" ); - RTEMS.TASKS.CREATE( - MPTEST.TASK_NAME( 2 ), - 1, - 2048, - RTEMS.TIMESLICE, - RTEMS.DEFAULT_ATTRIBUTES, - MPTEST.TASK_ID( 2 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); - - TEXT_IO.PUT_LINE( "Starting Test_task 2 (local)" ); - RTEMS.TASKS.START( - MPTEST.TASK_ID( 2 ), - MPTEST.TEST_TASK_2'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); - - if TEST_SUPPORT.NODE = 1 then - - RTEMS.TASKS.WAKE_AFTER( 5 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - TEXT_IO.PUT_LINE( "*** END OF TEST 13 ***" ); - - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end if; - - TEXT_IO.PUT_LINE( "Deleting initialization task" ); - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- TEST_TASK_1 --- - - procedure TEST_TASK_1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - COUNT : RTEMS.UNSIGNED32; - RECEIVE_BUFFER_AREA : RTEMS.BUFFER; - RECEIVE_BUFFER : RTEMS.BUFFER_POINTER; - STATUS : RTEMS.STATUS_CODES; - begin - - RECEIVE_BUFFER := - RTEMS.TO_BUFFER_POINTER( RECEIVE_BUFFER_AREA'ADDRESS ); - - TEXT_IO.PUT_LINE( "Getting QID of message queue" ); - - loop - - RTEMS.MESSAGE_QUEUE.IDENT( - MPTEST.QUEUE_NAME( 1 ), - RTEMS.SEARCH_ALL_NODES, - MPTEST.QUEUE_ID( 1 ), - STATUS - ); - - exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS ); - - end loop; - - if TEST_SUPPORT.NODE = 1 then - - TEXT_IO.PUT_LINE( "Receiving message ..." ); - RTEMS.MESSAGE_QUEUE.RECEIVE( - MPTEST.QUEUE_ID( 1 ), - RECEIVE_BUFFER, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - STATUS - ); - TEXT_IO.PUT_LINE( "How did I get back from here???" ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" ); - - end if; - - RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - TEXT_IO.PUT_LINE( "Receiving message ..." ); - RTEMS.MESSAGE_QUEUE.RECEIVE( - MPTEST.QUEUE_ID( 1 ), - RECEIVE_BUFFER, - RTEMS.DEFAULT_OPTIONS, - 2 * TEST_SUPPORT.TICKS_PER_SECOND, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.TIMEOUT, - "MESSAGE_QUEUE_RECEIVE" - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.TIMEOUT, - "MESSAGE_QUEUE_OBTAIN" - ); - - TEXT_IO.PUT_LINE( - "message_queue_receive correctly returned TIMEOUT" - ); - - TEXT_IO.PUT_LINE( "Deleting self" ); - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end TEST_TASK_1; - --- --- TEST_TASK_2 --- - - procedure TEST_TASK_2 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.PUT_LINE( "Getting SMID of semaphore" ); - - loop - - RTEMS.SEMAPHORE.IDENT( - MPTEST.SEMAPHORE_NAME( 1 ), - RTEMS.SEARCH_ALL_NODES, - MPTEST.SEMAPHORE_ID( 1 ), - STATUS - ); - - exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS ); - - end loop; - - if TEST_SUPPORT.NODE = 1 then - - RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - TEXT_IO.PUT_LINE( "Releasing semaphore ..." ); - RTEMS.SEMAPHORE.RELEASE( MPTEST.SEMAPHORE_ID( 1 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE" ); - - RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND / 2, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - TEXT_IO.PUT_LINE( "Getting semaphore ..." ); - RTEMS.SEMAPHORE.OBTAIN( - MPTEST.SEMAPHORE_ID( 1 ), - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN" ); - - TEXT_IO.PUT_LINE( "Getting semaphore ..." ); - RTEMS.SEMAPHORE.OBTAIN( - MPTEST.SEMAPHORE_ID( 1 ), - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - STATUS - ); - TEXT_IO.PUT_LINE( "How did I get back from here???" ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN" ); - - end if; - - RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND / 2, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - TEXT_IO.PUT_LINE( "Getting semaphore ..." ); - RTEMS.SEMAPHORE.OBTAIN( - MPTEST.SEMAPHORE_ID( 1 ), - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN" ); - - TEXT_IO.PUT_LINE( "Releasing semaphore ..." ); - RTEMS.SEMAPHORE.RELEASE( MPTEST.SEMAPHORE_ID( 1 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE" ); - - RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - TEXT_IO.PUT_LINE( "Getting semaphore ..." ); - RTEMS.SEMAPHORE.OBTAIN( - MPTEST.SEMAPHORE_ID( 1 ), - RTEMS.DEFAULT_OPTIONS, - 2 * TEST_SUPPORT.TICKS_PER_SECOND, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.TIMEOUT, - "SEMAPHORE_OBTAIN" - ); - TEXT_IO.PUT_LINE( "semaphore_obtain correctly returned TIMEOUT" ); - - TEXT_IO.PUT_LINE( "*** END OF TEST 13 ***" ); - - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end TEST_TASK_2; - -end MPTEST; diff --git a/c/src/ada-tests/mptests/mp13/mptest.ads b/c/src/ada-tests/mptests/mp13/mptest.ads deleted file mode 100644 index 8caa2347c9..0000000000 --- a/c/src/ada-tests/mptests/mp13/mptest.ads +++ /dev/null @@ -1,103 +0,0 @@ --- --- MPTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 13 of the RTEMS --- Multiprocessor 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; - -package MPTEST is - --- --- These arrays contain the IDs and NAMEs of all RTEMS tasks created --- by this test. --- - - TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; - TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; - --- --- These arrays contain the IDs and NAMEs of all RTEMS message --- queues created by this test. --- - - QUEUE_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID; - QUEUE_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME; - --- --- These arrays contain the IDs and NAMEs of all RTEMS semaphore --- created by this test. --- - - SEMAPHORE_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID; - SEMAPHORE_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME; - --- --- This variable contains the ID of the remote task with which this --- test interacts. --- - - REMOTE_TID : RTEMS.ID; - --- --- This variable contains the node on which the remote task with which --- this test interacts resides. --- - - REMOTE_NODE : RTEMS.UNSIGNED32; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- TEST_TASK_1 --- --- DESCRIPTION: --- --- This is the body of one of the RTEMS tasks which constitute this test. --- - - procedure TEST_TASK_1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TEST_TASK_1); - --- --- TEST_TASK_2 --- --- DESCRIPTION: --- --- This is the body of one of the RTEMS tasks which constitute this test. --- - - procedure TEST_TASK_2 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TEST_TASK_2); - -end MPTEST; diff --git a/c/src/ada-tests/mptests/mp13/node1/Makefile.am b/c/src/ada-tests/mptests/mp13/node1/Makefile.am deleted file mode 100644 index aa80acd467..0000000000 --- a/c/src/ada-tests/mptests/mp13/node1/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -AM_ADAFLAGS += -I$(srcdir)/.. - -noinst_PROGRAMS = mp13_ada_mp13_node1 -mp13_ada_mp13_node1_SOURCES = mp13_node1.adb ../mptest.adb config.h -mp13_ada_mp13_node1_SOURCES += ../mptest.ads -mp13_ada_mp13_node1_SOURCES += ../../../support/init.c - -mp13_ada_mp13_node1$(EXEEXT): mp13_node1.adb ../mptest.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_mp13-node1.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/mptests/mp13/node1/ada_mp13-node1.scn b/c/src/ada-tests/mptests/mp13/node1/ada_mp13-node1.scn deleted file mode 100644 index d3bd11f65e..0000000000 --- a/c/src/ada-tests/mptests/mp13/node1/ada_mp13-node1.scn +++ /dev/null @@ -1,14 +0,0 @@ -*** TEST 13 -- NODE 1 *** -Creating Message Queue (Global) -Creating Semaphore (Global) -Creating Test_task 1 (local) -Starting Test_task 1 (local) -Creating Test_task 2 (local) -Starting Test_task 2 (local) -Getting QID of message queue -Receiving message ... -Getting SMID of semaphore -Releasing semaphore ... -Getting semaphore ... -Getting semaphore ... -*** END OF TEST 13 *** diff --git a/c/src/ada-tests/mptests/mp13/node1/config.h b/c/src/ada-tests/mptests/mp13/node1/config.h deleted file mode 100644 index 36c9d133e8..0000000000 --- a/c/src/ada-tests/mptests/mp13/node1/config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* 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_MP_APPLICATION -#define CONFIGURE_MP_NODE_NUMBER 1 - -#include "../config_base.h" - -/* end of include file */ diff --git a/c/src/ada-tests/mptests/mp13/node1/mp13_node1.adb b/c/src/ada-tests/mptests/mp13/node1/mp13_node1.adb deleted file mode 100644 index 561bc67ba5..0000000000 --- a/c/src/ada-tests/mptests/mp13/node1/mp13_node1.adb +++ /dev/null @@ -1,56 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test MP13_NODE1 of the Multiprocessor --- 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 MPTEST; -with TEST_SUPPORT; - -procedure MP13_NODE1 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, - MPTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end MP13_NODE1; - diff --git a/c/src/ada-tests/mptests/mp13/node2/Makefile.am b/c/src/ada-tests/mptests/mp13/node2/Makefile.am deleted file mode 100644 index c28ec60bb2..0000000000 --- a/c/src/ada-tests/mptests/mp13/node2/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -AM_ADAFLAGS += -I$(srcdir)/.. - -noinst_PROGRAMS = mp13_ada_mp13_node2 -mp13_ada_mp13_node2_SOURCES = mp13_node2.adb ../mptest.adb config.h -mp13_ada_mp13_node2_SOURCES += ../mptest.ads -mp13_ada_mp13_node2_SOURCES += ../../../support/init.c - -mp13_ada_mp13_node2$(EXEEXT): mp13_node2.adb ../mptest.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_mp13-node2.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/mptests/mp13/node2/ada_mp13-node2.scn b/c/src/ada-tests/mptests/mp13/node2/ada_mp13-node2.scn deleted file mode 100644 index 3254046292..0000000000 --- a/c/src/ada-tests/mptests/mp13/node2/ada_mp13-node2.scn +++ /dev/null @@ -1,16 +0,0 @@ -*** TEST 13 -- NODE 2 *** -Creating Test_task 1 (local) -Starting Test_task 1 (local) -Creating Test_task 2 (local) -Starting Test_task 2 (local) -Deleting initialization task -Getting QID of message queue -Getting SMID of semaphore -Getting semaphore ... -Releasing semaphore ... -Receiving message ... -Getting semaphore ... -message_queue_receive correctly returned TIMEOUT -Deleting self -semaphore_obtain correctly returned TIMEOUT -*** END OF TEST 13 *** diff --git a/c/src/ada-tests/mptests/mp13/node2/config.h b/c/src/ada-tests/mptests/mp13/node2/config.h deleted file mode 100644 index 47edf66149..0000000000 --- a/c/src/ada-tests/mptests/mp13/node2/config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* 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_MP_APPLICATION -#define CONFIGURE_MP_NODE_NUMBER 2 - -#include "../config_base.h" - -/* end of include file */ diff --git a/c/src/ada-tests/mptests/mp13/node2/mp13_node2.adb b/c/src/ada-tests/mptests/mp13/node2/mp13_node2.adb deleted file mode 100644 index e197f5aa12..0000000000 --- a/c/src/ada-tests/mptests/mp13/node2/mp13_node2.adb +++ /dev/null @@ -1,56 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test MP13_NODE2 of the Multiprocessor --- 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 MPTEST; -with TEST_SUPPORT; - -procedure MP13_NODE2 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, - MPTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end MP13_NODE2; - diff --git a/c/src/ada-tests/mptests/mp14/Makefile.am b/c/src/ada-tests/mptests/mp14/Makefile.am deleted file mode 100644 index 43bba78abb..0000000000 --- a/c/src/ada-tests/mptests/mp14/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -_SUBDIRS = node1 node2 - -include $(top_srcdir)/../../../testsuites/automake/subdirs.am -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/mptests/mp14/config_base.h b/c/src/ada-tests/mptests/mp14/config_base.h deleted file mode 100644 index c1b8f24e86..0000000000 --- a/c/src/ada-tests/mptests/mp14/config_base.h +++ /dev/null @@ -1,28 +0,0 @@ -/* config_base.h - * - * This include file defines all of the Configuration Table for this test - * EXCEPT the NODE NUMBER. - * - * 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. - */ - - - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_TASKS 2 - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/mptests/mp14/mptest.adb b/c/src/ada-tests/mptests/mp14/mptest.adb deleted file mode 100644 index c795dc28bd..0000000000 --- a/c/src/ada-tests/mptests/mp14/mptest.adb +++ /dev/null @@ -1,766 +0,0 @@ --- --- MPTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation for Test 14 of the RTEMS --- Multiprocessor 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 INTERFACES; use INTERFACES; -with INTERFACES.C; -with RTEMS; -with RTEMS.EVENT; -with RTEMS.MESSAGE_QUEUE; -with RTEMS.PARTITION; -with RTEMS.SEMAPHORE; -with RTEMS.TASKS; -with RTEMS.TIMER; -with TEST_SUPPORT; -with TEXT_IO; -with UNSIGNED32_IO; - -with System.Storage_Elements; use System.Storage_Elements; - -package body MPTEST is - --- --- STOP_TEST_TSR --- - - procedure STOP_TEST_TSR ( - IGNORED_ID : in RTEMS.ID; - IGNORED_ADDRESS : in RTEMS.ADDRESS - ) is - begin - - MPTEST.STOP_TEST := TRUE; - - end STOP_TEST_TSR; - --- --- EXIT_TEST --- - - procedure EXIT_TEST is - OLD_MODE : RTEMS.MODE; - STATUS : RTEMS.STATUS_CODES; - procedure BSP_MPCI_PRINT_STATISTICS; - pragma Import (C, BSP_MPCI_PRINT_STATISTICS, "MPCI_Print_statistics" ); - begin - - RTEMS.TASKS.MODE(RTEMS.NO_PREEMPT, RTEMS.PREEMPT_MASK, OLD_MODE, STATUS); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); - - BSP_MPCI_PRINT_STATISTICS; - - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end EXIT_TEST; - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - INDEX : RTEMS.UNSIGNED32; - STATUS : RTEMS.STATUS_CODES; - PREVIOUS_PRIORITY : RTEMS.TASKS.PRIORITY; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT( "*** TEST 14 -- NODE " ); - UNSIGNED32_IO.PUT( - TEST_SUPPORT.NODE, - WIDTH => 1 - ); - TEXT_IO.PUT_LINE( " ***" ); - - MPTEST.STOP_TIMER_NAME := RTEMS.BUILD_NAME( 'S', 'T', 'O', 'P' ); - - MPTEST.STOP_TEST := FALSE; - - RTEMS.TIMER.CREATE( - MPTEST.STOP_TIMER_NAME, - MPTEST.STOP_TIMER_ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE" ); - - RTEMS.TIMER.FIRE_AFTER( - MPTEST.STOP_TIMER_ID, - TEST_SUPPORT.MAXIMUM_LONG_TEST_DURATION * - TEST_SUPPORT.TICKS_PER_SECOND, - MPTEST.STOP_TEST_TSR'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER" ); - - MPTEST.EVENT_TASK_NAME( 1 ) := RTEMS.BUILD_NAME( '1', '1', '1', ' ' ); - MPTEST.EVENT_TASK_NAME( 2 ) := RTEMS.BUILD_NAME( '2', '2', '2', ' ' ); - - MPTEST.QUEUE_TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'M', 'T', '1', ' ' ); - MPTEST.QUEUE_TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'M', 'T', '2', ' ' ); - - MPTEST.PARTITION_TASK_NAME( 1 ) := - RTEMS.BUILD_NAME( 'P', 'T', '1', ' ' ); - MPTEST.PARTITION_TASK_NAME( 2 ) := - RTEMS.BUILD_NAME( 'P', 'T', '2', ' ' ); - - MPTEST.SEMAPHORE_TASK_NAME( 1 ) := - RTEMS.BUILD_NAME( 'S', 'M', '1', ' ' ); - MPTEST.SEMAPHORE_TASK_NAME( 2 ) := - RTEMS.BUILD_NAME( 'S', 'M', '2', ' ' ); - - MPTEST.SEMAPHORE_NAME( 1 ) := RTEMS.BUILD_NAME( 'S', 'E', 'M', ' ' ); - - MPTEST.QUEUE_NAME( 1 ) := RTEMS.BUILD_NAME( 'M', 'S', 'G', ' ' ); - - MPTEST.PARTITION_NAME( 1 ) := RTEMS.BUILD_NAME( 'P', 'A', 'R', ' ' ); - - MPTEST.TIMER_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'M', 'R', ' ' ); - - for INDEX in MPTEST.BUFFERS'FIRST .. MPTEST.BUFFERS'LAST - loop - - MPTEST.BUFFERS( INDEX ) := - MPTEST.BUFFER_AREAS( INDEX )'ADDRESS; - - end loop; - - if TEST_SUPPORT.NODE = 1 then - - TEXT_IO.PUT_LINE( "Creating Semaphore (Global)" ); - RTEMS.SEMAPHORE.CREATE( - MPTEST.SEMAPHORE_NAME( 1 ), - 1, - RTEMS.GLOBAL, - MPTEST.SEMAPHORE_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE" ); - - TEXT_IO.PUT_LINE( "Creating Message Queue (Global)" ); - RTEMS.MESSAGE_QUEUE.CREATE( - MPTEST.QUEUE_NAME( 1 ), - 1, - RTEMS.GLOBAL, - MPTEST.QUEUE_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_CREATE" ); - - TEXT_IO.PUT_LINE( "Creating Partition (Global)" ); - RTEMS.PARTITION.CREATE( - MPTEST.PARTITION_NAME( 1 ), - MPTEST.PARTITION_AREA( 0 )'ADDRESS, - 16#8000#, - 16#3000#, - RTEMS.GLOBAL, - MPTEST.PARTITION_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_CREATE" ); - - end if; - - TEXT_IO.PUT_LINE( "Creating Event task (Global)" ); - RTEMS.TASKS.CREATE( - MPTEST.EVENT_TASK_NAME( - TEST_SUPPORT.NODE - ), - 2, - 2048, - RTEMS.TIMESLICE, - RTEMS.GLOBAL, - MPTEST.EVENT_TASK_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); - - TEXT_IO.PUT_LINE( "Starting Event task (Global)" ); - RTEMS.TASKS.START( - MPTEST.EVENT_TASK_ID( 1 ), - MPTEST.TEST_TASK'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); - - TEXT_IO.PUT_LINE( "Creating Semaphore task (Global)" ); - RTEMS.TASKS.CREATE( - MPTEST.SEMAPHORE_TASK_NAME( - TEST_SUPPORT.NODE - ), - 2, - 2048, - RTEMS.TIMESLICE, - RTEMS.GLOBAL, - MPTEST.SEMAPHORE_TASK_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); - - TEXT_IO.PUT_LINE( "Starting Semaphore task (Global)" ); - RTEMS.TASKS.START( - MPTEST.SEMAPHORE_TASK_ID( 1 ), - MPTEST.SEMAPHORE_TASK'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); - - TEXT_IO.PUT_LINE( "Creating Message Queue task (Global)" ); - RTEMS.TASKS.CREATE( - MPTEST.QUEUE_TASK_NAME( - TEST_SUPPORT.NODE - ), - 2, - 2048, - RTEMS.TIMESLICE, - RTEMS.GLOBAL, - MPTEST.QUEUE_TASK_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); - - TEXT_IO.PUT_LINE( "Starting Message Queue task (Global)" ); - RTEMS.TASKS.START( - MPTEST.QUEUE_TASK_ID( 1 ), - MPTEST.MESSAGE_QUEUE_TASK'ACCESS, - 1, -- index of buffer - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); - - TEXT_IO.PUT_LINE( "Creating Partition task (Global)" ); - RTEMS.TASKS.CREATE( - MPTEST.PARTITION_TASK_NAME( - TEST_SUPPORT.NODE - ), - 2, - 2048, - RTEMS.TIMESLICE, - RTEMS.GLOBAL, - MPTEST.PARTITION_TASK_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); - - TEXT_IO.PUT_LINE( "Starting Partition task (Global)" ); - RTEMS.TASKS.START( - MPTEST.PARTITION_TASK_ID( 1 ), - MPTEST.PARTITION_TASK'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); - - RTEMS.TASKS.SET_PRIORITY( RTEMS.SELF, 2, PREVIOUS_PRIORITY, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" ); - - MPTEST.DELAYED_EVENTS_TASK( 1 ); - - end INIT; - --- --- DELAYED_SEND_EVENT --- --- DESCRIPTION: --- --- This subprogram is a timer service routine which sends an --- event set to a waiting task. --- - - procedure DELAYED_SEND_EVENT ( - TIMER_ID : in RTEMS.ID; - IGNORED_ADDRESS : in RTEMS.ADDRESS - ) is - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.EVENT.SEND( - MPTEST.TASK_ID( RTEMS.GET_INDEX( TIMER_ID ) ), - RTEMS.EVENT_16, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND" ); - - end DELAYED_SEND_EVENT; - --- --- TEST_TASK --- --- DESCRIPTION: --- --- This is one of the test tasks. --- - - procedure TEST_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - REMOTE_NODE : RTEMS.UNSIGNED32; - REMOTE_TID : RTEMS.ID; - COUNT : RTEMS.UNSIGNED32; - EVENT_OUT : RTEMS.EVENT_SET; - STATUS : RTEMS.STATUS_CODES; - begin - - if TEST_SUPPORT.NODE = 1 then - REMOTE_NODE := 2; - else - REMOTE_NODE := 1; - end if; - - TEXT_IO.PUT_LINE( "About to go to sleep!" ); - RTEMS.TASKS.WAKE_AFTER( 1 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - TEXT_IO.PUT_LINE( "Waking up!" ); - - TEXT_IO.PUT( "Remote task's name is : " ); - TEST_SUPPORT.PUT_NAME( MPTEST.EVENT_TASK_NAME( REMOTE_NODE ), TRUE ); - - TEXT_IO.PUT_LINE( "Getting TID of remote task" ); - - loop - - RTEMS.TASKS.IDENT( - MPTEST.EVENT_TASK_NAME( REMOTE_NODE ), - RTEMS.SEARCH_ALL_NODES, - REMOTE_TID, - STATUS - ); - - exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS ); - - TEXT_IO.PUT_LINE( "task_ident" ); - - end loop; - - if TEST_SUPPORT.NODE = 1 then - TEXT_IO.PUT_LINE( "Sending events to remote task" ); - - loop - exit when MPTEST.STOP_TEST = TRUE; - - for COUNT in 1 .. MPTEST.EVENT_TASK_DOT_COUNT - loop - RTEMS.EVENT.SEND( - REMOTE_TID, - RTEMS.EVENT_16, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND" ); - - exit when MPTEST.STOP_TEST = TRUE; - - end loop; - - TEST_SUPPORT.PUT_DOT( "e" ); - - end loop; - - end if; - - TEXT_IO.PUT_LINE( "Receiving events from remote task" ); - - loop - exit when MPTEST.STOP_TEST = TRUE; - - for COUNT in 1 .. MPTEST.EVENT_TASK_DOT_COUNT - loop - exit when MPTEST.STOP_TEST = TRUE; - - RTEMS.EVENT.RECEIVE( - RTEMS.EVENT_16, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - EVENT_OUT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE" ); - - end loop; - - TEST_SUPPORT.PUT_DOT( "e" ); - - end loop; - - MPTEST.EXIT_TEST; - - end TEST_TASK; - --- --- DELAYED_EVENTS_TASK --- --- DESCRIPTION: --- --- This is one of the test tasks. --- - - procedure DELAYED_EVENTS_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - COUNT : RTEMS.UNSIGNED32; - PREVIOUS_MODE : RTEMS.MODE; - EVENTS_OUT : RTEMS.EVENT_SET; - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.TASKS.MODE( - RTEMS.PREEMPT + RTEMS.TIMESLICE, - RTEMS.PREEMPT_MASK + RTEMS.TIMESLICE_MASK, - PREVIOUS_MODE, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); - - RTEMS.TIMER.CREATE( - MPTEST.TIMER_NAME( 1 ), - MPTEST.TIMER_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE" ); - - RTEMS.TASKS.IDENT( - RTEMS.SELF, - RTEMS.SEARCH_ALL_NODES, - MPTEST.TASK_ID( RTEMS.GET_INDEX( MPTEST.TIMER_ID( 1 ) ) ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENTS" ); - - loop - - for COUNT in 1 .. MPTEST.DELAYED_EVENT_DOT_COUNT - loop - RTEMS.TIMER.FIRE_AFTER( - MPTEST.TIMER_ID( 1 ), - 1, - MPTEST.DELAYED_SEND_EVENT'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER" ); - - RTEMS.EVENT.RECEIVE( - RTEMS.EVENT_16, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - EVENTS_OUT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE" ); - - end loop; - - TEST_SUPPORT.PUT_DOT( "." ); - - end loop; - - MPTEST.EXIT_TEST; - - end DELAYED_EVENTS_TASK; - --- --- MESSAGE_QUEUE_TASK --- --- DESCRIPTION: --- --- This is one of the test tasks. --- - - procedure MESSAGE_QUEUE_TASK ( - INDEX : in RTEMS.TASKS.ARGUMENT - ) is - COUNT : RTEMS.UNSIGNED32; - YIELD_COUNT : RTEMS.UNSIGNED32; - OVERFLOW_COUNT : RTEMS.UNSIGNED32_POINTER; - BUFFER_COUNT : RTEMS.UNSIGNED32_POINTER; - STATUS : RTEMS.STATUS_CODES; - begin - - MPTEST.BUFFERS( INDEX ).FIELD1 := 0; - MPTEST.BUFFERS( INDEX ).FIELD2 := 0; - MPTEST.BUFFERS( INDEX ).FIELD3 := 0; - MPTEST.BUFFERS( INDEX ).FIELD4 := 0; - - TEXT_IO.PUT_LINE( "Getting ID of message queue" ); - - loop - - RTEMS.MESSAGE_QUEUE.IDENT( - MPTEST.QUEUE_NAME( 1 ), - RTEMS.SEARCH_ALL_NODES, - MPTEST.QUEUE_ID( 1 ), - STATUS - ); - exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS ); - - TEXT_IO.PUT_LINE( "message_queue_ident FAILED!!" ); - - end loop; - - if TEST_SUPPORT.NODE = 1 then - - RTEMS.MESSAGE_QUEUE.SEND( - MPTEST.QUEUE_ID( 1 ), - MPTEST.BUFFERS( INDEX ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); - - OVERFLOW_COUNT := RTEMS.TO_UNSIGNED32_POINTER( - MPTEST.BUFFERS( INDEX ).FIELD1'ADDRESS - ); - - BUFFER_COUNT := RTEMS.TO_UNSIGNED32_POINTER( - MPTEST.BUFFERS( INDEX ).FIELD2'ADDRESS - ); - - else - - OVERFLOW_COUNT := RTEMS.TO_UNSIGNED32_POINTER( - MPTEST.BUFFERS( INDEX ).FIELD3'ADDRESS - ); - - BUFFER_COUNT := RTEMS.TO_UNSIGNED32_POINTER( - MPTEST.BUFFERS( INDEX ).FIELD4'ADDRESS - ); - - end if; - - loop - - exit when MPTEST.STOP_TEST = TRUE; - - YIELD_COUNT := 100; - - for COUNT in 1 .. MPTEST.MESSAGE_DOT_COUNT - loop - - exit when MPTEST.STOP_TEST = TRUE; - - RTEMS.MESSAGE_QUEUE.RECEIVE( - MPTEST.QUEUE_ID( 1 ), - MPTEST.BUFFERS( INDEX ), - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( - STATUS, - "MESSAGE_QUEUE_RECEIVE" - ); - - if BUFFER_COUNT.ALL = RTEMS.UNSIGNED32'LAST then - BUFFER_COUNT.ALL := 0; - OVERFLOW_COUNT.ALL := OVERFLOW_COUNT.ALL + 1; - else - BUFFER_COUNT.ALL := BUFFER_COUNT.ALL + 1; - end if; - - RTEMS.MESSAGE_QUEUE.SEND( - MPTEST.QUEUE_ID( 1 ), - MPTEST.BUFFERS( INDEX ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); - - if MPTEST.STOP_TEST = FALSE then - if TEST_SUPPORT.NODE = 1 then - - YIELD_COUNT := YIELD_COUNT - 1; - - if YIELD_COUNT = 0 then - - RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "YIELD" ); - - YIELD_COUNT := 100; - - end if; - - end if; - - end if; - - end loop; - - TEST_SUPPORT.PUT_DOT( "m" ); - - end loop; - - MPTEST.EXIT_TEST; - - end MESSAGE_QUEUE_TASK; - --- --- PARTITION_TASK --- --- DESCRIPTION: --- --- This is one of the test tasks. --- - - procedure PARTITION_TASK ( - IGNORED : in RTEMS.TASKS.ARGUMENT - ) is - COUNT : RTEMS.UNSIGNED32; - BUFFER : RTEMS.ADDRESS; - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.PUT_LINE( "Getting ID of partition" ); - - loop - - RTEMS.PARTITION.IDENT( - MPTEST.PARTITION_NAME( 1 ), - RTEMS.SEARCH_ALL_NODES, - MPTEST.PARTITION_ID( 1 ), - STATUS - ); - exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS ); - - TEXT_IO.PUT_LINE( "partition_ident FAILED!!" ); - - end loop; - - loop - - exit when MPTEST.STOP_TEST = TRUE; - - for COUNT in 1 .. MPTEST.PARTITION_DOT_COUNT - loop - - exit when MPTEST.STOP_TEST = TRUE; - - RTEMS.PARTITION.GET_BUFFER( - MPTEST.PARTITION_ID( 1 ), - BUFFER, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_GET_BUFFER" ); - - RTEMS.PARTITION.RETURN_BUFFER( - MPTEST.PARTITION_ID( 1 ), - BUFFER, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( - STATUS, - "PARTITION_RETURN_BUFFER" - ); - - if TEST_SUPPORT.NODE = 1 then - - RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "YIELD" ); - - end if; - - end loop; - - TEST_SUPPORT.PUT_DOT( "p" ); - - end loop; - - MPTEST.EXIT_TEST; - - end PARTITION_TASK; - --- --- SEMAPHORE_TASK --- --- DESCRIPTION: --- --- This is one of the test tasks. --- - - procedure SEMAPHORE_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - COUNT : RTEMS.UNSIGNED32; - YIELD_COUNT : RTEMS.UNSIGNED32; - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.PUT_LINE( "Getting ID of semaphore" ); - - loop - - RTEMS.SEMAPHORE.IDENT( - MPTEST.SEMAPHORE_NAME( 1 ), - RTEMS.SEARCH_ALL_NODES, - MPTEST.SEMAPHORE_ID( 1 ), - STATUS - ); - exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS ); - - TEXT_IO.PUT_LINE( "semaphore_ident FAILED!!" ); - - end loop; - - loop - - YIELD_COUNT := 100; - - exit when MPTEST.STOP_TEST = TRUE; - - for COUNT in 1 .. MPTEST.SEMAPHORE_DOT_COUNT - loop - - exit when MPTEST.STOP_TEST = TRUE; - - RTEMS.SEMAPHORE.OBTAIN( - MPTEST.SEMAPHORE_ID( 1 ), - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN" ); - - RTEMS.SEMAPHORE.RELEASE( MPTEST.SEMAPHORE_ID( 1 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE" ); - - if TEST_SUPPORT.NODE = 1 then - - YIELD_COUNT := YIELD_COUNT - 1; - - if YIELD_COUNT = 0 then - - RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "YIELD" ); - - YIELD_COUNT := 100; - - end if; - - end if; - - end loop; - - TEST_SUPPORT.PUT_DOT( "s" ); - - end loop; - - MPTEST.EXIT_TEST; - - end SEMAPHORE_TASK; - -end MPTEST; diff --git a/c/src/ada-tests/mptests/mp14/mptest.ads b/c/src/ada-tests/mptests/mp14/mptest.ads deleted file mode 100644 index 1cf0b80942..0000000000 --- a/c/src/ada-tests/mptests/mp14/mptest.ads +++ /dev/null @@ -1,246 +0,0 @@ --- --- MPTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 14 of the RTEMS --- Multiprocessor 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; - -package MPTEST is - --- --- These arrays contain the IDs and NAMEs of all RTEMS tasks created --- by this test for passing event sets. --- - - TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.ID; - TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.NAME; --- --- These arrays contain the IDs and NAMEs of all RTEMS tasks created --- by this test for passing event sets. --- - - EVENT_TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.ID; - EVENT_TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.NAME; - --- --- These arrays contain the IDs and NAMEs of all RTEMS tasks created --- by this test for manipulating semaphores. --- - - SEMAPHORE_TASK_ID : - array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.ID; - SEMAPHORE_TASK_NAME : - array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.NAME; - --- --- These arrays contain the IDs and NAMEs of all RTEMS tasks created --- by this test for passing messages. --- - - QUEUE_TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.ID; - QUEUE_TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.NAME; - --- --- These arrays contain the IDs and NAMEs of all RTEMS tasks created --- by this test for manipulating the global partitions. --- - - PARTITION_TASK_ID : - array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.ID; - PARTITION_TASK_NAME : - array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.NAME; - --- --- These arrays contain the IDs and NAMEs of all RTEMS partitions --- created by this test. --- - - PARTITION_ID : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.ID; - PARTITION_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.NAME; - --- --- These arrays contain the IDs and NAMEs of all RTEMS semaphores --- created by this test. --- - - SEMAPHORE_ID : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.ID; - SEMAPHORE_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.NAME; - --- --- These arrays contain the IDs and NAMEs of all RTEMS message_queues --- created by this test. --- - - QUEUE_ID : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.ID; - QUEUE_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.NAME; - --- --- --- These arrays contain the IDs and NAMEs of all RTEMS timers --- created by this test. --- - - TIMER_ID : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.ID; - TIMER_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.NAME; - --- --- The following are message buffers used to contain the test messages --- and pointers to those buffers. --- - - BUFFER_AREAS : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.BUFFER; - BUFFERS : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.ADDRESS; - --- --- This is the area used for the partition. --- - - PARTITION_AREA : - array ( RTEMS.UNSIGNED32 range 0 .. 16#7FFF# ) of RTEMS.UNSIGNED8; - for PARTITION_AREA'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT; - --- --- The following constants control the flow of "dot" indicators --- from the various test componenents. --- - - EVENT_TASK_DOT_COUNT : constant RTEMS.UNSIGNED32 := 100; - EVENT_SEND_DOT_COUNT : constant RTEMS.UNSIGNED32 := 100; - DELAYED_EVENT_DOT_COUNT : constant RTEMS.UNSIGNED32 := 1000; - MESSAGE_DOT_COUNT : constant RTEMS.UNSIGNED32 := 200; - PARTITION_DOT_COUNT : constant RTEMS.UNSIGNED32 := 200; - SEMAPHORE_DOT_COUNT : constant RTEMS.UNSIGNED32 := 200; - --- --- These contain the IDs and NAMEs of the RTEMS timers used --- by this test to stop. --- - - STOP_TIMER_ID : RTEMS.ID; - STOP_TIMER_NAME : RTEMS.NAME; - --- --- This variable is set when the test should stop executing. --- - - STOP_TEST : BOOLEAN; - --- --- EXIT_TEST --- --- DESCRIPTION: --- --- This subprogram is invoked to stop this test. --- - - procedure EXIT_TEST; - --- --- DELAYED_SEND_EVENT --- --- DESCRIPTION: --- --- This subprogram is a timer service routine which sends an --- event set to a waiting task. --- - - procedure DELAYED_SEND_EVENT ( - TIMER_ID : in RTEMS.ID; - IGNORED_ADDRESS : in RTEMS.ADDRESS - ); - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- TEST_TASK --- --- DESCRIPTION: --- --- This is one of the test tasks. --- - - procedure TEST_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TEST_TASK); - --- --- DELAYED_EVENTS_TASK --- --- DESCRIPTION: --- --- This is one of the test tasks. --- - - procedure DELAYED_EVENTS_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, DELAYED_EVENTS_TASK); - --- --- MESSAGE_QUEUE_TASK --- --- DESCRIPTION: --- --- This is one of the test tasks. --- - - procedure MESSAGE_QUEUE_TASK ( - INDEX : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, MESSAGE_QUEUE_TASK); - --- --- PARTITION_TASK --- --- DESCRIPTION: --- --- This is one of the test tasks. --- - - procedure PARTITION_TASK ( - IGNORED : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, PARTITION_TASK); - --- --- SEMAPHORE_TASK --- --- DESCRIPTION: --- --- This is one of the test tasks. --- - - procedure SEMAPHORE_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, SEMAPHORE_TASK); - -end MPTEST; diff --git a/c/src/ada-tests/mptests/mp14/node1/Makefile.am b/c/src/ada-tests/mptests/mp14/node1/Makefile.am deleted file mode 100644 index 0dc8f8be52..0000000000 --- a/c/src/ada-tests/mptests/mp14/node1/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -AM_ADAFLAGS += -I$(srcdir)/.. - -noinst_PROGRAMS = mp14_ada_mp14_node1 -mp14_ada_mp14_node1_SOURCES = mp14_node1.adb ../mptest.adb config.h -mp14_ada_mp14_node1_SOURCES += ../mptest.ads -mp14_ada_mp14_node1_SOURCES += ../../../support/init.c - -mp14_ada_mp14_node1$(EXEEXT): mp14_node1.adb ../mptest.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_mp14-node1.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/mptests/mp14/node1/ada_mp14-node1.scn b/c/src/ada-tests/mptests/mp14/node1/ada_mp14-node1.scn deleted file mode 100644 index d1b6feefe9..0000000000 --- a/c/src/ada-tests/mptests/mp14/node1/ada_mp14-node1.scn +++ /dev/null @@ -1,33 +0,0 @@ -*** TEST 14 -- NODE 1 *** -Creating Semaphore (Global) -Creating Message Queue (Global) -Creating Partition (Global) -Creating Event task (Global) -Starting Event task (Global) -Creating Semaphore task (Global) -About to go to sleep! -Starting Semaphore task (Global) -Creating Message Queue task (Global) -Getting SMID of semaphore -Starting Message Queue task (Global) -Creating Partition task (Global) -Getting ID of msg queue -Starting Partition task (Global) -Getting ID of partition -Waking up! -Remote task's name is : 222 -Getting TID of remote task -Sending events to remote task - -. - indicates 100 iterations of -tm_evafter of 1 tick and event_receive. -e - indicates that 100 -events have been sent to the remote task. -m - indicates 100 iterations of -message_queue_send and message_queue_receive. -p - indicates 100 iterations of -partition_get_buffer and partition_return_buffer. -s - indicates 100 iterations of -semaphore_obtain and semaphore_release. -NOTE: The characters in the stream could begin to appear whenever any -task is started. diff --git a/c/src/ada-tests/mptests/mp14/node1/config.h b/c/src/ada-tests/mptests/mp14/node1/config.h deleted file mode 100644 index 36c9d133e8..0000000000 --- a/c/src/ada-tests/mptests/mp14/node1/config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* 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_MP_APPLICATION -#define CONFIGURE_MP_NODE_NUMBER 1 - -#include "../config_base.h" - -/* end of include file */ diff --git a/c/src/ada-tests/mptests/mp14/node1/mp14_node1.adb b/c/src/ada-tests/mptests/mp14/node1/mp14_node1.adb deleted file mode 100644 index 766fc5d816..0000000000 --- a/c/src/ada-tests/mptests/mp14/node1/mp14_node1.adb +++ /dev/null @@ -1,56 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test MP14_NODE1 of the Multiprocessor --- 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 MPTEST; -with TEST_SUPPORT; - -procedure MP14_NODE1 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, - MPTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end MP14_NODE1; - diff --git a/c/src/ada-tests/mptests/mp14/node2/Makefile.am b/c/src/ada-tests/mptests/mp14/node2/Makefile.am deleted file mode 100644 index 30d2cf8c3f..0000000000 --- a/c/src/ada-tests/mptests/mp14/node2/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -AM_ADAFLAGS += -I$(srcdir)/.. - -noinst_PROGRAMS = mp14_ada_mp14_node2 -mp14_ada_mp14_node2_SOURCES = mp14_node2.adb ../mptest.adb config.h -mp14_ada_mp14_node2_SOURCES += ../mptest.ads -mp14_ada_mp14_node2_SOURCES += ../../../support/init.c - -mp14_ada_mp14_node2$(EXEEXT): mp14_node2.adb ../mptest.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_mp14-node2.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/mptests/mp14/node2/ada_mp14-node2.scn b/c/src/ada-tests/mptests/mp14/node2/ada_mp14-node2.scn deleted file mode 100644 index a245b11faa..0000000000 --- a/c/src/ada-tests/mptests/mp14/node2/ada_mp14-node2.scn +++ /dev/null @@ -1,28 +0,0 @@ -*** TEST 14 -- NODE 2 *** -Creating Event task (Global) -Starting Event task (Global) -Creating Semaphore task (Global) -About to go to sleep! -Starting Semaphore task (Global) -Creating Message Queue task (Global) -Getting SMID of semaphore -Starting Message Queue task (Global) -Creating Partition task (Global) -Getting ID of msg queue -Starting Partition task (Global) -Getting ID of partition -Waking up! -Remote task's name is : 111 -Getting TID of remote task -Receiving events from remote task - -. - indicates 100 iterations of -tm_evafter of 1 tick and event_receive. -e - indicates that 100 -events have been sent to the remote task. -m - indicates 100 iterations of -message_queue_send and message_queue_receive. -p - indicates 100 iterations of -partition_get_buffer and partition_return_buffer. -s - indicates 100 iterations of -semaphore_obtain and semaphore_release. diff --git a/c/src/ada-tests/mptests/mp14/node2/config.h b/c/src/ada-tests/mptests/mp14/node2/config.h deleted file mode 100644 index 47edf66149..0000000000 --- a/c/src/ada-tests/mptests/mp14/node2/config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* 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_MP_APPLICATION -#define CONFIGURE_MP_NODE_NUMBER 2 - -#include "../config_base.h" - -/* end of include file */ diff --git a/c/src/ada-tests/mptests/mp14/node2/mp14_node2.adb b/c/src/ada-tests/mptests/mp14/node2/mp14_node2.adb deleted file mode 100644 index fb92b69554..0000000000 --- a/c/src/ada-tests/mptests/mp14/node2/mp14_node2.adb +++ /dev/null @@ -1,56 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test MP14_NODE2 of the Multiprocessor --- 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 MPTEST; -with TEST_SUPPORT; - -procedure MP14_NODE2 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, - MPTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end MP14_NODE2; - diff --git a/c/src/ada-tests/samples/Makefile.am b/c/src/ada-tests/samples/Makefile.am deleted file mode 100644 index c41a4b4af8..0000000000 --- a/c/src/ada-tests/samples/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ -_SUBDIRS = hello ticker base_sp nsecs - -if HAS_MP -_SUBDIRS += base_mp -endif -DIST_SUBDIRS = hello ticker base_sp base_mp nsecs - -include $(top_srcdir)/../../../testsuites/automake/subdirs.am -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/samples/base_mp/Makefile.am b/c/src/ada-tests/samples/base_mp/Makefile.am deleted file mode 100644 index caf05e5fb0..0000000000 --- a/c/src/ada-tests/samples/base_mp/Makefile.am +++ /dev/null @@ -1,21 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -_SUBDIRS = node1 node2 -#include $(top_srcdir)/ada.am - -#mptest$(EXEEXT): mptest.adb -# $(GNATCOMPILE) -margs -a $< -o $@ - -#if EXPADA -#noinst_PROGRAMS = mptest -#endif - -#mptest_exe_SOURCES = mptest.adb mptest.ads - -#EXTRA_DIST += node1/mptest-per_node_configuration.adb - -#EXTRA_DIST += node2/mptest-per_node_configuration.adb - -include $(top_srcdir)/../../../testsuites/automake/subdirs.am -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/samples/base_mp/config.h b/c/src/ada-tests/samples/base_mp/config.h deleted file mode 100644 index 33c9288f4c..0000000000 --- a/c/src/ada-tests/samples/base_mp/config.h +++ /dev/null @@ -1,34 +0,0 @@ -/* 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.rtems.org/license/LICENSE. - */ - -/* configuration information */ - -#define CONFIGURE_MP_APPLICATION - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 2 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -/* - * Put the overrides of default configuration parameters here. - */ - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/samples/base_mp/mptest.adb b/c/src/ada-tests/samples/base_mp/mptest.adb deleted file mode 100644 index d4eef0a29f..0000000000 --- a/c/src/ada-tests/samples/base_mp/mptest.adb +++ /dev/null @@ -1,100 +0,0 @@ --- --- MPTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation for Test 1 of the RTEMS --- Multiprocessor 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 INTERFACES; use INTERFACES; -with RTEMS; -with RTEMS.INTERRUPT; -with RTEMS.TASKS; -with TEST_SUPPORT; -with TEXT_IO; -with UNSIGNED32_IO; - -package body MPTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT( "*** SAMPLE MULTIPROCESSOR APPLICATION ***" ); - TEXT_IO.PUT( "Creating and starting an application task" ); - - - MPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); - - RTEMS.TASKS.CREATE( - MPTEST.TASK_NAME( 1 ), - 1, - 2048, - RTEMS.INTERRUPT_LEVEL( 0 ), - RTEMS.DEFAULT_ATTRIBUTES, - MPTEST.TASK_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" ); - - RTEMS.TASKS.START( - MPTEST.TASK_ID( 1 ), - MPTEST.APPLICATION_TASK'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- APPLICATION_TASK --- - - procedure APPLICATION_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - TID : RTEMS.ID; - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.TASKS.IDENT( RTEMS.SELF, RTEMS.SEARCH_ALL_NODES, TID, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF SELF" ); - - TEXT_IO.PUT( "This task was invoked with node argument (" ); - UNSIGNED32_IO.PUT( ARGUMENT ); - TEXT_IO.PUT_LINE( ")" ); - - TEXT_IO.PUT( "This task has the id of 0x" ); - UNSIGNED32_IO.PUT( TID, BASE => 16 ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT_LINE( "*** END OF SAMPLE MULTIPROCESSOR APPLICATION ***" ); - - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end APPLICATION_TASK; - -end MPTEST; diff --git a/c/src/ada-tests/samples/base_mp/mptest.ads b/c/src/ada-tests/samples/base_mp/mptest.ads deleted file mode 100644 index f246b4e0ed..0000000000 --- a/c/src/ada-tests/samples/base_mp/mptest.ads +++ /dev/null @@ -1,62 +0,0 @@ --- --- MPTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 1 of the RTEMS --- Multiprocessor 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; - -package MPTEST is - --- --- These arrays contain the IDs and NAMEs of all RTEMS tasks created --- by this test. --- - - TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; - TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- APPLICATION_TASK --- --- DESCRIPTION: --- --- This routine is as an example of an application task which --- prints a message including its RTEMS task id. This task --- then invokes exit to return to the monitor. --- - - procedure APPLICATION_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, APPLICATION_TASK); - -end MPTEST; diff --git a/c/src/ada-tests/samples/base_mp/node1/Makefile.am b/c/src/ada-tests/samples/base_mp/node1/Makefile.am deleted file mode 100644 index 530766541c..0000000000 --- a/c/src/ada-tests/samples/base_mp/node1/Makefile.am +++ /dev/null @@ -1,22 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -AM_ADAFLAGS += -I$(srcdir)/.. - -if EXPADA -noinst_PROGRAMS = ada_base_mp_node1 -ada_base_mp_node1_SOURCES = mptest-per_node_configuration.adb -endif - -ada_base_mp_node1$(EXEEXT): ../mptest.adb init.o - $(GNATCOMPILE) -margs -a $< -o $@ - -init.o: ../../../support/init.c - $(COMPILE.c) -DNODE_NUMBER=1 -I$(srcdir)/.. -c $< - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_base_mp-node1.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/samples/base_mp/node1/ada_base_mp-node1.scn b/c/src/ada-tests/samples/base_mp/node1/ada_base_mp-node1.scn deleted file mode 100644 index a2d2f359be..0000000000 --- a/c/src/ada-tests/samples/base_mp/node1/ada_base_mp-node1.scn +++ /dev/null @@ -1,5 +0,0 @@ -*** SAMPLE MULTIPROCESSOR APPLICATION *** -Creating and starting an application task -This task was invoked with the node argument (1) -This task has the id of 0x10002 -*** END OF SAMPLE MULTIPROCESSOR APPLICATION *** diff --git a/c/src/ada-tests/samples/base_mp/node2/Makefile.am b/c/src/ada-tests/samples/base_mp/node2/Makefile.am deleted file mode 100644 index efc208bf65..0000000000 --- a/c/src/ada-tests/samples/base_mp/node2/Makefile.am +++ /dev/null @@ -1,22 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -AM_ADAFLAGS += -I$(srcdir)/.. - -if EXPADA -noinst_PROGRAMS = ada_base_mp_node2 -ada_base_mp_node2_SOURCES = mptest-per_node_configuration.adb -endif - -ada_base_mp_node2$(EXEEXT): ../mptest.adb init.o - $(GNATCOMPILE) -margs -a $< -o $@ - -init.o: ../../../support/init.c - $(COMPILE.c) -DNODE_NUMBER=2 -I$(srcdir)/.. -c $< - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_base_mp-node2.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/samples/base_mp/node2/ada_base_mp-node2.scn b/c/src/ada-tests/samples/base_mp/node2/ada_base_mp-node2.scn deleted file mode 100644 index 95bc96a808..0000000000 --- a/c/src/ada-tests/samples/base_mp/node2/ada_base_mp-node2.scn +++ /dev/null @@ -1,5 +0,0 @@ -*** SAMPLE MULTIPROCESSOR APPLICATION *** -Creating and starting an application task -This task was invoked with the node argument (2) -This task has the id of 0x20002 -*** END OF SAMPLE MULTIPROCESSOR APPLICATION *** diff --git a/c/src/ada-tests/samples/base_sp/Makefile.am b/c/src/ada-tests/samples/base_sp/Makefile.am deleted file mode 100644 index 6575f06ccc..0000000000 --- a/c/src/ada-tests/samples/base_sp/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -ada_base_sp$(EXEEXT): base_sp.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -init.$(OBJEXT): ../../support/init.c - $(COMPILE.c) -I$(srcdir) -c $< - -noinst_PROGRAMS = ada_base_sp - -ada_base_sp_SOURCES = base_sp.adb config.h sptest.adb sptest.ads - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_base_sp.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/samples/base_sp/ada_base_sp.scn b/c/src/ada-tests/samples/base_sp/ada_base_sp.scn deleted file mode 100644 index 7b8867dc85..0000000000 --- a/c/src/ada-tests/samples/base_sp/ada_base_sp.scn +++ /dev/null @@ -1,4 +0,0 @@ -*** SAMPLE SINGLE PROCESSOR APPLICATION *** -Creating and starting an application task -Application task was invoked with argument ( 0) and has id of 0x16#A010002# -*** END OF SAMPLE SINGLE PROCESSOR APPLICATION *** diff --git a/c/src/ada-tests/samples/base_sp/base_sp.adb b/c/src/ada-tests/samples/base_sp/base_sp.adb deleted file mode 100644 index aaa1ab3bca..0000000000 --- a/c/src/ada-tests/samples/base_sp/base_sp.adb +++ /dev/null @@ -1,56 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Base Single Process Example of the --- Sample 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 Base_SP 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 Base_SP; - diff --git a/c/src/ada-tests/samples/base_sp/config.h b/c/src/ada-tests/samples/base_sp/config.h deleted file mode 100644 index 083d52515e..0000000000 --- a/c/src/ada-tests/samples/base_sp/config.h +++ /dev/null @@ -1,30 +0,0 @@ -/* 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_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#define CONFIGURE_MAXIMUM_TASKS 2 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/samples/base_sp/sptest.adb b/c/src/ada-tests/samples/base_sp/sptest.adb deleted file mode 100644 index 85a847f281..0000000000 --- a/c/src/ada-tests/samples/base_sp/sptest.adb +++ /dev/null @@ -1,93 +0,0 @@ --- --- SPTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 1 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 TEST_SUPPORT; -with TEXT_IO; -with UNSIGNED32_IO; - -package body SPTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** SAMPLE SINGLE PROCESSOR APPLICATION ***" ); - TEXT_IO.PUT_LINE( "Creating and starting an application task" ); - - SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 1 ), - 1, - 2048, - RTEMS.INTERRUPT_LEVEL( 0 ), - 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.APPLICATION_TASK'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- APPLICATION_TASK --- - - procedure APPLICATION_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - TID : RTEMS.ID; - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.TASKS.IDENT( RTEMS.SELF, RTEMS.SEARCH_ALL_NODES, TID, STATUS ); - - TEXT_IO.PUT( "Application task was invoked with argument (" ); - UNSIGNED32_IO.PUT( ARGUMENT ); - TEXT_IO.PUT( ") and has id of 0x" ); - UNSIGNED32_IO.PUT( TID, BASE => 16 ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT_LINE( "*** END OF SAMPLE SINGLE PROCESSOR APPLICATION ***" ); - - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end APPLICATION_TASK; - -end SPTEST; diff --git a/c/src/ada-tests/samples/base_sp/sptest.ads b/c/src/ada-tests/samples/base_sp/sptest.ads deleted file mode 100644 index e35751cd32..0000000000 --- a/c/src/ada-tests/samples/base_sp/sptest.ads +++ /dev/null @@ -1,60 +0,0 @@ --- --- SPTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 1 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; - -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 .. 3 ) of RTEMS.ID; - TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- APPLICATION_TASK --- --- DESCRIPTION: --- --- This is the body of the RTEMS task which constitutes this test. --- - - procedure APPLICATION_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, APPLICATION_TASK); - -end SPTEST; diff --git a/c/src/ada-tests/samples/hello/Makefile.am b/c/src/ada-tests/samples/hello/Makefile.am deleted file mode 100644 index ff4b51c232..0000000000 --- a/c/src/ada-tests/samples/hello/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -ada_hello$(EXEEXT): hello.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -init.$(OBJEXT): ../../support/init.c - $(COMPILE.c) -I$(srcdir) -c $< - -noinst_PROGRAMS = ada_hello - -ada_hello_SOURCES = hello.adb config.h sptest.adb sptest.ads - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_hello.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/samples/hello/ada_hello.scn b/c/src/ada-tests/samples/hello/ada_hello.scn deleted file mode 100644 index d9e92d81d5..0000000000 --- a/c/src/ada-tests/samples/hello/ada_hello.scn +++ /dev/null @@ -1,3 +0,0 @@ -*** HELLO WORLD TEST *** -Hello World -*** END OF HELLO WORLD TEST *** diff --git a/c/src/ada-tests/samples/hello/config.h b/c/src/ada-tests/samples/hello/config.h deleted file mode 100644 index 2be186cc2a..0000000000 --- a/c/src/ada-tests/samples/hello/config.h +++ /dev/null @@ -1,31 +0,0 @@ -/* config.h - * - * This include file defines the Configuration Table for this test. - * - * COPYRIGHT (c) 1989-2008. - * 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_APPLICATION - -/* NOTICE: the clock driver is explicitly disabled */ -#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#define CONFIGURE_MAXIMUM_TASKS 1 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/samples/hello/hello.adb b/c/src/ada-tests/samples/hello/hello.adb deleted file mode 100644 index f7748f3607..0000000000 --- a/c/src/ada-tests/samples/hello/hello.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test Hello of the Sample 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 Hello 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 Hello; - diff --git a/c/src/ada-tests/samples/hello/sptest.adb b/c/src/ada-tests/samples/hello/sptest.adb deleted file mode 100644 index 8c29155eba..0000000000 --- a/c/src/ada-tests/samples/hello/sptest.adb +++ /dev/null @@ -1,44 +0,0 @@ --- --- SPTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 1 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 TEXT_IO; - -package body SPTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** HELLO WORLD TEST ***" ); - TEXT_IO.PUT_LINE( "Hello World" ); - TEXT_IO.PUT_LINE( "*** END OF HELLO WORLD TEST ***" ); - - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end INIT; - -end SPTEST; diff --git a/c/src/ada-tests/samples/hello/sptest.ads b/c/src/ada-tests/samples/hello/sptest.ads deleted file mode 100644 index 62993b0220..0000000000 --- a/c/src/ada-tests/samples/hello/sptest.ads +++ /dev/null @@ -1,48 +0,0 @@ --- --- SPTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for the Hello World Test of the RTEMS --- Sample 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; - -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 .. 3 ) of RTEMS.ID; - TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - - -end SPTEST; diff --git a/c/src/ada-tests/samples/nsecs/Makefile.am b/c/src/ada-tests/samples/nsecs/Makefile.am deleted file mode 100644 index bc8dd2a87b..0000000000 --- a/c/src/ada-tests/samples/nsecs/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -ada_nsecs$(EXEEXT): nsecs.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -init.$(OBJEXT): ../../support/init.c - $(COMPILE.c) -I$(srcdir) -c $< - -noinst_PROGRAMS = ada_nsecs - -ada_nsecs_SOURCES = nsecs.adb config.h sptest.adb sptest.ads - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_nsecs.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/samples/nsecs/ada_nsecs.scn b/c/src/ada-tests/samples/nsecs/ada_nsecs.scn deleted file mode 100644 index 458f12c874..0000000000 --- a/c/src/ada-tests/samples/nsecs/ada_nsecs.scn +++ /dev/null @@ -1,27 +0,0 @@ -*** NANOSECOND CLOCK TEST *** -10 iterations of getting TOD NOT tested in Ada - -10 iterations of getting Uptime -0: 9025000 0: 9034000 --> 0: 9000 -0: 10724000 0: 10733000 --> 0: 9000 -0: 12400000 0: 12409000 --> 0: 9000 -0: 14076000 0: 14085000 --> 0: 9000 -0: 15752000 0: 15761000 --> 0: 9000 -0: 17428000 0: 17438000 --> 0: 10000 -0: 19108000 0: 19117000 --> 0: 9000 -0: 20814000 0: 20823000 --> 0: 9000 -0: 22490000 0: 22499000 --> 0: 9000 -0: 24166000 0: 24175000 --> 0: 9000 - -10 iterations of getting Uptime with different loop values -loop of 10000 0: 26747000 0: 29758000 --> 0: 3011000 -loop of 20000 0: 31927000 0: 37938000 --> 0: 6011000 -loop of 30000 0: 40108000 0: 49118000 --> 0: 9010000 -loop of 40000 0: 51287000 0: 63327000 --> 0: 12040000 -loop of 50000 0: 65471000 0: 80541000 --> 0: 15070000 -loop of 60000 0: 82684000 0:100754000 --> 0: 18070000 -loop of 70000 0:102892000 0:123963000 --> 0: 21071000 -loop of 80000 0:126096000 0:150196000 --> 0: 24100000 -loop of 90000 0:152329000 0:179399000 --> 0: 27070000 -loop of 100000 0:181562000 0:211662000 --> 0: 30100000 -*** END OF NANOSECOND CLOCK TEST *** diff --git a/c/src/ada-tests/samples/nsecs/config.h b/c/src/ada-tests/samples/nsecs/config.h deleted file mode 100644 index 7703e721f0..0000000000 --- a/c/src/ada-tests/samples/nsecs/config.h +++ /dev/null @@ -1,30 +0,0 @@ -/* 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_APPLICATION - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#define CONFIGURE_MAXIMUM_TASKS 1 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/samples/nsecs/nsecs.adb b/c/src/ada-tests/samples/nsecs/nsecs.adb deleted file mode 100644 index 0a8f84a606..0000000000 --- a/c/src/ada-tests/samples/nsecs/nsecs.adb +++ /dev/null @@ -1,54 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test Nsecs of the Sample 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 Nsecs 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 Nsecs; - diff --git a/c/src/ada-tests/samples/nsecs/sptest.adb b/c/src/ada-tests/samples/nsecs/sptest.adb deleted file mode 100644 index 193fa09a45..0000000000 --- a/c/src/ada-tests/samples/nsecs/sptest.adb +++ /dev/null @@ -1,153 +0,0 @@ --- --- SPTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of the Nanosecond test of the --- Sample 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 Ada.Integer_Text_IO; -with Interfaces.C; -with RTEMS; -with RTEMS.Clock; -with Text_IO; -use type Interfaces.C.Long; -use type RTEMS.Time_T; - -package body SPTEST is - - Dummy_Variable : Natural := 0; - - procedure Simple_Procedure is - begin - Dummy_Variable := Dummy_Variable + 1; - end Simple_Procedure; - - procedure Subtract_Em ( - Start : in RTEMS.Timespec; - Stop : in RTEMS.Timespec; - Result : out RTEMS.Timespec - ) is - Nanoseconds_Per_Second : constant := 1000000000; - begin - if (Stop.TV_Nsec < Start.TV_Nsec) then - Result.TV_Sec := Stop.TV_Sec - Start.TV_Sec - 1; - Result.TV_Nsec := - (Nanoseconds_Per_Second - Start.TV_Nsec) + Stop.TV_Nsec; - else - Result.TV_Sec := Stop.TV_Sec - Start.TV_Sec; - Result.TV_Nsec := Stop.TV_Nsec - Start.TV_Nsec; - end if; - end Subtract_Em; - - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - Status : RTEMS.Status_Codes; - Start : RTEMS.Timespec; - Stop : RTEMS.Timespec; - Diff : RTEMS.Timespec; - Max : Integer; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** NANOSECOND CLOCK TEST ***" ); - - -- - -- Iterate 10 times showing difference in TOD - -- - - TEXT_IO.PUT_LINE( "10 iterations of getting TOD NOT tested in Ada" ); - - -- - -- Iterate 10 times showing difference in Uptime - -- - - TEXT_IO.NEW_LINE; - TEXT_IO.PUT_LINE( "10 iterations of getting Uptime" ); - - for Index in 1 .. 10 loop - - RTEMS.Clock.Get_Uptime( Start, Status ); - RTEMS.Clock.Get_Uptime( Stop, Status ); - - Subtract_Em( Start, Stop, Diff ); - - Ada.Integer_Text_IO.Put( Integer( Start.TV_Sec ), 1 ); - Text_IO.Put( ":" ); - Ada.Integer_Text_IO.Put( Integer( Start.TV_Nsec ), 9 ); - Text_IO.Put( " " ); - Ada.Integer_Text_IO.Put( Integer( Stop.TV_Sec ), 1 ); - Text_IO.Put( ":" ); - Ada.Integer_Text_IO.Put( Integer( Stop.TV_Nsec ), 9 ); - Text_IO.Put( " --> " ); - Ada.Integer_Text_IO.Put( Integer( Diff.TV_Sec ), 1 ); - Text_IO.Put( ":" ); - Ada.Integer_Text_IO.Put( Integer( Diff.TV_Nsec ), 9 ); - Text_IO.New_Line; - end loop; - - -- - -- Iterate 10 times showing difference in Uptime with different counts - -- - - TEXT_IO.NEW_LINE; - TEXT_IO.PUT_LINE( - "10 iterations of getting Uptime with different loop values" - ); - - for Index in 1 .. 10 loop - Max := (Index * 10000); - RTEMS.Clock.Get_Uptime( Start, Status ); - for j in 1 .. Max loop - Simple_Procedure; - end loop; - RTEMS.Clock.Get_Uptime( Stop, Status ); - - Subtract_Em( Start, Stop, Diff ); - - Text_IO.Put( "loop of " ); - Ada.Integer_Text_IO.Put( Max, 6 ); - Text_IO.Put( " " ); - Ada.Integer_Text_IO.Put( Integer( Start.TV_Sec ), 1 ); - Text_IO.Put( ":" ); - Ada.Integer_Text_IO.Put( Integer( Start.TV_Nsec ), 9 ); - Text_IO.Put( " " ); - Ada.Integer_Text_IO.Put( Integer( Stop.TV_Sec ), 1 ); - Text_IO.Put( ":" ); - Ada.Integer_Text_IO.Put( Integer( Stop.TV_Nsec ), 9 ); - Text_IO.Put( " --> " ); - Ada.Integer_Text_IO.Put( Integer( Diff.TV_Sec ), 1 ); - Text_IO.Put( ":" ); - Ada.Integer_Text_IO.Put( Integer( Diff.TV_Nsec ), 9 ); - Text_IO.New_Line; - - end loop; - - delay( 1.0 ); - - TEXT_IO.PUT_LINE( "*** END OF NANOSECOND CLOCK TEST ***" ); - - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end INIT; - -end SPTEST; diff --git a/c/src/ada-tests/samples/nsecs/sptest.ads b/c/src/ada-tests/samples/nsecs/sptest.ads deleted file mode 100644 index 97fa00ac2c..0000000000 --- a/c/src/ada-tests/samples/nsecs/sptest.ads +++ /dev/null @@ -1,39 +0,0 @@ --- --- SPTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for the Nsecs Test of the RTEMS --- Sample 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; - -package SPTEST is - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - -end SPTEST; diff --git a/c/src/ada-tests/samples/ticker/Makefile.am b/c/src/ada-tests/samples/ticker/Makefile.am deleted file mode 100644 index b21d6c464f..0000000000 --- a/c/src/ada-tests/samples/ticker/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -ada_ticker$(EXEEXT): ticker.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -init.$(OBJEXT): ../../support/init.c - $(COMPILE.c) -I$(srcdir) -c $< - -noinst_PROGRAMS = ada_ticker - -ada_ticker_SOURCES = ticker.adb config.h sptest.adb sptest.ads - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_ticker.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/samples/ticker/ada_ticker.scn b/c/src/ada-tests/samples/ticker/ada_ticker.scn deleted file mode 100644 index 89cd8b3204..0000000000 --- a/c/src/ada-tests/samples/ticker/ada_ticker.scn +++ /dev/null @@ -1,16 +0,0 @@ -*** TEST 1 *** -TA1 - clock_get - 9: 0: 0 12/31/1988 -TA2 - clock_get - 9: 0: 0 12/31/1988 -TA3 - clock_get - 9: 0: 0 12/31/1988 -TA1 - clock_get - 9: 0: 5 12/31/1988 -TA2 - clock_get - 9: 0:10 12/31/1988 -TA1 - clock_get - 9: 0:10 12/31/1988 -TA3 - clock_get - 9: 0:15 12/31/1988 -TA1 - clock_get - 9: 0:15 12/31/1988 -TA2 - clock_get - 9: 0:20 12/31/1988 -TA1 - clock_get - 9: 0:20 12/31/1988 -TA1 - clock_get - 9: 0:25 12/31/1988 -TA3 - clock_get - 9: 0:30 12/31/1988 -TA1 - clock_get - 9: 0:30 12/31/1988 -TA2 - clock_get - 9: 0:30 12/31/1988 -*** END OF CLOCK TICK TEST *** diff --git a/c/src/ada-tests/samples/ticker/config.h b/c/src/ada-tests/samples/ticker/config.h deleted file mode 100644 index 17d957c94a..0000000000 --- a/c/src/ada-tests/samples/ticker/config.h +++ /dev/null @@ -1,30 +0,0 @@ -/* 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_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#define CONFIGURE_MAXIMUM_TASKS 4 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/samples/ticker/sptest.adb b/c/src/ada-tests/samples/ticker/sptest.adb deleted file mode 100644 index 2de8b35b79..0000000000 --- a/c/src/ada-tests/samples/ticker/sptest.adb +++ /dev/null @@ -1,159 +0,0 @@ --- --- SPTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 1 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 INTERFACES; use INTERFACES; -with TEST_SUPPORT; -with TEXT_IO; -with RTEMS.CLOCK; - -package body SPTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - TIME : RTEMS.TIME_OF_DAY; - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TEST 1 ***" ); - - TIME := ( 1988, 12, 31, 9, 0, 0, 0 ); - - RTEMS.CLOCK.SET( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET" ); - - SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); - SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' ); - SPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' ); - - 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.CREATE( - SPTEST.TASK_NAME( 2 ), - 1, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 2 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 3 ), - 1, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 3 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA3" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 1 ), - SPTEST.TASK_1_THROUGH_3'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 2 ), - SPTEST.TASK_1_THROUGH_3'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 3 ), - SPTEST.TASK_1_THROUGH_3'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA3" ); - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- TASK_1_THROUGH_3 --- - - procedure TASK_1_THROUGH_3 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - TID : RTEMS.ID; - TIME : RTEMS.TIME_OF_DAY; - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.TASKS.IDENT( RTEMS.SELF, RTEMS.SEARCH_ALL_NODES, TID, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF SELF" ); - - loop - - RTEMS.CLOCK.GET_TOD( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); - - if TIME.SECOND >= 35 then - TEXT_IO.PUT_LINE( "*** END OF CLOCK TICK TEST ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - end if; - - TEST_SUPPORT.PUT_NAME( - SPTEST.TASK_NAME( TEST_SUPPORT.TASK_NUMBER( TID ) ), - FALSE - ); - - TEST_SUPPORT.PRINT_TIME( "- clock_get - ", TIME, "" ); - TEXT_IO.NEW_LINE; - - RTEMS.TASKS.WAKE_AFTER( - TEST_SUPPORT.TASK_NUMBER( TID ) * 5 * - TEST_SUPPORT.TICKS_PER_SECOND, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - end loop; - - end TASK_1_THROUGH_3; - -end SPTEST; diff --git a/c/src/ada-tests/samples/ticker/sptest.ads b/c/src/ada-tests/samples/ticker/sptest.ads deleted file mode 100644 index 8753d3edad..0000000000 --- a/c/src/ada-tests/samples/ticker/sptest.ads +++ /dev/null @@ -1,60 +0,0 @@ --- --- SPTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 1 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; - -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 .. 3 ) of RTEMS.ID; - TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- TASK_1_THROUGH_3 --- --- DESCRIPTION: --- --- This is the body of the RTEMS tasks which constitute this test. --- - - procedure TASK_1_THROUGH_3 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_1_THROUGH_3); - -end SPTEST; diff --git a/c/src/ada-tests/samples/ticker/ticker.adb b/c/src/ada-tests/samples/ticker/ticker.adb deleted file mode 100644 index 08a1fb9e31..0000000000 --- a/c/src/ada-tests/samples/ticker/ticker.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test Ticker of the Sample 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 Ticker 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 Ticker; - diff --git a/c/src/ada-tests/sptests/Makefile.am b/c/src/ada-tests/sptests/Makefile.am deleted file mode 100644 index 7edeb6fa4e..0000000000 --- a/c/src/ada-tests/sptests/Makefile.am +++ /dev/null @@ -1,28 +0,0 @@ -_SUBDIRS = -_SUBDIRS += sp01 -_SUBDIRS += sp02 -_SUBDIRS += sp03 -_SUBDIRS += sp04 -_SUBDIRS += sp05 -_SUBDIRS += sp06 -_SUBDIRS += sp07 -_SUBDIRS += sp08 -_SUBDIRS += sp09 -_SUBDIRS += sp11 -_SUBDIRS += sp12 -_SUBDIRS += sp13 -_SUBDIRS += sp14 -_SUBDIRS += sp15 -_SUBDIRS += sp16 -_SUBDIRS += sp17 -_SUBDIRS += sp19 -_SUBDIRS += sp20 -_SUBDIRS += sp22 -_SUBDIRS += sp23 -_SUBDIRS += sp24 -_SUBDIRS += sp25 -_SUBDIRS += spname01 -_SUBDIRS += spatcb01 - -include $(top_srcdir)/../../../testsuites/automake/subdirs.am -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/sptests/sp01/Makefile.am b/c/src/ada-tests/sptests/sp01/Makefile.am deleted file mode 100644 index fbbc8374c0..0000000000 --- a/c/src/ada-tests/sptests/sp01/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_sp01 -ada_sp01_SOURCES = sp01.adb config.h sptest.adb sptest.ads -ada_sp01_SOURCES += ../../support/init.c - -ada_sp01$(EXEEXT): sp01.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_sp01.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/sptests/sp01/ada_sp01.scn b/c/src/ada-tests/sptests/sp01/ada_sp01.scn deleted file mode 100644 index 7ba3bea626..0000000000 --- a/c/src/ada-tests/sptests/sp01/ada_sp01.scn +++ /dev/null @@ -1,16 +0,0 @@ -*** TEST 1 *** -TA1 - clock_get - 9: 0: 0 12/31/1988 -TA2 - clock_get - 9: 0: 0 12/31/1988 -TA3 - clock_get - 9: 0: 0 12/31/1988 -TA1 - clock_get - 9: 0: 5 12/31/1988 -TA1 - clock_get - 9: 0:10 12/31/1988 -TA2 - clock_get - 9: 0:10 12/31/1988 -TA1 - clock_get - 9: 0:15 12/31/1988 -TA3 - clock_get - 9: 0:15 12/31/1988 -TA1 - clock_get - 9: 0:20 12/31/1988 -TA2 - clock_get - 9: 0:20 12/31/1988 -TA1 - clock_get - 9: 0:25 12/31/1988 -TA1 - clock_get - 9: 0:30 12/31/1988 -TA3 - clock_get - 9: 0:30 12/31/1988 -TA2 - clock_get - 9: 0:30 12/31/1988 -*** END OF TEST 1 *** diff --git a/c/src/ada-tests/sptests/sp01/config.h b/c/src/ada-tests/sptests/sp01/config.h deleted file mode 100644 index 3a11342306..0000000000 --- a/c/src/ada-tests/sptests/sp01/config.h +++ /dev/null @@ -1,30 +0,0 @@ -/* config.h - * - * This include file defines the Configuration Table for this test. - * - * COPYRIGHT (c) 1989-1997. - * 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_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#define CONFIGURE_MAXIMUM_TASKS 4 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/sptests/sp01/sp01.adb b/c/src/ada-tests/sptests/sp01/sp01.adb deleted file mode 100644 index 656a6ff009..0000000000 --- a/c/src/ada-tests/sptests/sp01/sp01.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test SP01 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 SP01 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 SP01; - diff --git a/c/src/ada-tests/sptests/sp01/sptest.adb b/c/src/ada-tests/sptests/sp01/sptest.adb deleted file mode 100644 index 46e48e9b04..0000000000 --- a/c/src/ada-tests/sptests/sp01/sptest.adb +++ /dev/null @@ -1,159 +0,0 @@ --- --- SPTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 1 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 INTERFACES; use INTERFACES; -with TEST_SUPPORT; -with TEXT_IO; -with RTEMS.CLOCK; - -package body SPTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - TIME : RTEMS.TIME_OF_DAY; - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TEST 1 ***" ); - - TIME := ( 1988, 12, 31, 9, 0, 0, 0 ); - - RTEMS.CLOCK.SET( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET" ); - - SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); - SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' ); - SPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 1 ), - 1, - 2048, - RTEMS.INTERRUPT_LEVEL( 31 ), - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 2 ), - 1, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 2 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 3 ), - 1, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 3 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA3" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 1 ), - SPTEST.TASK_1_THROUGH_3'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 2 ), - SPTEST.TASK_1_THROUGH_3'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 3 ), - SPTEST.TASK_1_THROUGH_3'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA3" ); - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- TASK_1_THROUGH_3 --- - - procedure TASK_1_THROUGH_3 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - TID : RTEMS.ID; - TIME : RTEMS.TIME_OF_DAY; - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.TASKS.IDENT( RTEMS.SELF, RTEMS.SEARCH_ALL_NODES, TID, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF SELF" ); - - loop - - RTEMS.CLOCK.GET_TOD( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); - - if TIME.SECOND >= 35 then - TEXT_IO.PUT_LINE( "*** END OF TEST 1 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - end if; - - TEST_SUPPORT.PUT_NAME( - SPTEST.TASK_NAME( TEST_SUPPORT.TASK_NUMBER( TID ) ), - FALSE - ); - - TEST_SUPPORT.PRINT_TIME( "- clock_get - ", TIME, "" ); - TEXT_IO.NEW_LINE; - - RTEMS.TASKS.WAKE_AFTER( - TEST_SUPPORT.TASK_NUMBER( TID ) * 5 * - TEST_SUPPORT.TICKS_PER_SECOND, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - end loop; - - end TASK_1_THROUGH_3; - -end SPTEST; diff --git a/c/src/ada-tests/sptests/sp01/sptest.ads b/c/src/ada-tests/sptests/sp01/sptest.ads deleted file mode 100644 index 8753d3edad..0000000000 --- a/c/src/ada-tests/sptests/sp01/sptest.ads +++ /dev/null @@ -1,60 +0,0 @@ --- --- SPTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 1 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; - -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 .. 3 ) of RTEMS.ID; - TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- TASK_1_THROUGH_3 --- --- DESCRIPTION: --- --- This is the body of the RTEMS tasks which constitute this test. --- - - procedure TASK_1_THROUGH_3 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_1_THROUGH_3); - -end SPTEST; diff --git a/c/src/ada-tests/sptests/sp02/Makefile.am b/c/src/ada-tests/sptests/sp02/Makefile.am deleted file mode 100644 index d23a4e6fdb..0000000000 --- a/c/src/ada-tests/sptests/sp02/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_sp02 -ada_sp02_SOURCES = sp02.adb config.h sptest.adb sptest.ads -ada_sp02_SOURCES += ../../support/init.c - -ada_sp02$(EXEEXT): sp02.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_sp02.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/sptests/sp02/ada_sp02.scn b/c/src/ada-tests/sptests/sp02/ada_sp02.scn deleted file mode 100644 index 722dfff1de..0000000000 --- a/c/src/ada-tests/sptests/sp02/ada_sp02.scn +++ /dev/null @@ -1,15 +0,0 @@ -*** TEST 2 *** -INIT - task_wake_after - yielding processor -PREEMPT - task_delete - deleting self -INIT - suspending TA2 while middle task on a ready chain -TA1 - task_wake_after - sleep 1 second -TA2 - task_wake_after - sleep 1 minute -TA3 - task_wake_after - sleep 5 seconds -TA1 - task_ident - tid of TA2 (16#A010004#) -TA1 - task_ident - tid of TA3 (16#A010002#) -TA1 - task_set_priority - set TA3's priority to 2 -TA1 - task_suspend - suspend TA2 -TA1 - task_delete - delete TA2 -TA1 - task_wake_after - sleep for 5 seconds -TA3 - task_delete - delete self -*** END OF TEST 2 *** diff --git a/c/src/ada-tests/sptests/sp02/config.h b/c/src/ada-tests/sptests/sp02/config.h deleted file mode 100644 index 17d957c94a..0000000000 --- a/c/src/ada-tests/sptests/sp02/config.h +++ /dev/null @@ -1,30 +0,0 @@ -/* 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_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#define CONFIGURE_MAXIMUM_TASKS 4 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/sptests/sp02/sp02.adb b/c/src/ada-tests/sptests/sp02/sp02.adb deleted file mode 100644 index adbc97f66c..0000000000 --- a/c/src/ada-tests/sptests/sp02/sp02.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test SP02 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 SP02 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 SP02; - diff --git a/c/src/ada-tests/sptests/sp02/sptest.adb b/c/src/ada-tests/sptests/sp02/sptest.adb deleted file mode 100644 index 45fb4ac5c2..0000000000 --- a/c/src/ada-tests/sptests/sp02/sptest.adb +++ /dev/null @@ -1,327 +0,0 @@ --- --- SPTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 2 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 INTERFACES; use INTERFACES; -with TEST_SUPPORT; -with TEXT_IO; -with UNSIGNED32_IO; - -package body SPTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TEST 2 ***" ); - - SPTEST.PREEMPT_TASK_NAME := RTEMS.BUILD_NAME( 'P', 'R', 'M', 'T' ); - - RTEMS.TASKS.CREATE( - SPTEST.PREEMPT_TASK_NAME, - 1, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.PREEMPT_TASK_ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF PREEMPT" ); - - RTEMS.TASKS.START( - SPTEST.PREEMPT_TASK_ID, - SPTEST.PREEMPT_TASK'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF PREEMPT" ); - - TEXT_IO.PUT_LINE( "INIT - task_wake_after - yielding processor" ); - RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); - SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' ); - SPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 1 ), - 3, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 2 ), - 3, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 2 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 3 ), - 3, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 3 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA3" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 1 ), - SPTEST.TASK_1'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 2 ), - SPTEST.TASK_2'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 3 ), - SPTEST.TASK_3'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA3" ); - - TEXT_IO.PUT_LINE( - "INIT - suspending TA2 while middle task on a ready chain" - ); - - RTEMS.TASKS.SUSPEND( SPTEST.TASK_ID( 2 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND OF TA2" ); - - RTEMS.TASKS.DELETE( SPTEST.TASK_ID( 1 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA1" ); - - RTEMS.TASKS.DELETE( SPTEST.TASK_ID( 2 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA2" ); - - RTEMS.TASKS.DELETE( SPTEST.TASK_ID( 3 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA3" ); - - 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.CREATE( - SPTEST.TASK_NAME( 2 ), - 3, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 2 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 3 ), - 3, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 3 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA3" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 1 ), - SPTEST.TASK_1'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 2 ), - SPTEST.TASK_2'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 3 ), - SPTEST.TASK_3'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA3" ); - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- PREEMPT_TASK --- - - procedure PREEMPT_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.PUT_LINE( "PREEMPT - task_delete - deleting self" ); - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF PREEMPT" ); - - end PREEMPT_TASK; - --- --- TASK_1 --- - - procedure TASK_1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - TID2 : RTEMS.ID; - TID3 : RTEMS.ID; - STATUS : RTEMS.STATUS_CODES; - PREVIOUS_PRIORITY : RTEMS.TASKS.PRIORITY; - begin - - TEXT_IO.PUT_LINE( "TA1 - task_wake_after - sleep 1 second" ); - RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - RTEMS.TASKS.IDENT( - SPTEST.TASK_NAME( 2 ), - RTEMS.SEARCH_ALL_NODES, - TID2, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF TA2" ); - - TEXT_IO.PUT( "TA1 - task_ident - tid of TA2 (" ); - UNSIGNED32_IO.PUT( TID2, WIDTH => 8, BASE => 10#16# ); - TEXT_IO.PUT_LINE( ")" ); - - RTEMS.TASKS.IDENT( - SPTEST.TASK_NAME( 3 ), - RTEMS.SEARCH_ALL_NODES, - TID3, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF TA3" ); - - TEXT_IO.PUT( "TA1 - task_ident - tid of TA3 (" ); - UNSIGNED32_IO.PUT( TID3, WIDTH => 8, BASE => 10#16# ); - TEXT_IO.PUT_LINE( ")" ); - - RTEMS.TASKS.SET_PRIORITY( TID3, 2, PREVIOUS_PRIORITY, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" ); - - TEXT_IO.PUT_LINE( - "TA1 - task_set_priority - set TA3's priority to 2" - ); - - TEXT_IO.PUT_LINE( "TA1 - task_suspend - suspend TA2" ); - RTEMS.TASKS.SUSPEND( TID2, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND OF TA2" ); - - TEXT_IO.PUT_LINE( "TA1 - task_delete - delete TA2" ); - RTEMS.TASKS.DELETE( TID2, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA2" ); - - TEXT_IO.PUT_LINE( "TA1 - task_wake_after - sleep for 5 seconds" ); - RTEMS.TASKS.WAKE_AFTER( 5 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - TEXT_IO.PUT_LINE( "*** END OF TEST 2 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end TASK_1; - --- --- TASK_2 --- - - procedure TASK_2 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.PUT_LINE( "TA2 - task_wake_after - sleep 1 minute" ); - RTEMS.TASKS.WAKE_AFTER( 60 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER IN TA2" ); - - end TASK_2; - --- --- TASK_3 --- - - procedure TASK_3 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.PUT_LINE( "TA3 - task_wake_after - sleep 5 seconds" ); - RTEMS.TASKS.WAKE_AFTER( 5 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER IN TA3" ); - - TEXT_IO.PUT_LINE( "TA3 - task_delete - delete self" ); - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA3" ); - - end TASK_3; - -end SPTEST; diff --git a/c/src/ada-tests/sptests/sp02/sptest.ads b/c/src/ada-tests/sptests/sp02/sptest.ads deleted file mode 100644 index 20122e3cbd..0000000000 --- a/c/src/ada-tests/sptests/sp02/sptest.ads +++ /dev/null @@ -1,102 +0,0 @@ --- --- SPTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 2 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; - -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 .. 3 ) of RTEMS.ID; - TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; - - PREEMPT_TASK_ID : RTEMS.ID; - PREEMPT_TASK_NAME : RTEMS.NAME; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- PREEMPT_TASK --- --- DESCRIPTION: --- --- This RTEMS task tests the basic preemption capability. --- - - procedure PREEMPT_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, PREEMPT_TASK); - --- --- TASK_1 --- --- DESCRIPTION: --- --- This RTEMS task tests some of the capabilities of the Task Manager. --- - - procedure TASK_1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_1); - --- --- TASK_2 --- --- DESCRIPTION: --- --- This RTEMS task tests some of the capabilities of the Task Manager. --- - - procedure TASK_2 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_2); - --- --- TASK_3 --- --- DESCRIPTION: --- --- This RTEMS task tests some of the capabilities of the Task Manager. --- - - procedure TASK_3 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_3); - -end SPTEST; diff --git a/c/src/ada-tests/sptests/sp03/Makefile.am b/c/src/ada-tests/sptests/sp03/Makefile.am deleted file mode 100644 index cdb256c07f..0000000000 --- a/c/src/ada-tests/sptests/sp03/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_sp03 -ada_sp03_SOURCES = sp03.adb config.h sptest.adb sptest.ads -ada_sp03_SOURCES += ../../support/init.c - -ada_sp03$(EXEEXT): sp03.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_sp03.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/sptests/sp03/ada_sp03.scn b/c/src/ada-tests/sptests/sp03/ada_sp03.scn deleted file mode 100644 index a2a04c6951..0000000000 --- a/c/src/ada-tests/sptests/sp03/ada_sp03.scn +++ /dev/null @@ -1,26 +0,0 @@ -*** TEST 3 *** -TA1 sets clock: 9:15: 0 12/31/1988 -TA1 going to sleep: 9:15: 0 12/31/1988 -TA2 9:15: 1 12/31/1988 -TA2 9:15: 2 12/31/1988 -TA2 9:15: 3 12/31/1988 -TA2 9:15: 4 12/31/1988 -TA1 awakened: 9:15: 5 12/31/1988 -TA1 going to sleep: 9:15: 5 12/31/1988 -TA2 9:15: 5 12/31/1988 -TA2 9:15: 6 12/31/1988 -TA2 9:15: 7 12/31/1988 -TA2 9:15: 8 12/31/1988 -TA2 9:15: 9 12/31/1988 -TA1 awakened: 9:15:10 12/31/1988 -TA1 going to sleep: 9:15:10 12/31/1988 -TA2 9:15:10 12/31/1988 -TA2 9:15:11 12/31/1988 -TA2 9:15:12 12/31/1988 -TA2 9:15:13 12/31/1988 -TA2 9:15:14 12/31/1988 -TA1 awakened: 9:15:15 12/31/1988 -TA1 going to sleep: 9:15:15 12/31/1988 -TA2 9:15:15 12/31/1988 -TA2 9:15:16 12/31/1988 -*** END OF TEST 3 *** diff --git a/c/src/ada-tests/sptests/sp03/config.h b/c/src/ada-tests/sptests/sp03/config.h deleted file mode 100644 index 393afc4b28..0000000000 --- a/c/src/ada-tests/sptests/sp03/config.h +++ /dev/null @@ -1,30 +0,0 @@ -/* 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_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#define CONFIGURE_MAXIMUM_TASKS 3 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/sptests/sp03/sp03.adb b/c/src/ada-tests/sptests/sp03/sp03.adb deleted file mode 100644 index 5f081d4879..0000000000 --- a/c/src/ada-tests/sptests/sp03/sp03.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test SP03 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 SP03 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 SP03; - diff --git a/c/src/ada-tests/sptests/sp03/sptest.adb b/c/src/ada-tests/sptests/sp03/sptest.adb deleted file mode 100644 index 24be47eb1c..0000000000 --- a/c/src/ada-tests/sptests/sp03/sptest.adb +++ /dev/null @@ -1,169 +0,0 @@ --- --- SPTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 3 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 INTERFACES; use INTERFACES; -with TEST_SUPPORT; -with TEXT_IO; -with RTEMS.CLOCK; - -package body SPTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TEST 3 ***" ); - - SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); - SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 1 ), - 1, - RTEMS.MINIMUM_STACK_SIZE, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 2 ), - 1, - RTEMS.MINIMUM_STACK_SIZE, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 2 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 1 ), - SPTEST.TASK_1'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 2 ), - SPTEST.TASK_2'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" ); - - 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); - TIME : RTEMS.TIME_OF_DAY; - STATUS : RTEMS.STATUS_CODES; - begin - - TIME := ( 1988, 12, 31, 9, 15, 0, 0 ); - - RTEMS.CLOCK.SET( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET" ); - - TEST_SUPPORT.PUT_NAME( SPTEST.TASK_NAME( 1 ), FALSE ); - TEST_SUPPORT.PRINT_TIME( "sets clock: ", TIME, "" ); - TEXT_IO.NEW_LINE; - - loop - - RTEMS.CLOCK.GET_TOD( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); - - TEST_SUPPORT.PUT_NAME( SPTEST.TASK_NAME( 1 ), FALSE ); - TEST_SUPPORT.PRINT_TIME( "going to sleep: ", TIME, "" ); - TEXT_IO.NEW_LINE; - - TIME.SECOND := TIME.SECOND + 5; - TIME.MINUTE := TIME.MINUTE + (TIME.SECOND / 60 ); - TIME.SECOND := TIME.SECOND mod 60; - TIME.HOUR := TIME.HOUR + (TIME.MINUTE / 60 ); - TIME.MINUTE := TIME.MINUTE mod 60; - TIME.HOUR := TIME.HOUR mod 24; - - RTEMS.TASKS.WAKE_WHEN( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_WHEN" ); - - TEST_SUPPORT.PUT_NAME( SPTEST.TASK_NAME( 1 ), FALSE ); - TEST_SUPPORT.PRINT_TIME( "awakened: ", TIME, "" ); - TEXT_IO.NEW_LINE; - - end loop; - - end TASK_1; - --- --- TASK_2 --- - - procedure TASK_2 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - TIME : RTEMS.TIME_OF_DAY; - STATUS : RTEMS.STATUS_CODES; - begin - - loop - - RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - RTEMS.CLOCK.GET_TOD( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); - - if TIME.SECOND >= 17 then - TEXT_IO.PUT_LINE( "*** END OF TEST 3 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - end if; - - TEST_SUPPORT.PUT_NAME( SPTEST.TASK_NAME( 2 ), FALSE ); - TEST_SUPPORT.PRINT_TIME( " ", TIME, "" ); - TEXT_IO.NEW_LINE; - - end loop; - - end TASK_2; - -end SPTEST; diff --git a/c/src/ada-tests/sptests/sp03/sptest.ads b/c/src/ada-tests/sptests/sp03/sptest.ads deleted file mode 100644 index 60a2531ba1..0000000000 --- a/c/src/ada-tests/sptests/sp03/sptest.ads +++ /dev/null @@ -1,75 +0,0 @@ --- --- SPTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 3 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; - -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 .. 3 ) of RTEMS.ID; - TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; - --- --- 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 TASK_WAKE_WHEN directive of --- the Task Manager. --- - - procedure TASK_1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_1); - --- --- TASK_2 --- --- DESCRIPTION: --- --- This RTEMS task tests the TASK_WAKE_AFTER directive of --- the Task Manager. --- - - procedure TASK_2 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_2); - -end SPTEST; diff --git a/c/src/ada-tests/sptests/sp04/Makefile.am b/c/src/ada-tests/sptests/sp04/Makefile.am deleted file mode 100644 index cbc8cf294b..0000000000 --- a/c/src/ada-tests/sptests/sp04/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_sp04 -ada_sp04_SOURCES = sp04.adb config.h sptest.adb sptest.ads -ada_sp04_SOURCES += ../../support/init.c - -ada_sp04$(EXEEXT): sp04.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_sp04.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/sptests/sp04/README b/c/src/ada-tests/sptests/sp04/README deleted file mode 100644 index 43ff165261..0000000000 --- a/c/src/ada-tests/sptests/sp04/README +++ /dev/null @@ -1,9 +0,0 @@ -This test is broken as it is currently implemented. It is illegal for -a task to do Ada IO during a extension since the Ada run-time uses -locks to safeguard data structures. Dispatching is disabled and the -call to Text_IO in the Switch extension will lock the system up. - -The proper solution is to have the Switch extension lock task and -time when it a switch occurs and have a single task print this -information as necessary. - diff --git a/c/src/ada-tests/sptests/sp04/ada_sp04.scn b/c/src/ada-tests/sptests/sp04/ada_sp04.scn deleted file mode 100644 index 76d9f0c665..0000000000 --- a/c/src/ada-tests/sptests/sp04/ada_sp04.scn +++ /dev/null @@ -1,25 +0,0 @@ -*** TEST 4 *** -TA1 - task_suspend - on Task 2 -TA1 - task_suspend - on Task 3 -TA1 - killing time -TA1 - task_resume - on Task 2 -TA1 - task_resume - on Task 3 -TA1 - task_mode - change mode to NO PREEMPT -TA1 - 9:15:10 12/31/1988 -TA1 - 9:15:11 12/31/1988 -TA1 - 9:15:12 12/31/1988 -TA1 - 9:15:13 12/31/1988 -TA1 - 9:15:14 12/31/1988 -TA1 - 9:15:15 12/31/1988 -TA1 - task_mode - change mode to PREEMPT -TA1 - 9:15: 0 12/31/1988 -TA2 - 9:15: 4 12/31/1988 -TA3 - 9:15: 5 12/31/1988 -TA1 - 9:15: 6 12/31/1988 -TA2 - 9:15: 7 12/31/1988 -TA3 - 9:15: 8 12/31/1988 -TA1 - 9:15: 9 12/31/1988 -TA2 - 9:15:16 12/31/1988 -TA3 - 9:15:17 12/31/1988 -TA1 - 9:15:18 12/31/1988 -*** END OF TEST 4 *** diff --git a/c/src/ada-tests/sptests/sp04/config.h b/c/src/ada-tests/sptests/sp04/config.h deleted file mode 100644 index 45fc324df8..0000000000 --- a/c/src/ada-tests/sptests/sp04/config.h +++ /dev/null @@ -1,33 +0,0 @@ -/* config.h - * - * This include file defines the Configuration Table for this test. - * - * COPYRIGHT (c) 1989-1997. - * 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_USER_EXTENSIONS 1 -#define CONFIGURE_TICKS_PER_TIMESLICE 100 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#define CONFIGURE_MAXIMUM_TASKS 4 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/sptests/sp04/sp04.adb b/c/src/ada-tests/sptests/sp04/sp04.adb deleted file mode 100644 index 9d91593b36..0000000000 --- a/c/src/ada-tests/sptests/sp04/sp04.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test SP04 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 SP04 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 SP04; - diff --git a/c/src/ada-tests/sptests/sp04/sptest.adb b/c/src/ada-tests/sptests/sp04/sptest.adb deleted file mode 100644 index 01283d3fec..0000000000 --- a/c/src/ada-tests/sptests/sp04/sptest.adb +++ /dev/null @@ -1,348 +0,0 @@ --- --- SPTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 4 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 INTERFACES; use INTERFACES; -with TEST_SUPPORT; -with TEXT_IO; -with RTEMS.CLOCK; -with RTEMS.EXTENSION; -with RTEMS.FATAL; - -package body SPTEST is - - TestsFinished : Boolean := False; - pragma Volatile (TestsFinished); - - type Task_Event is record - Task_Index : RTEMS.Unsigned32; - When_Switched : RTEMS.Time_Of_Day; - end record; - - Task_Events : array (1 .. 15) of Task_Event; - Task_Events_Index : Natural := Task_Events'First; - - procedure Log_Task_Event ( - Task_Index : RTEMS.Unsigned32; - When_Switched : RTEMS.Time_Of_Day - ) is - begin - if Task_Events_Index = Task_Events'Last then - RTEMS.Fatal.Error_Occurred ( 1 ); -- no other choice - else - Task_Events (Task_Events_Index).Task_Index := Task_Index; - Task_Events (Task_Events_Index).When_Switched := When_Switched; - Task_Events_Index := Task_Events_Index + 1; - end if; - end Log_Task_Event; - - procedure Flush_Task_Event_Log is - begin - for I in Task_Events'First .. Task_Events_Index - 1 loop - - TEST_SUPPORT.PUT_NAME( - SPTEST.TASK_NAME( Task_Events (I).Task_Index ), FALSE - ); - TEST_SUPPORT.PRINT_TIME( "- ", Task_Events (I).When_Switched, "" ); - TEXT_IO.NEW_LINE; - - end loop; - - end Flush_Task_Event_Log; - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - TIME : RTEMS.TIME_OF_DAY; - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TEST 4 ***" ); - - TIME := ( 1988, 12, 31, 9, 15, 0, 0 ); - - RTEMS.CLOCK.SET( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET" ); - - SPTEST.EXTENSION_NAME( 1 ) := RTEMS.BUILD_NAME( 'E', 'X', 'T', ' ' ); - - RTEMS.EXTENSION.CREATE( - SPTEST.EXTENSION_NAME( 1 ), - SPTEST.EXTENSIONS'ACCESS, - EXTENSION_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EXTENSION_CREATE" ); - - SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); - SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' ); - SPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' ); - - SPTEST.RUN_COUNT( 1 ) := 0; - SPTEST.RUN_COUNT( 2 ) := 0; - SPTEST.RUN_COUNT( 3 ) := 0; - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 1 ), - 1, - 2048, - RTEMS.TIMESLICE, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 2 ), - 1, - 2048, - RTEMS.TIMESLICE, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 2 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 3 ), - 1, - 2048, - RTEMS.TIMESLICE, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 3 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA3" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 1 ), - SPTEST.TASK_1'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 2 ), - SPTEST.TASK_2'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 3 ), - SPTEST.TASK_3'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA3" ); - - 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); - SECONDS : RTEMS.UNSIGNED32; - OLD_SECONDS : RTEMS.UNSIGNED32; - PREVIOUS_MODE : RTEMS.MODE; - TIME : RTEMS.TIME_OF_DAY; - START_TIME : RTEMS.INTERVAL; - END_TIME : RTEMS.INTERVAL; - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.PUT_LINE( "TA1 - task_suspend - on Task 2" ); - RTEMS.TASKS.SUSPEND( TASK_ID( 2 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND OF TA2" ); - - TEXT_IO.PUT_LINE( "TA1 - task_suspend - on Task 3" ); - RTEMS.TASKS.SUSPEND( TASK_ID( 3 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND OF TA3" ); - - TEXT_IO.PUT_LINE( "TA1 - killing time" ); - - RTEMS.CLOCK.GET_SECONDS_SINCE_EPOCH( START_TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_SECONDS_SINCE_EPOCH" ); - - loop - RTEMS.CLOCK.GET_SECONDS_SINCE_EPOCH( START_TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED(STATUS, "CLOCK_GET_SECONDS_SINCE_EPOCH"); - - exit when END_TIME > (START_TIME + 2); - end loop; - - TEXT_IO.PUT_LINE( "TA1 - task_resume - on Task 2" ); - RTEMS.TASKS.RESUME( TASK_ID( 2 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESUME OF TA2" ); - - TEXT_IO.PUT_LINE( "TA1 - task_resume - on Task 3" ); - RTEMS.TASKS.RESUME( TASK_ID( 3 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESUME OF TA3" ); - - loop - - if SPTEST.RUN_COUNT( 1 ) = 3 then - - TEXT_IO.PUT_LINE( - "TA1 - task_mode - change mode to NO PREEMPT" - ); - RTEMS.TASKS.MODE( - RTEMS.NO_PREEMPT, - RTEMS.PREEMPT_MASK, - PREVIOUS_MODE, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); - - RTEMS.CLOCK.GET_TOD( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); - - OLD_SECONDS := TIME.SECOND; - - SECONDS := 0; - loop - - exit when SECONDS >= 6; - - RTEMS.CLOCK.GET_TOD( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); - - if TIME.SECOND /= OLD_SECONDS then - OLD_SECONDS := TIME.SECOND; - SECONDS := SECONDS + 1; - TEST_SUPPORT.PRINT_TIME( "TA1 - ", TIME, "" ); - TEXT_IO.NEW_LINE; - end if; - - end loop; - - TEXT_IO.PUT_LINE( - "TA1 - task_mode - change mode to PREEMPT" - ); - - RTEMS.TASKS.MODE( - RTEMS.PREEMPT, - RTEMS.PREEMPT_MASK, - PREVIOUS_MODE, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); - - while not TestsFinished loop - NULL; - END LOOP; - Flush_Task_Event_Log; - TEXT_IO.PUT_LINE( "*** END OF TEST 4 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end if; - - end loop; - - end TASK_1; - --- --- TASK_2 --- - - procedure TASK_2 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - begin - - LOOP - NULL; - END LOOP; - - end TASK_2; - --- --- TASK_3 --- - - procedure TASK_3 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - begin - - LOOP - NULL; - END LOOP; - - end TASK_3; - --- --- TASK_SWITCH --- - - procedure TASK_SWITCH ( - UNUSED : in RTEMS.TCB_POINTER; - HEIR : in RTEMS.TCB_POINTER - ) is - pragma Unreferenced(UNUSED); - INDEX : RTEMS.UNSIGNED32; - TIME : RTEMS.TIME_OF_DAY; - STATUS : RTEMS.STATUS_CODES; - function TCB_To_ID ( - TCB : RTEMS.TCB_POINTER - ) return RTEMS.ID; - pragma Import (C, TCB_To_ID, "tcb_to_id" ); - - begin - - INDEX := TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( HEIR ) ); - - case INDEX is - when 1 | 2 | 3 => - SPTEST.RUN_COUNT( INDEX ) := SPTEST.RUN_COUNT( INDEX ) + 1; - - RTEMS.CLOCK.GET_TOD( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); - - Log_Task_Event ( INDEX, TIME ); - - if TIME.SECOND >= 16 then - TestsFinished := True; - end if; - - when others => - NULL; - end case; - - end TASK_SWITCH; - -end SPTEST; diff --git a/c/src/ada-tests/sptests/sp04/sptest.ads b/c/src/ada-tests/sptests/sp04/sptest.ads deleted file mode 100644 index 36f1202118..0000000000 --- a/c/src/ada-tests/sptests/sp04/sptest.ads +++ /dev/null @@ -1,136 +0,0 @@ --- --- SPTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 4 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; - -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 .. 3 ) of RTEMS.ID; - TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; - --- --- These arrays contain the IDs and NAMEs of all RTEMS extensions created --- by this test. --- - - EXTENSION_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; - EXTENSION_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; - --- --- This array contains the number of times each of the test tasks has --- been context switched TO. --- - - RUN_COUNT : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.UNSIGNED32; - --- --- 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 some of the capabilities of the Task Manager. --- - - procedure TASK_1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_1); - --- --- TASK_2 --- --- DESCRIPTION: --- --- This RTEMS task is used as a background task to suspend, resume, --- and context switch to. --- - - procedure TASK_2 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_2); - --- --- TASK_3 --- --- DESCRIPTION: --- --- This RTEMS task is used as a background task to suspend, resume, --- and context switch to. --- - - procedure TASK_3 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_3); - --- --- TASK_SWITCH --- --- DESCRIPTION: --- --- This subprogram is the TASK_SWITCH extension for this test. --- It is invoked at each context switch and counts the number --- of times each application task has been context switched to. --- - - procedure TASK_SWITCH ( - UNUSED : in RTEMS.TCB_POINTER; - HEIR : in RTEMS.TCB_POINTER - ); - pragma Convention (C, TASK_SWITCH); - --- --- This is the User Extension Table for this test. --- - - EXTENSIONS : aliased RTEMS.EXTENSIONS_TABLE := - ( - NULL, -- Task create - NULL, -- Task start - NULL, -- Task restart - NULL, -- Task delete - SPTEST.TASK_SWITCH'ACCESS, -- Task switch - NULL, -- Task post switch - NULL, -- Task begin - NULL, -- Task exitted - NULL -- Fatal error - ); - -end SPTEST; diff --git a/c/src/ada-tests/sptests/sp05/Makefile.am b/c/src/ada-tests/sptests/sp05/Makefile.am deleted file mode 100644 index c66d419a14..0000000000 --- a/c/src/ada-tests/sptests/sp05/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_sp05 -ada_sp05_SOURCES = sp05.adb config.h sptest.adb sptest.ads -ada_sp05_SOURCES += ../../support/init.c - -ada_sp05$(EXEEXT): sp05.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_sp05.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/sptests/sp05/ada_sp05.scn b/c/src/ada-tests/sptests/sp05/ada_sp05.scn deleted file mode 100644 index 591397f760..0000000000 --- a/c/src/ada-tests/sptests/sp05/ada_sp05.scn +++ /dev/null @@ -1,47 +0,0 @@ -*** TEST 5 *** -TA1 - task_wake_after - sleep 5 seconds -TA2 - task_suspend - suspend self -TA3 - task_suspend - suspend self -TA1 - task_suspend - suspend TA3 -TA1 - task_resume - resume TA2 -TA1 - task_wake_after - sleep 5 seconds -TA2 - task_wake_after - sleep 1 second -TA2 - task_wake_after - sleep 1 second -TA2 - task_wake_after - sleep 1 second -TA2 - task_wake_after - sleep 1 second -TA2 - task_wake_after - sleep 1 second -TA1 - task_suspend - suspend TA2 -TA1 - task_resume - resume TA3 -TA1 - task_wake_after - sleep 5 seconds -TA3 - task_wake_after - sleep 1 second -TA3 - task_wake_after - sleep 1 second -TA3 - task_wake_after - sleep 1 second -TA3 - task_wake_after - sleep 1 second -TA3 - task_wake_after - sleep 1 second -TA1 - task_suspend - suspend TA3 -TA1 - task_resume - resume TA2 -TA1 - task_wake_after - sleep 5 seconds -TA2 - task_wake_after - sleep 1 second -TA2 - task_wake_after - sleep 1 second -TA2 - task_wake_after - sleep 1 second -TA2 - task_wake_after - sleep 1 second -TA2 - task_wake_after - sleep 1 second -TA1 - task_suspend - suspend TA2 -TA1 - task_resume - resume TA3 -TA1 - task_wake_after - sleep 5 seconds -TA3 - task_wake_after - sleep 1 second -TA3 - task_wake_after - sleep 1 second -TA3 - task_wake_after - sleep 1 second -TA3 - task_wake_after - sleep 1 second -TA3 - task_wake_after - sleep 1 second -TA1 - task_suspend - suspend TA3 -TA1 - task_resume - resume TA2 -TA1 - task_wake_after - sleep 5 seconds -TA2 - task_wake_after - sleep 1 second -TA2 - task_wake_after - sleep 1 second -TA2 - task_wake_after - sleep 1 second -TA2 - task_wake_after - sleep 1 second -TA2 - task_wake_after - sleep 1 second -TA1 - task_suspend - suspend TA2 -TA1 - task_resume - resume TA3 -*** END OF TEST 5 *** diff --git a/c/src/ada-tests/sptests/sp05/config.h b/c/src/ada-tests/sptests/sp05/config.h deleted file mode 100644 index d85c77e62b..0000000000 --- a/c/src/ada-tests/sptests/sp05/config.h +++ /dev/null @@ -1,32 +0,0 @@ -/* 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_TICKS_PER_TIMESLICE 100 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#define CONFIGURE_MAXIMUM_TASKS 4 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/sptests/sp05/sp05.adb b/c/src/ada-tests/sptests/sp05/sp05.adb deleted file mode 100644 index 842657a699..0000000000 --- a/c/src/ada-tests/sptests/sp05/sp05.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test SP05 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 SP05 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 SP05; - diff --git a/c/src/ada-tests/sptests/sp05/sptest.adb b/c/src/ada-tests/sptests/sp05/sptest.adb deleted file mode 100644 index 1a9b974419..0000000000 --- a/c/src/ada-tests/sptests/sp05/sptest.adb +++ /dev/null @@ -1,224 +0,0 @@ --- --- SPTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 5 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 INTERFACES; use INTERFACES; -with TEST_SUPPORT; -with TEXT_IO; - -package body SPTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TEST 5 ***" ); - - SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); - SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' ); - SPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' ); - - 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.CREATE( - SPTEST.TASK_NAME( 2 ), - 1, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 2 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 3 ), - 1, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 3 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA3" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 1 ), - SPTEST.TASK_1'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 2 ), - SPTEST.TASK_2'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 3 ), - SPTEST.TASK_3'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA3" ); - - 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); - TID2 : RTEMS.ID; - TID3 : RTEMS.ID; - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.TASKS.IDENT( - SPTEST.TASK_NAME( 2 ), - 1, - TID2, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF TA2" ); - - RTEMS.TASKS.IDENT( - SPTEST.TASK_NAME( 3 ), - 1, - TID3, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF TA3" ); - - for PASS in 1 .. 3 - loop - - TEXT_IO.PUT_LINE( "TA1 - task_wake_after - sleep 5 seconds" ); - RTEMS.TASKS.WAKE_AFTER( 5 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER OF TA1" ); - - TEXT_IO.PUT_LINE( "TA1 - task_suspend - suspend TA3" ); - RTEMS.TASKS.SUSPEND( TID3, STATUS ); - if PASS = 1 then - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.ALREADY_SUSPENDED, - "TASK_SUSPEND OF TA3" - ); - else - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND OF TA3" ); - end if; - - TEXT_IO.PUT_LINE( "TA1 - task_resume - resume TA2" ); - RTEMS.TASKS.RESUME( TID2, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESUME OF TA2" ); - - TEXT_IO.PUT_LINE( "TA1 - task_wake_after - sleep 5 seconds" ); - RTEMS.TASKS.WAKE_AFTER( 5 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - TEXT_IO.PUT_LINE( "TA1 - task_suspend - suspend TA2" ); - RTEMS.TASKS.SUSPEND( TID2, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND OF TA2" ); - - TEXT_IO.PUT_LINE( "TA1 - task_resume - resume TA3" ); - RTEMS.TASKS.RESUME( TID3, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESUME OF TA3" ); - - end loop; - - TEXT_IO.PUT_LINE( "*** END OF TEST 5 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end TASK_1; - --- --- TASK_2 --- - - procedure TASK_2 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.PUT_LINE( "TA2 - task_suspend - suspend self" ); - RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND OF TA2" ); - - loop - TEXT_IO.PUT_LINE( "TA2 - task_wake_after - sleep 1 second" ); - RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER OF TA2" ); - end loop; - - end TASK_2; - --- --- TASK_3 --- - - procedure TASK_3 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.PUT_LINE( "TA3 - task_suspend - suspend self" ); - RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND OF TA3" ); - - loop - TEXT_IO.PUT_LINE( "TA3 - task_wake_after - sleep 1 second" ); - RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER OF TA3" ); - end loop; - - end TASK_3; - -end SPTEST; diff --git a/c/src/ada-tests/sptests/sp05/sptest.ads b/c/src/ada-tests/sptests/sp05/sptest.ads deleted file mode 100644 index 9fe136ec8b..0000000000 --- a/c/src/ada-tests/sptests/sp05/sptest.ads +++ /dev/null @@ -1,86 +0,0 @@ --- --- SPTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 5 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; - -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 .. 3 ) of RTEMS.ID; - TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; - --- --- 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 some of the capabilities of the Task Manager. --- - - procedure TASK_1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_1); - --- --- TASK_2 --- --- DESCRIPTION: --- --- This RTEMS task tests some of the capabilities of the Task Manager. --- - - procedure TASK_2 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_2); - --- --- TASK_3 --- --- DESCRIPTION: --- --- This RTEMS task tests the Message Queue Manager. --- - - procedure TASK_3 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_3); - -end SPTEST; diff --git a/c/src/ada-tests/sptests/sp06/Makefile.am b/c/src/ada-tests/sptests/sp06/Makefile.am deleted file mode 100644 index 538e0939f8..0000000000 --- a/c/src/ada-tests/sptests/sp06/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_sp06 -ada_sp06_SOURCES = sp06.adb config.h sptest.adb sptest.ads -ada_sp06_SOURCES += ../../support/init.c - -ada_sp06$(EXEEXT): sp06.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_sp06.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/sptests/sp06/ada_sp06.scn b/c/src/ada-tests/sptests/sp06/ada_sp06.scn deleted file mode 100644 index 8dc6c6afae..0000000000 --- a/c/src/ada-tests/sptests/sp06/ada_sp06.scn +++ /dev/null @@ -1,38 +0,0 @@ -*** TEST 6 *** -TA1 - is beginning to run -TA1 - restarting TA3 -TA2 - is beginning to run -TA2 - task_wake_after - sleep 1/2 second -TA2 - task_wake_after - sleep 1/2 second -TA1 - task_restart - restarting TA2 -TA2 - is beginning to run -TA2 - task_wake_after - sleep 1/2 second -TA2 - task_wake_after - sleep 1/2 second -TA1 - task_restart - restarting self -TA2 - task_wake_after - sleep 1/2 second -TA1 - is beginning to run -TA2 - task_wake_after - sleep 1/2 second -TA1 - task_restart - restarting TA2 -TA2 - is beginning to run -TA2 - task_wake_after - sleep 1/2 second -TA2 - task_wake_after - sleep 1/2 second -TA1 - task_restart - restarting self -TA2 - task_wake_after - sleep 1/2 second -TA1 - is beginning to run -TA2 - task_wake_after - sleep 1/2 second -TA1 - task_restart - restarting TA2 -TA2 - is beginning to run -TA2 - task_wake_after - sleep 1/2 second -TA2 - task_wake_after - sleep 1/2 second -TA1 - task_restart - restarting self -TA2 - task_wake_after - sleep 1/2 second -TA1 - is beginning to run -TA2 - task_wake_after - sleep 1/2 second -TA1 - task_restart - restarting TA2 -TA2 - is beginning to run -TA2 - task_wake_after - sleep 1/2 second -TA2 - task_wake_after - sleep 1/2 second -TA1 - task_restart - restarting self -TA2 - task_wake_after - sleep 1/2 second -TA1 - is beginning to run -*** END OF TEST 6 *** diff --git a/c/src/ada-tests/sptests/sp06/config.h b/c/src/ada-tests/sptests/sp06/config.h deleted file mode 100644 index d85c77e62b..0000000000 --- a/c/src/ada-tests/sptests/sp06/config.h +++ /dev/null @@ -1,32 +0,0 @@ -/* 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_TICKS_PER_TIMESLICE 100 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#define CONFIGURE_MAXIMUM_TASKS 4 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/sptests/sp06/sp06.adb b/c/src/ada-tests/sptests/sp06/sp06.adb deleted file mode 100644 index 4caba9ae73..0000000000 --- a/c/src/ada-tests/sptests/sp06/sp06.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test SP06 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 SP06 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 SP06; - diff --git a/c/src/ada-tests/sptests/sp06/sptest.adb b/c/src/ada-tests/sptests/sp06/sptest.adb deleted file mode 100644 index f19fd068ee..0000000000 --- a/c/src/ada-tests/sptests/sp06/sptest.adb +++ /dev/null @@ -1,216 +0,0 @@ --- --- SPTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 6 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 INTERFACES; use INTERFACES; -with TEST_SUPPORT; -with TEXT_IO; - -package body SPTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - PREVIOUS_PRIORITY : RTEMS.TASKS.PRIORITY; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TEST 6 ***" ); - - SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); - SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' ); - SPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' ); - - SPTEST.ARGUMENT := 0; - SPTEST.RESTART_ARGUMENT := 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.CREATE( - SPTEST.TASK_NAME( 2 ), - 1, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 2 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 3 ), - 10, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 3 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA3" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 1 ), - SPTEST.TASK_1'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 2 ), - SPTEST.TASK_2'ACCESS, - SPTEST.ARGUMENT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 3 ), - SPTEST.TASK_3'ACCESS, - SPTEST.ARGUMENT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA3" ); - - RTEMS.TASKS.SET_PRIORITY( - SPTEST.TASK_ID( 3 ), - 5, - PREVIOUS_PRIORITY, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY OF TA3" ); - - 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 - PASS : RTEMS.UNSIGNED32; - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.PUT_LINE( "TA1 - is beginning to run" ); - - PASS := ARGUMENT + 1; - - if PASS = 5 then - TEXT_IO.PUT_LINE( "*** END OF TEST 6 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - end if; - - if PASS = 1 then - TEXT_IO.PUT_LINE( "TA1 - restarting TA3" ); - RTEMS.TASKS.RESTART( - SPTEST.TASK_ID( 3 ), - SPTEST.RESTART_ARGUMENT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESTART OF TA3" ); - - RTEMS.TASKS.WAKE_AFTER( 2 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - end if; - - RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - TEXT_IO.PUT_LINE( "TA1 - task_restart - restarting TA2" ); - RTEMS.TASKS.RESTART( - SPTEST.TASK_ID( 2 ), - SPTEST.RESTART_ARGUMENT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESTART OF TA2" ); - - RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - TEXT_IO.PUT_LINE( "TA1 - task_restart - restarting self" ); - RTEMS.TASKS.RESTART( SPTEST.TASK_ID( 1 ), PASS, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESTART OF SELF" ); - - end TASK_1; - --- --- TASK_2 --- - - procedure TASK_2 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.PUT_LINE( "TA2 - is beginning to run" ); - - if ARGUMENT = SPTEST.ARGUMENT then - RTEMS.TASKS.WAKE_AFTER( 2 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - end if; - - loop - - TEXT_IO.PUT_LINE( "TA2 - task_wake_after - sleep 1/2 second" ); - RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND / 2, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - end loop; - - end TASK_2; - --- --- TASK_3 --- - - procedure TASK_3 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end TASK_3; - -end SPTEST; diff --git a/c/src/ada-tests/sptests/sp06/sptest.ads b/c/src/ada-tests/sptests/sp06/sptest.ads deleted file mode 100644 index 29fa897210..0000000000 --- a/c/src/ada-tests/sptests/sp06/sptest.ads +++ /dev/null @@ -1,93 +0,0 @@ --- --- SPTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 6 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; - -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 .. 3 ) of RTEMS.ID; - TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; - --- --- The following are used as arguments to the various RTEMS tasks --- in this test to indicate when a restart should be performed. - - ARGUMENT : RTEMS.UNSIGNED32; - RESTART_ARGUMENT : RTEMS.UNSIGNED32; - --- --- 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 some of the capabilities of the Task Manager. --- - - procedure TASK_1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_1); - --- --- TASK_2 --- --- DESCRIPTION: --- --- This RTEMS task tests some of the capabilities of the Task Manager. --- - - procedure TASK_2 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_2); - --- --- TASK_3 --- --- DESCRIPTION: --- --- This RTEMS task tests some of the capabilities of the Task Manager. --- - - procedure TASK_3 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_3); - -end SPTEST; diff --git a/c/src/ada-tests/sptests/sp07/Makefile.am b/c/src/ada-tests/sptests/sp07/Makefile.am deleted file mode 100644 index 52c93798c0..0000000000 --- a/c/src/ada-tests/sptests/sp07/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_sp07 - -ada_sp07_SOURCES = sp07.adb config.h sptest.adb sptest.ads -ada_sp07_SOURCES += ../../support/init.c - -ada_sp07$(EXEEXT): sp07.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_sp07.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/sptests/sp07/ada_sp07.scn b/c/src/ada-tests/sptests/sp07/ada_sp07.scn deleted file mode 100644 index 9748dda74c..0000000000 --- a/c/src/ada-tests/sptests/sp07/ada_sp07.scn +++ /dev/null @@ -1,23 +0,0 @@ -*** TEST 7 *** -TASKS_CREATE - TA1 - created. -TASKS_CREATE - TA2 - created. -TASKS_CREATE - TA3 - created. -TASKS_CREATE - TA4 - created. -TASKS_START - TA1 - started. -TASKS_START - TA2 - started. -TASKS_START - TA3 - started. -TASKS_START - TA4 - started. -TASKS_RESTART - TA3 - restarted. - -TA1 - task_set_priority - get initial priority of self: 4 -TA1 - task_set_priority - set TA2's priority: 3 -TA2 - task_set_priority - set TA1's priority: 2 -TA1 - task_set_priority - set TA2's priority: 1 -TA2 - task_suspend - suspend TA1 -TA2 - task_set_priority - set priority of TA1 ( blocked ) -TASKS_DELETE - TA2 deleting TA1 -TASKS_DELETE - TA2 deleting TA3 -TASKS_DELETE - TA2 deleting TA2 -TA4 - exitting task -TASK_EXITTED - user extension invoked correctly -*** END OF TEST 7 *** diff --git a/c/src/ada-tests/sptests/sp07/config.h b/c/src/ada-tests/sptests/sp07/config.h deleted file mode 100644 index 2aa307a46c..0000000000 --- a/c/src/ada-tests/sptests/sp07/config.h +++ /dev/null @@ -1,33 +0,0 @@ -/* 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_USER_EXTENSIONS 1 -#define CONFIGURE_TICKS_PER_TIMESLICE 100 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#define CONFIGURE_MAXIMUM_TASKS 5 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/sptests/sp07/sp07.adb b/c/src/ada-tests/sptests/sp07/sp07.adb deleted file mode 100644 index 177de946b8..0000000000 --- a/c/src/ada-tests/sptests/sp07/sp07.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test SP07 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 SP07 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 SP07; - diff --git a/c/src/ada-tests/sptests/sp07/sptest.adb b/c/src/ada-tests/sptests/sp07/sptest.adb deleted file mode 100644 index d55aa73bf8..0000000000 --- a/c/src/ada-tests/sptests/sp07/sptest.adb +++ /dev/null @@ -1,513 +0,0 @@ --- --- SPTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 7 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 INTERFACES; use INTERFACES; -with TEST_SUPPORT; -with TEXT_IO; -with UNSIGNED32_IO; -with RTEMS.EXTENSION; -with RTEMS.FATAL; - -package body SPTEST is - - type Task_Event_Type is ( - Created, - Deleted, - Restarted, - Started - ); - - type Task_Event is record - The_Event : Task_Event_Type; - Task1 : RTEMS.Unsigned32; - Task2 : RTEMS.Unsigned32; - end record; - - Task_Events : array (1 .. 10) of Task_Event; - Task_Events_Index : Natural := Task_Events'First; - - procedure Log_Task_Event ( - The_Event : in Task_Event_Type; - Task1 : in RTEMS.Unsigned32; - Task2 : in RTEMS.Unsigned32 - ) is - begin - if Task_Events_Index = Task_Events'Last then - RTEMS.Fatal.Error_Occurred ( 1 ); -- no other choice - else - Task_Events (Task_Events_Index).The_Event := The_Event; - Task_Events (Task_Events_Index).Task1 := Task1; - Task_Events (Task_Events_Index).Task2 := Task2; - Task_Events_Index := Task_Events_Index + 1; - end if; - end Log_Task_Event; - - procedure Flush_Task_Event_Log is - begin - for I in Task_Events'First .. Task_Events_Index - 1 loop - - case Task_Events (I).The_Event is - - when Created => - TEXT_IO.PUT( "TASKS_CREATE - " ); - TEST_SUPPORT.PUT_NAME( - SPTEST.TASK_NAME( Task_Events (I).Task1 ), - FALSE - ); - TEXT_IO.PUT_LINE( " - created." ); - - when Deleted => - TEXT_IO.PUT( "TASKS_DELETE - " ); - TEST_SUPPORT.PUT_NAME( - SPTEST.TASK_NAME( Task_Events (I).Task1 ), - FALSE - ); - - TEXT_IO.PUT( " deleting " ); - TEST_SUPPORT.PUT_NAME( - SPTEST.TASK_NAME( Task_Events (I).Task2 ), - TRUE - ); - - when Restarted => - TEXT_IO.PUT( "TASKS_RESTART - " ); - TEST_SUPPORT.PUT_NAME( - SPTEST.TASK_NAME( Task_Events (I).Task1 ), - FALSE - ); - TEXT_IO.PUT_LINE( " - restarted." ); - - when Started => - TEXT_IO.PUT( "TASKS_START - " ); - TEST_SUPPORT.PUT_NAME( - SPTEST.TASK_NAME( Task_Events (I).Task1 ), - FALSE - ); - TEXT_IO.PUT_LINE( " - started." ); - - end case; - end loop; - - -- Reset the events list - Task_Events_Index := Task_Events'First; - - end Flush_Task_Event_Log; - --- --- TCB_To_ID --- - - function TCB_To_ID ( - TCB : RTEMS.TCB_POINTER - ) return RTEMS.ID; - pragma Import (C, TCB_To_ID, "tcb_to_id" ); - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TEST 7 ***" ); - - SPTEST.EXTENSION_NAME( 1 ) := RTEMS.BUILD_NAME( 'E', 'X', 'T', ' ' ); - - RTEMS.EXTENSION.CREATE( - SPTEST.EXTENSION_NAME( 1 ), - SPTEST.EXTENSIONS'ACCESS, - EXTENSION_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EXTENSION_CREATE" ); - - SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); - SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' ); - SPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' ); - SPTEST.TASK_NAME( 4 ) := RTEMS.BUILD_NAME( 'T', 'A', '4', ' ' ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 1 ), - 4, - RTEMS.MINIMUM_STACK_SIZE, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 2 ), - 4, - RTEMS.MINIMUM_STACK_SIZE, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 2 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 3 ), - 250, - RTEMS.MINIMUM_STACK_SIZE, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 3 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA3" ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 4 ), - 254, - RTEMS.MINIMUM_STACK_SIZE, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 4 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA4" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 1 ), - SPTEST.TASK_1'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 2 ), - SPTEST.TASK_2'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 3 ), - SPTEST.TASK_3'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA3" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 4 ), - SPTEST.TASK_4'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA4" ); - - RTEMS.TASKS.RESTART( SPTEST.TASK_ID( 3 ), 0, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESTART OF TA3" ); - - Flush_Task_Event_Log; - - 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); - STATUS : RTEMS.STATUS_CODES; - THE_PRIORITY : RTEMS.TASKS.PRIORITY; - PREVIOUS_PRIORITY : RTEMS.TASKS.PRIORITY; - begin - - TEST_SUPPORT.PAUSE; - - RTEMS.TASKS.SET_PRIORITY( - RTEMS.SELF, - RTEMS.TASKS.CURRENT_PRIORITY, - THE_PRIORITY, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" ); - TEXT_IO.PUT( "TA1 - task_set_priority - "); - TEXT_IO.PUT( "get initial priority of self: "); - UNSIGNED32_IO.PUT( THE_PRIORITY, BASE => 10, WIDTH => 2 ); - TEXT_IO.NEW_LINE; - - loop - - THE_PRIORITY := THE_PRIORITY - 1; - - if THE_PRIORITY = 0 then - TEXT_IO.PUT_LINE( "TA1 - task_suspend - suspend TA2" ); - RTEMS.TASKS.SUSPEND( SPTEST.TASK_ID( 2 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND" ); - - TEXT_IO.PUT( "TA1 - task_set_priority - "); - TEXT_IO.PUT_LINE( "set priority of TA2 ( blocked )"); - RTEMS.TASKS.SET_PRIORITY( - SPTEST.TASK_ID( 2 ), - 5, - PREVIOUS_PRIORITY, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" ); - - RTEMS.TASKS.DELETE( SPTEST.TASK_ID( 2 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA2" ); - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end if; - - TEXT_IO.PUT("TA1 - task_set_priority - set TA2's priority: "); - UNSIGNED32_IO.PUT( THE_PRIORITY, BASE => 10, WIDTH => 2 ); - TEXT_IO.NEW_LINE; - RTEMS.TASKS.SET_PRIORITY( - SPTEST.TASK_ID( 2 ), - THE_PRIORITY, - PREVIOUS_PRIORITY, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" ); - - end loop; - - end TASK_1; - --- --- TASK_2 --- - - procedure TASK_2 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - THE_PRIORITY : RTEMS.TASKS.PRIORITY; - PREVIOUS_PRIORITY : RTEMS.TASKS.PRIORITY; - begin - - loop - - THE_PRIORITY := THE_PRIORITY - 1; - - if THE_PRIORITY = 0 then - TEXT_IO.PUT_LINE( "TA2 - task_suspend - suspend TA1" ); - RTEMS.TASKS.SUSPEND( SPTEST.TASK_ID( 1 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND" ); - - TEXT_IO.PUT( "TA2 - task_set_priority - "); - TEXT_IO.PUT_LINE( "set priority of TA1 ( blocked )"); - RTEMS.TASKS.SET_PRIORITY( - SPTEST.TASK_ID( 1 ), - 5, - PREVIOUS_PRIORITY, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" ); - - RTEMS.TASKS.DELETE( - SPTEST.TASK_ID( 1 ), - STATUS - ); -- TA1 is blocked - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA1" ); - - RTEMS.TASKS.DELETE( - SPTEST.TASK_ID( 3 ), - STATUS - ); -- TA3 is ready - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA3" ); - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - else - - TEXT_IO.PUT( "TA2 - task_set_priority - "); - TEXT_IO.PUT( "set TA1's priority: "); - UNSIGNED32_IO.PUT( THE_PRIORITY, BASE => 10, WIDTH => 2); - TEXT_IO.NEW_LINE; - RTEMS.TASKS.SET_PRIORITY( - SPTEST.TASK_ID( 1 ), - THE_PRIORITY, - PREVIOUS_PRIORITY, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" ); - - end if; - - end loop; - - end TASK_2; - --- --- TASK_3 --- - - procedure TASK_3 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - loop - - RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - end loop; - - end TASK_3; - --- --- TASK_4 --- - - procedure TASK_4 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - begin - - Flush_Task_Event_Log; - - TEXT_IO.PUT_LINE( "TA4 - exitting task" ); - - end TASK_4; - --- --- TASK_EXIT_EXTENSION --- - - procedure TASK_EXIT_EXTENSION ( - RUNNING_TASK : in RTEMS.TCB_POINTER - ) is - begin - - if TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( RUNNING_TASK ) ) > 0 then - TEXT_IO.PUT_LINE( "TASK_EXITTED - user extension invoked correctly" ); - end if; - - TEXT_IO.PUT_LINE( "*** END OF TEST 7 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end TASK_EXIT_EXTENSION; - --- --- TASK_CREATE_EXTENSION --- - - function TASK_CREATE_EXTENSION ( - UNUSED : in RTEMS.TCB_POINTER; - CREATED_TASK : in RTEMS.TCB_POINTER - ) return RTEMS.Boolean is - pragma Unreferenced(UNUSED); - begin - - if TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( CREATED_TASK ) ) > 0 then - Log_Task_Event ( - Created, - TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( CREATED_TASK ) ), - 0 - ); - end if; - - return RTEMS.True; - - end TASK_CREATE_EXTENSION; - --- --- TASK_DELETE_EXTENSION --- - - procedure TASK_DELETE_EXTENSION ( - RUNNING_TASK : in RTEMS.TCB_POINTER; - DELETED_TASK : in RTEMS.TCB_POINTER - ) is - begin - - if TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( RUNNING_TASK ) ) > 0 and - TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( DELETED_TASK ) ) > 0 then - Log_Task_Event ( - Deleted, - TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( RUNNING_TASK ) ), - TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( DELETED_TASK ) ) - ); - end if; - - end TASK_DELETE_EXTENSION; - --- --- TASK_RESTART_EXTENSION --- - - procedure TASK_RESTART_EXTENSION ( - UNUSED : in RTEMS.TCB_POINTER; - RESTARTED_TASK : in RTEMS.TCB_POINTER - ) is - pragma Unreferenced(UNUSED); - begin - - if TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( RESTARTED_TASK ) ) > 0 then - Log_Task_Event ( - Restarted, - TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( RESTARTED_TASK ) ), - 0 - ); - end if; - - end TASK_RESTART_EXTENSION; - --- --- TASK_START_EXTENSION --- - - procedure TASK_START_EXTENSION ( - UNUSED : in RTEMS.TCB_POINTER; - STARTED_TASK : in RTEMS.TCB_POINTER - ) is - pragma Unreferenced(UNUSED); - begin - - if TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( STARTED_TASK ) ) > 0 then - Log_Task_Event ( - Started, - TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( STARTED_TASK ) ), - 0 - ); - end if; - - end TASK_START_EXTENSION; - -end SPTEST; diff --git a/c/src/ada-tests/sptests/sp07/sptest.ads b/c/src/ada-tests/sptests/sp07/sptest.ads deleted file mode 100644 index 3984c64ee1..0000000000 --- a/c/src/ada-tests/sptests/sp07/sptest.ads +++ /dev/null @@ -1,194 +0,0 @@ --- --- SPTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 7 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; - -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 .. 4 ) of RTEMS.ID; - TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.NAME; - --- --- These arrays contain the IDs and NAMEs of all RTEMS extensions created --- by this test. --- - - EXTENSION_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; - EXTENSION_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; - --- --- 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 some of the capabilities of the Task Manager. --- - - procedure TASK_1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_1); - --- --- TASK_2 --- --- DESCRIPTION: --- --- This RTEMS task tests some of the capabilities of the Task Manager. --- - - procedure TASK_2 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_2); - --- --- TASK_3 --- --- DESCRIPTION: --- --- This RTEMS task tests some of the capabilities of the Task Manager. --- - - procedure TASK_3 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_3); - --- --- TASK_4 --- --- DESCRIPTION: --- --- This RTEMS task tests the Message Queue Manager. --- - - procedure TASK_4 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_4); - --- --- TASK_CREATE_EXTENSION --- --- DESCRIPTION: --- --- This subprogram is the TASK_CREATE extension for this test. --- - - function TASK_CREATE_EXTENSION ( - UNUSED : in RTEMS.TCB_POINTER; - CREATED_TASK : in RTEMS.TCB_POINTER - ) return RTEMS.Boolean; - pragma Convention (C, TASK_CREATE_EXTENSION); - --- --- TASK_DELETE_EXTENSION --- --- DESCRIPTION: --- --- This subprogram is the TASK_DELETE extension for this test. --- - - procedure TASK_DELETE_EXTENSION ( - RUNNING_TASK : in RTEMS.TCB_POINTER; - DELETED_TASK : in RTEMS.TCB_POINTER - ); - pragma Convention (C, TASK_DELETE_EXTENSION); - --- --- TASK_RESTART_EXTENSION --- --- DESCRIPTION: --- --- This subprogram is the TASK_RESTART extension for this test. --- - - procedure TASK_RESTART_EXTENSION ( - UNUSED : in RTEMS.TCB_POINTER; - RESTARTED_TASK : in RTEMS.TCB_POINTER - ); - pragma Convention (C, TASK_RESTART_EXTENSION); - --- --- TASK_START_EXTENSION --- --- DESCRIPTION: --- --- This subprogram is the TASK_START extension for this test. --- - - procedure TASK_START_EXTENSION ( - UNUSED : in RTEMS.TCB_POINTER; - STARTED_TASK : in RTEMS.TCB_POINTER - ); - pragma Convention (C, TASK_START_EXTENSION); - --- --- TASK_EXIT_EXTENSION --- --- DESCRIPTION: --- --- This subprogram is the TASK_EXIT extension for this test. --- It is invoked when a RTEMS task exits from its entry point. --- - - procedure TASK_EXIT_EXTENSION ( - RUNNING_TASK : in RTEMS.TCB_POINTER - ); - pragma Convention (C, TASK_EXIT_EXTENSION); - --- --- This is the User Extension Table for this test. --- - - EXTENSIONS : aliased RTEMS.EXTENSIONS_TABLE := - ( - SPTEST.TASK_CREATE_EXTENSION'ACCESS, -- Task create - SPTEST.TASK_START_EXTENSION'ACCESS, -- Task start - SPTEST.TASK_RESTART_EXTENSION'ACCESS, -- Task restart - SPTEST.TASK_DELETE_EXTENSION'ACCESS, -- Task delete - NULL, -- Task switch - NULL, -- Task post switch - NULL, -- Task begin - SPTEST.TASK_EXIT_EXTENSION'ACCESS, -- Task exitted - NULL -- Fatal error - ); - -end SPTEST; diff --git a/c/src/ada-tests/sptests/sp08/Makefile.am b/c/src/ada-tests/sptests/sp08/Makefile.am deleted file mode 100644 index 1514bd39a0..0000000000 --- a/c/src/ada-tests/sptests/sp08/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_sp08 -ada_sp08_SOURCES = sp08.adb config.h sptest.adb sptest.ads -ada_sp08_SOURCES += ../../support/init.c - -ada_sp08$(EXEEXT): sp08.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_sp08.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/sptests/sp08/ada_sp08.scn b/c/src/ada-tests/sptests/sp08/ada_sp08.scn deleted file mode 100644 index d0081437fe..0000000000 --- a/c/src/ada-tests/sptests/sp08/ada_sp08.scn +++ /dev/null @@ -1,20 +0,0 @@ -*** TEST 8 *** -TA1 - task_mode - ASR - previous mode: 16#0# -TA1 - task_mode - NO_ASR - previous mode: 16#0# -TA1 - task_mode - NO_ASR - previous mode: 16#400# -TA1 - task_mode - ASR - previous mode: 16#400# -TA1 - task_mode - NO_TIMESLICE - previous mode: 16#0# -TA1 - task_mode - TIMESLICE - previous mode: 16#0# -TA1 - task_mode - TIMESLICE - previous mode: 16#200# -TA1 - task_mode - NO_TIMESLICE - previous mode: 16#200# -TA1 - task_mode - PREEMPT - previous mode: 16#0# -TA1 - task_mode - NO_PREEMPT - previous mode: 16#0# -TA1 - task_mode - NO_PREEMPT - previous mode: 16#100# -TA1 - task_mode - PREEMPT - previous mode: 16#100# -TA1 - task_mode - INTERRUPT_LEVEL( 3 ) - previous mode: 16#0# -TA1 - task_mode - INTERRUPT_LEVEL( 5 ) - previous mode: 16#1# -TA1 - task_mode - set all modes - previous mode: 16#1# -TA1 - task_mode - set all modes - previous mode: 16#701# -TA1 - task_mode - clear all modes - previous mode: 16#701# -TA1 - task_mode - get current mode - previous mode: 16#0# -*** END OF TEST 8 *** diff --git a/c/src/ada-tests/sptests/sp08/config.h b/c/src/ada-tests/sptests/sp08/config.h deleted file mode 100644 index 6ada011600..0000000000 --- a/c/src/ada-tests/sptests/sp08/config.h +++ /dev/null @@ -1,32 +0,0 @@ -/* 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_TICKS_PER_TIMESLICE 100 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#define CONFIGURE_MAXIMUM_TASKS 2 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/sptests/sp08/sp08.adb b/c/src/ada-tests/sptests/sp08/sp08.adb deleted file mode 100644 index f881ad4e71..0000000000 --- a/c/src/ada-tests/sptests/sp08/sp08.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test SP08 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 SP08 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 SP08; - diff --git a/c/src/ada-tests/sptests/sp08/sptest.adb b/c/src/ada-tests/sptests/sp08/sptest.adb deleted file mode 100644 index 2bec479285..0000000000 --- a/c/src/ada-tests/sptests/sp08/sptest.adb +++ /dev/null @@ -1,346 +0,0 @@ --- --- SPTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 8 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 INTERFACES; use INTERFACES; -with TEST_SUPPORT; -with TEXT_IO; -with UNSIGNED32_IO; - -package body SPTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TEST 8 ***" ); - - 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" ); - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- PUT_MODE --- - - procedure PUT_MODE( - COMMENT : in STRING; - OUTPUT_MODE : in RTEMS.MODE - ) is - begin - - TEXT_IO.PUT( COMMENT ); - UNSIGNED32_IO.PUT( OUTPUT_MODE, BASE => 16, WIDTH => 8 ); - TEXT_IO.NEW_LINE; - - end PUT_MODE; - --- --- TASK_1 --- - - procedure TASK_1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - PREVIOUS_MODE : RTEMS.MODE; - STATUS : RTEMS.STATUS_CODES; - begin - --- BEGINNING OF ASR - - RTEMS.TASKS.MODE( - RTEMS.ASR, - RTEMS.ASR_MASK, - PREVIOUS_MODE, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); - SPTEST.PUT_MODE( - "TA1 - task_mode - ASR - previous mode: ", - PREVIOUS_MODE - ); - - RTEMS.TASKS.MODE( - RTEMS.NO_ASR, - RTEMS.ASR_MASK, - PREVIOUS_MODE, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); - SPTEST.PUT_MODE( - "TA1 - task_mode - NO_ASR - previous mode: ", - PREVIOUS_MODE - ); - - RTEMS.TASKS.MODE( - RTEMS.NO_ASR, - RTEMS.ASR_MASK, - PREVIOUS_MODE, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); - SPTEST.PUT_MODE( - "TA1 - task_mode - NO_ASR - previous mode: ", - PREVIOUS_MODE - ); - - RTEMS.TASKS.MODE( - RTEMS.ASR, - RTEMS.ASR_MASK, - PREVIOUS_MODE, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); - SPTEST.PUT_MODE( - "TA1 - task_mode - ASR - previous mode: ", - PREVIOUS_MODE - ); - --- END OF ASR - --- BEGINNING OF TIMESLICE - - RTEMS.TASKS.MODE( - RTEMS.NO_TIMESLICE, - RTEMS.TIMESLICE_MASK, - PREVIOUS_MODE, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); - SPTEST.PUT_MODE( - "TA1 - task_mode - NO_TIMESLICE - previous mode: ", - PREVIOUS_MODE - ); - - RTEMS.TASKS.MODE( - RTEMS.TIMESLICE, - RTEMS.TIMESLICE_MASK, - PREVIOUS_MODE, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); - SPTEST.PUT_MODE( - "TA1 - task_mode - TIMESLICE - previous mode: ", - PREVIOUS_MODE - ); - - RTEMS.TASKS.MODE( - RTEMS.TIMESLICE, - RTEMS.TIMESLICE_MASK, - PREVIOUS_MODE, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); - SPTEST.PUT_MODE( - "TA1 - task_mode - TIMESLICE - previous mode: ", - PREVIOUS_MODE - ); - - RTEMS.TASKS.MODE( - RTEMS.NO_TIMESLICE, - RTEMS.TIMESLICE_MASK, - PREVIOUS_MODE, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); - SPTEST.PUT_MODE( - "TA1 - task_mode - NO_TIMESLICE - previous mode: ", - PREVIOUS_MODE - ); - --- END OF TIMESLICE - --- BEGINNING OF PREEMPT - - RTEMS.TASKS.MODE( - RTEMS.PREEMPT, - RTEMS.PREEMPT_MASK, - PREVIOUS_MODE, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); - SPTEST.PUT_MODE( - "TA1 - task_mode - PREEMPT - previous mode: ", - PREVIOUS_MODE - ); - - RTEMS.TASKS.MODE( - RTEMS.NO_PREEMPT, - RTEMS.PREEMPT_MASK, - PREVIOUS_MODE, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); - SPTEST.PUT_MODE( - "TA1 - task_mode - NO_PREEMPT - previous mode: ", - PREVIOUS_MODE - ); - - RTEMS.TASKS.MODE( - RTEMS.NO_PREEMPT, - RTEMS.PREEMPT_MASK, - PREVIOUS_MODE, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); - SPTEST.PUT_MODE( - "TA1 - task_mode - NO_PREEMPT - previous mode: ", - PREVIOUS_MODE - ); - - RTEMS.TASKS.MODE( - RTEMS.PREEMPT, - RTEMS.PREEMPT_MASK, - PREVIOUS_MODE, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); - SPTEST.PUT_MODE( - "TA1 - task_mode - PREEMPT - previous mode: ", - PREVIOUS_MODE - ); - --- END OF PREEMPT - --- BEGINNING OF INTERRUPT_LEVEL - - RTEMS.TASKS.MODE( - RTEMS.INTERRUPT_LEVEL( 3 ), - RTEMS.INTERRUPT_MASK, - PREVIOUS_MODE, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); - SPTEST.PUT_MODE( - "TA1 - task_mode - INTERRUPT_LEVEL( 3 ) - previous mode: ", - PREVIOUS_MODE - ); - - RTEMS.TASKS.MODE( - RTEMS.INTERRUPT_LEVEL( 5 ), - RTEMS.INTERRUPT_MASK, - PREVIOUS_MODE, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); - SPTEST.PUT_MODE( - "TA1 - task_mode - INTERRUPT_LEVEL( 5 ) - previous mode: ", - PREVIOUS_MODE - ); - --- END OF INTERRUPT_LEVEL - --- BEGINNING OF COMBINATIONS - - RTEMS.TASKS.MODE( - RTEMS.INTERRUPT_LEVEL( 3 ) + RTEMS.NO_ASR + - RTEMS.TIMESLICE + RTEMS.NO_PREEMPT, - RTEMS.INTERRUPT_MASK + RTEMS.ASR_MASK + - RTEMS.TIMESLICE_MASK + RTEMS.PREEMPT_MASK, - PREVIOUS_MODE, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); - SPTEST.PUT_MODE( - "TA1 - task_mode - set all modes - previous mode: ", - PREVIOUS_MODE - ); - - RTEMS.TASKS.MODE( - RTEMS.INTERRUPT_LEVEL( 3 ) + RTEMS.NO_ASR + - RTEMS.TIMESLICE + RTEMS.NO_PREEMPT, - RTEMS.INTERRUPT_MASK + RTEMS.ASR_MASK + - RTEMS.TIMESLICE_MASK + RTEMS.PREEMPT_MASK, - PREVIOUS_MODE, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); - SPTEST.PUT_MODE( - "TA1 - task_mode - set all modes - previous mode: ", - PREVIOUS_MODE - ); - - RTEMS.TASKS.MODE( - RTEMS.INTERRUPT_LEVEL( 0 ) + RTEMS.ASR + - RTEMS.NO_TIMESLICE + RTEMS.PREEMPT, - RTEMS.INTERRUPT_MASK + RTEMS.ASR_MASK + - RTEMS.TIMESLICE_MASK + RTEMS.PREEMPT_MASK, - PREVIOUS_MODE, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); - SPTEST.PUT_MODE( - "TA1 - task_mode - clear all modes - previous mode: ", - PREVIOUS_MODE - ); - --- END OF COMBINATIONS - --- BEGINNING OF CURRENT MODE - - RTEMS.TASKS.MODE( - RTEMS.CURRENT_MODE, - RTEMS.CURRENT_MODE, - PREVIOUS_MODE, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); - SPTEST.PUT_MODE( - "TA1 - task_mode - get current mode - previous mode: ", - PREVIOUS_MODE - ); - --- END OF CURRENT MODE - - TEXT_IO.PUT_LINE( "*** END OF TEST 8 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - end TASK_1; - -end SPTEST; diff --git a/c/src/ada-tests/sptests/sp08/sptest.ads b/c/src/ada-tests/sptests/sp08/sptest.ads deleted file mode 100644 index 09e9f8383f..0000000000 --- a/c/src/ada-tests/sptests/sp08/sptest.ads +++ /dev/null @@ -1,74 +0,0 @@ --- --- SPTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 8 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; - -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 .. 3 ) of RTEMS.ID; - TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- PUT_MODE --- --- DESCRIPTION: --- --- This subprogram prints the COMMENT and the OUTPUT_MODE followed --- by a carriage return. --- - - procedure PUT_MODE( - COMMENT : in STRING; - OUTPUT_MODE : in RTEMS.MODE - ); - --- --- TASK_1 --- --- DESCRIPTION: --- --- This RTEMS task tests the TASK_MODE directive of the Task Manager. --- - - procedure TASK_1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_1); - -end SPTEST; diff --git a/c/src/ada-tests/sptests/sp09/Makefile.am b/c/src/ada-tests/sptests/sp09/Makefile.am deleted file mode 100644 index ba4edebc84..0000000000 --- a/c/src/ada-tests/sptests/sp09/Makefile.am +++ /dev/null @@ -1,21 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -# Prevents Ada from raising a constraint so that the error -# handling can be verified in the binding. -AM_ADAFLAGS += -gnatp - -noinst_PROGRAMS = ada_sp09 - -ada_sp09_SOURCES = sp09.adb config.h sptest.adb sptest.ads -ada_sp09_SOURCES += ../../support/init.c - -ada_sp09$(EXEEXT): sp09.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_sp09.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/sptests/sp09/ada_sp09.scn b/c/src/ada-tests/sptests/sp09/ada_sp09.scn deleted file mode 100644 index de199d7dd5..0000000000 --- a/c/src/ada-tests/sptests/sp09/ada_sp09.scn +++ /dev/null @@ -1,246 +0,0 @@ -*** TEST 9 *** -INIT - task_create - INVALID_PRIORITY -INIT - task_restart - INCORRECT_STATE -TA1 - task_delete - INVALID_ID -TA1 - task_ident - current task SUCCESSFUL -TA1 - task_ident - global INVALID_NAME -TA1 - task_ident - local INVALID_NAME -TA1 - task_ident - INVALID_NODE -TA1 - task_restart - INVALID_ID -TA1 - task_resume - INVALID_ID -TA1 - task_resume - INCORRECT_STATE -TA1 - task_set_priority - INVALID_PRIORITY -TA1 - task_set_priority - INVALID_ID -TA1 - task_start - INVALID_ID -TA1 - task_start - INCORRECT_STATE -TA1 - task_suspend - INVALID_ID - -TA1 - clock_get - NOT_DEFINED -TA1 - task_wake_when - NOT_DEFINED -TA1 - timer_fire_when - NOT_DEFINED -TA1 - clock_set - 8:30:45 2/ 5/1987 - INVALID_CLOCK -TA1 - clock_set - 8:30:45 15/ 5/1988 - INVALID_CLOCK -TA1 - clock_set - 8:30:45 2/32/1988 - INVALID_CLOCK -TA1 - clock_set - 25:30:45 2/ 5/1988 - INVALID_CLOCK -TA1 - clock_set - 8:61:45 2/ 5/1988 - INVALID_CLOCK -TA1 - clock_set - 8:30:61 2/ 5/1988 - INVALID_CLOCK -TA1 - clock_set - 8:30:45 2/ 5/1988 - INVALID_CLOCK -TA1 - clock_set - 8:30:45 2/ 5/1988 - SUCCESSFUL -TA1 - task_wake_when - TICK INVALID - sleep about 3 seconds -TA1 - task_wake_when - TICK INVALID - woke up SUCCESSFUL -TA1 - task_wake_when - 8:30:48 2/ 5/1961 - INVALID_CLOCK -TA1 - task_wake_when - 25:30:48 2/ 5/1988 - INVALID_CLOCK -TA1 - current time - 8:30:48 2/ 5/1988 -TA1 - task_wake_when - 8:30:48 1/ 5/1988 - INVALID_CLOCK - -TA1 - task_create - INVALID_NAME -TA1 - task_create - stack size - UNSATISFIED -TA1 - task_create - TA2 created - SUCCESSFUL -TA1 - task_suspend - suspend TA2 - SUCCESSFUL -TA1 - task_suspend - suspend TA2 - ALREADY_SUSPENDED -TA1 - task_resume - TA2 resumed - SUCCESSFUL -TA1 - task_create - TA3 created - SUCCESSFUL -TA1 - task_create - 4 created - SUCCESSFUL -TA1 - task_create - 5 created - SUCCESSFUL -TA1 - task_create - 6 created - SUCCESSFUL -TA1 - task_create - 7 created - SUCCESSFUL -TA1 - task_create - 8 created - SUCCESSFUL -TA1 - task_create - 9 created - SUCCESSFUL -TA1 - task_create - 10 created - SUCCESSFUL -TA1 - task_create - 11 - TOO_MANY -TA1 - task_create - MP_NOT_CONFIGURED - -TA1 - event_receive - UNSATISFIED ( all conditions ) -TA1 - event_receive - UNSATISFIED ( any conditions ) -TA1 - event_receive - timeout in 3 seconds -TA1 - event_receive - woke with TIMEOUT -TA1 - event_send - INVALID_ID -TA1 - task_wake_after - sleep 1 second - SUCCESSFUL -TA1 - clock_set - 8:30:45 2/ 5/1988 - SUCCESSFUL - -TA1 - semaphore_create - INVALID_NAME -TA1 - semaphore_create - 1 - SUCCESSFUL -TA1 - semaphore_create - 2 - SUCCESSFUL -TA1 - semaphore_create - 3 - TOO_MANY -TA1 - semaphore_create - NOT_DEFINED -TA1 - semaphore_create - NOT_DEFINED -TA1 - semaphore_create - INVALID_NUMBER -TA1 - semaphore_create - MP_NOT_CONFIGURED -TA1 - semaphore_delete - unknown INVALID_ID -TA1 - semaphore_delete - local INVALID_ID -TA1 - semaphore_ident - global INVALID_NAME -TA1 - semaphore_ident - local INVALID_NAME - -TA1 - semaphore_obtain - INVALID_ID -TA1 - semaphore_obtain - got sem 1 - SUCCESSFUL -TA1 - semaphore_obtain - UNSATISFIED -TA1 - semaphore_obtain - timeout in 3 seconds -TA1 - semaphore_obtain - woke with TIMEOUT -TA1 - semaphore_release - NOT_OWNER_OF_RESOURCE -TA1 - semaphore_release - INVALID_ID -TA1 - task_start - start TA2 - SUCCESSFUL -TA1 - task_wake_after - yield processor - SUCCESSFUL -TA2 - semaphore_obtain - sem 1 - WAIT FOREVER -TA1 - semaphore_delete - delete sem 1 - SUCCESSFUL -TA1 - semaphore_obtain - binary semaphore -TA1 - semaphore_delete - delete sem 2 - RESOURCE_IN_USE -TA1 - task_wake_after - yield processor - SUCCESSFUL -TA2 - semaphore_obtain - woke up with OBJECT_WAS_DELETED -TA2 - task_delete - delete self - SUCCESSFUL -TA1 - task_delete TA2 - already deleted INVALID_ID - -TA1 - message_queue_broadcast - INVALID_ID -TA1 - message_queue_create - Q 1 - INVALID_NAME -TA1 - message_queue_create - Q 1 - MP_NOT_CONFIGURED -TA1 - message_queue_create - Q 1 - 2 DEEP - SUCCESSFUL -TA1 - message_queue_create - Q 2 - TOO_MANY -TA1 - message_queue_delete - unknown INVALID_ID -TA1 - message_queue_delete - local INVALID_ID -TA1 - message_queue_ident - INVALID_NAME -TA1 - message_queue_get_number_pending - INVALID_ID -TA1 - message_queue_flush - INVALID_ID -TA1 - message_queue_receive - INVALID_ID -TA1 - message_queue_receive - Q 1 - UNSATISFIED -TA1 - message_queue_receive - Q 1 - timeout in 3 seconds -TA1 - message_queue_receive - Q 1 - woke up with TIMEOUT -TA1 - message_queue_send - INVALID_ID -TA1 - message_queue_send - BUFFER 1 TO Q 1 - SUCCESSFUL -TA1 - message_queue_send - BUFFER 2 TO Q 1 - SUCCESSFUL -TA1 - message_queue_send - BUFFER 3 TO Q 1 - TOO_MANY - -TA1 - message_queue_delete - Q 1 - SUCCESSFUL -TA1 - message_queue_create - Q 1 - 2 DEEP - SUCCESSFUL -TA1 - message_queue_send - BUFFER 1 TO Q 1 - SUCCESSFUL -TA1 - message_queue_send - BUFFER 2 TO Q 1 - SUCCESSFUL -TA1 - message_queue_send - BUFFER 3 TO Q 1 - TOO_MANY -TA1 - message_queue_delete - Q 1 - SUCCESSFUL -TA1 - message_queue_create - Q 1 - 3 DEEP - SUCCESSFUL -TA1 - message_queue_send - BUFFER 1 TO Q 1 - SUCCESSFUL -TA1 - message_queue_send - BUFFER 2 TO Q 1 - SUCCESSFUL -TA1 - message_queue_send - BUFFER 3 TO Q 1 - SUCCESSFUL -TA1 - message_queue_send - BUFFER 4 TO Q 1 - TOO_MANY -TA1 - message_queue_delete - Q 1 - SUCCESSFUL -TA1 - message_queue_create - Q 1 - 3 DEEP - SUCCESSFUL -TA1 - task_start - start TA3 - SUCCESSFUL -TA1 - task_wake_after - yield processor - SUCCESSFUL -TA3 - message_queue_receive - Q 1 - WAIT FOREVER -TA1 - message_queue_delete - delete Q 1 - SUCCESSFUL -TA1 - task_wake_after - yield processor - SUCCESSFUL -TA3 - message_queue_receive - woke up with OBJECT_WAS_DELETED -TA3 - task_delete - delete self - SUCCESSFUL - -TA1 - port_create - INVALID_NAME -TA1 - port_create - INVALID_ADDRESS -TA1 - port_create - TOO_MANY -TA1 - port_delete - INVALID_ID -TA1 - port_ident - INVALID_NAME -TA1 - port_internal_to_external - INVALID_ID -TA1 - port_external_to_internal - INVALID_ID - -TA1 - rate_monotonic_create - INVALID_NAME -TA1 - rate_monotonic_create - SUCCESSFUL -TA1 - rate_monotonic_create - TOO_MANY -TA1 - rate_monotonic_ident - INVALID_NAME -TA1 - rate_monotonic_period - unknown INVALID_ID -TA1 - rate_monotonic_period - local INVALID_ID -TA1 - rate_monotonic_period( STATUS ) - NOT_DEFINED -TA1 - rate_monotonic_period - 100 ticks - SUCCESSFUL -TA1 - rate_monotonic_period( STATUS ) - SUCCESSFUL -TA1 - rate_monotonic_period( STATUS ) - TIMEOUT -TA1 - rate_monotonic_cancel - unknown INVALID_ID -TA1 - rate_monotonic_cancel - local INVALID_ID -TA1 - rate_monotonic_cancel - SUCCESSFUL -TA1 - rate_monotonic_period - 5 ticks - TIMEOUT -TA1 - task_wake_after - yielding to TA4 -TA4 - rate_monotonic_cancel - NOT_OWNER_OF_RESOURCE -TA4 - rate_monotonic_period - NOT_OWNER_OF_RESOURCE -TA4 - task_delete - delete self - SUCCESSFUL -TA1 - rate_monotonic_delete - unknown INVALID_ID -TA1 - rate_monotonic_delete - local INVALID_ID -TA1 - rate_monotonic_delete - SUCCESSFUL - -TA1 - partition_create - INVALID_NAME -TA1 - partition_create - length - INVALID_SIZE -TA1 - partition_create - buffer size - INVALID_SIZE -TA1 - partition_create - length < buffer size - INVALID_SIZE -TA1 - partition_create - MP_NOT_CONFIGURED -TA1 - partition_create - INVALID_ADDRESS -TA1 - partition_create - INVALID_SIZE -TA1 - partition_delete - unknown INVALID_ID -TA1 - partition_delete - local INVALID_ID -TA1 - partition_get_buffer - INVALID_ID -TA1 - partition_ident - INVALID_NAME -TA1 - partition_return_buffer - INVALID_ID -TA1 - partition_create - SUCCESSFUL -TA1 - partition_create - TOO_MANY -TA1 - partition_get_buffer - SUCCESSFUL -TA1 - partition_get_buffer - SUCCESSFUL -TA1 - partition_get_buffer - UNSATISFIED -TA1 - partition_delete - RESOURCE_IN_USE -TA1 - partition_return_buffer - INVALID_ADDRESS - out of range -TA1 - partition_return_buffer - INVALID_ADDRESS - not on boundary - -TA1 - region_create - INVALID_NAME -TA1 - region_create - INVALID_ADDRESS -TA1 - region_create - INVALID_SIZE -TA1 - region_create - SUCCESSFUL -TA1 - region_create - TOO_MANY -TA1 - region_delete - unknown INVALID_ID -TA1 - region_delete - local INVALID_ID -TA1 - region_ident - INVALID_NAME -TA1 - region_get_segment - INVALID_ID -TA1 - region_get_segment - INVALID_SIZE -TA1 - region_get_segment - SUCCESSFUL -TA1 - region_get_segment - UNSATISFIED -TA1 - region_get_segment - timeout in 3 seconds -TA1 - region_get_segment - woke up with TIMEOUT -TA1 - region_delete - RESOURCE_IN_USE -TA1 - region_return_segment - INVALID_ID -TA1 - region_return_segment - INVALID_ADDRESS -TA1 - debug_disable - DEBUG_REGION -TA1 - region_return_segment - INVALID_ADDRESS - SKIPPED -TA1 - region_return_segment - INVALID_ADDRESS - SKIPPED -TA1 - debug_enable - DEBUG_REGION -TA1 - region_extend - INVALID_ID -TA1 - region_extend - within heap - INVALID_ADDRESS -TA1 - region_extend - non-contiguous lower - NOT_IMPLEMENTED -TA1 - region_extend - contiguous lower - NOT_IMPLEMENTED -TA1 - region_extend - non-contiguous higher - NOT_IMPLEMENTED - -TA1 - clock_set - 23:59:59 12/31/2000 - SUCCESSFUL -TA1 - clock_get - 0: 0: 0 1/ 1/2001 - SUCCESSFUL -TA1 - clock_set - 23:59:59 12/31/1999 - SUCCESSFUL -TA1 - clock_get - 0: 0: 0 1/ 1/2000 - SUCCESSFUL -TA1 - clock_set - 23:59:59 12/31/2100 - SUCCESSFUL -TA1 - clock_get - 17:31:44 11/25/1964 - SUCCESSFUL -TA1 - clock_set - 23:59:59 12/31/2099 - SUCCESSFUL -TA1 - clock_get - 17:31:44 11/25/1963 - SUCCESSFUL -TA1 - clock_set - 23:59:59 12/31/1991 - SUCCESSFUL -TA1 - clock_get - 0: 0: 0 1/ 1/1992 - SUCCESSFUL - -TA1 - timer_create - INVALID_NAME -TA1 - timer_create - 1 - SUCCESSFUL -TA1 - timer_create - 2 - TOO_MANY -TA1 - timer_delete - local INVALID_ID -TA1 - timer_delete - global INVALID_ID -TA1 - timer_ident - INVALID_NAME -TA1 - timer_cancel - INVALID_ID -TA1 - timer_reset - INVALID_ID -TA1 - timer_reset - NOT_DEFINED -TA1 - timer_fire_after - INVALID_ID -TA1 - timer_fire_when - INVALID_ID -TA1 - timer_fire_after - INVALID_NUMBER -TA1 - timer_fire_when - 8:30:45 2/ 5/1987 - INVALID_CLOCK -TA1 - clock_get - 0: 0: 0 1/ 1/1992 -TA1 - timer_fire_when - 8:30:45 2/ 5/1990 - before INVALID_CLOCK -TA1 - timer_server_fire_after - INCORRECT_STATE -TA1 - timer_server_fire_when - INCORRECT_STATE -TA1 - timer_initiate_server - INVALID_PRIORITY -TA1 - timer_initiate_server -TA1 - timer_server_fire_after - INVALID_ID -TA1 - timer_server_fire_when - INVALID_ID -TA1 - timer_server_fire_after - INVALID_NUMBER -TA1 - timer_server_fire_when - 8:30:45 2/ 5/1987 - INVALID_CLOCK -TA1 - clock_get - 0: 0: 0 1/ 1/1992 -TA1 - timer_server_fire_when - 8:30:45 2/ 5/1990 - before INVALID_CLOCK -*** END OF TEST 9 *** diff --git a/c/src/ada-tests/sptests/sp09/config.h b/c/src/ada-tests/sptests/sp09/config.h deleted file mode 100644 index a94c222fa1..0000000000 --- a/c/src/ada-tests/sptests/sp09/config.h +++ /dev/null @@ -1,38 +0,0 @@ -/* 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 10 -#define CONFIGURE_MAXIMUM_TIMERS 1 -#define CONFIGURE_MAXIMUM_SEMAPHORES 2 -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 -#define CONFIGURE_MAXIMUM_PARTITIONS 1 -#define CONFIGURE_MAXIMUM_REGIONS 1 -#define CONFIGURE_MAXIMUM_PERIODS 1 -#define CONFIGURE_MAXIMUM_USER_EXTENSIONS 0 -#define CONFIGURE_TICKS_PER_TIMESLICE 100 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/sptests/sp09/sp09.adb b/c/src/ada-tests/sptests/sp09/sp09.adb deleted file mode 100644 index de3a8a91a0..0000000000 --- a/c/src/ada-tests/sptests/sp09/sp09.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test SP09 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 SP09 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 SP09; - diff --git a/c/src/ada-tests/sptests/sp09/sptest.adb b/c/src/ada-tests/sptests/sp09/sptest.adb deleted file mode 100644 index 218fbaed49..0000000000 --- a/c/src/ada-tests/sptests/sp09/sptest.adb +++ /dev/null @@ -1,3117 +0,0 @@ --- --- SPTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 9 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 INTERFACES; use INTERFACES; -with TEST_SUPPORT; -with TEXT_IO; -with RTEMS.CLOCK; -with RTEMS.EVENT; -with RTEMS.MESSAGE_QUEUE; -with RTEMS.PARTITION; -with RTEMS.PORT; -with RTEMS.RATE_MONOTONIC; -with RTEMS.REGION; -with RTEMS.SEMAPHORE; -with RTEMS.TIMER; - -package body SPTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TEST 9 ***" ); - - SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); - SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' ); - SPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' ); - SPTEST.TASK_NAME( 4 ) := RTEMS.BUILD_NAME( 'T', 'A', '4', ' ' ); - SPTEST.TASK_NAME( 5 ) := RTEMS.BUILD_NAME( 'T', 'A', '5', ' ' ); - SPTEST.TASK_NAME( 6 ) := RTEMS.BUILD_NAME( 'T', 'A', '6', ' ' ); - SPTEST.TASK_NAME( 7 ) := RTEMS.BUILD_NAME( 'T', 'A', '7', ' ' ); - SPTEST.TASK_NAME( 8 ) := RTEMS.BUILD_NAME( 'T', 'A', '8', ' ' ); - SPTEST.TASK_NAME( 9 ) := RTEMS.BUILD_NAME( 'T', 'A', '9', ' ' ); - SPTEST.TASK_NAME( 10 ) := RTEMS.BUILD_NAME( 'T', 'A', 'A', ' ' ); - - SPTEST.TIMER_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'M', '1', ' ' ); - - SPTEST.SEMAPHORE_NAME( 1 ) := RTEMS.BUILD_NAME( 'S', 'M', '1', ' ' ); - SPTEST.SEMAPHORE_NAME( 2 ) := RTEMS.BUILD_NAME( 'S', 'M', '2', ' ' ); - SPTEST.SEMAPHORE_NAME( 3 ) := RTEMS.BUILD_NAME( 'S', 'M', '3', ' ' ); - - SPTEST.QUEUE_NAME( 1 ) := RTEMS.BUILD_NAME( 'M', 'Q', '1', ' ' ); - SPTEST.QUEUE_NAME( 2 ) := RTEMS.BUILD_NAME( 'M', 'Q', '2', ' ' ); - - SPTEST.PARTITION_NAME( 1 ) := RTEMS.BUILD_NAME( 'P', 'T', '1', ' ' ); - - SPTEST.REGION_NAME( 1 ) := RTEMS.BUILD_NAME( 'R', 'N', '1', ' ' ); - - SPTEST.PORT_NAME( 1 ) := RTEMS.BUILD_NAME( 'D', 'P', '1', ' ' ); - - SPTEST.PERIOD_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'M', '1', ' ' ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 1 ), - 0, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 1 ), - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_PRIORITY, - "TASK_CREATE WITH ILLEGAL PRIORITY" - ); - TEXT_IO.PUT_LINE( "INIT - task_create - INVALID_PRIORITY" ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 1 ), - 4, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" ); - - RTEMS.TASKS.RESTART( - SPTEST.TASK_ID( 1 ), - 0, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INCORRECT_STATE, - "TASK_RESTART OF DORMANT TASK" - ); - TEXT_IO.PUT_LINE( "INIT - task_restart - INCORRECT_STATE" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 1 ), - SPTEST.TASK_1'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- DELAYED_SUBPROGRAM --- - - procedure DELAYED_SUBPROGRAM ( - IGNORED_ID : in RTEMS.ID; - IGNORED_ADDRESS : in RTEMS.ADDRESS - ) is - begin - - NULL; - - end DELAYED_SUBPROGRAM; - --- --- SCREEN_1 --- - - procedure SCREEN_1 - is - SELF_ID : RTEMS.ID; - PREVIOUS_PRIORITY : RTEMS.TASKS.PRIORITY; - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.TASKS.DELETE( 100, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "TASK_DELETE WITH ILLEGAL ID" - ); - TEXT_IO.PUT_LINE( "TA1 - task_delete - INVALID_ID" ); - - RTEMS.TASKS.IDENT( - RTEMS.SELF, - RTEMS.SEARCH_ALL_NODES, - SELF_ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF SELF" ); - if SELF_ID /= SPTEST.TASK_ID( 1 ) then - TEXT_IO.PUT_LINE( "ERROR - task_ident - incorrect ID returned!" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - end if; - TEXT_IO.PUT_LINE( - "TA1 - task_ident - current task SUCCESSFUL" - ); - - RTEMS.TASKS.IDENT( - 100, - RTEMS.SEARCH_ALL_NODES, - SPTEST.JUNK_ID, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_NAME, - "TASK_IDENT WITH ILLEGAL NAME (local)" - ); - TEXT_IO.PUT_LINE( "TA1 - task_ident - global INVALID_NAME" ); - - RTEMS.TASKS.IDENT( 100, 1, SPTEST.JUNK_ID, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_NAME, - "TASK_IDENT WITH ILLEGAL NAME (global)" - ); - TEXT_IO.PUT_LINE( "TA1 - task_ident - local INVALID_NAME" ); - - RTEMS.TASKS.IDENT( 100, 2, SPTEST.JUNK_ID, STATUS ); - if TEST_SUPPORT.Is_Configured_Multiprocessing then - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_NODE, - "TASK_IDENT WITH ILLEGAL NODE" - ); - else - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_NAME, - "TASK_IDENT WITH ILLEGAL NODE" - ); - end if; - TEXT_IO.PUT_LINE( "TA1 - task_ident - INVALID_NODE" ); - - RTEMS.TASKS.RESTART( 100, 0, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "TASK_RESTART WITH ILLEGAL ID" - ); - TEXT_IO.PUT_LINE( "TA1 - task_restart - INVALID_ID" ); - - RTEMS.TASKS.RESUME( 100, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "TASK_RESUME WITH ILLEGAL ID" - ); - TEXT_IO.PUT_LINE( "TA1 - task_resume - INVALID_ID" ); - - RTEMS.TASKS.RESUME( RTEMS.SELF, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INCORRECT_STATE, - "TASK_RESUME OF READY TASK" - ); - TEXT_IO.PUT_LINE( "TA1 - task_resume - INCORRECT_STATE" ); - - begin - RTEMS.TASKS.SET_PRIORITY( RTEMS.SELF, 512, PREVIOUS_PRIORITY, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_PRIORITY, - "TASK_SET_PRIORITY WITH ILLEGAL PRIORITY" - ); - TEXT_IO.PUT_LINE( - "TA1 - task_set_priority - INVALID_PRIORITY" - ); - exception - when others => - TEXT_IO.PUT_LINE( - "TA1 - task_set_priority - INVALID_PRIORITY -- constraint error" - ); - end; - - RTEMS.TASKS.SET_PRIORITY( 100, 8, PREVIOUS_PRIORITY, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "TASK_SET_PRIORITY WITH ILLEGAL ID" - ); - TEXT_IO.PUT_LINE( "TA1 - task_set_priority - INVALID_ID" ); - - RTEMS.TASKS.START( 100, SPTEST.TASK_1'ACCESS, 0, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "TASK_START WITH ILLEGAL ID" - ); - TEXT_IO.PUT_LINE( "TA1 - task_start - INVALID_ID" ); - - RTEMS.TASKS.START( RTEMS.SELF, SPTEST.TASK_1'ACCESS, 0, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INCORRECT_STATE, - "TASK_START OF READY TASK" - ); - TEXT_IO.PUT_LINE( "TA1 - task_start - INCORRECT_STATE" ); - - RTEMS.TASKS.SUSPEND( 100, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "TASK_SUSPEND WITH INVALID ID" - ); - TEXT_IO.PUT_LINE( "TA1 - task_suspend - INVALID_ID" ); - - end SCREEN_1; - --- --- SCREEN_2 --- - - procedure SCREEN_2 - is - TIME : RTEMS.TIME_OF_DAY; - STATUS : RTEMS.STATUS_CODES; - begin - --- errors before clock is set - - RTEMS.CLOCK.GET_TOD( TIME, STATUS ); - if RTEMS.IS_STATUS_SUCCESSFUL( STATUS ) then - TEXT_IO.PUT_LINE( - "TA1 - clock_get - NOT_DEFINED -- DID THE BSP SET THE TIME OF DAY?" - ); - else - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.NOT_DEFINED, - "CLOCK_GET BEFORE CLOCK IS SET" - ); - TEXT_IO.PUT_LINE( "TA1 - clock_get - NOT_DEFINED" ); - end if; - - RTEMS.TASKS.WAKE_WHEN( TIME, STATUS ); - if RTEMS.IS_STATUS_SUCCESSFUL( STATUS ) then - TEXT_IO.PUT( "TA1 - task_wake_when - NOT_DEFINED -- " ); - TEXT_IO.PUT_LINE( "DID THE BSP SET THE TIME OF DAY?" ); - else - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.NOT_DEFINED, - "TASK_WAKE_WHEN BEFORE CLOCK IS SET" - ); - TEXT_IO.PUT_LINE( "TA1 - task_wake_when - NOT_DEFINED" ); - end if; - - RTEMS.TIMER.FIRE_WHEN( - 0, - TIME, - SPTEST.DELAYED_SUBPROGRAM'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - - if RTEMS.IS_STATUS_SUCCESSFUL( STATUS ) then - TEXT_IO.PUT( "TA1 - task_fire_when - NOT_DEFINED -- " ); - TEXT_IO.PUT_LINE( "DID THE BSP SET THE TIME OF DAY?" ); - else - - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.NOT_DEFINED, - "TIMER_FIRE_WHEN BEFORE CLOCK IS SET" - ); - TEXT_IO.PUT_LINE( "TA1 - timer_fire_when - NOT_DEFINED" ); - - end if; - --- invalid time of day field - - TIME := ( 1987, 2, 5, 8, 30, 45, 0 ); - TEST_SUPPORT.PRINT_TIME( "TA1 - clock_set - ", TIME, "" ); - RTEMS.CLOCK.SET( TIME, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_CLOCK, - "CLOCK_SET WITH INVALID YEAR" - ); - TEXT_IO.PUT_LINE( " - INVALID_CLOCK" ); - - TIME := ( 1988, 15, 5, 8, 30, 45, 0 ); - TEST_SUPPORT.PRINT_TIME( "TA1 - clock_set - ", TIME, "" ); - RTEMS.CLOCK.SET( TIME, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_CLOCK, - "CLOCK_SET WITH INVALID MONTH" - ); - TEXT_IO.PUT_LINE( " - INVALID_CLOCK" ); - - TIME := ( 1988, 2, 32, 8, 30, 45, 0 ); - TEST_SUPPORT.PRINT_TIME( "TA1 - clock_set - ", TIME, "" ); - RTEMS.CLOCK.SET( TIME, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_CLOCK, - "CLOCK_SET WITH INVALID DAY" - ); - TEXT_IO.PUT_LINE( " - INVALID_CLOCK" ); - - TIME := ( 1988, 2, 5, 25, 30, 45, 0 ); - TEST_SUPPORT.PRINT_TIME( "TA1 - clock_set - ", TIME, "" ); - RTEMS.CLOCK.SET( TIME, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_CLOCK, - "CLOCK_SET WITH INVALID HOUR" - ); - TEXT_IO.PUT_LINE( " - INVALID_CLOCK" ); - - TIME := ( 1988, 2, 5, 8, 61, 45, 0 ); - TEST_SUPPORT.PRINT_TIME( "TA1 - clock_set - ", TIME, "" ); - RTEMS.CLOCK.SET( TIME, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_CLOCK, - "CLOCK_SET WITH INVALID MINUTE" - ); - TEXT_IO.PUT_LINE( " - INVALID_CLOCK" ); - - TIME := ( 1988, 2, 5, 8, 30, 61, 0 ); - TEST_SUPPORT.PRINT_TIME( "TA1 - clock_set - ", TIME, "" ); - RTEMS.CLOCK.SET( TIME, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_CLOCK, - "CLOCK_SET WITH INVALID SECOND" - ); - TEXT_IO.PUT_LINE( " - INVALID_CLOCK" ); - - TIME := ( 1988, 2, 5, 8, 30, 45, TEST_SUPPORT.TICKS_PER_SECOND + 1 ); - TEST_SUPPORT.PRINT_TIME( "TA1 - clock_set - ", TIME, "" ); - RTEMS.CLOCK.SET( TIME, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_CLOCK, - "CLOCK_SET WITH INVALID TICKS PER SECOND" - ); - TEXT_IO.PUT_LINE( " - INVALID_CLOCK" ); - - TIME := ( 1988, 2, 5, 8, 30, 45, 0 ); - TEST_SUPPORT.PRINT_TIME( "TA1 - clock_set - ", TIME, "" ); - RTEMS.CLOCK.SET( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET SUCCESSFUL" ); - TEXT_IO.PUT_LINE( " - SUCCESSFUL" ); - --- task_wake_when - - TIME := ( 1988, 2, 5, 8, 30, 48, TEST_SUPPORT.TICKS_PER_SECOND + 1 ); - TEXT_IO.PUT( "TA1 - task_wake_when - TICK INVALID - " ); - TEXT_IO.PUT_LINE( "sleep about 3 seconds" ); - RTEMS.TASKS.WAKE_WHEN( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( - STATUS, - "TASK_WAKE_WHEN WITH INVALID TICKS PER SECOND" - ); - TEXT_IO.PUT( "TA1 - task_wake_when - TICK INVALID - " ); - TEXT_IO.PUT_LINE( "woke up SUCCESSFUL" ); - - TIME := ( 1961, 2, 5, 8, 30, 48, 0 ); - TEST_SUPPORT.PRINT_TIME( "TA1 - task_wake_when - ", TIME, "" ); - RTEMS.TASKS.WAKE_WHEN( TIME, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_CLOCK, - "TASK_WAKE_WHEN WITH INVALID YEAR" - ); - TEXT_IO.PUT_LINE( " - INVALID_CLOCK" ); - - TIME := ( 1988, 2, 5, 25, 30, 48, 0 ); - TEST_SUPPORT.PRINT_TIME( "TA1 - task_wake_when - ", TIME, "" ); - RTEMS.TASKS.WAKE_WHEN( TIME, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_CLOCK, - "TASK_WAKE_WHEN WITH INVALID HOUR" - ); - TEXT_IO.PUT_LINE( " - INVALID_CLOCK" ); - - RTEMS.CLOCK.GET_TOD( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); - TEST_SUPPORT.PRINT_TIME( "TA1 - current time - ", TIME, "" ); - TEXT_IO.NEW_LINE; - - TIME.MONTH := 1; - TEST_SUPPORT.PRINT_TIME( "TA1 - task_wake_when - ", TIME, "" ); - RTEMS.TASKS.WAKE_WHEN( TIME, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_CLOCK, - "TASK_WAKE_WHEN BEFORE CURRENT TIME" - ); - TEXT_IO.PUT_LINE( " - INVALID_CLOCK" ); - - end SCREEN_2; - --- --- SCREEN_3 --- - - procedure SCREEN_3 - is - TASK_NAME : RTEMS.NAME; - STATUS : RTEMS.STATUS_CODES; - begin - - TASK_NAME := 1; - - RTEMS.TASKS.CREATE( - 0, - 1, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.JUNK_ID, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_NAME, - "TASK_CREATE WITH ILLEGAL NAME" - ); - TEXT_IO.PUT_LINE( - "TA1 - task_create - INVALID_NAME" - ); - - RTEMS.TASKS.CREATE( - TASK_NAME, - 1, - TEST_SUPPORT.WORK_SPACE_SIZE, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.JUNK_ID, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.UNSATISFIED, - "TASK_CREATE WITH A STACK SIZE LARGER THAN THE WORKSPACE" - ); - TEXT_IO.PUT_LINE( - "TA1 - task_create - stack size - UNSATISFIED" - ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 2 ), - 4, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 2 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" ); - TEXT_IO.PUT_LINE( - "TA1 - task_create - TA2 created - SUCCESSFUL" - ); - - RTEMS.TASKS.SUSPEND( SPTEST.TASK_ID( 2 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND OF TA2" ); - TEXT_IO.PUT_LINE( - "TA1 - task_suspend - suspend TA2 - SUCCESSFUL" - ); - - RTEMS.TASKS.SUSPEND( SPTEST.TASK_ID( 2 ), STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.ALREADY_SUSPENDED, - "TASK_SUSPEND ON SUSPENDED TA2" - ); - TEXT_IO.PUT_LINE( - "TA1 - task_suspend - suspend TA2 - ALREADY_SUSPENDED" - ); - - RTEMS.TASKS.RESUME( SPTEST.TASK_ID( 2 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESUME OF TA2" ); - TEXT_IO.PUT_LINE( - "TA1 - task_resume - TA2 resumed - SUCCESSFUL" - ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 3 ), - 4, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 3 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA3" ); - TEXT_IO.PUT_LINE( - "TA1 - task_create - TA3 created - SUCCESSFUL" - ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 4 ), - 4, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 4 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA4" ); - TEXT_IO.PUT_LINE( - "TA1 - task_create - 4 created - SUCCESSFUL" - ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 5 ), - 4, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 5 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA5" ); - TEXT_IO.PUT_LINE( - "TA1 - task_create - 5 created - SUCCESSFUL" - ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 6 ), - 4, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 6 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA6" ); - TEXT_IO.PUT_LINE( - "TA1 - task_create - 6 created - SUCCESSFUL" - ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 7 ), - 4, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 7 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA7" ); - TEXT_IO.PUT_LINE( - "TA1 - task_create - 7 created - SUCCESSFUL" - ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 8 ), - 4, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 8 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA8" ); - TEXT_IO.PUT_LINE( - "TA1 - task_create - 8 created - SUCCESSFUL" - ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 9 ), - 4, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 9 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA9" ); - TEXT_IO.PUT_LINE( - "TA1 - task_create - 9 created - SUCCESSFUL" - ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 10 ), - 4, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 10 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA10" ); - TEXT_IO.PUT_LINE( - "TA1 - task_create - 10 created - SUCCESSFUL" - ); - - RTEMS.TASKS.CREATE( - TASK_NAME, - 4, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.JUNK_ID, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.TOO_MANY, - "TASK_CREATE FOR TOO MANY TASKS" - ); - TEXT_IO.PUT_LINE( "TA1 - task_create - 11 - TOO_MANY" ); - - if TEST_SUPPORT.Is_Configured_Multiprocessing then - RTEMS.TASKS.CREATE( - TASK_NAME, - 4, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.GLOBAL, - SPTEST.JUNK_ID, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.MP_NOT_CONFIGURED, - "TASK_CREATE OF GLOBAL TASK IN SINGLE CPU SYSTEM" - ); - end if; - TEXT_IO.PUT_LINE( "TA1 - task_create - MP_NOT_CONFIGURED" ); - - end SCREEN_3; - --- --- SCREEN_4 --- - - procedure SCREEN_4 - is - EVENT_OUT : RTEMS.EVENT_SET; - TIME : RTEMS.TIME_OF_DAY; - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.EVENT.RECEIVE( - RTEMS.EVENT_16, - RTEMS.NO_WAIT, - RTEMS.NO_TIMEOUT, - EVENT_OUT, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.UNSATISFIED, - "EVENT_RECEIVE UNSATISFIED (ALL)" - ); - TEXT_IO.PUT_LINE( - "TA1 - event_receive - UNSATISFIED ( all conditions )" - ); - - RTEMS.EVENT.RECEIVE( - RTEMS.EVENT_16, - RTEMS.NO_WAIT + RTEMS.EVENT_ANY, - RTEMS.NO_TIMEOUT, - EVENT_OUT, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.UNSATISFIED, - "EVENT_RECEIVE UNSATISFIED (ANY)" - ); - TEXT_IO.PUT_LINE( - "TA1 - event_receive - UNSATISFIED ( any conditions )" - ); - - TEXT_IO.PUT_LINE( "TA1 - event_receive - timeout in 3 seconds" ); - RTEMS.EVENT.RECEIVE( - RTEMS.EVENT_16, - RTEMS.DEFAULT_OPTIONS, - 3 * TEST_SUPPORT.TICKS_PER_SECOND, - EVENT_OUT, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.TIMEOUT, - "EVENT_RECEIVE AFTER 3 SECOND TIMEOUT" - ); - TEXT_IO.PUT_LINE( - "TA1 - event_receive - woke with TIMEOUT" - ); - - RTEMS.EVENT.SEND( - 100, - RTEMS.EVENT_16, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "EVENT_SEND WITH ILLEGAL ID" - ); - TEXT_IO.PUT_LINE( - "TA1 - event_send - INVALID_ID" - ); - - TEXT_IO.PUT_LINE( - "TA1 - task_wake_after - sleep 1 second - SUCCESSFUL" - ); - RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER (1 SECOND)" ); - - TIME := ( 1988, 2, 5, 8, 30, 45, 0 ); - TEST_SUPPORT.PRINT_TIME( "TA1 - clock_set - ", TIME, "" ); - RTEMS.CLOCK.SET( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET SUCCESSFUL" ); - TEXT_IO.PUT_LINE( " - SUCCESSFUL" ); - - end SCREEN_4; - --- --- SCREEN_5 --- - - procedure SCREEN_5 - is - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.SEMAPHORE.CREATE( - 0, - 1, - RTEMS.DEFAULT_ATTRIBUTES, - RTEMS.TASKS.NO_PRIORITY, - SPTEST.JUNK_ID, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_NAME, - "SEMAPHORE_CREATE WITH ILLEGAL NAME" - ); - TEXT_IO.PUT_LINE( "TA1 - semaphore_create - INVALID_NAME" ); - - RTEMS.SEMAPHORE.CREATE( - SPTEST.SEMAPHORE_NAME( 1 ), - 1, - RTEMS.DEFAULT_ATTRIBUTES, - RTEMS.TASKS.NO_PRIORITY, - SPTEST.SEMAPHORE_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( - STATUS, - "SEMAPHORE_CREATE SUCCESSFUL" - ); - TEXT_IO.PUT_LINE( "TA1 - semaphore_create - 1 - SUCCESSFUL" ); - - RTEMS.SEMAPHORE.CREATE( - SPTEST.SEMAPHORE_NAME( 2 ), - 1, - (RTEMS.BINARY_SEMAPHORE or RTEMS.PRIORITY or RTEMS.INHERIT_PRIORITY), - RTEMS.TASKS.NO_PRIORITY, - SPTEST.SEMAPHORE_ID( 2 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( - STATUS, - "SEMAPHORE_CREATE SUCCESSFUL" - ); - TEXT_IO.PUT_LINE( "TA1 - semaphore_create - 2 - SUCCESSFUL" ); - - loop - RTEMS.SEMAPHORE.CREATE( - SPTEST.SEMAPHORE_NAME( 3 ), - 1, - RTEMS.DEFAULT_ATTRIBUTES, - RTEMS.TASKS.NO_PRIORITY, - SPTEST.JUNK_ID, - STATUS - ); - - exit when not RTEMS.ARE_STATUSES_EQUAL( STATUS, RTEMS.SUCCESSFUL ); - end loop; - - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.TOO_MANY, - "SEMAPHORE_CREATE OF TOO MANY" - ); - TEXT_IO.PUT_LINE( "TA1 - semaphore_create - 3 - TOO_MANY" ); - - RTEMS.SEMAPHORE.CREATE( - SPTEST.SEMAPHORE_NAME( 1 ), - 1, - RTEMS.INHERIT_PRIORITY + RTEMS.BINARY_SEMAPHORE + RTEMS.FIFO, - RTEMS.TASKS.NO_PRIORITY, - SPTEST.JUNK_ID, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.NOT_DEFINED, - "SEMAPHORE_CREATE OF FIFO INHERIT PRIORITY" - ); - TEXT_IO.PUT_LINE("TA1 - semaphore_create - NOT_DEFINED"); - - RTEMS.SEMAPHORE.CREATE( - SPTEST.SEMAPHORE_NAME( 1 ), - 1, - RTEMS.INHERIT_PRIORITY + RTEMS.COUNTING_SEMAPHORE + RTEMS.PRIORITY, - RTEMS.TASKS.NO_PRIORITY, - SPTEST.JUNK_ID, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.NOT_DEFINED, - "SEMAPHORE_CREATE OF COUNTING_SEMAPHORE INHERIT PRIORITY" - ); - TEXT_IO.PUT_LINE("TA1 - semaphore_create - NOT_DEFINED"); - - RTEMS.SEMAPHORE.CREATE( - SPTEST.SEMAPHORE_NAME( 1 ), - 2, - RTEMS.BINARY_SEMAPHORE, - RTEMS.TASKS.NO_PRIORITY, - SPTEST.JUNK_ID, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_NUMBER, - "SEMAPHORE_CREATE OF BINARY_SEMAPHORE with COUNT > 1" - ); - TEXT_IO.PUT_LINE("TA1 - semaphore_create - INVALID_NUMBER"); - - if TEST_SUPPORT.Is_Configured_Multiprocessing then - RTEMS.SEMAPHORE.CREATE( - SPTEST.SEMAPHORE_NAME( 3 ), - 1, - RTEMS.GLOBAL, - RTEMS.TASKS.NO_PRIORITY, - SPTEST.JUNK_ID, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.MP_NOT_CONFIGURED, - "SEMAPHORE_CREATE OF MP_NOT_CONFIGURED" - ); - end if; - TEXT_IO.PUT_LINE("TA1 - semaphore_create - MP_NOT_CONFIGURED"); - - RTEMS.SEMAPHORE.DELETE( 100, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "SEMAPHORE_DELETE WITH ILLEGAL ID" - ); - TEXT_IO.PUT_LINE( - "TA1 - semaphore_delete - unknown INVALID_ID" - ); - - RTEMS.SEMAPHORE.DELETE( 16#10100#, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "SEMAPHORE_DELETE WITH LOCAL ILLEGAL ID" - ); - TEXT_IO.PUT_LINE( - "TA1 - semaphore_delete - local INVALID_ID" - ); - - RTEMS.SEMAPHORE.IDENT( - 100, - RTEMS.SEARCH_ALL_NODES, - SPTEST.JUNK_ID, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_NAME, - "SEMAPHORE_IDENT WITH ILLEGAL NAME (local)" - ); - TEXT_IO.PUT_LINE( - "TA1 - semaphore_ident - global INVALID_NAME" - ); - - RTEMS.SEMAPHORE.IDENT( 100, 1, SPTEST.JUNK_ID, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_NAME, - "SEMAPHORE_IDENT WITH ILLEGAL NAME (global)" - ); - TEXT_IO.PUT_LINE( - "TA1 - semaphore_ident - local INVALID_NAME" - ); - - end SCREEN_5; - --- --- SCREEN_6 --- - - procedure SCREEN_6 - is - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.SEMAPHORE.OBTAIN( - 100, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "SEMAPHORE_OBTAIN WITH ILLEGAL ID" - ); - TEXT_IO.PUT_LINE( "TA1 - semaphore_obtain - INVALID_ID" ); - - RTEMS.SEMAPHORE.OBTAIN( - SPTEST.SEMAPHORE_ID( 1 ), - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED(STATUS, "SEMAPHORE_OBTAIN SUCCESSFUL"); - TEXT_IO.PUT_LINE( - "TA1 - semaphore_obtain - got sem 1 - SUCCESSFUL" - ); - - RTEMS.SEMAPHORE.OBTAIN( - SPTEST.SEMAPHORE_ID( 1 ), - RTEMS.NO_WAIT, - RTEMS.NO_TIMEOUT, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.UNSATISFIED, - "SEMAPHORE_OBTAIN NOT AVAILABLE" - ); - TEXT_IO.PUT_LINE( "TA1 - semaphore_obtain - UNSATISFIED" ); - - TEXT_IO.PUT_LINE( "TA1 - semaphore_obtain - timeout in 3 seconds" ); - RTEMS.SEMAPHORE.OBTAIN( - SPTEST.SEMAPHORE_ID( 1 ), - RTEMS.DEFAULT_OPTIONS, - 3 * TEST_SUPPORT.TICKS_PER_SECOND, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.TIMEOUT, - "SEMAPHORE_OBTAIN NOT AVAILABLE" - ); - TEXT_IO.PUT_LINE( - "TA1 - semaphore_obtain - woke with TIMEOUT" - ); - - RTEMS.SEMAPHORE.RELEASE( SPTEST.SEMAPHORE_ID( 2 ), STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.NOT_OWNER_OF_RESOURCE, - "SEMAPHORE_RELEASE AND NOT OWNER" - ); - TEXT_IO.PUT_LINE( - "TA1 - semaphore_release - NOT_OWNER_OF_RESOURCE" - ); - - RTEMS.SEMAPHORE.RELEASE( 100, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "SEMAPHORE_RELEASE WITH ILLEGAL ID" - ); - TEXT_IO.PUT_LINE( "TA1 - semaphore_release - INVALID_ID" ); - - TEXT_IO.PUT_LINE( - "TA1 - task_start - start TA2 - SUCCESSFUL" - ); - RTEMS.TASKS.START( - SPTEST.TASK_ID( 2 ), - SPTEST.TASK_2'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" ); - - TEXT_IO.PUT_LINE( - "TA1 - task_wake_after - yield processor - SUCCESSFUL" - ); - RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER (yield)" ); - - TEXT_IO.PUT_LINE( - "TA1 - semaphore_delete - delete sem 1 - SUCCESSFUL" - ); - RTEMS.SEMAPHORE.DELETE( SPTEST.SEMAPHORE_ID( 1 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_DELETE OF SM1" ); - - TEXT_IO.PUT_LINE( "TA1 - semaphore_obtain - binary semaphore" ); - RTEMS.SEMAPHORE.OBTAIN( - SPTEST.SEMAPHORE_ID( 2 ), - RTEMS.NO_WAIT, - RTEMS.NO_TIMEOUT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN" ); - - TEXT_IO.PUT_LINE( - "TA1 - semaphore_delete - delete sem 2 - RESOURCE_IN_USE" - ); - RTEMS.SEMAPHORE.DELETE( SPTEST.SEMAPHORE_ID( 2 ), STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.RESOURCE_IN_USE, - "SEMAPHORE_DELETE OF SM2" - ); - - TEXT_IO.PUT_LINE( - "TA1 - task_wake_after - yield processor - SUCCESSFUL" - ); - RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER (yield)" ); - - RTEMS.TASKS.DELETE( SPTEST.TASK_ID( 2 ), STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "TASK_DELETE AFTER THE TASK HAS BEEN DELETED" - ); - TEXT_IO.PUT_LINE( - "TA1 - task_delete TA2 - already deleted INVALID_ID" - ); - - end SCREEN_6; - --- --- SCREEN_7 --- - - procedure SCREEN_7 - is - BUFFER : SPTEST.BUFFER; - BUFFER_POINTER : RTEMS.ADDRESS; - COUNT : RTEMS.UNSIGNED32; - MESSAGE_SIZE : RTEMS.UNSIGNED32 := 0; - STATUS : RTEMS.STATUS_CODES; - begin - - BUFFER_POINTER := BUFFER'ADDRESS; - - RTEMS.MESSAGE_QUEUE.BROADCAST( - 100, - BUFFER_POINTER, - 16, - COUNT, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "MESSAGE_QUEUE_BROADCAST WITH ILLEGAL ID" - ); - TEXT_IO.PUT_LINE( - "TA1 - message_queue_broadcast - INVALID_ID" - ); - - RTEMS.MESSAGE_QUEUE.CREATE( - 0, - 3, - 16, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.JUNK_ID, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_NAME, - "MESSAGE_QUEUE_CREATE WITH ILLEGAL NAME" - ); - TEXT_IO.PUT_LINE( - "TA1 - message_queue_create - Q 1 - INVALID_NAME" - ); - - if TEST_SUPPORT.Is_Configured_Multiprocessing then - RTEMS.MESSAGE_QUEUE.CREATE( - SPTEST.QUEUE_NAME( 1 ), - 1, - 16, - RTEMS.GLOBAL, - SPTEST.JUNK_ID, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.MP_NOT_CONFIGURED, - "MESSAGE_QUEUE_CREATE OF MP NOT CONFIGURED" - ); - end if; - TEXT_IO.PUT_LINE( - "TA1 - message_queue_create - Q 1 - MP_NOT_CONFIGURED"); - - RTEMS.MESSAGE_QUEUE.CREATE( - SPTEST.QUEUE_NAME( 1 ), - 2, - 16, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.QUEUE_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( - STATUS, - "MESSAGE_QUEUE_CREATE SUCCESSFUL" - ); - TEXT_IO.PUT_LINE( - "TA1 - message_queue_create - Q 1 - 2 DEEP - SUCCESSFUL" - ); - - RTEMS.MESSAGE_QUEUE.CREATE( - SPTEST.QUEUE_NAME( 2 ), - 1, - 16, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.JUNK_ID, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.TOO_MANY, - "MESSAGE_QUEUE_CREATE OF TOO MANY" - ); - TEXT_IO.PUT_LINE( - "TA1 - message_queue_create - Q 2 - TOO_MANY" - ); - - RTEMS.MESSAGE_QUEUE.DELETE( 100, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "MESSAGE_QUEUE_DELETE WITH ILLEGAL ID" - ); - TEXT_IO.PUT_LINE( - "TA1 - message_queue_delete - unknown INVALID_ID" - ); - - RTEMS.MESSAGE_QUEUE.DELETE( 16#10100#, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "MESSAGE_QUEUE_DELETE WITH LOCAL ILLEGAL ID" - ); - TEXT_IO.PUT_LINE( - "TA1 - message_queue_delete - local INVALID_ID" - ); - - RTEMS.MESSAGE_QUEUE.IDENT( - 100, - RTEMS.SEARCH_ALL_NODES, - SPTEST.JUNK_ID, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_NAME, - "MESSAGE_QUEUE_IDENT WITH ILLEGAL NAME" - ); - TEXT_IO.PUT_LINE( "TA1 - message_queue_ident - INVALID_NAME" ); - - RTEMS.MESSAGE_QUEUE.GET_NUMBER_PENDING( 100, COUNT, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "MESSAGE_QUEUE_GET_NUMBER_PENDING WITH ILLEGAL ID" - ); - TEXT_IO.PUT_LINE("TA1 - message_queue_get_number_pending - INVALID_ID"); - - RTEMS.MESSAGE_QUEUE.FLUSH( 100, COUNT, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "MESSAGE_QUEUE_FLUSH WITH ILLEGAL ID" - ); - TEXT_IO.PUT_LINE( "TA1 - message_queue_flush - INVALID_ID" ); - - RTEMS.MESSAGE_QUEUE.RECEIVE( - 100, - BUFFER_POINTER, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - MESSAGE_SIZE, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "MESSAGE_QUEUE_RECEIVE WITH ILLEGAL ID" - ); - TEXT_IO.PUT_LINE( "TA1 - message_queue_receive - INVALID_ID" ); - - RTEMS.MESSAGE_QUEUE.RECEIVE( - SPTEST.QUEUE_ID( 1 ), - BUFFER_POINTER, - RTEMS.NO_WAIT, - RTEMS.NO_TIMEOUT, - MESSAGE_SIZE, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.UNSATISFIED, - "MESSAGE_QUEUE_RECEIVE UNSATISFIED" - ); - TEXT_IO.PUT_LINE( - "TA1 - message_queue_receive - Q 1 - UNSATISFIED" - ); - - TEXT_IO.PUT_LINE( - "TA1 - message_queue_receive - Q 1 - timeout in 3 seconds" - ); - RTEMS.MESSAGE_QUEUE.RECEIVE( - SPTEST.QUEUE_ID( 1 ), - BUFFER_POINTER, - RTEMS.DEFAULT_OPTIONS, - 3 * TEST_SUPPORT.TICKS_PER_SECOND, - MESSAGE_SIZE, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.TIMEOUT, - "MESSAGE_QUEUE_RECEIVE 3 SECOND TIMEOUT" - ); - TEXT_IO.PUT_LINE( - "TA1 - message_queue_receive - Q 1 - woke up with TIMEOUT" - ); - - RTEMS.MESSAGE_QUEUE.SEND( 100, BUFFER_POINTER, 16, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "MESSAGE_QUEUE_SEND WITH ILLEGAL ID" - ); - TEXT_IO.PUT_LINE( "TA1 - message_queue_send - INVALID_ID" ); - - RTEMS.MESSAGE_QUEUE.SEND( - SPTEST.QUEUE_ID( 1 ), - BUFFER_POINTER, - 16, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); - TEXT_IO.PUT_LINE( - "TA1 - message_queue_send - BUFFER 1 TO Q 1 - SUCCESSFUL" - ); - - RTEMS.MESSAGE_QUEUE.SEND( - SPTEST.QUEUE_ID( 1 ), - BUFFER_POINTER, - 16, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); - TEXT_IO.PUT_LINE( - "TA1 - message_queue_send - BUFFER 2 TO Q 1 - SUCCESSFUL" - ); - - RTEMS.MESSAGE_QUEUE.SEND( - SPTEST.QUEUE_ID( 1 ), - BUFFER_POINTER, - 16, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.TOO_MANY, - "MESSAGE_QUEUE_SEND TOO MANY TO LIMITED QUEUE" - ); - TEXT_IO.PUT_LINE( - "TA1 - message_queue_send - BUFFER 3 TO Q 1 - TOO_MANY" - ); - - end SCREEN_7; - --- --- SCREEN_8 --- - - procedure SCREEN_8 - is - BUFFER : SPTEST.BUFFER; - BUFFER_POINTER : RTEMS.ADDRESS; - STATUS : RTEMS.STATUS_CODES; - begin - - BUFFER_POINTER := BUFFER'ADDRESS; - - RTEMS.MESSAGE_QUEUE.DELETE( SPTEST.QUEUE_ID( 1 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( - STATUS, - "MESSAGE_QUEUE_DELETE SUCCESSFUL" - ); - TEXT_IO.PUT_LINE( - "TA1 - message_queue_delete - Q 1 - SUCCESSFUL" - ); - - RTEMS.MESSAGE_QUEUE.CREATE( - SPTEST.QUEUE_NAME( 1 ), - 2, - 16, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.QUEUE_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( - STATUS, - "MESSAGE_QUEUE_CREATE SUCCESSFUL" - ); - TEXT_IO.PUT_LINE( - "TA1 - message_queue_create - Q 1 - 2 DEEP - SUCCESSFUL" - ); - - RTEMS.MESSAGE_QUEUE.SEND( - SPTEST.QUEUE_ID( 1 ), - BUFFER_POINTER, - 16, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); - TEXT_IO.PUT_LINE( - "TA1 - message_queue_send - BUFFER 1 TO Q 1 - SUCCESSFUL" - ); - - RTEMS.MESSAGE_QUEUE.SEND( - SPTEST.QUEUE_ID( 1 ), - BUFFER_POINTER, - 16, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); - TEXT_IO.PUT_LINE( - "TA1 - message_queue_send - BUFFER 2 TO Q 1 - SUCCESSFUL" - ); - - RTEMS.MESSAGE_QUEUE.SEND( - SPTEST.QUEUE_ID( 1 ), - BUFFER_POINTER, - 16, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.TOO_MANY, - "MESSAGE_QUEUE_SEND TOO MANY TO LIMITED QUEUE" - ); - TEXT_IO.PUT_LINE( - "TA1 - message_queue_send - BUFFER 3 TO Q 1 - TOO_MANY" - ); - - RTEMS.MESSAGE_QUEUE.DELETE( SPTEST.QUEUE_ID( 1 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( - STATUS, - "MESSAGE_QUEUE_DELETE SUCCESSFUL" - ); - TEXT_IO.PUT_LINE( - "TA1 - message_queue_delete - Q 1 - SUCCESSFUL" - ); - - RTEMS.MESSAGE_QUEUE.CREATE( - SPTEST.QUEUE_NAME( 1 ), - 3, - 16, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.QUEUE_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( - STATUS, - "MESSAGE_QUEUE_CREATE SUCCESSFUL" - ); - TEXT_IO.PUT_LINE( - "TA1 - message_queue_create - Q 1 - 3 DEEP - SUCCESSFUL" - ); - - RTEMS.MESSAGE_QUEUE.SEND( - SPTEST.QUEUE_ID( 1 ), - BUFFER_POINTER, - 16, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); - TEXT_IO.PUT_LINE( - "TA1 - message_queue_send - BUFFER 1 TO Q 1 - SUCCESSFUL" - ); - - RTEMS.MESSAGE_QUEUE.SEND( - SPTEST.QUEUE_ID( 1 ), - BUFFER_POINTER, - 16, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); - TEXT_IO.PUT_LINE( - "TA1 - message_queue_send - BUFFER 2 TO Q 1 - SUCCESSFUL" - ); - - RTEMS.MESSAGE_QUEUE.SEND( - SPTEST.QUEUE_ID( 1 ), - BUFFER_POINTER, - 16, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); - TEXT_IO.PUT_LINE( - "TA1 - message_queue_send - BUFFER 3 TO Q 1 - SUCCESSFUL" - ); - - RTEMS.MESSAGE_QUEUE.SEND( - SPTEST.QUEUE_ID( 1 ), - BUFFER_POINTER, - 16, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.TOO_MANY, - "MESSAGE_QUEUE_SEND TOO MANY TO LIMITED QUEUE" - ); - TEXT_IO.PUT_LINE( - "TA1 - message_queue_send - BUFFER 4 TO Q 1 - TOO_MANY" - ); - - RTEMS.MESSAGE_QUEUE.DELETE( SPTEST.QUEUE_ID( 1 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( - STATUS, - "MESSAGE_QUEUE_DELETE SUCCESSFUL" - ); - TEXT_IO.PUT_LINE( - "TA1 - message_queue_delete - Q 1 - SUCCESSFUL" - ); - - RTEMS.MESSAGE_QUEUE.CREATE( - SPTEST.QUEUE_NAME( 1 ), - 2, - 16, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.QUEUE_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( - STATUS, - "MESSAGE_QUEUE_CREATE SUCCESSFUL" - ); - TEXT_IO.PUT_LINE( - "TA1 - message_queue_create - Q 1 - 3 DEEP - SUCCESSFUL" - ); - - TEXT_IO.PUT_LINE( - "TA1 - task_start - start TA3 - SUCCESSFUL" - ); - RTEMS.TASKS.START( - SPTEST.TASK_ID( 3 ), - SPTEST.TASK_3'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA3" ); - - TEXT_IO.PUT_LINE( - "TA1 - task_wake_after - yield processor - SUCCESSFUL" - ); - RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER (yield)" ); - - RTEMS.MESSAGE_QUEUE.DELETE( SPTEST.QUEUE_ID( 1 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( - STATUS, - "MESSAGE_QUEUE_DELETE SUCCESSFUL" - ); - TEXT_IO.PUT_LINE( - "TA1 - message_queue_delete - delete Q 1 - SUCCESSFUL" - ); - - TEXT_IO.PUT_LINE( - "TA1 - task_wake_after - yield processor - SUCCESSFUL" - ); - RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER (yield)" ); - - end SCREEN_8; - --- --- SCREEN_9 --- - - procedure SCREEN_9 - is - CONVERTED : RTEMS.ADDRESS; - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.PORT.CREATE( - 0, - SPTEST.INTERNAL_PORT_AREA'ADDRESS, - SPTEST.EXTERNAL_PORT_AREA'ADDRESS, - SPTEST.INTERNAL_PORT_AREA'LENGTH, - SPTEST.JUNK_ID, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_NAME, - "PORT_CREATE WITH ILLEGAL NAME" - ); - TEXT_IO.PUT_LINE( "TA1 - port_create - INVALID_NAME" ); - - RTEMS.PORT.CREATE( - SPTEST.PORT_NAME( 1 ), - SPTEST.INTERNAL_PORT_AREA( 1 )'ADDRESS, - SPTEST.EXTERNAL_PORT_AREA'ADDRESS, - SPTEST.INTERNAL_PORT_AREA'LENGTH, - SPTEST.JUNK_ID, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ADDRESS, - "PORT_CREATE WITH ILLEGAL ADDRESS" - ); - TEXT_IO.PUT_LINE( "TA1 - port_create - INVALID_ADDRESS" ); - - RTEMS.PORT.CREATE( - SPTEST.PORT_NAME( 1 ), - SPTEST.INTERNAL_PORT_AREA'ADDRESS, - SPTEST.EXTERNAL_PORT_AREA'ADDRESS, - SPTEST.INTERNAL_PORT_AREA'LENGTH, - SPTEST.JUNK_ID, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.TOO_MANY, - "PORT_CREATE OF TOO MANY" - ); - TEXT_IO.PUT_LINE( "TA1 - port_create - TOO_MANY" ); - - RTEMS.PORT.DELETE( 0, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "PORT_DELETE WITH ILLEGAL ID" - ); - TEXT_IO.PUT_LINE( "TA1 - port_delete - INVALID_ID" ); - - RTEMS.PORT.IDENT( 0, SPTEST.JUNK_ID, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_NAME, - "PORT_IDENT WITH ILLEGAL NAME" - ); - TEXT_IO.PUT_LINE( "TA1 - port_ident - INVALID_NAME" ); - - RTEMS.PORT.INTERNAL_TO_EXTERNAL( - 100, - SPTEST.INTERNAL_PORT_AREA'ADDRESS, - CONVERTED, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "PORT_INTERNAL_TO_EXTERNAL WITH ILLEGAL ID" - ); - TEXT_IO.PUT_LINE( - "TA1 - port_internal_to_external - INVALID_ID" - ); - - RTEMS.PORT.EXTERNAL_TO_INTERNAL( - 100, - SPTEST.EXTERNAL_PORT_AREA'ADDRESS, - CONVERTED, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "PORT_EXTERNAL_TO_INTERNAL WITH ILLEGAL ID" - ); - TEXT_IO.PUT_LINE( - "TA1 - port_external_to_internal - INVALID_ID" - ); - - end SCREEN_9; - --- --- SCREEN_10 --- - - procedure SCREEN_10 - is - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.RATE_MONOTONIC.CREATE( 0, SPTEST.JUNK_ID, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_NAME, - "RATE_MONOTONIC_CREATE WITH ILLEGAL NAME" - ); - TEXT_IO.PUT_LINE( - "TA1 - rate_monotonic_create - INVALID_NAME" - ); - - RTEMS.RATE_MONOTONIC.CREATE( - SPTEST.PERIOD_NAME( 1 ), - SPTEST.PERIOD_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "RATE_MONOTONIC_CREATE" ); - TEXT_IO.PUT_LINE( - "TA1 - rate_monotonic_create - SUCCESSFUL" - ); - - RTEMS.RATE_MONOTONIC.CREATE( - SPTEST.PERIOD_NAME( 1 ), - SPTEST.JUNK_ID, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.TOO_MANY, - "RATE_MONOTONIC_CREATE FOR TOO MANY" - ); - TEXT_IO.PUT_LINE( "TA1 - rate_monotonic_create - TOO_MANY" ); - - RTEMS.RATE_MONOTONIC.IDENT( 0, SPTEST.JUNK_ID, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_NAME, - "RATE_MONOTONIC_IDENT WITH ILLEGAL NAME" - ); - TEXT_IO.PUT_LINE( - "TA1 - rate_monotonic_ident - INVALID_NAME" - ); - - RTEMS.RATE_MONOTONIC.PERIOD( 100, 5, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "RATE_MONOTONIC_PERIOD WITH ILLEGAL ID" - ); - TEXT_IO.PUT_LINE( - "TA1 - rate_monotonic_period - unknown INVALID_ID" - ); - - RTEMS.RATE_MONOTONIC.PERIOD( 16#10100#, 5, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "RATE_MONOTONIC_PERIOD WITH ILLEGAL ID" - ); - TEXT_IO.PUT_LINE( - "TA1 - rate_monotonic_period - local INVALID_ID" - ); - - RTEMS.RATE_MONOTONIC.PERIOD( - SPTEST.PERIOD_ID( 1 ), - RTEMS.RATE_MONOTONIC_PERIOD_STATUS, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.NOT_DEFINED, - "RATE_MONOTONIC_PERIOD STATUS NOT DEFINED" - ); - TEXT_IO.PUT_LINE( - "TA1 - rate_monotonic_period( STATUS ) - NOT_DEFINED" - ); - - RTEMS.RATE_MONOTONIC.PERIOD( SPTEST.PERIOD_ID( 1 ), 100, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( - STATUS, - "RATE_MONOTONIC_PERIOD 100 TICKS" - ); - TEXT_IO.PUT( "TA1 - rate_monotonic_period - 100 ticks - " ); - TEXT_IO.PUT_LINE( "SUCCESSFUL" ); - - RTEMS.RATE_MONOTONIC.PERIOD( - SPTEST.PERIOD_ID( 1 ), - RTEMS.RATE_MONOTONIC_PERIOD_STATUS, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( - STATUS, - "RATE_MONOTONIC_PERIOD STATUS" - ); - TEXT_IO.PUT( "TA1 - rate_monotonic_period( STATUS ) - " ); - TEXT_IO.PUT_LINE( "SUCCESSFUL" ); - - loop - - RTEMS.RATE_MONOTONIC.PERIOD( - SPTEST.PERIOD_ID( 1 ), - RTEMS.RATE_MONOTONIC_PERIOD_STATUS, - STATUS - ); - - exit when RTEMS.ARE_STATUSES_EQUAL( STATUS, RTEMS.TIMEOUT ); - - TEST_SUPPORT.DIRECTIVE_FAILED( - STATUS, - "RATE_MONOTONIC_PERIOD STATUS WAITING FOR TIMEOUT" - ); - - end loop; - TEXT_IO.PUT( "TA1 - rate_monotonic_period( STATUS ) - " ); - TEXT_IO.PUT_LINE( "TIMEOUT" ); - - RTEMS.RATE_MONOTONIC.CANCEL( 100, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "RATE_MONOTONIC_CANCEL WITH ILLEGAL ID" - ); - TEXT_IO.PUT_LINE( - "TA1 - rate_monotonic_cancel - unknown INVALID_ID" - ); - - RTEMS.RATE_MONOTONIC.CANCEL( 16#10100#, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "RATE_MONOTONIC_CANCEL WITH ILLEGAL ID" - ); - TEXT_IO.PUT_LINE( - "TA1 - rate_monotonic_cancel - local INVALID_ID" - ); - - RTEMS.RATE_MONOTONIC.CANCEL( SPTEST.PERIOD_ID( 1 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "RATE_MONOTONIC_CANCEL" ); - TEXT_IO.PUT_LINE( "TA1 - rate_monotonic_cancel - SUCCESSFUL" ); - - RTEMS.RATE_MONOTONIC.PERIOD( SPTEST.PERIOD_ID( 1 ), 5, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( - STATUS, - "RATE_MONOTONIC_PERIOD RESTART" - ); - - RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - RTEMS.RATE_MONOTONIC.PERIOD( SPTEST.PERIOD_ID( 1 ), 5, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.TIMEOUT, - "RATE_MONOTONIC_PERIOD TIMED OUT" - ); - TEXT_IO.PUT_LINE( - "TA1 - rate_monotonic_period - 5 ticks - TIMEOUT" - ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 4 ), - SPTEST.TASK_4'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA4" ); - - TEXT_IO.PUT_LINE( "TA1 - task_wake_after - yielding to TA4" ); - RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER (yield)" ); - - RTEMS.RATE_MONOTONIC.DELETE( 100, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "RATE_MONOTONIC_DELETE WITH ILLEGAL ID" - ); - TEXT_IO.PUT_LINE( - "TA1 - rate_monotonic_delete - unknown INVALID_ID" - ); - - RTEMS.RATE_MONOTONIC.DELETE( 16#10100#, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "RATE_MONOTONIC_DELETE WITH ILLEGAL ID" - ); - TEXT_IO.PUT_LINE( - "TA1 - rate_monotonic_delete - local INVALID_ID" - ); - - RTEMS.RATE_MONOTONIC.DELETE( SPTEST.PERIOD_ID( 1 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "RATE_MONOTONIC_DELETE" ); - TEXT_IO.PUT_LINE( - "TA1 - rate_monotonic_delete - SUCCESSFUL" - ); - - end SCREEN_10; - --- --- SCREEN_11 --- - - procedure SCREEN_11 - is - BUFFER_ADDRESS_1 : RTEMS.ADDRESS; - BUFFER_ADDRESS_2 : RTEMS.ADDRESS; - BUFFER_ADDRESS_3 : RTEMS.ADDRESS; - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.PARTITION.CREATE( - 0, - SPTEST.PARTITION_GOOD_AREA'ADDRESS, - 128, - 40, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.JUNK_ID, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_NAME, - "PARTITION_CREATE WITH ILLEGAL NAME" - ); - TEXT_IO.PUT_LINE( "TA1 - partition_create - INVALID_NAME" ); - - RTEMS.PARTITION.CREATE( - SPTEST.PARTITION_NAME( 1 ), - SPTEST.PARTITION_GOOD_AREA'ADDRESS, - 0, - 80, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.JUNK_ID, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_SIZE, - "PARTITION_CREATE WITH ILLEGAL LENGTH" - ); - TEXT_IO.PUT_LINE( - "TA1 - partition_create - length - INVALID_SIZE" - ); - - RTEMS.PARTITION.CREATE( - SPTEST.PARTITION_NAME( 1 ), - SPTEST.PARTITION_GOOD_AREA'ADDRESS, - 128, - 0, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.JUNK_ID, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_SIZE, - "PARTITION_CREATE WITH ILLEGAL BUFFER_SIZE" - ); - TEXT_IO.PUT_LINE( - "TA1 - partition_create - buffer size - INVALID_SIZE" - ); - - RTEMS.PARTITION.CREATE( - SPTEST.PARTITION_NAME( 1 ), - SPTEST.PARTITION_GOOD_AREA'ADDRESS, - 128, - 256, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.JUNK_ID, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_SIZE, - "PARTITION_CREATE WITH BUFFER_SIZE > LENGTH" - ); - TEXT_IO.PUT_LINE( - "TA1 - partition_create - length < buffer size - INVALID_SIZE" - ); - - if TEST_SUPPORT.Is_Configured_Multiprocessing then - RTEMS.PARTITION.CREATE( - SPTEST.PARTITION_NAME( 1 ), - SPTEST.PARTITION_GOOD_AREA'ADDRESS, - 128, - 64, - RTEMS.GLOBAL, - SPTEST.JUNK_ID, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.MP_NOT_CONFIGURED, - "PARTITION_CREATE OF GLOBAL" - ); - end if; - TEXT_IO.PUT_LINE("TA1 - partition_create - MP_NOT_CONFIGURED"); - - RTEMS.PARTITION.CREATE( - SPTEST.PARTITION_NAME( 1 ), - SPTEST.PARTITION_BAD_AREA'ADDRESS, - 128, - 64, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.JUNK_ID, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ADDRESS, - "PARTITION_CREATE WITH BAD ADDRESS" - ); - TEXT_IO.PUT_LINE( "TA1 - partition_create - INVALID_ADDRESS" ); - - RTEMS.PARTITION.CREATE( - SPTEST.PARTITION_NAME( 1 ), - SPTEST.PARTITION_GOOD_AREA'ADDRESS, - 128, - 34, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.JUNK_ID, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_SIZE, - "PARTITION_CREATE WITH UNALIGNED BUFFER_SIZE" - ); - TEXT_IO.PUT_LINE( "TA1 - partition_create - INVALID_SIZE" ); - - RTEMS.PARTITION.DELETE( 100, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "PARTITION_DELETE WITH ILLEGAL ID" - ); - TEXT_IO.PUT_LINE( - "TA1 - partition_delete - unknown INVALID_ID" - ); - - RTEMS.PARTITION.DELETE( 16#10100#, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "PARTITION_DELETE WITH ILLEGAL ID" - ); - TEXT_IO.PUT_LINE( - "TA1 - partition_delete - local INVALID_ID" - ); - - RTEMS.PARTITION.GET_BUFFER( 100, BUFFER_ADDRESS_1, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "PARTITION_GET_BUFFER WITH ILLEGAL ID" - ); - TEXT_IO.PUT_LINE( "TA1 - partition_get_buffer - INVALID_ID" ); - - RTEMS.PARTITION.IDENT( - 0, - RTEMS.SEARCH_ALL_NODES, - SPTEST.JUNK_ID, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_NAME, - "PARTITION_IDENT WITH ILLEGAL NAME" - ); - TEXT_IO.PUT_LINE( "TA1 - partition_ident - INVALID_NAME" ); - - RTEMS.PARTITION.RETURN_BUFFER( 100, BUFFER_ADDRESS_1, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "PARTITION_RETURN WITH ILLEGAL ID" - ); - TEXT_IO.PUT_LINE( - "TA1 - partition_return_buffer - INVALID_ID" - ); - - RTEMS.PARTITION.CREATE( - SPTEST.PARTITION_NAME( 1 ), - SPTEST.PARTITION_GOOD_AREA'ADDRESS, - 128, - 64, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.PARTITION_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_CREATE" ); - TEXT_IO.PUT_LINE( "TA1 - partition_create - SUCCESSFUL" ); - - RTEMS.PARTITION.CREATE( - SPTEST.PARTITION_NAME( 1 ), - SPTEST.PARTITION_GOOD_AREA'ADDRESS, - 128, - 64, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.JUNK_ID, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.TOO_MANY, - "PARTITION_CREATE OF TOO MANY" - ); - TEXT_IO.PUT_LINE( "TA1 - partition_create - TOO_MANY" ); - - RTEMS.PARTITION.GET_BUFFER( - SPTEST.PARTITION_ID( 1 ), - BUFFER_ADDRESS_1, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_GET_BUFFER" ); - TEXT_IO.PUT_LINE( "TA1 - partition_get_buffer - SUCCESSFUL" ); - - RTEMS.PARTITION.GET_BUFFER( - SPTEST.PARTITION_ID( 1 ), - BUFFER_ADDRESS_2, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_GET_BUFFER" ); - TEXT_IO.PUT_LINE( "TA1 - partition_get_buffer - SUCCESSFUL" ); - - RTEMS.PARTITION.GET_BUFFER( - SPTEST.PARTITION_ID( 1 ), - BUFFER_ADDRESS_3, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.UNSATISFIED, - "PARTITION_GET_BUFFER UNSATISFIED" - ); - TEXT_IO.PUT_LINE( "TA1 - partition_get_buffer - UNSATISFIED" ); - - RTEMS.PARTITION.DELETE( - SPTEST.PARTITION_ID( 1 ), - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.RESOURCE_IN_USE, - "PARTITION_DELETE WITH BUFFERS IN USE" - ); - TEXT_IO.PUT_LINE( "TA1 - partition_delete - RESOURCE_IN_USE" ); - - RTEMS.PARTITION.RETURN_BUFFER( - SPTEST.PARTITION_ID( 1 ), - SPTEST.REGION_GOOD_AREA( 0 )'ADDRESS, -- NOTE: REGION - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ADDRESS, - "PARTITION_RETURN WITH BUFFER ADDRESS OUT OF PARTITION" - ); - TEXT_IO.PUT( "TA1 - partition_return_buffer - " ); - TEXT_IO.PUT_LINE( "INVALID_ADDRESS - out of range" ); - - RTEMS.PARTITION.RETURN_BUFFER( - SPTEST.PARTITION_ID( 1 ), - SPTEST.PARTITION_GOOD_AREA( 7 )'ADDRESS, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ADDRESS, - "PARTITION_RETURN WITH BUFFER ADDRESS NOT ON BOUNDARY" - ); - TEXT_IO.PUT( "TA1 - partition_return_buffer - " ); - TEXT_IO.PUT_LINE( "INVALID_ADDRESS - not on boundary" ); - - - end SCREEN_11; - --- --- SCREEN_12 --- - - procedure SCREEN_12 - is - SEGMENT_ADDRESS_1 : RTEMS.ADDRESS; - SEGMENT_ADDRESS_2 : RTEMS.ADDRESS; - SEGMENT_ADDRESS_3 : RTEMS.ADDRESS; --- OFFSET : RTEMS.UNSIGNED32; --- GOOD_FRONT_FLAG : RTEMS.UNSIGNED32; --- GOOD_BACK_FLAG : RTEMS.UNSIGNED32; - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.REGION.CREATE( - 0, - SPTEST.REGION_GOOD_AREA'ADDRESS, - 16#40#, - 32, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.JUNK_ID, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_NAME, - "REGION_CREATE WITH ILLEGAL NAME" - ); - TEXT_IO.PUT_LINE( "TA1 - region_create - INVALID_NAME" ); - - RTEMS.REGION.CREATE( - SPTEST.REGION_NAME( 1 ), - SPTEST.REGION_BAD_AREA'ADDRESS, - 16#40#, - 32, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.JUNK_ID, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ADDRESS, - "REGION_CREATE WITH ILLEGAL ADDRESS" - ); - TEXT_IO.PUT_LINE( "TA1 - region_create - INVALID_ADDRESS" ); - - RTEMS.REGION.CREATE( - SPTEST.REGION_NAME( 1 ), - SPTEST.REGION_GOOD_AREA'ADDRESS, - 34, - 34, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.JUNK_ID, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_SIZE, - "REGION_CREATE WITH ILLEGAL SIZE" - ); - TEXT_IO.PUT_LINE( "TA1 - region_create - INVALID_SIZE" ); - - RTEMS.REGION.CREATE( - SPTEST.REGION_NAME( 1 ), - SPTEST.REGION_GOOD_AREA( SPTEST.REGION_START_OFFSET )'ADDRESS, - SPTEST.REGION_LENGTH, - 16#40#, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.REGION_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_CREATE" ); - TEXT_IO.PUT_LINE( "TA1 - region_create - SUCCESSFUL" ); - - RTEMS.REGION.CREATE( - SPTEST.REGION_NAME( 1 ), - SPTEST.REGION_GOOD_AREA'ADDRESS, - SPTEST.REGION_LENGTH, - 16#40#, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.JUNK_ID, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.TOO_MANY, - "REGION_CREATE FOR TOO MANY" - ); - TEXT_IO.PUT_LINE( "TA1 - region_create - TOO_MANY" ); - - RTEMS.REGION.DELETE( 100, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "REGION_DELETE WITH ILLEGAL ID" - ); - TEXT_IO.PUT_LINE( "TA1 - region_delete - unknown INVALID_ID" ); - - RTEMS.REGION.DELETE( 16#10100#, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "REGION_DELETE WITH ILLEGAL ID" - ); - TEXT_IO.PUT_LINE( "TA1 - region_delete - local INVALID_ID" ); - - RTEMS.REGION.IDENT( 0, SPTEST.JUNK_ID, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_NAME, - "REGION_IDENT WITH ILLEGAL NAME" - ); - TEXT_IO.PUT_LINE( "TA1 - region_ident - INVALID_NAME" ); - - RTEMS.REGION.GET_SEGMENT( - 100, - 16#40#, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - SEGMENT_ADDRESS_1, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "REGION_GET_SEGMENT WITH ILLEGAL ID" - ); - TEXT_IO.PUT_LINE( "TA1 - region_get_segment - INVALID_ID" ); - - RTEMS.REGION.GET_SEGMENT( - SPTEST.REGION_ID( 1 ), - (SPTEST.REGION_GOOD_AREA'SIZE / 8) * 2, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - SEGMENT_ADDRESS_1, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_SIZE, - "REGION_GET_SEGMENT WITH ILLEGAL SIZE" - ); - TEXT_IO.PUT_LINE( "TA1 - region_get_segment - INVALID_SIZE" ); - - RTEMS.REGION.GET_SEGMENT( - SPTEST.REGION_ID( 1 ), - 384, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - SEGMENT_ADDRESS_1, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); - TEXT_IO.PUT_LINE( "TA1 - region_get_segment - SUCCESSFUL" ); - - RTEMS.REGION.GET_SEGMENT( - SPTEST.REGION_ID( 1 ), - SPTEST.REGION_LENGTH / 2, - RTEMS.NO_WAIT, - RTEMS.NO_TIMEOUT, - SEGMENT_ADDRESS_2, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.UNSATISFIED, - "REGION_GET_SEGMENT UNSATISFIED" - ); - TEXT_IO.PUT_LINE( "TA1 - region_get_segment - UNSATISFIED" ); - - TEXT_IO.PUT_LINE( "TA1 - region_get_segment - timeout in 3 seconds" ); - RTEMS.REGION.GET_SEGMENT( - SPTEST.REGION_ID( 1 ), - 128, - RTEMS.DEFAULT_OPTIONS, - 3 * TEST_SUPPORT.TICKS_PER_SECOND, - SEGMENT_ADDRESS_3, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.TIMEOUT, - "REGION_GET_SEGMENT TIMEOUT" - ); - TEXT_IO.PUT_LINE( - "TA1 - region_get_segment - woke up with TIMEOUT" - ); - - RTEMS.REGION.DELETE( SPTEST.REGION_ID( 1 ), STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.RESOURCE_IN_USE, - "REGION_DELETE WITH BUFFERS IN USE" - ); - TEXT_IO.PUT_LINE( "TA1 - region_delete - RESOURCE_IN_USE" ); - - RTEMS.REGION.RETURN_SEGMENT( - 100, - SEGMENT_ADDRESS_1, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "REGION_RETURN_SEGMENT WITH ILLEGAL ID" - ); - TEXT_IO.PUT_LINE( "TA1 - region_return_segment - INVALID_ID" ); - - RTEMS.REGION.RETURN_SEGMENT( - SPTEST.REGION_ID( 1 ), - SPTEST.REGION_GOOD_AREA'ADDRESS, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ADDRESS, - "REGION_RETURN_SEGMENT WITH ILLEGAL SEGMENT" - ); - TEXT_IO.PUT_LINE( - "TA1 - region_return_segment - INVALID_ADDRESS" - ); - --- OFFSET := 0; --- GOOD_BACK_FLAG := 0; --- GOOD_FRONT_FLAG := 0; - - TEXT_IO.PUT_LINE( - "TA1 - region_return_segment - INVALID_ADDRESS - SKIPPED" - ); - TEXT_IO.PUT_LINE( - "TA1 - region_return_segment - INVALID_ADDRESS - SKIPPED" - ); - - --- OFFSET := RTEMS.SUBTRACT( --- SEGMENT_ADDRESS_1, --- SPTEST.REGION_GOOD_AREA'ADDRESS --- ) / 4; --- --- --- -- bad FRONT_FLAG error --- --- GOOD_FRONT_FLAG := SPTEST.REGION_GOOD_AREA( OFFSET - 1 ); --- SPTEST.REGION_GOOD_AREA( OFFSET - 1 ) := GOOD_FRONT_FLAG + 2; --- --- RTEMS.REGION.RETURN_SEGMENT( --- SPTEST.REGION_ID( 1 ), --- SEGMENT_ADDRESS_1, --- STATUS --- ); --- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( --- STATUS, --- RTEMS.INVALID_ADDRESS, --- "REGION_RETURN_SEGMENT WITH BACK_FLAG /= FRONT_FLAG" --- ); --- TEXT_IO.PUT_LINE( --- "TA1 - region_return_segment - INVALID_ADDRESS" --- ); --- --- SPTEST.REGION_GOOD_AREA( OFFSET - 1 ) := GOOD_FRONT_FLAG; --- --- -- bad BACK_FLAG error --- --- GOOD_BACK_FLAG := SPTEST.REGION_GOOD_AREA( OFFSET - 2 ); --- SPTEST.REGION_GOOD_AREA( OFFSET - 2 ) := 1024; --- --- RTEMS.REGION.RETURN_SEGMENT( --- SPTEST.REGION_ID( 1 ), --- SEGMENT_ADDRESS_1, --- STATUS --- ); --- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( --- STATUS, --- RTEMS.INVALID_ADDRESS, --- "REGION_RETURN_SEGMENT WITH BACK_FLAG /= FRONT_FLAG" --- ); --- TEXT_IO.PUT_LINE( --- "TA1 - region_return_segment - INVALID_ADDRESS" --- ); --- --- SPTEST.REGION_GOOD_AREA( OFFSET - 2 ) := GOOD_BACK_FLAG; - - RTEMS.REGION.EXTEND( - 100, - SPTEST.REGION_GOOD_AREA'ADDRESS, - 128, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "REGION_EXTEND WITH INVALID_ID" - ); - TEXT_IO.PUT_LINE( - "TA1 - region_extend - INVALID_ID" - ); - - RTEMS.REGION.EXTEND( - SPTEST.REGION_ID( 1 ), - SPTEST.REGION_GOOD_AREA( SPTEST.REGION_START_OFFSET + 16 )'ADDRESS, - 128, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ADDRESS, - "REGION_EXTEND WITH INVALID_ADDRESS" - ); - TEXT_IO.PUT_LINE( - "TA1 - region_extend - within heap - INVALID_ADDRESS" - ); - - RTEMS.REGION.EXTEND( - SPTEST.REGION_ID( 1 ), - SPTEST.REGION_BAD_AREA'ADDRESS, - 128, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.NOT_IMPLEMENTED, - "REGION_EXTEND WITH NOT_IMPLEMENTED" - ); - TEXT_IO.PUT_LINE( - "TA1 - region_extend - non-contiguous lower - NOT_IMPLEMENTED" - ); - - RTEMS.REGION.EXTEND( - SPTEST.REGION_ID( 1 ), - SPTEST.REGION_GOOD_AREA( - SPTEST.REGION_START_OFFSET - SPTEST.REGION_LENGTH )'ADDRESS, - 128, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.NOT_IMPLEMENTED, - "REGION_EXTEND WITH NOT_IMPLEMENTED" - ); - TEXT_IO.PUT_LINE( - "TA1 - region_extend - contiguous lower - NOT_IMPLEMENTED" - ); - - RTEMS.REGION.EXTEND( - SPTEST.REGION_ID( 1 ), - SPTEST.REGION_GOOD_AREA( - SPTEST.REGION_START_OFFSET + SPTEST.REGION_LENGTH + 16 )'ADDRESS, - 128, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.NOT_IMPLEMENTED, - "REGION_EXTEND WITH NOT_IMPLEMENTED" - ); - TEXT_IO.PUT_LINE( - "TA1 - region_extend - non-contiguous higher - NOT_IMPLEMENTED" - ); - - end SCREEN_12; - --- --- SCREEN_13 --- - - procedure SCREEN_13 - is - TIME : RTEMS.TIME_OF_DAY; - STATUS : RTEMS.STATUS_CODES; - begin - TIME := ( 2000, 12, 31, 23, 59, 59, 0 ); - RTEMS.CLOCK.SET( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET SUCCESSFUL" ); - TEST_SUPPORT.PRINT_TIME( - "TA1 - clock_set - ", - TIME, - " - SUCCESSFUL" - ); - TEXT_IO.NEW_LINE; - RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - RTEMS.CLOCK.GET_TOD( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); - TEST_SUPPORT.PRINT_TIME( - "TA1 - clock_get - ", - TIME, - " - SUCCESSFUL" - ); - TEXT_IO.NEW_LINE; - - TIME := ( 1999, 12, 31, 23, 59, 59, 0 ); - RTEMS.CLOCK.SET( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET SUCCESSFUL" ); - TEST_SUPPORT.PRINT_TIME( - "TA1 - clock_set - ", - TIME, - " - SUCCESSFUL" - ); - TEXT_IO.NEW_LINE; - RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - RTEMS.CLOCK.GET_TOD( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); - TEST_SUPPORT.PRINT_TIME( - "TA1 - clock_get - ", - TIME, - " - SUCCESSFUL" - ); - TEXT_IO.NEW_LINE; - - TIME := ( 2100, 12, 31, 23, 59, 59, 0 ); - RTEMS.CLOCK.SET( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET SUCCESSFUL" ); - TEST_SUPPORT.PRINT_TIME( - "TA1 - clock_set - ", - TIME, - " - SUCCESSFUL" - ); - TEXT_IO.NEW_LINE; - RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - RTEMS.CLOCK.GET_TOD( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); - TEST_SUPPORT.PRINT_TIME( - "TA1 - clock_get - ", - TIME, - " - SUCCESSFUL" - ); - TEXT_IO.NEW_LINE; - - TIME := ( 2099, 12, 31, 23, 59, 59, 0 ); - RTEMS.CLOCK.SET( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET SUCCESSFUL" ); - TEST_SUPPORT.PRINT_TIME( - "TA1 - clock_set - ", - TIME, - " - SUCCESSFUL" - ); - TEXT_IO.NEW_LINE; - RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - RTEMS.CLOCK.GET_TOD( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); - TEST_SUPPORT.PRINT_TIME( - "TA1 - clock_get - ", - TIME, - " - SUCCESSFUL" - ); - TEXT_IO.NEW_LINE; - - TIME := ( 1991, 12, 31, 23, 59, 59, 0 ); - RTEMS.CLOCK.SET( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET SUCCESSFUL" ); - TEST_SUPPORT.PRINT_TIME( - "TA1 - clock_set - ", - TIME, - " - SUCCESSFUL" - ); - TEXT_IO.NEW_LINE; - RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - RTEMS.CLOCK.GET_TOD( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); - TEST_SUPPORT.PRINT_TIME( - "TA1 - clock_get - ", - TIME, - " - SUCCESSFUL" - ); - TEXT_IO.NEW_LINE; - - end SCREEN_13; - --- --- SCREEN_14 --- - - procedure SCREEN_14 - is - TIME : RTEMS.TIME_OF_DAY; - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.TIMER.CREATE( 0, SPTEST.JUNK_ID, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_NAME, - "TIMER_CREATE WITH ILLEGAL NAME" - ); - TEXT_IO.PUT_LINE( "TA1 - timer_create - INVALID_NAME" ); - - RTEMS.TIMER.CREATE( - SPTEST.TIMER_NAME( 1 ), - SPTEST.TIMER_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE" ); - TEXT_IO.PUT_LINE( "TA1 - timer_create - 1 - SUCCESSFUL" ); - - RTEMS.TIMER.CREATE( - SPTEST.TIMER_NAME( 1 ), - SPTEST.JUNK_ID, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.TOO_MANY, - "TIMER_CREATE FOR TOO MANY" - ); - TEXT_IO.PUT_LINE( "TA1 - timer_create - 2 - TOO_MANY" ); - - RTEMS.TIMER.DELETE( 100, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "TIMER_DELETE WITH ILLEGAL ID" - ); - TEXT_IO.PUT_LINE( "TA1 - timer_delete - local INVALID_ID" ); - - RTEMS.TIMER.DELETE( 16#10100#, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "TIMER_DELETE WITH ILLEGAL ID" - ); - TEXT_IO.PUT_LINE( "TA1 - timer_delete - global INVALID_ID" ); - - RTEMS.TIMER.IDENT( 0, SPTEST.JUNK_ID, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_NAME, - "TIMER_IDENT WITH ILLEGAL NAME" - ); - TEXT_IO.PUT_LINE( "TA1 - timer_ident - INVALID_NAME" ); - - RTEMS.TIMER.CANCEL( 16#10100#, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "TIMER_CANCEL WITH ILLEGAL ID" - ); - TEXT_IO.PUT_LINE( "TA1 - timer_cancel - INVALID_ID" ); - - RTEMS.TIMER.RESET( 16#10100#, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "TIMER_RESET WITH ILLEGAL ID" - ); - TEXT_IO.PUT_LINE( "TA1 - timer_reset - INVALID_ID" ); - - RTEMS.TIMER.RESET( SPTEST.TIMER_ID( 1 ), STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.NOT_DEFINED, - "TIMER_RESET BEFORE INITIATED" - ); - TEXT_IO.PUT_LINE( "TA1 - timer_reset - NOT_DEFINED" ); - - RTEMS.TIMER.FIRE_AFTER( - 16#10100#, - 5 * TEST_SUPPORT.TICKS_PER_SECOND, - SPTEST.DELAYED_SUBPROGRAM'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "TIMER_FIRE_AFTER WITH ILLEGAL ID" - ); - TEXT_IO.PUT_LINE( "TA1 - timer_fire_after - INVALID_ID" ); - - TIME := ( 1994, 12, 31, 1, 0, 0, 0 ); - RTEMS.TIMER.FIRE_WHEN( - 16#10100#, - TIME, - SPTEST.DELAYED_SUBPROGRAM'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "TIMER_FIRE_WHEN WITH ILLEGAL ID" - ); - TEXT_IO.PUT_LINE( "TA1 - timer_fire_when - INVALID_ID" ); - - RTEMS.TIMER.FIRE_AFTER( - SPTEST.TIMER_ID( 1 ), - 0, - SPTEST.DELAYED_SUBPROGRAM'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_NUMBER, - "TIMER_FIRE_AFTER WITH 0 TICKS" - ); - TEXT_IO.PUT_LINE( "TA1 - timer_fire_after - INVALID_NUMBER" ); - - TIME := ( 1987, 2, 5, 8, 30, 45, 0 ); - RTEMS.TIMER.FIRE_WHEN( - SPTEST.TIMER_ID( 1 ), - TIME, - SPTEST.DELAYED_SUBPROGRAM'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_CLOCK, - "TIMER_FIRE_WHEN WITH ILLEGAL TIME" - ); - TEST_SUPPORT.PRINT_TIME( - "TA1 - timer_fire_when - ", - TIME, - " - INVALID_CLOCK" - ); - TEXT_IO.NEW_LINE; - - RTEMS.CLOCK.GET_TOD( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET SUCCESSFUL" ); - TEST_SUPPORT.PRINT_TIME( "TA1 - clock_get - ", TIME, "" ); - TEXT_IO.NEW_LINE; - - TIME := ( 1990, 2, 5, 8, 30, 45, 0 ); - RTEMS.TIMER.FIRE_WHEN( - SPTEST.TIMER_ID( 1 ), - TIME, - SPTEST.DELAYED_SUBPROGRAM'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_CLOCK, - "TIMER_FIRE_WHEN BEFORE CURRENT TIME" - ); - TEST_SUPPORT.PRINT_TIME( - "TA1 - timer_fire_when - ", - TIME, - " - before INVALID_CLOCK" - ); - TEXT_IO.NEW_LINE; - - RTEMS.TIMER.SERVER_FIRE_AFTER( - 0, 5, SPTEST.DELAYED_SUBPROGRAM'ACCESS, RTEMS.NULL_ADDRESS, STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INCORRECT_STATE, - "TIMER_SERVER_FIRE_AFTER INCORRECT STATE" - ); - TEXT_IO.PUT_LINE( "TA1 - timer_server_fire_after - INCORRECT_STATE" ); - - RTEMS.TIMER.SERVER_FIRE_WHEN( - 0, TIME, SPTEST.DELAYED_SUBPROGRAM'ACCESS, RTEMS.NULL_ADDRESS, STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INCORRECT_STATE, - "TIMER_SERVER_FIRE_WHEN INCORRECT STATE" - ); - TEXT_IO.PUT_LINE( "TA1 - timer_server_fire_when - INCORRECT_STATE" ); - - RTEMS.TIMER.INITIATE_SERVER( 0, 0, 0, STATUS ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_PRIORITY, - "timer_initiate_server invalid priority" - ); - TEXT_IO.PUT_LINE( "TA1 - timer_initiate_server - INVALID_PRIORITY" ); - - RTEMS.TIMER.INITIATE_SERVER( --- XXX ask Joel --- RTEMS.TIMER.SERVER_DEFAULT_PRIORITY, 0, 0, STATUS - -1, 0, 0, STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "timer_initiate_server" ); - TEXT_IO.PUT_LINE( "TA1 - timer_initiate_server" ); - - RTEMS.TIMER.SERVER_FIRE_AFTER( - 16#010100#, - 5 * TEST_SUPPORT.TICKS_PER_SECOND, - SPTEST.DELAYED_SUBPROGRAM'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "TIMER_SERVER_FIRE_AFTER ILLEGAL ID" - ); - TEXT_IO.PUT_LINE( "TA1 - timer_server_fire_after - INVALID_ID" ); - - TIME := ( 1994, 12, 31, 9, 0, 0, 0 ); - RTEMS.TIMER.SERVER_FIRE_WHEN( - 16#010100#, - TIME, - SPTEST.DELAYED_SUBPROGRAM'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_ID, - "TIMER_SERVER_FIRE_WHEN WITH ILLEGAL ID" - ); - TEXT_IO.PUT_LINE( "TA1 - timer_server_fire_when - INVALID_ID" ); - - RTEMS.TIMER.SERVER_FIRE_AFTER( - SPTEST.TIMER_ID( 1 ), - 0, - SPTEST.DELAYED_SUBPROGRAM'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_NUMBER, - "TIMER_SERVER_FIRE_AFTER WITH 0 TICKS" - ); - TEXT_IO.PUT_LINE( "TA1 - timer_server_fire_after - INVALID_NUMBER" ); - - TIME := ( 1987, 2, 5, 8, 30, 45, 0 ); - RTEMS.TIMER.SERVER_FIRE_WHEN( - SPTEST.TIMER_ID( 1 ), - TIME, - SPTEST.DELAYED_SUBPROGRAM'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_CLOCK, - "TIMER_SERVER_FIRE_WHEN WITH ILLEGAL TIME" - ); - TEST_SUPPORT.PRINT_TIME( - "TA1 - timer_server_fire_when - ", - TIME, - " - INVALID_CLOCK" - ); - TEXT_IO.NEW_LINE; - - RTEMS.CLOCK.GET_TOD( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "clock_set" ); - TEST_SUPPORT.PRINT_TIME( "TA1 - clock_get - ", TIME, "" ); - TEXT_IO.NEW_LINE; - - TIME := ( 1990, 2, 5, 8, 30, 45, 0 ); - RTEMS.TIMER.SERVER_FIRE_WHEN( - SPTEST.TIMER_ID( 1 ), - TIME, - SPTEST.DELAYED_SUBPROGRAM'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.INVALID_CLOCK, - "TIMER_SERVER_FIRE_WHEN BEFORE CURRENT TIME" - ); - TEST_SUPPORT.PRINT_TIME( - "TA1 - timer_server_fire_when - ", - TIME, - " - before INVALID_CLOCK" - ); - TEXT_IO.NEW_LINE; - - end SCREEN_14; - --- --- TASK_1 --- - - procedure TASK_1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - begin - - SPTEST.SCREEN_1; - TEST_SUPPORT.PAUSE_AND_SCREEN_NUMBER( 2 ); - - SPTEST.SCREEN_2; - TEST_SUPPORT.PAUSE_AND_SCREEN_NUMBER( 3 ); - - SPTEST.SCREEN_3; - TEST_SUPPORT.PAUSE_AND_SCREEN_NUMBER( 4 ); - - SPTEST.SCREEN_4; - TEST_SUPPORT.PAUSE_AND_SCREEN_NUMBER( 5 ); - - SPTEST.SCREEN_5; - TEST_SUPPORT.PAUSE_AND_SCREEN_NUMBER( 6 ); - - SPTEST.SCREEN_6; - TEST_SUPPORT.PAUSE_AND_SCREEN_NUMBER( 7 ); - - SPTEST.SCREEN_7; - TEST_SUPPORT.PAUSE_AND_SCREEN_NUMBER( 8 ); - - SPTEST.SCREEN_8; - TEST_SUPPORT.PAUSE_AND_SCREEN_NUMBER( 9 ); - - SPTEST.SCREEN_9; - TEST_SUPPORT.PAUSE_AND_SCREEN_NUMBER( 10 ); - - SPTEST.SCREEN_10; - TEST_SUPPORT.PAUSE_AND_SCREEN_NUMBER( 11 ); - - SPTEST.SCREEN_11; - TEST_SUPPORT.PAUSE_AND_SCREEN_NUMBER( 12 ); - - SPTEST.SCREEN_12; - TEST_SUPPORT.PAUSE_AND_SCREEN_NUMBER( 13 ); - - SPTEST.SCREEN_13; - TEST_SUPPORT.PAUSE_AND_SCREEN_NUMBER( 14 ); - - SPTEST.SCREEN_14; - - TEXT_IO.PUT_LINE( "*** END OF TEST 9 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end TASK_1; - --- --- TASK_2 --- - - procedure TASK_2 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.PUT_LINE( "TA2 - semaphore_obtain - sem 1 - WAIT FOREVER" ); - RTEMS.SEMAPHORE.OBTAIN( - SPTEST.SEMAPHORE_ID( 1 ), - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.OBJECT_WAS_DELETED, - "SEMAPHORE_OBTAIN WAITING TO BE DELETED" - ); - TEXT_IO.PUT_LINE( - "TA2 - semaphore_obtain - woke up with OBJECT_WAS_DELETED" - ); - - TEXT_IO.PUT_LINE( - "TA2 - task_delete - delete self - SUCCESSFUL" - ); - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA2" ); - - end TASK_2; - --- --- TASK_3 --- - - procedure TASK_3 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - BUFFER : SPTEST.BUFFER; - BUFFER_POINTER : RTEMS.ADDRESS; - MESSAGE_SIZE : RTEMS.UNSIGNED32 := 0; - STATUS : RTEMS.STATUS_CODES; - begin - - BUFFER_POINTER := BUFFER'ADDRESS; - - TEXT_IO.PUT_LINE( - "TA3 - message_queue_receive - Q 1 - WAIT FOREVER" - ); - RTEMS.MESSAGE_QUEUE.RECEIVE( - SPTEST.QUEUE_ID( 1 ), - BUFFER_POINTER, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - MESSAGE_SIZE, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.OBJECT_WAS_DELETED, - "MESSAGE_QUEUE_RECEIVE WAITING TO BE DELETED" - ); - TEXT_IO.PUT( "TA3 - message_queue_receive - woke up " ); - TEXT_IO.PUT_LINE( "with OBJECT_WAS_DELETED" ); - - TEXT_IO.PUT_LINE( - "TA3 - task_delete - delete self - SUCCESSFUL" - ); - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA3" ); - - end TASK_3; - --- --- TASK_4 --- - - procedure TASK_4 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.RATE_MONOTONIC.CANCEL( - SPTEST.PERIOD_ID( 1 ), - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.NOT_OWNER_OF_RESOURCE, - "RATE_MONOTONIC_CANCEL NOT THE OWNER" - ); - TEXT_IO.PUT_LINE( - "TA4 - rate_monotonic_cancel - NOT_OWNER_OF_RESOURCE" - ); - - RTEMS.RATE_MONOTONIC.PERIOD( - SPTEST.PERIOD_ID( 1 ), - 5, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.NOT_OWNER_OF_RESOURCE, - "RATE_MONOTONIC_PERIOD NOT THE OWNER" - ); - TEXT_IO.PUT_LINE( - "TA4 - rate_monotonic_period - NOT_OWNER_OF_RESOURCE" - ); - - TEXT_IO.PUT_LINE( - "TA4 - task_delete - delete self - SUCCESSFUL" - ); - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA4" ); - - - end TASK_4; - -end SPTEST; diff --git a/c/src/ada-tests/sptests/sp09/sptest.ads b/c/src/ada-tests/sptests/sp09/sptest.ads deleted file mode 100644 index 9fdad75c3a..0000000000 --- a/c/src/ada-tests/sptests/sp09/sptest.ads +++ /dev/null @@ -1,393 +0,0 @@ --- --- SPTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 9 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 - --- --- Buffer Record similar to that used by RTEMS 3.2.1. Using this --- avoids changes to the test. --- - - type BUFFER is - record - FIELD1 : RTEMS.UNSIGNED32; -- TEMPORARY UNTIL VARIABLE LENGTH - FIELD2 : RTEMS.UNSIGNED32; - FIELD3 : RTEMS.UNSIGNED32; - FIELD4 : RTEMS.UNSIGNED32; - end record; - --- --- These arrays contain the IDs and NAMEs of all RTEMS tasks created --- by this test. --- - - TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 11 ) of RTEMS.ID; - TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 11 ) of RTEMS.NAME; - --- --- These arrays contain the IDs and NAMEs of all RTEMS timers created --- by this test. --- - - TIMER_ID : array ( RTEMS.UNSIGNED32 range 1 .. 1 ) of RTEMS.ID; - TIMER_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 1 ) of RTEMS.NAME; - --- --- These arrays contain the IDs and NAMEs of all RTEMS semaphores created --- by this test. --- - - SEMAPHORE_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; - SEMAPHORE_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; - --- --- These arrays contain the IDs and NAMEs of all RTEMS message queues --- created by this test. --- - - QUEUE_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID; - QUEUE_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME; - --- --- These arrays contain the IDs and NAMEs of all RTEMS partitions created --- by this test. --- - - PARTITION_ID : array ( RTEMS.UNSIGNED32 range 1 .. 1 ) of RTEMS.ID; - PARTITION_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 1 ) of RTEMS.NAME; - --- --- These arrays contain the IDs and NAMEs of all RTEMS regions created --- by this test. --- - - REGION_ID : array ( RTEMS.UNSIGNED32 range 1 .. 1 ) of RTEMS.ID; - REGION_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; - --- --- These arrays contain the IDs and NAMEs of all RTEMS periods created --- by this test. --- - - PERIOD_ID : array ( RTEMS.UNSIGNED32 range 1 .. 1 ) of RTEMS.ID; - PERIOD_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 1 ) of RTEMS.NAME; - --- --- This variable is used as the output ID on directives which return --- an ID but are invoked in a manner which returns a non-SUCCESSFUL --- status code. --- - - JUNK_ID : RTEMS.ID; - --- --- 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 as the --- memory space for a partition. --- - - PARTITION_GOOD_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 255 ) - of RTEMS.UNSIGNED8; - for PARTITION_GOOD_AREA'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT; - --- --- The following area defines a memory area to be used as the --- memory space for a partition which starts at an invalid address. --- - - PARTITION_BAD_AREA_ADDRESS : constant System.Address := - System.Storage_Elements.To_Address(16#00000006#); - - PARTITION_BAD_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 255 ) - of RTEMS.UNSIGNED8; - for PARTITION_BAD_AREA'Address use PARTITION_BAD_AREA_ADDRESS; - --- --- The following area defines a memory area to be used as the --- memory space for a region and constants used to define the regions --- starting area and length. --- - - REGION_GOOD_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 4095 ) - of RTEMS.UNSIGNED32; - for REGION_GOOD_AREA'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT; - - REGION_START_OFFSET : constant RTEMS.UNSIGNED32 := 1024; - REGION_LENGTH : constant RTEMS.UNSIGNED32 := 512; - --- --- The following area defines a memory area to be used as the --- memory space for a region which starts at an invalid address. --- - - REGION_BAD_AREA_ADDRESS : constant System.Address := - System.Storage_Elements.To_Address(16#00000006#); - - REGION_BAD_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 255 ) - of RTEMS.UNSIGNED8; - for REGION_BAD_AREA'Address use REGION_BAD_AREA_ADDRESS; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- DELAYED_SUBPROGRAM --- --- DESCRIPTION: --- --- This subprogram is scheduled as a timer service routine. --- It performs no actions if it fires. --- - - procedure DELAYED_SUBPROGRAM ( - IGNORED_ID : in RTEMS.ID; - IGNORED_ADDRESS : in RTEMS.ADDRESS - ); - pragma Convention (C, DELAYED_SUBPROGRAM); - --- --- TASK_1 --- --- DESCRIPTION: --- --- This RTEMS task tests numerous error conditions. --- - - procedure TASK_1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_1); - --- --- TASK_2 --- --- DESCRIPTION: --- --- This RTEMS task tests numerous error conditions. --- - - procedure TASK_2 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_2); - --- --- TASK_3 --- --- DESCRIPTION: --- --- This RTEMS task tests numerous error conditions. --- - - procedure TASK_3 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_3); - --- --- TASK_4 --- --- DESCRIPTION: --- --- This RTEMS task tests numerous error conditions. --- - - procedure TASK_4 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_4); - --- --- SCREEN_1 --- --- DESCRIPTION: --- --- This subprogram processes the a single output screen of this test. --- - - procedure SCREEN_1; - --- --- SCREEN_2 --- --- DESCRIPTION: --- --- This subprogram processes the a single output screen of this test. --- - - procedure SCREEN_2; - --- --- SCREEN_3 --- --- DESCRIPTION: --- --- This subprogram processes the a single output screen of this test. --- - - procedure SCREEN_3; - --- --- SCREEN_4 --- --- DESCRIPTION: --- --- This subprogram processes the a single output screen of this test. --- - - procedure SCREEN_4; - --- --- SCREEN_5 --- --- DESCRIPTION: --- --- This subprogram processes the a single output screen of this test. --- - - procedure SCREEN_5; - --- --- SCREEN_6 --- --- DESCRIPTION: --- --- This subprogram processes the a single output screen of this test. --- - - procedure SCREEN_6; - --- --- SCREEN_7 --- --- DESCRIPTION: --- --- This subprogram processes the a single output screen of this test. --- - - procedure SCREEN_7; - --- --- SCREEN_8 --- --- DESCRIPTION: --- --- This subprogram processes the a single output screen of this test. --- - - procedure SCREEN_8; - --- --- SCREEN_9 --- --- DESCRIPTION: --- --- This subprogram processes the a single output screen of this test. --- - - procedure SCREEN_9; - --- --- SCREEN_10 --- --- DESCRIPTION: --- --- This subprogram processes the a single output screen of this test. --- - - procedure SCREEN_10; - --- --- SCREEN_11 --- --- DESCRIPTION: --- --- This subprogram processes the a single output screen of this test. --- - - procedure SCREEN_11; - --- --- SCREEN_12 --- --- DESCRIPTION: --- --- This subprogram processes the a single output screen of this test. --- - - procedure SCREEN_12; - --- --- SCREEN_13 --- --- DESCRIPTION: --- --- This subprogram processes the a single output screen of this test. --- - - procedure SCREEN_13; - -end SPTEST; diff --git a/c/src/ada-tests/sptests/sp11/Makefile.am b/c/src/ada-tests/sptests/sp11/Makefile.am deleted file mode 100644 index 5c7cd28809..0000000000 --- a/c/src/ada-tests/sptests/sp11/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_sp11 -ada_sp11_SOURCES = sp11.adb config.h sptest.adb sptest.ads -ada_sp11_SOURCES += ../../support/init.c - -ada_sp11$(EXEEXT): sp11.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_sp11.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/sptests/sp11/ada_sp11.scn b/c/src/ada-tests/sptests/sp11/ada_sp11.scn deleted file mode 100644 index cbb6c4ab88..0000000000 --- a/c/src/ada-tests/sptests/sp11/ada_sp11.scn +++ /dev/null @@ -1,74 +0,0 @@ -*** TEST 11 *** -TA1 - event_send - send EVENT_16 to TA2 -TA1 - event_receive - waiting forever on EVENT_14 and EVENT_15 -TA2 - event_receive - waiting forever on EVENT_16 -TA2 - EVENT_16 received - eventout => 16#10000# -TA2 - event_send - send EVENT_14 and EVENT_15 to TA1 -TA2 - event_receive - waiting forever on EVENT_17 or EVENT_18 - EVENT_ANY -TA1 - EVENT_14 and EVENT_15 received - eventout => 16#C000# -TA1 - event_send - send EVENT_18 to TA2 -TA1 - event_receive - waiting with 10 second timeout on EVENT_14 -TA2 - EVENT_17 or EVENT_18 received - eventout => 16#40000# -TA2 - event_send - send EVENT_14 to TA1 -TA2 - clock_set - 8:15: 0 2/12/1988 -TA2 - event_send - sending EVENT_10 to self after 5 seconds -TA2 - event_receive - waiting forever on EVENT_10 -TA1 - EVENT_14 received - eventout => 16#4000# -TA1 - event_send - send EVENT_19 to TA2 -TA1 - clock_get - 8:15: 0 2/12/1988 - -TA1 - event_send - send EVENT_18 to self after 5 seconds -TA1 - event_receive - waiting forever on EVENT_18 -TA2 - EVENT_10 received - eventout => 16#400# -TA1 - clock_get - 8:15: 5 2/12/1988 -TA2 - event_receive - PENDING_EVENTS -TA2 - eventout => 16#80000# -TA2 - event_receive - EVENT_19 - NO_WAIT -TA2 - EVENT_19 received - eventout => 16#80000# -TA2 - task_delete - deletes self -TA1 - EVENT_18 received - eventout => 16#40000# -TA1 - clock_get - 8:15: 5 2/12/1988 -TA1 - event_send - send EVENT_3 to self -TA1 - event_receive - EVENT_3 or EVENT_22 - NO_WAIT and EVENT_ANY -TA1 - EVENT_3 received - eventout => 16#8# -TA1 - event_send - send EVENT_4 to self -TA1 - event_receive - waiting forever on EVENT_4 or EVENT_5 - EVENT_ANY -TA1 - EVENT_4 received - eventout => 16#10# - -TA1 - event_send - send EVENT_18 to self after 5 seconds -TA1 - timer_cancel - cancelling timer for event EVENT_18 -TA1 - event_send - send EVENT_8 to self after 60 seconds -TA1 - event_send - send EVENT_9 to self after 60 seconds -TA1 - event_send - send EVENT_10 to self after 60 seconds -TA1 - timer_cancel - cancelling timer for event EVENT_8 -TA1 - clock_set - 8:15: 0 2/12/1988 -TA1 - event_send - send EVENT_1 every second -TA1 - EVENT_1 received - eventout => 16#2# - at 8:15: 1 2/12/1988 -TA1 - EVENT_1 received - eventout => 16#2# - at 8:15: 2 2/12/1988 -TA1 - EVENT_1 received - eventout => 16#2# - at 8:15: 3 2/12/1988 -TA1 - timer_cancel - cancelling timer for event EVENT_1 - -TA1 - event_send - send EVENT_11 to self in 1 day -TA1 - event_send - send EVENT_11 to self in 1 day -TA1 - event_send - send EVENT_11 to self in 2 days -TA1 - timer_cancel - cancelling EVENT_11 to self in 1 day -TA1 - timer_cancel - cancelling EVENT_11 to self in 2 days -TA1 - event_send - resending EVENT_11 to self in 2 days -TA1 - clock_set - 8:15: 3 2/15/1988 -TA1 - event_receive - waiting forever on EVENT_11 -TA1 - EVENT_11 received - eventout => 16#800# - -TA1 - event_send/event_receive combination -TA1 - clock_set - 8:15: 0 2/12/1988 -TA1 - event_receive all outstanding events -TA1 - event_send - send EVENT_10 to self in 1 day -TA1 - event_send - send EVENT_11 to self in 2 days -TA1 - clock_set - 7:15: 0 2/12/1988 -TA1 - set time backwards -TA1 - no events received -TA1 - clock_set - 7:15: 0 2/14/1988 -TA1 - set time forwards (leave a timer) -TA1 - EVENT_10 received -TA1 - event_send - send EVENT_11 to self in 100 ticks -TA1 - event_send - send EVENT_11 to self in 200 ticks -*** END OF TEST 11 *** diff --git a/c/src/ada-tests/sptests/sp11/config.h b/c/src/ada-tests/sptests/sp11/config.h deleted file mode 100644 index 41506d08ee..0000000000 --- a/c/src/ada-tests/sptests/sp11/config.h +++ /dev/null @@ -1,32 +0,0 @@ -/* 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 3 -#define CONFIGURE_MAXIMUM_TIMERS 6 -#define CONFIGURE_TICKS_PER_TIMESLICE 100 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/sptests/sp11/sp11.adb b/c/src/ada-tests/sptests/sp11/sp11.adb deleted file mode 100644 index b39fd4b2be..0000000000 --- a/c/src/ada-tests/sptests/sp11/sp11.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test SP11 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 SP11 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 SP11; - diff --git a/c/src/ada-tests/sptests/sp11/sptest.adb b/c/src/ada-tests/sptests/sp11/sptest.adb deleted file mode 100644 index 95dd17846b..0000000000 --- a/c/src/ada-tests/sptests/sp11/sptest.adb +++ /dev/null @@ -1,906 +0,0 @@ --- --- SPTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 11 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 INTERFACES; use INTERFACES; -with TEST_SUPPORT; -with TEXT_IO; -with UNSIGNED32_IO; -with RTEMS.CLOCK; -with RTEMS.EVENT; -with RTEMS.TIMER; - -package body SPTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TEST 11 ***" ); - - SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); - SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 1 ), - 4, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 2 ), - 4, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 2 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 1 ), - SPTEST.TASK_1'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 2 ), - SPTEST.TASK_2'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" ); - - SPTEST.TIMER_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'M', '1', ' ' ); - SPTEST.TIMER_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'M', '2', ' ' ); - SPTEST.TIMER_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'M', '3', ' ' ); - SPTEST.TIMER_NAME( 4 ) := RTEMS.BUILD_NAME( 'T', 'M', '4', ' ' ); - SPTEST.TIMER_NAME( 5 ) := RTEMS.BUILD_NAME( 'T', 'M', '5', ' ' ); - SPTEST.TIMER_NAME( 6 ) := RTEMS.BUILD_NAME( 'T', 'M', '6', ' ' ); - - RTEMS.TIMER.CREATE( - SPTEST.TIMER_NAME( 1 ), - SPTEST.TIMER_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE OF TM1" ); - - RTEMS.TIMER.CREATE( - SPTEST.TIMER_NAME( 2 ), - SPTEST.TIMER_ID( 2 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE OF TM2" ); - - RTEMS.TIMER.CREATE( - SPTEST.TIMER_NAME( 3 ), - SPTEST.TIMER_ID( 3 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE OF TM3" ); - - RTEMS.TIMER.CREATE( - SPTEST.TIMER_NAME( 4 ), - SPTEST.TIMER_ID( 4 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE OF TM4" ); - - RTEMS.TIMER.CREATE( - SPTEST.TIMER_NAME( 5 ), - SPTEST.TIMER_ID( 5 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE OF TM5" ); - - RTEMS.TIMER.CREATE( - SPTEST.TIMER_NAME( 6 ), - SPTEST.TIMER_ID( 6 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE OF TM6" ); - - 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); - EVENTOUT : RTEMS.EVENT_SET; - TIME : RTEMS.TIME_OF_DAY; - STATUS : RTEMS.STATUS_CODES; - INDEX : RTEMS.UNSIGNED32; - begin - - TEXT_IO.PUT_LINE( "TA1 - event_send - send EVENT_16 to TA2" ); - RTEMS.EVENT.SEND( SPTEST.TASK_ID( 2 ), RTEMS.EVENT_16, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND of 16" ); - - TEXT_IO.PUT_LINE( - "TA1 - event_receive - waiting forever on EVENT_14 and EVENT_15" - ); - RTEMS.EVENT.RECEIVE( - RTEMS.EVENT_14 + RTEMS.EVENT_15, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - EVENTOUT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE of 14 and 15" ); - TEXT_IO.PUT( "TA1 - EVENT_14 and EVENT_15 received - eventout => "); - UNSIGNED32_IO.PUT( EVENTOUT, BASE => 16, WIDTH => 8 ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT_LINE( "TA1 - event_send - send EVENT_18 to TA2" ); - RTEMS.EVENT.SEND( SPTEST.TASK_ID( 2 ), RTEMS.EVENT_18, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND of 18" ); - - TEXT_IO.PUT_LINE( - "TA1 - event_receive - waiting with 10 second timeout on EVENT_14" - ); - RTEMS.EVENT.RECEIVE( - RTEMS.EVENT_14, - RTEMS.DEFAULT_OPTIONS, - 10 * TEST_SUPPORT.TICKS_PER_SECOND, - EVENTOUT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE of 14" ); - TEXT_IO.PUT( "TA1 - EVENT_14 received - eventout => "); - UNSIGNED32_IO.PUT( EVENTOUT, BASE => 16, WIDTH => 8 ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT_LINE( "TA1 - event_send - send EVENT_19 to TA2" ); - RTEMS.EVENT.SEND( SPTEST.TASK_ID( 2 ), RTEMS.EVENT_19, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND of 19" ); - - RTEMS.CLOCK.GET_TOD( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); - TEST_SUPPORT.PRINT_TIME( "TA1 - clock_get - ", TIME, "" ); - TEXT_IO.NEW_LINE; - - TEST_SUPPORT.PAUSE; - - TEXT_IO.PUT_LINE( - "TA1 - event_send - send EVENT_18 to self after 5 seconds" - ); - RTEMS.TIMER.FIRE_AFTER( - SPTEST.TIMER_ID( 1 ), - 5 * TEST_SUPPORT.TICKS_PER_SECOND, - SPTEST.TA1_SEND_18_TO_SELF_5_SECONDS'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER 5 seconds" ); - - TEXT_IO.PUT_LINE( - "TA1 - event_receive - waiting forever on EVENT_18" - ); - RTEMS.EVENT.RECEIVE( - RTEMS.EVENT_18, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - EVENTOUT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE of 18" ); - - RTEMS.CLOCK.GET_TOD( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); - - TEXT_IO.PUT( "TA1 - EVENT_18 received - eventout => "); - UNSIGNED32_IO.PUT( EVENTOUT, BASE => 16, WIDTH => 8 ); - TEXT_IO.NEW_LINE; - - TEST_SUPPORT.PRINT_TIME( "TA1 - clock_get - ", TIME, "" ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT_LINE( "TA1 - event_send - send EVENT_3 to self" ); - RTEMS.EVENT.SEND( RTEMS.SELF, RTEMS.EVENT_3, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND of 3" ); - - TEXT_IO.PUT_LINE( - "TA1 - event_receive - EVENT_3 or EVENT_22 - NO_WAIT and EVENT_ANY" - ); - RTEMS.EVENT.RECEIVE( - RTEMS.EVENT_3 + RTEMS.EVENT_22, - RTEMS.NO_WAIT + RTEMS.EVENT_ANY, - RTEMS.NO_TIMEOUT, - EVENTOUT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE of 3 and 22" ); - TEXT_IO.PUT( "TA1 - EVENT_3 received - eventout => "); - UNSIGNED32_IO.PUT( EVENTOUT, BASE => 16, WIDTH => 8 ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT_LINE( "TA1 - event_send - send EVENT_4 to self" ); - RTEMS.EVENT.SEND( RTEMS.SELF, RTEMS.EVENT_4, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND of 4" ); - - TEXT_IO.PUT_LINE( -"TA1 - event_receive - waiting forever on EVENT_4 or EVENT_5 - EVENT_ANY" - ); - RTEMS.EVENT.RECEIVE( - RTEMS.EVENT_4 + RTEMS.EVENT_5, - RTEMS.EVENT_ANY, - RTEMS.NO_TIMEOUT, - EVENTOUT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE of 4 and 5" ); - TEXT_IO.PUT( "TA1 - EVENT_4 received - eventout => "); - UNSIGNED32_IO.PUT( EVENTOUT, BASE => 16, WIDTH => 8 ); - TEXT_IO.NEW_LINE; - - TEST_SUPPORT.PAUSE; - - TEXT_IO.PUT_LINE( - "TA1 - event_send - send EVENT_18 to self after 5 seconds" - ); - RTEMS.TIMER.FIRE_AFTER( - SPTEST.TIMER_ID( 1 ), - 5 * TEST_SUPPORT.TICKS_PER_SECOND, - SPTEST.TA1_SEND_18_TO_SELF_5_SECONDS'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER 5 seconds" ); - - TEXT_IO.PUT_LINE( - "TA1 - timer_cancel - cancelling timer for event EVENT_18" - ); - RTEMS.TIMER.CANCEL( SPTEST.TIMER_ID( 1 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CANCEL" ); - - TEXT_IO.PUT_LINE( - "TA1 - event_send - send EVENT_8 to self after 60 seconds" - ); - RTEMS.TIMER.FIRE_AFTER( - SPTEST.TIMER_ID( 1 ), - 60 * TEST_SUPPORT.TICKS_PER_SECOND, - SPTEST.TA1_SEND_8_TO_SELF_60_SECONDS'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER 60 secs" ); - - TEXT_IO.PUT_LINE( - "TA1 - event_send - send EVENT_9 to self after 60 seconds" - ); - RTEMS.TIMER.FIRE_AFTER( - SPTEST.TIMER_ID( 2 ), - 60 * TEST_SUPPORT.TICKS_PER_SECOND, - SPTEST.TA1_SEND_9_TO_SELF_60_SECONDS'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER 60 secs" ); - - TEXT_IO.PUT_LINE( - "TA1 - event_send - send EVENT_10 to self after 60 seconds" - ); - RTEMS.TIMER.FIRE_AFTER( - SPTEST.TIMER_ID( 3 ), - 60 * TEST_SUPPORT.TICKS_PER_SECOND, - SPTEST.TA1_SEND_10_TO_SELF'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER 60 secs" ); - - TEXT_IO.PUT_LINE( - "TA1 - timer_cancel - cancelling timer for event EVENT_8" - ); - RTEMS.TIMER.CANCEL( SPTEST.TIMER_ID( 1 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CANCEL" ); - - TIME := ( 1988, 2, 12, 8, 15, 0, 0 ); - - TEST_SUPPORT.PRINT_TIME( "TA1 - clock_set - ", TIME, "" ); - TEXT_IO.NEW_LINE; - RTEMS.CLOCK.SET( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TA1 CLOCK_SET" ); - - TEXT_IO.PUT_LINE( - "TA1 - event_send - send EVENT_1 every second" - ); - RTEMS.TIMER.FIRE_AFTER( - SPTEST.TIMER_ID( 1 ), - TEST_SUPPORT.TICKS_PER_SECOND, - SPTEST.TA1_SEND_1_TO_SELF_EVERY_SECOND'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER 1 SECOND" ); - - INDEX := 0; - - loop - - exit when INDEX = 3; - - RTEMS.EVENT.RECEIVE( - RTEMS.EVENT_1, - RTEMS.EVENT_ANY, - RTEMS.NO_TIMEOUT, - EVENTOUT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE of 1" ); - - RTEMS.CLOCK.GET_TOD( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); - - TEXT_IO.PUT( "TA1 - EVENT_1 received - eventout => "); - UNSIGNED32_IO.PUT( EVENTOUT, BASE => 16, WIDTH => 8 ); - TEST_SUPPORT.PRINT_TIME( " - at ", TIME, "" ); - TEXT_IO.NEW_LINE; - - if INDEX < 2 then - RTEMS.TIMER.RESET( SPTEST.TIMER_ID( 1 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TA1 TIMER RESET" ); - end if; - - INDEX := INDEX + 1; - end loop; - - TEXT_IO.PUT_LINE( - "TA1 - timer_cancel - cancelling timer for event EVENT_1" - ); - RTEMS.TIMER.CANCEL( SPTEST.TIMER_ID( 1 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CANCEL" ); - - TEST_SUPPORT.PAUSE; - - TIME.DAY := 13; - TEXT_IO.PUT_LINE( - "TA1 - event_send - send EVENT_11 to self in 1 day" - ); - RTEMS.TIMER.FIRE_WHEN( - SPTEST.TIMER_ID( 1 ), - TIME, - SPTEST.TA1_SEND_11_TO_SELF'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_WHEN 1 day" ); - - TIME.HOUR := 7; - TEXT_IO.PUT_LINE( - "TA1 - event_send - send EVENT_11 to self in 1 day" - ); - RTEMS.TIMER.FIRE_WHEN( - SPTEST.TIMER_ID( 2 ), - TIME, - SPTEST.TA1_SEND_11_TO_SELF'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_WHEN 1 day" ); - TIME.HOUR := 8; - - TIME.DAY := 14; - TEXT_IO.PUT_LINE( - "TA1 - event_send - send EVENT_11 to self in 2 days" - ); - RTEMS.TIMER.FIRE_WHEN( - SPTEST.TIMER_ID( 3 ), - TIME, - SPTEST.TA1_SEND_11_TO_SELF'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_WHEN 2 days" ); - - TEXT_IO.PUT_LINE( - "TA1 - timer_cancel - cancelling EVENT_11 to self in 1 day" - ); - RTEMS.TIMER.CANCEL( SPTEST.TIMER_ID( 1 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CANCEL" ); - - TEXT_IO.PUT_LINE( - "TA1 - timer_cancel - cancelling EVENT_11 to self in 2 days" - ); - RTEMS.TIMER.CANCEL( SPTEST.TIMER_ID( 3 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CANCEL" ); - - TEXT_IO.PUT_LINE( - "TA1 - event_send - resending EVENT_11 to self in 2 days" - ); - RTEMS.TIMER.FIRE_WHEN( - SPTEST.TIMER_ID( 3 ), - TIME, - SPTEST.TA1_SEND_11_TO_SELF'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_WHEN 2 days" ); - - TIME.DAY := 15; - TEST_SUPPORT.PRINT_TIME( "TA1 - clock_set - ", TIME, "" ); - TEXT_IO.NEW_LINE; - RTEMS.CLOCK.SET( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TA1 CLOCK_SET" ); - TEXT_IO.PUT_LINE( - "TA1 - event_receive - waiting forever on EVENT_11" - ); - RTEMS.EVENT.RECEIVE( - RTEMS.EVENT_11, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - EVENTOUT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE of 11" ); - TEXT_IO.PUT( "TA1 - EVENT_11 received - eventout => "); - UNSIGNED32_IO.PUT( EVENTOUT, BASE => 16, WIDTH => 8 ); - TEXT_IO.NEW_LINE; - - TEST_SUPPORT.PAUSE; - --- The following code tests the case of deleting a timer ??? - - TEXT_IO.PUT_LINE( "TA1 - event_send/event_receive combination" ); - RTEMS.TIMER.FIRE_AFTER( - SPTEST.TIMER_ID( 1 ), - 10, - SPTEST.TA1_SEND_11_TO_SELF'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER 10 ticks" ); - RTEMS.EVENT.RECEIVE( - RTEMS.EVENT_11, - RTEMS.DEFAULT_OPTIONS, - 11, - EVENTOUT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE" ); - - TIME := ( 1988, 2, 12, 8, 15, 0, 0 ); - - TEST_SUPPORT.PRINT_TIME( "TA1 - clock_set - ", TIME, "" ); - TEXT_IO.NEW_LINE; - RTEMS.CLOCK.SET( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TA1 CLOCK_SET" ); - - TIME.DAY := 13; - TEXT_IO.PUT_LINE( - "TA1 - event_receive all outstanding events" - ); - RTEMS.EVENT.RECEIVE( - RTEMS.ALL_EVENTS, - RTEMS.NO_WAIT + RTEMS.EVENT_ANY, - RTEMS.NO_TIMEOUT, - EVENTOUT, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.UNSATISFIED, - "EVENT_RECEIVE all events" - ); - - TEXT_IO.PUT_LINE( - "TA1 - event_send - send EVENT_10 to self in 1 day" - ); - RTEMS.TIMER.FIRE_WHEN( - SPTEST.TIMER_ID( 1 ), - TIME, - SPTEST.TA1_SEND_10_TO_SELF'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_WHEN 1 day" ); - - TIME.DAY := 14; - TEXT_IO.PUT_LINE( - "TA1 - event_send - send EVENT_11 to self in 2 days" - ); - RTEMS.TIMER.FIRE_WHEN( - SPTEST.TIMER_ID( 2 ), - TIME, - SPTEST.TA1_SEND_11_TO_SELF'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_WHEN 2 days" ); - - TIME := ( 1988, 2, 12, 7, 15, 0, 0 ); - - TEST_SUPPORT.PRINT_TIME( "TA1 - clock_set - ", TIME, "" ); - TEXT_IO.NEW_LINE; - TEXT_IO.PUT_LINE( "TA1 - set time backwards" ); - RTEMS.CLOCK.SET( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TA1 CLOCK_SET" ); - - RTEMS.EVENT.RECEIVE( - RTEMS.ALL_EVENTS, - RTEMS.NO_WAIT + RTEMS.EVENT_ANY, - RTEMS.NO_TIMEOUT, - EVENTOUT, - STATUS - ); - if EVENTOUT >= RTEMS.EVENT_0 then - TEXT_IO.PUT( "ERROR - " ); - UNSIGNED32_IO.PUT( EVENTOUT, BASE => 16, WIDTH => 8 ); - TEXT_IO.PUT_LINE( " events received" ); - else - TEXT_IO.PUT_LINE( "TA1 - no events received" ); - end if; - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.UNSATISFIED, - "EVENT_RECEIVE all events" - ); - - TIME := ( 1988, 2, 14, 7, 15, 0, 0 ); - - TEST_SUPPORT.PRINT_TIME( "TA1 - clock_set - ", TIME, "" ); - TEXT_IO.NEW_LINE; - TEXT_IO.PUT_LINE( "TA1 - set time forwards (leave a timer)" ); - RTEMS.CLOCK.SET( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TA1 CLOCK_SET" ); - - RTEMS.EVENT.RECEIVE( - RTEMS.ALL_EVENTS, - RTEMS.NO_WAIT + RTEMS.EVENT_ANY, - RTEMS.NO_TIMEOUT, - EVENTOUT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE all events" ); - if EVENTOUT = RTEMS.EVENT_10 then - TEXT_IO.PUT_LINE( "TA1 - EVENT_10 received" ); - else - TEXT_IO.PUT( "ERROR - " ); - UNSIGNED32_IO.PUT( EVENTOUT, BASE => 16, WIDTH => 8 ); - TEXT_IO.PUT_LINE( " events received" ); - end if; - - TEXT_IO.PUT_LINE( - "TA1 - event_send - send EVENT_11 to self in 100 ticks" - ); - RTEMS.TIMER.FIRE_AFTER( - SPTEST.TIMER_ID( 1 ), - 100, - SPTEST.TA1_SEND_11_TO_SELF'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER 100 ticks" ); - - TEXT_IO.PUT_LINE( - "TA1 - event_send - send EVENT_11 to self in 200 ticks" - ); - RTEMS.TIMER.FIRE_AFTER( - SPTEST.TIMER_ID( 2 ), - 100, - SPTEST.TA1_SEND_11_TO_SELF'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER 200 ticks" ); - - TEXT_IO.PUT_LINE( "*** END OF TEST 11 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end TASK_1; - --- --- TASK_2 --- - - procedure TASK_2 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - EVENTOUT : RTEMS.EVENT_SET; - TIME : RTEMS.TIME_OF_DAY; - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.TASKS.WAKE_AFTER( 1 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - TEXT_IO.PUT_LINE( - "TA2 - event_receive - waiting forever on EVENT_16" - ); - RTEMS.EVENT.RECEIVE( - RTEMS.EVENT_16, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - EVENTOUT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE of 16" ); - TEXT_IO.PUT( "TA2 - EVENT_16 received - eventout => "); - UNSIGNED32_IO.PUT( EVENTOUT, BASE => 16, WIDTH => 8 ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT_LINE( - "TA2 - event_send - send EVENT_14 and EVENT_15 to TA1" - ); - RTEMS.EVENT.SEND( - SPTEST.TASK_ID( 1 ), - RTEMS.EVENT_14 + RTEMS.EVENT_15, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND of 14 and 15" ); - - TEXT_IO.PUT_LINE( - "TA2 - event_receive - waiting forever on EVENT_17 or EVENT_18 - EVENT_ANY" - ); - RTEMS.EVENT.RECEIVE( - RTEMS.EVENT_17 + RTEMS.EVENT_18, - RTEMS.EVENT_ANY, - RTEMS.NO_TIMEOUT, - EVENTOUT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE of 17 and 18" ); - TEXT_IO.PUT( "TA2 - EVENT_17 or EVENT_18 received - eventout => "); - UNSIGNED32_IO.PUT( EVENTOUT, BASE => 16, WIDTH => 8 ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT_LINE( - "TA2 - event_send - send EVENT_14 to TA1" - ); - RTEMS.EVENT.SEND( - SPTEST.TASK_ID( 1 ), - RTEMS.EVENT_14, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND of 14" ); - - TIME := ( 1988, 2, 12, 8, 15, 0, 0 ); - - TEST_SUPPORT.PRINT_TIME( "TA2 - clock_set - ", TIME, "" ); - TEXT_IO.NEW_LINE; - RTEMS.CLOCK.SET( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TA2 CLOCK_SET" ); - - TIME.SECOND := TIME.SECOND + 5; - TEXT_IO.PUT_LINE( - "TA2 - event_send - sending EVENT_10 to self after 5 seconds" - ); - RTEMS.TIMER.FIRE_WHEN( - SPTEST.TIMER_ID( 5 ), - TIME, - SPTEST.TA2_SEND_10_TO_SELF'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_WHEN 5 SECONDS" ); - - TEXT_IO.PUT_LINE( - "TA2 - event_receive - waiting forever on EVENT_10" - ); - RTEMS.EVENT.RECEIVE( - RTEMS.EVENT_10, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - EVENTOUT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE of 10" ); - - RTEMS.CLOCK.GET_TOD( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); - - TEXT_IO.PUT( "TA2 - EVENT_10 received - eventout => "); - UNSIGNED32_IO.PUT( EVENTOUT, BASE => 16, WIDTH => 8 ); - TEXT_IO.NEW_LINE; - - TEST_SUPPORT.PRINT_TIME( "TA1 - clock_get - ", TIME, "" ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT_LINE( "TA2 - event_receive - PENDING_EVENTS" ); - RTEMS.EVENT.RECEIVE( - RTEMS.PENDING_EVENTS, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - EVENTOUT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE of 10" ); - TEXT_IO.PUT( "TA2 - eventout => "); - UNSIGNED32_IO.PUT( EVENTOUT, BASE => 16, WIDTH => 8 ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT_LINE( - "TA2 - event_receive - EVENT_19 - NO_WAIT" - ); - RTEMS.EVENT.RECEIVE( - RTEMS.EVENT_19, - RTEMS.NO_WAIT, - RTEMS.NO_TIMEOUT, - EVENTOUT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE of 10" ); - TEXT_IO.PUT( "TA2 - EVENT_19 received - eventout => "); - UNSIGNED32_IO.PUT( EVENTOUT, BASE => 16, WIDTH => 8 ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT_LINE( "TA2 - task_delete - deletes self" ); - RTEMS.TASKS.DELETE( SPTEST.TASK_ID( 2 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE of TA2" ); - - end TASK_2; - --- --- TA1_SEND_18_TO_SELF_5_SECONDS --- - - procedure TA1_SEND_18_TO_SELF_5_SECONDS ( - IGNORED_ID : in RTEMS.ID; - IGNORED_ADDRESS : in RTEMS.ADDRESS - ) - is - pragma Unreferenced(IGNORED_ID); - pragma Unreferenced(IGNORED_ADDRESS); - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.EVENT.SEND( SPTEST.TASK_ID( 1 ), RTEMS.EVENT_18, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND of 18" ); - - end TA1_SEND_18_TO_SELF_5_SECONDS; - --- --- TA1_SEND_8_TO_SELF_60_SECONDS --- - - procedure TA1_SEND_8_TO_SELF_60_SECONDS ( - IGNORED_ID : in RTEMS.ID; - IGNORED_ADDRESS : in RTEMS.ADDRESS - ) - is - pragma Unreferenced(IGNORED_ID); - pragma Unreferenced(IGNORED_ADDRESS); - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.EVENT.SEND( SPTEST.TASK_ID( 1 ), RTEMS.EVENT_8, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND of 8" ); - - end TA1_SEND_8_TO_SELF_60_SECONDS; - --- --- TA1_SEND_9_TO_SELF_60_SECONDS --- - - procedure TA1_SEND_9_TO_SELF_60_SECONDS ( - IGNORED_ID : in RTEMS.ID; - IGNORED_ADDRESS : in RTEMS.ADDRESS - ) - is - pragma Unreferenced(IGNORED_ID); - pragma Unreferenced(IGNORED_ADDRESS); - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.EVENT.SEND( SPTEST.TASK_ID( 1 ), RTEMS.EVENT_9, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND of 9" ); - - end TA1_SEND_9_TO_SELF_60_SECONDS; - --- --- TA1_SEND_10_TO_SELF --- - - procedure TA1_SEND_10_TO_SELF ( - IGNORED_ID : in RTEMS.ID; - IGNORED_ADDRESS : in RTEMS.ADDRESS - ) - is - pragma Unreferenced(IGNORED_ID); - pragma Unreferenced(IGNORED_ADDRESS); - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.EVENT.SEND( SPTEST.TASK_ID( 1 ), RTEMS.EVENT_10, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND of 10" ); - - end TA1_SEND_10_TO_SELF; - --- --- TA1_SEND_1_TO_SELF_EVERY_SECOND --- - - procedure TA1_SEND_1_TO_SELF_EVERY_SECOND ( - IGNORED_ID : in RTEMS.ID; - IGNORED_ADDRESS : in RTEMS.ADDRESS - ) - is - pragma Unreferenced(IGNORED_ID); - pragma Unreferenced(IGNORED_ADDRESS); - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.EVENT.SEND( SPTEST.TASK_ID( 1 ), RTEMS.EVENT_1, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND of 1" ); - - end TA1_SEND_1_TO_SELF_EVERY_SECOND; - --- --- TA1_SEND_11_TO_SELF --- - - procedure TA1_SEND_11_TO_SELF ( - IGNORED_ID : in RTEMS.ID; - IGNORED_ADDRESS : in RTEMS.ADDRESS - ) - is - pragma Unreferenced(IGNORED_ID); - pragma Unreferenced(IGNORED_ADDRESS); - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.EVENT.SEND( SPTEST.TASK_ID( 1 ), RTEMS.EVENT_11, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND of 11" ); - - end TA1_SEND_11_TO_SELF; - --- --- TA2_SEND_10_TO_SELF --- - - procedure TA2_SEND_10_TO_SELF ( - IGNORED_ID : in RTEMS.ID; - IGNORED_ADDRESS : in RTEMS.ADDRESS - ) - is - pragma Unreferenced(IGNORED_ID); - pragma Unreferenced(IGNORED_ADDRESS); - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.EVENT.SEND( SPTEST.TASK_ID( 2 ), RTEMS.EVENT_10, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND of 10" ); - - end TA2_SEND_10_TO_SELF; - -end SPTEST; diff --git a/c/src/ada-tests/sptests/sp11/sptest.ads b/c/src/ada-tests/sptests/sp11/sptest.ads deleted file mode 100644 index b7f03b8f4c..0000000000 --- a/c/src/ada-tests/sptests/sp11/sptest.ads +++ /dev/null @@ -1,186 +0,0 @@ --- --- SPTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 11 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; - -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 .. 3 ) of RTEMS.ID; - TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; - --- --- These arrays contain the IDs and NAMEs of all RTEMS timers created --- by this test. --- - - TIMER_ID : array ( RTEMS.UNSIGNED32 range 1 .. 6 ) of RTEMS.ID; - TIMER_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 6 ) of RTEMS.NAME; - --- --- TA1_SEND_18_TO_SELF_5_SECONDS --- --- DESCRIPTION: --- --- This subprogram is scheduled to be fired by a timer after 5 seconds --- and to send EVENT_18 to TASK_1. --- - - procedure TA1_SEND_18_TO_SELF_5_SECONDS ( - IGNORED_ID : in RTEMS.ID; - IGNORED_ADDRESS : in RTEMS.ADDRESS - ); - pragma Convention (C, TA1_SEND_18_TO_SELF_5_SECONDS); - --- --- TA1_SEND_8_TO_SELF_60_SECONDS --- --- DESCRIPTION: --- --- This subprogram is scheduled to be fired by a timer after 60 seconds --- and to send EVENT_8 to TASK_1. --- - - procedure TA1_SEND_8_TO_SELF_60_SECONDS ( - IGNORED_ID : in RTEMS.ID; - IGNORED_ADDRESS : in RTEMS.ADDRESS - ); - pragma Convention (C, TA1_SEND_8_TO_SELF_60_SECONDS); - --- --- TA1_SEND_9_TO_SELF_5_SECONDS --- --- DESCRIPTION: --- --- This subprogram is scheduled to be fired by a timer after 60 seconds --- and to send EVENT_9 to TASK_1. --- - - procedure TA1_SEND_9_TO_SELF_60_SECONDS ( - IGNORED_ID : in RTEMS.ID; - IGNORED_ADDRESS : in RTEMS.ADDRESS - ); - pragma Convention (C, TA1_SEND_9_TO_SELF_60_SECONDS); - --- --- TA1_SEND_10_TO_SELF --- --- DESCRIPTION: --- --- This subprogram is scheduled to be fired by a timer after 60 seconds --- and to send EVENT_10 to TASK_1. --- - - procedure TA1_SEND_10_TO_SELF ( - IGNORED_ID : in RTEMS.ID; - IGNORED_ADDRESS : in RTEMS.ADDRESS - ); - pragma Convention (C, TA1_SEND_10_TO_SELF); - --- --- TA1_SEND_1_TO_SELF_EVERY_SECOND --- --- DESCRIPTION: --- --- This subprogram is scheduled to be fired by a timer every second --- and to send EVENT_1 to TASK_1 until the timer is cancelled. --- - - procedure TA1_SEND_1_TO_SELF_EVERY_SECOND ( - IGNORED_ID : in RTEMS.ID; - IGNORED_ADDRESS : in RTEMS.ADDRESS - ); - pragma Convention (C, TA1_SEND_1_TO_SELF_EVERY_SECOND); - --- --- TA1_SEND_11_TO_SELF --- --- DESCRIPTION: --- --- This subprogram is scheduled to be fired by a timer at a --- specific time of day and to send EVENT_11 to TASK_1. --- - - procedure TA1_SEND_11_TO_SELF ( - IGNORED_ID : in RTEMS.ID; - IGNORED_ADDRESS : in RTEMS.ADDRESS - ); - pragma Convention (C, TA1_SEND_11_TO_SELF); - --- --- TA2_SEND_10_TO_SELF --- --- DESCRIPTION: --- --- This subprogram is scheduled to be fired by a timer after 5 seconds --- and to send EVENT_10 to TASK_2. --- - - procedure TA2_SEND_10_TO_SELF ( - IGNORED_ID : in RTEMS.ID; - IGNORED_ADDRESS : in RTEMS.ADDRESS - ); - pragma Convention (C, TA2_SEND_10_TO_SELF); - --- --- 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 Event and Timer Managers. --- - - procedure TASK_1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_1); - --- --- TASK_2 --- --- DESCRIPTION: --- --- This RTEMS task tests the Event and Timer Managers. --- - - procedure TASK_2 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_2); - -end SPTEST; diff --git a/c/src/ada-tests/sptests/sp12/Makefile.am b/c/src/ada-tests/sptests/sp12/Makefile.am deleted file mode 100644 index 33c5e080e3..0000000000 --- a/c/src/ada-tests/sptests/sp12/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_sp12 -ada_sp12_SOURCES = sp12.adb config.h sptest.adb sptest.ads -ada_sp12_SOURCES += ../../support/init.c - -ada_sp12$(EXEEXT): sp12.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_sp12.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/sptests/sp12/ada_sp12.scn b/c/src/ada-tests/sptests/sp12/ada_sp12.scn deleted file mode 100644 index d1753e5ace..0000000000 --- a/c/src/ada-tests/sptests/sp12/ada_sp12.scn +++ /dev/null @@ -1,78 +0,0 @@ -*** TEST 12 *** -INIT - Forward priority queue test -PRI1 - semaphore_obtain - wait forever on SM2 -PRI2 - semaphore_obtain - wait forever on SM2 -PRI3 - semaphore_obtain - wait forever on SM2 -PRI4 - semaphore_obtain - wait forever on SM2 -PRI5 - semaphore_obtain - wait forever on SM2 -INIT - Backward priority queue test -PRI5 - semaphore_obtain - wait forever on SM2 -PRI4 - semaphore_obtain - wait forever on SM2 -PRI3 - semaphore_obtain - wait forever on SM2 -PRI2 - semaphore_obtain - wait forever on SM2 -PRI1 - semaphore_obtain - wait forever on SM2 - -INIT - Binary Semaphore and Priority Inheritance Test -INIT - semaphore_create - allocated binary semaphore -INIT - semaphore_release - allocated binary semaphore -INIT - semaphore_delete - allocated binary semaphore -PRI5 - semaphore_obtain - wait forever on SM2 -PRI5 - task_suspend - until all priority tasks blocked -PDRV - priority of PRI5 is 67 -PRI4 - semaphore_obtain - wait forever on SM2 -PDRV - change priority of PRI5 from 67 to 68 -PDRV - priority of PRI5 is 67 -PRI3 - semaphore_obtain - wait forever on SM2 -PDRV - priority of PRI5 is 67 -PRI2 - semaphore_obtain - wait forever on SM2 -PDRV - priority of PRI5 is 66 -PRI1 - semaphore_obtain - wait forever on SM2 -PDRV - priority of PRI5 is 65 -PDRV - task_resume - PRI5 -PRI5 - task_delete - all tasks waiting on SM2 -PRI5 - semaphore_obtain - nested -PRI5 - semaphore_release - nested -PRI5 - semaphore_release - restore priority -PRI5 - priority of PRI5 is 68 - -TA1 - semaphore_ident - smid => 16#1A010009# -TA1 - semaphore_obtain - wait forever on SM2 -TA1 - got SM2 -TA1 - semaphore_obtain - wait forever on SM3 -TA1 - got SM3 -TA1 - semaphore_obtain - get SM1 - NO_WAIT -TA1 - got SM1 -TA1 - task_wake_after - sleep 5 seconds -TA2 - semaphore_obtain - wait forever on SM1 -TA3 - semaphore_obtain - wait forever on SM2 - -TA1 - semaphore_release - release SM1 -TA1 - semaphore_obtain - waiting for SM1 with 10 second timeout -TA2 - got SM1 -TA2 - semaphore_release - release SM1 -TA2 - task_set_priority - make self highest priority task -TA2 - semaphore_obtain - wait forever on SM2 -TA1 - got SM1 -TA1 - semaphore_release - release SM2 -TA2 - got SM2 -TA2 - semaphore_release - release SM2 -TA2 - task_delete - delete self -TA1 - task_wake_after - sleep 5 seconds -TA3 - got SM2 -TA3 - semaphore_release - release SM2 -TA3 - semaphore_obtain - wait forever on SM3 - -TA1 - task_delete - delete TA3 -TA1 - task_wake_after - sleep 5 seconds -TA4 - semaphore_obtain - wait forever on SM1 -TA5 - semaphore_obtain - wait forever on SM1 -TA1 - task_delete - delete TA4 -TA1 - semaphore_release - release SM1 -TA1 - task_wake_after - sleep 5 seconds -TA5 - got SM1 -TA5 - semaphore_obtain - wait forever on SM1 -TA1 - semaphore_delete - delete SM1 -TA1 - semaphore_delete - delete SM3 -TA1 - task_delete - delete self -TA5 - SM1 deleted by TA1 -*** END OF TEST 12 *** diff --git a/c/src/ada-tests/sptests/sp12/config.h b/c/src/ada-tests/sptests/sp12/config.h deleted file mode 100644 index cd574e737f..0000000000 --- a/c/src/ada-tests/sptests/sp12/config.h +++ /dev/null @@ -1,32 +0,0 @@ -/* 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 8 -#define CONFIGURE_MAXIMUM_SEMAPHORES 10 -#define CONFIGURE_TICKS_PER_TIMESLICE 100 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/sptests/sp12/sp12.adb b/c/src/ada-tests/sptests/sp12/sp12.adb deleted file mode 100644 index 62a5761e51..0000000000 --- a/c/src/ada-tests/sptests/sp12/sp12.adb +++ /dev/null @@ -1,56 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test SP12 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 Interfaces; use Interfaces; -with RTEMS; -with RTEMS.TASKS; -with SPTEST; -with TEST_SUPPORT; - -procedure SP12 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 * 2, - 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 SP12; - diff --git a/c/src/ada-tests/sptests/sp12/sptest.adb b/c/src/ada-tests/sptests/sp12/sptest.adb deleted file mode 100644 index c1d9f627f8..0000000000 --- a/c/src/ada-tests/sptests/sp12/sptest.adb +++ /dev/null @@ -1,809 +0,0 @@ --- --- SPTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 12 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 INTERFACES; use INTERFACES; -with TEST_SUPPORT; -with TEXT_IO; -with UNSIGNED32_IO; -with RTEMS.SEMAPHORE; - -package body SPTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TEST 12 ***" ); - - SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); - SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' ); - SPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' ); - SPTEST.TASK_NAME( 4 ) := RTEMS.BUILD_NAME( 'T', 'A', '4', ' ' ); - SPTEST.TASK_NAME( 5 ) := RTEMS.BUILD_NAME( 'T', 'A', '5', ' ' ); - - SPTEST.PRIORITY_TASK_NAME( 1 ) := - RTEMS.BUILD_NAME( 'P', 'R', 'I', '1' ); - SPTEST.PRIORITY_TASK_NAME( 2 ) := - RTEMS.BUILD_NAME( 'P', 'R', 'I', '2' ); - SPTEST.PRIORITY_TASK_NAME( 3 ) := - RTEMS.BUILD_NAME( 'P', 'R', 'I', '3' ); - SPTEST.PRIORITY_TASK_NAME( 4 ) := - RTEMS.BUILD_NAME( 'P', 'R', 'I', '4' ); - SPTEST.PRIORITY_TASK_NAME( 5 ) := - RTEMS.BUILD_NAME( 'P', 'R', 'I', '5' ); - - SPTEST.SEMAPHORE_NAME( 1 ) := RTEMS.BUILD_NAME( 'S', 'M', '1', ' ' ); - SPTEST.SEMAPHORE_NAME( 2 ) := RTEMS.BUILD_NAME( 'S', 'M', '2', ' ' ); - SPTEST.SEMAPHORE_NAME( 3 ) := RTEMS.BUILD_NAME( 'S', 'M', '3', ' ' ); - - RTEMS.SEMAPHORE.CREATE( - SPTEST.SEMAPHORE_NAME( 1 ), - 1, - RTEMS.DEFAULT_ATTRIBUTES, - RTEMS.TASKS.NO_PRIORITY, - SPTEST.SEMAPHORE_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE OF SM1" ); - - RTEMS.SEMAPHORE.CREATE( - SPTEST.SEMAPHORE_NAME( 2 ), - 0, - RTEMS.PRIORITY, - RTEMS.TASKS.NO_PRIORITY, - SPTEST.SEMAPHORE_ID( 2 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE OF SM2" ); - - RTEMS.SEMAPHORE.CREATE( - SPTEST.SEMAPHORE_NAME( 3 ), - 1, - RTEMS.DEFAULT_ATTRIBUTES, - RTEMS.TASKS.NO_PRIORITY, - SPTEST.SEMAPHORE_ID( 3 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE OF SM3" ); - - TEXT_IO.PUT_LINE( "INIT - Forward priority queue test" ); - SPTEST.PRIORITY_TEST_DRIVER( 0 ); - - TEXT_IO.PUT_LINE( "INIT - Backward priority queue test" ); - SPTEST.PRIORITY_TEST_DRIVER( 32 ); - -TEST_SUPPORT.PAUSE; - - TEXT_IO.PUT_LINE( - "INIT - Binary Semaphore and Priority Inheritance Test" - ); - - RTEMS.SEMAPHORE.DELETE( SPTEST.SEMAPHORE_ID( 2 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_DELETE OF SM2" ); - - TEXT_IO.PUT_LINE( - "INIT - semaphore_create - allocated binary semaphore" - ); - RTEMS.SEMAPHORE.CREATE( - SPTEST.SEMAPHORE_NAME( 2 ), - 0, - RTEMS.BINARY_SEMAPHORE + RTEMS.PRIORITY + RTEMS.INHERIT_PRIORITY, - RTEMS.TASKS.NO_PRIORITY, - SPTEST.SEMAPHORE_ID( 2 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE OF SM2" ); - - TEXT_IO.PUT_LINE( - "INIT - semaphore_release - allocated binary semaphore" - ); - RTEMS.SEMAPHORE.RELEASE( SPTEST.SEMAPHORE_ID( 2 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE OF SM2" ); - - TEXT_IO.PUT_LINE( - "INIT - semaphore_delete - allocated binary semaphore" - ); - RTEMS.SEMAPHORE.DELETE( SPTEST.SEMAPHORE_ID( 2 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_DELETE OF SM2" ); - - RTEMS.SEMAPHORE.CREATE( - SPTEST.SEMAPHORE_NAME( 2 ), - 1, - RTEMS.BINARY_SEMAPHORE + RTEMS.PRIORITY + RTEMS.INHERIT_PRIORITY, - RTEMS.TASKS.NO_PRIORITY, - SPTEST.SEMAPHORE_ID( 2 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE OF SM2" ); - - SPTEST.PRIORITY_TEST_DRIVER( 64 ); - -TEST_SUPPORT.PAUSE; - - RTEMS.SEMAPHORE.DELETE( SPTEST.SEMAPHORE_ID( 2 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_DELETE OF SM2" ); - - RTEMS.SEMAPHORE.CREATE( - SPTEST.SEMAPHORE_NAME( 2 ), - 0, - RTEMS.PRIORITY, - RTEMS.TASKS.NO_PRIORITY, - SPTEST.SEMAPHORE_ID( 2 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE OF SM2" ); - - RTEMS.SEMAPHORE.RELEASE( SPTEST.SEMAPHORE_ID( 2 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE OF SM2" ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 1 ), - 4, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 2 ), - 4, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 2 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 3 ), - 4, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 3 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA3" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 1 ), - SPTEST.TASK_1'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 2 ), - SPTEST.TASK_2'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 3 ), - SPTEST.TASK_3'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA3" ); - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- PRIORITY_TEST_DRIVER --- - - procedure PRIORITY_TEST_DRIVER ( - PRIORITY_BASE : in RTEMS.UNSIGNED32 - ) is - PREVIOUS_PRIORITY : RTEMS.TASKS.PRIORITY; - STATUS : RTEMS.STATUS_CODES; - begin - - for INDEX in 1 .. 5 - loop - - case INDEX is - when 1 | 2 | 3 => - SPTEST.TASK_PRIORITY( INDEX ) := - PRIORITY_BASE + RTEMS.TASKS.PRIORITY( INDEX ); - when others => - SPTEST.TASK_PRIORITY( INDEX ) := PRIORITY_BASE + 3; - end case; - - RTEMS.TASKS.CREATE( - SPTEST.PRIORITY_TASK_NAME( INDEX ), - SPTEST.TASK_PRIORITY( INDEX ), - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.PRIORITY_TASK_ID( INDEX ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); - - end loop; - - if PRIORITY_BASE = 0 then - - for INDEX in 1 .. 5 - loop - - RTEMS.TASKS.START( - SPTEST.PRIORITY_TASK_ID( INDEX ), - SPTEST.PRIORITY_TASK'ACCESS, - RTEMS.TASKS.ARGUMENT( INDEX ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); - - end loop; - - else - - for INDEX in reverse 1 .. 5 - loop - - RTEMS.TASKS.START( - SPTEST.PRIORITY_TASK_ID( INDEX ), - SPTEST.PRIORITY_TASK'ACCESS, - RTEMS.TASKS.ARGUMENT( INDEX ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); - - RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER LOOP" ); - - if PRIORITY_BASE = 64 then - if INDEX = 4 then - RTEMS.TASKS.SET_PRIORITY( - SPTEST.PRIORITY_TASK_ID( 5 ), - PRIORITY_BASE + 4, - PREVIOUS_PRIORITY, - STATUS - ); - TEXT_IO.PUT( "PDRV - change priority of PRI5 from " ); - UNSIGNED32_IO.PUT( PREVIOUS_PRIORITY ); - TEXT_IO.PUT( " to " ); - UNSIGNED32_IO.PUT( PRIORITY_BASE + 4 ); - TEXT_IO.NEW_LINE; - TEST_SUPPORT.DIRECTIVE_FAILED( - STATUS, - "PDRV TASK_SET_PRIORITY" - ); - end if; - - RTEMS.TASKS.SET_PRIORITY( - SPTEST.PRIORITY_TASK_ID( 5 ), - RTEMS.TASKS.CURRENT_PRIORITY, - PREVIOUS_PRIORITY, - STATUS - ); - TEXT_IO.PUT( "PDRV - priority of PRI5 is " ); - UNSIGNED32_IO.PUT( PREVIOUS_PRIORITY ); - TEXT_IO.NEW_LINE; - TEST_SUPPORT.DIRECTIVE_FAILED( - STATUS, - "PDRV TASK_SET_PRIORITY" - ); - end if; - - end loop; - - end if; - - RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER AFTER LOOP" ); - - if PRIORITY_BASE = 0 then - for INDEX in 1 .. 5 - loop - - RTEMS.SEMAPHORE.RELEASE( - SPTEST.SEMAPHORE_ID( 2 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( - STATUS, - "SEMAPHORE_RELEASE LOOP" - ); - - end loop; - end if; - - if PRIORITY_BASE = 64 then - - TEXT_IO.PUT_LINE( "PDRV - task_resume - PRI5" ); - RTEMS.TASKS.RESUME( SPTEST.PRIORITY_TASK_ID( 5 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESUME" ); - - RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( - STATUS, - "TASK_WAKE_AFTER SO PRI5 can run" - ); - - RTEMS.TASKS.DELETE( SPTEST.PRIORITY_TASK_ID( 5 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF PRI5" ); - else - - for INDEX in 1 .. 5 - loop - - RTEMS.TASKS.DELETE( - SPTEST.PRIORITY_TASK_ID( INDEX ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE LOOP" ); - - end loop; - end if; - - - end PRIORITY_TEST_DRIVER; - --- --- PRIORITY_TASK --- - - procedure PRIORITY_TASK ( - ITS_INDEX : in RTEMS.TASKS.ARGUMENT - ) is - TIMEOUT : RTEMS.INTERVAL; - ITS_PRIORITY : RTEMS.TASKS.PRIORITY; - CURRENT_PRIORITY : RTEMS.TASKS.PRIORITY; - STATUS : RTEMS.STATUS_CODES; - begin - - ITS_PRIORITY := SPTEST.TASK_PRIORITY( INTEGER( ITS_INDEX ) ); - - if ITS_PRIORITY < 3 then - TIMEOUT := 5 * TEST_SUPPORT.TICKS_PER_SECOND; - else - TIMEOUT := RTEMS.NO_TIMEOUT; - end if; - - TEST_SUPPORT.PUT_NAME( PRIORITY_TASK_NAME( INTEGER(ITS_INDEX) ), FALSE ); - TEXT_IO.PUT_LINE( " - semaphore_obtain - wait forever on SM2" ); - - RTEMS.SEMAPHORE.OBTAIN( - SPTEST.SEMAPHORE_ID( 2 ), - RTEMS.DEFAULT_OPTIONS, - TIMEOUT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN OF SM2" ); - - if ITS_PRIORITY < 64 then - TEXT_IO.PUT( "PRI" ); - UNSIGNED32_IO.PUT( ITS_INDEX ); - TEXT_IO.PUT( " - WHY AM I HERE? (priority = " ); - UNSIGNED32_IO.PUT( ITS_PRIORITY ); - TEXT_IO.PUT_LINE( " )" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - end if; - - if ITS_INDEX = 5 then - TEXT_IO.PUT_LINE( - "PRI5 - task_suspend - until all priority tasks blocked" - ); - end if; - - RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND" ); - - TEXT_IO.PUT_LINE( "PRI5 - task_delete - all tasks waiting on SM2" ); - for INDEX in 1 .. 4 - loop - - RTEMS.TASKS.DELETE( SPTEST.PRIORITY_TASK_ID( INDEX ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE LOOP" ); - - end loop; - - TEXT_IO.PUT_LINE( "PRI5 - semaphore_obtain - nested" ); - RTEMS.SEMAPHORE.OBTAIN( - SPTEST.SEMAPHORE_ID( 2 ), - RTEMS.DEFAULT_OPTIONS, - TIMEOUT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN NESTED" ); - - TEXT_IO.PUT_LINE( "PRI5 - semaphore_release - nested" ); - RTEMS.SEMAPHORE.RELEASE( SPTEST.SEMAPHORE_ID( 2 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE NESTED" ); - - TEXT_IO.PUT_LINE( "PRI5 - semaphore_release - restore priority" ); - RTEMS.SEMAPHORE.RELEASE( SPTEST.SEMAPHORE_ID( 2 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE" ); - - RTEMS.TASKS.SET_PRIORITY( - SPTEST.PRIORITY_TASK_ID( 5 ), - RTEMS.TASKS.CURRENT_PRIORITY, - CURRENT_PRIORITY, - STATUS - ); - TEXT_IO.PUT( "PRI5 - priority of PRI5 is " ); - UNSIGNED32_IO.PUT( CURRENT_PRIORITY ); - TEXT_IO.NEW_LINE; - TEST_SUPPORT.DIRECTIVE_FAILED( - STATUS, - "PRI5 TASK_SET_PRIORITY CURRENT" - ); - RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS ); - -- DOES NOT RETURN. Following check makes compiler happy - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND" ); - - end PRIORITY_TASK; - --- --- TASK_1 --- - - procedure TASK_1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - SMID : RTEMS.ID; - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.SEMAPHORE.IDENT( - SPTEST.SEMAPHORE_NAME( 1 ), - RTEMS.SEARCH_ALL_NODES, - SMID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_IDENT OF SM1" ); - TEXT_IO.PUT( "TA1 - semaphore_ident - smid => " ); - UNSIGNED32_IO.PUT( SMID, WIDTH => 8, BASE => 16 ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT_LINE( "TA1 - semaphore_obtain - wait forever on SM2" ); - RTEMS.SEMAPHORE.OBTAIN( - SPTEST.SEMAPHORE_ID( 2 ), - RTEMS.DEFAULT_MODES, - RTEMS.NO_TIMEOUT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN ON SM2" ); - - TEXT_IO.PUT_LINE( "TA1 - got SM2" ); - - TEXT_IO.PUT_LINE( "TA1 - semaphore_obtain - wait forever on SM3" ); - RTEMS.SEMAPHORE.OBTAIN( - SPTEST.SEMAPHORE_ID( 3 ), - RTEMS.DEFAULT_MODES, - RTEMS.NO_TIMEOUT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN ON SM3" ); - - TEXT_IO.PUT_LINE( "TA1 - got SM3" ); - - TEXT_IO.PUT_LINE( "TA1 - semaphore_obtain - get SM1 - NO_WAIT" ); - RTEMS.SEMAPHORE.OBTAIN( - SPTEST.SEMAPHORE_ID( 1 ), - RTEMS.NO_WAIT, - RTEMS.NO_TIMEOUT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN ON SM1" ); - - TEXT_IO.PUT_LINE( "TA1 - got SM1" ); - - TEXT_IO.PUT_LINE( "TA1 - task_wake_after - sleep 5 seconds" ); - RTEMS.TASKS.WAKE_AFTER( 5 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - -TEST_SUPPORT.PAUSE; - - TEXT_IO.PUT_LINE( "TA1 - semaphore_release - release SM1" ); - RTEMS.SEMAPHORE.RELEASE( SPTEST.SEMAPHORE_ID( 1 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE ON SM1" ); - - TEXT_IO.PUT_LINE( - "TA1 - semaphore_obtain - waiting for SM1 with 10 second timeout" - ); - RTEMS.SEMAPHORE.OBTAIN( - SPTEST.SEMAPHORE_ID( 1 ), - RTEMS.DEFAULT_MODES, - 10 * TEST_SUPPORT.TICKS_PER_SECOND, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN ON SM3" ); - - TEXT_IO.PUT_LINE( "TA1 - got SM1" ); - - TEXT_IO.PUT_LINE( "TA1 - semaphore_release - release SM2" ); - RTEMS.SEMAPHORE.RELEASE( - SPTEST.SEMAPHORE_ID( 2 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE ON SM2" ); - - TEXT_IO.PUT_LINE( "TA1 - task_wake_after - sleep 5 seconds" ); - RTEMS.TASKS.WAKE_AFTER( 5 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - -TEST_SUPPORT.PAUSE; - - TEXT_IO.PUT_LINE( "TA1 - task_delete - delete TA3" ); - RTEMS.TASKS.DELETE( SPTEST.TASK_ID( 3 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA3" ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 4 ), - 4, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 4 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA4" ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 5 ), - 4, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 5 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA5" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 4 ), - SPTEST.TASK_4'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA4" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 5 ), - SPTEST.TASK_5'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA5" ); - - TEXT_IO.PUT_LINE( "TA1 - task_wake_after - sleep 5 seconds" ); - RTEMS.TASKS.WAKE_AFTER( 5 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - TEXT_IO.PUT_LINE( "TA1 - task_delete - delete TA4" ); - RTEMS.TASKS.DELETE( SPTEST.TASK_ID( 4 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA4" ); - - TEXT_IO.PUT_LINE( "TA1 - semaphore_release - release SM1" ); - RTEMS.SEMAPHORE.RELEASE( - SPTEST.SEMAPHORE_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE ON SM1" ); - - TEXT_IO.PUT_LINE( "TA1 - task_wake_after - sleep 5 seconds" ); - RTEMS.TASKS.WAKE_AFTER( 5 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - TEXT_IO.PUT_LINE( "TA1 - semaphore_delete - delete SM1" ); - RTEMS.SEMAPHORE.DELETE( SPTEST.SEMAPHORE_ID( 1 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_DELETE OF SM1" ); - - TEXT_IO.PUT_LINE( "TA1 - semaphore_delete - delete SM3" ); - RTEMS.SEMAPHORE.DELETE( SPTEST.SEMAPHORE_ID( 3 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_DELETE OF SM3" ); - - TEXT_IO.PUT_LINE( "TA1 - task_delete - delete self" ); - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA1" ); - - end TASK_1; - --- --- TASK_2 --- - - procedure TASK_2 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - PREVIOUS_PRIORITY : RTEMS.TASKS.PRIORITY; - begin - - TEXT_IO.PUT_LINE( "TA2 - semaphore_obtain - wait forever on SM1" ); - RTEMS.SEMAPHORE.OBTAIN( - SPTEST.SEMAPHORE_ID( 1 ), - RTEMS.DEFAULT_MODES, - RTEMS.NO_TIMEOUT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN ON SM1" ); - - TEXT_IO.PUT_LINE( "TA2 - got SM1" ); - - TEXT_IO.PUT_LINE( "TA2 - semaphore_release - release SM1" ); - RTEMS.SEMAPHORE.RELEASE( - SPTEST.SEMAPHORE_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE ON SM1" ); - - TEXT_IO.PUT_LINE( - "TA2 - task_set_priority - make self highest priority task" - ); - RTEMS.TASKS.SET_PRIORITY( - RTEMS.SELF, - 3, - PREVIOUS_PRIORITY, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY ON TA2" ); - - TEXT_IO.PUT_LINE( "TA2 - semaphore_obtain - wait forever on SM2" ); - RTEMS.SEMAPHORE.OBTAIN( - SPTEST.SEMAPHORE_ID( 2 ), - RTEMS.DEFAULT_MODES, - RTEMS.NO_TIMEOUT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN ON SM2" ); - - TEXT_IO.PUT_LINE( "TA2 - got SM2" ); - - TEXT_IO.PUT_LINE( "TA2 - semaphore_release - release SM2" ); - RTEMS.SEMAPHORE.RELEASE( - SPTEST.SEMAPHORE_ID( 2 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE ON SM2" ); - - TEXT_IO.PUT_LINE( "TA2 - task_delete - delete self" ); - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA2" ); - - end TASK_2; - --- --- TASK_3 --- - - procedure TASK_3 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.PUT_LINE( "TA3 - semaphore_obtain - wait forever on SM2" ); - RTEMS.SEMAPHORE.OBTAIN( - SPTEST.SEMAPHORE_ID( 2 ), - RTEMS.DEFAULT_MODES, - RTEMS.NO_TIMEOUT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN ON SM2" ); - TEXT_IO.PUT_LINE( "TA3 - got SM2" ); - - TEXT_IO.PUT_LINE( "TA3 - semaphore_release - release SM2" ); - RTEMS.SEMAPHORE.RELEASE( - SPTEST.SEMAPHORE_ID( 2 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE ON SM2" ); - - TEXT_IO.PUT_LINE( "TA3 - semaphore_obtain - wait forever on SM3" ); - RTEMS.SEMAPHORE.OBTAIN( - SPTEST.SEMAPHORE_ID( 3 ), - RTEMS.DEFAULT_MODES, - RTEMS.NO_TIMEOUT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN ON SM3" ); - - end TASK_3; - --- --- TASK_4 --- - - procedure TASK_4 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.PUT_LINE( "TA4 - semaphore_obtain - wait forever on SM1" ); - RTEMS.SEMAPHORE.OBTAIN( - SPTEST.SEMAPHORE_ID( 1 ), - RTEMS.DEFAULT_MODES, - RTEMS.NO_TIMEOUT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN ON SM1" ); - - end TASK_4; - --- --- TASK_5 --- - - procedure TASK_5 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.PUT_LINE( "TA5 - semaphore_obtain - wait forever on SM1" ); - RTEMS.SEMAPHORE.OBTAIN( - SPTEST.SEMAPHORE_ID( 1 ), - RTEMS.DEFAULT_MODES, - RTEMS.NO_TIMEOUT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN ON SM1" ); - - TEXT_IO.PUT_LINE( "TA5 - got SM1" ); - - TEXT_IO.PUT_LINE( "TA5 - semaphore_obtain - wait forever on SM1" ); - RTEMS.SEMAPHORE.OBTAIN( - SPTEST.SEMAPHORE_ID( 1 ), - RTEMS.DEFAULT_MODES, - RTEMS.NO_TIMEOUT, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.OBJECT_WAS_DELETED, - "SEMAPHORE_OBTAIN ON SM1" - ); - TEXT_IO.PUT_LINE( "TA5 - SM1 deleted by TA1" ); - - TEXT_IO.PUT_LINE( "*** END OF TEST 12 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end TASK_5; - -end SPTEST; diff --git a/c/src/ada-tests/sptests/sp12/sptest.ads b/c/src/ada-tests/sptests/sp12/sptest.ads deleted file mode 100644 index 663faa7686..0000000000 --- a/c/src/ada-tests/sptests/sp12/sptest.ads +++ /dev/null @@ -1,147 +0,0 @@ --- --- SPTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 12 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; - -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 .. 5 ) of RTEMS.ID; - TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 5 ) of RTEMS.NAME; - - PRIORITY_TASK_ID : array ( 1 .. 5 ) of RTEMS.ID; - PRIORITY_TASK_NAME : array ( 1 .. 5 ) of RTEMS.NAME; - TASK_PRIORITY : array ( 1 .. 5 ) of RTEMS.TASKS.PRIORITY; - - SEMAPHORE_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; - SEMAPHORE_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- PRIORITY_TEST_DRIVER --- --- DESCRIPTION: --- --- This subprogram creates and starts RTEMS tasks of different priority --- so that those tasks may exercise the priority blocking algorithm. --- - - procedure PRIORITY_TEST_DRIVER ( - PRIORITY_BASE : in RTEMS.UNSIGNED32 - ); - --- --- PRIORITY_TASK --- --- DESCRIPTION: --- --- Copies of this RTEMS are executed at different priorities and each --- instantiation blocks on a semaphore with priority blocking. This --- is done to exercise the priority blocking algorithms. --- - - procedure PRIORITY_TASK ( - ITS_INDEX : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, PRIORITY_TASK); - --- --- TASK_1 --- --- DESCRIPTION: --- --- This RTEMS task tests the Semaphore Manager. --- - - procedure TASK_1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_1); - --- --- TASK_2 --- --- DESCRIPTION: --- --- This RTEMS task tests the Semaphore Manager. --- - - procedure TASK_2 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_2); - --- --- TASK_3 --- --- DESCRIPTION: --- --- This RTEMS task tests the Semaphore Manager. --- - - procedure TASK_3 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_3); - --- --- TASK_4 --- --- DESCRIPTION: --- --- This RTEMS task tests the Semaphore Manager. --- - - procedure TASK_4 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_4); - --- --- TASK_5 --- --- DESCRIPTION: --- --- This RTEMS task tests the Semaphore Manager. --- - - procedure TASK_5 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_5); - -end SPTEST; diff --git a/c/src/ada-tests/sptests/sp13/Makefile.am b/c/src/ada-tests/sptests/sp13/Makefile.am deleted file mode 100644 index f54587f3a7..0000000000 --- a/c/src/ada-tests/sptests/sp13/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_sp13 -ada_sp13_SOURCES = sp13.adb config.h sptest.adb sptest.ads -ada_sp13_SOURCES += ../../support/init.c - -ada_sp13$(EXEEXT): sp13.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_sp13.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/sptests/sp13/ada_sp13.scn b/c/src/ada-tests/sptests/sp13/ada_sp13.scn deleted file mode 100644 index f54a497a58..0000000000 --- a/c/src/ada-tests/sptests/sp13/ada_sp13.scn +++ /dev/null @@ -1,78 +0,0 @@ -*** TEST 13 *** -TA1 - message_queue_ident - qid => 16#22010001# -TA1 - message_queue_send - BUFFER 1 TO Q 1 -TA1 - message_queue_send - BUFFER 2 TO Q 1 -TA1 - task_wake_after - sleep 5 seconds -TA2 - message_queue_receive - receive from queue 1 - NO_WAIT -TA2 - buffer received: BUFFER 1 TO Q 1 -TA2 - message_queue_receive - receive from queue 1 - WAIT FOREVER -TA2 - buffer received: BUFFER 2 TO Q 1 -TA2 - message_queue_receive - receive from queue 1 - WAIT FOREVER -TA3 - message_queue_receive - receive from queue 2 - WAIT FOREVER -TA1 - message_queue_send - BUFFER 3 TO Q 1 -TA1 - task_wake_after - sleep 5 seconds -TA2 - buffer received: BUFFER 3 TO Q 1 -TA2 - task_set_priority - make self highest priority task -TA2 - message_queue_receive - receive from queue 2 - WAIT FOREVER - -TA1 - message_queue_send - BUFFER 1 TO Q 2 -TA2 - buffer received: BUFFER 1 TO Q 2 -TA2 - message_queue_send - BUFFER 2 TO Q 2 -TA2 - message_queue_receive - receive from queue 1 - 10 second timeout -TA1 - message_queue_receive - receive from queue 1 - 10 second timeout -TA3 - buffer received: BUFFER 2 TO Q 2 -TA3 - message_queue_broadcast - BUFFER 3 TO Q 1 -TA2 - buffer received: BUFFER 3 TO Q 1 -TA2 - message_queue_receive - receive from queue 3 - WAIT FOREVER -TA3 - number of tasks awakened = 2 -TA3 - message_queue_receive - receive from queue 3 - WAIT FOREVER -TA1 - buffer received: BUFFER 3 TO Q 1 -TA1 - task_delete - delete TA2 -TA1 - message_queue_send - BUFFER 1 TO Q 3 -TA1 - task_wake_after - sleep 5 seconds -TA3 - buffer received: BUFFER 1 TO Q 3 -TA3 - task_delete - delete self - -TA1 - message_queue_send - BUFFER 2 TO Q 3 -TA1 - message_queue_send - BUFFER 3 TO Q 3 -TA1 - message_queue_send - BUFFER 4 TO Q 3 -TA1 - message_queue_urgent - BUFFER 5 TO Q 3 -TA1 - message_queue_receive - receive from queue 3 - WAIT FOREVER -TA1 - buffer received: BUFFER 5 TO Q 3 -TA1 - message_queue_receive - receive from queue 3 - WAIT FOREVER -TA1 - buffer received: BUFFER 2 TO Q 3 -TA1 - message_queue_receive - receive from queue 3 - WAIT FOREVER -TA1 - buffer received: BUFFER 3 TO Q 3 -TA1 - message_queue_receive - receive from queue 3 - WAIT FOREVER -TA1 - buffer received: BUFFER 4 TO Q 3 -TA1 - message_queue_urgent - BUFFER 3 TO Q 2 -TA1 - message_queue_receive - receive from queue 2 - WAIT FOREVER -TA1 - buffer received: BUFFER 3 TO Q 2 - -TA1 - message_queue_delete - delete queue 1 -TA1 - message_queue_urgent - BUFFER 3 TO Q 2 -TA1 - message_queue_delete - delete queue 2 -TA1 - message_queue_get_number_pending - check Q 3 -TA1 - 0 messages are pending on Q 3 -TA1 - message_queue_flush - empty Q 3 -TA1 - 0 messages were flushed from Q 3 -TA1 - message_queue_send - BUFFER 1 TO Q 3 -TA1 - message_queue_send - BUFFER 2 TO Q 3 -TA1 - message_queue_broadcast - NO BUFFER TO Q1 -TA1 - number of tasks awakened = 0 -TA1 - message_queue_get_number_pending - check Q 3 -TA1 - 2 messages are pending on Q 3 -TA1 - message_queue_send - BUFFER 3 TO Q 3 -TA1 - message_queue_flush - Q 3 -TA1 - 3 messages were flushed from Q 3 -TA1 - message_queue_send - until all message buffers consumed -TA1 - message_queue_send - all message buffers consumed -TA1 - message_queue_flush - Q 3 -TA1 - 100 messages were flushed from Q 3 - -TA1 - create message queue of 20 bytes on queue 1 -TA1 - message_queue_delete - delete queue 1 - -TA1 - message_queue_create - variable sizes -TA1 - message_queue_create and send - variable sizes -*** END OF TEST 13 *** diff --git a/c/src/ada-tests/sptests/sp13/config.h b/c/src/ada-tests/sptests/sp13/config.h deleted file mode 100644 index 8e7821e061..0000000000 --- a/c/src/ada-tests/sptests/sp13/config.h +++ /dev/null @@ -1,32 +0,0 @@ -/* 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 4 -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 10 -#define CONFIGURE_TICKS_PER_TIMESLICE 100 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/sptests/sp13/sp13.adb b/c/src/ada-tests/sptests/sp13/sp13.adb deleted file mode 100644 index 503e8fb989..0000000000 --- a/c/src/ada-tests/sptests/sp13/sp13.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test SP13 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 SP13 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 SP13; - diff --git a/c/src/ada-tests/sptests/sp13/sptest.adb b/c/src/ada-tests/sptests/sp13/sptest.adb deleted file mode 100644 index 7b61b9e7ba..0000000000 --- a/c/src/ada-tests/sptests/sp13/sptest.adb +++ /dev/null @@ -1,891 +0,0 @@ --- --- SPTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 13 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 INTERFACES; use INTERFACES; -with RTEMS; -with RTEMS.MESSAGE_QUEUE; -with TEST_SUPPORT; -with TEXT_IO; -with UNSIGNED32_IO; -use type RTEMS.STATUS_CODES; - -package body SPTEST is - - type BIG_BUFFER_TYPE is array (1 .. 2048) of RTEMS.UNSIGNED8; - - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TEST 13 ***" ); - - SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); - SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' ); - SPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 1 ), - 4, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 2 ), - 4, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 2 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 3 ), - 4, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 3 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA3" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 1 ), - SPTEST.TASK_1'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 2 ), - SPTEST.TASK_2'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 3 ), - SPTEST.TASK_3'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA3" ); - - SPTEST.QUEUE_NAME( 1 ) := RTEMS.BUILD_NAME( 'Q', '1', ' ', ' ' ); - SPTEST.QUEUE_NAME( 2 ) := RTEMS.BUILD_NAME( 'Q', '2', ' ', ' ' ); - SPTEST.QUEUE_NAME( 3 ) := RTEMS.BUILD_NAME( 'Q', '3', ' ', ' ' ); - - RTEMS.MESSAGE_QUEUE.CREATE( - SPTEST.QUEUE_NAME( 1 ), - 100, - 16, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.QUEUE_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "QUEUE_CREATE OF Q1" ); - - RTEMS.MESSAGE_QUEUE.CREATE( - SPTEST.QUEUE_NAME( 2 ), - 10, - 16, - RTEMS.PRIORITY, - SPTEST.QUEUE_ID( 2 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "QUEUE_CREATE OF Q2" ); - - RTEMS.MESSAGE_QUEUE.CREATE( - SPTEST.QUEUE_NAME( 3 ), - 100, - 16, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.QUEUE_ID( 3 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "QUEUE_CREATE OF Q3" ); - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- FILL_BUFFER --- - --- --- Depends on tricks to make the copy work. --- - - procedure FILL_BUFFER ( - SOURCE : in STRING; - BUFFER : out SPTEST.BUFFER - ) is - begin - - BUFFER.FIELD1 := RTEMS.BUILD_NAME( - SOURCE( SOURCE'FIRST ), - SOURCE( SOURCE'FIRST + 1 ), - SOURCE( SOURCE'FIRST + 2 ), - SOURCE( SOURCE'FIRST + 3 ) - ); - - BUFFER.FIELD2 := RTEMS.BUILD_NAME( - SOURCE( SOURCE'FIRST + 4 ), - SOURCE( SOURCE'FIRST + 5 ), - SOURCE( SOURCE'FIRST + 6 ), - SOURCE( SOURCE'FIRST + 7 ) - ); - - BUFFER.FIELD3 := RTEMS.BUILD_NAME( - SOURCE( SOURCE'FIRST + 8 ), - SOURCE( SOURCE'FIRST + 9 ), - SOURCE( SOURCE'FIRST + 10 ), - SOURCE( SOURCE'FIRST + 11 ) - ); - - BUFFER.FIELD4 := RTEMS.BUILD_NAME( - SOURCE( SOURCE'FIRST + 12 ), - SOURCE( SOURCE'FIRST + 13 ), - SOURCE( SOURCE'FIRST + 14 ), - SOURCE( SOURCE'FIRST + 15 ) - ); - - end FILL_BUFFER; - --- --- PUT_BUFFER --- - --- --- Depends on tricks to make the output work. --- - - procedure PUT_BUFFER ( - BUFFER : in SPTEST.BUFFER - ) is - begin - - TEST_SUPPORT.PUT_NAME( BUFFER.FIELD1, FALSE ); - TEST_SUPPORT.PUT_NAME( BUFFER.FIELD2, FALSE ); - TEST_SUPPORT.PUT_NAME( BUFFER.FIELD3, FALSE ); - TEST_SUPPORT.PUT_NAME( BUFFER.FIELD4, FALSE ); - - end PUT_BUFFER; - --- --- TASK_1 --- - - procedure TASK_1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - QID : RTEMS.ID; - BIG_SEND_BUFFER : BIG_BUFFER_TYPE; - BIG_SEND_BUFFER_POINTER : constant RTEMS.ADDRESS - := BIG_SEND_BUFFER'ADDRESS; - BIG_RECEIVE_BUFFER : BIG_BUFFER_TYPE; - BIG_RECEIVE_BUFFER_POINTER : constant RTEMS.ADDRESS - := BIG_RECEIVE_BUFFER'ADDRESS; - BUFFER : SPTEST.BUFFER; - BUFFER_POINTER : constant RTEMS.ADDRESS := BUFFER'ADDRESS; - COUNT : RTEMS.UNSIGNED32; - MESSAGE_SIZE : RTEMS.UNSIGNED32 := 0; - STATUS : RTEMS.STATUS_CODES; - SIZE : RTEMS.UNSIGNED32 := 0; - begin - - RTEMS.MESSAGE_QUEUE.IDENT( - SPTEST.QUEUE_NAME( 1 ), - RTEMS.SEARCH_ALL_NODES, - QID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_IDENT" ); - TEXT_IO.PUT( "TA1 - message_queue_ident - qid => " ); - UNSIGNED32_IO.PUT( QID, WIDTH => 8, BASE => 16 ); - TEXT_IO.NEW_LINE; - - SPTEST.FILL_BUFFER( "BUFFER 1 TO Q 1 ", BUFFER ); - TEXT_IO.PUT_LINE( "TA1 - message_queue_send - BUFFER 1 TO Q 1" ); - RTEMS.MESSAGE_QUEUE.SEND( - SPTEST.QUEUE_ID( 1 ), - BUFFER_POINTER, - 16, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); - - SPTEST.FILL_BUFFER( "BUFFER 2 TO Q 1 ", BUFFER ); - TEXT_IO.PUT_LINE( "TA1 - message_queue_send - BUFFER 2 TO Q 1" ); - RTEMS.MESSAGE_QUEUE.SEND( - SPTEST.QUEUE_ID( 1 ), - BUFFER_POINTER, - 16, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); - - TEXT_IO.PUT_LINE( "TA1 - task_wake_after - sleep 5 seconds" ); - RTEMS.TASKS.WAKE_AFTER( 5 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - SPTEST.FILL_BUFFER( "BUFFER 3 TO Q 1 ", BUFFER ); - TEXT_IO.PUT_LINE( "TA1 - message_queue_send - BUFFER 3 TO Q 1" ); - RTEMS.MESSAGE_QUEUE.SEND( - SPTEST.QUEUE_ID( 1 ), - BUFFER_POINTER, - 16, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); - - TEXT_IO.PUT_LINE( "TA1 - task_wake_after - sleep 5 seconds" ); - RTEMS.TASKS.WAKE_AFTER( 5 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - -TEST_SUPPORT.PAUSE; - - SPTEST.FILL_BUFFER( "BUFFER 1 TO Q 2 ", BUFFER ); - TEXT_IO.PUT_LINE( "TA1 - message_queue_send - BUFFER 1 TO Q 2" ); - RTEMS.MESSAGE_QUEUE.SEND( - SPTEST.QUEUE_ID( 2 ), - BUFFER_POINTER, - 16, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); - - TEXT_IO.PUT( - "TA1 - message_queue_receive - receive from queue 1 - " - ); - TEXT_IO.PUT_LINE( "10 second timeout" ); - RTEMS.MESSAGE_QUEUE.RECEIVE( - SPTEST.QUEUE_ID( 1 ), - BUFFER_POINTER, - RTEMS.DEFAULT_OPTIONS, - 10 * TEST_SUPPORT.TICKS_PER_SECOND, - MESSAGE_SIZE, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" ); - TEXT_IO.PUT( "TA1 - buffer received: " ); - SPTEST.PUT_BUFFER( BUFFER ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT_LINE( "TA1 - task_delete - delete TA2" ); - RTEMS.TASKS.DELETE( SPTEST.TASK_ID( 2 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE" ); - - SPTEST.FILL_BUFFER( "BUFFER 1 TO Q 3 ", BUFFER ); - TEXT_IO.PUT_LINE( "TA1 - message_queue_send - BUFFER 1 TO Q 3" ); - RTEMS.MESSAGE_QUEUE.SEND( - SPTEST.QUEUE_ID( 3 ), - BUFFER_POINTER, - 16, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); - - TEXT_IO.PUT_LINE( "TA1 - task_wake_after - sleep 5 seconds" ); - RTEMS.TASKS.WAKE_AFTER( 5 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - -TEST_SUPPORT.PAUSE; - - SPTEST.FILL_BUFFER( "BUFFER 2 TO Q 3 ", BUFFER ); - TEXT_IO.PUT_LINE( "TA1 - message_queue_send - BUFFER 2 TO Q 3" ); - RTEMS.MESSAGE_QUEUE.SEND( - SPTEST.QUEUE_ID( 3 ), - BUFFER_POINTER, - 16, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); - - SPTEST.FILL_BUFFER( "BUFFER 3 TO Q 3 ", BUFFER ); - TEXT_IO.PUT_LINE( "TA1 - message_queue_send - BUFFER 3 TO Q 3" ); - RTEMS.MESSAGE_QUEUE.SEND( - SPTEST.QUEUE_ID( 3 ), - BUFFER_POINTER, - 16, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); - - SPTEST.FILL_BUFFER( "BUFFER 4 TO Q 3 ", BUFFER ); - TEXT_IO.PUT_LINE( "TA1 - message_queue_send - BUFFER 4 TO Q 3" ); - RTEMS.MESSAGE_QUEUE.SEND( - SPTEST.QUEUE_ID( 3 ), - BUFFER_POINTER, - 16, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); - - SPTEST.FILL_BUFFER( "BUFFER 5 TO Q 3 ", BUFFER ); - TEXT_IO.PUT_LINE( "TA1 - message_queue_urgent - BUFFER 5 TO Q 3" ); - RTEMS.MESSAGE_QUEUE.URGENT( - SPTEST.QUEUE_ID( 3 ), - BUFFER_POINTER, - 16, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_URGENT" ); - - for TIMES in 1 .. 4 - loop - TEXT_IO.PUT( - "TA1 - message_queue_receive - receive from queue 3 - " - ); - TEXT_IO.PUT_LINE( "WAIT FOREVER" ); - RTEMS.MESSAGE_QUEUE.RECEIVE( - SPTEST.QUEUE_ID( 3 ), - BUFFER_POINTER, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - MESSAGE_SIZE, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" ); - TEXT_IO.PUT( "TA1 - buffer received: " ); - SPTEST.PUT_BUFFER( BUFFER ); - TEXT_IO.NEW_LINE; - end loop; - - SPTEST.FILL_BUFFER( "BUFFER 3 TO Q 2 ", BUFFER ); - TEXT_IO.PUT_LINE( "TA1 - message_queue_urgent - BUFFER 3 TO Q 2" ); - RTEMS.MESSAGE_QUEUE.URGENT( - SPTEST.QUEUE_ID( 2 ), - BUFFER_POINTER, - 16, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_URGENT" ); - - TEXT_IO.PUT( - "TA1 - message_queue_receive - receive from queue 2 - " - ); - TEXT_IO.PUT_LINE( "WAIT FOREVER" ); - RTEMS.MESSAGE_QUEUE.RECEIVE( - SPTEST.QUEUE_ID( 2 ), - BUFFER_POINTER, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - MESSAGE_SIZE, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" ); - TEXT_IO.PUT( "TA1 - buffer received: " ); - SPTEST.PUT_BUFFER( BUFFER ); - TEXT_IO.NEW_LINE; - -TEST_SUPPORT.PAUSE; - - TEXT_IO.PUT_LINE( "TA1 - message_queue_delete - delete queue 1" ); - RTEMS.MESSAGE_QUEUE.DELETE( SPTEST.QUEUE_ID( 1 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_DELETE" ); - - SPTEST.FILL_BUFFER( "BUFFER 3 TO Q 2 ", BUFFER ); - TEXT_IO.PUT_LINE( "TA1 - message_queue_urgent - BUFFER 3 TO Q 2" ); - RTEMS.MESSAGE_QUEUE.URGENT( - SPTEST.QUEUE_ID( 2 ), - BUFFER_POINTER, - 16, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_URGENT" ); - - TEXT_IO.PUT_LINE( "TA1 - message_queue_delete - delete queue 2" ); - RTEMS.MESSAGE_QUEUE.DELETE( SPTEST.QUEUE_ID( 2 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_DELETE" ); - - TEXT_IO.PUT_LINE( "TA1 - message_queue_get_number_pending - check Q 3" ); - RTEMS.MESSAGE_QUEUE.GET_NUMBER_PENDING( - SPTEST.QUEUE_ID( 3 ), COUNT, STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( - STATUS, "MESSAGE_QUEUE_GET_NUMBER_PENDING" - ); - TEXT_IO.PUT( "TA1 - " ); - UNSIGNED32_IO.PUT( COUNT, WIDTH => 3, BASE => 10 ); - TEXT_IO.PUT_LINE( " messages are pending on Q 3" ); - - TEXT_IO.PUT_LINE( "TA1 - message_queue_flush - empty Q 3" ); - RTEMS.MESSAGE_QUEUE.FLUSH( SPTEST.QUEUE_ID( 3 ), COUNT, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_FLUSH" ); - TEXT_IO.PUT( "TA1 - " ); - UNSIGNED32_IO.PUT( COUNT, WIDTH => 3, BASE => 10 ); - TEXT_IO.PUT_LINE( " messages were flushed from Q 3" ); - - SPTEST.FILL_BUFFER( "BUFFER 1 TO Q 3 ", BUFFER ); - TEXT_IO.PUT_LINE( "TA1 - message_queue_send - BUFFER 1 TO Q 3" ); - RTEMS.MESSAGE_QUEUE.SEND( - SPTEST.QUEUE_ID( 3 ), - BUFFER_POINTER, - 16, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); - - SPTEST.FILL_BUFFER( "BUFFER 2 TO Q 3 ", BUFFER ); - TEXT_IO.PUT_LINE( "TA1 - message_queue_send - BUFFER 2 TO Q 3" ); - RTEMS.MESSAGE_QUEUE.SEND( - SPTEST.QUEUE_ID( 3 ), - BUFFER_POINTER, - 16, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); - - -- this broadcast should have no effect on the queue - SPTEST.FIlL_BUFFER( "NO BUFFER TO Q1 ", BUFFER ); - TEXT_IO.PUT_LINE( "TA1 - message_queue_broadcast - NO BUFFER TO Q1" ); - RTEMS.MESSAGE_QUEUE.BROADCAST( - SPTEST.QUEUE_ID( 1 ), - BUFFER_POINTER, - 16, - COUNT, - STATUS - ); - TEXT_IO.PUT( "TA1 - number of tasks awakened = " ); - UNSIGNED32_IO.PUT( COUNT, WIDTH => 3, BASE => 10 ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT_LINE( "TA1 - message_queue_get_number_pending - check Q 3" ); - RTEMS.MESSAGE_QUEUE.GET_NUMBER_PENDING( - SPTEST.QUEUE_ID( 3 ), COUNT, STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( - STATUS, "MESSAGE_QUEUE_GET_NUMBER_PENDING" - ); - TEXT_IO.PUT( "TA1 - " ); - UNSIGNED32_IO.PUT( COUNT, WIDTH => 3, BASE => 10 ); - TEXT_IO.PUT_LINE( " messages are pending on Q 3" ); - - SPTEST.FILL_BUFFER( "BUFFER 3 TO Q 3 ", BUFFER ); - TEXT_IO.PUT_LINE( "TA1 - message_queue_send - BUFFER 3 TO Q 3" ); - RTEMS.MESSAGE_QUEUE.SEND( - SPTEST.QUEUE_ID( 3 ), - BUFFER_POINTER, - 16, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); - - TEXT_IO.PUT_LINE( "TA1 - message_queue_flush - Q 3" ); - RTEMS.MESSAGE_QUEUE.FLUSH( SPTEST.QUEUE_ID( 3 ), COUNT, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_FLUSH" ); - TEXT_IO.PUT( "TA1 - " ); - UNSIGNED32_IO.PUT( COUNT, WIDTH => 3, BASE => 10 ); - TEXT_IO.PUT_LINE( " messages were flushed from Q 3" ); - - TEXT_IO.PUT_LINE( - "TA1 - message_queue_send - until all message buffers consumed" - ); - loop - - RTEMS.MESSAGE_QUEUE.SEND( - SPTEST.QUEUE_ID( 3 ), - BUFFER_POINTER, - 16, - STATUS - ); - - exit when RTEMS.ARE_STATUSES_EQUAL( STATUS, RTEMS.TOO_MANY ); - - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); - - end loop; - - TEXT_IO.PUT_LINE( - "TA1 - message_queue_send - all message buffers consumed" - ); - - TEXT_IO.PUT_LINE( "TA1 - message_queue_flush - Q 3" ); - RTEMS.MESSAGE_QUEUE.FLUSH( SPTEST.QUEUE_ID( 3 ), COUNT, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_FLUSH" ); - TEXT_IO.PUT( "TA1 - " ); - UNSIGNED32_IO.PUT( COUNT, WIDTH => 3, BASE => 10 ); - TEXT_IO.PUT_LINE( " messages were flushed from Q 3" ); - -TEST_SUPPORT.PAUSE; - - TEXT_IO.PUT_LINE( "TA1 - create message queue of 20 bytes on queue 1" ); - RTEMS.MESSAGE_QUEUE.CREATE( - SPTEST.QUEUE_NAME( 1 ), - 100, - 20, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.QUEUE_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( - STATUS, "MESSAGE_QUEUE_CREATE of Q1; 20 bytes each" - ); - RTEMS.MESSAGE_QUEUE.SEND( - SPTEST.QUEUE_ID( 1 ), BIG_SEND_BUFFER_POINTER, 40, STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, RTEMS.INVALID_SIZE, "expected INVALID_SIZE" - ); - - TEXT_IO.PUT_LINE( "TA1 - message_queue_delete - delete queue 1" ); - RTEMS.MESSAGE_QUEUE.DELETE( SPTEST.QUEUE_ID( 1 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_DELETE" ); - -TEST_SUPPORT.PAUSE; - - TEXT_IO.PUT_LINE( "TA1 - message_queue_create - variable sizes " ); - for QUEUE_SIZE in 1 .. 1029 loop - RTEMS.MESSAGE_QUEUE.CREATE( - SPTEST.QUEUE_NAME( 1 ), - 2, -- just 2 msgs each - RTEMS.UNSIGNED32( QUEUE_SIZE ), - RTEMS.DEFAULT_ATTRIBUTES, - QUEUE_ID( 1 ), - STATUS - ); - if STATUS /= RTEMS.SUCCESSFUL then - TEXT_IO.PUT( "TA1 - msq que size: " ); - UNSIGNED32_IO.PUT( - RTEMS.UNSIGNED32( QUEUE_SIZE ), WIDTH => 3, BASE => 10 - ); - TEXT_IO.NEW_LINE; - TEST_SUPPORT.DIRECTIVE_FAILED( - STATUS, "message_queue_create of Q1" - ); - end if; - - RTEMS.MESSAGE_QUEUE.DELETE( SPTEST.QUEUE_ID( 1 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "message_queue_delete" ); - end loop; - - TEXT_IO.PUT_LINE( - "TA1 - message_queue_create and send - variable sizes " - ); - for QUEUE_SIZE in 1 .. 1029 loop - - RTEMS.MESSAGE_QUEUE.CREATE( - SPTEST.QUEUE_NAME( 1 ), - 2, -- just 2 msgs each - RTEMS.UNSIGNED32( QUEUE_SIZE ), - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.QUEUE_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED(status, "message_queue_create of Q1"); - - BIG_SEND_BUFFER := (others => CHARACTER'POS( 'A' )); - BIG_RECEIVE_BUFFER := (others => CHARACTER'POS( 'Z' )); - - -- send a msg too big - RTEMS.MESSAGE_QUEUE.SEND( - SPTEST.QUEUE_ID( 1 ), - BIG_SEND_BUFFER_POINTER, - RTEMS.UNSIGNED32( QUEUE_SIZE + 1 ), - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, RTEMS.INVALID_SIZE, "message_queue_send too large" - ); - - -- send a msg that is just right - RTEMS.MESSAGE_QUEUE.SEND( - SPTEST.QUEUE_ID( 1 ), - BIG_SEND_BUFFER_POINTER, - RTEMS.UNSIGNED32( QUEUE_SIZE ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( - STATUS, "message_queue_send exact size" - ); - - -- now read and verify the message just sent - SIZE := INTERFACES.UNSIGNED_32(QUEUE_SIZE); - RTEMS.MESSAGE_QUEUE.RECEIVE( - SPTEST.QUEUE_ID( 1 ), - BIG_RECEIVE_BUFFER_POINTER, - RTEMS.DEFAULT_OPTIONS, - 1 * TEST_SUPPORT.TICKS_PER_SECOND, - SIZE, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( - STATUS, "message_queue_receive exact size" - ); - if SIZE /= RTEMS.UNSIGNED32( QUEUE_SIZE ) then - TEXT_IO.PUT( - "TA1 - exact size size match failed for queue_size = " - ); - UNSIGNED32_IO.PUT( - RTEMS.UNSIGNED32( QUEUE_SIZE ), WIDTH => 3, BASE => 10 - ); - TEXT_IO.NEW_LINE; - end if; - - if (BIG_SEND_BUFFER( BIG_SEND_BUFFER'FIRST .. Integer( SIZE )) /= - BIG_RECEIVE_BUFFER( BIG_RECEIVE_BUFFER'FIRST .. Integer( SIZE ))) - then - TEXT_IO.PUT_LINE("TA1 - exact size data match failed"); - end if; - - for I in Integer( SIZE + 1 ) .. BIG_RECEIVE_BUFFER'LAST loop - if BIG_RECEIVE_BUFFER( I ) /= CHARACTER'POS( 'Z' ) then - TEXT_IO.PUT_LINE("TA1 - exact size overrun match failed"); - end if; - end loop; - - -- all done with this one; delete it - RTEMS.MESSAGE_QUEUE.DELETE( SPTEST.QUEUE_ID( 1 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "message_queue_delete" ); - end loop; - - TEXT_IO.PUT_LINE( "*** END OF TEST 13 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end TASK_1; - --- --- TASK_2 --- - - procedure TASK_2 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - BUFFER : SPTEST.BUFFER; - BUFFER_POINTER : RTEMS.ADDRESS; - PREVIOUS_PRIORITY : RTEMS.TASKS.PRIORITY; - MESSAGE_SIZE : RTEMS.UNSIGNED32 := 0; - STATUS : RTEMS.STATUS_CODES; - begin - - BUFFER_POINTER := BUFFER'ADDRESS; - - TEXT_IO.PUT_LINE( - "TA2 - message_queue_receive - receive from queue 1 - NO_WAIT" - ); - RTEMS.MESSAGE_QUEUE.RECEIVE( - SPTEST.QUEUE_ID( 1 ), - BUFFER_POINTER, - RTEMS.NO_WAIT, - RTEMS.NO_TIMEOUT, - MESSAGE_SIZE, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" ); - TEXT_IO.PUT( "TA2 - buffer received: " ); - SPTEST.PUT_BUFFER( BUFFER ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT_LINE( - "TA2 - message_queue_receive - receive from queue 1 - WAIT FOREVER" - ); - RTEMS.MESSAGE_QUEUE.RECEIVE( - SPTEST.QUEUE_ID( 1 ), - BUFFER_POINTER, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - MESSAGE_SIZE, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" ); - TEXT_IO.PUT( "TA2 - buffer received: " ); - SPTEST.PUT_BUFFER( BUFFER ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT_LINE( - "TA2 - message_queue_receive - receive from queue 1 - WAIT FOREVER" - ); - RTEMS.MESSAGE_QUEUE.RECEIVE( - SPTEST.QUEUE_ID( 1 ), - BUFFER_POINTER, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - MESSAGE_SIZE, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" ); - TEXT_IO.PUT( "TA2 - buffer received: " ); - SPTEST.PUT_BUFFER( BUFFER ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT_LINE( - "TA2 - task_set_priority - make self highest priority task" - ); - RTEMS.TASKS.SET_PRIORITY( - RTEMS.SELF, - 3, - PREVIOUS_PRIORITY, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" ); - - TEXT_IO.PUT_LINE( - "TA2 - message_queue_receive - receive from queue 2 - WAIT FOREVER" - ); - RTEMS.MESSAGE_QUEUE.RECEIVE( - SPTEST.QUEUE_ID( 2 ), - BUFFER_POINTER, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - MESSAGE_SIZE, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" ); - TEXT_IO.PUT( "TA2 - buffer received: " ); - SPTEST.PUT_BUFFER( BUFFER ); - TEXT_IO.NEW_LINE; - - SPTEST.FILL_BUFFER( "BUFFER 2 TO Q 2 ", BUFFER ); - TEXT_IO.PUT_LINE( "TA2 - message_queue_send - BUFFER 2 TO Q 2" ); - RTEMS.MESSAGE_QUEUE.SEND( - SPTEST.QUEUE_ID( 2 ), - BUFFER_POINTER, - 16, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); - - TEXT_IO.PUT_LINE( - "TA2 - message_queue_receive - receive from queue 1 - 10 second timeout" - ); - RTEMS.MESSAGE_QUEUE.RECEIVE( - SPTEST.QUEUE_ID( 1 ), - BUFFER_POINTER, - RTEMS.DEFAULT_OPTIONS, - 10 * TEST_SUPPORT.TICKS_PER_SECOND, - MESSAGE_SIZE, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" ); - TEXT_IO.PUT( "TA2 - buffer received: " ); - SPTEST.PUT_BUFFER( BUFFER ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT_LINE( - "TA2 - message_queue_receive - receive from queue 3 - WAIT FOREVER" - ); - RTEMS.MESSAGE_QUEUE.RECEIVE( - SPTEST.QUEUE_ID( 3 ), - BUFFER_POINTER, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - MESSAGE_SIZE, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" ); - TEXT_IO.PUT( "TA2 - buffer received: " ); - SPTEST.PUT_BUFFER( BUFFER ); - TEXT_IO.NEW_LINE; - - end TASK_2; - --- --- TASK_3 --- - - procedure TASK_3 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - BUFFER : SPTEST.BUFFER; - BUFFER_POINTER : RTEMS.ADDRESS; - COUNT : RTEMS.UNSIGNED32; - MESSAGE_SIZE : RTEMS.UNSIGNED32 := 0; - STATUS : RTEMS.STATUS_CODES; - begin - - BUFFER_POINTER := BUFFER'ADDRESS; - - TEXT_IO.PUT_LINE( - "TA3 - message_queue_receive - receive from queue 2 - WAIT FOREVER" - ); - RTEMS.MESSAGE_QUEUE.RECEIVE( - SPTEST.QUEUE_ID( 2 ), - BUFFER_POINTER, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - MESSAGE_SIZE, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" ); - TEXT_IO.PUT( "TA3 - buffer received: " ); - SPTEST.PUT_BUFFER( BUFFER ); - TEXT_IO.NEW_LINE; - - SPTEST.FILL_BUFFER( "BUFFER 3 TO Q 1 ", BUFFER ); - TEXT_IO.PUT_LINE( "TA3 - message_queue_broadcast - BUFFER 3 TO Q 1" ); - RTEMS.MESSAGE_QUEUE.BROADCAST( - SPTEST.QUEUE_ID( 1 ), - BUFFER_POINTER, - 16, - COUNT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_BROADCAST" ); - TEXT_IO.PUT( "TA3 - number of tasks awakened = " ); - UNSIGNED32_IO.PUT( COUNT, WIDTH => 3, BASE => 10 ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT_LINE( - "TA3 - message_queue_receive - receive from queue 3 - WAIT FOREVER" - ); - RTEMS.MESSAGE_QUEUE.RECEIVE( - SPTEST.QUEUE_ID( 3 ), - BUFFER_POINTER, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - MESSAGE_SIZE, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" ); - TEXT_IO.PUT( "TA3 - buffer received: " ); - SPTEST.PUT_BUFFER( BUFFER ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT_LINE( "TA3 - task_delete - delete self" ); - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end TASK_3; - -end SPTEST; diff --git a/c/src/ada-tests/sptests/sp13/sptest.ads b/c/src/ada-tests/sptests/sp13/sptest.ads deleted file mode 100644 index 9b92b3ba61..0000000000 --- a/c/src/ada-tests/sptests/sp13/sptest.ads +++ /dev/null @@ -1,134 +0,0 @@ --- --- SPTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 13 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; - -package SPTEST is - --- --- Buffer Record similar to that used by RTEMS 3.2.1. Using this --- avoids changes to the test. --- - - type BUFFER is - record - FIELD1 : RTEMS.NAME; -- TEMPORARY UNTIL VARIABLE LENGTH - FIELD2 : RTEMS.NAME; - FIELD3 : RTEMS.NAME; - FIELD4 : RTEMS.NAME; - end record; - --- --- These arrays contain the IDs and NAMEs of all RTEMS tasks created --- by this test. --- - - TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; - TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; - --- --- These arrays contain the IDs and NAMEs of all RTEMS message --- queues created by this test. --- - - QUEUE_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; - QUEUE_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- FILL_BUFFER --- --- DESCRIPTION: --- --- This subprogram takes the SOURCE input string and places --- up to the first sixteen characters of that string into --- the message BUFFER. --- - - procedure FILL_BUFFER ( - SOURCE : in STRING; - BUFFER : out SPTEST.BUFFER - ); - --- --- PUT_BUFFER --- --- DESCRIPTION: --- --- This subprogram prints the specified message BUFFER. --- - - procedure PUT_BUFFER ( - BUFFER : in SPTEST.BUFFER - ); - --- --- TASK_1 --- --- DESCRIPTION: --- --- This RTEMS task tests the Message Queue Manager. --- - - procedure TASK_1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_1); - --- --- TASK_2 --- --- DESCRIPTION: --- --- This RTEMS task tests the Message Queue Manager. --- - - procedure TASK_2 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_2); - --- --- TASK_3 --- --- DESCRIPTION: --- --- This RTEMS task tests the Message Queue Manager. --- - - procedure TASK_3 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_3); - -end SPTEST; diff --git a/c/src/ada-tests/sptests/sp14/Makefile.am b/c/src/ada-tests/sptests/sp14/Makefile.am deleted file mode 100644 index dbe01f5915..0000000000 --- a/c/src/ada-tests/sptests/sp14/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_sp14 -ada_sp14_SOURCES = sp14.adb config.h sptest.adb sptest.ads -ada_sp14_SOURCES += ../../support/init.c - -ada_sp14$(EXEEXT): sp14.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_sp14.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/sptests/sp14/ada_sp14.scn b/c/src/ada-tests/sptests/sp14/ada_sp14.scn deleted file mode 100644 index 09b33721ef..0000000000 --- a/c/src/ada-tests/sptests/sp14/ada_sp14.scn +++ /dev/null @@ -1,33 +0,0 @@ -*** TEST 14 *** -TA1 - signal_catch - INTERRUPT_LEVEL( 3 ) -TA1 - signal_send - SIGNAL_16 to self -ASR - ENTRY - signal => 16#10000# -ASR - EXIT - signal => 16#10000# -TA1 - signal_send - SIGNAL_0 to self -ASR - ENTRY - signal => 16#1# -ASR - task_wake_after - yield processor -TA2 - signal_send - SIGNAL_17 to TA1 -TA2 - task_wake_after - yield processor -ASR - ENTRY - signal => 16#20000# -ASR - EXIT - signal => 16#20000# -ASR - EXIT - signal => 16#1# -TA1 - signal_catch - NO_ASR - -TA1 - signal_send - SIGNAL_1 to self -ASR - ENTRY - signal => 16#2# -ASR - task_wake_after - yield processor -TA2 - signal_send - SIGNAL_18 and SIGNAL_19 to TA1 -TA2 - task_wake_after - yield processor -ASR - EXIT - signal => 16#2# -ASR - ENTRY - signal => 16#C0000# -ASR - EXIT - signal => 16#C0000# -TA1 - task_mode - disable ASRs -TA1 - sending signal to SELF from timer -TA1 - waiting for signal to arrive -TA1 - timer routine got the correct arguments -TA1 - task_mode - enable ASRs -ASR - ENTRY - signal => 16#8# -ASR - EXIT - signal => 16#8# -TA1 - signal_catch - ASR ADDRESS of NULL -TA1 - task_delete - delete self -*** END OF TEST 14 *** diff --git a/c/src/ada-tests/sptests/sp14/config.h b/c/src/ada-tests/sptests/sp14/config.h deleted file mode 100644 index 2c046d6db3..0000000000 --- a/c/src/ada-tests/sptests/sp14/config.h +++ /dev/null @@ -1,32 +0,0 @@ -/* 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 3 -#define CONFIGURE_MAXIMUM_TIMERS 1 -#define CONFIGURE_TICKS_PER_TIMESLICE 100 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/sptests/sp14/sp14.adb b/c/src/ada-tests/sptests/sp14/sp14.adb deleted file mode 100644 index 2149694ecc..0000000000 --- a/c/src/ada-tests/sptests/sp14/sp14.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test SP14 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 SP14 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 SP14; - diff --git a/c/src/ada-tests/sptests/sp14/sptest.adb b/c/src/ada-tests/sptests/sp14/sptest.adb deleted file mode 100644 index 3b74c9f256..0000000000 --- a/c/src/ada-tests/sptests/sp14/sptest.adb +++ /dev/null @@ -1,325 +0,0 @@ --- --- SPTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 14 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 INTERFACES; use INTERFACES; -with RTEMS.TIMER; -with RTEMS.SIGNAL; - -package body SPTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TEST 14 ***" ); - - SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); - SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 1 ), - 1, - RTEMS.MINIMUM_STACK_SIZE * 2, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 2 ), - 1, - RTEMS.MINIMUM_STACK_SIZE * 2, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 2 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 1 ), - SPTEST.TASK_1'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 2 ), - SPTEST.TASK_2'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" ); - - SPTEST.TIMER_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'M', '1', ' ' ); - - RTEMS.TIMER.CREATE( - SPTEST.TIMER_NAME( 1 ), - SPTEST.TIMER_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE OF TM1" ); - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- SIGNAL_3_TO_TASK_1 --- - - procedure SIGNAL_3_TO_TASK_1 ( - ID : in RTEMS.ID; - POINTER : in RTEMS.ADDRESS - ) is - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.SIGNAL.SEND( SPTEST.TASK_ID( 1 ), RTEMS.SIGNAL_3, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SIGNAL_SEND of 3" ); - - SPTEST.TIMER_GOT_THIS_ID := ID; - SPTEST.TIMER_GOT_THIS_POINTER := POINTER; - - SPTEST.SIGNAL_SENT := TRUE; - - end SIGNAL_3_TO_TASK_1; - --- --- TASK_1 --- - - procedure TASK_1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - PREVIOUS_MODE : RTEMS.MODE; - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.PUT_LINE( "TA1 - signal_catch - INTERRUPT_LEVEL( 3 )" ); - RTEMS.SIGNAL.CATCH( - SPTEST.PROCESS_ASR'ACCESS, - RTEMS.INTERRUPT_LEVEL( 3 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SIGNAL_CATCH INTERRUPT(3)" ); - - TEXT_IO.PUT_LINE( "TA1 - signal_send - SIGNAL_16 to self" ); - RTEMS.SIGNAL.SEND( RTEMS.SELF, RTEMS.SIGNAL_16, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( - STATUS, - "SIGNAL_SEND - SIGNAL_16 to SELF" - ); - - TEXT_IO.PUT_LINE( "TA1 - signal_send - SIGNAL_0 to self" ); - RTEMS.SIGNAL.SEND( RTEMS.SELF, RTEMS.SIGNAL_0, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( - STATUS, - "SIGNAL_SEND - SIGNAL_0 to SELF" - ); - - TEXT_IO.PUT_LINE( "TA1 - signal_catch - NO_ASR" ); - RTEMS.SIGNAL.CATCH(SPTEST.PROCESS_ASR'ACCESS, RTEMS.NO_ASR, STATUS); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SIGNAL_CATCH - NO_ASR" ); - - TEST_SUPPORT.PAUSE; - - TEXT_IO.PUT_LINE( "TA1 - signal_send - SIGNAL_1 to self" ); - RTEMS.SIGNAL.SEND( RTEMS.SELF, RTEMS.SIGNAL_1, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( - STATUS, - "SIGNAL_SEND - SIGNAL_1 to SELF" - ); - - TEXT_IO.PUT_LINE( "TA1 - task_mode - disable ASRs" ); - RTEMS.TASKS.MODE( - RTEMS.NO_ASR, - RTEMS.ASR_MASK, - PREVIOUS_MODE, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); - - SPTEST.TIMER_GOT_THIS_ID := 0; - SPTEST.TIMER_GOT_THIS_POINTER := RTEMS.NULL_ADDRESS; - - TEXT_IO.PUT_LINE( "TA1 - sending signal to SELF from timer" ); - RTEMS.TIMER.FIRE_AFTER( - SPTEST.TIMER_ID( 1 ), - TEST_SUPPORT.TICKS_PER_SECOND / 2, - SPTEST.SIGNAL_3_TO_TASK_1'ACCESS, - SPTEST.TASK_1'ADDRESS, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER" ); - - TEXT_IO.PUT_LINE( "TA1 - waiting for signal to arrive" ); - - SPTEST.SIGNAL_SENT := FALSE; - SPTEST.ASR_FIRED := FALSE; - - loop - exit when SPTEST.SIGNAL_SENT; - end loop; - - if SPTEST.TIMER_GOT_THIS_ID = SPTEST.TIMER_ID( 1 ) and then - RTEMS.ARE_EQUAL(SPTEST.TIMER_GOT_THIS_POINTER, - SPTEST.TASK_1'ADDRESS) then - - TEXT_IO.PUT_LINE( "TA1 - timer routine got the correct arguments" ); - - else - - TEXT_IO.PUT( "TA1 - timer got (" ); - UNSIGNED32_IO.PUT( SPTEST.TIMER_GOT_THIS_ID ); - TEXT_IO.PUT( "," ); - ADDRESS_IO.PUT( SPTEST.TIMER_GOT_THIS_POINTER ); - TEXT_IO.PUT( ") instead of (" ); - UNSIGNED32_IO.PUT( SPTEST.TIMER_ID( 1 ) ); - TEXT_IO.PUT( "," ); - ADDRESS_IO.PUT( SPTEST.TASK_1'ADDRESS ); - TEXT_IO.PUT_LINE( ")!!!!" ); - - end if; - - TEXT_IO.PUT_LINE( "TA1 - task_mode - enable ASRs" ); - RTEMS.TASKS.MODE( - RTEMS.ASR, - RTEMS.ASR_MASK, - PREVIOUS_MODE, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); - - TEXT_IO.PUT_LINE( "TA1 - signal_catch - ASR ADDRESS of NULL" ); - RTEMS.SIGNAL.CATCH( NULL, RTEMS.DEFAULT_MODES, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( - STATUS, - "SIGNAL_CATCH - NULL ADDRESS" - ); - - TEXT_IO.PUT_LINE( "TA1 - task_delete - delete self" ); - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end TASK_1; - --- --- TASK_2 --- - - procedure TASK_2 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.PUT_LINE( "TA2 - signal_send - SIGNAL_17 to TA1" ); - RTEMS.SIGNAL.SEND( SPTEST.TASK_ID( 1 ), RTEMS.SIGNAL_17, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( - STATUS, - "SIGNAL_SEND - SIGNAL_17 to TA1" - ); - - TEXT_IO.PUT_LINE( "TA2 - task_wake_after - yield processor" ); - RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER YIELD" ); - - TEXT_IO.PUT_LINE( - "TA2 - signal_send - SIGNAL_18 and SIGNAL_19 to TA1" - ); - RTEMS.SIGNAL.SEND( - SPTEST.TASK_ID( 1 ), - RTEMS.SIGNAL_18 + RTEMS.SIGNAL_19, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( - STATUS, - "SIGNAL_SEND - SIGNAL_18 and SIGNAL_19 to TA1" - ); - - TEXT_IO.PUT_LINE( "TA2 - task_wake_after - yield processor" ); - RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER YIELD" ); - - TEXT_IO.PUT_LINE( "*** END OF TEST 14 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end TASK_2; - --- --- PROCESS_ASR --- - - procedure PROCESS_ASR ( - THE_SIGNAL_SET : in RTEMS.SIGNAL_SET - ) is - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.PUT( "ASR - ENTRY - signal => " ); - UNSIGNED32_IO.PUT( THE_SIGNAL_SET, BASE => 16, WIDTH => 8 ); - TEXT_IO.NEW_LINE; - - if THE_SIGNAL_SET = RTEMS.SIGNAL_16 or else - THE_SIGNAL_SET = RTEMS.SIGNAL_17 or else - THE_SIGNAL_SET = RTEMS.SIGNAL_18 + RTEMS.SIGNAL_19 then - NULL; - - elsif THE_SIGNAL_SET = RTEMS.SIGNAL_0 or else - THE_SIGNAL_SET = RTEMS.SIGNAL_1 then - TEXT_IO.PUT_LINE( "ASR - task_wake_after - yield processor" ); - RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( - STATUS, - "TASK_WAKE_AFTER YIELD" - ); - - elsif THE_SIGNAL_SET = RTEMS.SIGNAL_3 then - - SPTEST.ASR_FIRED := TRUE; - - end if; - - TEXT_IO.PUT( "ASR - EXIT - signal => " ); - UNSIGNED32_IO.PUT( THE_SIGNAL_SET, BASE => 16, WIDTH => 8 ); - TEXT_IO.NEW_LINE; - - end PROCESS_ASR; - -end SPTEST; diff --git a/c/src/ada-tests/sptests/sp14/sptest.ads b/c/src/ada-tests/sptests/sp14/sptest.ads deleted file mode 100644 index ecf6f93dff..0000000000 --- a/c/src/ada-tests/sptests/sp14/sptest.ads +++ /dev/null @@ -1,134 +0,0 @@ --- --- SPTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 14 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; - -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 .. 2 ) of RTEMS.ID; - TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME; - --- --- These arrays contain the IDs and NAMEs of all RTEMS timers created --- by this test. --- - - TIMER_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID; - TIMER_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME; - --- --- SIGNAL_SENT is set to TRUE to indicate that a signal set has --- been sent from an ISR to the executing task. --- - - SIGNAL_SENT : BOOLEAN; - pragma volatile( SIGNAL_SENT ); - --- --- These hold the arguments passed to the timer service routine. --- - - TIMER_GOT_THIS_ID : RTEMS.ID; - pragma volatile( TIMER_GOT_THIS_ID ); - - TIMER_GOT_THIS_POINTER : RTEMS.ADDRESS; - pragma volatile( TIMER_GOT_THIS_POINTER ); - --- --- ASR_FIRED is set to TRUE to indicate that the ASR has executed --- and was passed the correct signal set. --- - - ASR_FIRED : BOOLEAN; - pragma volatile( ASR_FIRED ); - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- SIGNAL_3_TO_TASK_1 --- --- DESCRIPTION: --- --- This subprogram sends signal 3 to TASK_1. --- - - procedure SIGNAL_3_TO_TASK_1 ( - ID : in RTEMS.ID; - POINTER : in RTEMS.ADDRESS - ); - pragma Convention (C, SIGNAL_3_TO_TASK_1); - --- --- PROCESS_ASR --- --- DESCRIPTION: --- --- This subprogram is an ASR for TASK_1. --- - - procedure PROCESS_ASR ( - THE_SIGNAL_SET : in RTEMS.SIGNAL_SET - ); - pragma Convention (C, PROCESS_ASR); - --- --- TASK_1 --- --- DESCRIPTION: --- --- This RTEMS task tests the Signal Manager. --- - - procedure TASK_1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_1); - --- --- TASK_2 --- --- DESCRIPTION: --- --- This RTEMS task tests the Signal Manager. --- - - procedure TASK_2 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_2); - -end SPTEST; diff --git a/c/src/ada-tests/sptests/sp15/Makefile.am b/c/src/ada-tests/sptests/sp15/Makefile.am deleted file mode 100644 index 5804cda188..0000000000 --- a/c/src/ada-tests/sptests/sp15/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_sp15 -ada_sp15_SOURCES = sp15.adb config.h sptest.adb sptest.ads -ada_sp15_SOURCES += ../../support/init.c - -ada_sp15$(EXEEXT): sp15.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_sp15.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/sptests/sp15/ada_sp15.scn b/c/src/ada-tests/sptests/sp15/ada_sp15.scn deleted file mode 100644 index 9c9e68f3d7..0000000000 --- a/c/src/ada-tests/sptests/sp15/ada_sp15.scn +++ /dev/null @@ -1,16 +0,0 @@ -*** TEST 15 *** -INIT - partition_create - partition 1 -INIT - partition_create - partition 2 -TA1 - partition_ident - partition 1 id = 16#2A010001# -TA1 - partition_ident - partition 2 id = 16#2A010002# -TA1 - partition_get_buffer - get buffer 1 from partition 1 - 16#0# -TA1 - partition_get_buffer - get buffer 2 from partition 1 - 16#200# -TA1 - partition_get_buffer - get buffer 1 from partition 2 - 16#0# -TA1 - partition_get_buffer - get buffer 2 from partition 2 - 16#80# -TA1 - partition_return_buffer - return buffer 1 to partition 1 - 16#0# -TA1 - partition_return_buffer - return buffer 2 to partition 1 - 16#200# -TA1 - partition_return_buffer - return buffer 1 to partition 2 - 16#0# -TA1 - partition_return_buffer - return buffer 2 to partition 2 - 16#80# -TA1 - partition_delete - delete partition 1 -TA1 - partition_delete - delete partition 2 -*** END OF TEST 15 *** diff --git a/c/src/ada-tests/sptests/sp15/config.h b/c/src/ada-tests/sptests/sp15/config.h deleted file mode 100644 index 7774f3563c..0000000000 --- a/c/src/ada-tests/sptests/sp15/config.h +++ /dev/null @@ -1,32 +0,0 @@ -/* 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_PARTITIONS 2 -#define CONFIGURE_TICKS_PER_TIMESLICE 100 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/sptests/sp15/sp15.adb b/c/src/ada-tests/sptests/sp15/sp15.adb deleted file mode 100644 index 77e8f27144..0000000000 --- a/c/src/ada-tests/sptests/sp15/sp15.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test SP15 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 SP15 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 SP15; - diff --git a/c/src/ada-tests/sptests/sp15/sptest.adb b/c/src/ada-tests/sptests/sp15/sptest.adb deleted file mode 100644 index 39e887dd2f..0000000000 --- a/c/src/ada-tests/sptests/sp15/sptest.adb +++ /dev/null @@ -1,278 +0,0 @@ --- --- SPTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 15 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 TEST_SUPPORT; -with TEXT_IO; -with UNSIGNED32_IO; -with RTEMS.PARTITION; - -package body SPTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TEST 15 ***" ); - - SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); - - SPTEST.PARTITION_NAME( 1 ) := RTEMS.BUILD_NAME( 'P', 'T', '1', ' ' ); - SPTEST.PARTITION_NAME( 2 ) := RTEMS.BUILD_NAME( 'P', 'T', '2', ' ' ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 1 ), - 4, - 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" ); - - TEXT_IO.PUT_LINE( "INIT - partition_create - partition 1" ); - RTEMS.PARTITION.CREATE( - SPTEST.PARTITION_NAME( 1 ), - AREA_1'ADDRESS, - 4096, - 512, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.PARTITION_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_CREATE OF PT1" ); - - TEXT_IO.PUT_LINE( "INIT - partition_create - partition 2" ); - RTEMS.PARTITION.CREATE( - SPTEST.PARTITION_NAME( 2 ), - AREA_2'ADDRESS, - 274, - 128, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.PARTITION_ID( 2 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_CREATE OF PT2" ); - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- PUT_ADDRESS_FROM_AREA_1 --- - - procedure PUT_ADDRESS_FROM_AREA_1 ( - TO_BE_PRINTED : in RTEMS.ADDRESS - ) is - - begin - - UNSIGNED32_IO.PUT( - RTEMS.SUBTRACT( TO_BE_PRINTED, SPTEST.AREA_1'ADDRESS ), - WIDTH => 8, - BASE => 16 - ); - - end PUT_ADDRESS_FROM_AREA_1; - --- --- PUT_ADDRESS_FROM_AREA_2 --- - - procedure PUT_ADDRESS_FROM_AREA_2 ( - TO_BE_PRINTED : in RTEMS.ADDRESS - ) is - begin - - UNSIGNED32_IO.PUT( - RTEMS.SUBTRACT( TO_BE_PRINTED, SPTEST.AREA_2'ADDRESS ), - WIDTH => 8, - BASE => 16 - ); - - end PUT_ADDRESS_FROM_AREA_2; - --- --- TASK_1 --- - - procedure TASK_1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - PTID_1 : RTEMS.ID; - PTID_2 : RTEMS.ID; - BUFFER_ADDRESS_1 : RTEMS.ADDRESS; - BUFFER_ADDRESS_2 : RTEMS.ADDRESS; - BUFFER_ADDRESS_3 : RTEMS.ADDRESS; - BUFFER_ADDRESS_4 : RTEMS.ADDRESS; - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.PUT( "TA1 - partition_ident - partition 1 id = " ); - RTEMS.PARTITION.IDENT( - SPTEST.PARTITION_NAME( 1 ), - RTEMS.SEARCH_ALL_NODES, - PTID_1, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_IDENT OF PT1" ); - UNSIGNED32_IO.PUT( PTID_1, WIDTH => 8, BASE => 16 ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT( "TA1 - partition_ident - partition 2 id = " ); - RTEMS.PARTITION.IDENT( - SPTEST.PARTITION_NAME( 2 ), - RTEMS.SEARCH_ALL_NODES, - PTID_2, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_IDENT OF PT2" ); - UNSIGNED32_IO.PUT( PTID_2, WIDTH => 8, BASE => 16 ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT( - "TA1 - partition_get_buffer - get buffer 1 from partition 1 - " - ); - RTEMS.PARTITION.GET_BUFFER( - SPTEST.PARTITION_ID( 1 ), - BUFFER_ADDRESS_1, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_GET_BUFFER" ); - SPTEST.PUT_ADDRESS_FROM_AREA_1( BUFFER_ADDRESS_1 ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT( - "TA1 - partition_get_buffer - get buffer 2 from partition 1 - " - ); - RTEMS.PARTITION.GET_BUFFER( - SPTEST.PARTITION_ID( 1 ), - BUFFER_ADDRESS_2, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_GET_BUFFER" ); - SPTEST.PUT_ADDRESS_FROM_AREA_1( BUFFER_ADDRESS_2 ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT( - "TA1 - partition_get_buffer - get buffer 1 from partition 2 - " - ); - RTEMS.PARTITION.GET_BUFFER( - SPTEST.PARTITION_ID( 2 ), - BUFFER_ADDRESS_3, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_GET_BUFFER" ); - SPTEST.PUT_ADDRESS_FROM_AREA_2( BUFFER_ADDRESS_3 ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT( - "TA1 - partition_get_buffer - get buffer 2 from partition 2 - " - ); - RTEMS.PARTITION.GET_BUFFER( - SPTEST.PARTITION_ID( 2 ), - BUFFER_ADDRESS_4, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_GET_BUFFER" ); - SPTEST.PUT_ADDRESS_FROM_AREA_2( BUFFER_ADDRESS_4 ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT( - "TA1 - partition_return_buffer - return buffer 1 to partition 1 - " - ); - SPTEST.PUT_ADDRESS_FROM_AREA_1( BUFFER_ADDRESS_1 ); - TEXT_IO.NEW_LINE; - RTEMS.PARTITION.RETURN_BUFFER( - SPTEST.PARTITION_ID( 1 ), - BUFFER_ADDRESS_1, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_RETURN_BUFFER" ); - - TEXT_IO.PUT( - "TA1 - partition_return_buffer - return buffer 2 to partition 1 - " - ); - SPTEST.PUT_ADDRESS_FROM_AREA_1( BUFFER_ADDRESS_2 ); - TEXT_IO.NEW_LINE; - RTEMS.PARTITION.RETURN_BUFFER( - SPTEST.PARTITION_ID( 1 ), - BUFFER_ADDRESS_2, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_RETURN_BUFFER" ); - - TEXT_IO.PUT( - "TA1 - partition_return_buffer - return buffer 1 to partition 2 - " - ); - SPTEST.PUT_ADDRESS_FROM_AREA_2( BUFFER_ADDRESS_3 ); - TEXT_IO.NEW_LINE; - RTEMS.PARTITION.RETURN_BUFFER( - SPTEST.PARTITION_ID( 2 ), - BUFFER_ADDRESS_3, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_RETURN_BUFFER" ); - - TEXT_IO.PUT( - "TA1 - partition_return_buffer - return buffer 2 to partition 2 - " - ); - SPTEST.PUT_ADDRESS_FROM_AREA_2( BUFFER_ADDRESS_4 ); - TEXT_IO.NEW_LINE; - RTEMS.PARTITION.RETURN_BUFFER( - SPTEST.PARTITION_ID( 2 ), - BUFFER_ADDRESS_4, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_RETURN_BUFFER" ); - - TEXT_IO.PUT_LINE( "TA1 - partition_delete - delete partition 1" ); - RTEMS.PARTITION.DELETE( SPTEST.PARTITION_ID( 1 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_DELETE OF SELF" ); - - TEXT_IO.PUT_LINE( "TA1 - partition_delete - delete partition 2" ); - RTEMS.PARTITION.DELETE( SPTEST.PARTITION_ID( 2 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_DELETE OF SELF" ); - - TEXT_IO.PUT_LINE( "*** END OF TEST 15 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end TASK_1; - -end SPTEST; diff --git a/c/src/ada-tests/sptests/sp15/sptest.ads b/c/src/ada-tests/sptests/sp15/sptest.ads deleted file mode 100644 index 5af0e61503..0000000000 --- a/c/src/ada-tests/sptests/sp15/sptest.ads +++ /dev/null @@ -1,118 +0,0 @@ --- --- SPTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 15 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; - -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 .. 3 ) of RTEMS.ID; - TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; - --- --- These arrays contain the IDs and NAMEs of all RTEMS partitions created --- by this test. --- - - PARTITION_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; - PARTITION_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; - --- --- These arrays define the memory areas used for the partitions in --- this test. --- - - AREA_1 : array ( RTEMS.UNSIGNED32 range 0 .. 4095 ) of RTEMS.UNSIGNED8; - for AREA_1'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT; - - AREA_2 : array ( RTEMS.UNSIGNED32 range 0 .. 273 ) of RTEMS.UNSIGNED8; - for AREA_2'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT; - - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- PUT_ADDRESS_FROM_AREA_1 --- --- DESCRIPTION: --- --- This subpgram prints the offset of the address TO_BE_PRINTED --- from the first byte of AREA_1. --- --- NOTE: --- --- This subprogram is used because the actual address of AREA_1 --- varies based upon the size of the executable, the target board, --- and the target processor. --- - - procedure PUT_ADDRESS_FROM_AREA_1 ( - TO_BE_PRINTED : in RTEMS.ADDRESS - ); - --- --- PUT_ADDRESS_FROM_AREA_2 --- --- DESCRIPTION: --- --- This subprogram prints the offset of the address TO_BE_PRINTED --- from the first byte of AREA_2. --- --- NOTE: --- --- This subprogram is used because the actual address of AREA_1 --- varies based upon the size of the executable, the target board, --- and the target processor. --- - - procedure PUT_ADDRESS_FROM_AREA_2 ( - TO_BE_PRINTED : in RTEMS.ADDRESS - ); - --- --- TASK_1 --- --- DESCRIPTION: --- --- This RTEMS task tests the Partition Manager. --- - - procedure TASK_1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_1); - -end SPTEST; diff --git a/c/src/ada-tests/sptests/sp16/Makefile.am b/c/src/ada-tests/sptests/sp16/Makefile.am deleted file mode 100644 index fc5d075d2c..0000000000 --- a/c/src/ada-tests/sptests/sp16/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_sp16 -ada_sp16_SOURCES = sp16.adb config.h sptest.adb sptest.ads -ada_sp16_SOURCES += ../../support/init.c - -ada_sp16$(EXEEXT): sp16.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_sp16.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/sptests/sp16/ada_sp16.scn b/c/src/ada-tests/sptests/sp16/ada_sp16.scn deleted file mode 100644 index 928dc4a9cf..0000000000 --- a/c/src/ada-tests/sptests/sp16/ada_sp16.scn +++ /dev/null @@ -1,58 +0,0 @@ -*** TEST 16 *** -TA1 - region_ident - rnid => 16#32010001# -TA1 - region_get_segment - wait on 100 byte segment from region 2 -TA1 - got segment from region 2 - 16#70# -TA1 - region_get_segment - wait on 3K segment from region 3 -TA1 - got segment from region 3 - 16#70# -TA1 - region_get_segment - get 3080 byte segment from region 1 - NO_WAIT -TA1 - got segment from region 1 - 16#60# -TA1 - task_wake_after - yield processor -TA2 - region_get_segment - wait on 2K segment from region 1 -TA3 - region_get_segment - wait on 3950 byte segment from region 2 - -TA1 - region_return_segment - return segment to region 1 - 16#60# -TA1 - region_get_segment - wait 10 seconds for 3K segment from region 1 -TA2 - got segment from region 1 - 16#60# -TA2 - region_return_segment - return segment to region 1 - 16#60# -TA2 - task_set_priority - make self highest priority task -TA2 - region_get_segment - wait on 3950 byte segment from region 2 -TA1 - got segment from region 1 - 16#60# -TA1 - region_return_segment - return segment to region 2 - 16#70# -TA2 - got segment from region 2 - 16#70# -TA2 - region_return_segment - return segment to region 2 - 16#70# -TA2 - task_delete - delete self -TA1 - task_wake_after - yield processor -TA3 - got segment from region 2 - 16#70# -TA3 - region_get_segment - wait on 2K segment from region 3 -TA1 - task_delete - delete TA3 - -TA1 - task_wake_after - yield processor -TA4 - region_get_segment - wait on 1.5K segment from region 1 -TA5 - region_get_segment - wait on 1.5K segment from region 1 -TA1 - region_return_segment - return segment to region 1 - 16#60# -TA1 - task_wake_after - yield processor -TA4 - got and returned 16#60# -TA5 - got and returned 16#6E0# -TA1 - region_get_segment - wait 10 seconds for 3K segment from region 1 -TA1 - got segment from region 1 - 16#60# -TA1 - task_wake_after - yield processor -TA5 - region_get_segment - wait on 3K segment from region 1 -TA4 - region_get_segment - wait on 3K segment from region 1 -TA1 - task_delete - delete TA4 -TA1 - region_return_segment - return segment to region 1 - 16#60# -TA1 - task_wake_after - yield processor -TA5 - got segment from region 1 - 16#60# -TA5 - region_return_segment - return segment to region 1 - 16#60# -TA5 - task_delete - delete self -TA1 - region_delete - delete region 1 -TA1 - region_get_segment - get 3K segment from region 4 -TA1 - got segment from region 4 - 16#70# -TA1 - region_get_segment - attempt to get 3K segment from region 4 -TA1 - task_get_note - UNSATISFIED -TA1 - region_extend - extend region 4 by 4K -TA1 - region_get_segment - attempt to get 3K segment from region 4 -TA1 - got 3K segment from region 4 - 16#CF0# -TA1 - return_segment - return segment to region 4 - 16#70# -TA1 - region_return_segment - return segment to region 4 - 16#CF0# -TA1 - region_delete - delete region 4 -*** END OF TEST 16 *** diff --git a/c/src/ada-tests/sptests/sp16/config.h b/c/src/ada-tests/sptests/sp16/config.h deleted file mode 100644 index 087a4c5a49..0000000000 --- a/c/src/ada-tests/sptests/sp16/config.h +++ /dev/null @@ -1,32 +0,0 @@ -/* 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 4 -#define CONFIGURE_MAXIMUM_REGIONS 4 -#define CONFIGURE_TICKS_PER_TIMESLICE 100 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/sptests/sp16/sp16.adb b/c/src/ada-tests/sptests/sp16/sp16.adb deleted file mode 100644 index 4280c67665..0000000000 --- a/c/src/ada-tests/sptests/sp16/sp16.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test SP16 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 SP16 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 SP16; - diff --git a/c/src/ada-tests/sptests/sp16/sptest.adb b/c/src/ada-tests/sptests/sp16/sptest.adb deleted file mode 100644 index a62eedd104..0000000000 --- a/c/src/ada-tests/sptests/sp16/sptest.adb +++ /dev/null @@ -1,789 +0,0 @@ --- --- SPTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 16 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 INTERFACES; use INTERFACES; -with TEST_SUPPORT; -with TEXT_IO; -with UNSIGNED32_IO; -with RTEMS.REGION; - -package body SPTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TEST 16 ***" ); - - SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); - SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' ); - SPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' ); - SPTEST.TASK_NAME( 4 ) := RTEMS.BUILD_NAME( 'T', 'A', '4', ' ' ); - SPTEST.TASK_NAME( 5 ) := RTEMS.BUILD_NAME( 'T', 'A', '5', ' ' ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 1 ), - SPTEST.BASE_PRIORITY, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 2 ), - SPTEST.BASE_PRIORITY, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 2 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 3 ), - SPTEST.BASE_PRIORITY, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 3 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA3" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 1 ), - SPTEST.TASK_1'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 2 ), - SPTEST.TASK_2'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 3 ), - SPTEST.TASK_3'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA3" ); - - SPTEST.REGION_NAME( 1 ) := RTEMS.BUILD_NAME( 'R', 'N', '1', ' ' ); - SPTEST.REGION_NAME( 2 ) := RTEMS.BUILD_NAME( 'R', 'N', '2', ' ' ); - SPTEST.REGION_NAME( 3 ) := RTEMS.BUILD_NAME( 'R', 'N', '3', ' ' ); - SPTEST.REGION_NAME( 4 ) := RTEMS.BUILD_NAME( 'R', 'N', '4', ' ' ); - - RTEMS.REGION.CREATE( - SPTEST.REGION_NAME( 1 ), - SPTEST.AREA_1'ADDRESS, - 4096, - 128, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.REGION_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_CREATE OF RN1" ); - - RTEMS.REGION.CREATE( - SPTEST.REGION_NAME( 2 ), - SPTEST.AREA_2'ADDRESS, - 4096, - 128, - RTEMS.PRIORITY, - SPTEST.REGION_ID( 2 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_CREATE OF RN2" ); - - RTEMS.REGION.CREATE( - SPTEST.REGION_NAME( 3 ), - SPTEST.AREA_3'ADDRESS, - 4096, - 128, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.REGION_ID( 3 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_CREATE OF RN3" ); - - RTEMS.REGION.CREATE( - SPTEST.REGION_NAME( 4 ), - SPTEST.AREA_4'ADDRESS, - 4096, - 128, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.REGION_ID( 4 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_CREATE OF RN4" ); - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- PUT_ADDRESS_FROM_AREA_1 --- - - procedure PUT_ADDRESS_FROM_AREA_1 ( - TO_BE_PRINTED : in RTEMS.ADDRESS - ) is - - begin - - UNSIGNED32_IO.PUT( - RTEMS.SUBTRACT( TO_BE_PRINTED, SPTEST.AREA_1'ADDRESS ), - WIDTH => 8, - BASE => 16 - ); - - end PUT_ADDRESS_FROM_AREA_1; - --- --- PUT_ADDRESS_FROM_AREA_2 --- - - procedure PUT_ADDRESS_FROM_AREA_2 ( - TO_BE_PRINTED : in RTEMS.ADDRESS - ) is - begin - - UNSIGNED32_IO.PUT( - RTEMS.SUBTRACT( TO_BE_PRINTED, SPTEST.AREA_2'ADDRESS ), - WIDTH => 8, - BASE => 16 - ); - - end PUT_ADDRESS_FROM_AREA_2; - --- --- PUT_ADDRESS_FROM_AREA_3 --- - - procedure PUT_ADDRESS_FROM_AREA_3 ( - TO_BE_PRINTED : in RTEMS.ADDRESS - ) is - begin - - UNSIGNED32_IO.PUT( - RTEMS.SUBTRACT( TO_BE_PRINTED, SPTEST.AREA_3'ADDRESS ), - WIDTH => 8, - BASE => 16 - ); - - end PUT_ADDRESS_FROM_AREA_3; - --- --- PUT_ADDRESS_FROM_AREA_4 --- - - procedure PUT_ADDRESS_FROM_AREA_4 ( - TO_BE_PRINTED : in RTEMS.ADDRESS - ) is - begin - - UNSIGNED32_IO.PUT( - RTEMS.SUBTRACT( TO_BE_PRINTED, SPTEST.AREA_4'ADDRESS ), - WIDTH => 8, - BASE => 16 - ); - - end PUT_ADDRESS_FROM_AREA_4; - --- --- TASK_1 --- - - procedure TASK_1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - RNID : RTEMS.ID; - SEGMENT_ADDRESS_1 : RTEMS.ADDRESS; - SEGMENT_ADDRESS_2 : RTEMS.ADDRESS; - SEGMENT_ADDRESS_3 : RTEMS.ADDRESS; - SEGMENT_ADDRESS_4 : RTEMS.ADDRESS; - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.REGION.IDENT( SPTEST.REGION_NAME( 1 ), RNID, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_IDENT OF RN1" ); - TEXT_IO.PUT( "TA1 - region_ident - rnid => " ); - UNSIGNED32_IO.PUT( RNID, WIDTH => 8, BASE => 16 ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT( "TA1 - region_get_segment - wait on " ); - TEXT_IO.PUT_LINE( "100 byte segment from region 2" ); - RTEMS.REGION.GET_SEGMENT( - SPTEST.REGION_ID( 2 ), - 100, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - SEGMENT_ADDRESS_1, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); - TEXT_IO.PUT( "TA1 - got segment from region 2 - " ); - SPTEST.PUT_ADDRESS_FROM_AREA_2( SEGMENT_ADDRESS_1 ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT( "TA1 - region_get_segment - wait on " ); - TEXT_IO.PUT_LINE( "3K segment from region 3" ); - RTEMS.REGION.GET_SEGMENT( - SPTEST.REGION_ID( 3 ), - 3072, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - SEGMENT_ADDRESS_2, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); - TEXT_IO.PUT( "TA1 - got segment from region 3 - " ); - SPTEST.PUT_ADDRESS_FROM_AREA_3( SEGMENT_ADDRESS_2 ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT( "TA1 - region_get_segment - get 3080 byte segment " ); - TEXT_IO.PUT_LINE( "from region 1 - NO_WAIT" ); - RTEMS.REGION.GET_SEGMENT( - SPTEST.REGION_ID( 1 ), - 3080, - RTEMS.NO_WAIT, - RTEMS.NO_TIMEOUT, - SEGMENT_ADDRESS_3, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); - TEXT_IO.PUT( "TA1 - got segment from region 1 - " ); - SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_3 ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT_LINE( "TA1 - task_wake_after - yield processor" ); - RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - -TEST_SUPPORT.PAUSE; - - TEXT_IO.PUT( - "TA1 - region_return_segment - return segment to region 1 - " - ); - SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_3 ); - RTEMS.REGION.RETURN_SEGMENT( - SPTEST.REGION_ID( 1 ), - SEGMENT_ADDRESS_3, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT( "TA1 - region_get_segment - wait 10 seconds for 3K " ); - TEXT_IO.PUT_LINE( "segment from region 1" ); - RTEMS.REGION.GET_SEGMENT( - SPTEST.REGION_ID( 1 ), - 3072, - RTEMS.DEFAULT_OPTIONS, - 10 * TEST_SUPPORT.TICKS_PER_SECOND, - SEGMENT_ADDRESS_4, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); - TEXT_IO.PUT( "TA1 - got segment from region 1 - " ); - SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_4 ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT( - "TA1 - region_return_segment - return segment to region 2 - " - ); - SPTEST.PUT_ADDRESS_FROM_AREA_2( SEGMENT_ADDRESS_1 ); - TEXT_IO.NEW_LINE; - RTEMS.REGION.RETURN_SEGMENT( - SPTEST.REGION_ID( 2 ), - SEGMENT_ADDRESS_1, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" ); - - TEXT_IO.PUT_LINE( "TA1 - task_wake_after - yield processor" ); - RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - TEXT_IO.PUT_LINE( "TA1 - task_delete - delete TA3" ); - RTEMS.TASKS.DELETE( SPTEST.TASK_ID( 3 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA3" ); - -TEST_SUPPORT.PAUSE; - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 4 ), - SPTEST.BASE_PRIORITY, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 4 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA4" ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 5 ), - SPTEST.BASE_PRIORITY, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 5 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA5" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 4 ), - SPTEST.TASK_4'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA4" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 5 ), - SPTEST.TASK_5'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA5" ); - - TEXT_IO.PUT_LINE( "TA1 - task_wake_after - yield processor" ); - RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - TEXT_IO.PUT( - "TA1 - region_return_segment - return segment to region 1 - " - ); - SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_4 ); - RTEMS.REGION.RETURN_SEGMENT( - SPTEST.REGION_ID( 1 ), - SEGMENT_ADDRESS_4, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT_LINE( "TA1 - task_wake_after - yield processor" ); - RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - TEXT_IO.PUT( "TA1 - region_get_segment - wait 10 seconds for 3K " ); - TEXT_IO.PUT_LINE( "segment from region 1" ); - RTEMS.REGION.GET_SEGMENT( - SPTEST.REGION_ID( 1 ), - 3072, - RTEMS.DEFAULT_OPTIONS, - 10 * TEST_SUPPORT.TICKS_PER_SECOND, - SEGMENT_ADDRESS_4, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); - TEXT_IO.PUT( "TA1 - got segment from region 1 - " ); - SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_4 ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT_LINE( "TA1 - task_wake_after - yield processor" ); - RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - TEXT_IO.PUT_LINE( "TA1 - task_delete - delete TA4" ); - RTEMS.TASKS.DELETE( SPTEST.TASK_ID( 4 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA4" ); - - TEXT_IO.PUT( - "TA1 - region_return_segment - return segment to region 1 - " - ); - SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_4 ); - RTEMS.REGION.RETURN_SEGMENT( - SPTEST.REGION_ID( 1 ), - SEGMENT_ADDRESS_4, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT_LINE( "TA1 - task_wake_after - yield processor" ); - RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - TEXT_IO.PUT_LINE( "TA1 - region_delete - delete region 1" ); - RTEMS.REGION.DELETE( SPTEST.REGION_ID( 1 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_DELETE OF RN1" ); ---XXX - TEXT_IO.PUT_LINE( - "TA1 - region_get_segment - get 3K segment from region 4" - ); - RTEMS.REGION.GET_SEGMENT( - SPTEST.REGION_ID( 4 ), - 3072, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - segment_address_1, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "region_get_segment" ); - TEXT_IO.PUT( "TA1 - got segment from region 4 - " ); - PUT_ADDRESS_FROM_AREA_4( segment_address_1 ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT_LINE( - "TA1 - region_get_segment - attempt to get 3K segment from region 4" - ); - RTEMS.REGION.GET_SEGMENT( - SPTEST.REGION_ID( 4 ), - 3072, - RTEMS.NO_WAIT, - RTEMS.NO_TIMEOUT, - SEGMENT_ADDRESS_2, - STATUS - ); - TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( - STATUS, - RTEMS.UNSATISFIED, - "task_get_segment with no memory left" - ); - TEXT_IO.PUT_LINE( "TA1 - task_get_note - UNSATISFIED" ); - - TEXT_IO.PUT_LINE( "TA1 - region_extend - extend region 4 by 4K" ); - RTEMS.REGION.EXTEND( - SPTEST.REGION_ID( 4 ), - SPTEST.AREA_4( 4096 )'ADDRESS, - 4096, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( status, "region_extend" ); - - TEXT_IO.PUT_LINE( - "TA1 - region_get_segment - attempt to get 3K segment from region 4" - ); - RTEMS.REGION.GET_SEGMENT( - SPTEST.REGION_ID( 4 ), - 3072, - RTEMS.NO_WAIT, - RTEMS.NO_TIMEOUT, - segment_address_3, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( status, "region_get_segment" ); - TEXT_IO.PUT( "TA1 - got 3K segment from region 4 - " ); - PUT_ADDRESS_FROM_AREA_4( segment_address_3 ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT( - "TA1 - return_segment - return segment to region 4 - " - ); - PUT_ADDRESS_FROM_AREA_4( segment_address_1 ); - RTEMS.REGION.RETURN_SEGMENT( - SPTEST.REGION_ID( 4 ), segment_address_1, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( status, "region_return_segment" ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT( - "TA1 - region_return_segment - return segment to region 4 - " - ); - PUT_ADDRESS_FROM_AREA_4( segment_address_3 ); - RTEMS.REGION.RETURN_SEGMENT( - SPTEST.REGION_ID( 4 ), segment_address_3, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( status, "region_return_segment" ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT_LINE( "TA1 - region_delete - delete region 4" ); - RTEMS.REGION.DELETE( SPTEST.REGION_ID( 4 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( status, "region_delete" ); - - TEXT_IO.PUT_LINE( "*** END OF TEST 16 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end TASK_1; - --- --- TASK_2 --- - - procedure TASK_2 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - PREVIOUS_PRIORITY : RTEMS.TASKS.PRIORITY; - SEGMENT_ADDRESS_1 : RTEMS.ADDRESS; - SEGMENT_ADDRESS_2 : RTEMS.ADDRESS; - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.PUT( "TA2 - region_get_segment - wait on 2K segment " ); - TEXT_IO.PUT_LINE( "from region 1" ); - RTEMS.REGION.GET_SEGMENT( - SPTEST.REGION_ID( 1 ), - 2048, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - SEGMENT_ADDRESS_1, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); - TEXT_IO.PUT( "TA2 - got segment from region 1 - " ); - SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_1 ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT( - "TA2 - region_return_segment - return segment to region 1 - " - ); - SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_1 ); - RTEMS.REGION.RETURN_SEGMENT( - SPTEST.REGION_ID( 1 ), - SEGMENT_ADDRESS_1, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT( "TA2 - task_set_priority - make self " ); - TEXT_IO.PUT_LINE( "highest priority task" ); - RTEMS.TASKS.SET_PRIORITY( - RTEMS.SELF, - SPTEST.BASE_PRIORITY - 1, - PREVIOUS_PRIORITY, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" ); - - TEXT_IO.PUT( - "TA2 - region_get_segment - wait on 3950 byte segment " - ); - TEXT_IO.PUT_LINE( "from region 2" ); - RTEMS.REGION.GET_SEGMENT( - SPTEST.REGION_ID( 2 ), - 3950, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - SEGMENT_ADDRESS_2, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); - TEXT_IO.PUT( "TA2 - got segment from region 2 - " ); - SPTEST.PUT_ADDRESS_FROM_AREA_2( SEGMENT_ADDRESS_2 ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT( - "TA2 - region_return_segment - return segment to region 2 - " - ); - SPTEST.PUT_ADDRESS_FROM_AREA_2( SEGMENT_ADDRESS_2 ); - RTEMS.REGION.RETURN_SEGMENT( - SPTEST.REGION_ID( 2 ), - SEGMENT_ADDRESS_2, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT_LINE( "TA2 - task_delete - delete self" ); - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA2" ); - - end TASK_2; - --- --- TASK_3 --- - - procedure TASK_3 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - SEGMENT_ADDRESS_1 : RTEMS.ADDRESS; - SEGMENT_ADDRESS_2 : RTEMS.ADDRESS; - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.PUT( "TA3 - region_get_segment - wait on 3950 byte segment " ); - TEXT_IO.PUT_LINE( "from region 2" ); - RTEMS.REGION.GET_SEGMENT( - SPTEST.REGION_ID( 2 ), - 3950, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - SEGMENT_ADDRESS_1, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); - TEXT_IO.PUT( "TA3 - got segment from region 2 - " ); - SPTEST.PUT_ADDRESS_FROM_AREA_2( SEGMENT_ADDRESS_1 ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT( "TA3 - region_get_segment - wait on 2K segment " ); - TEXT_IO.PUT_LINE( "from region 3" ); - RTEMS.REGION.GET_SEGMENT( - SPTEST.REGION_ID( 3 ), - 2048, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - SEGMENT_ADDRESS_2, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); - - end TASK_3; - --- --- TASK_4 --- - - procedure TASK_4 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - SEGMENT_ADDRESS_1 : RTEMS.ADDRESS; - SEGMENT_ADDRESS_2 : RTEMS.ADDRESS; - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.PUT( "TA4 - region_get_segment - wait on 1.5K segment " ); - TEXT_IO.PUT_LINE( "from region 1" ); - RTEMS.REGION.GET_SEGMENT( - SPTEST.REGION_ID( 1 ), - 1536, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - SEGMENT_ADDRESS_1, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); - - RTEMS.REGION.RETURN_SEGMENT( - SPTEST.REGION_ID( 1 ), - SEGMENT_ADDRESS_1, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" ); - TEXT_IO.PUT( "TA4 - got and returned " ); - SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_1 ); - TEXT_IO.NEW_LINE; - - RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - TEXT_IO.PUT( "TA4 - region_get_segment - wait on 3K segment " ); - TEXT_IO.PUT_LINE( "from region 1" ); - RTEMS.REGION.GET_SEGMENT( - SPTEST.REGION_ID( 1 ), - 3072, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - SEGMENT_ADDRESS_2, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); - - end TASK_4; - --- --- TASK_5 --- - - procedure TASK_5 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - SEGMENT_ADDRESS_1 : RTEMS.ADDRESS; - SEGMENT_ADDRESS_2 : RTEMS.ADDRESS; - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.PUT( "TA5 - region_get_segment - wait on 1.5K segment " ); - TEXT_IO.PUT_LINE( "from region 1" ); - RTEMS.REGION.GET_SEGMENT( - SPTEST.REGION_ID( 1 ), - 1536, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - SEGMENT_ADDRESS_1, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); - - RTEMS.REGION.RETURN_SEGMENT( - SPTEST.REGION_ID( 1 ), - SEGMENT_ADDRESS_1, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" ); - TEXT_IO.PUT( "TA5 - got and returned " ); - SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_1 ); - TEXT_IO.NEW_LINE; - - RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - TEXT_IO.PUT( "TA5 - region_get_segment - wait on 3K segment " ); - TEXT_IO.PUT_LINE( "from region 1" ); - RTEMS.REGION.GET_SEGMENT( - SPTEST.REGION_ID( 1 ), - 3072, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - SEGMENT_ADDRESS_2, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); - TEXT_IO.PUT( "TA5 - got segment from region 1 - " ); - SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_2 ); - TEXT_IO.NEW_LINE; - - RTEMS.REGION.RETURN_SEGMENT( - SPTEST.REGION_ID( 1 ), - SEGMENT_ADDRESS_2, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" ); - TEXT_IO.PUT( - "TA5 - region_return_segment - return segment to region 1 - " - ); - SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_2 ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT_LINE( "TA5 - task_delete - delete self" ); - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA5" ); - - end TASK_5; - -end SPTEST; diff --git a/c/src/ada-tests/sptests/sp16/sptest.ads b/c/src/ada-tests/sptests/sp16/sptest.ads deleted file mode 100644 index 7f028a0274..0000000000 --- a/c/src/ada-tests/sptests/sp16/sptest.ads +++ /dev/null @@ -1,202 +0,0 @@ --- --- SPTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 16 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; - -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 .. 5 ) of RTEMS.ID; - TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 5 ) of RTEMS.NAME; - --- --- These arrays contain the IDs and NAMEs of all RTEMS regions created --- by this test. --- - - REGION_ID : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.ID; - REGION_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.NAME; - --- --- The following constant defines the priority of most of the --- RTEMS tasks in this test. This allows one of the tasks to --- easily set itself to a higher priority than the rest. --- - - BASE_PRIORITY : constant RTEMS.TASKS.PRIORITY := 140; - --- --- These arrays define the memory areas used for the regions in --- this test. --- - - AREA_1 : array ( RTEMS.UNSIGNED32 range 0 .. 4095 ) of RTEMS.UNSIGNED8; - for AREA_1'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT; - - AREA_2 : array ( RTEMS.UNSIGNED32 range 0 .. 4095 ) of RTEMS.UNSIGNED8; - for AREA_2'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT; - - AREA_3 : array ( RTEMS.UNSIGNED32 range 0 .. 4095 ) of RTEMS.UNSIGNED8; - for AREA_3'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT; - - AREA_4 : array ( RTEMS.UNSIGNED32 range 0 .. 8191 ) of RTEMS.UNSIGNED8; - for AREA_4'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- PUT_ADDRESS_FROM_AREA_1 --- --- DESCRIPTION: --- --- This subprogram prints the offset of the address TO_BE_PRINTED --- from the first byte of AREA_1. --- --- NOTE: --- --- This subprogram is used because the actual address of AREA_1 --- varies based upon the size of the executable, the target board, --- and the target processor. --- - - procedure PUT_ADDRESS_FROM_AREA_1 ( - TO_BE_PRINTED : in RTEMS.ADDRESS - ); - --- --- PUT_ADDRESS_FROM_AREA_2 --- --- DESCRIPTION: --- --- This subprogram prints the offset of the address TO_BE_PRINTED --- from the first byte of AREA_2. --- --- NOTE: --- --- This subprogram is used because the actual address of AREA_2 --- varies based upon the size of the executable, the target board, --- and the target processor. --- - - procedure PUT_ADDRESS_FROM_AREA_2 ( - TO_BE_PRINTED : in RTEMS.ADDRESS - ); - --- --- PUT_ADDRESS_FROM_AREA_3 --- --- DESCRIPTION: --- --- This subprogram prints the offset of the address TO_BE_PRINTED --- from the first byte of AREA_3. --- --- NOTE: --- --- This subprogram is used because the actual address of AREA_3 --- varies based upon the size of the executable, the target board, --- and the target processor. --- - - procedure PUT_ADDRESS_FROM_AREA_3 ( - TO_BE_PRINTED : in RTEMS.ADDRESS - ); - --- --- TASK_1 --- --- DESCRIPTION: --- --- This RTEMS task tests the Region Manager. --- - - procedure TASK_1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_1); - --- --- TASK_2 --- --- DESCRIPTION: --- --- This RTEMS task tests the Region Manager. --- - - procedure TASK_2 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_2); - --- --- TASK_3 --- --- DESCRIPTION: --- --- This RTEMS task tests the Region Manager. --- - - procedure TASK_3 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_3); - --- --- TASK_4 --- --- DESCRIPTION: --- --- This RTEMS task tests the Region Manager. --- - - procedure TASK_4 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_4); - --- --- TASK_5 --- --- DESCRIPTION: --- --- This RTEMS task tests the Region Manager. --- - - procedure TASK_5 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_5); - -end SPTEST; diff --git a/c/src/ada-tests/sptests/sp17/Makefile.am b/c/src/ada-tests/sptests/sp17/Makefile.am deleted file mode 100644 index 7b20338c06..0000000000 --- a/c/src/ada-tests/sptests/sp17/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_sp17 -ada_sp17_SOURCES = sp17.adb config.h sptest.adb sptest.ads -ada_sp17_SOURCES += ../../support/init.c - -ada_sp17$(EXEEXT): sp17.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_sp17.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/sptests/sp17/ada_sp17.scn b/c/src/ada-tests/sptests/sp17/ada_sp17.scn deleted file mode 100644 index 887284d877..0000000000 --- a/c/src/ada-tests/sptests/sp17/ada_sp17.scn +++ /dev/null @@ -1,8 +0,0 @@ -*** TEST 17 *** -TA2 - Suspending self -TA1 - signal_catch: initializing signal catcher -TA1 - Sending signal to self -TA2 - signal_return preempted correctly -TA1 - TA2 correctly preempted me -TA1 - Got Back!!! -*** END OF TEST 17 *** diff --git a/c/src/ada-tests/sptests/sp17/config.h b/c/src/ada-tests/sptests/sp17/config.h deleted file mode 100644 index 0ceab6f736..0000000000 --- a/c/src/ada-tests/sptests/sp17/config.h +++ /dev/null @@ -1,32 +0,0 @@ -/* 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 3 -#define CONFIGURE_MICROSECONDS_PER_TICK RTEMS_MILLISECONDS_TO_MICROSECONDS(25) -#define CONFIGURE_TICKS_PER_TIMESLICE 1000 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/sptests/sp17/sp17.adb b/c/src/ada-tests/sptests/sp17/sp17.adb deleted file mode 100644 index 5c06ef0b44..0000000000 --- a/c/src/ada-tests/sptests/sp17/sp17.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test SP17 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 SP17 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 SP17; - diff --git a/c/src/ada-tests/sptests/sp17/sptest.adb b/c/src/ada-tests/sptests/sp17/sptest.adb deleted file mode 100644 index e2402a50cf..0000000000 --- a/c/src/ada-tests/sptests/sp17/sptest.adb +++ /dev/null @@ -1,170 +0,0 @@ --- --- SPTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 17 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 INTERFACES; use INTERFACES; -with TEST_SUPPORT; -with TEXT_IO; -with RTEMS.SIGNAL; - -package body SPTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TEST 17 ***" ); - - SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); - SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' ); - - SPTEST.TASK_2_PREEMPTED := FALSE; - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 1 ), - 2, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 2 ), - 1, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 2 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 1 ), - SPTEST.TASK_1'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 2 ), - SPTEST.TASK_2'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" ); - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- PROCESS_ASR --- - - procedure PROCESS_ASR ( - SIGNALS : in RTEMS.SIGNAL_SET - ) is - pragma Unreferenced(SIGNALS); - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.TASKS.RESUME( SPTEST.TASK_ID( 2 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "ASR - TASK_RESUME OF TA2" ); - - end PROCESS_ASR; - --- --- TASK_1 --- - - procedure TASK_1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.PUT_LINE( "TA1 - signal_catch: initializing signal catcher" ); - RTEMS.SIGNAL.CATCH( - SPTEST.PROCESS_ASR'ACCESS, - RTEMS.NO_ASR + RTEMS.NO_PREEMPT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SIGNAL_CATCH" ); - - TEXT_IO.PUT_LINE( "TA1 - Sending signal to self" ); - RTEMS.SIGNAL.SEND( - SPTEST.TASK_ID( 1 ), - RTEMS.SIGNAL_16, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SIGNAL_SEND" ); - - if SPTEST.TASK_2_PREEMPTED then - TEXT_IO.PUT_LINE( "TA1 - TA2 correctly preempted me" ); - end if; - - TEXT_IO.PUT_LINE( "TA1 - Got Back!!!" ); - - TEXT_IO.PUT_LINE( "*** END OF TEST 17 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end TASK_1; - --- --- TASK_2 --- - - procedure TASK_2 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - SPTEST.TASK_2_PREEMPTED := FALSE; - - TEXT_IO.PUT_LINE( "TA2 - Suspending self" ); - RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND OF TA2" ); - - TEXT_IO.PUT_LINE( "TA2 - signal_return preempted correctly" ); - - SPTEST.TASK_2_PREEMPTED := TRUE; - - RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND OF TA2" ); - - end TASK_2; - -end SPTEST; diff --git a/c/src/ada-tests/sptests/sp17/sptest.ads b/c/src/ada-tests/sptests/sp17/sptest.ads deleted file mode 100644 index 428114c9a0..0000000000 --- a/c/src/ada-tests/sptests/sp17/sptest.ads +++ /dev/null @@ -1,95 +0,0 @@ --- --- SPTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 17 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; - -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 .. 3 ) of RTEMS.ID; - TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; - --- --- The following is set to TRUE by TASK_2 when it preempts TASK_1. --- - - TASK_2_PREEMPTED : STANDARD.BOOLEAN; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- PROCESS_ASR --- --- DESCRIPTION: --- --- This subprogram is the ASR for TASK_1. --- - - procedure PROCESS_ASR ( - SIGNALS : in RTEMS.SIGNAL_SET - ); - pragma Convention (C, PROCESS_ASR); - --- --- TASK_1 --- --- DESCRIPTION: --- --- This RTEMS task tests that when the transfer from the task --- to the ASR (and vice-versa) is performed, that the new mode --- is taken into account. If this occurs, then TASK_2 will be --- able to preempt upon completion of the ASR of TASK_1. --- - - procedure TASK_1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_1); - --- --- TASK_2 --- --- DESCRIPTION: --- --- This RTEMS task is designed to preempt TASK_1. --- - - procedure TASK_2 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_2); - -end SPTEST; diff --git a/c/src/ada-tests/sptests/sp19/Makefile.am b/c/src/ada-tests/sptests/sp19/Makefile.am deleted file mode 100644 index 726b07c82d..0000000000 --- a/c/src/ada-tests/sptests/sp19/Makefile.am +++ /dev/null @@ -1,20 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -AM_ADAFLAGS += -I. - -noinst_PROGRAMS = ada_sp19 -ada_sp19_SOURCES = sp19.adb sptest.adb config.h sptest.ads -ada_sp19_SOURCES += ../../support/init.c - -CLEANFILES += sptest.adb - -ada_sp19$(EXEEXT): sp19.adb sptest.adb sptest.ads init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_sp19.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/sptests/sp19/README b/c/src/ada-tests/sptests/sp19/README deleted file mode 100644 index 4fd698381e..0000000000 --- a/c/src/ada-tests/sptests/sp19/README +++ /dev/null @@ -1,19 +0,0 @@ -This is a "problem" test in Ada versus the C equivalent. In C, -we used macros to : - - + declare a LOT of local integer and floating point variables - + load them with values - + check them at certain times - + to avoid floating point operations on CPUs w/o hardware support - -The macros are not equivalent to subprograms doing the same thing. -We are trying to insure that the register set is fully utilized and -checking that it survives context switches. If the routines are -subprograms, then calling conventions and scoping rules apply. Thus -the variables do not exist throughout the entire life of the task -as in the C test. - -It seems to point out that although the conditional compilation -and macro capabilities of C are often abused, they do provide -capabilities which are difficult if not impossible to mimic entirely -with subprograms. diff --git a/c/src/ada-tests/sptests/sp19/ada_sp19.scn b/c/src/ada-tests/sptests/sp19/ada_sp19.scn deleted file mode 100644 index 573860bb59..0000000000 --- a/c/src/ada-tests/sptests/sp19/ada_sp19.scn +++ /dev/null @@ -1,55 +0,0 @@ -*** TEST 19 *** -FP1 - integer base = ( 16#6000#) -FP1 - float base = ( 6.00060E+03) -FP1 - integer base = ( 16#6000#) -FP1 - float base = ( 6.00060E+03) -TA1 - integer base = ( 16#1000#) -TA1 - clock_get - 9: 0: 0 12/31/1988 -TA2 - integer base = ( 16#2000#) -TA2 - clock_get - 9: 0: 0 12/31/1988 -TA3 - integer base = ( 16#3000#) -TA3 - clock_get - 9: 0: 0 12/31/1988 -TA4 - integer base = ( 16#4000#) -TA4 - float base = ( 4.00040E+03) -TA4 - clock_get - 9: 0: 0 12/31/1988 -TA5 - integer base = ( 16#5000#) -TA5 - float base = ( 5.00050E+03) -TA5 - clock_get - 9: 0: 0 12/31/1988 -TA4 - clock_get - 9: 0: 1 12/31/1988 -TA5 - clock_get - 9: 0: 1 12/31/1988 -TA4 - clock_get - 9: 0: 2 12/31/1988 -TA5 - clock_get - 9: 0: 2 12/31/1988 -TA4 - clock_get - 9: 0: 3 12/31/1988 -TA5 - clock_get - 9: 0: 3 12/31/1988 -TA4 - clock_get - 9: 0: 4 12/31/1988 -TA5 - clock_get - 9: 0: 4 12/31/1988 -TA1 - clock_get - 9: 0: 5 12/31/1988 -TA4 - clock_get - 9: 0: 5 12/31/1988 -TA5 - clock_get - 9: 0: 5 12/31/1988 -TA4 - clock_get - 9: 0: 6 12/31/1988 -TA5 - clock_get - 9: 0: 6 12/31/1988 -TA4 - clock_get - 9: 0: 7 12/31/1988 -TA5 - clock_get - 9: 0: 7 12/31/1988 -TA4 - clock_get - 9: 0: 8 12/31/1988 -TA5 - clock_get - 9: 0: 8 12/31/1988 -TA4 - clock_get - 9: 0: 9 12/31/1988 -TA5 - clock_get - 9: 0: 9 12/31/1988 -TA2 - clock_get - 9: 0:10 12/31/1988 -TA1 - clock_get - 9: 0:10 12/31/1988 -TA4 - clock_get - 9: 0:10 12/31/1988 -TA5 - clock_get - 9: 0:10 12/31/1988 -TA4 - clock_get - 9: 0:11 12/31/1988 -TA5 - clock_get - 9: 0:11 12/31/1988 -TA4 - clock_get - 9: 0:12 12/31/1988 -TA5 - clock_get - 9: 0:12 12/31/1988 -TA4 - clock_get - 9: 0:13 12/31/1988 -TA5 - clock_get - 9: 0:13 12/31/1988 -TA4 - clock_get - 9: 0:14 12/31/1988 -TA5 - clock_get - 9: 0:14 12/31/1988 -TA1 - clock_get - 9: 0:15 12/31/1988 -TA3 - clock_get - 9: 0:15 12/31/1988 -TA4 - clock_get - 9: 0:15 12/31/1988 -TA5 - clock_get - 9: 0:15 12/31/1988 -TA4 - task_delete - self -TA5 - task_delete - TA3 -*** END OF TEST 19 *** diff --git a/c/src/ada-tests/sptests/sp19/config.h b/c/src/ada-tests/sptests/sp19/config.h deleted file mode 100644 index 278aaf69b0..0000000000 --- a/c/src/ada-tests/sptests/sp19/config.h +++ /dev/null @@ -1,30 +0,0 @@ -/* 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_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#define CONFIGURE_MAXIMUM_TASKS 7 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/sptests/sp19/sp19.adb b/c/src/ada-tests/sptests/sp19/sp19.adb deleted file mode 100644 index f2cfddb97a..0000000000 --- a/c/src/ada-tests/sptests/sp19/sp19.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test SP19 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 SP19 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.FLOATING_POINT, - 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 SP19; - diff --git a/c/src/ada-tests/sptests/sp19/sptest.adp b/c/src/ada-tests/sptests/sp19/sptest.adp deleted file mode 100644 index d49bf41aac..0000000000 --- a/c/src/ada-tests/sptests/sp19/sptest.adp +++ /dev/null @@ -1,397 +0,0 @@ --- --- SPTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 19 of the RTEMS --- Single Processor Test Suite. --- --- DEPENDENCIES: --- --- --- --- COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. --- On-Line Applications Research Corporation (OAR). --- - -with INTERFACES; use INTERFACES; -with FLOAT_IO; -with TEST_SUPPORT; -with TEXT_IO; -with UNSIGNED32_IO; -with RTEMS.CLOCK; - -include(../../support/fp.inc) -include(../../support/integer.inc) - -package body SPTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TEST 19 ***" ); - - SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); - SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' ); - SPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' ); - SPTEST.TASK_NAME( 4 ) := RTEMS.BUILD_NAME( 'T', 'A', '4', ' ' ); - SPTEST.TASK_NAME( 5 ) := RTEMS.BUILD_NAME( 'T', 'A', '5', ' ' ); - SPTEST.TASK_NAME( 6 ) := RTEMS.BUILD_NAME( 'F', 'P', '1', ' ' ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 1 ), - 2, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.FLOATING_POINT, - SPTEST.TASK_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 2 ), - 2, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 2 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 3 ), - 2, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( 3 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA3" ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 4 ), - 2, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.FLOATING_POINT, - SPTEST.TASK_ID( 4 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA4" ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 5 ), - 2, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.FLOATING_POINT, - SPTEST.TASK_ID( 5 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA5" ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 6 ), - 1, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.FLOATING_POINT, - SPTEST.TASK_ID( 6 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF FP1" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 6 ), - SPTEST.FIRST_FP_TASK'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF FP1" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 1 ), - SPTEST.TASK_1'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 2 ), - SPTEST.TASK_1'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 3 ), - SPTEST.TASK_1'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA3" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 4 ), - SPTEST.FP_TASK'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA4" ); - - RTEMS.TASKS.START( - SPTEST.TASK_ID( 5 ), - SPTEST.FP_TASK'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA5" ); - - -- - -- Load "task dependent factors" in the context areas - -- - - SPTEST.FP_FACTORS( 0 ) := 0.0; - SPTEST.FP_FACTORS( 1 ) := 1000.1; - SPTEST.FP_FACTORS( 2 ) := 2000.2; - SPTEST.FP_FACTORS( 3 ) := 3000.3; - SPTEST.FP_FACTORS( 4 ) := 4000.4; - SPTEST.FP_FACTORS( 5 ) := 5000.5; - SPTEST.FP_FACTORS( 6 ) := 6000.6; - SPTEST.FP_FACTORS( 7 ) := 7000.7; - SPTEST.FP_FACTORS( 8 ) := 8000.8; - SPTEST.FP_FACTORS( 9 ) := 9000.9; - - SPTEST.INTEGER_FACTORS( 0 ) := 16#0000#; - SPTEST.INTEGER_FACTORS( 1 ) := 16#1000#; - SPTEST.INTEGER_FACTORS( 2 ) := 16#2000#; - SPTEST.INTEGER_FACTORS( 3 ) := 16#3000#; - SPTEST.INTEGER_FACTORS( 4 ) := 16#4000#; - SPTEST.INTEGER_FACTORS( 5 ) := 16#5000#; - SPTEST.INTEGER_FACTORS( 6 ) := 16#6000#; - SPTEST.INTEGER_FACTORS( 7 ) := 16#7000#; - SPTEST.INTEGER_FACTORS( 8 ) := 16#8000#; - SPTEST.INTEGER_FACTORS( 9 ) := 16#9000#; - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- FIRST_FP_TASK --- - - procedure FIRST_FP_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - STATUS : RTEMS.STATUS_CODES; - TID : RTEMS.ID; - TIME : RTEMS.TIME_OF_DAY; - TASK_INDEX : RTEMS.UNSIGNED32; - INTEGER_DECLARE; - FP_DECLARE; - begin - - RTEMS.TASKS.IDENT( RTEMS.SELF, RTEMS.SEARCH_ALL_NODES, TID, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF SELF" ); - - TASK_INDEX := TEST_SUPPORT.TASK_NUMBER( TID ); - - INTEGER_LOAD( INTEGER_FACTORS( TASK_INDEX ) ); - FP_LOAD( FP_FACTORS( TASK_INDEX ) ); - - TEST_SUPPORT.PUT_NAME( SPTEST.TASK_NAME( TASK_INDEX ), FALSE ); - TEXT_IO.PUT( " - integer base = (" ); - UNSIGNED32_IO.PUT( INTEGER_FACTORS( TASK_INDEX ), BASE => 16 ); - TEXT_IO.PUT_LINE( ")" ); - - -- - -- C implementation prints NA if no hardware FP support. - -- - - TEST_SUPPORT.PUT_NAME( - SPTEST.TASK_NAME( TEST_SUPPORT.TASK_NUMBER( TID ) ), - FALSE - ); - TEXT_IO.PUT( " - float base = (" ); - FLOAT_IO.PUT( FP_FACTORS( TASK_INDEX ) ); - TEXT_IO.PUT_LINE( ")" ); - - FP_CHECK( FP_FACTORS( TASK_INDEX ) ); - INTEGER_CHECK( INTEGER_FACTORS( TASK_INDEX ) ); - if ARGUMENT = 0 then - RTEMS.TASKS.RESTART( - RTEMS.SELF, - 1, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESTART OF SELF" ); - else - TIME := ( 1988, 12, 31, 9, 0, 0, 0 ); - RTEMS.CLOCK.SET( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET" ); - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - end if; - - end FIRST_FP_TASK; - --- --- FP_TASK --- - - procedure FP_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - TID : RTEMS.ID; - TIME : RTEMS.TIME_OF_DAY; - TASK_INDEX : RTEMS.UNSIGNED32; - INTEGER_DECLARE; - FP_DECLARE; - begin - - RTEMS.TASKS.IDENT( RTEMS.SELF, RTEMS.SEARCH_ALL_NODES, TID, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF SELF" ); - - TASK_INDEX := TEST_SUPPORT.TASK_NUMBER( TID ); - - INTEGER_LOAD( INTEGER_FACTORS( TASK_INDEX ) ); - FP_LOAD( FP_FACTORS( TASK_INDEX ) ); - - TEST_SUPPORT.PUT_NAME( - SPTEST.TASK_NAME( TEST_SUPPORT.TASK_NUMBER( TID ) ), - FALSE - ); - TEXT_IO.PUT( " - integer base = (" ); - UNSIGNED32_IO.PUT( INTEGER_FACTORS( TASK_INDEX ), BASE => 16 ); - TEXT_IO.PUT_LINE( ")" ); - - -- - -- C implementation prints NA if no hardware FP support. - -- - - TEST_SUPPORT.PUT_NAME( - SPTEST.TASK_NAME( TEST_SUPPORT.TASK_NUMBER( TID ) ), - FALSE - ); - TEXT_IO.PUT( " - float base = (" ); - FLOAT_IO.PUT( FP_FACTORS( TASK_INDEX ) ); - TEXT_IO.PUT_LINE( ")" ); - - loop - - RTEMS.CLOCK.GET_TOD( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); - - if TIME.SECOND >= 16 then - - if TEST_SUPPORT.TASK_NUMBER( TID ) = 4 then - TEXT_IO.PUT_LINE( "TA4 - task_delete - self" ); - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA4" ); - end if; - - TEXT_IO.PUT_LINE( "TA5 - task_delete - TA3" ); - RTEMS.TASKS.DELETE( SPTEST.TASK_ID( 3 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA3" ); - - TEXT_IO.PUT_LINE( "*** END OF TEST 19 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - end if; - - TEST_SUPPORT.PUT_NAME( - SPTEST.TASK_NAME( TEST_SUPPORT.TASK_NUMBER( TID ) ), - FALSE - ); - - TEST_SUPPORT.PRINT_TIME( " - clock_get - ", TIME, "" ); - TEXT_IO.NEW_LINE; - - INTEGER_CHECK( INTEGER_FACTORS( TASK_INDEX ) ); - FP_CHECK( FP_FACTORS( TASK_INDEX ) ); - - RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - end loop; - - end FP_TASK; - --- --- TASK_1 --- - - procedure TASK_1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - TID : RTEMS.ID; - TIME : RTEMS.TIME_OF_DAY; - TASK_INDEX : RTEMS.UNSIGNED32; - INTEGER_DECLARE; - FP_DECLARE; - begin - - RTEMS.TASKS.IDENT( RTEMS.SELF, RTEMS.SEARCH_ALL_NODES, TID, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF SELF" ); - - TASK_INDEX := TEST_SUPPORT.TASK_NUMBER( TID ); - - INTEGER_LOAD( INTEGER_FACTORS( TASK_INDEX ) ); - FP_LOAD( FP_FACTORS( TASK_INDEX ) ); - - TEST_SUPPORT.PUT_NAME( - SPTEST.TASK_NAME( TEST_SUPPORT.TASK_NUMBER( TID ) ), - FALSE - ); - TEXT_IO.PUT( " - integer base = (" ); - UNSIGNED32_IO.PUT( INTEGER_FACTORS( TASK_INDEX ), BASE => 16 ); - TEXT_IO.PUT_LINE( ")" ); - - loop - - RTEMS.CLOCK.GET_TOD( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); - - TEST_SUPPORT.PUT_NAME( - SPTEST.TASK_NAME( TEST_SUPPORT.TASK_NUMBER( TID ) ), - FALSE - ); - - TEST_SUPPORT.PRINT_TIME( " - clock_get - ", TIME, "" ); - TEXT_IO.NEW_LINE; - - INTEGER_CHECK( INTEGER_FACTORS( TASK_INDEX ) ); - FP_CHECK( FP_FACTORS( TASK_INDEX ) ); - - RTEMS.TASKS.WAKE_AFTER( - TEST_SUPPORT.TASK_NUMBER( TID ) * 5 * - TEST_SUPPORT.TICKS_PER_SECOND, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - end loop; - - end TASK_1; - -end SPTEST; diff --git a/c/src/ada-tests/sptests/sp19/sptest.ads b/c/src/ada-tests/sptests/sp19/sptest.ads deleted file mode 100644 index 3befd7cc3a..0000000000 --- a/c/src/ada-tests/sptests/sp19/sptest.ads +++ /dev/null @@ -1,119 +0,0 @@ --- --- SPTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 19 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; - -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 .. 6 ) of RTEMS.ID; - TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 6 ) of RTEMS.NAME; - --- --- This array contains the floating point factors used by the --- floating point tasks in this test. --- - - FP_FACTORS : array ( RTEMS.UNSIGNED32 range 0 .. 9 ) of FLOAT; - --- --- This array contains the integer factors used by the --- integer tasks in this test. --- - - INTEGER_FACTORS : array ( RTEMS.UNSIGNED32 range 0 .. 9 ) of - RTEMS.UNSIGNED32; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- FIRST_FP_TASK --- --- DESCRIPTION: --- --- This RTEMS task tests the restart and deletion of floating point tasks. --- - - procedure FIRST_FP_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, FIRST_FP_TASK); - --- --- FP_TASK --- --- DESCRIPTION: --- --- This RTEMS task tests the basic capabilities of a floating point --- task. --- - - procedure FP_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, FP_TASK); - --- --- TASK_1 --- --- DESCRIPTION: --- --- This RTEMS task provides a non-floating point task to test --- that an application can utilize a mixture of floating point --- and non-floating point tasks. --- - - procedure TASK_1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_1); - --- --- Add_Float --- --- DESCRIPTION: --- --- This method ensures the compilers thinks we are using the variables. --- - - function Add_Float( - n : in Float; - factor : in Float - ) return Float; - pragma Interface (C, Add_Float); - pragma Interface_Name (Add_Float, "add_float"); - -end SPTEST; diff --git a/c/src/ada-tests/sptests/sp20/Makefile.am b/c/src/ada-tests/sptests/sp20/Makefile.am deleted file mode 100644 index 24628b8122..0000000000 --- a/c/src/ada-tests/sptests/sp20/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_sp20 -ada_sp20_SOURCES = sp20.adb config.h sptest.adb sptest.ads -ada_sp20_SOURCES += ../../support/init.c - -ada_sp20$(EXEEXT): sp20.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_sp20.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/sptests/sp20/ada_sp20.scn b/c/src/ada-tests/sptests/sp20/ada_sp20.scn deleted file mode 100644 index 5411361d76..0000000000 --- a/c/src/ada-tests/sptests/sp20/ada_sp20.scn +++ /dev/null @@ -1,40 +0,0 @@ -*** TEST 20 *** -TA1 - rate_monotonic_create id = 16#42010001# -TA1 - rate_monotonic_ident id = 16#42010001# -TA1 - (16#42010001#) period 2 -TA2 - rate_monotonic_create id = 16#42010002# -TA2 - rate_monotonic_ident id = 16#42010002# -TA2 - (16#42010002#) period 2 -TA3 - rate_monotonic_create id = 16#42010003# -TA3 - rate_monotonic_ident id = 16#42010003# -TA3 - (16#42010003#) period 2 -TA4 - rate_monotonic_create id = 16#42010004# -TA4 - rate_monotonic_ident id = 16#42010004# -TA4 - (16#42010004#) period 2 -TA5 - rate_monotonic_create id = 16#42010005# -TA5 - rate_monotonic_ident id = 16#42010005# -TA5 - (16#42010005#) period 100 -TA6 - rate_monotonic_create id = 16#42010006# -TA6 - rate_monotonic_ident id = 16#42010006# -TA6 - (16#42010006#) period 0 -TA5 - PERIODS CHECK OK (1) -TA5 - PERIODS CHECK OK (2) -TA5 - PERIODS CHECK OK (3) -TA5 - PERIODS CHECK OK (4) -TA5 - PERIODS CHECK OK (5) -TA6 - Actual: 10 Expected: 10 - OK -TA6 - Actual: 20 Expected: 20 - OK -TA6 - Actual: 30 Expected: 30 - OK -TA6 - Actual: 40 Expected: 40 - OK -TA6 - Actual: 50 Expected: 50 - OK -TA6 - Actual: 60 Expected: 60 - OK -TA6 - Actual: 70 Expected: 70 - OK -TA6 - Actual: 80 Expected: 80 - OK -TA6 - Actual: 90 Expected: 90 - OK -TA6 - Actual: 100 Expected: 100 - OK -TA5 - PERIODS CHECK OK (6) -TA5 - PERIODS CHECK OK (7) -TA5 - PERIODS CHECK OK (8) -TA5 - PERIODS CHECK OK (9) -TA5 - PERIODS CHECK OK (10) -*** END OF TEST 20 *** diff --git a/c/src/ada-tests/sptests/sp20/config.h b/c/src/ada-tests/sptests/sp20/config.h deleted file mode 100644 index daf598bf4c..0000000000 --- a/c/src/ada-tests/sptests/sp20/config.h +++ /dev/null @@ -1,31 +0,0 @@ -/* 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 7 -#define CONFIGURE_MAXIMUM_PERIODS 10 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/sptests/sp20/sp20.adb b/c/src/ada-tests/sptests/sp20/sp20.adb deleted file mode 100644 index 898b96c119..0000000000 --- a/c/src/ada-tests/sptests/sp20/sp20.adb +++ /dev/null @@ -1,54 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test SP20 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 SP20 is - INIT_ID : RTEMS.ID; - STATUS : RTEMS.STATUS_CODES; -begin - - RTEMS.TASKS.CREATE( - RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ), - 10, - RTEMS.MINIMUM_STACK_SIZE, - RTEMS.DEFAULT_MODES, - 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 SP20; - diff --git a/c/src/ada-tests/sptests/sp20/sptest.adb b/c/src/ada-tests/sptests/sp20/sptest.adb deleted file mode 100644 index 1929fd958f..0000000000 --- a/c/src/ada-tests/sptests/sp20/sptest.adb +++ /dev/null @@ -1,310 +0,0 @@ --- --- SPTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 20 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 INTERFACES; use INTERFACES; -with TEST_SUPPORT; -with TEXT_IO; -with UNSIGNED32_IO; -with RTEMS.CLOCK; -with RTEMS.RATE_MONOTONIC; - -package body SPTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TEST 20 ***" ); - - SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); - SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' ); - SPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' ); - SPTEST.TASK_NAME( 4 ) := RTEMS.BUILD_NAME( 'T', 'A', '4', ' ' ); - SPTEST.TASK_NAME( 5 ) := RTEMS.BUILD_NAME( 'T', 'A', '5', ' ' ); - SPTEST.TASK_NAME( 6 ) := RTEMS.BUILD_NAME( 'T', 'A', '6', ' ' ); - - for INDEX in 1 .. 6 - loop - - SPTEST.COUNT( INDEX ) := 0; - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( INDEX ), - SPTEST.PRIORITIES( INDEX ), - 4096, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( INDEX ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); - - end loop; - - for INDEX in 1 .. 6 - loop - - RTEMS.TASKS.START( - SPTEST.TASK_ID( INDEX ), - SPTEST.TASK_1_THROUGH_6'ACCESS, - RTEMS.TASKS.ARGUMENT( INDEX ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); - - end loop; - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- TASK_1_THROUGH_6 --- - - procedure TASK_1_THROUGH_6 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - RMID : RTEMS.ID; - TEST_RMID : RTEMS.ID; - PASS : RTEMS.UNSIGNED32; - FAILED : RTEMS.UNSIGNED32; - STATUS : RTEMS.STATUS_CODES; - TIME : array( 0 .. 10 ) of RTEMS.INTERVAL; - PERIOD : RTEMS.INTERVAL; - MEASURE : RTEMS.INTERVAL; - begin - - RTEMS.RATE_MONOTONIC.CREATE( ARGUMENT, RMID, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "RATE_MONOTONIC_CREATE" ); - TEST_SUPPORT.PUT_NAME( SPTEST.TASK_NAME( INTEGER( ARGUMENT ) ), FALSE ); - TEXT_IO.PUT( "- rate_monotonic_create id = " ); - UNSIGNED32_IO.PUT( RMID, WIDTH => 8, BASE => 16 ); - TEXT_IO.NEW_LINE; - - RTEMS.RATE_MONOTONIC.IDENT( ARGUMENT, TEST_RMID, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "RATE_MONOTONIC_IDENT" ); - TEST_SUPPORT.PUT_NAME( SPTEST.TASK_NAME( INTEGER( ARGUMENT ) ), FALSE ); - TEXT_IO.PUT( "- rate_monotonic_ident id = " ); - UNSIGNED32_IO.PUT( RMID, WIDTH => 8, BASE => 16 ); - TEXT_IO.NEW_LINE; - if TEST_RMID /= RMID then - TEXT_IO.PUT_LINE( "RMID's DO NOT MATCH!!!" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - end if; - - TEST_SUPPORT.PUT_NAME( SPTEST.TASK_NAME( INTEGER( ARGUMENT ) ), FALSE ); - TEXT_IO.PUT( " - (" ); - UNSIGNED32_IO.PUT( RMID, WIDTH => 1, BASE => 16 ); - TEXT_IO.PUT( ") period " ); - UNSIGNED32_IO.PUT( - SPTEST.PERIODS( INTEGER( ARGUMENT ) ), - WIDTH => 1, - BASE => 10 - ); - TEXT_IO.NEW_LINE; - - RTEMS.TASKS.WAKE_AFTER( 2, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - case ARGUMENT is - when 1 .. 4 => - loop - RTEMS.RATE_MONOTONIC.PERIOD( - RMID, - SPTEST.PERIODS( INTEGER( ARGUMENT ) ), - STATUS - ); - - TEST_SUPPORT.DIRECTIVE_FAILED( - STATUS, - "RATE_MONOTONIC_PERIOD" - ); - - SPTEST.COUNT( INTEGER( ARGUMENT ) ) := - SPTEST.COUNT( INTEGER( ARGUMENT ) ) + 1; - - end loop; - - when 5 => - - PASS := 0; - FAILED := 0; - - RTEMS.RATE_MONOTONIC.PERIOD( - RMID, - SPTEST.PERIODS( INTEGER( ARGUMENT ) ), - STATUS - ); - - TEST_SUPPORT.DIRECTIVE_FAILED( - STATUS, - "RATE_MONOTONIC_PERIOD 1 OF TA5" - ); - - SPTEST.GET_ALL_COUNTERS; - - loop - - RTEMS.RATE_MONOTONIC.PERIOD( - RMID, - SPTEST.PERIODS( INTEGER( ARGUMENT ) ), - STATUS - ); - - TEST_SUPPORT.DIRECTIVE_FAILED( - STATUS, - "RATE_MONOTONIC_PERIOD 2 OF TA5" - ); - - SPTEST.GET_ALL_COUNTERS; - - for INDEX in 1 .. 4 loop - - if SPTEST.TEMPORARY_COUNT( INDEX ) /= - SPTEST.ITERATIONS( INDEX ) then - - TEXT_IO.PUT( "FAIL -- " ); - TEST_SUPPORT.PUT_NAME( - SPTEST.TASK_NAME( INDEX ), - FALSE - ); - TEXT_IO.PUT( "ACTUAL=" ); - UNSIGNED32_IO.PUT( - SPTEST.TEMPORARY_COUNT( INDEX ), - WIDTH => 3, - BASE => 10 - ); - TEXT_IO.PUT( " EXPECTED=" ); - UNSIGNED32_IO.PUT( - SPTEST.ITERATIONS( INDEX ), - WIDTH => 3, - BASE => 10 - ); - TEXT_IO.NEW_LINE; - - FAILED := FAILED + 1; - - end if; - - end loop; - - if FAILED = 5 then - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - end if; - - PASS := PASS + 1; - TEXT_IO.PUT( "TA5 - PERIODS CHECK OK (" ); - UNSIGNED32_IO.PUT( PASS, WIDTH => 1, BASE => 10 ); - TEXT_IO.PUT_LINE( ")" ); - - if PASS = 10 then - TEXT_IO.PUT_LINE( "*** END OF TEST 20 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - end if; - - end loop; - - when 6 => - -- test changing periods - for INDEX in 0 .. 10 loop - PERIOD := RTEMS.INTERVAL( ( INDEX + 1 ) * 10 ); - RTEMS.RATE_MONOTONIC.PERIOD( RMID, PERIOD, STATUS); - TEST_SUPPORT.DIRECTIVE_FAILED( - STATUS, "rate_monotonic_period of TA6" - ); - - -- timestamp - Time( INDEX ) := RTEMS.CLOCK.GET_TICKS_SINCE_BOOT; - end loop; - - for INDEX in 1 .. 10 loop - MEASURE := TIME( INDEX ) - TIME( INDEX - 1 ); - PERIOD := RTEMS.INTERVAL( INDEX * 10 ); - TEXT_IO.PUT( "TA6 - Actual: " ); - UNSIGNED32_IO.PUT( MEASURE, WIDTH => 3, BASE => 10 ); - TEXT_IO.PUT( " Expected: " ); - UNSIGNED32_IO.PUT( PERIOD, WIDTH => 3, BASE => 10 ); - if PERIOD = MEASURE then - TEXT_IO.PUT_LINE( " - OK" ); - else - TEXT_IO.PUT_LINE( " - FAILED" ); - end if; - end loop; - - RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( - STATUS, "task_suspend of TA6" - ); - - when others => - NULL; - - end case; - - end TASK_1_THROUGH_6; - --- --- GET_ALL_COUNTERS --- - - procedure GET_ALL_COUNTERS - is - PREVIOUS_MODE : RTEMS.MODE; - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.TASKS.MODE( - RTEMS.NO_PREEMPT, - RTEMS.PREEMPT_MASK, - PREVIOUS_MODE, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE TO NO_PREEMPT" ); - - SPTEST.TEMPORARY_COUNT := SPTEST.COUNT; - - for INDEX in 1 .. 5 - loop - - SPTEST.COUNT( INDEX ) := 0; - - end loop; - - RTEMS.TASKS.MODE( - RTEMS.PREEMPT, - RTEMS.PREEMPT_MASK, - PREVIOUS_MODE, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE TO PREEMPT" ); - - end GET_ALL_COUNTERS; - -end SPTEST; diff --git a/c/src/ada-tests/sptests/sp20/sptest.ads b/c/src/ada-tests/sptests/sp20/sptest.ads deleted file mode 100644 index 384cc1dac5..0000000000 --- a/c/src/ada-tests/sptests/sp20/sptest.ads +++ /dev/null @@ -1,105 +0,0 @@ --- --- SPTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 20 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; - -package SPTEST is - --- --- These arrays contain the IDs and NAMEs of all RTEMS tasks created --- by this test. --- - - TASK_ID : array ( 1 .. 6 ) of RTEMS.ID; - TASK_NAME : array ( 1 .. 6 ) of RTEMS.NAME; - --- --- These arrays contain the parameters which define the execution --- characteristics and periods of each instantiation of the --- copies of the RTEMS task TASKS_1_THROUGH_6. --- - - PERIODS : constant array ( 1 .. 6 ) - of RTEMS.UNSIGNED32 := ( 2, 2, 2, 2, 100, 0 ); - - ITERATIONS : constant array ( 1 .. 6 ) - of RTEMS.UNSIGNED32 := ( 50, 50, 50, 50, 1, 10 ); - - PRIORITIES : constant array ( 1 .. 6 ) - of RTEMS.UNSIGNED32 := ( 1, 1, 3, 4, 5, 1 ); - --- --- The following type defines the array used to manage the --- execution counts of each task's period. --- - - type COUNT_ARRAY is array ( 1 .. 6 ) of RTEMS.UNSIGNED32; - --- --- These arrays contains the number of periods successfully completed --- by each of the tasks. At each of its periods, the fifth task --- will copy the contents of the COUNT array to TEMPORARY_COUNT, --- and clear the COUNT array. The copy is performed to insure --- that no periods fire while it is verifying the correctness --- of the test's execution. --- - - COUNT : SPTEST.COUNT_ARRAY; - TEMPORARY_COUNT : SPTEST.COUNT_ARRAY; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- TASK_1_THROUGH_6 --- --- DESCRIPTION: --- --- These RTEMS tasks test the Rate Monotonic Manager. --- - - procedure TASK_1_THROUGH_6 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_1_THROUGH_6); - --- --- GET_ALL_COUNTERS --- --- DESCRIPTION: --- --- This subprogram atomically copies the contents of COUNTER to --- TEMPORARY_COUNTER. --- - - procedure GET_ALL_COUNTERS; - -end SPTEST; diff --git a/c/src/ada-tests/sptests/sp22/Makefile.am b/c/src/ada-tests/sptests/sp22/Makefile.am deleted file mode 100644 index 168d23befb..0000000000 --- a/c/src/ada-tests/sptests/sp22/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_sp22 -ada_sp22_SOURCES = sp22.adb config.h sptest.adb sptest.ads -ada_sp22_SOURCES += ../../support/init.c - -ada_sp22$(EXEEXT): sp22.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_sp22.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/sptests/sp22/ada_sp22.scn b/c/src/ada-tests/sptests/sp22/ada_sp22.scn deleted file mode 100644 index 3e96936e24..0000000000 --- a/c/src/ada-tests/sptests/sp22/ada_sp22.scn +++ /dev/null @@ -1,29 +0,0 @@ -*** TEST 22 *** -INIT - timer_create - creating timer 1 -INIT - timer 1 has id (16#12010001#) -TA1 - timer_ident - identing timer 1 -TA1 - timer 1 has id (16#12010001#) -TA1 - clock_get - 9: 0: 0 12/31/1988 -TA1 - timer_after - timer 1 in 3 seconds -TA1 - task_suspend( SELF ) -TA1 - clock_get - 9: 0: 3 12/31/1988 -TA1 - timer_after - timer 1 in 3 seconds -TA1 - task_wake_after - 1 second -TA1 - clock_get - 9: 0: 4 12/31/1988 -TA1 - timer_reset - timer 1 -TA1 - task_suspend( SELF ) -TA1 - clock_get - 9: 0: 7 12/31/1988 - -TA1 - timer_after - timer 1 in 3 seconds -TA1 - timer_cancel - timer 1 -TA1 - clock_get - 9: 0: 7 12/31/1988 -TA1 - timer_when - timer 1 in 3 seconds -TA1 - task_suspend( SELF ) -TA1 - clock_get - 9: 0:10 12/31/1988 -TA1 - timer_when - timer 1 in 3 seconds -TA1 - task_wake_after - 1 second -TA1 - clock_get - 9: 0:11 12/31/1988 -TA1 - timer_cancel - timer 1 -TA1 - task_wake_after - YIELD (only task at priority) -TA1 - timer_delete - timer 1 -*** END OF TEST 22 *** diff --git a/c/src/ada-tests/sptests/sp22/config.h b/c/src/ada-tests/sptests/sp22/config.h deleted file mode 100644 index b8ed5c97d0..0000000000 --- a/c/src/ada-tests/sptests/sp22/config.h +++ /dev/null @@ -1,31 +0,0 @@ -/* 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_TIMERS 2 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/sptests/sp22/sp22.adb b/c/src/ada-tests/sptests/sp22/sp22.adb deleted file mode 100644 index 842bc7338e..0000000000 --- a/c/src/ada-tests/sptests/sp22/sp22.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test SP22 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 SP22 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 SP22; - diff --git a/c/src/ada-tests/sptests/sp22/sptest.adb b/c/src/ada-tests/sptests/sp22/sptest.adb deleted file mode 100644 index a947628db5..0000000000 --- a/c/src/ada-tests/sptests/sp22/sptest.adb +++ /dev/null @@ -1,297 +0,0 @@ --- --- SPTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 22 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 INTERFACES; use INTERFACES; -with TEST_SUPPORT; -with TEXT_IO; -with UNSIGNED32_IO; -with RTEMS.CLOCK; -with RTEMS.TIMER; - -package body SPTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - TIME : RTEMS.TIME_OF_DAY; - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TEST 22 ***" ); - - TIME := ( 1988, 12, 31, 9, 0, 0, 0 ); - - RTEMS.CLOCK.SET( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET" ); - - SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); - SPTEST.TIMER_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'M', '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" ); - - TEXT_IO.PUT_LINE( "INIT - timer_create - creating timer 1" ); - RTEMS.TIMER.CREATE( - SPTEST.TIMER_NAME( 1 ), - SPTEST.TIMER_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE OF TM1" ); - TEXT_IO.PUT( "INIT - timer 1 has id (" ); - UNSIGNED32_IO.PUT( SPTEST.TIMER_ID( 1 ), WIDTH => 8, BASE => 16 ); - TEXT_IO.PUT_LINE( ")" ); - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- DELAYED_RESUME --- - - procedure DELAYED_RESUME ( - IGNORED_ID : in RTEMS.ID; - IGNORED_ADDRESS : in RTEMS.ADDRESS - ) is - pragma Unreferenced(IGNORED_ID); - pragma Unreferenced(IGNORED_ADDRESS); - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.TASKS.RESUME( SPTEST.TASK_ID( 1 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESUME OF SELF" ); - - end DELAYED_RESUME; - --- --- PRINT_TIME --- - - procedure PRINT_TIME - is - TIME : RTEMS.TIME_OF_DAY; - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.CLOCK.GET_TOD( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); - - TEST_SUPPORT.PUT_NAME( - SPTEST.TASK_NAME( 1 ), - FALSE - ); - - TEST_SUPPORT.PRINT_TIME( "- clock_get - ", TIME, "" ); - TEXT_IO.NEW_LINE; - - end PRINT_TIME; - --- --- TASK_1 --- - - procedure TASK_1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - TMID : RTEMS.ID; - TIME : RTEMS.TIME_OF_DAY; - STATUS : RTEMS.STATUS_CODES; - begin - --- GET ID - - TEXT_IO.PUT_LINE( "TA1 - timer_ident - identing timer 1" ); - RTEMS.TIMER.IDENT( SPTEST.TIMER_NAME( 1 ), TMID, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_IDENT OF TM1" ); - TEXT_IO.PUT( "TA1 - timer 1 has id (" ); - UNSIGNED32_IO.PUT( SPTEST.TIMER_ID( 1 ), WIDTH => 8, BASE => 16 ); - TEXT_IO.PUT_LINE( ")" ); - --- AFTER WHICH IS ALLOWED TO FIRE - - SPTEST.PRINT_TIME; - - TEXT_IO.PUT_LINE( "TA1 - timer_after - timer 1 in 3 seconds" ); - RTEMS.TIMER.FIRE_AFTER( - TMID, - 3 * TEST_SUPPORT.TICKS_PER_SECOND, - SPTEST.DELAYED_RESUME'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER" ); - - TEXT_IO.PUT_LINE( "TA1 - task_suspend( SELF )" ); - RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND" ); - - SPTEST.PRINT_TIME; - --- AFTER WHICH IS RESET AND ALLOWED TO FIRE - - TEXT_IO.PUT_LINE( "TA1 - timer_after - timer 1 in 3 seconds" ); - RTEMS.TIMER.FIRE_AFTER( - TMID, - 3 * TEST_SUPPORT.TICKS_PER_SECOND, - SPTEST.DELAYED_RESUME'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER" ); - - TEXT_IO.PUT_LINE( "TA1 - task_wake_after - 1 second" ); - RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - SPTEST.PRINT_TIME; - - TEXT_IO.PUT_LINE( "TA1 - timer_reset - timer 1" ); - RTEMS.TIMER.RESET( TMID, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_RESET" ); - - TEXT_IO.PUT_LINE( "TA1 - task_suspend( SELF )" ); - RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND" ); - - SPTEST.PRINT_TIME; - -TEST_SUPPORT.PAUSE; - --- --- Reset the time since we do not know how long the user waited --- before pressing at the pause. This insures that the --- actual output matches the screen. --- - - TIME := ( 1988, 12, 31, 9, 0, 7, 0 ); - - RTEMS.CLOCK.SET( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET" ); - --- after which is canceled - - TEXT_IO.PUT_LINE( "TA1 - timer_after - timer 1 in 3 seconds" ); - RTEMS.TIMER.FIRE_AFTER( - TMID, - 3 * TEST_SUPPORT.TICKS_PER_SECOND, - SPTEST.DELAYED_RESUME'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER" ); - - TEXT_IO.PUT_LINE( "TA1 - timer_cancel - timer 1" ); - RTEMS.TIMER.CANCEL( TMID, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CANCEL" ); - --- when which is allowed to fire - - SPTEST.PRINT_TIME; - - RTEMS.CLOCK.GET_TOD( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); - - TIME.SECOND := TIME.SECOND + 3; - - TEXT_IO.PUT_LINE( "TA1 - timer_when - timer 1 in 3 seconds" ); - RTEMS.TIMER.FIRE_WHEN( - TMID, - TIME, - SPTEST.DELAYED_RESUME'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_WHEN" ); - - TEXT_IO.PUT_LINE( "TA1 - task_suspend( SELF )" ); - RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND" ); - - SPTEST.PRINT_TIME; - --- when which is canceled - - RTEMS.CLOCK.GET_TOD( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); - - TIME.SECOND := TIME.SECOND + 3; - - TEXT_IO.PUT_LINE( "TA1 - timer_when - timer 1 in 3 seconds" ); - RTEMS.TIMER.FIRE_WHEN( - TMID, - TIME, - SPTEST.DELAYED_RESUME'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_WHEN" ); - - TEXT_IO.PUT_LINE( "TA1 - task_wake_after - 1 second" ); - RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - SPTEST.PRINT_TIME; - - TEXT_IO.PUT_LINE( "TA1 - timer_cancel - timer 1" ); - RTEMS.TIMER.CANCEL( TMID, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CANCEL" ); - --- delete - - TEXT_IO.PUT_LINE( - "TA1 - task_wake_after - YIELD (only task at priority)" - ); - RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER YIELD" ); - - TEXT_IO.PUT_LINE( "TA1 - timer_delete - timer 1" ); - RTEMS.TIMER.DELETE( TMID, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_DELETE" ); - - TEXT_IO.PUT_LINE( "*** END OF TEST 22 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end TASK_1; - -end SPTEST; diff --git a/c/src/ada-tests/sptests/sp22/sptest.ads b/c/src/ada-tests/sptests/sp22/sptest.ads deleted file mode 100644 index af312fafb8..0000000000 --- a/c/src/ada-tests/sptests/sp22/sptest.ads +++ /dev/null @@ -1,93 +0,0 @@ --- --- SPTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 22 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; - -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 timers created --- by this test. --- - - TIMER_ID : array ( RTEMS.UNSIGNED32 range 1 .. 1 ) of RTEMS.ID; - TIMER_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 1 ) of RTEMS.NAME; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- DELAYED_RESUME --- --- DESCRIPTION: --- --- This subprogram is scheduled to be fired as a timer service --- routine. When fired this subprogram resumes TASK_1. --- - - procedure DELAYED_RESUME ( - IGNORED_ID : in RTEMS.ID; - IGNORED_ADDRESS : in RTEMS.ADDRESS - ); - pragma Convention (C, DELAYED_RESUME); - --- --- PRINT_TIME --- --- DESCRIPTION: --- --- This subprogram prints the name of TASK_1 and the current TIME of day. --- - - procedure PRINT_TIME; - --- --- TASK_1 --- --- DESCRIPTION: --- --- This RTEMS task tests the Timer Manager. --- - - procedure TASK_1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_1); - -end SPTEST; diff --git a/c/src/ada-tests/sptests/sp23/Makefile.am b/c/src/ada-tests/sptests/sp23/Makefile.am deleted file mode 100644 index c4823a817d..0000000000 --- a/c/src/ada-tests/sptests/sp23/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/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)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/sptests/sp23/ada_sp23.scn b/c/src/ada-tests/sptests/sp23/ada_sp23.scn deleted file mode 100644 index 2fc1e74582..0000000000 --- a/c/src/ada-tests/sptests/sp23/ada_sp23.scn +++ /dev/null @@ -1,9 +0,0 @@ -*** 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/c/src/ada-tests/sptests/sp23/config.h b/c/src/ada-tests/sptests/sp23/config.h deleted file mode 100644 index 277e38b708..0000000000 --- a/c/src/ada-tests/sptests/sp23/config.h +++ /dev/null @@ -1,31 +0,0 @@ -/* 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 - -/* end of include file */ diff --git a/c/src/ada-tests/sptests/sp23/sp23.adb b/c/src/ada-tests/sptests/sp23/sp23.adb deleted file mode 100644 index 5a6a728e1d..0000000000 --- a/c/src/ada-tests/sptests/sp23/sp23.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- 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/c/src/ada-tests/sptests/sp23/sptest.adb b/c/src/ada-tests/sptests/sp23/sptest.adb deleted file mode 100644 index e3a2871ab6..0000000000 --- a/c/src/ada-tests/sptests/sp23/sptest.adb +++ /dev/null @@ -1,175 +0,0 @@ --- --- 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/c/src/ada-tests/sptests/sp23/sptest.ads b/c/src/ada-tests/sptests/sp23/sptest.ads deleted file mode 100644 index b5faf7b87a..0000000000 --- a/c/src/ada-tests/sptests/sp23/sptest.ads +++ /dev/null @@ -1,118 +0,0 @@ --- --- 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; diff --git a/c/src/ada-tests/sptests/sp24/Makefile.am b/c/src/ada-tests/sptests/sp24/Makefile.am deleted file mode 100644 index 044faae303..0000000000 --- a/c/src/ada-tests/sptests/sp24/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_sp24 -ada_sp24_SOURCES = sp24.adb config.h sptest.adb sptest.ads -ada_sp24_SOURCES += ../../support/init.c - -ada_sp24$(EXEEXT): sp24.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_sp24.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/sptests/sp24/ada_sp24.scn b/c/src/ada-tests/sptests/sp24/ada_sp24.scn deleted file mode 100644 index eb626eb6b2..0000000000 --- a/c/src/ada-tests/sptests/sp24/ada_sp24.scn +++ /dev/null @@ -1,16 +0,0 @@ -*** TEST 24 *** -TA1 - clock_get - 9: 0: 0 12/31/1988 -TA2 - clock_get - 9: 0: 0 12/31/1988 -TA3 - clock_get - 9: 0: 0 12/31/1988 -TA1 - clock_get - 9: 0: 5 12/31/1988 -TA1 - clock_get - 9: 0:10 12/31/1988 -TA2 - clock_get - 9: 0:10 12/31/1988 -TA1 - clock_get - 9: 0:15 12/31/1988 -TA3 - clock_get - 9: 0:15 12/31/1988 -TA1 - clock_get - 9: 0:20 12/31/1988 -TA2 - clock_get - 9: 0:20 12/31/1988 -TA1 - clock_get - 9: 0:25 12/31/1988 -TA1 - clock_get - 9: 0:30 12/31/1988 -TA3 - clock_get - 9: 0:30 12/31/1988 -TA2 - clock_get - 9: 0:30 12/31/1988 -*** END OF TEST 24 *** diff --git a/c/src/ada-tests/sptests/sp24/config.h b/c/src/ada-tests/sptests/sp24/config.h deleted file mode 100644 index a72dd35dac..0000000000 --- a/c/src/ada-tests/sptests/sp24/config.h +++ /dev/null @@ -1,31 +0,0 @@ -/* 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 4 -#define CONFIGURE_MAXIMUM_TIMERS 3 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/sptests/sp24/sp24.adb b/c/src/ada-tests/sptests/sp24/sp24.adb deleted file mode 100644 index e56802640b..0000000000 --- a/c/src/ada-tests/sptests/sp24/sp24.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test SP24 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 SP24 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 SP24; - diff --git a/c/src/ada-tests/sptests/sp24/sptest.adb b/c/src/ada-tests/sptests/sp24/sptest.adb deleted file mode 100644 index 4245036995..0000000000 --- a/c/src/ada-tests/sptests/sp24/sptest.adb +++ /dev/null @@ -1,167 +0,0 @@ --- --- SPTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 24 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 INTERFACES; use INTERFACES; -with TEST_SUPPORT; -with TEXT_IO; -with RTEMS.CLOCK; -with RTEMS.TIMER; - -package body SPTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - TIME : RTEMS.TIME_OF_DAY; - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TEST 24 ***" ); - - TIME := ( 1988, 12, 31, 9, 0, 0, 0 ); - - RTEMS.CLOCK.SET( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET" ); - - SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); - SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' ); - SPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' ); - - SPTEST.TIMER_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'M', '1', ' ' ); - SPTEST.TIMER_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'M', '2', ' ' ); - SPTEST.TIMER_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'M', '3', ' ' ); - - for INDEX in 1 .. 3 - loop - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( INDEX ), - 1, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.TASK_ID( INDEX ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); - - RTEMS.TIMER.CREATE( - SPTEST.TIMER_NAME( INDEX ), - SPTEST.TIMER_ID( INDEX ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE LOOP" ); - - end loop; - - for INDEX in 1 .. 3 - loop - - RTEMS.TASKS.START( - SPTEST.TASK_ID( INDEX ), - SPTEST.TASK_1_THROUGH_3'ACCESS, - RTEMS.TASKS.ARGUMENT( INDEX ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); - - end loop; - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- RESUME_TASK --- - - procedure RESUME_TASK ( - TIMER_ID : in RTEMS.ID; - IGNORED_ADDRESS : in RTEMS.ADDRESS - ) is - pragma Unreferenced(IGNORED_ADDRESS); - TASK_TO_RESUME : RTEMS.ID; - STATUS : RTEMS.STATUS_CODES; - begin - - TASK_TO_RESUME := SPTEST.TASK_ID(INTEGER( RTEMS.GET_INDEX( TIMER_ID ) )); - RTEMS.TASKS.RESUME( TASK_TO_RESUME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESUME" ); - - end RESUME_TASK; - --- --- TASK_1_THROUGH_3 --- - - procedure TASK_1_THROUGH_3 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - TID : RTEMS.ID; - TIME : RTEMS.TIME_OF_DAY; - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.TASKS.IDENT( RTEMS.SELF, RTEMS.SEARCH_ALL_NODES, TID, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF SELF" ); - - loop - - RTEMS.TIMER.FIRE_AFTER( - SPTEST.TIMER_ID( INTEGER( ARGUMENT ) ), - TEST_SUPPORT.TASK_NUMBER( TID ) * 5 * - TEST_SUPPORT.TICKS_PER_SECOND, - SPTEST.RESUME_TASK'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER" ); - - RTEMS.CLOCK.GET_TOD( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); - - if TIME.SECOND >= 35 then - TEXT_IO.PUT_LINE( "*** END OF TEST 24 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - end if; - - TEST_SUPPORT.PUT_NAME( - SPTEST.TASK_NAME( INTEGER( TEST_SUPPORT.TASK_NUMBER( TID ) ) ), - FALSE - ); - - TEST_SUPPORT.PRINT_TIME( " - clock_get - ", TIME, "" ); - TEXT_IO.NEW_LINE; - - RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND" ); - - end loop; - - end TASK_1_THROUGH_3; - -end SPTEST; diff --git a/c/src/ada-tests/sptests/sp24/sptest.ads b/c/src/ada-tests/sptests/sp24/sptest.ads deleted file mode 100644 index 166ee812b3..0000000000 --- a/c/src/ada-tests/sptests/sp24/sptest.ads +++ /dev/null @@ -1,83 +0,0 @@ --- --- SPTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 24 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; - -package SPTEST is - --- --- These arrays contain the IDs and NAMEs of all RTEMS tasks created --- by this test. --- - - TASK_ID : array ( 1 .. 3 ) of RTEMS.ID; - TASK_NAME : array ( 1 .. 3 ) of RTEMS.NAME; - --- --- These arrays contain the IDs and NAMEs of all RTEMS timers created --- by this test. --- - - TIMER_ID : array ( 1 .. 3 ) of RTEMS.ID; - TIMER_NAME : array ( 1 .. 3 ) of RTEMS.NAME; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- RESUME_TASK --- --- DESCRIPTION: --- --- This subprogram is scheduled as a timer service routine. When --- it fires it resumes the task which is mapped to this timer. --- - - procedure RESUME_TASK ( - TIMER_ID : in RTEMS.ID; - IGNORED_ADDRESS : in RTEMS.ADDRESS - ); - pragma Convention (C, RESUME_TASK); - --- --- TASK_1_THROUGH_3 --- --- DESCRIPTION: --- --- This RTEMS task tests the Timer Manager. --- - - procedure TASK_1_THROUGH_3 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_1_THROUGH_3); - -end SPTEST; diff --git a/c/src/ada-tests/sptests/sp25/Makefile.am b/c/src/ada-tests/sptests/sp25/Makefile.am deleted file mode 100644 index e5a25e495c..0000000000 --- a/c/src/ada-tests/sptests/sp25/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_sp25 -ada_sp25_SOURCES = sp25.adb config.h sptest.adb sptest.ads -ada_sp25_SOURCES += ../../support/init.c - -ada_sp25$(EXEEXT): sp25.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_sp25.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/sptests/sp25/ada_sp25.scn b/c/src/ada-tests/sptests/sp25/ada_sp25.scn deleted file mode 100644 index bb568001ac..0000000000 --- a/c/src/ada-tests/sptests/sp25/ada_sp25.scn +++ /dev/null @@ -1,29 +0,0 @@ -*** TEST 25 *** -TA1 - region_ident - rnid => 16#32010001# -TA1 - region_get_segment - wait on 64 byte segment from region 1 -TA1 - got segment from region 1 - 16#10# -TA1 - region_get_segment - wait on 128 byte segment from region 1 -TA1 - got segment from region 1 - 16#70# -TA1 - region_get_segment - wait on 256 byte segment from region 1 -TA1 - got segment from region 1 - 16#110# -TA1 - region_get_segment - wait on 512 byte segment from region 1 -TA1 - got segment from region 1 - 16#230# -TA1 - region_get_segment - wait on 1024 byte segment from region 1 -TA1 - got segment from region 1 - 16#450# -TA1 - region_get_segment - wait on 2048 byte segment from region 1 -TA1 - got segment from region 1 - 16#870# -TA1 - region_get_segment - wait on 4096 byte segment from region 1 -TA1 - got segment from region 1 - 16#1090# -TA1 - region_get_segment - wait on 8192 byte segment from region 1 -TA1 - got segment from region 1 - 16#20B0# - -TA1 - region_return_segment - return segment to region 1 - 16#110# -TA1 - region_return_segment - return segment to region 1 - 16#230# -TA1 - region_return_segment - return segment to region 1 - 16#10# -TA1 - region_return_segment - return segment to region 1 - 16#70# -TA1 - region_return_segment - return segment to region 1 - 16#1090# -TA1 - region_return_segment - return segment to region 1 - 16#870# -TA1 - region_return_segment - return segment to region 1 - 16#20B0# -TA1 - region_return_segment - return segment to region 1 - 16#450# -TA1 - region_delete - walks heap if debug enabled -*** END OF TEST 25 *** diff --git a/c/src/ada-tests/sptests/sp25/config.h b/c/src/ada-tests/sptests/sp25/config.h deleted file mode 100644 index aa74afdd45..0000000000 --- a/c/src/ada-tests/sptests/sp25/config.h +++ /dev/null @@ -1,31 +0,0 @@ -/* 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_REGIONS 1 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/sptests/sp25/sp25.adb b/c/src/ada-tests/sptests/sp25/sp25.adb deleted file mode 100644 index 00db138fa9..0000000000 --- a/c/src/ada-tests/sptests/sp25/sp25.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test SP25 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 SP25 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 SP25; - diff --git a/c/src/ada-tests/sptests/sp25/sptest.adb b/c/src/ada-tests/sptests/sp25/sptest.adb deleted file mode 100644 index 1fb103e966..0000000000 --- a/c/src/ada-tests/sptests/sp25/sptest.adb +++ /dev/null @@ -1,362 +0,0 @@ --- --- SPTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 25 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 TEST_SUPPORT; -with TEXT_IO; -with UNSIGNED32_IO; -with RTEMS.REGION; - -package body SPTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TEST 25 ***" ); - - SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); - - RTEMS.TASKS.CREATE( - SPTEST.TASK_NAME( 1 ), - SPTEST.BASE_PRIORITY, - 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.REGION_NAME( 1 ) := RTEMS.BUILD_NAME( 'R', 'N', '1', ' ' ); - - RTEMS.REGION.CREATE( - SPTEST.REGION_NAME( 1 ), - SPTEST.AREA_1'ADDRESS, - 64000, - 32, - RTEMS.DEFAULT_ATTRIBUTES, - SPTEST.REGION_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_CREATE OF RN1" ); - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- PUT_ADDRESS_FROM_AREA_1 --- - - procedure PUT_ADDRESS_FROM_AREA_1 ( - TO_BE_PRINTED : in RTEMS.ADDRESS - ) is - - begin - - UNSIGNED32_IO.PUT( - RTEMS.SUBTRACT( TO_BE_PRINTED, SPTEST.AREA_1'ADDRESS ), - WIDTH => 8, - BASE => 16 - ); - - end PUT_ADDRESS_FROM_AREA_1; - --- --- TASK_1 --- - - procedure TASK_1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - RNID : RTEMS.ID; - SEGMENT_ADDRESS_1 : RTEMS.ADDRESS; - SEGMENT_ADDRESS_2 : RTEMS.ADDRESS; - SEGMENT_ADDRESS_3 : RTEMS.ADDRESS; - SEGMENT_ADDRESS_4 : RTEMS.ADDRESS; - SEGMENT_ADDRESS_5 : RTEMS.ADDRESS; - SEGMENT_ADDRESS_6 : RTEMS.ADDRESS; - SEGMENT_ADDRESS_7 : RTEMS.ADDRESS; - SEGMENT_ADDRESS_8 : RTEMS.ADDRESS; - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.REGION.IDENT( SPTEST.REGION_NAME( 1 ), RNID, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_IDENT OF RN1" ); - TEXT_IO.PUT( "TA1 - region_ident - rnid => " ); - UNSIGNED32_IO.PUT( RNID, WIDTH => 8, BASE => 16 ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT( "TA1 - region_get_segment - wait on " ); - TEXT_IO.PUT_LINE( "64 byte segment from region 1" ); - RTEMS.REGION.GET_SEGMENT( - SPTEST.REGION_ID( 1 ), - 64, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - SEGMENT_ADDRESS_1, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); - TEXT_IO.PUT( "TA1 - got segment from region 1 - " ); - SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_1 ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT( "TA1 - region_get_segment - wait on " ); - TEXT_IO.PUT_LINE( "128 byte segment from region 1" ); - RTEMS.REGION.GET_SEGMENT( - SPTEST.REGION_ID( 1 ), - 128, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - SEGMENT_ADDRESS_2, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); - TEXT_IO.PUT( "TA1 - got segment from region 1 - " ); - SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_2 ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT( "TA1 - region_get_segment - wait on " ); - TEXT_IO.PUT_LINE( "256 byte segment from region 1" ); - RTEMS.REGION.GET_SEGMENT( - SPTEST.REGION_ID( 1 ), - 256, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - SEGMENT_ADDRESS_3, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); - TEXT_IO.PUT( "TA1 - got segment from region 1 - " ); - SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_3 ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT( "TA1 - region_get_segment - wait on " ); - TEXT_IO.PUT_LINE( "512 byte segment from region 1" ); - RTEMS.REGION.GET_SEGMENT( - SPTEST.REGION_ID( 1 ), - 512, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - SEGMENT_ADDRESS_4, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); - TEXT_IO.PUT( "TA1 - got segment from region 1 - " ); - SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_4 ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT( "TA1 - region_get_segment - wait on " ); - TEXT_IO.PUT_LINE( "1024 byte segment from region 1" ); - RTEMS.REGION.GET_SEGMENT( - SPTEST.REGION_ID( 1 ), - 1024, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - SEGMENT_ADDRESS_5, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); - TEXT_IO.PUT( "TA1 - got segment from region 1 - " ); - SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_5 ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT( "TA1 - region_get_segment - wait on " ); - TEXT_IO.PUT_LINE( "2048 byte segment from region 1" ); - RTEMS.REGION.GET_SEGMENT( - SPTEST.REGION_ID( 1 ), - 2048, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - SEGMENT_ADDRESS_6, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); - TEXT_IO.PUT( "TA1 - got segment from region 1 - " ); - SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_6 ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT( "TA1 - region_get_segment - wait on " ); - TEXT_IO.PUT_LINE( "4096 byte segment from region 1" ); - RTEMS.REGION.GET_SEGMENT( - SPTEST.REGION_ID( 1 ), - 4096, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - SEGMENT_ADDRESS_7, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); - TEXT_IO.PUT( "TA1 - got segment from region 1 - " ); - SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_7 ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT( "TA1 - region_get_segment - wait on " ); - TEXT_IO.PUT_LINE( "8192 byte segment from region 1" ); - RTEMS.REGION.GET_SEGMENT( - SPTEST.REGION_ID( 1 ), - 8192, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - SEGMENT_ADDRESS_8, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); - TEXT_IO.PUT( "TA1 - got segment from region 1 - " ); - SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_8 ); - TEXT_IO.NEW_LINE; - -TEST_SUPPORT.PAUSE; - - TEXT_IO.PUT( - "TA1 - region_return_segment - return segment to region 1 - " - ); - SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_3 ); - RTEMS.REGION.RETURN_SEGMENT( - SPTEST.REGION_ID( 1 ), - SEGMENT_ADDRESS_3, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" ); - TEXT_IO.NEW_LINE; - -- SEGMENT_ADDRESS_3 := RTEMS.NULL_ADDRESS; - - TEXT_IO.PUT( - "TA1 - region_return_segment - return segment to region 1 - " - ); - SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_4 ); - RTEMS.REGION.RETURN_SEGMENT( - SPTEST.REGION_ID( 1 ), - SEGMENT_ADDRESS_4, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" ); - TEXT_IO.NEW_LINE; - -- SEGMENT_ADDRESS_4 := RTEMS.NULL_ADDRESS; - - TEXT_IO.PUT( - "TA1 - region_return_segment - return segment to region 1 - " - ); - SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_1 ); - RTEMS.REGION.RETURN_SEGMENT( - SPTEST.REGION_ID( 1 ), - SEGMENT_ADDRESS_1, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" ); - TEXT_IO.NEW_LINE; - -- SEGMENT_ADDRESS_1 := RTEMS.NULL_ADDRESS; - - TEXT_IO.PUT( - "TA1 - region_return_segment - return segment to region 1 - " - ); - SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_2 ); - RTEMS.REGION.RETURN_SEGMENT( - SPTEST.REGION_ID( 1 ), - SEGMENT_ADDRESS_2, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" ); - TEXT_IO.NEW_LINE; - -- SEGMENT_ADDRESS_2 := RTEMS.NULL_ADDRESS; - - TEXT_IO.PUT( - "TA1 - region_return_segment - return segment to region 1 - " - ); - SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_7 ); - RTEMS.REGION.RETURN_SEGMENT( - SPTEST.REGION_ID( 1 ), - SEGMENT_ADDRESS_7, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" ); - TEXT_IO.NEW_LINE; - -- SEGMENT_ADDRESS_7 := RTEMS.NULL_ADDRESS; - - TEXT_IO.PUT( - "TA1 - region_return_segment - return segment to region 1 - " - ); - SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_6 ); - RTEMS.REGION.RETURN_SEGMENT( - SPTEST.REGION_ID( 1 ), - SEGMENT_ADDRESS_6, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" ); - TEXT_IO.NEW_LINE; - -- SEGMENT_ADDRESS_6 := RTEMS.NULL_ADDRESS; - - TEXT_IO.PUT( - "TA1 - region_return_segment - return segment to region 1 - " - ); - SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_8 ); - RTEMS.REGION.RETURN_SEGMENT( - SPTEST.REGION_ID( 1 ), - SEGMENT_ADDRESS_8, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" ); - TEXT_IO.NEW_LINE; - -- SEGMENT_ADDRESS_8 := RTEMS.NULL_ADDRESS; - - TEXT_IO.PUT( - "TA1 - region_return_segment - return segment to region 1 - " - ); - SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_5 ); - RTEMS.REGION.RETURN_SEGMENT( - SPTEST.REGION_ID( 1 ), - SEGMENT_ADDRESS_5, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" ); - TEXT_IO.NEW_LINE; - -- SEGMENT_ADDRESS_5 := RTEMS.NULL_ADDRESS; - - TEXT_IO.PUT_LINE( - "TA1 - region_delete - walks heap if debug enabled" - ); - RTEMS.REGION.DELETE( SPTEST.REGION_ID( 1 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_DELETE OF RN1" ); - - TEXT_IO.PUT_LINE( "*** END OF TEST 25 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end TASK_1; - -end SPTEST; diff --git a/c/src/ada-tests/sptests/sp25/sptest.ads b/c/src/ada-tests/sptests/sp25/sptest.ads deleted file mode 100644 index 21c27a38db..0000000000 --- a/c/src/ada-tests/sptests/sp25/sptest.ads +++ /dev/null @@ -1,103 +0,0 @@ --- --- SPTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 25 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; - -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 .. 2 ) of RTEMS.ID; - TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME; - --- --- These arrays contain the IDs and NAMEs of all RTEMS regions created --- by this test. --- - - REGION_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID; - REGION_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME; - --- --- The following constant defines the priority of most of the --- RTEMS tasks in this test. This allows one of the tasks to --- easily set itself to a higher priority than the rest. --- - - BASE_PRIORITY : constant RTEMS.TASKS.PRIORITY := 140; - --- --- These arrays define the memory areas used for the regions in --- this test. --- - - AREA_1 : array ( RTEMS.UNSIGNED32 range 0 .. 64000 ) of RTEMS.UNSIGNED8; - for AREA_1'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- PUT_ADDRESS_FROM_AREA_1 --- --- DESCRIPTION: --- --- This subprogram prints the offset of the address TO_BE_PRINTED --- from the first byte of AREA_1. --- --- NOTE: --- --- This subprogram is used because the actual address of AREA_1 --- varies based upon the size of the executable, the target board, --- and the target processor. --- - - procedure PUT_ADDRESS_FROM_AREA_1 ( - TO_BE_PRINTED : in RTEMS.ADDRESS - ); - --- --- TASK_1 --- --- DESCRIPTION: --- --- This RTEMS task tests the Region Manager. --- - - procedure TASK_1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_1); - -end SPTEST; diff --git a/c/src/ada-tests/sptests/spatcb01/Makefile.am b/c/src/ada-tests/sptests/spatcb01/Makefile.am deleted file mode 100644 index 59e99eab98..0000000000 --- a/c/src/ada-tests/sptests/spatcb01/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_spatcb01 -ada_spatcb01_SOURCES = spatcb01.adb config.h -ada_spatcb01_SOURCES += ../../support/init.c - -ada_spatcb01$(EXEEXT): spatcb01.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_spatcb01.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/sptests/spatcb01/ada_spatcb01.scn b/c/src/ada-tests/sptests/spatcb01/ada_spatcb01.scn deleted file mode 100644 index 7738ff8a0e..0000000000 --- a/c/src/ada-tests/sptests/spatcb01/ada_spatcb01.scn +++ /dev/null @@ -1,3 +0,0 @@ -*** BEGIN OF TEST SPATCB 1 *** -foreign thread -*** END OF TEST SPATCB 1 *** diff --git a/c/src/ada-tests/sptests/spatcb01/config.h b/c/src/ada-tests/sptests/spatcb01/config.h deleted file mode 100644 index 405b536c82..0000000000 --- a/c/src/ada-tests/sptests/spatcb01/config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2017 embedded brains GmbH - * - * The license and distribution terms for this file may in - * the file LICENSE in this distribution or at - * http://www.rtems.org/license/LICENSE. - */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 1 - -#include diff --git a/c/src/ada-tests/sptests/spatcb01/spatcb01.adb b/c/src/ada-tests/sptests/spatcb01/spatcb01.adb deleted file mode 100644 index 19aaa8031f..0000000000 --- a/c/src/ada-tests/sptests/spatcb01/spatcb01.adb +++ /dev/null @@ -1,26 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- Ensure that the SYSTEM.TASK_PRIMITIVES.OPERATIONS.SPECIFIC implementation --- works. --- --- Copyright (c) 2017 embedded brains GmbH --- --- 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 TEXT_IO; -with System.Task_Primitives.Operations; -with System.Tasking; - -procedure SPATCB01 is - Self_Id : constant System.Tasking.Task_Id := System.Task_Primitives.Operations.Self; -begin - TEXT_IO.PUT_LINE( "*** BEGIN OF TEST SPATCB 1 ***" ); - TEXT_IO.PUT_LINE( Self_Id.Common.Task_Image( 1 .. Self_Id.Common.Task_Image_Len ) ); - TEXT_IO.PUT_LINE( "*** END OF TEST SPATCB 1 ***" ); -end SPATCB01; diff --git a/c/src/ada-tests/sptests/spname01/Makefile.am b/c/src/ada-tests/sptests/spname01/Makefile.am deleted file mode 100644 index ab5d8a6bdf..0000000000 --- a/c/src/ada-tests/sptests/spname01/Makefile.am +++ /dev/null @@ -1,18 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_spname01 -ada_spname01_SOURCES = spname01.adb config.h sptest.adb sptest.ads - -ada_spname01$(EXEEXT): spname01.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -init.$(OBJEXT): ../../support/init.c - $(COMPILE.c) -I$(srcdir) -c $< - -scndir = $(rtems_ada_testsdir) -dist_scn_DATA = ada_spname01.scn - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/sptests/spname01/ada_spname01.scn b/c/src/ada-tests/sptests/spname01/ada_spname01.scn deleted file mode 100644 index 825cd14437..0000000000 --- a/c/src/ada-tests/sptests/spname01/ada_spname01.scn +++ /dev/null @@ -1,3 +0,0 @@ -*** Ada Task Name TEST *** -TBD -*** END OF Ada Task Name TEST *** diff --git a/c/src/ada-tests/sptests/spname01/config.h b/c/src/ada-tests/sptests/spname01/config.h deleted file mode 100644 index 2be186cc2a..0000000000 --- a/c/src/ada-tests/sptests/spname01/config.h +++ /dev/null @@ -1,31 +0,0 @@ -/* config.h - * - * This include file defines the Configuration Table for this test. - * - * COPYRIGHT (c) 1989-2008. - * 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_APPLICATION - -/* NOTICE: the clock driver is explicitly disabled */ -#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#define CONFIGURE_MAXIMUM_TASKS 1 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/sptests/spname01/spname01.adb b/c/src/ada-tests/sptests/spname01/spname01.adb deleted file mode 100644 index 863e64f24e..0000000000 --- a/c/src/ada-tests/sptests/spname01/spname01.adb +++ /dev/null @@ -1,28 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test Hello of the Sample Test Suite. --- --- DEPENDENCIES: --- --- --- --- COPYRIGHT (c) 1989-2009. --- 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. --- - -procedure SPNAME01 is -begin - - loop - delay 120.0; - end loop; - -end SPNAME01; - diff --git a/c/src/ada-tests/sptests/spname01/sptest.adb b/c/src/ada-tests/sptests/spname01/sptest.adb deleted file mode 100644 index 5dd78d8e4a..0000000000 --- a/c/src/ada-tests/sptests/spname01/sptest.adb +++ /dev/null @@ -1,62 +0,0 @@ --- --- SPTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of the Ada Task Name test of the RTEMS --- Ada Single Processor Test Suite. --- --- DEPENDENCIES: --- --- --- --- COPYRIGHT (c) 1989-2009. --- 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 TEST_SUPPORT; -with TEXT_IO; -with System; use System; -- for Null Pointer comparison - -package body SPTEST is - - task body AdaTask is - Status : RTEMS.Status_Codes; - Pointer : RTEMS.Address; - StringName : String(1 .. 120) := (1 .. 120 => '*' ); - NewName : constant String := "Josiah"; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** Ada Task Name TEST ***" ); - - RTEMS.Object_Get_Name( RTEMS.Self, StringName, Pointer ); - if Pointer = RTEMS.Null_Address then - TEXT_IO.PUT_LINE( "Object_Get_Name_Failed" ); - else - TEXT_IO.PUT_LINE( "My name is (" & StringName & ")" ); - end if; - - TEXT_IO.PUT_LINE( "Setting name to (Josiah)" ); - RTEMS.Object_Set_Name( RTEMS.Self, NewName, Status ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "Object_Set_Name" ); - - RTEMS.Object_Get_Name( RTEMS.Self, StringName, Pointer ); - if Pointer = RTEMS.Null_Address then - TEXT_IO.PUT_LINE( "Object_Get_Name_Failed" ); - else - TEXT_IO.PUT_LINE( "My name is (" & StringName & ")" ); - end if; - - TEXT_IO.PUT_LINE( "*** END OF Ada Task Name TEST ***" ); - - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end AdaTask; - -end SPTEST; diff --git a/c/src/ada-tests/sptests/spname01/sptest.ads b/c/src/ada-tests/sptests/spname01/sptest.ads deleted file mode 100644 index 5e4f682221..0000000000 --- a/c/src/ada-tests/sptests/spname01/sptest.ads +++ /dev/null @@ -1,25 +0,0 @@ --- --- SPTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for the Hello World Test of the RTEMS --- Sample Test Suite. --- --- DEPENDENCIES: --- --- --- --- COPYRIGHT (c) 1989-2009. --- 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. --- - -package SPTEST is - - task AdaTask; - -end SPTEST; diff --git a/c/src/ada-tests/support/Makefile.am b/c/src/ada-tests/support/Makefile.am deleted file mode 100644 index 88a4014be7..0000000000 --- a/c/src/ada-tests/support/Makefile.am +++ /dev/null @@ -1,18 +0,0 @@ -EXTRA_DIST = -EXTRA_DIST += address_io.adb -EXTRA_DIST += address_io.ads -EXTRA_DIST += float_io.ads -EXTRA_DIST += fp.inc -EXTRA_DIST += init.c -EXTRA_DIST += integer.inc -EXTRA_DIST += rtems_calling_overhead.ads -EXTRA_DIST += status_io.ads -EXTRA_DIST += test_support.adb -EXTRA_DIST += test_support.ads -EXTRA_DIST += time_test_support.adb -EXTRA_DIST += time_test_support.ads -EXTRA_DIST += timer_driver.adb -EXTRA_DIST += timer_driver.ads -EXTRA_DIST += unsigned32_io.ads - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/support/address_io.adb b/c/src/ada-tests/support/address_io.adb deleted file mode 100644 index f549f57ffe..0000000000 --- a/c/src/ada-tests/support/address_io.adb +++ /dev/null @@ -1,43 +0,0 @@ --- --- Address_IO / Specification --- --- DESCRIPTION: --- --- This package instantiates the IO routines necessary to --- perform IO on data of the type System.Address. --- --- DEPENDENCIES: --- --- --- --- COPYRIGHT (c) 1989-2009. --- 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 System.Storage_Elements; -with Text_IO; - -package body Address_IO is - - procedure Put ( - Item : in System.Address; - Width : in Natural := 8; - Base : in Natural := 16 - ) is - package Integer_IO is new TEXT_IO.Integer_IO( Integer ); - begin - - Integer_IO.Put( - Integer( System.Storage_Elements.To_Integer( Item ) ), - Width, - Base - ); - - end Put; - -end Address_IO; - diff --git a/c/src/ada-tests/support/address_io.ads b/c/src/ada-tests/support/address_io.ads deleted file mode 100644 index 8a4fce98d3..0000000000 --- a/c/src/ada-tests/support/address_io.ads +++ /dev/null @@ -1,32 +0,0 @@ --- --- ADDRESS_IO / SPECIFICATION --- --- DESCRIPTION: --- --- This package instantiates the IO routines necessary to --- perform IO on data of the type System.Address. --- --- DEPENDENCIES: --- --- --- --- COPYRIGHT (c) 1989-1997. --- 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 System; - -package Address_IO is - - procedure Put ( - Item : in System.Address; - Width : in Natural := 8; - Base : in Natural := 16 - ); - -end Address_IO; - diff --git a/c/src/ada-tests/support/float_io.ads b/c/src/ada-tests/support/float_io.ads deleted file mode 100644 index 5e1a90bf92..0000000000 --- a/c/src/ada-tests/support/float_io.ads +++ /dev/null @@ -1,24 +0,0 @@ --- --- Float_IO / Specification --- --- Description: --- --- This package instantiates the IO routines necessary to --- perform IO on data of the type Float. --- --- Dependencies: --- --- --- --- COPYRIGHT (c) 1989-1997. --- 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 Text_IO; - -package Float_IO is new Text_IO.Float_IO( Float ); - diff --git a/c/src/ada-tests/support/fp.inc b/c/src/ada-tests/support/fp.inc deleted file mode 100644 index eb6f5528a9..0000000000 --- a/c/src/ada-tests/support/fp.inc +++ /dev/null @@ -1,151 +0,0 @@ --- --- fp.inc --- --- Macros to produce a large number of LOCAL floating point variables. This --- preprocessing is necessary to insure that the variables are --- scoped properly and to avoid duplicating hundreds of lines --- of code. --- --- --- DEFICIENCIES: --- --- 1. This currently does not address whether or not the CPU --- actually has hardware floating point. It just does the work. --- --- COPYRIGHT (c) 1989-1997. --- 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. - --- --- private definitions for macro use --- - --- macro usage EPSILON() -define(`EPSILON',`0.0005') - --- macro usage FP_CHECK_ONE( value, base, factor ) -define(`FP_CHECK_ONE',` - if ( $1 - ( $2 + $3 ) ) > EPSILON or else ( $1 - ( $2 + $3 ) ) < - EPSILON then - UNSIGNED32_IO.PUT( TASK_INDEX ); - TEXT_IO.PUT( ": $1 wrong -- (" ); - FLOAT_IO.PUT( $1 ); - TEXT_IO.PUT( " not " ); - FLOAT_IO.PUT( $2 + $3 ); - TEXT_IO.PUT_LINE( ")" ); - end if -' -) - --- macro usage FP_DECLARE -define(`FP_DECLARE', ` - FP01 : FLOAT := 1.0; - FP02 : FLOAT := 2.0; - FP03 : FLOAT := 3.0; - FP04 : FLOAT := 4.0; - FP05 : FLOAT := 5.0; - FP06 : FLOAT := 6.0; - FP07 : FLOAT := 7.0; - FP08 : FLOAT := 8.0; - FP09 : FLOAT := 9.0; - FP10 : FLOAT := 10.0; - FP11 : FLOAT := 11.0; - FP12 : FLOAT := 12.0; - FP13 : FLOAT := 13.0; - FP14 : FLOAT := 14.0; - FP15 : FLOAT := 15.0; - FP16 : FLOAT := 16.0; - FP17 : FLOAT := 17.0; - FP18 : FLOAT := 18.0; - FP19 : FLOAT := 19.0; - FP20 : FLOAT := 20.0; - FP21 : FLOAT := 21.0; - FP22 : FLOAT := 22.0; - FP23 : FLOAT := 23.0; - FP24 : FLOAT := 24.0; - FP25 : FLOAT := 25.0; - FP26 : FLOAT := 26.0; - FP27 : FLOAT := 27.0; - FP28 : FLOAT := 28.0; - FP29 : FLOAT := 29.0; - FP30 : FLOAT := 30.0; - FP31 : FLOAT := 31.0; - FP32 : FLOAT := 32.0 -' -) - - --- macro usage FP_LOAD( factor ) -define(`FP_LOAD',` - FP01 := FP01 + $1; - FP02 := FP02 + $1; - FP03 := FP03 + $1; - FP04 := FP04 + $1; - FP05 := FP05 + $1; - FP06 := FP06 + $1; - FP07 := FP07 + $1; - FP08 := FP08 + $1; - FP09 := FP09 + $1; - FP10 := FP10 + $1; - FP11 := FP11 + $1; - FP12 := FP12 + $1; - FP13 := FP13 + $1; - FP14 := FP14 + $1; - FP15 := FP15 + $1; - FP16 := FP16 + $1; - FP17 := FP17 + $1; - FP18 := FP18 + $1; - FP19 := FP19 + $1; - FP20 := FP20 + $1; - FP21 := FP21 + $1; - FP22 := FP22 + $1; - FP23 := FP23 + $1; - FP24 := FP24 + $1; - FP25 := FP25 + $1; - FP26 := FP26 + $1; - FP27 := FP27 + $1; - FP28 := FP28 + $1; - FP29 := FP29 + $1; - FP30 := FP30 + $1; - FP31 := FP31 + $1; - FP32 := FP32 + $1 -') - --- macro usage FP_CHECK( factor ) -define(`FP_CHECK',` - FP_CHECK_ONE( FP01, 1.0, $1 ); - FP_CHECK_ONE( FP02, 2.0, $1 ); - FP_CHECK_ONE( FP03, 3.0, $1 ); - FP_CHECK_ONE( FP04, 4.0, $1 ); - FP_CHECK_ONE( FP05, 5.0, $1 ); - FP_CHECK_ONE( FP06, 6.0, $1 ); - FP_CHECK_ONE( FP07, 7.0, $1 ); - FP_CHECK_ONE( FP08, 8.0, $1 ); - FP_CHECK_ONE( FP09, 9.0, $1 ); - FP_CHECK_ONE( FP10, 10.0, $1 ); - FP_CHECK_ONE( FP11, 11.0, $1 ); - FP_CHECK_ONE( FP12, 12.0, $1 ); - FP_CHECK_ONE( FP13, 13.0, $1 ); - FP_CHECK_ONE( FP14, 14.0, $1 ); - FP_CHECK_ONE( FP15, 15.0, $1 ); - FP_CHECK_ONE( FP16, 16.0, $1 ); - FP_CHECK_ONE( FP17, 17.0, $1 ); - FP_CHECK_ONE( FP18, 18.0, $1 ); - FP_CHECK_ONE( FP19, 19.0, $1 ); - FP_CHECK_ONE( FP20, 20.0, $1 ); - FP_CHECK_ONE( FP21, 21.0, $1 ); - FP_CHECK_ONE( FP22, 22.0, $1 ); - FP_CHECK_ONE( FP23, 23.0, $1 ); - FP_CHECK_ONE( FP24, 24.0, $1 ); - FP_CHECK_ONE( FP25, 25.0, $1 ); - FP_CHECK_ONE( FP26, 26.0, $1 ); - FP_CHECK_ONE( FP27, 27.0, $1 ); - FP_CHECK_ONE( FP28, 28.0, $1 ); - FP_CHECK_ONE( FP29, 29.0, $1 ); - FP_CHECK_ONE( FP30, 30.0, $1 ); - FP_CHECK_ONE( FP31, 31.0, $1 ); - FP_CHECK_ONE( FP32, 32.0, $1 ) -' -) diff --git a/c/src/ada-tests/support/init.c b/c/src/ada-tests/support/init.c deleted file mode 100644 index 968b17b3a4..0000000000 --- a/c/src/ada-tests/support/init.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - * COPYRIGHT (c) 1989-2015 - * On-Line Applications Research Corporation (OAR). - */ - -#include -#include - -#include - -/* - * This is the entry point automatically generated by GNAT. - */ -extern int gnat_main ( int argc, char **argv, char **envp ); - -static void *POSIX_Init( - void *argument -) -{ - (void) gnat_main ( 0, 0, 0 ); - - exit( 0 ); -} - -/* - * Prototypes for various test support routines. Since these are bound to - * from Ada, there are no external .h files even though they must be public. - */ -uint32_t milliseconds_per_tick(void); -uint32_t ticks_per_second(void); -uint32_t work_space_size(void); -uint32_t is_configured_multiprocessing(void); -uint32_t get_node(void); -rtems_id tcb_to_id(Thread_Control *tcb); - -/* - * By putting this in brackets rather than quotes, we get the search - * path and can get this file from ".." in the mptests. - */ -#define CONFIGURE_INIT -#define CONFIGURE_GNAT_RTEMS -#define CONFIGURE_MEMORY_OVERHEAD (256) - -#include - -rtems_id tcb_to_id( - Thread_Control *tcb -) -{ - return tcb->Object.id; /* Only for sp04 */ -} - -uint32_t milliseconds_per_tick(void) -{ - return CONFIGURE_MICROSECONDS_PER_TICK / 1000; -} - -uint32_t ticks_per_second(void) -{ - return rtems_clock_get_ticks_per_second(); -} - -uint32_t work_space_size(void) -{ - return CONFIGURE_EXECUTIVE_RAM_SIZE; -} - -uint32_t is_configured_multiprocessing(void) -{ -#if defined(RTEMS_MULTIPROCESSING) - return 1; -#else - return 0; -#endif -} - -uint32_t get_node(void) -{ - /* XXX HACK -- use public API */ - return _Objects_Local_node; -} - diff --git a/c/src/ada-tests/support/integer.inc b/c/src/ada-tests/support/integer.inc deleted file mode 100644 index c47f68efd4..0000000000 --- a/c/src/ada-tests/support/integer.inc +++ /dev/null @@ -1,142 +0,0 @@ --- --- integer.inc --- --- Macros to produce a large number of LOCAL integer variables. This --- preprocessing is necessary to insure that the variables are --- scoped properly and to avoid duplicating hundreds of lines --- of code. --- --- COPYRIGHT (c) 1989-1997. --- 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. - --- --- private definitions for macro use --- - --- macro usage INTEGER_CHECK_ONE( value, base, factor ) -define(`INTEGER_CHECK_ONE',` - if $1 /= ($2 + $3) then - UNSIGNED32_IO.PUT( TASK_INDEX ); - TEXT_IO.PUT( ": $1 wrong -- (" ); - UNSIGNED32_IO.PUT( $1, BASE => 16); - TEXT_IO.PUT( " not " ); - UNSIGNED32_IO.PUT( $2, BASE => 16 ); - TEXT_IO.PUT_LINE( ")" ); - end if -' -) - --- macro usage INTEGER_DECLARE -define(`INTEGER_DECLARE', ` - INT01 : RTEMS.UNSIGNED32 := 1; - INT02 : RTEMS.UNSIGNED32 := 2; - INT03 : RTEMS.UNSIGNED32 := 3; - INT04 : RTEMS.UNSIGNED32 := 4; - INT05 : RTEMS.UNSIGNED32 := 5; - INT06 : RTEMS.UNSIGNED32 := 6; - INT07 : RTEMS.UNSIGNED32 := 7; - INT08 : RTEMS.UNSIGNED32 := 8; - INT09 : RTEMS.UNSIGNED32 := 9; - INT10 : RTEMS.UNSIGNED32 := 10; - INT11 : RTEMS.UNSIGNED32 := 11; - INT12 : RTEMS.UNSIGNED32 := 12; - INT13 : RTEMS.UNSIGNED32 := 13; - INT14 : RTEMS.UNSIGNED32 := 14; - INT15 : RTEMS.UNSIGNED32 := 15; - INT16 : RTEMS.UNSIGNED32 := 16; - INT17 : RTEMS.UNSIGNED32 := 17; - INT18 : RTEMS.UNSIGNED32 := 18; - INT19 : RTEMS.UNSIGNED32 := 19; - INT20 : RTEMS.UNSIGNED32 := 20; - INT21 : RTEMS.UNSIGNED32 := 21; - INT22 : RTEMS.UNSIGNED32 := 22; - INT23 : RTEMS.UNSIGNED32 := 23; - INT24 : RTEMS.UNSIGNED32 := 24; - INT25 : RTEMS.UNSIGNED32 := 25; - INT26 : RTEMS.UNSIGNED32 := 26; - INT27 : RTEMS.UNSIGNED32 := 27; - INT28 : RTEMS.UNSIGNED32 := 28; - INT29 : RTEMS.UNSIGNED32 := 29; - INT30 : RTEMS.UNSIGNED32 := 30; - INT31 : RTEMS.UNSIGNED32 := 31; - INT32 : RTEMS.UNSIGNED32 := 32 -' -) - - --- macro usage INTEGER_LOAD( factor ) -define(`INTEGER_LOAD',` - INT01 := INT01 + $1; - INT02 := INT02 + $1; - INT03 := INT03 + $1; - INT04 := INT04 + $1; - INT05 := INT05 + $1; - INT06 := INT06 + $1; - INT07 := INT07 + $1; - INT08 := INT08 + $1; - INT09 := INT09 + $1; - INT10 := INT10 + $1; - INT11 := INT11 + $1; - INT12 := INT12 + $1; - INT13 := INT13 + $1; - INT14 := INT14 + $1; - INT15 := INT15 + $1; - INT16 := INT16 + $1; - INT17 := INT17 + $1; - INT18 := INT18 + $1; - INT19 := INT19 + $1; - INT20 := INT20 + $1; - INT21 := INT21 + $1; - INT22 := INT22 + $1; - INT23 := INT23 + $1; - INT24 := INT24 + $1; - INT25 := INT25 + $1; - INT26 := INT26 + $1; - INT27 := INT27 + $1; - INT28 := INT28 + $1; - INT29 := INT29 + $1; - INT30 := INT30 + $1; - INT31 := INT31 + $1; - INT32 := INT32 + $1 -') - --- macro usage INTEGER_CHECK( factor ) -define(`INTEGER_CHECK',` - INTEGER_CHECK_ONE( INT01, 1, $1 ); - INTEGER_CHECK_ONE( INT02, 2, $1 ); - INTEGER_CHECK_ONE( INT03, 3, $1 ); - INTEGER_CHECK_ONE( INT04, 4, $1 ); - INTEGER_CHECK_ONE( INT05, 5, $1 ); - INTEGER_CHECK_ONE( INT06, 6, $1 ); - INTEGER_CHECK_ONE( INT07, 7, $1 ); - INTEGER_CHECK_ONE( INT08, 8, $1 ); - INTEGER_CHECK_ONE( INT09, 9, $1 ); - INTEGER_CHECK_ONE( INT10, 10, $1 ); - INTEGER_CHECK_ONE( INT11, 11, $1 ); - INTEGER_CHECK_ONE( INT12, 12, $1 ); - INTEGER_CHECK_ONE( INT13, 13, $1 ); - INTEGER_CHECK_ONE( INT14, 14, $1 ); - INTEGER_CHECK_ONE( INT15, 15, $1 ); - INTEGER_CHECK_ONE( INT16, 16, $1 ); - INTEGER_CHECK_ONE( INT17, 17, $1 ); - INTEGER_CHECK_ONE( INT18, 18, $1 ); - INTEGER_CHECK_ONE( INT19, 19, $1 ); - INTEGER_CHECK_ONE( INT20, 20, $1 ); - INTEGER_CHECK_ONE( INT21, 21, $1 ); - INTEGER_CHECK_ONE( INT22, 22, $1 ); - INTEGER_CHECK_ONE( INT23, 23, $1 ); - INTEGER_CHECK_ONE( INT24, 24, $1 ); - INTEGER_CHECK_ONE( INT25, 25, $1 ); - INTEGER_CHECK_ONE( INT26, 26, $1 ); - INTEGER_CHECK_ONE( INT27, 27, $1 ); - INTEGER_CHECK_ONE( INT28, 28, $1 ); - INTEGER_CHECK_ONE( INT29, 29, $1 ); - INTEGER_CHECK_ONE( INT30, 30, $1 ); - INTEGER_CHECK_ONE( INT31, 31, $1 ); - INTEGER_CHECK_ONE( INT32, 32, $1 ) -' -) diff --git a/c/src/ada-tests/support/rtems_calling_overhead.ads b/c/src/ada-tests/support/rtems_calling_overhead.ads deleted file mode 100644 index 5f94e0505a..0000000000 --- a/c/src/ada-tests/support/rtems_calling_overhead.ads +++ /dev/null @@ -1,102 +0,0 @@ --- --- RTEMS_CALLING_OVERHEAD / SPECIFICATION --- --- DESCRIPTION: --- --- This package contains the invocation overhead for each --- of the RTEMS directives on the MC68020 Timing Platform. --- This time is then subtracted from the execution time --- of each directive as measured by the Timing Suite. --- --- DEPENDENCIES: --- --- --- --- COPYRIGHT (c) 1989-1997. --- 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; - -package RTEMS_CALLING_OVERHEAD is - - INITIALIZE_EXECUTIVE : constant RTEMS.UNSIGNED32 := 0; - SHUTDOWN_EXECUTIVE : constant RTEMS.UNSIGNED32 := 0; - TASK_CREATE : constant RTEMS.UNSIGNED32 := 0; - TASK_IDENT : constant RTEMS.UNSIGNED32 := 0; - TASK_START : constant RTEMS.UNSIGNED32 := 0; - TASK_RESTART : constant RTEMS.UNSIGNED32 := 0; - TASK_DELETE : constant RTEMS.UNSIGNED32 := 0; - TASK_SUSPEND : constant RTEMS.UNSIGNED32 := 0; - TASK_RESUME : constant RTEMS.UNSIGNED32 := 0; - TASK_SET_PRIORITY : constant RTEMS.UNSIGNED32 := 0; - TASK_MODE : constant RTEMS.UNSIGNED32 := 0; - TASK_GET_NOTE : constant RTEMS.UNSIGNED32 := 0; - TASK_SET_NOTE : constant RTEMS.UNSIGNED32 := 0; - TASK_WAKE_WHEN : constant RTEMS.UNSIGNED32 := 0; - TASK_WAKE_AFTER : constant RTEMS.UNSIGNED32 := 0; - INTERRUPT_CATCH : constant RTEMS.UNSIGNED32 := 0; - CLOCK_GET : constant RTEMS.UNSIGNED32 := 0; - CLOCK_SET : constant RTEMS.UNSIGNED32 := 0; - CLOCK_TICK : constant RTEMS.UNSIGNED32 := 0; - - TIMER_CREATE : constant RTEMS.UNSIGNED32 := 0; - TIMER_DELETE : constant RTEMS.UNSIGNED32 := 0; - TIMER_IDENT : constant RTEMS.UNSIGNED32 := 0; - TIMER_FIRE_AFTER : constant RTEMS.UNSIGNED32 := 0; - TIMER_FIRE_WHEN : constant RTEMS.UNSIGNED32 := 0; - TIMER_RESET : constant RTEMS.UNSIGNED32 := 0; - TIMER_CANCEL : constant RTEMS.UNSIGNED32 := 0; - SEMAPHORE_CREATE : constant RTEMS.UNSIGNED32 := 0; - SEMAPHORE_DELETE : constant RTEMS.UNSIGNED32 := 0; - SEMAPHORE_IDENT : constant RTEMS.UNSIGNED32 := 0; - SEMAPHORE_OBTAIN : constant RTEMS.UNSIGNED32 := 0; - SEMAPHORE_RELEASE : constant RTEMS.UNSIGNED32 := 0; - MESSAGE_QUEUE_CREATE : constant RTEMS.UNSIGNED32 := 0; - MESSAGE_QUEUE_IDENT : constant RTEMS.UNSIGNED32 := 0; - MESSAGE_QUEUE_DELETE : constant RTEMS.UNSIGNED32 := 0; - MESSAGE_QUEUE_SEND : constant RTEMS.UNSIGNED32 := 0; - MESSAGE_QUEUE_URGENT : constant RTEMS.UNSIGNED32 := 0; - MESSAGE_QUEUE_BROADCAST : constant RTEMS.UNSIGNED32 := 0; - MESSAGE_QUEUE_RECEIVE : constant RTEMS.UNSIGNED32 := 0; - MESSAGE_QUEUE_FLUSH : constant RTEMS.UNSIGNED32 := 0; - - EVENT_SEND : constant RTEMS.UNSIGNED32 := 0; - EVENT_RECEIVE : constant RTEMS.UNSIGNED32 := 0; - SIGNAL_CATCH : constant RTEMS.UNSIGNED32 := 0; - SIGNAL_SEND : constant RTEMS.UNSIGNED32 := 0; - PARTITION_CREATE : constant RTEMS.UNSIGNED32 := 0; - PARTITION_IDENT : constant RTEMS.UNSIGNED32 := 0; - PARTITION_DELETE : constant RTEMS.UNSIGNED32 := 0; - PARTITION_GET_BUFFER : constant RTEMS.UNSIGNED32 := 0; - PARTITION_RETURN_BUFFER : constant RTEMS.UNSIGNED32 := 0; - REGION_CREATE : constant RTEMS.UNSIGNED32 := 0; - REGION_IDENT : constant RTEMS.UNSIGNED32 := 0; - REGION_DELETE : constant RTEMS.UNSIGNED32 := 0; - REGION_GET_SEGMENT : constant RTEMS.UNSIGNED32 := 0; - REGION_RETURN_SEGMENT : constant RTEMS.UNSIGNED32 := 0; - PORT_CREATE : constant RTEMS.UNSIGNED32 := 0; - PORT_IDENT : constant RTEMS.UNSIGNED32 := 0; - PORT_DELETE : constant RTEMS.UNSIGNED32 := 0; - PORT_EXTERNAL_TO_INTERNAL : constant RTEMS.UNSIGNED32 := 0; - PORT_INTERNAL_TO_EXTERNAL : constant RTEMS.UNSIGNED32 := 0; - - IO_INITIALIZE : constant RTEMS.UNSIGNED32 := 0; - IO_OPEN : constant RTEMS.UNSIGNED32 := 0; - IO_CLOSE : constant RTEMS.UNSIGNED32 := 0; - IO_READ : constant RTEMS.UNSIGNED32 := 0; - IO_WRITE : constant RTEMS.UNSIGNED32 := 0; - IO_CONTROL : constant RTEMS.UNSIGNED32 := 0; - FATAL_ERROR_OCCURRED : constant RTEMS.UNSIGNED32 := 0; - RATE_MONOTONIC_CREATE : constant RTEMS.UNSIGNED32 := 0; - RATE_MONOTONIC_IDENT : constant RTEMS.UNSIGNED32 := 0; - RATE_MONOTONIC_DELETE : constant RTEMS.UNSIGNED32 := 0; - RATE_MONOTONIC_CANCEL : constant RTEMS.UNSIGNED32 := 0; - RATE_MONOTONIC_PERIOD : constant RTEMS.UNSIGNED32 := 0; - MULTIPROCESSING_ANNOUNCE : constant RTEMS.UNSIGNED32 := 0; - -end RTEMS_CALLING_OVERHEAD; diff --git a/c/src/ada-tests/support/status_io.ads b/c/src/ada-tests/support/status_io.ads deleted file mode 100644 index 301e7a2ba1..0000000000 --- a/c/src/ada-tests/support/status_io.ads +++ /dev/null @@ -1,25 +0,0 @@ --- --- Status_IO / Specification --- --- DESCRIPTION: --- --- This package instantiates the IO routines necessary to --- perform IO on data of the type Status.CODES. --- --- DEPENDENCIES: --- --- --- --- COPYRIGHT (c) 1989-1997. --- 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 Text_IO; - -package Status_IO is new Text_IO.Enumeration_IO( RTEMS.Status_Codes ); - diff --git a/c/src/ada-tests/support/test_support.adb b/c/src/ada-tests/support/test_support.adb deleted file mode 100644 index bc636cee11..0000000000 --- a/c/src/ada-tests/support/test_support.adb +++ /dev/null @@ -1,266 +0,0 @@ --- --- Test_Support / Specification --- --- DESCRIPTION: --- --- This package provides routines which aid the Test Suites --- and simplify their design and operation. --- --- 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 Interfaces; use Interfaces; -with Unsigned32_IO; -with Status_IO; -with Text_IO; -with RTEMS.Fatal; - -package body Test_Support is - --- --- Fatal_Directive_Status --- - - procedure Fatal_Directive_Status ( - Status : in RTEMS.Status_Codes; - Desired : in RTEMS.Status_Codes; - Message : in String - ) is - begin - - if not RTEMS.Are_Statuses_Equal( Status, Desired ) then - - Text_IO.Put( Message ); - Text_IO.Put( " FAILED -- expected " ); - Status_IO.Put( Desired ); - Text_IO.Put( " got " ); - Status_IO.Put( Status ); - Text_IO.New_Line; - - RTEMS.Fatal.Error_Occurred( RTEMS.Status_Codes'Pos( Status ) ); - - end if; - - end Fatal_Directive_Status; - --- --- Directive_Failed --- - - procedure Directive_Failed ( - Status : in RTEMS.Status_Codes; - Message : in String - ) is - begin - - Test_Support.Fatal_Directive_Status( - Status, - RTEMS.Successful, - Message - ); - - end Directive_Failed; - --- --- Print_Time --- - - procedure Print_Time ( - Prefix : in String; - Time_Buffer : in RTEMS.Time_Of_Day; - Suffix : in String - ) is - begin - - Text_IO.Put( Prefix ); - Unsigned32_IO.Put( Time_Buffer.Hour, Width=>2 ); - Text_IO.Put( ":" ); - Unsigned32_IO.Put( Time_Buffer.Minute, Width=>2 ); - Text_IO.Put( ":" ); - Unsigned32_IO.Put( Time_Buffer.Second, Width=>2 ); - Text_IO.Put( " " ); - Unsigned32_IO.Put( Time_Buffer.Month, Width=>2 ); - Text_IO.Put( "/" ); - Unsigned32_IO.Put( Time_Buffer.Day, Width=>2 ); - Text_IO.Put( "/" ); - Unsigned32_IO.Put( Time_Buffer.Year, Width=>2 ); - Text_IO.Put( Suffix ); - - end Print_Time; - --- --- Put_Dot --- - - procedure Put_Dot ( - Buffer : in String - ) is - begin - Text_IO.Put( Buffer ); - Text_IO.FLUSH; - end Put_Dot; - --- --- Pause --- - - procedure Pause is - -- Ignored_String : String( 1 .. 80 ); - -- Ignored_Last : Natural; - - begin - - -- - -- Really should be a "put" followed by a "flush." - -- - Text_IO.Put_Line( " " ); - -- Text_IO.Get_Line( Ignored_String, Ignored_Last ); - - end Pause; - --- --- Pause_And_Screen_Number --- - - procedure Pause_And_Screen_Number ( - SCREEN : in RTEMS.Unsigned32 - ) is - -- Ignored_String : String( 1 .. 80 ); - -- Ignored_Last : Natural; - begin - - -- - -- Really should be a "put" followed by a "flush." - -- - Text_IO.Put( "2 ); - Text_IO.Put_Line( "> " ); - -- Text_IO.Get_Line( Ignored_String, Ignored_Last ); - - end Pause_And_Screen_Number; - --- --- Put_Name --- - - procedure Put_Name ( - Name : in RTEMS.Name; - New_Line : in Boolean - ) is - C1 : Character; - C2 : Character; - C3 : Character; - C4 : Character; - begin - - RTEMS.Name_To_Characters( Name, C1, C2, C3, C4 ); - - Text_IO.Put( C1 ); - Text_IO.Put( C2 ); - Text_IO.Put( C3 ); - Text_IO.Put( C4 ); - - if New_Line then - Text_IO.New_Line; - end if; - - end Put_Name; - --- --- Task_Number --- - - function Task_Number ( - TID : in RTEMS.ID - ) return RTEMS.Unsigned32 is - begin - - -- probably OK - return RTEMS.Get_Index( TID ) - 1; - - end Task_Number; - --- --- Do_Nothing --- - - procedure Do_Nothing is - begin - NULL; - end Do_Nothing; - - --- --- Milliseconds_Per_Tick --- - - function Milliseconds_Per_Tick - return RTEMS.Unsigned32 is - function Milliseconds_Per_Tick_Base return RTEMS.Unsigned32; - pragma Import (C, Milliseconds_Per_Tick_Base, "milliseconds_per_tick"); - begin - return Milliseconds_Per_Tick_Base; - end Milliseconds_Per_Tick; - --- --- Milliseconds_Per_Tick --- - function Ticks_Per_Second - return RTEMS.Interval is - function Ticks_Per_Second_Base return RTEMS.Unsigned32; - pragma Import (C, Ticks_Per_Second_Base, "ticks_per_second"); - begin - return Ticks_Per_Second_Base; - end Ticks_Per_Second; - --- --- Return the size of the RTEMS Workspace --- - - function Work_Space_Size - return RTEMS.Unsigned32 is - function Work_Space_Size_Base return RTEMS.Unsigned32; - pragma Import (C, Work_Space_Size_Base, "work_space_size"); - begin - return Work_Space_Size_Base; - end Work_Space_Size; - --- --- Return an indication of whether multiprocessing is configured --- - - function Is_Configured_Multiprocessing - return Boolean is - function Is_Configured_Multiprocessing_Base return RTEMS.Unsigned32; - pragma Import ( - C, Is_Configured_Multiprocessing_Base, "is_configured_multiprocessing" - ); - begin - if Is_Configured_Multiprocessing_Base = 1 then - return True; - else - return False; - end if; - end Is_Configured_Multiprocessing; - --- --- Node is the node number in a multiprocessor configuration --- - - function Node - return RTEMS.Unsigned32 is - function Get_Node_Base return RTEMS.Unsigned32; - pragma Import (C, Get_Node_Base, "get_node"); - begin - return Get_Node_Base; - end Node; -end Test_Support; diff --git a/c/src/ada-tests/support/test_support.ads b/c/src/ada-tests/support/test_support.ads deleted file mode 100644 index e41bf834ed..0000000000 --- a/c/src/ada-tests/support/test_support.ads +++ /dev/null @@ -1,195 +0,0 @@ --- --- Test_Support / SPECIFICATION --- --- DESCRIPTION: --- --- This package provides routines which aid the Test Suites --- and simplify their design and operation. --- --- DEPENDENCIES: --- --- --- --- COPYRIGHT (c) 1989-2009. --- 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; - -package Test_Support is - --- --- Fatal_Directive_Status --- --- DESCRIPTION: --- --- This subprogram checks if Status is equal to Desired. If so, it --- returns immediately. Otherwise, it prints the Message along with --- the Status and Desired status and invokes the Fatal_Error_Occurred --- directive. --- - - procedure Fatal_Directive_Status ( - Status : in RTEMS.Status_Codes; - Desired : in RTEMS.Status_Codes; - Message : in STRING - ); - pragma Inline ( Fatal_Directive_Status ); - --- Directive_Failed --- --- DESCRIPTION: --- --- This subprogram checks if Status is equal to Successful. If so, it --- returns immediately. Otherwise, it prints the Message along with --- the Status and Desired status and invokes the Fatal_Error_Occurred --- - - procedure Directive_Failed ( - Status : in RTEMS.Status_Codes; - Message : in STRING - ); - pragma Inline ( Directive_Failed ); - --- --- Print_Time --- --- DESCRIPTION: --- --- This subprogram prints the Prefix string, following by the --- time of day in Time_Buffer, followed by the Suffix. --- - - procedure Print_Time ( - Prefix : in STRING; - Time_Buffer : in RTEMS.Time_Of_Day; - Suffix : in STRING - ); - pragma Inline ( Print_Time ); - --- --- Put_Dot --- --- DESCRIPTION: --- --- This subprogram prints a single character without a carriage return. --- - - procedure Put_Dot ( - Buffer : in STRING - ); - pragma Inline ( Put_Dot ); - --- --- Pause --- --- DESCRIPTION: --- --- This subprogram is used to pause screen output in the Test Suites --- until the user presses carriage return. --- - - procedure Pause; - --- --- Pause_And_Screen_Number --- --- DESCRIPTION: --- --- This subprogram is used to pause screen output and print the current --- number in the Test Suites until the user presses carriage return. --- - - procedure Pause_And_Screen_Number ( - SCREEN : in RTEMS.Unsigned32 - ); - --- --- Put_Name --- --- DESCRIPTION: --- --- This subprogram prints the RTEMS object Name. If New_Line is TRUE, --- then a carriage return is printed after the Name. --- - - procedure Put_Name ( - Name : in RTEMS.Name; - New_Line : in Boolean - ); - --- --- Task_Number --- --- DESCRIPTION: --- --- This function returns the task index which the test should use --- for TID. --- - - function Task_Number ( - TID : in RTEMS.ID - ) return RTEMS.Unsigned32; - pragma Inline ( Task_Number ); - --- --- Do_Nothing --- --- DESCRIPTION: --- --- This procedure is called when a test wishes to use a delay --- loop and insure that the compiler does not optimize it away. --- - - procedure Do_Nothing; - --- --- Ticks_Per_Second is the number of RTEMS clock ticks which --- occur each second. --- - - function Ticks_Per_Second - return RTEMS.Interval; - --- --- Milliseconds_Per_Tick is the number of milliseconds which --- occur between each RTEMS clock tick. --- - - function Milliseconds_Per_Tick - return RTEMS.Unsigned32; - --- --- Return the size of the RTEMS Workspace --- - - function Work_Space_Size - return RTEMS.Unsigned32; - --- --- Return an indication of whether multiprocessing is configured --- - - function Is_Configured_Multiprocessing - return Boolean; - --- --- Node is the node number in a multiprocessor configuration --- - - function Node - return RTEMS.Unsigned32; - --- --- Longest time in seconds to run a test --- - - MAXIMUM_LONG_TEST_DURATION : RTEMS.UNSIGNED32; - -private - -end Test_Support; diff --git a/c/src/ada-tests/support/time_test_support.adb b/c/src/ada-tests/support/time_test_support.adb deleted file mode 100644 index aab0c75dfe..0000000000 --- a/c/src/ada-tests/support/time_test_support.adb +++ /dev/null @@ -1,73 +0,0 @@ --- --- TIME_TEST_SUPPORT / SPECIFICATION --- --- DESCRIPTION: --- --- This package provides routines which aid the individual tests in --- the Timing Test Suite and simplify their design and operation. --- --- DEPENDENCIES: --- --- --- --- COPYRIGHT (c) 1989-2009. --- 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 INTERFACES; use INTERFACES; -with TEXT_IO; -with UNSIGNED32_IO; - -package body TIME_TEST_SUPPORT is - ---PAGE --- --- PUT_TIME --- - - procedure PUT_TIME ( - MESSAGE : in STRING; - TOTAL_TIME : in RTEMS.UNSIGNED32; - ITERATIONS : in RTEMS.UNSIGNED32; - LOOP_OVERHEAD : in RTEMS.UNSIGNED32; - CALLING_OVERHEAD : in RTEMS.UNSIGNED32 - ) is - PER_ITERATION : RTEMS.UNSIGNED32; - begin - - PER_ITERATION := (TOTAL_TIME - LOOP_OVERHEAD) / ITERATIONS; - PER_ITERATION := PER_ITERATION - CALLING_OVERHEAD; - - if PER_ITERATION = 0 then - - TEXT_IO.PUT( "TOTAL_TIME " ); - UNSIGNED32_IO.PUT( TOTAL_TIME ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT( "ITERATIONS " ); - UNSIGNED32_IO.PUT( ITERATIONS ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT( "LOOP_OVERHEAD " ); - UNSIGNED32_IO.PUT( LOOP_OVERHEAD ); - TEXT_IO.NEW_LINE; - - TEXT_IO.PUT( "CALLING_OVERHEAD " ); - UNSIGNED32_IO.PUT( CALLING_OVERHEAD ); - TEXT_IO.NEW_LINE; - - end if; - - TEXT_IO.PUT( MESSAGE ); - TEXT_IO.PUT( " " ); - UNSIGNED32_IO.PUT( PER_ITERATION ); - TEXT_IO.NEW_LINE; - TEXT_IO.FLUSH; - - end PUT_TIME; - -end TIME_TEST_SUPPORT; diff --git a/c/src/ada-tests/support/time_test_support.ads b/c/src/ada-tests/support/time_test_support.ads deleted file mode 100644 index aeed677ba2..0000000000 --- a/c/src/ada-tests/support/time_test_support.ads +++ /dev/null @@ -1,51 +0,0 @@ --- --- TIME_TEST_SUPPORT / SPECIFICATION --- --- DESCRIPTION: --- --- This package provides routines which aid the individual tests in --- the Timing Test Suite and simplify their design and operation. --- --- DEPENDENCIES: --- --- --- --- COPYRIGHT (c) 1989-1997. --- 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; - -package TIME_TEST_SUPPORT is - --- --- The following constants define the number of times a directive --- will be performed in the Timing Suite. --- - - OPERATION_COUNT : constant RTEMS.UNSIGNED32 := 100; - ITERATION_COUNT : constant RTEMS.UNSIGNED32 := 100; - --- --- PUT_TIME --- --- DESCRIPTION: --- --- This subprogram prints the MESSAGE followed by the length of --- time which each individual operation took. All times are --- in microseconds. --- - - procedure PUT_TIME ( - MESSAGE : in STRING; - TOTAL_TIME : in RTEMS.UNSIGNED32; - ITERATIONS : in RTEMS.UNSIGNED32; - LOOP_OVERHEAD : in RTEMS.UNSIGNED32; - CALLING_OVERHEAD : in RTEMS.UNSIGNED32 - ); - -end TIME_TEST_SUPPORT; diff --git a/c/src/ada-tests/support/timer_driver.adb b/c/src/ada-tests/support/timer_driver.adb deleted file mode 100644 index 389499ccc8..0000000000 --- a/c/src/ada-tests/support/timer_driver.adb +++ /dev/null @@ -1,59 +0,0 @@ --- --- Timer_Driver / Body --- --- Description: --- --- This package is the body for the Timer Driver. --- --- Dependencies: --- --- --- --- COPYRIGHT (c) 1989-2009. --- 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 Interfaces; - -package body Timer_Driver is - ---PAGE --- --- Empty_function --- --- - procedure Empty_Function - is - begin - Null; - end Empty_Function; - ---PAGE --- --- Set_Find_Average_Overhead --- --- - - procedure Set_Find_Average_Overhead ( - Find_Flag : in Standard.Boolean - ) is - procedure Set_Find_Average_Overhead_base ( - Find_Flag : in Interfaces.Unsigned_8 - ); - pragma Import (C, Set_Find_Average_Overhead_base, - "benchmark_timer_disable_subtracting_average_overhead"); - c: Interfaces.Unsigned_8; - begin - if Find_Flag then - c := 1; - else - c := 0; - end if; - Set_Find_Average_Overhead_base (c); - end Set_Find_Average_Overhead; - -end Timer_Driver; diff --git a/c/src/ada-tests/support/timer_driver.ads b/c/src/ada-tests/support/timer_driver.ads deleted file mode 100644 index 00642dfe90..0000000000 --- a/c/src/ada-tests/support/timer_driver.ads +++ /dev/null @@ -1,77 +0,0 @@ --- --- Timer_Driver / Specification --- --- Description: --- --- This package is the specification for the Timer Driver. --- --- Dependencies: --- --- --- --- COPYRIGHT (c) 1989-1997. --- 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; - -package Timer_Driver is - --- --- Initialize --- --- Description: --- --- This subprogram initializes the hardware timer to start it. --- - - procedure Initialize; - pragma Import (C, Initialize, "benchmark_timer_initialize"); - --- --- Read_Timer --- --- Description: --- --- This subprogram stops the timer, calculates the length of time --- in microseconds since the timer was started, and returns that --- value. --- - - function Read_Timer - return RTEMS.Unsigned32; - pragma Import (C, Read_Timer, "benchmark_timer_read"); - --- --- Empty_Function --- --- Description: --- --- This subprogram is an empty subprogram. It is used to --- insure that a loop will be included in the final executable --- so that loop overhead can be subtracted from the directive --- times reported. --- - - procedure Empty_Function; - --- --- Set_Find_Average_Overhead --- --- Description: --- --- This subprogram sets the Find_Average_Overhead flag to the --- the value passed. --- - - procedure Set_Find_Average_Overhead ( - Find_Flag : in Standard.Boolean - ); - -private - -end Timer_Driver; diff --git a/c/src/ada-tests/support/unsigned32_io.ads b/c/src/ada-tests/support/unsigned32_io.ads deleted file mode 100644 index 4d1a7e6e87..0000000000 --- a/c/src/ada-tests/support/unsigned32_io.ads +++ /dev/null @@ -1,25 +0,0 @@ --- --- Unsigned32_IO / Specification --- --- DESCRIPTION: --- --- This package instantiates the IO routines necessary to --- perform IO on data of the type RTEMS.Unsigned32. --- --- DEPENDENCIES: --- --- --- --- COPYRIGHT (c) 1989-1997. --- 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 Text_IO; - -package Unsigned32_IO is new Text_IO.Modular_IO( RTEMS.Unsigned32 ); - diff --git a/c/src/ada-tests/tmtests/Makefile.am b/c/src/ada-tests/tmtests/Makefile.am deleted file mode 100644 index 64b5f6fe48..0000000000 --- a/c/src/ada-tests/tmtests/Makefile.am +++ /dev/null @@ -1,33 +0,0 @@ -_SUBDIRS = -_SUBDIRS += tm01 -_SUBDIRS += tm02 -_SUBDIRS += tm03 -_SUBDIRS += tm04 -_SUBDIRS += tm05 -_SUBDIRS += tm06 -_SUBDIRS += tm07 -_SUBDIRS += tm08 -_SUBDIRS += tm09 -_SUBDIRS += tm10 -_SUBDIRS += tm11 -_SUBDIRS += tm12 -_SUBDIRS += tm13 -_SUBDIRS += tm14 -_SUBDIRS += tm15 -_SUBDIRS += tm16 -_SUBDIRS += tm17 -_SUBDIRS += tm18 -_SUBDIRS += tm19 -_SUBDIRS += tm20 -_SUBDIRS += tm21 -_SUBDIRS += tm22 -_SUBDIRS += tm23 -_SUBDIRS += tm24 -_SUBDIRS += tm25 -_SUBDIRS += tm28 -_SUBDIRS += tm29 -_SUBDIRS += tmck -_SUBDIRS += tmoverhd - -include $(top_srcdir)/../../../testsuites/automake/subdirs.am -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/tmtests/tm01/Makefile.am b/c/src/ada-tests/tmtests/tm01/Makefile.am deleted file mode 100644 index 18932e9c15..0000000000 --- a/c/src/ada-tests/tmtests/tm01/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_tm01 -ada_tm01_SOURCES = tm01.adb config.h tmtest.adb tmtest.ads -ada_tm01_SOURCES += ../../support/init.c - -ada_tm01$(EXEEXT): tm01.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/tmtests/tm01/config.h b/c/src/ada-tests/tmtests/tm01/config.h deleted file mode 100644 index 7730385b3c..0000000000 --- a/c/src/ada-tests/tmtests/tm01/config.h +++ /dev/null @@ -1,32 +0,0 @@ -/* config.h - * - * This include file defines the Configuration Table for this test. - * - * COPYRIGHT (c) 1989-1997. - * 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_TMTEST - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 2 -#define CONFIGURE_MAXIMUM_SEMAPHORES 1 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/tmtests/tm01/tm01.adb b/c/src/ada-tests/tmtests/tm01/tm01.adb deleted file mode 100644 index 47c83a17e0..0000000000 --- a/c/src/ada-tests/tmtests/tm01/tm01.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test TM01 of the Timing 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 TMTEST; -with TEST_SUPPORT; - -procedure TM01 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, - TMTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end TM01; - diff --git a/c/src/ada-tests/tmtests/tm01/tmtest.adb b/c/src/ada-tests/tmtests/tm01/tmtest.adb deleted file mode 100644 index 31e54aa40f..0000000000 --- a/c/src/ada-tests/tmtests/tm01/tmtest.adb +++ /dev/null @@ -1,273 +0,0 @@ --- --- TMTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 1 of the RTEMS --- Timing 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 INTERFACES; use INTERFACES; -with RTEMS_CALLING_OVERHEAD; -with TEST_SUPPORT; -with TEXT_IO; -with TIME_TEST_SUPPORT; -with TIMER_DRIVER; -with RTEMS.SEMAPHORE; - -package body TMTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TIME TEST 1 ***" ); - - TMTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); - TMTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' ); - TMTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' ); - - RTEMS.TASKS.CREATE( - TMTEST.TASK_NAME( 1 ), - 1, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - TMTEST.TASK_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" ); - - RTEMS.TASKS.START( - TMTEST.TASK_ID( 1 ), - TMTEST.TASK_1'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); - - 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); - SEMAPHORE_OBTAIN_TIME : RTEMS.UNSIGNED32; - SEMAPHORE_RELEASE_TIME : RTEMS.UNSIGNED32; - SEMAPHORE_OBTAIN_NO_WAIT_TIME : RTEMS.UNSIGNED32; - SEMAPHORE_OBTAIN_LOOP_TIME : RTEMS.UNSIGNED32; - SEMAPHORE_RELEASE_LOOP_TIME : RTEMS.UNSIGNED32; - NAME : RTEMS.NAME; - SMID : RTEMS.ID; - STATUS : RTEMS.STATUS_CODES; - begin - - 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; - --- Time one invocation of SEMAPHORE_CREATE - - TIMER_DRIVER.INITIALIZE; - - RTEMS.SEMAPHORE.CREATE( - NAME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - RTEMS.DEFAULT_ATTRIBUTES, - RTEMS.TASKS.NO_PRIORITY, - SMID, - STATUS - ); - - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "SEMAPHORE_CREATE", - TMTEST.END_TIME, - 1, - 0, - RTEMS_CALLING_OVERHEAD.SEMAPHORE_CREATE - ); - --- Time one invocation of SEMAPHORE_DELETE - - TIMER_DRIVER.INITIALIZE; - - RTEMS.SEMAPHORE.DELETE( SMID, STATUS ); - - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "SEMAPHORE_DELETE", - TMTEST.END_TIME, - 1, - 0, - RTEMS_CALLING_OVERHEAD.SEMAPHORE_DELETE - ); - --- Create semaphore for repeated operations. - - RTEMS.SEMAPHORE.CREATE( - NAME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - RTEMS.DEFAULT_ATTRIBUTES, - RTEMS.TASKS.NO_PRIORITY, - SMID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE" ); - --- Perform repeated SEMAPHORE OBTAIN's and RELEASE's - - for ITERATIONS in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - TIMER_DRIVER.EMPTY_FUNCTION; - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - SEMAPHORE_OBTAIN_LOOP_TIME := SEMAPHORE_OBTAIN_LOOP_TIME + - TMTEST.END_TIME; - SEMAPHORE_RELEASE_LOOP_TIME := SEMAPHORE_RELEASE_LOOP_TIME + - TMTEST.END_TIME; - - -- Semaphore_obtain (available loop) - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - - RTEMS.SEMAPHORE.OBTAIN( - SMID, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - STATUS - ); - - end loop; - - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - SEMAPHORE_OBTAIN_TIME := SEMAPHORE_OBTAIN_TIME + TMTEST.END_TIME; - - -- Semaphore_release - - TIMER_DRIVER.INITIALIZE; - - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - - RTEMS.SEMAPHORE.RELEASE( SMID, STATUS ); - - end loop; - - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - SEMAPHORE_RELEASE_TIME := SEMAPHORE_RELEASE_TIME + - TMTEST.END_TIME; - - -- Semaphore_p (NO_WAIT) - - TIMER_DRIVER.INITIALIZE; - - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - - RTEMS.SEMAPHORE.OBTAIN( - SMID, - RTEMS.NO_WAIT, - RTEMS.NO_TIMEOUT, - STATUS - ); - - end loop; - - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - SEMAPHORE_OBTAIN_NO_WAIT_TIME := - SEMAPHORE_OBTAIN_NO_WAIT_TIME + TMTEST.END_TIME; - - -- Semaphore_v - - TIMER_DRIVER.INITIALIZE; - - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - - RTEMS.SEMAPHORE.RELEASE( SMID, STATUS ); - - end loop; - - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - SEMAPHORE_RELEASE_TIME := SEMAPHORE_RELEASE_TIME + - TMTEST.END_TIME; - - end loop; - - TIME_TEST_SUPPORT.PUT_TIME( - "SEMAPHORE_OBTAIN (semaphore available)", - SEMAPHORE_OBTAIN_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT * - TIME_TEST_SUPPORT.OPERATION_COUNT, - SEMAPHORE_OBTAIN_LOOP_TIME, - RTEMS_CALLING_OVERHEAD.SEMAPHORE_OBTAIN - ); - - TIME_TEST_SUPPORT.PUT_TIME( - "SEMAPHORE_OBTAIN (NO_WAIT)", - SEMAPHORE_OBTAIN_NO_WAIT_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT * - TIME_TEST_SUPPORT.OPERATION_COUNT, - SEMAPHORE_OBTAIN_LOOP_TIME, - RTEMS_CALLING_OVERHEAD.SEMAPHORE_OBTAIN - ); - - TIME_TEST_SUPPORT.PUT_TIME( - "SEMAPHORE_RELEASE (no task waiting)", - SEMAPHORE_RELEASE_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT * - TIME_TEST_SUPPORT.OPERATION_COUNT * 2, - SEMAPHORE_RELEASE_LOOP_TIME * 2, - RTEMS_CALLING_OVERHEAD.SEMAPHORE_RELEASE - ); - - TEXT_IO.PUT_LINE( "*** END OF TIME TEST 1 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end TASK_1; - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm01/tmtest.ads b/c/src/ada-tests/tmtests/tm01/tmtest.ads deleted file mode 100644 index 6d00d05715..0000000000 --- a/c/src/ada-tests/tmtests/tm01/tmtest.ads +++ /dev/null @@ -1,67 +0,0 @@ --- --- TMTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 1 of the RTEMS --- Timing 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; - -package TMTEST is - --- --- These arrays contain the IDs and NAMEs of all RTEMS tasks created --- by this test. --- - - TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; - TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; - --- --- The following variable is set to the execution time returned --- by the timer. --- - - END_TIME : RTEMS.UNSIGNED32; - --- --- 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 performs the all of the timing operations in this test. --- - - procedure TASK_1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_1); - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm02/Makefile.am b/c/src/ada-tests/tmtests/tm02/Makefile.am deleted file mode 100644 index c8d86e77ba..0000000000 --- a/c/src/ada-tests/tmtests/tm02/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_tm02 -ada_tm02_SOURCES = tm02.adb config.h tmtest.adb tmtest.ads -ada_tm02_SOURCES += ../../support/init.c - -ada_tm02$(EXEEXT): tm02.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/tmtests/tm02/config.h b/c/src/ada-tests/tmtests/tm02/config.h deleted file mode 100644 index b03802dcc5..0000000000 --- a/c/src/ada-tests/tmtests/tm02/config.h +++ /dev/null @@ -1,33 +0,0 @@ -/* config.h - * - * This include file defines the Configuration Table for this test. - * - * COPYRIGHT (c) 1989-1997. - * 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_TMTEST - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 111 -#define CONFIGURE_MAXIMUM_TIMERS 110 -#define CONFIGURE_MAXIMUM_SEMAPHORES 101 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/tmtests/tm02/tm02.adb b/c/src/ada-tests/tmtests/tm02/tm02.adb deleted file mode 100644 index 9476c87878..0000000000 --- a/c/src/ada-tests/tmtests/tm02/tm02.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test TM02 of the Timing 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 TMTEST; -with TEST_SUPPORT; - -procedure TM02 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, - TMTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end TM02; - diff --git a/c/src/ada-tests/tmtests/tm02/tmtest.adb b/c/src/ada-tests/tmtests/tm02/tmtest.adb deleted file mode 100644 index 8fc9df5b18..0000000000 --- a/c/src/ada-tests/tmtests/tm02/tmtest.adb +++ /dev/null @@ -1,206 +0,0 @@ --- --- TMTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 2 of the RTEMS --- Timing 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 INTERFACES; use INTERFACES; -with RTEMS_CALLING_OVERHEAD; -with TEST_SUPPORT; -with TEXT_IO; -with TIME_TEST_SUPPORT; -with TIMER_DRIVER; -with RTEMS.SEMAPHORE; - -package body TMTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TIME TEST 2 ***" ); - - TMTEST.TEST_INIT; - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- TEST_INIT --- - - procedure TEST_INIT is - PRIORITY : RTEMS.TASKS.PRIORITY; - HIGH_ID : RTEMS.ID; - LOW_ID : RTEMS.ID; - TASK_ID : RTEMS.ID; - STATUS : RTEMS.STATUS_CODES; - begin - - PRIORITY := 5; - - RTEMS.TASKS.CREATE( - RTEMS.BUILD_NAME( 'H', 'I', 'G', 'H' ), - PRIORITY, - 1024, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - HIGH_ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF HIGH TASK" ); - - PRIORITY := PRIORITY + 1; - - RTEMS.TASKS.START( - HIGH_ID, - TMTEST.HIGH_TASK'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF HIGH TASK" ); - - for INDEX in 2 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - - RTEMS.TASKS.CREATE( - RTEMS.BUILD_NAME( 'M', 'I', 'D', ' ' ), - PRIORITY, - 1024, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - TASK_ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE MIDDLE" ); - - PRIORITY := PRIORITY + 1; - - RTEMS.TASKS.START( - TASK_ID, - TMTEST.MIDDLE_TASKS'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START MIDDLE" ); - - end loop; - - RTEMS.TASKS.CREATE( - RTEMS.BUILD_NAME( 'L', 'O', 'W', ' ' ), - PRIORITY, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - LOW_ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF LOW TASK" ); - - RTEMS.TASKS.START( LOW_ID, TMTEST.LOW_TASK'ACCESS, 0, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF LOW TASK" ); - - RTEMS.SEMAPHORE.CREATE( - RTEMS.BUILD_NAME( 'S', 'M', '1', ' ' ), - 0, - RTEMS.DEFAULT_ATTRIBUTES, - RTEMS.TASKS.NO_PRIORITY, - TMTEST.SEMAPHORE_ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE OF SM1" ); - - end TEST_INIT; - --- --- HIGH_TASK --- - - procedure HIGH_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TIMER_DRIVER.INITIALIZE; - RTEMS.SEMAPHORE.OBTAIN( - TMTEST.SEMAPHORE_ID, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN" ); - - end HIGH_TASK; - --- --- MIDDLE_TASKS --- - - procedure MIDDLE_TASKS ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.SEMAPHORE.OBTAIN( - TMTEST.SEMAPHORE_ID, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN" ); - - end MIDDLE_TASKS; - --- --- LOW_TASK --- - - procedure LOW_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - begin - - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - TIME_TEST_SUPPORT.PUT_TIME( - "SEMAPHORE_OBTAIN (blocking)", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - 0, - RTEMS_CALLING_OVERHEAD.SEMAPHORE_OBTAIN - ); - - TEXT_IO.PUT_LINE( "*** END OF TIME TEST 2 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end LOW_TASK; - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm02/tmtest.ads b/c/src/ada-tests/tmtests/tm02/tmtest.ads deleted file mode 100644 index 0857c93313..0000000000 --- a/c/src/ada-tests/tmtests/tm02/tmtest.ads +++ /dev/null @@ -1,104 +0,0 @@ --- --- TMTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 2 of the RTEMS --- Timing 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; - -package TMTEST is - --- --- The following is the ID of the semaphore used for timing operations. --- - - SEMAPHORE_ID : RTEMS.ID; - --- --- The following variable is set to the execution time returned --- by the timer. --- - - END_TIME : RTEMS.UNSIGNED32; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- TEST_INIT --- --- DESCRIPTION: --- --- This subprogram performs test initialization. --- - - procedure TEST_INIT; - --- --- HIGH_TASK --- --- DESCRIPTION: --- --- This RTEMS task starts the timer and performs a blocking --- SEMAPHORE_OBTAIN. --- - - procedure HIGH_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, HIGH_TASK); - --- --- MIDDLE_TASKS --- --- DESCRIPTION: --- --- These RTEMS task start the timer and performs a blocking --- SEMAPHORE_OBTAIN. --- - - procedure MIDDLE_TASKS ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, MIDDLE_TASKS); - --- --- LOW_TASK --- --- DESCRIPTION: --- --- This RTEMS task stops the timer and reports the execution time for --- a blocking SEMAPHORE_OBTAIN. --- - - procedure LOW_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, LOW_TASK); - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm03/Makefile.am b/c/src/ada-tests/tmtests/tm03/Makefile.am deleted file mode 100644 index ea61d4b209..0000000000 --- a/c/src/ada-tests/tmtests/tm03/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_tm03 -ada_tm03_SOURCES = tm03.adb config.h tmtest.adb tmtest.ads -ada_tm03_SOURCES += ../../support/init.c - -ada_tm03$(EXEEXT): tm03.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/tmtests/tm03/config.h b/c/src/ada-tests/tmtests/tm03/config.h deleted file mode 100644 index b03802dcc5..0000000000 --- a/c/src/ada-tests/tmtests/tm03/config.h +++ /dev/null @@ -1,33 +0,0 @@ -/* config.h - * - * This include file defines the Configuration Table for this test. - * - * COPYRIGHT (c) 1989-1997. - * 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_TMTEST - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 111 -#define CONFIGURE_MAXIMUM_TIMERS 110 -#define CONFIGURE_MAXIMUM_SEMAPHORES 101 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/tmtests/tm03/tm03.adb b/c/src/ada-tests/tmtests/tm03/tm03.adb deleted file mode 100644 index 9a95e5e1d0..0000000000 --- a/c/src/ada-tests/tmtests/tm03/tm03.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test TM03 of the Timing 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 TMTEST; -with TEST_SUPPORT; - -procedure TM03 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, - TMTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end TM03; - diff --git a/c/src/ada-tests/tmtests/tm03/tmtest.adb b/c/src/ada-tests/tmtests/tm03/tmtest.adb deleted file mode 100644 index a6e7606920..0000000000 --- a/c/src/ada-tests/tmtests/tm03/tmtest.adb +++ /dev/null @@ -1,190 +0,0 @@ --- --- TMTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 3 of the RTEMS --- Timing 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 INTERFACES; use INTERFACES; -with RTEMS_CALLING_OVERHEAD; -with TEST_SUPPORT; -with TEXT_IO; -with TIME_TEST_SUPPORT; -with TIMER_DRIVER; -with RTEMS.SEMAPHORE; - -package body TMTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - TASK_ID : RTEMS.ID; - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TIME TEST 3 ***" ); - - RTEMS.TASKS.CREATE( - RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ), - 252, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - TASK_ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TEST_INIT" ); - - RTEMS.TASKS.START( TASK_ID, TMTEST.TEST_INIT'ACCESS, 0, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TEST_INIT" ); - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- TEST_INIT --- - - procedure TEST_INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - PRIORITY : RTEMS.TASKS.PRIORITY; - TASK_ID : RTEMS.ID; - STATUS : RTEMS.STATUS_CODES; - begin - - PRIORITY := 250; - - RTEMS.SEMAPHORE.CREATE( - RTEMS.BUILD_NAME( 'S', 'M', '1', ' ' ), - 0, - RTEMS.DEFAULT_ATTRIBUTES, - RTEMS.TASKS.NO_PRIORITY, - TMTEST.SEMAPHORE_ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE OF SM1" ); - - for INDEX in 2 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - - RTEMS.TASKS.CREATE( - RTEMS.BUILD_NAME( 'M', 'I', 'D', ' ' ), - PRIORITY, - 1024, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - TASK_ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE MIDDLE" ); - - PRIORITY := PRIORITY - 1; - - RTEMS.TASKS.START( TASK_ID, TMTEST.MIDDLE_TASKS'ACCESS, 0, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START MIDDLE" ); - - end loop; - - RTEMS.TASKS.CREATE( - RTEMS.BUILD_NAME( 'H', 'I', 'G', 'H' ), - PRIORITY, - 1024, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - TASK_ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF HIGH TASK" ); - - RTEMS.TASKS.START( TASK_ID, TMTEST.HIGH_TASK'ACCESS, 0, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF HIGH TASK" ); - - TIMER_DRIVER.INITIALIZE; - RTEMS.SEMAPHORE.RELEASE( TMTEST.SEMAPHORE_ID, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE" ); - - end TEST_INIT; - --- --- MIDDLE_TASKS --- - - procedure MIDDLE_TASKS ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.SEMAPHORE.OBTAIN( - TMTEST.SEMAPHORE_ID, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN" ); - - RTEMS.SEMAPHORE.RELEASE( TMTEST.SEMAPHORE_ID, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE" ); - - end MIDDLE_TASKS; - --- --- HIGH_TASK --- - - procedure HIGH_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.SEMAPHORE.OBTAIN( - TMTEST.SEMAPHORE_ID, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - STATUS - ); - - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "LAST CALL DID NOT WORK" ); - - TIME_TEST_SUPPORT.PUT_TIME( - "SEMAPHORE_RELEASE (preemptive)", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - 0, - RTEMS_CALLING_OVERHEAD.SEMAPHORE_RELEASE - ); - - TEXT_IO.PUT_LINE( "*** END OF TIME TEST 3 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end HIGH_TASK; - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm03/tmtest.ads b/c/src/ada-tests/tmtests/tm03/tmtest.ads deleted file mode 100644 index 4acd5f7a77..0000000000 --- a/c/src/ada-tests/tmtests/tm03/tmtest.ads +++ /dev/null @@ -1,96 +0,0 @@ --- --- TMTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 3 of the RTEMS --- Timing 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; - -package TMTEST is - --- --- The following is the ID of the semaphore used for timing operations. --- - - SEMAPHORE_ID : RTEMS.ID; - --- --- The following variable is set to the execution time returned --- by the timer. --- - - END_TIME : RTEMS.UNSIGNED32; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- TEST_INIT --- --- DESCRIPTION: --- --- This subprogram performs test initialization. After completion --- of test initialization, the timer is started and a preemptive --- SEMAPHORE_RELEASE is performed. --- - - procedure TEST_INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TEST_INIT); - --- --- MIDDLE_TASKS --- --- DESCRIPTION: --- --- This RTEMS task performs a blocking SEMAPHORE_OBTAIN. Once --- is obtains the semaphore unit and executes again, it performs --- a preemptive SEMAPHORE_RELEASE. --- - - procedure MIDDLE_TASKS ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, MIDDLE_TASKS); - --- --- HIGH_TASK --- --- DESCRIPTION: --- --- This RTEMS task stops the timer and reports the execution --- timer for a preemptive SEMAPHORE_RELEASE. --- - - procedure HIGH_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, HIGH_TASK); - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm04/Makefile.am b/c/src/ada-tests/tmtests/tm04/Makefile.am deleted file mode 100644 index 744e383ce7..0000000000 --- a/c/src/ada-tests/tmtests/tm04/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_tm04 -ada_tm04_SOURCES = tm04.adb config.h tmtest.adb tmtest.ads -ada_tm04_SOURCES += ../../support/init.c - -ada_tm04$(EXEEXT): tm04.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/tmtests/tm04/config.h b/c/src/ada-tests/tmtests/tm04/config.h deleted file mode 100644 index 700438ceae..0000000000 --- a/c/src/ada-tests/tmtests/tm04/config.h +++ /dev/null @@ -1,32 +0,0 @@ -/* config.h - * - * This include file defines the Configuration Table for this test. - * - * COPYRIGHT (c) 1989-1997. - * 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_TMTEST - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 111 -#define CONFIGURE_MAXIMUM_SEMAPHORES 1 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/tmtests/tm04/tm04.adb b/c/src/ada-tests/tmtests/tm04/tm04.adb deleted file mode 100644 index 28e75c7db5..0000000000 --- a/c/src/ada-tests/tmtests/tm04/tm04.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test TM04 of the Timing 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 TMTEST; -with TEST_SUPPORT; - -procedure TM04 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, - TMTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end TM04; - diff --git a/c/src/ada-tests/tmtests/tm04/tmtest.adb b/c/src/ada-tests/tmtests/tm04/tmtest.adb deleted file mode 100644 index 7278bf2432..0000000000 --- a/c/src/ada-tests/tmtests/tm04/tmtest.adb +++ /dev/null @@ -1,494 +0,0 @@ --- --- TMTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 4 of the RTEMS --- Timing 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 INTERFACES; use INTERFACES; -with RTEMS_CALLING_OVERHEAD; -with TEST_SUPPORT; -with TEXT_IO; -with TIMER_DRIVER; -with RTEMS.SEMAPHORE; - -package body TMTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TIME TEST 4 ***" ); - - TMTEST.TEST_INIT; - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- TEST_INIT --- - - procedure TEST_INIT - is - STATUS : RTEMS.STATUS_CODES; - begin - - TMTEST.TASK_COUNT := TIME_TEST_SUPPORT.OPERATION_COUNT; - - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - - RTEMS.TASKS.CREATE( - RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ), - 10, - 1024, - RTEMS.NO_PREEMPT, - RTEMS.DEFAULT_ATTRIBUTES, - TMTEST.TASK_ID( INDEX ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); - - RTEMS.TASKS.START( - TMTEST.TASK_ID( INDEX ), - TMTEST.LOW_TASKS'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); - - end loop; - - RTEMS.SEMAPHORE.CREATE( - RTEMS.BUILD_NAME( 'S', 'M', '1', ' ' ), - 0, - RTEMS.DEFAULT_ATTRIBUTES, - RTEMS.TASKS.NO_PRIORITY, - TMTEST.SEMAPHORE_ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE OF SM1" ); - - end TEST_INIT; - --- --- HIGHEST_TASK --- - - procedure HIGHEST_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - OLD_PRIORITY : RTEMS.TASKS.PRIORITY; - STATUS : RTEMS.STATUS_CODES; - begin - - if ARGUMENT = 1 then - - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TASK_RESTART (blocked, preempt)", - TMTEST.END_TIME, - 1, - 0, - RTEMS_CALLING_OVERHEAD.TASK_RESTART - ); - - RTEMS.TASKS.SET_PRIORITY( RTEMS.SELF, 254, OLD_PRIORITY, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" ); - - elsif ARGUMENT = 2 then - - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TASK_RESTART (ready, preempt)", - TMTEST.END_TIME, - 1, - 0, - RTEMS_CALLING_OVERHEAD.TASK_RESTART - ); - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE" ); - - else - - RTEMS.SEMAPHORE.OBTAIN( - TMTEST.SEMAPHORE_ID, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - STATUS - ); - - end if; - - end HIGHEST_TASK; - --- --- HIGH_TASK --- - - procedure HIGH_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - OLD_PRIORITY : RTEMS.TASKS.PRIORITY; - OVERHEAD : RTEMS.UNSIGNED32; - NAME : RTEMS.NAME; - STATUS : RTEMS.STATUS_CODES; - begin - - TIMER_DRIVER.INITIALIZE; - RTEMS.TASKS.RESTART( TMTEST.HIGHEST_ID, 1, STATUS ); - -- preempted by Higher_task - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESTART" ); - - TIMER_DRIVER.INITIALIZE; - RTEMS.TASKS.RESTART( TMTEST.HIGHEST_ID, 2, STATUS ); - -- preempted by Higher_task - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESTART" ); - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - TIMER_DRIVER.EMPTY_FUNCTION; - end loop; - OVERHEAD := TIMER_DRIVER.READ_TIMER; - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.SEMAPHORE.RELEASE( TMTEST.SEMAPHORE_ID, STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE" ); - - TIME_TEST_SUPPORT.PUT_TIME( - "SEMAPHORE_RELEASE (readying)", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - RTEMS_CALLING_OVERHEAD.SEMAPHORE_RELEASE - ); - - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.TASKS.DELETE( TMTEST.TASK_ID( INDEX ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE" ); - end loop; - - NAME := RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ); - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.TASKS.CREATE( - NAME, - 10, - 1024, - RTEMS.NO_PREEMPT, - RTEMS.DEFAULT_ATTRIBUTES, - TMTEST.TASK_ID( INDEX ), - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TASK_CREATE", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - RTEMS_CALLING_OVERHEAD.TASK_CREATE - ); - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.TASKS.START( - TMTEST.TASK_ID( INDEX ), - TMTEST.LOW_TASKS'ACCESS, - 0, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TASK_START", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - RTEMS_CALLING_OVERHEAD.TASK_START - ); - - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.TASKS.DELETE( TMTEST.TASK_ID( INDEX ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE LOOP" ); - end loop; - - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.TASKS.CREATE( - NAME, - 250, - 1024, - RTEMS.NO_PREEMPT, - RTEMS.DEFAULT_ATTRIBUTES, - TMTEST.TASK_ID( INDEX ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); - RTEMS.TASKS.START( - TMTEST.TASK_ID( INDEX ), - TMTEST.RESTART_TASK'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); - RTEMS.TASKS.SUSPEND( TMTEST.TASK_ID( INDEX ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND LOOP" ); - end loop; - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.TASKS.RESTART( TMTEST.TASK_ID( INDEX ), 0, STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TASK_RESTART (suspended)", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - RTEMS_CALLING_OVERHEAD.TASK_RESTART - ); - - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.TASKS.SUSPEND( TMTEST.TASK_ID( INDEX ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND LOOP" ); - end loop; - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.TASKS.DELETE( TMTEST.TASK_ID( INDEX ), STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TASK_DELETE (suspended)", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - RTEMS_CALLING_OVERHEAD.TASK_DELETE - ); - - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.TASKS.CREATE( - NAME, - 250, - 1024, - RTEMS.DEFAULT_OPTIONS, - RTEMS.DEFAULT_ATTRIBUTES, - TMTEST.TASK_ID( INDEX ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); - RTEMS.TASKS.START( - TMTEST.TASK_ID( INDEX ), - TMTEST.RESTART_TASK'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); - end loop; - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.TASKS.RESTART( TMTEST.TASK_ID( INDEX ), 1, STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TASK_RESTART (ready)", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - RTEMS_CALLING_OVERHEAD.TASK_RESTART - ); - - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.TASKS.SET_PRIORITY( - TMTEST.TASK_ID( INDEX ), - 5, - OLD_PRIORITY, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY LOOP" ); - end loop; - - -- yield processor -- tasks block - RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.TASKS.RESTART( TMTEST.TASK_ID( INDEX ), 1, STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TASK_RESTART (blocked, no preempt)", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - RTEMS_CALLING_OVERHEAD.TASK_RESTART - ); - - -- yield processor -- tasks block - RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.TASKS.DELETE( TMTEST.TASK_ID( INDEX ), STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TASK_DELETE (blocked)", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - RTEMS_CALLING_OVERHEAD.TASK_DELETE - ); - - TEXT_IO.PUT_LINE( "*** END OF TIME TEST 4 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end HIGH_TASK; - --- --- LOW_TASKS --- - - procedure LOW_TASKS ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - ID : RTEMS.ID; - STATUS : RTEMS.STATUS_CODES; - begin - - TMTEST.TASK_COUNT := TMTEST.TASK_COUNT - 1; - - if TMTEST.TASK_COUNT = 0 then - - RTEMS.TASKS.CREATE( - RTEMS.BUILD_NAME( 'H', 'I', ' ', ' ' ), - 5, - 2048, - RTEMS.DEFAULT_OPTIONS, - RTEMS.DEFAULT_ATTRIBUTES, - ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE HI" ); - - RTEMS.TASKS.START( - ID, - TMTEST.HIGH_TASK'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START HI" ); - - - RTEMS.TASKS.CREATE( - RTEMS.BUILD_NAME( 'H', 'I', 'G', 'H' ), - 3, - 2048, - RTEMS.DEFAULT_OPTIONS, - RTEMS.DEFAULT_ATTRIBUTES, - TMTEST.HIGHEST_ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE HIGH" ); - - RTEMS.TASKS.START( - TMTEST.HIGHEST_ID, - TMTEST.HIGHEST_TASK'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START HIGH" ); - - - end if; - - RTEMS.SEMAPHORE.OBTAIN( - TMTEST.SEMAPHORE_ID, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN" ); - - end LOW_TASKS; - --- --- RESTART_TASK --- - - procedure RESTART_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - STATUS : RTEMS.STATUS_CODES; - begin - - if ARGUMENT = 1 then - RTEMS.SEMAPHORE.OBTAIN( - TMTEST.SEMAPHORE_ID, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - STATUS - ); - end if; - - end RESTART_TASK; - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm04/tmtest.ads b/c/src/ada-tests/tmtests/tm04/tmtest.ads deleted file mode 100644 index e1f303ee2f..0000000000 --- a/c/src/ada-tests/tmtests/tm04/tmtest.ads +++ /dev/null @@ -1,163 +0,0 @@ --- --- TMTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 4 of the RTEMS --- Timing 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 TIME_TEST_SUPPORT; -with RTEMS; -with RTEMS.TASKS; - -package TMTEST is - --- --- This array contains the IDs of all RTEMS tasks created by this test. --- - - TASK_ID : array ( RTEMS.UNSIGNED32 - range 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.ID; - --- --- This variable contains the id of the highest priority task --- in the system. --- - - HIGHEST_ID : RTEMS.ID; - --- --- The following is the ID of the semaphore used for timing operations. --- - - SEMAPHORE_ID : RTEMS.ID; - --- --- The following is used to perform the same operation --- on a group of tasks. --- - - TASK_COUNT : RTEMS.UNSIGNED32; - --- --- The following variable is set to the execution time returned --- by the timer. --- - - END_TIME : RTEMS.UNSIGNED32; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- TEST_INIT --- --- DESCRIPTION: --- --- This subprogram performs test initialization. --- - - procedure TEST_INIT; - --- --- HIGHEST_TASK --- --- DESCRIPTION: --- --- This RTEMS task is created by one of the LOW_TASKS. The --- first time it executes, it performs a blocking SEMAPHORE_OBTAIN --- which transfers control of the processor to HIGH_TASK. --- The first time HIGHEST_TASK is restarted, it stops the --- timer and reports the execution time for a TASK_RESTART --- for a blocked task which preempts the caller. The second --- time HIGHEST_TASK is restarted, it stops the timer and reports --- the execution time for a TASK_RESTART for a ready task which --- has its original priority restored and preempts the caller. --- - - procedure HIGHEST_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, HIGHEST_TASK); - --- --- HIGH_TASK --- --- DESCRIPTION: --- --- This RTEMS task is created by one of the LOW_TASKS. This --- task restarts HIGHEST_TASK twice. HIGHEST_TASK is blocked the --- first time and preempts this task when restarted. HIGHEST_TASK --- is ready the second time but has lowered its priority. When --- restarted for the second time, HIGHEST_TASK will have its --- original priority restored and preempt this task. --- Once control of the processor is returned to this task after --- HIGHEST_TASK deletes itself, the following execution times --- are measured and reported. --- --- + readying SEMAPHORE_RELEASE --- + TASK_CREATE --- + TASK_START --- + TASK_RESTART of a suspended task --- + TASK_DELETE of a suspended task --- + TASK_RESTART of a ready task --- + TASK_RESTART of a blocked task which does not cause a preempt --- + TASK_DELETE of a blocked task --- - - procedure HIGH_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, HIGH_TASK); - --- --- LOW_TASKS --- --- DESCRIPTION: --- --- The last of these RTEMS tasks to execute creates HIGH_TASK --- and HIGHEST_TASK. All of these tasks perform a blocking --- SEMAPHORE_OBTAIN. --- - - procedure LOW_TASKS ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, LOW_TASKS); - --- --- RESTART_TASK --- --- DESCRIPTION: --- --- This RTEMS task --- - - procedure RESTART_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, RESTART_TASK); - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm05/Makefile.am b/c/src/ada-tests/tmtests/tm05/Makefile.am deleted file mode 100644 index 9398956ee6..0000000000 --- a/c/src/ada-tests/tmtests/tm05/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_tm05 -ada_tm05_SOURCES = tm05.adb config.h tmtest.adb tmtest.ads -ada_tm05_SOURCES += ../../support/init.c - -ada_tm05$(EXEEXT): tm05.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/tmtests/tm05/config.h b/c/src/ada-tests/tmtests/tm05/config.h deleted file mode 100644 index b03802dcc5..0000000000 --- a/c/src/ada-tests/tmtests/tm05/config.h +++ /dev/null @@ -1,33 +0,0 @@ -/* config.h - * - * This include file defines the Configuration Table for this test. - * - * COPYRIGHT (c) 1989-1997. - * 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_TMTEST - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 111 -#define CONFIGURE_MAXIMUM_TIMERS 110 -#define CONFIGURE_MAXIMUM_SEMAPHORES 101 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/tmtests/tm05/tm05.adb b/c/src/ada-tests/tmtests/tm05/tm05.adb deleted file mode 100644 index eaa0741592..0000000000 --- a/c/src/ada-tests/tmtests/tm05/tm05.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test TM05 of the Timing 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 TMTEST; -with TEST_SUPPORT; - -procedure TM05 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, - TMTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end TM05; - diff --git a/c/src/ada-tests/tmtests/tm05/tmtest.adb b/c/src/ada-tests/tmtests/tm05/tmtest.adb deleted file mode 100644 index c334acd526..0000000000 --- a/c/src/ada-tests/tmtests/tm05/tmtest.adb +++ /dev/null @@ -1,170 +0,0 @@ --- --- TMTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 5 of the RTEMS --- Timing 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 INTERFACES; use INTERFACES; -with RTEMS_CALLING_OVERHEAD; -with TEST_SUPPORT; -with TEXT_IO; -with TIMER_DRIVER; - -package body TMTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TIME TEST 5 ***" ); - - TMTEST.TEST_INIT; - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- TEST_INIT --- - - procedure TEST_INIT - is - TASK_ENTRY : RTEMS.TASKS.ENTRY_POINT; - PRIORITY : RTEMS.TASKS.PRIORITY; - STATUS : RTEMS.STATUS_CODES; - begin - - PRIORITY := 250; - - for INDEX in 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - - RTEMS.TASKS.CREATE( - RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ), - PRIORITY, - 1024, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - TMTEST.TASK_ID( INDEX ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); - - PRIORITY := PRIORITY - 1; - - if INDEX = 0 then - TASK_ENTRY := TMTEST.LOW_TASK'ACCESS; - elsif INDEX = TIME_TEST_SUPPORT.OPERATION_COUNT then - TASK_ENTRY := TMTEST.HIGH_TASK'ACCESS; - else - TASK_ENTRY := TMTEST.MIDDLE_TASKS'ACCESS; - end if; - - RTEMS.TASKS.START( TMTEST.TASK_ID( INDEX ), TASK_ENTRY, 0, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); - - end loop; - - end TEST_INIT; - --- --- HIGH_TASK --- - - procedure HIGH_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TIMER_DRIVER.INITIALIZE; - RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPENT" ); - - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - TIME_TEST_SUPPORT.PUT_TIME( - "TASK_RESUME causing preempt", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - 0, - RTEMS_CALLING_OVERHEAD.TASK_RESUME - ); - - TEXT_IO.PUT_LINE( "*** END OF TIME TEST 5 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end HIGH_TASK; - --- --- MIDDLE_TASKS --- - - procedure MIDDLE_TASKS ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND" ); - - TMTEST.TASK_INDEX := TMTEST.TASK_INDEX + 1; - RTEMS.TASKS.RESUME( TMTEST.TASK_ID( TMTEST.TASK_INDEX ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESUME" ); - - end MIDDLE_TASKS; - --- --- LOW_TASK --- - - procedure LOW_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - TIME_TEST_SUPPORT.PUT_TIME( - "TASK_SUSPEND self", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - 0, - RTEMS_CALLING_OVERHEAD.TASK_SUSPEND - ); - - TMTEST.TASK_INDEX := 1; - TIMER_DRIVER.INITIALIZE; - RTEMS.TASKS.RESUME( TMTEST.TASK_ID( TMTEST.TASK_INDEX ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESUME" ); - - end LOW_TASK; - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm05/tmtest.ads b/c/src/ada-tests/tmtests/tm05/tmtest.ads deleted file mode 100644 index f705c936df..0000000000 --- a/c/src/ada-tests/tmtests/tm05/tmtest.ads +++ /dev/null @@ -1,114 +0,0 @@ --- --- TMTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 5 of the RTEMS --- Timing 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 TIME_TEST_SUPPORT; -with RTEMS; -with RTEMS.TASKS; - -package TMTEST is - --- --- This array contains the IDs of all RTEMS tasks created by this test. --- - - TASK_ID : array ( RTEMS.UNSIGNED32 - range 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.ID; - - TASK_INDEX : RTEMS.UNSIGNED32; - --- --- The following variable is set to the execution time returned --- by the timer. --- - - END_TIME : RTEMS.UNSIGNED32; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- TEST_INIT --- --- DESCRIPTION: --- --- This subprogram performs test initialization. --- - - procedure TEST_INIT; - --- --- HIGH_TASK --- --- DESCRIPTION: --- --- This RTEMS task is the highest priority task in the system. --- It starts the timer and performs a TASK_SUSPEND on SELF. --- When this task executes again, it stops the timer and --- reports the execution time for a preemptive TASK_RESUME. --- - - procedure HIGH_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, HIGH_TASK); - --- --- MIDDLE_TASKS --- --- DESCRIPTION: --- --- These RTEMS tasks perform a TASK_SUSPEND on SELF. When each --- task executes again, it performs preemptive TASK_RESUME on --- a higher priority task. --- - - procedure MIDDLE_TASKS ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, MIDDLE_TASKS); - --- --- LOW_TASK --- --- DESCRIPTION: --- --- This RTEMS task is the lowest priority task in the system. --- When this task executes, it stops the timer and reports the --- execution time for a blocking TASK_SUSPEND. After this, --- it starts the timer and performs a TASK_RESUME on a --- higher priority task. --- - - procedure LOW_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, LOW_TASK); - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm06/Makefile.am b/c/src/ada-tests/tmtests/tm06/Makefile.am deleted file mode 100644 index 881effa4fe..0000000000 --- a/c/src/ada-tests/tmtests/tm06/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_tm06 -ada_tm06_SOURCES = tm06.adb config.h tmtest.adb tmtest.ads -ada_tm06_SOURCES += ../../support/init.c - -ada_tm06$(EXEEXT): tm06.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/tmtests/tm06/config.h b/c/src/ada-tests/tmtests/tm06/config.h deleted file mode 100644 index b03802dcc5..0000000000 --- a/c/src/ada-tests/tmtests/tm06/config.h +++ /dev/null @@ -1,33 +0,0 @@ -/* config.h - * - * This include file defines the Configuration Table for this test. - * - * COPYRIGHT (c) 1989-1997. - * 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_TMTEST - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 111 -#define CONFIGURE_MAXIMUM_TIMERS 110 -#define CONFIGURE_MAXIMUM_SEMAPHORES 101 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/tmtests/tm06/tm06.adb b/c/src/ada-tests/tmtests/tm06/tm06.adb deleted file mode 100644 index db064adb4d..0000000000 --- a/c/src/ada-tests/tmtests/tm06/tm06.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test TM06 of the Timing 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 TMTEST; -with TEST_SUPPORT; - -procedure TM06 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, - TMTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end TM06; - diff --git a/c/src/ada-tests/tmtests/tm06/tmtest.adb b/c/src/ada-tests/tmtests/tm06/tmtest.adb deleted file mode 100644 index 2f0f8b1a26..0000000000 --- a/c/src/ada-tests/tmtests/tm06/tmtest.adb +++ /dev/null @@ -1,202 +0,0 @@ --- --- TMTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 6 of the RTEMS --- Timing 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 INTERFACES; use INTERFACES; -with RTEMS_CALLING_OVERHEAD; -with TEST_SUPPORT; -with TEXT_IO; -with TIMER_DRIVER; - -package body TMTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TIME TEST 6 ***" ); - - TMTEST.TEST_INIT; - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- TEST_INIT --- - - procedure TEST_INIT - is - ID : RTEMS.ID; - STATUS : RTEMS.STATUS_CODES; - begin - - TMTEST.TASK_RESTARTED := TIME_TEST_SUPPORT.OPERATION_COUNT; - - RTEMS.TASKS.CREATE( - RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ), - 128, - 1024, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); - - RTEMS.TASKS.START( ID, TMTEST.TASK_1'ACCESS, 0, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); - - end TEST_INIT; - --- --- TASK_1 --- - - procedure TASK_1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - OVERHEAD : RTEMS.UNSIGNED32; - STATUS : RTEMS.STATUS_CODES; - begin - - if TMTEST.TASK_RESTARTED = TIME_TEST_SUPPORT.OPERATION_COUNT then - TIMER_DRIVER.INITIALIZE; - end if; - - TMTEST.TASK_RESTARTED := TMTEST.TASK_RESTARTED - 1; - - if TMTEST.TASK_RESTARTED /= 0 then - RTEMS.TASKS.RESTART( RTEMS.SELF, 0, STATUS ); - end if; - - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - TIMER_DRIVER.EMPTY_FUNCTION; - end loop; - OVERHEAD := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TASK_RESTART self", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - 0, - RTEMS_CALLING_OVERHEAD.TASK_RESTART - ); - - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - - RTEMS.TASKS.CREATE( - RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ), - 254, - 1024, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - TMTEST.TASK_ID( INDEX ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); - - RTEMS.TASKS.START( - TMTEST.TASK_ID( INDEX ), - TMTEST.NULL_TASK'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); - - end loop; - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.TASKS.SUSPEND( TMTEST.TASK_ID( INDEX ), STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - TIME_TEST_SUPPORT.PUT_TIME( - "TASK_SUSPEND no preempt", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - RTEMS_CALLING_OVERHEAD.TASK_SUSPEND - ); - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.TASKS.RESUME( TMTEST.TASK_ID( INDEX ), STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - TIME_TEST_SUPPORT.PUT_TIME( - "TASK_RESUME no preempt", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - RTEMS_CALLING_OVERHEAD.TASK_RESUME - ); - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.TASKS.DELETE( TMTEST.TASK_ID( INDEX ), STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - TIME_TEST_SUPPORT.PUT_TIME( - "TASK_DELETE others", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - RTEMS_CALLING_OVERHEAD.TASK_DELETE - ); - - TEXT_IO.PUT_LINE( "*** END OF TIME TEST 6 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end TASK_1; - --- --- NULL_TASK --- - - procedure NULL_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - begin - - NULL; - - end NULL_TASK; - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm06/tmtest.ads b/c/src/ada-tests/tmtests/tm06/tmtest.ads deleted file mode 100644 index a6eb2b2df8..0000000000 --- a/c/src/ada-tests/tmtests/tm06/tmtest.ads +++ /dev/null @@ -1,104 +0,0 @@ --- --- TMTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 6 of the RTEMS --- Timing 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 TIME_TEST_SUPPORT; -with RTEMS; -with RTEMS.TASKS; - -package TMTEST is - --- --- This array contains the IDs of all RTEMS tasks created by this test. --- - - TASK_ID : array ( RTEMS.UNSIGNED32 - range 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.ID; - --- --- This variable is used to determine which restart of TASK_1 will start --- timer and which will stop the timer and report the execution time. --- - - TASK_RESTARTED : RTEMS.UNSIGNED32; - --- --- The following variable is set to the execution time returned --- by the timer. --- - - END_TIME : RTEMS.UNSIGNED32; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- TEST_INIT --- --- DESCRIPTION: --- --- This subprogram performs test initialization. --- - - procedure TEST_INIT; - --- --- TASK_1 --- --- DESCRIPTION: --- --- This RTEMS task is responsible for measuring and reporting the --- following directive execution times: --- --- + TASK_RESTART of SELF --- + TASK_SUSPEND of another task with no context switch --- + TASK_RESUME with no preemption --- + TASK_DELETE of another task --- - - procedure TASK_1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_1); - --- --- NULL_TASK --- --- DESCRIPTION: --- --- This RTEMS task has no operations. It is used to have --- tasks to perform directives upon. --- - - procedure NULL_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, NULL_TASK); - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm07/Makefile.am b/c/src/ada-tests/tmtests/tm07/Makefile.am deleted file mode 100644 index d4bbd23128..0000000000 --- a/c/src/ada-tests/tmtests/tm07/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_tm07 -ada_tm07_SOURCES = tm07.adb config.h tmtest.adb tmtest.ads -ada_tm07_SOURCES += ../../support/init.c - -ada_tm07$(EXEEXT): tm07.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/tmtests/tm07/config.h b/c/src/ada-tests/tmtests/tm07/config.h deleted file mode 100644 index b03802dcc5..0000000000 --- a/c/src/ada-tests/tmtests/tm07/config.h +++ /dev/null @@ -1,33 +0,0 @@ -/* config.h - * - * This include file defines the Configuration Table for this test. - * - * COPYRIGHT (c) 1989-1997. - * 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_TMTEST - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 111 -#define CONFIGURE_MAXIMUM_TIMERS 110 -#define CONFIGURE_MAXIMUM_SEMAPHORES 101 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/tmtests/tm07/tm07.adb b/c/src/ada-tests/tmtests/tm07/tm07.adb deleted file mode 100644 index 342406b38f..0000000000 --- a/c/src/ada-tests/tmtests/tm07/tm07.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test TM07 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 TMTEST; -with TEST_SUPPORT; - -procedure TM07 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, - TMTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end TM07; - diff --git a/c/src/ada-tests/tmtests/tm07/tmtest.adb b/c/src/ada-tests/tmtests/tm07/tmtest.adb deleted file mode 100644 index c3a2c62b96..0000000000 --- a/c/src/ada-tests/tmtests/tm07/tmtest.adb +++ /dev/null @@ -1,170 +0,0 @@ --- --- TMTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 7 of the RTEMS --- Timing 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 INTERFACES; use INTERFACES; -with RTEMS_CALLING_OVERHEAD; -with TEST_SUPPORT; -with TEXT_IO; -with TIMER_DRIVER; - -package body TMTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TIME TEST 7 ***" ); - - TMTEST.TEST_INIT; - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- TEST_INIT --- - - procedure TEST_INIT - is - TASK_ENTRY : RTEMS.TASKS.ENTRY_POINT; - PRIORITY : RTEMS.TASKS.PRIORITY; - STATUS : RTEMS.STATUS_CODES; - begin - - PRIORITY := 250; - - for INDEX in 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - - RTEMS.TASKS.CREATE( - RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ), - PRIORITY, - 1024, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - TMTEST.TASK_ID( INDEX ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); - - PRIORITY := PRIORITY - 1; - - if INDEX = 0 then - TASK_ENTRY := TMTEST.LOW_TASK'ACCESS; - elsif INDEX = TIME_TEST_SUPPORT.OPERATION_COUNT then - TASK_ENTRY := TMTEST.HIGH_TASK'ACCESS; - else - TASK_ENTRY := TMTEST.MIDDLE_TASKS'ACCESS; - end if; - - RTEMS.TASKS.START( TMTEST.TASK_ID( INDEX ), TASK_ENTRY, 0, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); - - end loop; - - end TEST_INIT; - --- --- HIGH_TASK --- - - procedure HIGH_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - STATUS : RTEMS.STATUS_CODES; - begin - - if ARGUMENT > 0 then - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - TIME_TEST_SUPPORT.PUT_TIME( - "TASK_RESTART suspended/preempt", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - 0, - RTEMS_CALLING_OVERHEAD.TASK_RESTART - ); - else - RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS ); - end if; - - TEXT_IO.PUT_LINE( "*** END OF TIME TEST 07 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end HIGH_TASK; - --- --- MIDDLE_TASKS --- - - procedure MIDDLE_TASKS ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - STATUS : RTEMS.STATUS_CODES; - begin - - TMTEST.TASK_INDEX := TMTEST.TASK_INDEX + 1; - - if ARGUMENT > 0 then - RTEMS.TASKS.RESTART( - TMTEST.TASK_ID( TMTEST.TASK_INDEX ), - 16#7FFFFFFF#, - STATUS - ); - else - RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS ); - end if; - - - end MIDDLE_TASKS; - --- --- LOW_TASK --- - - procedure LOW_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TMTEST.TASK_INDEX := 1; - TIMER_DRIVER.INITIALIZE; - - RTEMS.TASKS.RESTART( - TMTEST.TASK_ID( TMTEST.TASK_INDEX ), - 16#7FFFFFFF#, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESTART" ); - - end LOW_TASK; - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm07/tmtest.ads b/c/src/ada-tests/tmtests/tm07/tmtest.ads deleted file mode 100644 index 3abc539505..0000000000 --- a/c/src/ada-tests/tmtests/tm07/tmtest.ads +++ /dev/null @@ -1,112 +0,0 @@ --- --- TMTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 7 of the RTEMS --- Timing 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 TIME_TEST_SUPPORT; -with RTEMS; -with RTEMS.TASKS; - -package TMTEST is - --- --- This array contains the IDs of all RTEMS tasks created by this test. --- - - TASK_ID : array ( RTEMS.UNSIGNED32 - range 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.ID; - - TASK_INDEX : RTEMS.UNSIGNED32; - --- --- The following variable is set to the execution time returned --- by the timer. --- - - END_TIME : RTEMS.UNSIGNED32; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- TEST_INIT --- --- DESCRIPTION: --- --- This subprogram performs test initialization. --- - - procedure TEST_INIT; - --- --- HIGH_TASK --- --- DESCRIPTION: --- --- This RTEMS task is the highest priority task in the system. --- The first time it executes it suspends itself. When restarted --- it stops the timer and reports the time for a TASK_RESTART --- of a suspended task which results in a preemption. --- - - procedure HIGH_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, HIGH_TASK); - --- --- MIDDLE_TASKS --- --- DESCRIPTION: --- --- These RTEMS tasks suspend themselves the first time they execute. --- When restarted they perform a TASK_RESTART of a suspended --- higher priority task which results in a preemption. --- - - procedure MIDDLE_TASKS ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, MIDDLE_TASKS); - --- --- LOW_TASK --- --- DESCRIPTION: --- --- This RTEMS task is the lowest priority task in the system. --- When it executes it starts the timer and restarts a higher --- priority task which immediately preempts this task. --- - - procedure LOW_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, LOW_TASK); - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm08/Makefile.am b/c/src/ada-tests/tmtests/tm08/Makefile.am deleted file mode 100644 index b37d09d337..0000000000 --- a/c/src/ada-tests/tmtests/tm08/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_tm08 -ada_tm08_SOURCES = tm08.adb config.h tmtest.adb tmtest.ads -ada_tm08_SOURCES += ../../support/init.c - -ada_tm08$(EXEEXT): tm08.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/tmtests/tm08/config.h b/c/src/ada-tests/tmtests/tm08/config.h deleted file mode 100644 index b03802dcc5..0000000000 --- a/c/src/ada-tests/tmtests/tm08/config.h +++ /dev/null @@ -1,33 +0,0 @@ -/* config.h - * - * This include file defines the Configuration Table for this test. - * - * COPYRIGHT (c) 1989-1997. - * 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_TMTEST - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 111 -#define CONFIGURE_MAXIMUM_TIMERS 110 -#define CONFIGURE_MAXIMUM_SEMAPHORES 101 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/tmtests/tm08/tm08.adb b/c/src/ada-tests/tmtests/tm08/tm08.adb deleted file mode 100644 index d927a18d63..0000000000 --- a/c/src/ada-tests/tmtests/tm08/tm08.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test TM08 of the Timing 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 TMTEST; -with TEST_SUPPORT; - -procedure TM08 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, - TMTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end TM08; - diff --git a/c/src/ada-tests/tmtests/tm08/tmtest.adb b/c/src/ada-tests/tmtests/tm08/tmtest.adb deleted file mode 100644 index c1dbcb3e30..0000000000 --- a/c/src/ada-tests/tmtests/tm08/tmtest.adb +++ /dev/null @@ -1,299 +0,0 @@ --- --- TMTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 8 of the RTEMS --- Timing 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 INTERFACES; use INTERFACES; -with RTEMS_CALLING_OVERHEAD; -with TEST_SUPPORT; -with TEXT_IO; -with TIME_TEST_SUPPORT; -with TIMER_DRIVER; -with RTEMS.CLOCK; - -package body TMTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TIME TEST 8 ***" ); - - TMTEST.TEST_INIT; - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- TEST_INIT --- - - procedure TEST_INIT - is - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.TASKS.CREATE( - 1, - 128, - 1024, - RTEMS.DEFAULT_OPTIONS, - RTEMS.DEFAULT_ATTRIBUTES, - TASK_ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); - - RTEMS.TASKS.START( TASK_ID, TMTEST.TEST_TASK'ACCESS, 0, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); - - RTEMS.TASKS.CREATE( - 1, - 254, - 1024, - RTEMS.DEFAULT_OPTIONS, - RTEMS.DEFAULT_ATTRIBUTES, - TASK_ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); - - RTEMS.TASKS.START( TASK_ID, TMTEST.TEST_TASK1'ACCESS, 0, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); - - end TEST_INIT; - --- --- TEST_TASK --- - - procedure TEST_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - OVERHEAD : RTEMS.UNSIGNED32; - OLD_PRIORITY : RTEMS.TASKS.PRIORITY; - OLD_MODE : RTEMS.MODE; - TIME : RTEMS.TIME_OF_DAY; - STATUS : RTEMS.STATUS_CODES; - begin - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - TIMER_DRIVER.EMPTY_FUNCTION; - end loop; - OVERHEAD := TIMER_DRIVER.READ_TIMER; - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.TASKS.SET_PRIORITY( - TMTEST.TASK_ID, - RTEMS.TASKS.CURRENT_PRIORITY, - OLD_PRIORITY, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - TIME_TEST_SUPPORT.PUT_TIME( - "TASK_SET_PRIORITY current priority", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - RTEMS_CALLING_OVERHEAD.TASK_SET_PRIORITY - ); - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.TASKS.SET_PRIORITY( - TMTEST.TASK_ID, - 253, - OLD_PRIORITY, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - TIME_TEST_SUPPORT.PUT_TIME( - "TASK_SET_PRIORITY no preempt", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - RTEMS_CALLING_OVERHEAD.TASK_SET_PRIORITY - ); - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.TASKS.MODE( - RTEMS.CURRENT_MODE, - RTEMS.CURRENT_MODE, - OLD_MODE, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - TIME_TEST_SUPPORT.PUT_TIME( - "TASK_MODE (current)", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - RTEMS_CALLING_OVERHEAD.TASK_MODE - ); - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.TASKS.MODE( - RTEMS.INTERRUPT_LEVEL( 1 ), - RTEMS.INTERRUPT_MASK, - OLD_MODE, - STATUS - ); - RTEMS.TASKS.MODE( - RTEMS.INTERRUPT_LEVEL( 0 ), - RTEMS.INTERRUPT_MASK, - OLD_MODE, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - TIME_TEST_SUPPORT.PUT_TIME( - "TASK_MODE (no reschedule)", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT * 2, - OVERHEAD, - RTEMS_CALLING_OVERHEAD.TASK_MODE - ); - - TIMER_DRIVER.INITIALIZE; - RTEMS.TASKS.MODE( - RTEMS.NO_ASR, - RTEMS.ASR_MASK, - OLD_MODE, - STATUS - ); - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - TIME_TEST_SUPPORT.PUT_TIME( - "TASK_MODE (reschedule)", - TMTEST.END_TIME, - 1, - 0, - RTEMS_CALLING_OVERHEAD.TASK_MODE - ); - - RTEMS.TASKS.MODE( - RTEMS.NO_PREEMPT, - RTEMS.PREEMPT_MASK, - OLD_MODE, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); - - RTEMS.TASKS.SET_PRIORITY( - TMTEST.TASK_ID, - 1, - OLD_PRIORITY, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" ); - - TIMER_DRIVER.INITIALIZE; - RTEMS.TASKS.MODE( -- preempted by TEST_TASK1 - RTEMS.PREEMPT, - RTEMS.PREEMPT_MASK, - OLD_MODE, - STATUS - ); - - TIME := (1988, 1, 1, 0, 0, 0, 0 ); - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.CLOCK.SET( - TIME, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - TIME_TEST_SUPPORT.PUT_TIME( - "CLOCK_SET", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - RTEMS_CALLING_OVERHEAD.CLOCK_SET - ); - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.CLOCK.GET_TOD( TIME, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - TIME_TEST_SUPPORT.PUT_TIME( - "CLOCK_GET_TOD", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - RTEMS_CALLING_OVERHEAD.CLOCK_GET - ); - - TEXT_IO.PUT_LINE( "*** END OF TIME TEST 8 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end TEST_TASK; - --- --- TEST_TASK1 --- - - procedure TEST_TASK1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - TIME_TEST_SUPPORT.PUT_TIME( - "TASK_MODE (preemptive) ", - TMTEST.END_TIME, - 1, - 0, - RTEMS_CALLING_OVERHEAD.TASK_MODE - ); - - RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "DOES NOT RETURN" ); - - end TEST_TASK1; - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm08/tmtest.ads b/c/src/ada-tests/tmtests/tm08/tmtest.ads deleted file mode 100644 index 695235f479..0000000000 --- a/c/src/ada-tests/tmtests/tm08/tmtest.ads +++ /dev/null @@ -1,96 +0,0 @@ --- --- TMTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 8 of the RTEMS --- Timing 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; - -package TMTEST is - - TASK_ID : RTEMS.ID; - --- --- The following variable is set to the execution time returned --- by the timer. --- - - END_TIME : RTEMS.UNSIGNED32; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- TEST_INIT --- --- DESCRIPTION: --- --- This subprogram performs test initialization. --- - - procedure TEST_INIT; - --- --- TEST_TASK --- --- DESCRIPTION: --- --- This RTEMS task is responsible for measuring and reporting the --- following directive execution times: --- --- + TASK_SET_PRIORITY to obtain the current priority --- + TASK_SET_PRIORITY which does not require a context switch --- + TASK_MODE to obtain the current mode --- + TASK_MODE which does not require a reschedule --- + TASK_MODE which does require a reschedule --- + TASK_MODE which causes a preemption *** TEST_TASK1 executes --- + CLOCK_SET --- - - procedure TEST_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TEST_TASK); - --- --- TEST_TASK2 --- --- DESCRIPTION: --- --- This RTEMS task is responsible for measuring and reporting the --- following directive execution times: --- --- + TASK_MODE which results in a preemption --- - - procedure TEST_TASK1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TEST_TASK1); - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm09/Makefile.am b/c/src/ada-tests/tmtests/tm09/Makefile.am deleted file mode 100644 index e0be06a650..0000000000 --- a/c/src/ada-tests/tmtests/tm09/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_tm09 -ada_tm09_SOURCES = tm09.adb config.h tmtest.adb tmtest.ads -ada_tm09_SOURCES += ../../support/init.c - -ada_tm09$(EXEEXT): tm09.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/tmtests/tm09/config.h b/c/src/ada-tests/tmtests/tm09/config.h deleted file mode 100644 index 56b5b2848e..0000000000 --- a/c/src/ada-tests/tmtests/tm09/config.h +++ /dev/null @@ -1,32 +0,0 @@ -/* 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_TMTEST - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 2 -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/tmtests/tm09/tm09.adb b/c/src/ada-tests/tmtests/tm09/tm09.adb deleted file mode 100644 index 6fe1971d44..0000000000 --- a/c/src/ada-tests/tmtests/tm09/tm09.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test TM09 of the Timing 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 TMTEST; -with TEST_SUPPORT; - -procedure TM09 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, - TMTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end TM09; - diff --git a/c/src/ada-tests/tmtests/tm09/tmtest.adb b/c/src/ada-tests/tmtests/tm09/tmtest.adb deleted file mode 100644 index 432a7b50a8..0000000000 --- a/c/src/ada-tests/tmtests/tm09/tmtest.adb +++ /dev/null @@ -1,297 +0,0 @@ --- --- TMTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 9 of the RTEMS --- Timing 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 INTERFACES; use INTERFACES; -with RTEMS_CALLING_OVERHEAD; -with TEST_SUPPORT; -with TEXT_IO; -with TIME_TEST_SUPPORT; -with TIMER_DRIVER; -with RTEMS.MESSAGE_QUEUE; - -package body TMTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - TASK_ID : RTEMS.ID; - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TIME TEST 9 ***" ); - - RTEMS.TASKS.CREATE( - 1, - 128, - 4096, - RTEMS.DEFAULT_OPTIONS, - RTEMS.DEFAULT_ATTRIBUTES, - TASK_ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); - - RTEMS.TASKS.START( TASK_ID, TMTEST.TEST_TASK'ACCESS, 0, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- TEST_TASK --- - - procedure TEST_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TIMER_DRIVER.INITIALIZE; - RTEMS.MESSAGE_QUEUE.CREATE( - 1, - TIME_TEST_SUPPORT.OPERATION_COUNT, - 16, - RTEMS.DEFAULT_OPTIONS, - TMTEST.QUEUE_ID, - STATUS - ); - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - TIME_TEST_SUPPORT.PUT_TIME( - "MESSAGE_QUEUE_CREATE", - TMTEST.END_TIME, - 1, - 0, - RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_CREATE - ); - - TMTEST.QUEUE_TEST; - - TIMER_DRIVER.INITIALIZE; - RTEMS.MESSAGE_QUEUE.DELETE( - TMTEST.QUEUE_ID, - STATUS - ); - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_DELETE" ); - TIME_TEST_SUPPORT.PUT_TIME( - "MESSAGE_QUEUE_DELETE", - TMTEST.END_TIME, - 1, - 0, - RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_DELETE - ); - - TEXT_IO.PUT_LINE( "*** END OF TIME TEST 9 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end TEST_TASK; - --- --- QUEUE_TEST --- - - procedure QUEUE_TEST - is - SEND_LOOP_TIME : RTEMS.UNSIGNED32; - URGENT_LOOP_TIME : RTEMS.UNSIGNED32; - RECEIVE_LOOP_TIME : RTEMS.UNSIGNED32; - SEND_TIME : RTEMS.UNSIGNED32; - URGENT_TIME : RTEMS.UNSIGNED32; - RECEIVE_TIME : RTEMS.UNSIGNED32; - EMPTY_FLUSH_TIME : RTEMS.UNSIGNED32; - FLUSH_TIME : RTEMS.UNSIGNED32; - FLUSH_COUNT : RTEMS.UNSIGNED32; - EMPTY_FLUSH_COUNT : RTEMS.UNSIGNED32; - BUFFER : TMTEST.BUFFER; - BUFFER_POINTER : RTEMS.ADDRESS; - MESSAGE_SIZE : RTEMS.UNSIGNED32 := 0; - STATUS : RTEMS.STATUS_CODES; - begin - - 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; - EMPTY_FLUSH_COUNT := 0; - - BUFFER_POINTER := BUFFER'ADDRESS; - - for ITERATIONS in 1 .. TIME_TEST_SUPPORT.ITERATION_COUNT - loop - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - TIMER_DRIVER.EMPTY_FUNCTION; - end loop; - SEND_LOOP_TIME := SEND_LOOP_TIME + TIMER_DRIVER.READ_TIMER; - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - TIMER_DRIVER.EMPTY_FUNCTION; - end loop; - URGENT_LOOP_TIME := URGENT_LOOP_TIME + TIMER_DRIVER.READ_TIMER; - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - TIMER_DRIVER.EMPTY_FUNCTION; - end loop; - RECEIVE_LOOP_TIME := RECEIVE_LOOP_TIME + TIMER_DRIVER.READ_TIMER; - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.MESSAGE_QUEUE.SEND( - TMTEST.QUEUE_ID, - BUFFER_POINTER, - 16, - STATUS - ); - end loop; - SEND_TIME := SEND_TIME + TIMER_DRIVER.READ_TIMER; - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.MESSAGE_QUEUE.RECEIVE( - TMTEST.QUEUE_ID, - BUFFER_POINTER, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - MESSAGE_SIZE, - STATUS - ); - end loop; - RECEIVE_TIME := RECEIVE_TIME + TIMER_DRIVER.READ_TIMER; - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.MESSAGE_QUEUE.URGENT( - TMTEST.QUEUE_ID, - BUFFER_POINTER, - 16, - STATUS - ); - end loop; - URGENT_TIME := URGENT_TIME + TIMER_DRIVER.READ_TIMER; - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.MESSAGE_QUEUE.RECEIVE( - TMTEST.QUEUE_ID, - BUFFER_POINTER, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - MESSAGE_SIZE, - STATUS - ); - end loop; - RECEIVE_TIME := RECEIVE_TIME + TIMER_DRIVER.READ_TIMER; - - TIMER_DRIVER.INITIALIZE; - RTEMS.MESSAGE_QUEUE.FLUSH( - TMTEST.QUEUE_ID, - EMPTY_FLUSH_COUNT, - STATUS - ); - EMPTY_FLUSH_TIME := EMPTY_FLUSH_TIME + TIMER_DRIVER.READ_TIMER; - - -- send one message to flush - RTEMS.MESSAGE_QUEUE.SEND( - TMTEST.QUEUE_ID, - BUFFER_POINTER, - 16, - STATUS - ); - TIMER_DRIVER.INITIALIZE; - RTEMS.MESSAGE_QUEUE.FLUSH( - TMTEST.QUEUE_ID, - FLUSH_COUNT, - STATUS - ); - FLUSH_TIME := FLUSH_TIME + TIMER_DRIVER.READ_TIMER; - - end loop; - - TIME_TEST_SUPPORT.PUT_TIME( - "MESSAGE_QUEUE_SEND (no tasks waiting)", - SEND_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT * - TIME_TEST_SUPPORT.ITERATION_COUNT, - SEND_LOOP_TIME, - RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_SEND - ); - - TIME_TEST_SUPPORT.PUT_TIME( - "MESSAGE_QUEUE_URGENT (no tasks waiting)", - URGENT_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT * - TIME_TEST_SUPPORT.ITERATION_COUNT, - URGENT_LOOP_TIME, - RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_URGENT - ); - - TIME_TEST_SUPPORT.PUT_TIME( - "MESSAGE_QUEUE_RECEIVE (messages available)", - RECEIVE_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT * - TIME_TEST_SUPPORT.ITERATION_COUNT * 2, - RECEIVE_LOOP_TIME * 2, - RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_RECEIVE - ); - - TIME_TEST_SUPPORT.PUT_TIME( - "MESSAGE_QUEUE_FLUSH (empty queue)", - EMPTY_FLUSH_TIME, - TIME_TEST_SUPPORT.ITERATION_COUNT, - 0, - RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_FLUSH - ); - - TIME_TEST_SUPPORT.PUT_TIME( - "MESSAGE_QUEUE_FLUSH (messages flushed)", - FLUSH_TIME, - TIME_TEST_SUPPORT.ITERATION_COUNT, - 0, - RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_FLUSH - ); - - end QUEUE_TEST; - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm09/tmtest.ads b/c/src/ada-tests/tmtests/tm09/tmtest.ads deleted file mode 100644 index ca02e74a51..0000000000 --- a/c/src/ada-tests/tmtests/tm09/tmtest.ads +++ /dev/null @@ -1,99 +0,0 @@ --- --- TMTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 9 of the RTEMS --- Timing 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; - -package TMTEST is - --- --- Buffer Record similar to that used by RTEMS 3.2.1. Using this --- avoids changes to the test. --- - - type BUFFER is - record - FIELD1 : RTEMS.UNSIGNED32; -- TEMPORARY UNTIL VARIABLE LENGTH - FIELD2 : RTEMS.UNSIGNED32; - FIELD3 : RTEMS.UNSIGNED32; - FIELD4 : RTEMS.UNSIGNED32; - end record; - --- --- The following is the ID of the message queue used for timing operations. --- - - QUEUE_ID : RTEMS.ID; - --- --- The following variable is set to the execution time returned --- by the timer. --- - - END_TIME : RTEMS.UNSIGNED32; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- TEST_TASK --- --- DESCRIPTION: --- --- This RTEMS task is responsible for measuring and reporting the --- following directive execution times: --- --- + MESSAGE_QUEUE_CREATE --- + MESSAGE_QUEUE_DELETE --- - - procedure TEST_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TEST_TASK); - --- --- QUEUE_TEST --- --- DESCRIPTION: --- --- This subprogram is responsible for measuring and reporting the --- following directive execution times: --- --- + MESSAGE_QUEUE_SEND with no tasks waiting --- + MESSAGE_QUEUE_URGENT with no tasks waiting --- + MESSAGE_QUEUE_RECEIVE with messages available --- + MESSAGE_QUEUE_FLUSH with an empty message queue --- + MESSAGE_QUEUE_FLUSH with messages flushed --- - - procedure QUEUE_TEST; - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm10/Makefile.am b/c/src/ada-tests/tmtests/tm10/Makefile.am deleted file mode 100644 index 43b039dd38..0000000000 --- a/c/src/ada-tests/tmtests/tm10/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_tm10 -ada_tm10_SOURCES = tm10.adb config.h tmtest.adb tmtest.ads -ada_tm10_SOURCES += ../../support/init.c - -ada_tm10$(EXEEXT): tm10.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/tmtests/tm10/config.h b/c/src/ada-tests/tmtests/tm10/config.h deleted file mode 100644 index ee201258aa..0000000000 --- a/c/src/ada-tests/tmtests/tm10/config.h +++ /dev/null @@ -1,32 +0,0 @@ -/* config.h - * - * This include file defines the Configuration Table for this test. - * - * COPYRIGHT (c) 1989-1997. - * 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_TMTEST - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 110 -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/tmtests/tm10/tm10.adb b/c/src/ada-tests/tmtests/tm10/tm10.adb deleted file mode 100644 index 4117d7a01a..0000000000 --- a/c/src/ada-tests/tmtests/tm10/tm10.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test TM10 of the Timing 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 TMTEST; -with TEST_SUPPORT; - -procedure TM10 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, - TMTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end TM10; - diff --git a/c/src/ada-tests/tmtests/tm10/tmtest.adb b/c/src/ada-tests/tmtests/tm10/tmtest.adb deleted file mode 100644 index 9a92266cf5..0000000000 --- a/c/src/ada-tests/tmtests/tm10/tmtest.adb +++ /dev/null @@ -1,220 +0,0 @@ --- --- TMTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 10 of the RTEMS --- Timing 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 INTERFACES; use INTERFACES; -with RTEMS_CALLING_OVERHEAD; -with TEST_SUPPORT; -with TEXT_IO; -with TIME_TEST_SUPPORT; -with TIMER_DRIVER; -with RTEMS.MESSAGE_QUEUE; - -package body TMTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TIME TEST 10 ***" ); - - TMTEST.TEST_INIT; - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- TEST_INIT --- - - procedure TEST_INIT - is - TASK_ENTRY : RTEMS.TASKS.ENTRY_POINT; - PRIORITY : RTEMS.TASKS.PRIORITY; - OVERHEAD : RTEMS.UNSIGNED32; - TASK_ID : RTEMS.ID; - BUFFER : TMTEST.BUFFER; - BUFFER_POINTER : RTEMS.ADDRESS; - MESSAGE_SIZE : RTEMS.UNSIGNED32 := 0; - STATUS : RTEMS.STATUS_CODES; - begin - - BUFFER_POINTER := BUFFER'ADDRESS; - - PRIORITY := 5; - - for INDEX in 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - - RTEMS.TASKS.CREATE( - RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ), - PRIORITY, - 1024, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - TASK_ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); - - PRIORITY := PRIORITY + 1; - - if INDEX = 0 then - TASK_ENTRY := TMTEST.HIGH_TASK'ACCESS; - elsif INDEX = TIME_TEST_SUPPORT.OPERATION_COUNT then - TASK_ENTRY := TMTEST.LOW_TASK'ACCESS; - else - TASK_ENTRY := TMTEST.MIDDLE_TASKS'ACCESS; - end if; - - RTEMS.TASKS.START( TASK_ID, TASK_ENTRY, 0, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); - - end loop; - - RTEMS.MESSAGE_QUEUE.CREATE( - 1, - TIME_TEST_SUPPORT.OPERATION_COUNT, - 16, - RTEMS.DEFAULT_OPTIONS, - TMTEST.QUEUE_ID, - STATUS - ); - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - TIMER_DRIVER.EMPTY_FUNCTION; - end loop; - OVERHEAD := TIMER_DRIVER.READ_TIMER; - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.MESSAGE_QUEUE.RECEIVE( - TMTEST.QUEUE_ID, - BUFFER_POINTER, - RTEMS.NO_WAIT, - RTEMS.NO_TIMEOUT, - MESSAGE_SIZE, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - TIME_TEST_SUPPORT.PUT_TIME( - "MESSAGE_QUEUE_RECEIVE (NO_WAIT)", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_RECEIVE - ); - - end TEST_INIT; - --- --- HIGH_TASK --- - - procedure HIGH_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - BUFFER : TMTEST.BUFFER; - BUFFER_POINTER : RTEMS.ADDRESS; - MESSAGE_SIZE : RTEMS.UNSIGNED32 := 0; - STATUS : RTEMS.STATUS_CODES; - begin - - BUFFER_POINTER := BUFFER'ADDRESS; - - TIMER_DRIVER.INITIALIZE; - - RTEMS.MESSAGE_QUEUE.RECEIVE( - TMTEST.QUEUE_ID, - BUFFER_POINTER, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - MESSAGE_SIZE, - STATUS - ); - - end HIGH_TASK; - --- --- MIDDLE_TASKS --- - - procedure MIDDLE_TASKS ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - BUFFER : TMTEST.BUFFER; - BUFFER_POINTER : RTEMS.ADDRESS; - MESSAGE_SIZE : RTEMS.UNSIGNED32 := 0; - STATUS : RTEMS.STATUS_CODES; - begin - - BUFFER_POINTER := BUFFER'ADDRESS; - - RTEMS.MESSAGE_QUEUE.RECEIVE( - TMTEST.QUEUE_ID, - BUFFER_POINTER, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - MESSAGE_SIZE, - STATUS - ); - - end MIDDLE_TASKS; - --- --- LOW_TASK --- - - procedure LOW_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - begin - - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - TIME_TEST_SUPPORT.PUT_TIME( - "MESSAGE_QUEUE_RECEIVE (blocking)", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - 0, - RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_RECEIVE - ); - - TEXT_IO.PUT_LINE( "*** END OF TIME TEST 10 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end LOW_TASK; - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm10/tmtest.ads b/c/src/ada-tests/tmtests/tm10/tmtest.ads deleted file mode 100644 index 224630e1d5..0000000000 --- a/c/src/ada-tests/tmtests/tm10/tmtest.ads +++ /dev/null @@ -1,118 +0,0 @@ --- --- TMTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 10 of the RTEMS --- Timing 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; - -package TMTEST is - --- --- Buffer Record similar to that used by RTEMS 3.2.1. Using this --- avoids changes to the test. --- - - type BUFFER is - record - FIELD1 : RTEMS.UNSIGNED32; -- TEMPORARY UNTIL VARIABLE LENGTH - FIELD2 : RTEMS.UNSIGNED32; - FIELD3 : RTEMS.UNSIGNED32; - FIELD4 : RTEMS.UNSIGNED32; - end record; - --- --- The following is the ID of the message queue used for timing operations. --- - - QUEUE_ID : RTEMS.ID; - --- --- The following variable is set to the execution time returned --- by the timer. --- - - END_TIME : RTEMS.UNSIGNED32; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- TEST_INIT --- --- DESCRIPTION: --- --- This subprogram performs test initialization. After initialization --- has been completed, the NO_WAIT case for MESSAGE_QUEUE_RECEIVE --- is timed and reported. --- - - procedure TEST_INIT; - --- --- HIGH_TASK --- --- DESCRIPTION: --- --- This RTEMS task is the highest priority task in the system. --- It starts the timer and performs a blocking MESSAGE_QUEUE_RECEIVE. --- - - procedure HIGH_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, HIGH_TASK); - --- --- MIDDLE_TASKS --- --- DESCRIPTION: --- --- These RTEMS tasks perform a blocking MESSAGE_QUEUE_RECEIVE. --- - - procedure MIDDLE_TASKS ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, MIDDLE_TASKS); - --- --- LOW_TASK --- --- DESCRIPTION: --- --- This RTEMS task stops the timer and reports the execution time --- of a blocking MESSAGE_QUEUE_RECEIVE. --- - - procedure LOW_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, LOW_TASK); - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm11/Makefile.am b/c/src/ada-tests/tmtests/tm11/Makefile.am deleted file mode 100644 index a5532f2301..0000000000 --- a/c/src/ada-tests/tmtests/tm11/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_tm11 -ada_tm11_SOURCES = tm11.adb config.h tmtest.adb tmtest.ads -ada_tm11_SOURCES += ../../support/init.c - -ada_tm11$(EXEEXT): tm11.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/tmtests/tm11/config.h b/c/src/ada-tests/tmtests/tm11/config.h deleted file mode 100644 index a5064b6e92..0000000000 --- a/c/src/ada-tests/tmtests/tm11/config.h +++ /dev/null @@ -1,32 +0,0 @@ -/* config.h - * - * This include file defines the Configuration Table for this test. - * - * COPYRIGHT (c) 1989-1997. - * 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_TMTEST - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 111 -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/tmtests/tm11/tm11.adb b/c/src/ada-tests/tmtests/tm11/tm11.adb deleted file mode 100644 index bcc91aa905..0000000000 --- a/c/src/ada-tests/tmtests/tm11/tm11.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test TM11 of the Timing 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 TMTEST; -with TEST_SUPPORT; - -procedure TM11 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, - TMTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end TM11; - diff --git a/c/src/ada-tests/tmtests/tm11/tmtest.adb b/c/src/ada-tests/tmtests/tm11/tmtest.adb deleted file mode 100644 index 610c248d57..0000000000 --- a/c/src/ada-tests/tmtests/tm11/tmtest.adb +++ /dev/null @@ -1,218 +0,0 @@ --- --- TMTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 11 of the RTEMS --- Timing 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 INTERFACES; use INTERFACES; -with RTEMS_CALLING_OVERHEAD; -with TEST_SUPPORT; -with TEXT_IO; -with TIME_TEST_SUPPORT; -with TIMER_DRIVER; -with RTEMS.MESSAGE_QUEUE; - -package body TMTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - TASK_ID : RTEMS.ID; - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TIME TEST 11 ***" ); - - RTEMS.TASKS.CREATE( - 1, - 251, - 1024, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - TASK_ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); - - RTEMS.TASKS.START( - TASK_ID, - TMTEST.TEST_INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- TEST_INIT --- - - procedure TEST_INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - TASK_ENTRY : RTEMS.TASKS.ENTRY_POINT; - PRIORITY : RTEMS.TASKS.PRIORITY; - TASK_ID : RTEMS.ID; - BUFFER : TMTEST.BUFFER; - BUFFER_POINTER : RTEMS.ADDRESS; - STATUS : RTEMS.STATUS_CODES; - begin - - BUFFER_POINTER := BUFFER'ADDRESS; - --- As each task is started, it preempts this task and performs a blocking --- MESSAGE_QUEUE_RECEIVE. Upon completion of this loop all created tasks --- are blocked. - - RTEMS.MESSAGE_QUEUE.CREATE( - RTEMS.BUILD_NAME( 'M', 'Q', '1', ' ' ), - TIME_TEST_SUPPORT.OPERATION_COUNT, - 16, - RTEMS.DEFAULT_OPTIONS, - TMTEST.QUEUE_ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_CREATE" ); - - PRIORITY := 250; - - for INDEX in 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT - 1 - loop - - RTEMS.TASKS.CREATE( - RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ), - PRIORITY, - 1024, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - TASK_ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); - - PRIORITY := PRIORITY - 1; - - if INDEX = TIME_TEST_SUPPORT.OPERATION_COUNT - 1 then - TASK_ENTRY := TMTEST.HIGH_TASK'ACCESS; - else - TASK_ENTRY := TMTEST.MIDDLE_TASKS'ACCESS; - end if; - - RTEMS.TASKS.START( TASK_ID, TASK_ENTRY, 0, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); - - end loop; - - TIMER_DRIVER.INITIALIZE; - RTEMS.MESSAGE_QUEUE.SEND( - TMTEST.QUEUE_ID, - BUFFER_POINTER, - 16, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); - - end TEST_INIT; - --- --- HIGH_TASK --- - - procedure HIGH_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - BUFFER : TMTEST.BUFFER; - BUFFER_POINTER : RTEMS.ADDRESS; - MESSAGE_SIZE : RTEMS.UNSIGNED32 := 0; - STATUS : RTEMS.STATUS_CODES; - begin - - BUFFER_POINTER := BUFFER'ADDRESS; - - RTEMS.MESSAGE_QUEUE.RECEIVE( - TMTEST.QUEUE_ID, - BUFFER_POINTER, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - MESSAGE_SIZE, - STATUS - ); - - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "MESSAGE_QUEUE_SEND (preemptive)", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - 0, - RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_SEND - ); - - TEXT_IO.PUT_LINE( "*** END OF TIME TEST 11 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end HIGH_TASK; - --- --- MIDDLE_TASKS --- - - procedure MIDDLE_TASKS ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - BUFFER : TMTEST.BUFFER; - BUFFER_POINTER : RTEMS.ADDRESS; - MESSAGE_SIZE : RTEMS.UNSIGNED32 := 0; - STATUS : RTEMS.STATUS_CODES; - begin - - BUFFER_POINTER := BUFFER'ADDRESS; - - RTEMS.MESSAGE_QUEUE.RECEIVE( - TMTEST.QUEUE_ID, - BUFFER_POINTER, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - MESSAGE_SIZE, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" ); - - RTEMS.MESSAGE_QUEUE.SEND( - TMTEST.QUEUE_ID, - BUFFER_POINTER, - 16, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); - - end MIDDLE_TASKS; - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm11/tmtest.ads b/c/src/ada-tests/tmtests/tm11/tmtest.ads deleted file mode 100644 index 6718933b04..0000000000 --- a/c/src/ada-tests/tmtests/tm11/tmtest.ads +++ /dev/null @@ -1,115 +0,0 @@ --- --- TMTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 11 of the RTEMS --- Timing 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; - -package TMTEST is - --- --- Buffer Record similar to that used by RTEMS 3.2.1. Using this --- avoids changes to the test. --- - - type BUFFER is - record - FIELD1 : RTEMS.UNSIGNED32; -- TEMPORARY UNTIL VARIABLE LENGTH - FIELD2 : RTEMS.UNSIGNED32; - FIELD3 : RTEMS.UNSIGNED32; - FIELD4 : RTEMS.UNSIGNED32; - end record; - --- --- The following is the ID of the message queue used for timing operations. --- - - QUEUE_ID : RTEMS.ID; - --- --- The following variable is set to the execution time returned --- by the timer. --- - - END_TIME : RTEMS.UNSIGNED32; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- TEST_INIT --- --- DESCRIPTION: --- --- This subprogram performs test initialization. As each application --- task is created and started, it will preempt this task and --- perform a blocking MESSAGE_QUEUE_RECEIVE. Once all of the --- initialization is completed, the timer is started and the first --- preemptive MESSAGE_QUEUE_SEND is executed. --- - - procedure TEST_INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TEST_INIT); - --- --- HIGH_TASK --- --- DESCRIPTION: --- --- This RTEMS task is the highest priority task in the system. --- It performs a blocking blocking MESSAGE_QUEUE_RECEIVE. It is --- the last test task created and started. Thus it is the last --- task to be enqueued waiting for a message and the last task --- to receive the message. Once it receives the message, it --- stops the timer and reports the execution time for a --- preemptive MESSAGE_QUEUE_SEND. --- - - procedure HIGH_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, HIGH_TASK); - --- --- MIDDLE_TASKS --- --- DESCRIPTION: --- --- As each of these RTEMS tasks is created and started, it preempts --- the initialization task and perform a blocking MESSAGE_QUEUE_RECEIVE. --- - - procedure MIDDLE_TASKS ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, MIDDLE_TASKS); - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm12/Makefile.am b/c/src/ada-tests/tmtests/tm12/Makefile.am deleted file mode 100644 index 925aa17a5f..0000000000 --- a/c/src/ada-tests/tmtests/tm12/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_tm12 -ada_tm12_SOURCES = tm12.adb config.h tmtest.adb tmtest.ads -ada_tm12_SOURCES += ../../support/init.c - -ada_tm12$(EXEEXT): tm12.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/tmtests/tm12/config.h b/c/src/ada-tests/tmtests/tm12/config.h deleted file mode 100644 index a5064b6e92..0000000000 --- a/c/src/ada-tests/tmtests/tm12/config.h +++ /dev/null @@ -1,32 +0,0 @@ -/* config.h - * - * This include file defines the Configuration Table for this test. - * - * COPYRIGHT (c) 1989-1997. - * 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_TMTEST - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 111 -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/tmtests/tm12/tm12.adb b/c/src/ada-tests/tmtests/tm12/tm12.adb deleted file mode 100644 index bea5e83b79..0000000000 --- a/c/src/ada-tests/tmtests/tm12/tm12.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test TM12 of the Timing 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 TMTEST; -with TEST_SUPPORT; - -procedure TM12 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, - TMTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end TM12; - diff --git a/c/src/ada-tests/tmtests/tm12/tmtest.adb b/c/src/ada-tests/tmtests/tm12/tmtest.adb deleted file mode 100644 index a97330f7bf..0000000000 --- a/c/src/ada-tests/tmtests/tm12/tmtest.adb +++ /dev/null @@ -1,204 +0,0 @@ --- --- TMTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 12 of the RTEMS --- Timing 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 INTERFACES; use INTERFACES; -with RTEMS_CALLING_OVERHEAD; -with TEST_SUPPORT; -with TEXT_IO; -with TIME_TEST_SUPPORT; -with TIMER_DRIVER; -with RTEMS.MESSAGE_QUEUE; - -package body TMTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - TASK_ID : RTEMS.ID; - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TIME TEST 12 ***" ); - - RTEMS.TASKS.CREATE( - 1, - 251, - 1024, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - TASK_ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); - - RTEMS.TASKS.START( - TASK_ID, - TMTEST.TEST_INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- TEST_INIT --- - - procedure TEST_INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - TASK_ENTRY : RTEMS.TASKS.ENTRY_POINT; - PRIORITY : RTEMS.TASKS.PRIORITY; - TASK_ID : RTEMS.ID; - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.MESSAGE_QUEUE.CREATE( - RTEMS.BUILD_NAME( 'M', 'Q', '1', ' ' ), - TIME_TEST_SUPPORT.OPERATION_COUNT, - 16, - RTEMS.DEFAULT_OPTIONS, - TMTEST.QUEUE_ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_CREATE" ); - - PRIORITY := 250; - - for INDEX in 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT - 1 - loop - - RTEMS.TASKS.CREATE( - RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ), - PRIORITY, - 1024, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - TASK_ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); - - PRIORITY := PRIORITY - 1; - - if INDEX = TIME_TEST_SUPPORT.OPERATION_COUNT - 1 then - TASK_ENTRY := TMTEST.HIGH_TASK'ACCESS; - else - TASK_ENTRY := TMTEST.LOW_TASKS'ACCESS; - end if; - - RTEMS.TASKS.START( TASK_ID, TASK_ENTRY, 0, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); - - end loop; - - end TEST_INIT; - --- --- HIGH_TASK --- - - procedure HIGH_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - BUFFER : TMTEST.BUFFER; - BUFFER_POINTER : RTEMS.ADDRESS; - OVERHEAD : RTEMS.UNSIGNED32; - STATUS : RTEMS.STATUS_CODES; - begin - - BUFFER_POINTER := BUFFER'ADDRESS; - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - TIMER_DRIVER.EMPTY_FUNCTION; - end loop; - OVERHEAD := TIMER_DRIVER.READ_TIMER; - - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - - RTEMS.MESSAGE_QUEUE.SEND( - TMTEST.QUEUE_ID, - BUFFER_POINTER, - 16, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); --XXX - - end loop; - - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "MESSAGE_QUEUE_SEND (readying)", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_SEND - ); - - TEXT_IO.PUT_LINE( "*** END OF TIME TEST 12 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end HIGH_TASK; - --- --- LOW_TASK --- - - procedure LOW_TASKS ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - BUFFER : TMTEST.BUFFER; - BUFFER_POINTER : RTEMS.ADDRESS; - MESSAGE_SIZE : RTEMS.UNSIGNED32 := 0; - STATUS : RTEMS.STATUS_CODES; - begin - - BUFFER_POINTER := BUFFER'ADDRESS; - - RTEMS.MESSAGE_QUEUE.RECEIVE( - TMTEST.QUEUE_ID, - BUFFER_POINTER, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - MESSAGE_SIZE, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" ); --XXX - - end LOW_TASKS; - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm12/tmtest.ads b/c/src/ada-tests/tmtests/tm12/tmtest.ads deleted file mode 100644 index 15ff276c7c..0000000000 --- a/c/src/ada-tests/tmtests/tm12/tmtest.ads +++ /dev/null @@ -1,106 +0,0 @@ --- --- TMTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 12 of the RTEMS --- Timing 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; - -package TMTEST is - --- --- Buffer Record similar to that used by RTEMS 3.2.1. Using this --- avoids changes to the test. --- - - type BUFFER is - record - FIELD1 : RTEMS.UNSIGNED32; -- TEMPORARY UNTIL VARIABLE LENGTH - FIELD2 : RTEMS.UNSIGNED32; - FIELD3 : RTEMS.UNSIGNED32; - FIELD4 : RTEMS.UNSIGNED32; - end record; - --- --- The following is the ID of the message queue used for timing operations. --- - - QUEUE_ID : RTEMS.ID; - --- --- The following variable is set to the execution time returned --- by the timer. --- - - END_TIME : RTEMS.UNSIGNED32; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- TEST_INIT --- --- DESCRIPTION: --- --- This subprogram performs test initialization. --- - - procedure TEST_INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TEST_INIT); - --- --- HIGH_TASK --- --- DESCRIPTION: --- --- This RTEMS task is the lowest priority task in the system. It --- only executes after all of the LOW_TASKS have blocked. It then --- times a readying MESSAGE_QUEUE_SEND. --- - - procedure HIGH_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, HIGH_TASK); - --- --- LOW_TASKS --- --- DESCRIPTION: --- --- These RTEMS tasks perform a blocking MESSAGE_QUEUE_RECEIVE. --- - - procedure LOW_TASKS ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, LOW_TASKS); - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm13/Makefile.am b/c/src/ada-tests/tmtests/tm13/Makefile.am deleted file mode 100644 index cc8bb32e16..0000000000 --- a/c/src/ada-tests/tmtests/tm13/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_tm13 -ada_tm13_SOURCES = tm13.adb config.h tmtest.adb tmtest.ads -ada_tm13_SOURCES += ../../support/init.c - -ada_tm13$(EXEEXT): tm13.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/tmtests/tm13/config.h b/c/src/ada-tests/tmtests/tm13/config.h deleted file mode 100644 index a5064b6e92..0000000000 --- a/c/src/ada-tests/tmtests/tm13/config.h +++ /dev/null @@ -1,32 +0,0 @@ -/* config.h - * - * This include file defines the Configuration Table for this test. - * - * COPYRIGHT (c) 1989-1997. - * 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_TMTEST - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 111 -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/tmtests/tm13/tm13.adb b/c/src/ada-tests/tmtests/tm13/tm13.adb deleted file mode 100644 index ba2ab58065..0000000000 --- a/c/src/ada-tests/tmtests/tm13/tm13.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test TM13 of the Timing 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 TMTEST; -with TEST_SUPPORT; - -procedure TM13 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, - TMTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end TM13; - diff --git a/c/src/ada-tests/tmtests/tm13/tmtest.adb b/c/src/ada-tests/tmtests/tm13/tmtest.adb deleted file mode 100644 index aa9a760f82..0000000000 --- a/c/src/ada-tests/tmtests/tm13/tmtest.adb +++ /dev/null @@ -1,216 +0,0 @@ --- --- TMTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 13 of the RTEMS --- Timing 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 INTERFACES; use INTERFACES; -with RTEMS_CALLING_OVERHEAD; -with TEST_SUPPORT; -with TEXT_IO; -with TIME_TEST_SUPPORT; -with TIMER_DRIVER; -with RTEMS.MESSAGE_QUEUE; - -package body TMTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - TASK_ID : RTEMS.ID; - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TIME TEST 13 ***" ); - - RTEMS.TASKS.CREATE( - 1, - 251, - 1024, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - TASK_ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); - - RTEMS.TASKS.START( - TASK_ID, - TMTEST.TEST_INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- TEST_INIT --- - - procedure TEST_INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - TASK_ENTRY : RTEMS.TASKS.ENTRY_POINT; - PRIORITY : RTEMS.TASKS.PRIORITY; - TASK_ID : RTEMS.ID; - BUFFER : TMTEST.BUFFER; - BUFFER_POINTER : RTEMS.ADDRESS; - STATUS : RTEMS.STATUS_CODES; - begin - - BUFFER_POINTER := BUFFER'ADDRESS; - --- As each task is started, it preempts this task and performs a blocking --- MESSAGE_QUEUE_RECEIVE. Upon completion of this loop all created tasks --- are blocked. - - RTEMS.MESSAGE_QUEUE.CREATE( - RTEMS.BUILD_NAME( 'M', 'Q', '1', ' ' ), - TIME_TEST_SUPPORT.OPERATION_COUNT, - 16, - RTEMS.DEFAULT_OPTIONS, - TMTEST.QUEUE_ID, - STATUS - ); - - PRIORITY := 250; - - for INDEX in 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT - 1 - loop - - RTEMS.TASKS.CREATE( - RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ), - PRIORITY, - 1024, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - TASK_ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); - - PRIORITY := PRIORITY - 1; - - if INDEX = TIME_TEST_SUPPORT.OPERATION_COUNT - 1 then - TASK_ENTRY := TMTEST.HIGH_TASK'ACCESS; - else - TASK_ENTRY := TMTEST.MIDDLE_TASKS'ACCESS; - end if; - - RTEMS.TASKS.START( TASK_ID, TASK_ENTRY, 0, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); - - end loop; - - TIMER_DRIVER.INITIALIZE; - RTEMS.MESSAGE_QUEUE.URGENT( - TMTEST.QUEUE_ID, - BUFFER_POINTER, - 16, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_URGENT" ); - - end TEST_INIT; - --- --- HIGH_TASK --- - - procedure HIGH_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - BUFFER : TMTEST.BUFFER; - BUFFER_POINTER : RTEMS.ADDRESS; - MESSAGE_SIZE : RTEMS.UNSIGNED32 := 0; - STATUS : RTEMS.STATUS_CODES; - begin - - BUFFER_POINTER := BUFFER'ADDRESS; - - RTEMS.MESSAGE_QUEUE.RECEIVE( - TMTEST.QUEUE_ID, - BUFFER_POINTER, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - MESSAGE_SIZE, - STATUS - ); - - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - TIME_TEST_SUPPORT.PUT_TIME( - "MESSAGE_QUEUE_URGENT (preemptive)", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - 0, - RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_URGENT - ); - - TEXT_IO.PUT_LINE( "*** END OF TIME TEST 13 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end HIGH_TASK; - --- --- MIDDLE_TASKS --- - - procedure MIDDLE_TASKS ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - BUFFER : TMTEST.BUFFER; - BUFFER_POINTER : RTEMS.ADDRESS; - MESSAGE_SIZE : RTEMS.UNSIGNED32 := 0; - STATUS : RTEMS.STATUS_CODES; - begin - - BUFFER_POINTER := BUFFER'ADDRESS; - - RTEMS.MESSAGE_QUEUE.RECEIVE( - TMTEST.QUEUE_ID, - BUFFER_POINTER, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - MESSAGE_SIZE, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" ); - - RTEMS.MESSAGE_QUEUE.URGENT( - TMTEST.QUEUE_ID, - BUFFER_POINTER, - 16, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_URGENT" ); - - end MIDDLE_TASKS; - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm13/tmtest.ads b/c/src/ada-tests/tmtests/tm13/tmtest.ads deleted file mode 100644 index 270bcda7e2..0000000000 --- a/c/src/ada-tests/tmtests/tm13/tmtest.ads +++ /dev/null @@ -1,115 +0,0 @@ --- --- TMTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 13 of the RTEMS --- Timing 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; - -package TMTEST is - --- --- Buffer Record similar to that used by RTEMS 3.2.1. Using this --- avoids changes to the test. --- - - type BUFFER is - record - FIELD1 : RTEMS.UNSIGNED32; -- TEMPORARY UNTIL VARIABLE LENGTH - FIELD2 : RTEMS.UNSIGNED32; - FIELD3 : RTEMS.UNSIGNED32; - FIELD4 : RTEMS.UNSIGNED32; - end record; - --- --- The following is the ID of the message queue used for timing operations. --- - - QUEUE_ID : RTEMS.ID; - --- --- The following variable is set to the execution time returned --- by the timer. --- - - END_TIME : RTEMS.UNSIGNED32; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- TEST_INIT --- --- DESCRIPTION: --- --- This subprogram performs test initialization. As each application --- task is created and started, it will preempt this task and --- perform a blocking MESSAGE_QUEUE_RECEIVE. Once all of the --- initialization is completed, the timer is started and the first --- preemptive MESSAGE_QUEUE_URGENT is executed. --- - - procedure TEST_INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TEST_INIT); - --- --- HIGH_TASK --- --- DESCRIPTION: --- --- This RTEMS task is the highest priority task in the system. --- It performs a blocking blocking MESSAGE_QUEUE_RECEIVE. It is --- the last test task created and started. Thus it is the last --- task to be enqueued waiting for a message and the last task --- to receive the message. Once it receives the message, it --- stops the timer and reports the execution time for a --- preemptive MESSAGE_QUEUE_URGENT. --- - - procedure HIGH_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, HIGH_TASK); - --- --- MIDDLE_TASKS --- --- DESCRIPTION: --- --- As each of these RTEMS tasks is created and started, it preempts --- the initialization task and perform a blocking MESSAGE_QUEUE_RECEIVE. --- - - procedure MIDDLE_TASKS ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, MIDDLE_TASKS); - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm14/Makefile.am b/c/src/ada-tests/tmtests/tm14/Makefile.am deleted file mode 100644 index 0577c8a26c..0000000000 --- a/c/src/ada-tests/tmtests/tm14/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_tm14 -ada_tm14_SOURCES = tm14.adb config.h tmtest.adb tmtest.ads -ada_tm14_SOURCES += ../../support/init.c - -ada_tm14$(EXEEXT): tm14.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/tmtests/tm14/config.h b/c/src/ada-tests/tmtests/tm14/config.h deleted file mode 100644 index a5064b6e92..0000000000 --- a/c/src/ada-tests/tmtests/tm14/config.h +++ /dev/null @@ -1,32 +0,0 @@ -/* config.h - * - * This include file defines the Configuration Table for this test. - * - * COPYRIGHT (c) 1989-1997. - * 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_TMTEST - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 111 -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/tmtests/tm14/tm14.adb b/c/src/ada-tests/tmtests/tm14/tm14.adb deleted file mode 100644 index 3835813b60..0000000000 --- a/c/src/ada-tests/tmtests/tm14/tm14.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test TM14 of the Timing 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 TMTEST; -with TEST_SUPPORT; - -procedure TM14 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, - TMTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end TM14; - diff --git a/c/src/ada-tests/tmtests/tm14/tmtest.adb b/c/src/ada-tests/tmtests/tm14/tmtest.adb deleted file mode 100644 index adde5deb77..0000000000 --- a/c/src/ada-tests/tmtests/tm14/tmtest.adb +++ /dev/null @@ -1,214 +0,0 @@ --- --- TMTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 14 of the RTEMS --- Timing 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 INTERFACES; use INTERFACES; -with RTEMS_CALLING_OVERHEAD; -with TEST_SUPPORT; -with TEXT_IO; -with TIME_TEST_SUPPORT; -with TIMER_DRIVER; -with RTEMS.MESSAGE_QUEUE; - -package body TMTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - TASK_ID : RTEMS.ID; - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TIME TEST 14 ***" ); - - RTEMS.TASKS.CREATE( - 1, - 251, - 1024, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - TASK_ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); - - RTEMS.TASKS.START( - TASK_ID, - TMTEST.TEST_INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- TEST_INIT --- - - procedure TEST_INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - TASK_ENTRY : RTEMS.TASKS.ENTRY_POINT; - PRIORITY : RTEMS.TASKS.PRIORITY; - TASK_ID : RTEMS.ID; - BUFFER : TMTEST.BUFFER; - BUFFER_POINTER : RTEMS.ADDRESS; - STATUS : RTEMS.STATUS_CODES; - begin - - BUFFER_POINTER := BUFFER'ADDRESS; - - RTEMS.MESSAGE_QUEUE.CREATE( - RTEMS.BUILD_NAME( 'M', 'Q', '1', ' ' ), - TIME_TEST_SUPPORT.OPERATION_COUNT, - 16, - RTEMS.DEFAULT_OPTIONS, - TMTEST.QUEUE_ID, - STATUS - ); - - PRIORITY := 250; - - for INDEX in 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT - 1 - loop - - RTEMS.TASKS.CREATE( - RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ), - PRIORITY, - 1024, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - TASK_ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); - - PRIORITY := PRIORITY - 1; - - if INDEX = TIME_TEST_SUPPORT.OPERATION_COUNT - 1 then - TASK_ENTRY := TMTEST.HIGH_TASK'ACCESS; - else - TASK_ENTRY := TMTEST.LOW_TASKS'ACCESS; - end if; - - RTEMS.TASKS.START( TASK_ID, TASK_ENTRY, 0, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); - - end loop; - - TIMER_DRIVER.INITIALIZE; - RTEMS.MESSAGE_QUEUE.URGENT( - TMTEST.QUEUE_ID, - BUFFER_POINTER, - 16, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSSAGE_QUEUE_URGENT" ); - - end TEST_INIT; - --- --- HIGH_TASK --- - - procedure HIGH_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - BUFFER : TMTEST.BUFFER; - BUFFER_POINTER : RTEMS.ADDRESS; - OVERHEAD : RTEMS.UNSIGNED32; - STATUS : RTEMS.STATUS_CODES; - begin - - BUFFER_POINTER := BUFFER'ADDRESS; - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - TIMER_DRIVER.EMPTY_FUNCTION; - end loop; - OVERHEAD := TIMER_DRIVER.READ_TIMER; - - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - - RTEMS.MESSAGE_QUEUE.URGENT( - TMTEST.QUEUE_ID, - BUFFER_POINTER, - 16, - STATUS - ); - - end loop; - - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "MESSAGE_QUEUE_URGENT (readying)", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_URGENT - ); - - TEXT_IO.PUT_LINE( "*** END OF TIME TEST 14 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end HIGH_TASK; - --- --- LOW_TASKS --- - - procedure LOW_TASKS ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - BUFFER : TMTEST.BUFFER; - BUFFER_POINTER : RTEMS.ADDRESS; - MESSAGE_SIZE : RTEMS.UNSIGNED32 := 0; - STATUS : RTEMS.STATUS_CODES; - begin - - BUFFER_POINTER := BUFFER'ADDRESS; - - RTEMS.MESSAGE_QUEUE.RECEIVE( - TMTEST.QUEUE_ID, - BUFFER_POINTER, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - MESSAGE_SIZE, - STATUS - ); - - end LOW_TASKS; - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm14/tmtest.ads b/c/src/ada-tests/tmtests/tm14/tmtest.ads deleted file mode 100644 index c90b1cadc3..0000000000 --- a/c/src/ada-tests/tmtests/tm14/tmtest.ads +++ /dev/null @@ -1,106 +0,0 @@ --- --- TMTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 14 of the RTEMS --- Timing 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; - -package TMTEST is - --- --- Buffer Record similar to that used by RTEMS 3.2.1. Using this --- avoids changes to the test. --- - - type BUFFER is - record - FIELD1 : RTEMS.UNSIGNED32; -- TEMPORARY UNTIL VARIABLE LENGTH - FIELD2 : RTEMS.UNSIGNED32; - FIELD3 : RTEMS.UNSIGNED32; - FIELD4 : RTEMS.UNSIGNED32; - end record; - --- --- The following is the ID of the message queue used for timing operations. --- - - QUEUE_ID : RTEMS.ID; - --- --- The following variable is set to the execution time returned --- by the timer. --- - - END_TIME : RTEMS.UNSIGNED32; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- TEST_INIT --- --- DESCRIPTION: --- --- This subprogram performs test initialization. --- - - procedure TEST_INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TEST_INIT); - --- --- HIGH_TASK --- --- DESCRIPTION: --- --- This RTEMS task is the lowest priority task in the system. It --- only executes after all of the LOW_TASKS have blocked. It then --- times a readying MESSAGE_QUEUE_SEND. --- - - procedure HIGH_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, HIGH_TASK); - --- --- LOW_TASKS --- --- DESCRIPTION: --- --- These RTEMS tasks perform a blocking MESSAGE_QUEUE_RECEIVE. --- - - procedure LOW_TASKS ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, LOW_TASKS); - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm15/Makefile.am b/c/src/ada-tests/tmtests/tm15/Makefile.am deleted file mode 100644 index 09713d4b66..0000000000 --- a/c/src/ada-tests/tmtests/tm15/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_tm15 -ada_tm15_SOURCES = tm15.adb config.h tmtest.adb tmtest.ads -ada_tm15_SOURCES += ../../support/init.c - -ada_tm15$(EXEEXT): tm15.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/tmtests/tm15/config.h b/c/src/ada-tests/tmtests/tm15/config.h deleted file mode 100644 index a5064b6e92..0000000000 --- a/c/src/ada-tests/tmtests/tm15/config.h +++ /dev/null @@ -1,32 +0,0 @@ -/* config.h - * - * This include file defines the Configuration Table for this test. - * - * COPYRIGHT (c) 1989-1997. - * 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_TMTEST - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 111 -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/tmtests/tm15/tm15.adb b/c/src/ada-tests/tmtests/tm15/tm15.adb deleted file mode 100644 index 31e40968da..0000000000 --- a/c/src/ada-tests/tmtests/tm15/tm15.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test TM15 of the Timing 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 TMTEST; -with TEST_SUPPORT; - -procedure TM15 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, - TMTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end TM15; - diff --git a/c/src/ada-tests/tmtests/tm15/tmtest.adb b/c/src/ada-tests/tmtests/tm15/tmtest.adb deleted file mode 100644 index 2a7efedcf9..0000000000 --- a/c/src/ada-tests/tmtests/tm15/tmtest.adb +++ /dev/null @@ -1,267 +0,0 @@ --- --- TMTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 15 of the RTEMS --- Timing 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_CALLING_OVERHEAD; -with TEST_SUPPORT; -with TEXT_IO; -with TIMER_DRIVER; -with RTEMS.EVENT; - -package body TMTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TIME TEST 15 ***" ); - - TMTEST.TEST_INIT; - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- TEST_INIT --- - - procedure TEST_INIT - is - ID : RTEMS.ID; - OVERHEAD : RTEMS.UNSIGNED32; - EVENT_OUT : RTEMS.EVENT_SET; - STATUS : RTEMS.STATUS_CODES; - begin - - TMTEST.TIME_SET := FALSE; - - RTEMS.TASKS.CREATE( - RTEMS.BUILD_NAME( 'L', 'O', 'W', ' ' ), - 10, - 1024, - RTEMS.NO_PREEMPT, - RTEMS.DEFAULT_ATTRIBUTES, - ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOW" ); - - RTEMS.TASKS.START( ID, TMTEST.LOW_TASK'ACCESS, 0, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOW" ); - - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - - RTEMS.TASKS.CREATE( - RTEMS.BUILD_NAME( 'H', 'I', 'G', 'H' ), - 5, - 1024, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - TMTEST.TASK_ID( INDEX ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); - - RTEMS.TASKS.START( - TMTEST.TASK_ID( INDEX ), - TMTEST.HIGH_TASKS'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); - - end loop; - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - TIMER_DRIVER.EMPTY_FUNCTION; - end loop; - OVERHEAD := TIMER_DRIVER.READ_TIMER; - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.EVENT.RECEIVE( - RTEMS.PENDING_EVENTS, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - EVENT_OUT, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "EVENT_RECEIVE (current)", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - RTEMS_CALLING_OVERHEAD.EVENT_RECEIVE - ); - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.EVENT.RECEIVE( - RTEMS.ALL_EVENTS, - RTEMS.NO_WAIT, - RTEMS.NO_TIMEOUT, - EVENT_OUT, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "EVENT_RECEIVE (NO_WAIT)", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - RTEMS_CALLING_OVERHEAD.EVENT_RECEIVE - ); - - end TEST_INIT; - --- --- LOW_TASK --- - - procedure LOW_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - EVENT_OUT : RTEMS.EVENT_SET; - OVERHEAD : RTEMS.UNSIGNED32; - STATUS : RTEMS.STATUS_CODES; - begin - - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "EVENT_RECEIVE (blocking)", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - 0, - RTEMS_CALLING_OVERHEAD.EVENT_RECEIVE - ); - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - TIMER_DRIVER.EMPTY_FUNCTION; - end loop; - OVERHEAD := TIMER_DRIVER.READ_TIMER; - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.EVENT.SEND( RTEMS.SELF, RTEMS.EVENT_16, STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "EVENT_SEND (returns to caller)", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - RTEMS_CALLING_OVERHEAD.EVENT_SEND - ); - - TIMER_DRIVER.INITIALIZE; - RTEMS.EVENT.RECEIVE( - RTEMS.EVENT_16, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - EVENT_OUT, - STATUS - ); - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "EVENT_RECEIVE (available)", - TMTEST.END_TIME, - 1, - 0, - RTEMS_CALLING_OVERHEAD.EVENT_RECEIVE - ); - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.EVENT.SEND( - TMTEST.TASK_ID( INDEX ), - RTEMS.EVENT_16, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "EVENT_SEND (readying)", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - RTEMS_CALLING_OVERHEAD.EVENT_SEND - ); - - TEXT_IO.PUT_LINE( "*** END OF TIME TEST 15 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end LOW_TASK; - --- --- HIGH_TASKS --- - - procedure HIGH_TASKS ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - EVENT_OUT : RTEMS.EVENT_SET; - STATUS : RTEMS.STATUS_CODES; - begin - - if TMTEST.TIME_SET = FALSE then - TMTEST.TIME_SET := TRUE; - TIMER_DRIVER.INITIALIZE; - end if; - - RTEMS.EVENT.RECEIVE( - 16#7FFFFFFF#, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - EVENT_OUT, - STATUS - ); - - end HIGH_TASKS; - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm15/tmtest.ads b/c/src/ada-tests/tmtests/tm15/tmtest.ads deleted file mode 100644 index b8ab38d6cd..0000000000 --- a/c/src/ada-tests/tmtests/tm15/tmtest.ads +++ /dev/null @@ -1,109 +0,0 @@ --- --- TMTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 15 of the RTEMS --- Timing 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 TIME_TEST_SUPPORT; -with RTEMS; -with RTEMS.TASKS; - -package TMTEST is - --- --- This array contains the IDs of all RTEMS tasks created by this test. --- - - TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. - TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.ID; - --- --- This variable is set to TRUE if the timer has been initialized --- and is currently timing an operation. --- - - TIME_SET : Standard.BOOLEAN; - --- --- The following variable is set to the execution time returned --- by the timer. --- - - END_TIME : RTEMS.UNSIGNED32; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- TEST_INIT --- --- DESCRIPTION: --- --- This subprogram performs test initialization. Once initialization --- has been completed, the following operations are timed and reported: --- --- + event_receive of currently PENDING_EVENTS --- + event_receive NO_WAIT case --- - - procedure TEST_INIT; - --- --- LOW_TASK --- --- DESCRIPTION: --- --- This RTEMS task stops the timer and reports the execution time --- of a blocking EVENT_RECEIVE. After this the following --- operations are timed and the execution time is reported: --- --- + EVENT_SEND which does not ready a task --- + EVENT_RECEIVE with the event condition available --- + EVENT_SEND which readies a task --- - - procedure LOW_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, LOW_TASK); - --- --- HIGH_TASKS --- --- DESCRIPTION: --- --- These RTEMS tasks executive a blocking EVENT_RECEIVE after --- initialization is complete. The first of these tasks to --- execute starts the timer. --- - - procedure HIGH_TASKS ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, HIGH_TASKS); - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm16/Makefile.am b/c/src/ada-tests/tmtests/tm16/Makefile.am deleted file mode 100644 index e3a598b83d..0000000000 --- a/c/src/ada-tests/tmtests/tm16/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_tm16 -ada_tm16_SOURCES = tm16.adb config.h tmtest.adb tmtest.ads -ada_tm16_SOURCES += ../../support/init.c - -ada_tm16$(EXEEXT): tm16.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/tmtests/tm16/config.h b/c/src/ada-tests/tmtests/tm16/config.h deleted file mode 100644 index a5064b6e92..0000000000 --- a/c/src/ada-tests/tmtests/tm16/config.h +++ /dev/null @@ -1,32 +0,0 @@ -/* config.h - * - * This include file defines the Configuration Table for this test. - * - * COPYRIGHT (c) 1989-1997. - * 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_TMTEST - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 111 -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/tmtests/tm16/tm16.adb b/c/src/ada-tests/tmtests/tm16/tm16.adb deleted file mode 100644 index a6d67d93ce..0000000000 --- a/c/src/ada-tests/tmtests/tm16/tm16.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test TM16 of the Timing 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 TMTEST; -with TEST_SUPPORT; - -procedure TM16 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, - TMTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end TM16; - diff --git a/c/src/ada-tests/tmtests/tm16/tmtest.adb b/c/src/ada-tests/tmtests/tm16/tmtest.adb deleted file mode 100644 index 4be7a6bbd6..0000000000 --- a/c/src/ada-tests/tmtests/tm16/tmtest.adb +++ /dev/null @@ -1,196 +0,0 @@ --- --- TMTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 16 of the RTEMS --- Timing 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 INTERFACES; use INTERFACES; -with RTEMS_CALLING_OVERHEAD; -with TEST_SUPPORT; -with TEXT_IO; -with TIMER_DRIVER; -with RTEMS.EVENT; - -package body TMTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - ID : RTEMS.ID; - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TIME TEST 16 ***" ); - - RTEMS.TASKS.CREATE( - RTEMS.BUILD_NAME( 'T', 'E', 'S', 'T' ), - 251, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TEST INIT" ); - - RTEMS.TASKS.START( - ID, - TMTEST.TEST_INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TEST INIT" ); - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- TEST_INIT --- - - procedure TEST_INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - PRIORITY : RTEMS.TASKS.PRIORITY; - TASK_ENTRY : RTEMS.TASKS.ENTRY_POINT; - STATUS : RTEMS.STATUS_CODES; - begin - - PRIORITY := 250; - - for INDEX in 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - - RTEMS.TASKS.CREATE( - RTEMS.BUILD_NAME( 'M', 'I', 'D', ' ' ), - PRIORITY, - 1024, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - TMTEST.TASK_ID( INDEX ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); - - if INDEX = TIME_TEST_SUPPORT.OPERATION_COUNT then - TASK_ENTRY := TMTEST.HIGH_TASK'ACCESS; - else - TASK_ENTRY := TMTEST.MIDDLE_TASKS'ACCESS; - end if; - - RTEMS.TASKS.START( - TMTEST.TASK_ID( INDEX ), - TASK_ENTRY, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); - - PRIORITY := PRIORITY - 1; - - end loop; - - TMTEST.TASK_COUNT := 0; - - TIMER_DRIVER.INITIALIZE; -- starts the timer - - RTEMS.EVENT.SEND( -- preempts task - TMTEST.TASK_ID( TMTEST.TASK_COUNT ), - RTEMS.EVENT_16, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND" ); - - end TEST_INIT; - --- --- MIDDLE_TASKS --- - - procedure MIDDLE_TASKS ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - EVENT_OUT : RTEMS.EVENT_SET; - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.EVENT.RECEIVE( -- task blocks - RTEMS.EVENT_16, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - EVENT_OUT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE" ); - - TMTEST.TASK_COUNT := TMTEST.TASK_COUNT + 1; - - RTEMS.EVENT.SEND( -- preempts task - TMTEST.TASK_ID( TMTEST.TASK_COUNT ), - RTEMS.EVENT_16, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND" ); - - end MIDDLE_TASKS; - --- --- HIGH_TASK --- - - procedure HIGH_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - EVENT_OUT : RTEMS.EVENT_SET; - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.EVENT.RECEIVE( -- task blocks - RTEMS.EVENT_16, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - EVENT_OUT, - STATUS - ); - - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "EVENT_SEND (preemptive)", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - 0, - RTEMS_CALLING_OVERHEAD.EVENT_SEND - ); - - TEXT_IO.PUT_LINE( "*** END OF TIME TEST 16 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end HIGH_TASK; - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm16/tmtest.ads b/c/src/ada-tests/tmtests/tm16/tmtest.ads deleted file mode 100644 index ab42eb259c..0000000000 --- a/c/src/ada-tests/tmtests/tm16/tmtest.ads +++ /dev/null @@ -1,112 +0,0 @@ --- --- TMTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 16 of the RTEMS --- Timing 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 TIME_TEST_SUPPORT; - -package TMTEST is - --- --- This array contains the IDs of all RTEMS tasks created by this test. --- - - TASK_ID : array ( RTEMS.UNSIGNED32 - range 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.ID; - --- --- This variable is used to index through the TASK_ID array --- so that events can be send to the next task. --- - - TASK_COUNT : RTEMS.UNSIGNED32; - --- --- The following variable is set to the execution time returned --- by the timer. --- - - END_TIME : RTEMS.UNSIGNED32; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- TEST_INIT --- --- DESCRIPTION: --- --- This subprogram performs test initialization. Once initialization --- has been completed, this task sets the TASK_COUNT to 0 and --- starts the timer before performing a preemptive EVENT_SEND. --- - - procedure TEST_INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TEST_INIT); - --- --- HIGH_TASK --- --- DESCRIPTION: --- --- This RTEMS task is highest priority task in the system. --- Its first action is to perform a blocking EVENT_RECEIVE. --- It is the last task to have its event set sent to it. Thus it --- is the last task to be awakened by a preemptive EVENT_SEND. --- After it preempts the last MIDDLE_TASKS, it stops the timer --- and reports the execution time of preemptive EVENT_SEND. --- - - procedure HIGH_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, HIGH_TASK); - --- --- MIDDLE_TASKS --- --- DESCRIPTION: --- --- These RTEMS tasks perform a blocking EVENT_RECEIVE. When --- readied, each task will increment the TASK_COUNT and --- perform a preemptive EVENT_SEND. TASK_COUNT is used to --- index the TASK_ID array in such a way that incrementing --- TASK_COUNT makes it index the ID of the next task to --- send events to. --- - - procedure MIDDLE_TASKS ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, MIDDLE_TASKS); - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm17/Makefile.am b/c/src/ada-tests/tmtests/tm17/Makefile.am deleted file mode 100644 index b46cc74a21..0000000000 --- a/c/src/ada-tests/tmtests/tm17/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_tm17 -ada_tm17_SOURCES = tm17.adb config.h tmtest.adb tmtest.ads -ada_tm17_SOURCES += ../../support/init.c - -ada_tm17$(EXEEXT): tm17.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/tmtests/tm17/config.h b/c/src/ada-tests/tmtests/tm17/config.h deleted file mode 100644 index a5064b6e92..0000000000 --- a/c/src/ada-tests/tmtests/tm17/config.h +++ /dev/null @@ -1,32 +0,0 @@ -/* config.h - * - * This include file defines the Configuration Table for this test. - * - * COPYRIGHT (c) 1989-1997. - * 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_TMTEST - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 111 -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/tmtests/tm17/tm17.adb b/c/src/ada-tests/tmtests/tm17/tm17.adb deleted file mode 100644 index efc2766479..0000000000 --- a/c/src/ada-tests/tmtests/tm17/tm17.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test TM17 of the Timing 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 TMTEST; -with TEST_SUPPORT; - -procedure TM17 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, - TMTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end TM17; - diff --git a/c/src/ada-tests/tmtests/tm17/tmtest.adb b/c/src/ada-tests/tmtests/tm17/tmtest.adb deleted file mode 100644 index 5e645581d4..0000000000 --- a/c/src/ada-tests/tmtests/tm17/tmtest.adb +++ /dev/null @@ -1,155 +0,0 @@ --- --- TMTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 17 of the RTEMS --- Timing 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 INTERFACES; use INTERFACES; -with RTEMS_CALLING_OVERHEAD; -with TEST_SUPPORT; -with TEXT_IO; -with TIMER_DRIVER; - -package body TMTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - TASK_ENTRY : RTEMS.TASKS.ENTRY_POINT; - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TIME TEST 17 ***" ); - - TMTEST.TASK_PRIORITY := 254; - - for INDEX in 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - - RTEMS.TASKS.CREATE( - RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ), - TMTEST.TASK_PRIORITY, - 1024, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - TMTEST.TASK_ID( INDEX ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); - - if INDEX = TIME_TEST_SUPPORT.OPERATION_COUNT then - TASK_ENTRY := TMTEST.LAST_TASK'ACCESS; - elsif INDEX = 0 then - TASK_ENTRY := TMTEST.FIRST_TASK'ACCESS; - else - TASK_ENTRY := TMTEST.MIDDLE_TASKS'ACCESS; - end if; - - RTEMS.TASKS.START( TMTEST.TASK_ID( INDEX ), TASK_ENTRY, 0, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); - - end loop; - - TMTEST.TASK_COUNT := 1; - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- FIRST_TASK --- - - procedure FIRST_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - PREVIOUS_PRIORITY : RTEMS.TASKS.PRIORITY; - STATUS : RTEMS.STATUS_CODES; - begin - - TIMER_DRIVER.INITIALIZE; - - TMTEST.TASK_PRIORITY := TMTEST.TASK_PRIORITY - 1; - TMTEST.TASK_COUNT := TMTEST.TASK_COUNT + 1; - - RTEMS.TASKS.SET_PRIORITY( - TMTEST.TASK_ID( TMTEST.TASK_COUNT ), - TMTEST.TASK_PRIORITY, - PREVIOUS_PRIORITY, - STATUS - ); - - end FIRST_TASK; - --- --- MIDDLE_TASKS --- - - procedure MIDDLE_TASKS ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - PREVIOUS_PRIORITY : RTEMS.TASKS.PRIORITY; - STATUS : RTEMS.STATUS_CODES; - begin - - TMTEST.TASK_PRIORITY := TMTEST.TASK_PRIORITY - 1; - TMTEST.TASK_COUNT := TMTEST.TASK_COUNT + 1; - - RTEMS.TASKS.SET_PRIORITY( - TMTEST.TASK_ID( TMTEST.TASK_COUNT ), - TMTEST.TASK_PRIORITY, - PREVIOUS_PRIORITY, - STATUS - ); - - end MIDDLE_TASKS; - --- --- LAST_TASK --- - - procedure LAST_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - begin - - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TASK_SET_PRIORITY (preemptive)", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - 0, - RTEMS_CALLING_OVERHEAD.TASK_SET_PRIORITY - ); - - TEXT_IO.PUT_LINE( "*** END OF TIME TEST 17 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end LAST_TASK; - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm17/tmtest.ads b/c/src/ada-tests/tmtests/tm17/tmtest.ads deleted file mode 100644 index b2c9369e26..0000000000 --- a/c/src/ada-tests/tmtests/tm17/tmtest.ads +++ /dev/null @@ -1,110 +0,0 @@ --- --- TMTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 17 of the RTEMS --- Timing 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 TIME_TEST_SUPPORT; - -package TMTEST is - --- --- These arrays contain the IDs and NAMEs of all RTEMS tasks created --- by this test. --- - - TASK_ID : array ( RTEMS.UNSIGNED32 - range 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.ID; - TASK_NAME : array ( RTEMS.UNSIGNED32 - range 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.NAME; - --- --- These variables are used to index the TASK_ID array and change --- the priority of each successive task such that the TASK_SET_PRIORITY --- results in a preemption. --- - - TASK_COUNT : RTEMS.UNSIGNED32; - TASK_PRIORITY : RTEMS.TASKS.PRIORITY; - --- --- The following variable is set to the execution time returned --- by the timer. --- - - END_TIME : RTEMS.UNSIGNED32; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- FIRST_TASK --- --- DESCRIPTION: --- --- This RTEMS task is the first task to execute in the system. It --- starts the timer and updates the TASK_COUNT and TASK_PRIORITY --- variables so that a preemptive TASK_SET_PRIORITY can be performed. --- - - procedure FIRST_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, FIRST_TASK); - --- --- MIDDLE_TASK --- --- DESCRIPTION: --- --- These RTEMS tasks update the TASK_COUNT and TASK_PRIORITY variables --- so that a preemptive TASK_SET_PRIORITY can be performed. --- - - procedure MIDDLE_TASKS ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, MIDDLE_TASKS); - --- --- LAST_TASK --- --- DESCRIPTION: --- --- This RTEMS task is the last task to execute in the system. It --- stops the timer and reports the execution time of a preemptive --- TASK_SET_PRIORITY. --- - - procedure LAST_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, LAST_TASK); - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm18/Makefile.am b/c/src/ada-tests/tmtests/tm18/Makefile.am deleted file mode 100644 index e1c08d484c..0000000000 --- a/c/src/ada-tests/tmtests/tm18/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_tm18 -ada_tm18_SOURCES = tm18.adb config.h tmtest.adb tmtest.ads -ada_tm18_SOURCES += ../../support/init.c - -ada_tm18$(EXEEXT): tm18.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/tmtests/tm18/config.h b/c/src/ada-tests/tmtests/tm18/config.h deleted file mode 100644 index a5064b6e92..0000000000 --- a/c/src/ada-tests/tmtests/tm18/config.h +++ /dev/null @@ -1,32 +0,0 @@ -/* config.h - * - * This include file defines the Configuration Table for this test. - * - * COPYRIGHT (c) 1989-1997. - * 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_TMTEST - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 111 -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/tmtests/tm18/tm18.adb b/c/src/ada-tests/tmtests/tm18/tm18.adb deleted file mode 100644 index 856b6f1127..0000000000 --- a/c/src/ada-tests/tmtests/tm18/tm18.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test TM18 of the Timing 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 TMTEST; -with TEST_SUPPORT; - -procedure TM18 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, - TMTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end TM18; - diff --git a/c/src/ada-tests/tmtests/tm18/tmtest.adb b/c/src/ada-tests/tmtests/tm18/tmtest.adb deleted file mode 100644 index e86b24cd4a..0000000000 --- a/c/src/ada-tests/tmtests/tm18/tmtest.adb +++ /dev/null @@ -1,151 +0,0 @@ --- --- TMTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 18 of the RTEMS --- Timing 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 INTERFACES; use INTERFACES; -with RTEMS_CALLING_OVERHEAD; -with TEST_SUPPORT; -with TEXT_IO; -with TIME_TEST_SUPPORT; -with TIMER_DRIVER; - -package body TMTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TIME TEST 18 ***" ); - - TMTEST.TEST_INIT; - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- TEST_INIT --- - - procedure TEST_INIT - is - ID : RTEMS.ID; - TASK_ENTRY : RTEMS.TASKS.ENTRY_POINT; - STATUS : RTEMS.STATUS_CODES; - begin - - for INDEX in 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - - RTEMS.TASKS.CREATE( - RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ), - 128, - 1024, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); - - - if INDEX = TIME_TEST_SUPPORT.OPERATION_COUNT then - TASK_ENTRY := TMTEST.LAST_TASK'ACCESS; - elsif INDEX = 0 then - TASK_ENTRY := TMTEST.FIRST_TASK'ACCESS; - else - TASK_ENTRY := TMTEST.MIDDLE_TASKS'ACCESS; - end if; - - RTEMS.TASKS.START( ID, TASK_ENTRY, 0, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); - - end loop; - - end TEST_INIT; - --- --- FIRST_TASK --- - - procedure FIRST_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TIMER_DRIVER.INITIALIZE; - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE" ); - - end FIRST_TASK; - --- --- MIDDLE_TASKS --- - - procedure MIDDLE_TASKS ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE" ); - - end MIDDLE_TASKS; - --- --- LAST_TASK --- - - procedure LAST_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - begin - - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TASK_DELETE (self)", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - 0, - RTEMS_CALLING_OVERHEAD.TASK_DELETE - ); - - TEXT_IO.PUT_LINE( "*** END OF TIME TEST 18 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end LAST_TASK; - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm18/tmtest.ads b/c/src/ada-tests/tmtests/tm18/tmtest.ads deleted file mode 100644 index 0b919d44a4..0000000000 --- a/c/src/ada-tests/tmtests/tm18/tmtest.ads +++ /dev/null @@ -1,97 +0,0 @@ --- --- TMTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 18 of the RTEMS --- Timing 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; - -package TMTEST is - --- --- The following variable is set to the execution time returned --- by the timer. --- - - END_TIME : RTEMS.UNSIGNED32; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- TEST_INIT --- --- DESCRIPTION: --- --- This subprogram performs test initialization. --- - - procedure TEST_INIT; - --- --- FIRST_TASK --- --- DESCRIPTION: --- --- This RTEMS task is the first task to execute. It starts the --- timer and performs a TASK_DELETE on itself. --- - - procedure FIRST_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, FIRST_TASK); - --- --- MIDDLE_TASKS --- --- DESCRIPTION: --- --- These RTEMS tasks perform a TASK_DELETE on themselves. --- - - procedure MIDDLE_TASKS ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - - pragma Convention (C, MIDDLE_TASKS); --- --- LAST_TASK --- --- DESCRIPTION: --- --- This RTEMS task is the last task to execute. It stops the --- timer and reports the execution time of a TASK_DELETE SELF. --- - - procedure LAST_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, LAST_TASK); - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm19/Makefile.am b/c/src/ada-tests/tmtests/tm19/Makefile.am deleted file mode 100644 index 3ce11ecde0..0000000000 --- a/c/src/ada-tests/tmtests/tm19/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_tm19 -ada_tm19_SOURCES = tm19.adb config.h tmtest.adb tmtest.ads -ada_tm19_SOURCES += ../../support/init.c - -ada_tm19$(EXEEXT): tm19.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/tmtests/tm19/config.h b/c/src/ada-tests/tmtests/tm19/config.h deleted file mode 100644 index a5064b6e92..0000000000 --- a/c/src/ada-tests/tmtests/tm19/config.h +++ /dev/null @@ -1,32 +0,0 @@ -/* config.h - * - * This include file defines the Configuration Table for this test. - * - * COPYRIGHT (c) 1989-1997. - * 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_TMTEST - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 111 -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/tmtests/tm19/tm19.adb b/c/src/ada-tests/tmtests/tm19/tm19.adb deleted file mode 100644 index 0b232d833a..0000000000 --- a/c/src/ada-tests/tmtests/tm19/tm19.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test TM19 of the Timing 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 TMTEST; -with TEST_SUPPORT; - -procedure TM19 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, - TMTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end TM19; - diff --git a/c/src/ada-tests/tmtests/tm19/tmtest.adb b/c/src/ada-tests/tmtests/tm19/tmtest.adb deleted file mode 100644 index 288a6a799d..0000000000 --- a/c/src/ada-tests/tmtests/tm19/tmtest.adb +++ /dev/null @@ -1,287 +0,0 @@ --- --- TMTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 19 of the RTEMS --- Timing 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_CALLING_OVERHEAD; -with TEST_SUPPORT; -with TEXT_IO; -with TIME_TEST_SUPPORT; -with TIMER_DRIVER; -with RTEMS.SIGNAL; - -package body TMTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TIME TEST 19 ***" ); - - RTEMS.TASKS.CREATE( - RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ), - 128, - 1024, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - TMTEST.TASK_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TASK1" ); - - RTEMS.TASKS.START( - TMTEST.TASK_ID( 1 ), - TMTEST.TASK_1'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TASK1" ); - - RTEMS.TASKS.CREATE( - RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ), - 127, - 1024, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - TMTEST.TASK_ID( 2 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TASK2" ); - - RTEMS.TASKS.START( - TMTEST.TASK_ID( 2 ), - TMTEST.TASK_2'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TASK2" ); - - RTEMS.TASKS.CREATE( - RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ), - 126, - 1024, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - TMTEST.TASK_ID( 3 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TASK3" ); - - RTEMS.TASKS.START( - TMTEST.TASK_ID( 3 ), - TMTEST.TASK_3'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TASK3" ); - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- PROCESS_ASR_FOR_PASS_1 --- - - procedure PROCESS_ASR_FOR_PASS_1 ( - SIGNALS : in RTEMS.SIGNAL_SET - ) is - pragma Unreferenced(SIGNALS); - begin - - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "SIGNAL_SEND (self)", - TMTEST.END_TIME, - 1, - 0, - RTEMS_CALLING_OVERHEAD.SIGNAL_SEND - ); - - TEXT_IO.PUT_LINE( "SIGNAL_ENTER (preemptive) na" ); - - TIMER_DRIVER.INITIALIZE; - - end PROCESS_ASR_FOR_PASS_1; - --- --- PROCESS_ASR_FOR_PASS_2 --- - - procedure PROCESS_ASR_FOR_PASS_2 ( - SIGNALS : in RTEMS.SIGNAL_SET - ) is - pragma Unreferenced(SIGNALS); - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.PUT_LINE( "SIGNAL_ENTER (preemptive) na" ); - - RTEMS.TASKS.RESUME( TMTEST.TASK_ID( 3 ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESUME" ); - - TIMER_DRIVER.INITIALIZE; - - end PROCESS_ASR_FOR_PASS_2; - --- --- TASK_1 --- - - procedure TASK_1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TIMER_DRIVER.INITIALIZE; - RTEMS.SIGNAL.CATCH( - TMTEST.PROCESS_ASR_FOR_PASS_1'ACCESS, - RTEMS.DEFAULT_MODES, - STATUS - ); - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SIGNAL_CATCH" ); - - TIME_TEST_SUPPORT.PUT_TIME( - "SIGNAL_CATCH", - TMTEST.END_TIME, - 1, - 0, - RTEMS_CALLING_OVERHEAD.SIGNAL_CATCH - ); - - TIMER_DRIVER.INITIALIZE; - RTEMS.SIGNAL.SEND( TMTEST.TASK_ID( 2 ), RTEMS.SIGNAL_1, STATUS ); - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SIGNAL_SEND" ); - - TIME_TEST_SUPPORT.PUT_TIME( - "SIGNAL_SEND (non-preemptive)", - TMTEST.END_TIME, - 1, - 0, - RTEMS_CALLING_OVERHEAD.SIGNAL_SEND - ); - - TIMER_DRIVER.INITIALIZE; - RTEMS.SIGNAL.SEND( RTEMS.SELF, RTEMS.SIGNAL_1, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SIGNAL_SEND" ); - - -- end time is done in ASR - - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "SIGNAL_RETURN (non-preemptive)", - TMTEST.END_TIME, - 1, - 0, - 0 - ); - - RTEMS.SIGNAL.CATCH( - TMTEST.PROCESS_ASR_FOR_PASS_2'ACCESS, - RTEMS.NO_PREEMPT, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SIGNAL_CATCH" ); - - TIMER_DRIVER.INITIALIZE; - RTEMS.SIGNAL.SEND( RTEMS.SELF, RTEMS.SIGNAL_1, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SIGNAL_SEND" ); - - end TASK_1; - --- --- PROCESS_ASR_FOR_TASK_2 --- - - procedure PROCESS_ASR_FOR_TASK_2 ( - SIGNALS : in RTEMS.SIGNAL_SET - ) is - begin - - NULL; - - end PROCESS_ASR_FOR_TASK_2; - --- --- TASK_2 --- - - procedure TASK_2 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.SIGNAL.CATCH( - TMTEST.PROCESS_ASR_FOR_TASK_2'ACCESS, - RTEMS.DEFAULT_MODES, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SIGNAL_CATCH" ); - - RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND" ); - - end TASK_2; - --- --- TASK_3 --- - - procedure TASK_3 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND" ); - - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "SIGNAL_RETURN (preemptive)", - TMTEST.END_TIME, - 1, - 0, - 0 - ); - - TEXT_IO.PUT_LINE( "*** END OF TIME TEST 19 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end TASK_3; - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm19/tmtest.ads b/c/src/ada-tests/tmtests/tm19/tmtest.ads deleted file mode 100644 index 7776b41b35..0000000000 --- a/c/src/ada-tests/tmtests/tm19/tmtest.ads +++ /dev/null @@ -1,147 +0,0 @@ --- --- TMTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 19 of the RTEMS --- Timing 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; - -package TMTEST is - --- --- This array contains the IDs of all RTEMS tasks created by this test. --- - - TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; - --- --- The following variable is set to the execution time returned --- by the timer. --- - - END_TIME : RTEMS.UNSIGNED32; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- PROCESS_ASR_FOR_PASS_1 --- --- DESCRIPTION: --- --- This subprogram is the ASR used to measure and report the --- execution time of a SIGNAL_SEND to SELF. Before it exits --- it starts the timer so that the execution time required to --- exit from an ASR back to the same task can be measured. --- - - procedure PROCESS_ASR_FOR_PASS_1 ( - SIGNALS : in RTEMS.SIGNAL_SET - ); - pragma Convention (C, PROCESS_ASR_FOR_PASS_1); - --- --- PROCESS_ASR_FOR_PASS_2 --- --- DESCRIPTION: --- --- This subprogram is the ASR which sets up for a preemptive --- return from an ASR. Before it exits it starts the timer --- so that the execution time required to exit from an ASR --- and transfer control to the another task can be measured. --- - - procedure PROCESS_ASR_FOR_PASS_2 ( - SIGNALS : in RTEMS.SIGNAL_SET - ); - pragma Convention (C, PROCESS_ASR_FOR_PASS_2); - --- --- TASK_1 --- --- DESCRIPTION: --- --- This RTEMS task is responsible for measuring and reporting --- the following execution times: --- --- + SIGNAL_CATCH --- + non-preemptive SIGNAL_SEND --- + non-preemptive return from an ASR --- - - procedure TASK_1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_1); - --- --- PROCESS_ASR_FOR_TASK_2 --- --- DESCRIPTION: --- --- This subprogram is the ASR for TASK_2. It performs no actions. --- - - procedure PROCESS_ASR_FOR_TASK_2 ( - SIGNALS : in RTEMS.SIGNAL_SET - ); - pragma Convention (C, PROCESS_ASR_FOR_TASK_2); - --- --- TASK_2 --- --- DESCRIPTION: --- --- This RTEMS task is used as the recipient of a SIGNAL_SEND. --- After establishing an ASR, it suspends itself to insure --- that it does not execute again. --- - - procedure TASK_2 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_2); - --- --- TASK_3 --- --- DESCRIPTION: --- --- This RTEMS task is used as the recipient of a preemptive --- SIGNAL_SEND. This task suspends itself and is resumed by --- an ASR for TASK_1. Once the task executes, it stops the --- timer and reports the execution time for a preemptive --- return from an ASR. --- - - procedure TASK_3 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_3); - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm20/Makefile.am b/c/src/ada-tests/tmtests/tm20/Makefile.am deleted file mode 100644 index 03ff046510..0000000000 --- a/c/src/ada-tests/tmtests/tm20/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_tm20 -ada_tm20_SOURCES = tm20.adb config.h tmtest.adb tmtest.ads -ada_tm20_SOURCES += ../../support/init.c - -ada_tm20$(EXEEXT): tm20.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/tmtests/tm20/config.h b/c/src/ada-tests/tmtests/tm20/config.h deleted file mode 100644 index 30b26944d9..0000000000 --- a/c/src/ada-tests/tmtests/tm20/config.h +++ /dev/null @@ -1,33 +0,0 @@ -/* config.h - * - * This include file defines the Configuration Table for this test. - * - * COPYRIGHT (c) 1989-1997. - * 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_TMTEST - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_PARTITIONS 1 -#define CONFIGURE_MAXIMUM_REGIONS 1 -#define CONFIGURE_MAXIMUM_TASKS 3 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/tmtests/tm20/tm20.adb b/c/src/ada-tests/tmtests/tm20/tm20.adb deleted file mode 100644 index 47ef899495..0000000000 --- a/c/src/ada-tests/tmtests/tm20/tm20.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test TM20 of the Timing 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 TMTEST; -with TEST_SUPPORT; - -procedure TM20 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, - TMTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end TM20; - diff --git a/c/src/ada-tests/tmtests/tm20/tmtest.adb b/c/src/ada-tests/tmtests/tm20/tmtest.adb deleted file mode 100644 index 4a997f3ff4..0000000000 --- a/c/src/ada-tests/tmtests/tm20/tmtest.adb +++ /dev/null @@ -1,455 +0,0 @@ --- --- TMTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 20 of the RTEMS --- Timing 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 INTERFACES; use INTERFACES; -with RTEMS_CALLING_OVERHEAD; -with TEST_SUPPORT; -with TEXT_IO; -with TIMER_DRIVER; -with RTEMS.PARTITION; -with RTEMS.REGION; - -package body TMTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TIME TEST 20 ***" ); - - RTEMS.TASKS.CREATE( - RTEMS.BUILD_NAME( 'T', 'I', 'M', '1' ), - 128, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - TMTEST.TASK_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TASK1" ); - - RTEMS.TASKS.START( - TMTEST.TASK_ID( 1 ), - TMTEST.TASK_1'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TASK1" ); - - RTEMS.TASKS.CREATE( - RTEMS.BUILD_NAME( 'T', 'I', 'M', '2' ), - 129, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - TMTEST.TASK_ID( 2 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TASK2" ); - - RTEMS.TASKS.START( - TMTEST.TASK_ID( 2 ), - TMTEST.TASK_2'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TASK2" ); - - 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); - BUFFER_COUNT : RTEMS.UNSIGNED32; - PREVIOUS_MODE : RTEMS.MODE; - PREVIOUS_PRIORITY : RTEMS.TASKS.PRIORITY; - STATUS : RTEMS.STATUS_CODES; - begin - - TMTEST.PARTITION_NAME := RTEMS.BUILD_NAME( 'P', 'A', 'R', 'T' ); - - TIMER_DRIVER.INITIALIZE; - - RTEMS.PARTITION.CREATE( - TMTEST.PARTITION_NAME, - TMTEST.PARTITION_AREA'ADDRESS, - 2048, - 128, - RTEMS.DEFAULT_ATTRIBUTES, - TMTEST.PARTITION_ID, - STATUS - ); - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "PARTITION_CREATE", - TMTEST.END_TIME, - 1, - 0, - RTEMS_CALLING_OVERHEAD.PARTITION_CREATE - ); - - TMTEST.REGION_NAME := RTEMS.BUILD_NAME( 'R', 'E', 'G', 'N' ); - - TIMER_DRIVER.INITIALIZE; - - RTEMS.REGION.CREATE( - TMTEST.REGION_NAME, - TMTEST.REGION_AREA'ADDRESS, - 2048, - 16, - RTEMS.DEFAULT_ATTRIBUTES, - TMTEST.REGION_ID, - STATUS - ); - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "REGION_CREATE", - TMTEST.END_TIME, - 1, - 0, - RTEMS_CALLING_OVERHEAD.REGION_CREATE - ); - - TIMER_DRIVER.INITIALIZE; - RTEMS.PARTITION.GET_BUFFER( - TMTEST.PARTITION_ID, - TMTEST.BUFFER_ADDRESS_1, - STATUS - ); - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "PARTITION_GET_BUFFER (available)", - TMTEST.END_TIME, - 1, - 0, - RTEMS_CALLING_OVERHEAD.PARTITION_GET_BUFFER - ); - - BUFFER_COUNT := 0; - loop - - RTEMS.PARTITION.GET_BUFFER( - TMTEST.PARTITION_ID, - TMTEST.BUFFER_ADDRESSES( BUFFER_COUNT ), - STATUS - ); - - exit when RTEMS.ARE_STATUSES_EQUAL( STATUS, RTEMS.UNSATISFIED ); - - BUFFER_COUNT := BUFFER_COUNT + 1; - - end loop; - - TIMER_DRIVER.INITIALIZE; - RTEMS.PARTITION.GET_BUFFER( - TMTEST.PARTITION_ID, - TMTEST.BUFFER_ADDRESS_2, - STATUS - ); - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "PARTITION_GET_BUFFER (not available)", - TMTEST.END_TIME, - 1, - 0, - RTEMS_CALLING_OVERHEAD.PARTITION_GET_BUFFER - ); - - TIMER_DRIVER.INITIALIZE; - RTEMS.PARTITION.RETURN_BUFFER( - TMTEST.PARTITION_ID, - TMTEST.BUFFER_ADDRESS_1, - STATUS - ); - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "PARTITION_RETURN_BUFFER", - TMTEST.END_TIME, - 1, - 0, - RTEMS_CALLING_OVERHEAD.PARTITION_RETURN_BUFFER - ); - - for INDEX in 0 .. BUFFER_COUNT - 1 - loop - - RTEMS.PARTITION.RETURN_BUFFER( - TMTEST.PARTITION_ID, - TMTEST.BUFFER_ADDRESSES( INDEX ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_RETURN_BUFFER" ); - - end loop; - - TIMER_DRIVER.INITIALIZE; - RTEMS.PARTITION.DELETE( TMTEST.PARTITION_ID, STATUS ); - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "PARTITION_DELETE", - TMTEST.END_TIME, - 1, - 0, - RTEMS_CALLING_OVERHEAD.PARTITION_DELETE - ); - - RTEMS.REGION.GET_SEGMENT( - TMTEST.REGION_ID, - 400, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - TMTEST.BUFFER_ADDRESS_2, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); - - TIMER_DRIVER.INITIALIZE; - RTEMS.REGION.GET_SEGMENT( - TMTEST.REGION_ID, - 400, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - TMTEST.BUFFER_ADDRESS_3, - STATUS - ); - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "REGION_GET_SEGMENT (available)", - TMTEST.END_TIME, - 1, - 0, - RTEMS_CALLING_OVERHEAD.REGION_GET_SEGMENT - ); - - TIMER_DRIVER.INITIALIZE; - RTEMS.REGION.GET_SEGMENT( - TMTEST.REGION_ID, - 1998, - RTEMS.NO_WAIT, - RTEMS.NO_TIMEOUT, - TMTEST.BUFFER_ADDRESS_4, - STATUS - ); - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "REGION_GET_SEGMENT (NO_WAIT)", - TMTEST.END_TIME, - 1, - 0, - RTEMS_CALLING_OVERHEAD.REGION_GET_SEGMENT - ); - - RTEMS.REGION.RETURN_SEGMENT( - TMTEST.REGION_ID, - TMTEST.BUFFER_ADDRESS_3, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" ); - - TIMER_DRIVER.INITIALIZE; - RTEMS.REGION.RETURN_SEGMENT( - TMTEST.REGION_ID, - TMTEST.BUFFER_ADDRESS_2, - STATUS - ); - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "REGION_RETURN_SEGMENT (no tasks waiting)", - TMTEST.END_TIME, - 1, - 0, - RTEMS_CALLING_OVERHEAD.REGION_RETURN_SEGMENT - ); - - RTEMS.REGION.GET_SEGMENT( - TMTEST.REGION_ID, - 400, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - TMTEST.BUFFER_ADDRESS_1, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); - - TIMER_DRIVER.INITIALIZE; - RTEMS.REGION.GET_SEGMENT( - TMTEST.REGION_ID, - 1998, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - TMTEST.BUFFER_ADDRESS_2, - STATUS - ); - - -- execute TASK_2 - - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "REGION_RETURN_SEGMENT (preempt)", - TMTEST.END_TIME, - 1, - 0, - RTEMS_CALLING_OVERHEAD.REGION_RETURN_SEGMENT - ); - - RTEMS.REGION.RETURN_SEGMENT( - TMTEST.REGION_ID, - TMTEST.BUFFER_ADDRESS_2, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" ); - - RTEMS.TASKS.MODE( - RTEMS.NO_PREEMPT, - RTEMS.PREEMPT_MASK, - PREVIOUS_MODE, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); - - RTEMS.TASKS.SET_PRIORITY( RTEMS.SELF, 254, PREVIOUS_PRIORITY, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" ); - - RTEMS.REGION.GET_SEGMENT( - TMTEST.REGION_ID, - 400, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - TMTEST.BUFFER_ADDRESS_1, - STATUS - ); - - RTEMS.REGION.GET_SEGMENT( - TMTEST.REGION_ID, - 1998, - RTEMS.DEFAULT_OPTIONS, - RTEMS.NO_TIMEOUT, - TMTEST.BUFFER_ADDRESS_2, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); - - -- execute TASK_2 - - RTEMS.REGION.RETURN_SEGMENT( - TMTEST.REGION_ID, - TMTEST.BUFFER_ADDRESS_2, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" ); - - TIMER_DRIVER.INITIALIZE; - RTEMS.REGION.DELETE( TMTEST.REGION_ID, STATUS ); - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_DELETE" ); - - TIME_TEST_SUPPORT.PUT_TIME( - "REGION_DELETE", - TMTEST.END_TIME, - 1, - 0, - RTEMS_CALLING_OVERHEAD.REGION_DELETE - ); - - TEXT_IO.PUT_LINE( "*** END OF TIME TEST 20 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end TASK_1; - --- --- TASK_2 --- - - procedure TASK_2 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "REGION_GET_SEGMENT (blocking)", - TMTEST.END_TIME, - 1, - 0, - RTEMS_CALLING_OVERHEAD.REGION_GET_SEGMENT - ); - - TIMER_DRIVER.INITIALIZE; - RTEMS.REGION.RETURN_SEGMENT( - TMTEST.REGION_ID, - TMTEST.BUFFER_ADDRESS_1, - STATUS - ); - - -- preempt back to TASK_1 - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" ); - - TIMER_DRIVER.INITIALIZE; - RTEMS.REGION.RETURN_SEGMENT( - TMTEST.REGION_ID, - TMTEST.BUFFER_ADDRESS_1, - STATUS - ); - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" ); - - TIME_TEST_SUPPORT.PUT_TIME( - "REGION_RETURN_SEGMENT (ready -- return)", - TMTEST.END_TIME, - 1, - 0, - RTEMS_CALLING_OVERHEAD.REGION_RETURN_SEGMENT - ); - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end TASK_2; - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm20/tmtest.ads b/c/src/ada-tests/tmtests/tm20/tmtest.ads deleted file mode 100644 index 8afc25ac2c..0000000000 --- a/c/src/ada-tests/tmtests/tm20/tmtest.ads +++ /dev/null @@ -1,151 +0,0 @@ --- --- TMTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 20 of the RTEMS --- Timing 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 TIME_TEST_SUPPORT; -with RTEMS; -with RTEMS.TASKS; - -package TMTEST is - --- --- These arrays contain the IDs and NAMEs of all RTEMS tasks created --- by this test. --- - - TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; - TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; - --- --- These following are the ID and NAME of the RTEMS partition created --- by this test. --- - - PARTITION_ID : RTEMS.ID; - PARTITION_NAME : RTEMS.NAME; - --- --- These following are the ID and NAME of the RTEMS region created --- by this test. --- - - REGION_ID : RTEMS.ID; - REGION_NAME : RTEMS.NAME; - --- --- The following area defines a memory area to be used as the --- memory space for a partition. --- - - PARTITION_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 2047 ) - of RTEMS.UNSIGNED8; - for PARTITION_AREA'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT; - --- --- The following area defines a memory area to be used as the --- memory space for a region. --- - - REGION_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 2047 ) - of RTEMS.UNSIGNED8; - - for REGION_AREA'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT; - --- --- The following are the buffers allocated from the region. --- - - BUFFER_ADDRESS_1 : RTEMS.ADDRESS; - BUFFER_ADDRESS_2 : RTEMS.ADDRESS; - BUFFER_ADDRESS_3 : RTEMS.ADDRESS; - BUFFER_ADDRESS_4 : RTEMS.ADDRESS; - - BUFFER_ADDRESSES : array ( RTEMS.UNSIGNED32 - range 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.ADDRESS; - --- --- The following variable is set to the execution time returned --- by the timer. --- - - END_TIME : RTEMS.UNSIGNED32; - --- --- 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 is responsible for measuring and reporting --- the following execution times: --- --- + PARTITION_CREATE --- + REGION_CREATE --- + PARTITION_GET_BUFFER with a buffer available --- + PARTITION_GET_BUFFER with no buffers available --- + PARTITION_RETURN_BUFFER --- + PARTITION_DELETE --- + REGION_GET_SEGMENT with a segment available --- + REGION_GET_SEGMENT with the NO_WAIT option --- + REGION_RETURN_SEGMENT with no tasks waiting for memory --- + REGION_RETURN_SEGMENT preemptive --- + REGION_DELETE --- + IO_INITIALIZE --- + IO_OPEN --- + IO_CLOSE --- + IO_READ --- + IO_WRITE --- + IO_CONTROL --- - - procedure TASK_1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_1); - --- --- TASK_2 --- --- DESCRIPTION: --- --- This RTEMS task is responsible for measuring and reporting --- the following execution times: --- --- + blocking REGION_GET_SEGMENT --- + REGION_RETURN_SEGMENT which readies a task --- - - procedure TASK_2 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_2); - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm21/Makefile.am b/c/src/ada-tests/tmtests/tm21/Makefile.am deleted file mode 100644 index 7adced3f74..0000000000 --- a/c/src/ada-tests/tmtests/tm21/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_tm21 -ada_tm21_SOURCES = tm21.adb config.h tmtest.adb tmtest.ads -ada_tm21_SOURCES += ../../support/init.c - -ada_tm21$(EXEEXT): tm21.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/tmtests/tm21/config.h b/c/src/ada-tests/tmtests/tm21/config.h deleted file mode 100644 index d4b8bc5054..0000000000 --- a/c/src/ada-tests/tmtests/tm21/config.h +++ /dev/null @@ -1,38 +0,0 @@ -/* config.h - * - * This include file defines the Configuration Table for this test. - * - * COPYRIGHT (c) 1989-1997. - * 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_TMTEST - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 102 -#define CONFIGURE_MAXIMUM_TIMERS 100 -#define CONFIGURE_MAXIMUM_SEMAPHORES 100 -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 100 -#define CONFIGURE_MAXIMUM_PARTITIONS 100 -#define CONFIGURE_MAXIMUM_REGIONS 100 -#define CONFIGURE_MAXIMUM_PORTS 100 -#define CONFIGURE_MAXIMUM_PERIODS 100 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/tmtests/tm21/tm21.adb b/c/src/ada-tests/tmtests/tm21/tm21.adb deleted file mode 100644 index 45381ece6c..0000000000 --- a/c/src/ada-tests/tmtests/tm21/tm21.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test TM21 of the Timing 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 TMTEST; -with TEST_SUPPORT; - -procedure TM21 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, - TMTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end TM21; - diff --git a/c/src/ada-tests/tmtests/tm21/tmtest.adb b/c/src/ada-tests/tmtests/tm21/tmtest.adb deleted file mode 100644 index 245376953d..0000000000 --- a/c/src/ada-tests/tmtests/tm21/tmtest.adb +++ /dev/null @@ -1,304 +0,0 @@ --- --- TMTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 21 of the RTEMS --- Timing 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_CALLING_OVERHEAD; -with TEST_SUPPORT; -with TEXT_IO; -with TIME_TEST_SUPPORT; -with TIMER_DRIVER; -with RTEMS.MESSAGE_QUEUE; -with RTEMS.PARTITION; -with RTEMS.PORT; -with RTEMS.RATE_MONOTONIC; -with RTEMS.REGION; -with RTEMS.SEMAPHORE; -with RTEMS.TIMER; - -package body TMTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - ID : RTEMS.ID; - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TIME TEST 21 ***" ); - - RTEMS.TASKS.CREATE( - RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ), - 250, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE TASK_1" ); - - RTEMS.TASKS.START( ID, TMTEST.TASK_1'ACCESS, 0, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START TASK1" ); - - 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); - ID : RTEMS.ID; - OVERHEAD : RTEMS.UNSIGNED32; - STATUS : RTEMS.STATUS_CODES; - begin - - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - - RTEMS.TASKS.CREATE( - INDEX, - 254, - 1024, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); - - RTEMS.MESSAGE_QUEUE.CREATE( - INDEX, - TIME_TEST_SUPPORT.OPERATION_COUNT, - 16, - RTEMS.DEFAULT_ATTRIBUTES, - ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_CREATE" ); - - RTEMS.SEMAPHORE.CREATE( - INDEX, - TIME_TEST_SUPPORT.OPERATION_COUNT, - RTEMS.DEFAULT_ATTRIBUTES, - RTEMS.TASKS.NO_PRIORITY, - ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE" ); - - RTEMS.REGION.CREATE( - INDEX, - TMTEST.REGION_AREA'ADDRESS, - 2048, - 16, - RTEMS.DEFAULT_ATTRIBUTES, - ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_CREATE" ); - - RTEMS.PARTITION.CREATE( - INDEX, - TMTEST.PARTITION_AREA'ADDRESS, - 2048, - 128, - RTEMS.DEFAULT_ATTRIBUTES, - ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_CREATE" ); - - RTEMS.PORT.CREATE( - INDEX, - TMTEST.INTERNAL_PORT_AREA'ADDRESS, - TMTEST.EXTERNAL_PORT_AREA'ADDRESS, - 16#FF#, - ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PORT_CREATE" ); - - RTEMS.TIMER.CREATE( INDEX, ID, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE" ); - - RTEMS.RATE_MONOTONIC.CREATE( INDEX, ID, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "RATE_MONOTONIC_CREATE" ); - - end loop; - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - TIMER_DRIVER.EMPTY_FUNCTION; - end loop; - OVERHEAD := TIMER_DRIVER.READ_TIMER; - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.TASKS.IDENT( INDEX, RTEMS.SEARCH_ALL_NODES, ID, STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TASK_IDENT", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - RTEMS_CALLING_OVERHEAD.TASK_IDENT - ); - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.MESSAGE_QUEUE.IDENT( - INDEX, - RTEMS.SEARCH_ALL_NODES, - ID, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "MESSAGE_QUEUE_IDENT", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_IDENT - ); - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.SEMAPHORE.IDENT( - INDEX, - RTEMS.SEARCH_ALL_NODES, - ID, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "SEMAPHORE_IDENT", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - RTEMS_CALLING_OVERHEAD.SEMAPHORE_IDENT - ); - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.PARTITION.IDENT( - INDEX, - RTEMS.SEARCH_ALL_NODES, - ID, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "PARTITION_IDENT", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - RTEMS_CALLING_OVERHEAD.PARTITION_IDENT - ); - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.REGION.IDENT( INDEX, ID, STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "REGION_IDENT", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - RTEMS_CALLING_OVERHEAD.REGION_IDENT - ); - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.PORT.IDENT( INDEX, ID, STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "PORT_IDENT", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - RTEMS_CALLING_OVERHEAD.PORT_IDENT - ); - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.TIMER.IDENT( INDEX, ID, STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TIMER_IDENT", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - RTEMS_CALLING_OVERHEAD.TIMER_IDENT - ); - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.RATE_MONOTONIC.IDENT( INDEX, ID, STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "RATE_MONOTONIC_IDENT", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - RTEMS_CALLING_OVERHEAD.RATE_MONOTONIC_IDENT - ); - - TEXT_IO.PUT_LINE( "*** END OF TIME TEST 21 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end TASK_1; - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm21/tmtest.ads b/c/src/ada-tests/tmtests/tm21/tmtest.ads deleted file mode 100644 index 538ffad4d0..0000000000 --- a/c/src/ada-tests/tmtests/tm21/tmtest.ads +++ /dev/null @@ -1,121 +0,0 @@ --- --- TMTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 21 of the RTEMS --- Timing 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 TMTEST is - --- --- These arrays contain the IDs and NAMEs of all RTEMS tasks created --- by this test. --- - - TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; - TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; - --- --- The following variable is set to the execution time returned --- by the timer. --- - - END_TIME : RTEMS.UNSIGNED32; - --- --- 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 as the --- memory space for a partition. --- - - PARTITION_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 2047 ) - of RTEMS.UNSIGNED8; - for PARTITION_AREA'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT; - --- --- These following are the ID and NAME of the RTEMS region created --- by this test. --- - - REGION_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 2047 ) - of RTEMS.UNSIGNED8; - for REGION_AREA'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT; - --- --- 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 is responsible for measuring and reporting the --- following directive execution times: --- --- + TASK_IDENT --- + MESSAGE_QUEUE_IDENT --- + SEMAPHORE_IDENT --- + PARTITION_IDENT --- + REGION_IDENT --- + PORT_IDENT --- + TIMER_IDENT --- + RATE_MONOTONIC_IDENT --- - - procedure TASK_1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_1); - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm22/Makefile.am b/c/src/ada-tests/tmtests/tm22/Makefile.am deleted file mode 100644 index bbed77ec88..0000000000 --- a/c/src/ada-tests/tmtests/tm22/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_tm22 -ada_tm22_SOURCES = tm22.adb config.h tmtest.adb tmtest.ads -ada_tm22_SOURCES += ../../support/init.c - -ada_tm22$(EXEEXT): tm22.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/tmtests/tm22/config.h b/c/src/ada-tests/tmtests/tm22/config.h deleted file mode 100644 index c1585c7ef4..0000000000 --- a/c/src/ada-tests/tmtests/tm22/config.h +++ /dev/null @@ -1,32 +0,0 @@ -/* config.h - * - * This include file defines the Configuration Table for this test. - * - * COPYRIGHT (c) 1989-1997. - * 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_TMTEST - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 103 -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/tmtests/tm22/tm22.adb b/c/src/ada-tests/tmtests/tm22/tm22.adb deleted file mode 100644 index ce755dd517..0000000000 --- a/c/src/ada-tests/tmtests/tm22/tm22.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test TM22 of the Timing 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 TMTEST; -with TEST_SUPPORT; - -procedure TM22 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, - TMTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end TM22; - diff --git a/c/src/ada-tests/tmtests/tm22/tmtest.adb b/c/src/ada-tests/tmtests/tm22/tmtest.adb deleted file mode 100644 index ea1afc84c9..0000000000 --- a/c/src/ada-tests/tmtests/tm22/tmtest.adb +++ /dev/null @@ -1,252 +0,0 @@ --- --- TMTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 22 of the RTEMS --- Timing 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_CALLING_OVERHEAD; -with TEST_SUPPORT; -with TEXT_IO; -with TIME_TEST_SUPPORT; -with TIMER_DRIVER; -with RTEMS.MESSAGE_QUEUE; - -package body TMTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - ID : RTEMS.ID; - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TIME TEST 22 ***" ); - - RTEMS.MESSAGE_QUEUE.CREATE( - RTEMS.BUILD_NAME( 'M', 'Q', '1', ' ' ), - 100, - 16, - RTEMS.DEFAULT_ATTRIBUTES, - TMTEST.MESSAGE_QUEUE_ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_CREATE" ); - - RTEMS.TASKS.CREATE( - RTEMS.BUILD_NAME( 'L', 'O', 'W', ' ' ), - 10, - 2048, - RTEMS.NO_PREEMPT, - RTEMS.DEFAULT_ATTRIBUTES, - ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOW" ); - - RTEMS.TASKS.START( ID, TMTEST.LOW_TASK'ACCESS, 0, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOW" ); - - RTEMS.TASKS.CREATE( - RTEMS.BUILD_NAME( 'P', 'R', 'M', 'T' ), - 11, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE PREEMPT" ); - - RTEMS.TASKS.START( ID, TMTEST.PREEMPT_TASK'ACCESS, 0, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START PREEMPT" ); - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- HIGH_TASK --- - - procedure HIGH_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - BUFFER : TMTEST.BUFFER; - BUFFER_POINTER : RTEMS.ADDRESS; - COUNT : RTEMS.UNSIGNED32; - STATUS : RTEMS.STATUS_CODES; - begin - - BUFFER_POINTER := BUFFER'ADDRESS; - - TIMER_DRIVER.INITIALIZE; - RTEMS.MESSAGE_QUEUE.BROADCAST( - TMTEST.MESSAGE_QUEUE_ID, - BUFFER_POINTER, - 16, - COUNT, - STATUS - ); - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "MESSAGE_QUEUE_BROADCAST (readying)", - TMTEST.END_TIME, - 1, - 0, - RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_BROADCAST - ); - - RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND" ); - - end HIGH_TASK; - --- --- LOW_TASK --- - - procedure LOW_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - ID : RTEMS.ID; - BUFFER : TMTEST.BUFFER; - BUFFER_POINTER : RTEMS.ADDRESS; - OVERHEAD : RTEMS.UNSIGNED32; - COUNT : RTEMS.UNSIGNED32; - MESSAGE_SIZE : RTEMS.UNSIGNED32 := 0; - STATUS : RTEMS.STATUS_CODES; - begin - - BUFFER_POINTER := BUFFER'ADDRESS; - - RTEMS.TASKS.CREATE( - RTEMS.BUILD_NAME( 'H', 'I', 'G', 'H' ), - 5, - 2048, - RTEMS.NO_PREEMPT, - RTEMS.DEFAULT_ATTRIBUTES, - ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE HIGH" ); - - RTEMS.TASKS.START( ID, TMTEST.HIGH_TASK'ACCESS, 0, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START HIGH" ); - - RTEMS.MESSAGE_QUEUE.RECEIVE( - TMTEST.MESSAGE_QUEUE_ID, - BUFFER_POINTER, - RTEMS.DEFAULT_MODES, - RTEMS.NO_TIMEOUT, - MESSAGE_SIZE, - STATUS - ); - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - TIMER_DRIVER.EMPTY_FUNCTION; - end loop; - OVERHEAD := TIMER_DRIVER.READ_TIMER; - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.MESSAGE_QUEUE.BROADCAST( - TMTEST.MESSAGE_QUEUE_ID, - BUFFER_POINTER, - 16, - COUNT, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "MESSAGE_QUEUE_BROADCAST (no waiting tasks)", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_BROADCAST - ); - - RTEMS.MESSAGE_QUEUE.RECEIVE( - TMTEST.MESSAGE_QUEUE_ID, - BUFFER_POINTER, - RTEMS.DEFAULT_MODES, - RTEMS.NO_TIMEOUT, - MESSAGE_SIZE, - STATUS - ); - - -- should go to PREEMPT_TASK here - - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "MESSAGE_QUEUE_BROADCAST (preempt)", - TMTEST.END_TIME, - 1, - 0, - RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_BROADCAST - ); - - TEXT_IO.PUT_LINE( "*** END OF TIME TEST 22 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end LOW_TASK; - --- --- LOW_TASK --- - - procedure PREEMPT_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - BUFFER : TMTEST.BUFFER; - BUFFER_POINTER : RTEMS.ADDRESS; - COUNT : RTEMS.UNSIGNED32; - STATUS : RTEMS.STATUS_CODES; - begin - - BUFFER_POINTER := BUFFER'ADDRESS; - - TIMER_DRIVER.INITIALIZE; - RTEMS.MESSAGE_QUEUE.BROADCAST( - TMTEST.MESSAGE_QUEUE_ID, - BUFFER_POINTER, - 16, - COUNT, - STATUS - ); - - -- should be preempted by LOW_TASK - - end PREEMPT_TASK; - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm22/tmtest.ads b/c/src/ada-tests/tmtests/tm22/tmtest.ads deleted file mode 100644 index f5dce6c3a0..0000000000 --- a/c/src/ada-tests/tmtests/tm22/tmtest.ads +++ /dev/null @@ -1,120 +0,0 @@ --- --- TMTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 22 of the RTEMS --- Timing 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; - -package TMTEST is - --- --- Buffer Record similar to that used by RTEMS 3.2.1. Using this --- avoids changes to the test. --- - - type BUFFER is - record - FIELD1 : RTEMS.UNSIGNED32; -- TEMPORARY UNTIL VARIABLE LENGTH - FIELD2 : RTEMS.UNSIGNED32; - FIELD3 : RTEMS.UNSIGNED32; - FIELD4 : RTEMS.UNSIGNED32; - end record; - --- --- The following is the ID of the message queue used for timing operations. --- - - MESSAGE_QUEUE_ID : RTEMS.ID; - --- --- The following variable is set to the execution time returned --- by the timer. --- - - END_TIME : RTEMS.UNSIGNED32; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- HIGH_TASK --- --- DESCRIPTION: --- --- This RTEMS task is created by LOW_TASK and executes after --- LOW_TASK has performed a blocking MESSAGE_QUEUE_RECEIVE. --- This task then executes and performs a readying --- MESSAGE_QUEUE_BROADCAST and reports its execution time. --- Finally, the task suspends itself so LOW_TASK can continue --- execution. --- - - procedure HIGH_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, HIGH_TASK); - --- --- LOW_TASK --- --- DESCRIPTION: --- --- This RTEMS task performs a blocking MESSAGE_QUEUE_RECEIVE --- so that when HIGH_TASK performs a MESSAGE_QUEUE_BROADCAST, --- there will be a task to be readied. Following this, the --- execution time for a MESSAGE_QUEUE_BROADCAST to a message --- queue with no waiting tasks is measured and reported. --- Then this task performs another blocking MESSAGE_QUEUE_RECEIVE --- so that when PREEMPT_TASK performs a MESSAGE_QUEUE_BROADCAST, --- PREEMPT_TASK will be preempted by this task. After control --- of the processor is transferred back to this task by the --- preemption, the timer is stopped and the execution time of --- a preemptive MESSAGE_QUEUE_BROADCAST is reported. --- - - procedure LOW_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, LOW_TASK); - --- --- PREEMPT_TASK --- --- DESCRIPTION: --- --- This RTEMS task starts the timer and performs a preemptive --- MESSAGE_QUEUE_BROADCAST. --- - - procedure PREEMPT_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, PREEMPT_TASK); - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm23/Makefile.am b/c/src/ada-tests/tmtests/tm23/Makefile.am deleted file mode 100644 index 04800ceb24..0000000000 --- a/c/src/ada-tests/tmtests/tm23/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_tm23 -ada_tm23_SOURCES = tm23.adb config.h tmtest.adb tmtest.ads -ada_tm23_SOURCES += ../../support/init.c - -ada_tm23$(EXEEXT): tm23.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/tmtests/tm23/config.h b/c/src/ada-tests/tmtests/tm23/config.h deleted file mode 100644 index 15e3e1ccf6..0000000000 --- a/c/src/ada-tests/tmtests/tm23/config.h +++ /dev/null @@ -1,32 +0,0 @@ -/* config.h - * - * This include file defines the Configuration Table for this test. - * - * COPYRIGHT (c) 1989-1997. - * 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_TMTEST - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 111 -#define CONFIGURE_MAXIMUM_TIMERS 110 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/tmtests/tm23/tm23.adb b/c/src/ada-tests/tmtests/tm23/tm23.adb deleted file mode 100644 index 5e345c958a..0000000000 --- a/c/src/ada-tests/tmtests/tm23/tm23.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test TM23 of the Timing 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 TMTEST; -with TEST_SUPPORT; - -procedure TM23 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, - TMTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end TM23; - diff --git a/c/src/ada-tests/tmtests/tm23/tmtest.adb b/c/src/ada-tests/tmtests/tm23/tmtest.adb deleted file mode 100644 index 4b5a26f777..0000000000 --- a/c/src/ada-tests/tmtests/tm23/tmtest.adb +++ /dev/null @@ -1,388 +0,0 @@ --- --- TMTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 23 of the RTEMS --- Timing 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 INTERFACES; use INTERFACES; -with RTEMS_CALLING_OVERHEAD; -with TEST_SUPPORT; -with TEXT_IO; -with TIMER_DRIVER; -with RTEMS.CLOCK; -with RTEMS.TIMER; - -package body TMTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - TASK_PRIORITY : RTEMS.TASKS.PRIORITY; - ID : RTEMS.ID; - TASK_ENTRY : RTEMS.TASKS.ENTRY_POINT; - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TIME TEST 23 ***" ); - - TASK_PRIORITY := 5; - - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - - RTEMS.TASKS.CREATE( - RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ), - TASK_PRIORITY, - 1024, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); - - if INDEX = 1 then - TASK_ENTRY := TMTEST.HIGH_TASK'ACCESS; - elsif INDEX = TIME_TEST_SUPPORT.OPERATION_COUNT then - TASK_ENTRY := TMTEST.LOW_TASK'ACCESS; - else - TASK_ENTRY := TMTEST.MIDDLE_TASKS'ACCESS; - end if; - - RTEMS.TASKS.START( ID, TASK_ENTRY, 0, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); - - TASK_PRIORITY := TASK_PRIORITY + 1; - - end loop; - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- NULL_DELAY --- - - procedure NULL_DELAY ( - IGNORED_ID : in RTEMS.ID; - IGNORED_ADDRESS : in RTEMS.ADDRESS - ) is - begin - - NULL; - - end NULL_DELAY; - --- --- HIGH_TASK --- - - procedure HIGH_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - OVERHEAD : RTEMS.UNSIGNED32; - STATUS : RTEMS.STATUS_CODES; - begin - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - TIMER_DRIVER.EMPTY_FUNCTION; - end loop; - OVERHEAD := TIMER_DRIVER.READ_TIMER; - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.TIMER.CREATE( - INDEX, - TMTEST.TIMER_ID( INDEX ), - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TIMER_CREATE", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - 0, - RTEMS_CALLING_OVERHEAD.TIMER_CREATE - ); - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.TIMER.FIRE_AFTER( - TMTEST.TIMER_ID( INDEX ), - 500, - TMTEST.NULL_DELAY'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TIMER_FIRE_AFTER (inactive)", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - RTEMS_CALLING_OVERHEAD.TIMER_FIRE_AFTER - ); - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.TIMER.FIRE_AFTER( - TMTEST.TIMER_ID( INDEX ), - 500, - TMTEST.NULL_DELAY'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TIMER_FIRE_AFTER (active)", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - 0, - RTEMS_CALLING_OVERHEAD.TIMER_FIRE_AFTER - ); - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.TIMER.CANCEL( TMTEST.TIMER_ID( INDEX ), STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TIMER_CANCEL (active)", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - 0, - RTEMS_CALLING_OVERHEAD.TIMER_CANCEL - ); - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.TIMER.CANCEL( TMTEST.TIMER_ID( INDEX ), STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TIMER_CANCEL (inactive)", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - 0, - RTEMS_CALLING_OVERHEAD.TIMER_CANCEL - ); - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.TIMER.RESET( TMTEST.TIMER_ID( INDEX ), STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TIMER_RESET (inactive)", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - 0, - RTEMS_CALLING_OVERHEAD.TIMER_RESET - ); - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.TIMER.RESET( TMTEST.TIMER_ID( INDEX ), STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TIMER_RESET (active)", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - 0, - RTEMS_CALLING_OVERHEAD.TIMER_RESET - ); - - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.TIMER.CANCEL( TMTEST.TIMER_ID( INDEX ), STATUS ); - end loop; - - TMTEST.TIME_OF_DAY := ( 1988, 12, 31, 9, 0, 0, 0 ); - - RTEMS.CLOCK.SET( TMTEST.TIME_OF_DAY, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET" ); - - TMTEST.TIME_OF_DAY.YEAR := 1989; - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.TIMER.FIRE_WHEN( - TMTEST.TIMER_ID( INDEX ), - TMTEST.TIME_OF_DAY, - TMTEST.NULL_DELAY'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TIMER_FIRE_WHEN (inactive)", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - 0, - RTEMS_CALLING_OVERHEAD.TIMER_FIRE_WHEN - ); - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.TIMER.FIRE_WHEN( - TMTEST.TIMER_ID( INDEX ), - TMTEST.TIME_OF_DAY, - TMTEST.NULL_DELAY'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TIMER_FIRE_WHEN (active)", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - 0, - RTEMS_CALLING_OVERHEAD.TIMER_FIRE_WHEN - ); - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.TIMER.DELETE( TMTEST.TIMER_ID( INDEX ), STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TIMER_DELETE (active)", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - 0, - RTEMS_CALLING_OVERHEAD.TIMER_DELETE - ); - - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.TIMER.CREATE( INDEX, TMTEST.TIMER_ID( INDEX ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE" ); - - RTEMS.TIMER.FIRE_AFTER( - TMTEST.TIMER_ID( INDEX ), - 500, - TMTEST.NULL_DELAY'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER" ); - - RTEMS.TIMER.CANCEL( TMTEST.TIMER_ID( INDEX ), STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CANCEL" ); - - end loop; - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.TIMER.DELETE( TMTEST.TIMER_ID( INDEX ), STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TIMER_DELETE (inactive)", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - 0, - RTEMS_CALLING_OVERHEAD.TIMER_DELETE - ); - - TIMER_DRIVER.INITIALIZE; - RTEMS.TASKS.WAKE_WHEN( TMTEST.TIME_OF_DAY, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_WHEN" ); - - end HIGH_TASK; - --- --- MIDDLE_TASKS --- - - procedure MIDDLE_TASKS ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.TASKS.WAKE_WHEN( TMTEST.TIME_OF_DAY, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_WHEN" ); - - end MIDDLE_TASKS; - --- --- LOW_TASK --- - - procedure LOW_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - begin - - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TASK_WAKE_WHEN", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - 0, - RTEMS_CALLING_OVERHEAD.TASK_WAKE_WHEN - ); - - TEXT_IO.PUT_LINE( "*** END OF TIME TEST 23 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end LOW_TASK; - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm23/tmtest.ads b/c/src/ada-tests/tmtests/tm23/tmtest.ads deleted file mode 100644 index 6e567007ca..0000000000 --- a/c/src/ada-tests/tmtests/tm23/tmtest.ads +++ /dev/null @@ -1,132 +0,0 @@ --- --- TMTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 23 of the RTEMS --- Timing 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 TIME_TEST_SUPPORT; -with RTEMS; -with RTEMS.TASKS; - -package TMTEST is - --- --- This array contains the IDs of all RTEMS timers created by this test. --- - - TIMER_ID : array ( RTEMS.UNSIGNED32 - range 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.ID; - --- --- This data item contains a time of day used by all of the --- "WHEN" directives timed in this test. --- - - TIME_OF_DAY : RTEMS.TIME_OF_DAY; - --- --- The following variable is set to the execution time returned --- by the timer. --- - - END_TIME : RTEMS.UNSIGNED32; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- NULL_DELAY --- --- DESCRIPTION: --- --- This subprogram is a timer service routine. It performs --- no actions. --- - - procedure NULL_DELAY ( - IGNORED_ID : in RTEMS.ID; - IGNORED_ADDRESS : in RTEMS.ADDRESS - ); - pragma Convention (C, NULL_DELAY); - --- --- HIGH_TASK --- --- DESCRIPTION: --- --- This RTEMS task is responsible for measuring and reporting --- the following directive execution times: --- --- + TIMER_CREATE --- + TIMER_FIRE_AFTER with an inactive timer --- + TIMER_FIRE_AFTER with an active timer --- + TIMER_CANCEL of an active timer --- + TIMER_CANCEL of an inactive timer --- + TIMER_RESET of an active timer --- + TIMER_RESET of an inactive timer --- + TIMER_FIRE_WHEN of an inactive timer --- + TIMER_FIRE_WHEN of an active timer --- + TIMER_DELETE of an active timer --- + TIMER_DELETE of an inactive timer --- --- After measuring and reporting the above times, this task starts --- the timer and executes the TASK_WAKE_WHEN directive. --- - - procedure HIGH_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, HIGH_TASK); - --- --- MIDDLE_TASKS --- --- DESCRIPTION: --- --- These RTEMS tasks executes the TASK_WAKE_WHEN directive. --- - - procedure MIDDLE_TASKS ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, MIDDLE_TASKS); - --- --- LOW_TASK --- --- DESCRIPTION: --- --- This RTEMS task stops the timer and reports the execution time for --- the TASK_WAKE_WHEN directive. --- - - procedure LOW_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, LOW_TASK); - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm24/Makefile.am b/c/src/ada-tests/tmtests/tm24/Makefile.am deleted file mode 100644 index cb0fdcbb9a..0000000000 --- a/c/src/ada-tests/tmtests/tm24/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_tm24 -ada_tm24_SOURCES = tm24.adb config.h tmtest.adb tmtest.ads -ada_tm24_SOURCES += ../../support/init.c - -ada_tm24$(EXEEXT): tm24.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/tmtests/tm24/config.h b/c/src/ada-tests/tmtests/tm24/config.h deleted file mode 100644 index 85640d92a9..0000000000 --- a/c/src/ada-tests/tmtests/tm24/config.h +++ /dev/null @@ -1,31 +0,0 @@ -/* config.h - * - * This include file defines the Configuration Table for this test. - * - * COPYRIGHT (c) 1989-1997. - * 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_TMTEST - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 111 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/tmtests/tm24/tm24.adb b/c/src/ada-tests/tmtests/tm24/tm24.adb deleted file mode 100644 index a5ca5d4f7f..0000000000 --- a/c/src/ada-tests/tmtests/tm24/tm24.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test TM24 of the Timing 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 TMTEST; -with TEST_SUPPORT; - -procedure TM24 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, - TMTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end TM24; - diff --git a/c/src/ada-tests/tmtests/tm24/tmtest.adb b/c/src/ada-tests/tmtests/tm24/tmtest.adb deleted file mode 100644 index 2bcd220516..0000000000 --- a/c/src/ada-tests/tmtests/tm24/tmtest.adb +++ /dev/null @@ -1,161 +0,0 @@ --- --- TMTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 24 of the RTEMS --- Timing 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 INTERFACES; use INTERFACES; -with RTEMS_CALLING_OVERHEAD; -with TEST_SUPPORT; -with TEXT_IO; -with TIME_TEST_SUPPORT; -with TIMER_DRIVER; - -package body TMTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - ID : RTEMS.ID; - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TIME TEST 24 ***" ); - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - TIMER_DRIVER.EMPTY_FUNCTION; - end loop; - TMTEST.OVERHEAD := TIMER_DRIVER.READ_TIMER; - - RTEMS.TASKS.CREATE( - RTEMS.BUILD_NAME( 'H', 'I', 'G', 'H' ), - 10, - 1024, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE HIGH" ); - - RTEMS.TASKS.START( ID, TMTEST.HIGH_TASK'ACCESS, 0, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START HIGH" ); - - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - - RTEMS.TASKS.CREATE( - RTEMS.BUILD_NAME( 'R', 'E', 'S', 'T' ), - 128, - 1024, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); - - RTEMS.TASKS.START( ID, TMTEST.TASKS'ACCESS, 0, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); - - end loop; - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- HIGH_TASK --- - - procedure HIGH_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TASK_WAKE_AFTER (no context switch)", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - TMTEST.OVERHEAD, - RTEMS_CALLING_OVERHEAD.TASK_WAKE_AFTER - ); - - TMTEST.TASK_COUNT := 0; - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end HIGH_TASK; - --- --- TASKS --- - - procedure TASKS ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TMTEST.TASK_COUNT := TMTEST.TASK_COUNT + 1; - - if TMTEST.TASK_COUNT = 1 then - - TIMER_DRIVER.INITIALIZE; - - elsif TMTEST.TASK_COUNT = TIME_TEST_SUPPORT.OPERATION_COUNT then - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TASK_WAKE_AFTER (context switch)", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - TMTEST.OVERHEAD, - RTEMS_CALLING_OVERHEAD.TASK_WAKE_AFTER - ); - - TEXT_IO.PUT_LINE( "*** END OF TIME TEST 24 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end if; - - RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - end TASKS; - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm24/tmtest.ads b/c/src/ada-tests/tmtests/tm24/tmtest.ads deleted file mode 100644 index fb6203d5c1..0000000000 --- a/c/src/ada-tests/tmtests/tm24/tmtest.ads +++ /dev/null @@ -1,99 +0,0 @@ --- --- TMTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 24 of the RTEMS --- Timing 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; - -package TMTEST is - --- --- These arrays contain the IDs and NAMEs of all RTEMS tasks created --- by this test. --- - - TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; - TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; - --- --- This variable is used to determine which task should --- start the timer and which task should stop the timer --- and report the execution time. --- - - TASK_COUNT : RTEMS.UNSIGNED32; - --- --- This variable contains the execution time required of the --- loop used to execute the directive. --- - - OVERHEAD : RTEMS.UNSIGNED32; - --- --- The following variable is set to the execution time returned --- by the timer. --- - - END_TIME : RTEMS.UNSIGNED32; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- HIGH_TASK --- --- DESCRIPTION: --- --- This RTEMS task is responsible for measuring and reporting the --- execution time for an invocation of TASK_WAKE_AFTER which --- attempts to yield but does not result in a context switch. --- - - procedure HIGH_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, HIGH_TASK); - --- --- TASKS --- --- DESCRIPTION: --- --- These RTEMS tasks are responsible for measuring and reporting the --- execution time for an invocation of TASK_WAKE_AFTER which --- attempts to yield but does result in a context switch. --- - - procedure TASKS ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASKS); - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm25/Makefile.am b/c/src/ada-tests/tmtests/tm25/Makefile.am deleted file mode 100644 index d50089bb75..0000000000 --- a/c/src/ada-tests/tmtests/tm25/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_tm25 -ada_tm25_SOURCES = tm25.adb config.h tmtest.adb tmtest.ads -ada_tm25_SOURCES += ../../support/init.c - -ada_tm25$(EXEEXT): tm25.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/tmtests/tm25/config.h b/c/src/ada-tests/tmtests/tm25/config.h deleted file mode 100644 index 700438ceae..0000000000 --- a/c/src/ada-tests/tmtests/tm25/config.h +++ /dev/null @@ -1,32 +0,0 @@ -/* config.h - * - * This include file defines the Configuration Table for this test. - * - * COPYRIGHT (c) 1989-1997. - * 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_TMTEST - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 111 -#define CONFIGURE_MAXIMUM_SEMAPHORES 1 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/tmtests/tm25/tm25.adb b/c/src/ada-tests/tmtests/tm25/tm25.adb deleted file mode 100644 index 44bda5893f..0000000000 --- a/c/src/ada-tests/tmtests/tm25/tm25.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test TM25 of the Timing 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 TMTEST; -with TEST_SUPPORT; - -procedure TM25 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, - TMTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end TM25; - diff --git a/c/src/ada-tests/tmtests/tm25/tmtest.adb b/c/src/ada-tests/tmtests/tm25/tmtest.adb deleted file mode 100644 index 8710052bfb..0000000000 --- a/c/src/ada-tests/tmtests/tm25/tmtest.adb +++ /dev/null @@ -1,155 +0,0 @@ --- --- TMTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 25 of the RTEMS --- Timing 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_CALLING_OVERHEAD; -with TEST_SUPPORT; -with TEXT_IO; -with TIME_TEST_SUPPORT; -with TIMER_DRIVER; -with RTEMS.CLOCK; -with RTEMS.SEMAPHORE; - -package body TMTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - TASK_ID : RTEMS.ID; - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TIME TEST 25 ***" ); - - RTEMS.SEMAPHORE.CREATE( - RTEMS.BUILD_NAME( 'S', 'M', '1', ' ' ), - 0, - RTEMS.DEFAULT_ATTRIBUTES, - RTEMS.TASKS.NO_PRIORITY, - TMTEST.SEMAPHORE_ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE OF SM1" ); - - RTEMS.TASKS.CREATE( - RTEMS.BUILD_NAME( 'L', 'O', 'W', ' ' ), - 254, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - TASK_ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOW" ); - - RTEMS.TASKS.START( - TASK_ID, - TMTEST.LOW_TASK'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOW" ); - - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - - RTEMS.TASKS.CREATE( - RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ), - 128, - 1024, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - TASK_ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); - - RTEMS.TASKS.START( - TASK_ID, - TMTEST.HIGH_TASKS'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); - - end loop; - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- HIGH_TASKS --- - - procedure HIGH_TASKS ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.SEMAPHORE.OBTAIN( - TMTEST.SEMAPHORE_ID, - RTEMS.DEFAULT_OPTIONS, - RTEMS.INTERVAL'LAST, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN" ); - - end HIGH_TASKS; - --- --- LOW_TASK --- - - procedure LOW_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.CLOCK.TICK( STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "CLOCK_TICK", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - 0, - RTEMS_CALLING_OVERHEAD.CLOCK_TICK - ); - - TEXT_IO.PUT_LINE( "*** END OF TIME TEST 25 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end LOW_TASK; - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm25/tmtest.ads b/c/src/ada-tests/tmtests/tm25/tmtest.ads deleted file mode 100644 index 45a671af81..0000000000 --- a/c/src/ada-tests/tmtests/tm25/tmtest.ads +++ /dev/null @@ -1,80 +0,0 @@ --- --- TMTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 25 of the RTEMS --- Timing 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; - -package TMTEST is - --- --- The following is the ID of the semaphore used for timing operations. --- - - SEMAPHORE_ID : RTEMS.ID; - --- --- The following variable is set to the execution time returned --- by the timer. --- - - END_TIME : RTEMS.UNSIGNED32; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- HIGH_TASKS --- --- DESCRIPTION: --- --- These RTEMS tasks perform a blocking SEMAPHORE_OBTAIN which --- has an optional timeout. --- - - procedure HIGH_TASKS ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, HIGH_TASKS); - --- --- LOW_TASK --- --- DESCRIPTION: --- --- This RTEMS task is responsible for measuring and reporting --- the execution time for the CLOCK_TICK directive. --- - - procedure LOW_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, LOW_TASK); - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm28/Makefile.am b/c/src/ada-tests/tmtests/tm28/Makefile.am deleted file mode 100644 index e59b303823..0000000000 --- a/c/src/ada-tests/tmtests/tm28/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_tm28 -ada_tm28_SOURCES = tm28.adb config.h tmtest.adb tmtest.ads -ada_tm28_SOURCES += ../../support/init.c - -ada_tm28$(EXEEXT): tm28.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/tmtests/tm28/config.h b/c/src/ada-tests/tmtests/tm28/config.h deleted file mode 100644 index 2f73cd5acb..0000000000 --- a/c/src/ada-tests/tmtests/tm28/config.h +++ /dev/null @@ -1,32 +0,0 @@ -/* config.h - * - * This include file defines the Configuration Table for this test. - * - * COPYRIGHT (c) 1989-1997. - * 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_TMTEST - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 2 -#define CONFIGURE_MAXIMUM_PORTS 1 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/tmtests/tm28/tm28.adb b/c/src/ada-tests/tmtests/tm28/tm28.adb deleted file mode 100644 index 93d0f3cf02..0000000000 --- a/c/src/ada-tests/tmtests/tm28/tm28.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test TM28 of the Timing 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 TMTEST; -with TEST_SUPPORT; - -procedure TM28 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, - TMTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end TM28; - diff --git a/c/src/ada-tests/tmtests/tm28/tmtest.adb b/c/src/ada-tests/tmtests/tm28/tmtest.adb deleted file mode 100644 index 189090e39f..0000000000 --- a/c/src/ada-tests/tmtests/tm28/tmtest.adb +++ /dev/null @@ -1,171 +0,0 @@ --- --- TMTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 28 of the RTEMS --- Timing 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_CALLING_OVERHEAD; -with TEST_SUPPORT; -with TEXT_IO; -with TIMER_DRIVER; -with RTEMS.PORT; - -package body TMTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TIME TEST 28 ***" ); - - RTEMS.TASKS.CREATE( - RTEMS.BUILD_NAME( 'T', 'E', 'S', 'T' ), - 128, - 1024, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - TMTEST.TASK_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); - - RTEMS.TASKS.START( - TMTEST.TASK_ID( 1 ), - TMTEST.TEST_TASK'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- TEST_TASK --- - - procedure TEST_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - NAME : RTEMS.NAME; - OVERHEAD : RTEMS.UNSIGNED32; - CONVERTED : RTEMS.ADDRESS; - STATUS : RTEMS.STATUS_CODES; - begin - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - TIMER_DRIVER.EMPTY_FUNCTION; - end loop; - OVERHEAD := TIMER_DRIVER.READ_TIMER; - - NAME := RTEMS.BUILD_NAME( 'P', 'O', 'R', 'T' ); - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.PORT.CREATE( - NAME, - TMTEST.INTERNAL_PORT_AREA'ADDRESS, - TMTEST.EXTERNAL_PORT_AREA'ADDRESS, - 16#FF#, - TMTEST.PORT_ID( INDEX ), - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "PORT_CREATE", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - RTEMS_CALLING_OVERHEAD.PORT_CREATE - ); - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.PORT.EXTERNAL_TO_INTERNAL( - TMTEST.PORT_ID( 1 ), - TMTEST.EXTERNAL_PORT_AREA( 16#F# )'ADDRESS, - CONVERTED, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "PORT_EXTERNAL_TO_INTERNAL", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - RTEMS_CALLING_OVERHEAD.PORT_EXTERNAL_TO_INTERNAL - ); - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.PORT.INTERNAL_TO_EXTERNAL( - TMTEST.PORT_ID( 1 ), - TMTEST.INTERNAL_PORT_AREA( 16#F# )'ADDRESS, - CONVERTED, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "PORT_INTERNAL_TO_EXTERNAL", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - RTEMS_CALLING_OVERHEAD.PORT_INTERNAL_TO_EXTERNAL - ); - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - RTEMS.PORT.DELETE( TMTEST.PORT_ID( INDEX ), STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "PORT_DELETE", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - RTEMS_CALLING_OVERHEAD.PORT_DELETE - ); - - TEXT_IO.PUT_LINE( "*** END OF TIME TEST 28 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end TEST_TASK; - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm28/tmtest.ads b/c/src/ada-tests/tmtests/tm28/tmtest.ads deleted file mode 100644 index 39ceeb0ad2..0000000000 --- a/c/src/ada-tests/tmtests/tm28/tmtest.ads +++ /dev/null @@ -1,105 +0,0 @@ --- --- TMTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 28 of the RTEMS --- Timing 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 SYSTEM; -with TIME_TEST_SUPPORT; -with RTEMS; -with RTEMS.TASKS; -with System.Storage_Elements; - -package TMTEST is - --- --- This array contains the IDs of all RTEMS tasks created by this test. --- - - TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; - --- --- This array contains the IDs of all RTEMS ports created by this test. --- - - PORT_ID : array ( RTEMS.UNSIGNED32 - range 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.ID; - --- --- 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 variable is set to the execution time returned --- by the timer. --- - - END_TIME : RTEMS.UNSIGNED32; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- TEST_TASK --- --- DESCRIPTION: --- --- This RTEMS task is responsible for measuring and reporting the --- following directive execution times: --- --- + PORT_CREATE --- + PORT_EXTERNAL_TO_INTERNAL --- + PORT_INTERNAL_TO_EXTERNAL --- + PORT_DELETE --- - - procedure TEST_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TEST_TASK); - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm29/Makefile.am b/c/src/ada-tests/tmtests/tm29/Makefile.am deleted file mode 100644 index d28cd2447a..0000000000 --- a/c/src/ada-tests/tmtests/tm29/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_tm29 -ada_tm29_SOURCES = tm29.adb config.h tmtest.adb tmtest.ads -ada_tm29_SOURCES += ../../support/init.c - -ada_tm29$(EXEEXT): tm29.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/tmtests/tm29/config.h b/c/src/ada-tests/tmtests/tm29/config.h deleted file mode 100644 index e9165e59c8..0000000000 --- a/c/src/ada-tests/tmtests/tm29/config.h +++ /dev/null @@ -1,32 +0,0 @@ -/* config.h - * - * This include file defines the Configuration Table for this test. - * - * COPYRIGHT (c) 1989-1997. - * 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_TMTEST - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 111 -#define CONFIGURE_MAXIMUM_PERIODS 111 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/tmtests/tm29/tm29.adb b/c/src/ada-tests/tmtests/tm29/tm29.adb deleted file mode 100644 index 4853fbf2c7..0000000000 --- a/c/src/ada-tests/tmtests/tm29/tm29.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test TM29 of the Timing 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 TMTEST; -with TEST_SUPPORT; - -procedure TM29 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, - TMTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end TM29; - diff --git a/c/src/ada-tests/tmtests/tm29/tmtest.adb b/c/src/ada-tests/tmtests/tm29/tmtest.adb deleted file mode 100644 index 0a6a31b713..0000000000 --- a/c/src/ada-tests/tmtests/tm29/tmtest.adb +++ /dev/null @@ -1,236 +0,0 @@ --- --- TMTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Test 29 of the RTEMS --- Timing 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 INTERFACES; use INTERFACES; -with RTEMS_CALLING_OVERHEAD; -with TEST_SUPPORT; -with TEXT_IO; -with TIME_TEST_SUPPORT; -with TIMER_DRIVER; -with RTEMS.RATE_MONOTONIC; - -package body TMTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - ID : RTEMS.ID; - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TIME TEST 29 ***" ); - - TMTEST.PERIOD_NAME := RTEMS.BUILD_NAME( 'P', 'R', 'D', ' ' ); - - TIMER_DRIVER.INITIALIZE; - RTEMS.RATE_MONOTONIC.CREATE( TMTEST.PERIOD_NAME, ID, STATUS ); - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "RATE_MONOTONIC_CREATE", - TMTEST.END_TIME, - 1, - 0, - RTEMS_CALLING_OVERHEAD.RATE_MONOTONIC_CREATE - ); - - TIMER_DRIVER.INITIALIZE; - RTEMS.RATE_MONOTONIC.PERIOD( ID, 10, STATUS ); - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "RATE_MONOTONIC_PERIOD" ); - - TIME_TEST_SUPPORT.PUT_TIME( - "RATE_MONOTONIC_PERIOD (initial)", - TMTEST.END_TIME, - 1, - 0, - RTEMS_CALLING_OVERHEAD.RATE_MONOTONIC_PERIOD - ); - - TIMER_DRIVER.INITIALIZE; - RTEMS.RATE_MONOTONIC.PERIOD( ID, RTEMS.RATE_MONOTONIC_PERIOD_STATUS, STATUS ); - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "RATE_MONOTONIC_PERIOD" ); - - TIME_TEST_SUPPORT.PUT_TIME( - "RATE_MONOTONIC_PERIOD (STATUS)", - TMTEST.END_TIME, - 1, - 0, - RTEMS_CALLING_OVERHEAD.RATE_MONOTONIC_PERIOD - ); - - TIMER_DRIVER.INITIALIZE; - RTEMS.RATE_MONOTONIC.CANCEL( ID, STATUS ); - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "RATE_MONOTONIC_CANCEL" ); - - TIME_TEST_SUPPORT.PUT_TIME( - "RATE_MONOTONIC_CANCEL", - TMTEST.END_TIME, - 1, - 0, - RTEMS_CALLING_OVERHEAD.RATE_MONOTONIC_CANCEL - ); - - TIMER_DRIVER.INITIALIZE; - RTEMS.RATE_MONOTONIC.DELETE( ID, STATUS ); - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "RATE_MONOTONIC_DELETE (cancelled)", - TMTEST.END_TIME, - 1, - 0, - RTEMS_CALLING_OVERHEAD.RATE_MONOTONIC_DELETE - ); - - RTEMS.RATE_MONOTONIC.CREATE( TMTEST.PERIOD_NAME, ID, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "RATE_MONOTONIC_CREATE" ); - - RTEMS.RATE_MONOTONIC.PERIOD( ID, 10, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "RATE_MONOTONIC_PERIOD" ); - - TIMER_DRIVER.INITIALIZE; - RTEMS.RATE_MONOTONIC.DELETE( ID, STATUS ); - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "RATE_MONOTONIC_DELETE (active)", - TMTEST.END_TIME, - 1, - 0, - RTEMS_CALLING_OVERHEAD.RATE_MONOTONIC_DELETE - ); - - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - - RTEMS.TASKS.CREATE( - RTEMS.BUILD_NAME( 'T', 'E', 'S', 'T' ), - 128, - 1024, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); - - RTEMS.TASKS.START( ID, TMTEST.TASKS'ACCESS, 0, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); - - end loop; - - RTEMS.TASKS.CREATE( - RTEMS.BUILD_NAME( 'L', 'O', 'W', ' ' ), - 200, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - ID, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); - - RTEMS.TASKS.START( ID, TMTEST.LOW_TASK'ACCESS, 0, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); - - TMTEST.TASK_COUNT := 0; - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - --- --- TASKS --- - - procedure TASKS ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - ID : RTEMS.NAME; - STATUS : RTEMS.STATUS_CODES; - begin - - RTEMS.RATE_MONOTONIC.CREATE( TMTEST.PERIOD_NAME, ID, STATUS ); - RTEMS.RATE_MONOTONIC.PERIOD( ID, 10, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "RATE_MONOTONIC_PERIOD" ); - - -- Give up the processor to allow all tasks to actually - -- create and start their period timer before the benchmark - -- timer driver is initialized. - - RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); - - TMTEST.TASK_COUNT := TMTEST.TASK_COUNT + 1; - - if TMTEST.TASK_COUNT = 1 then - TIMER_DRIVER.INITIALIZE; - end if; - - RTEMS.RATE_MONOTONIC.PERIOD( ID, 100, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "RATE_MONOTONIC_PERIOD" ); - - end TASKS; - --- --- LOW_TASK --- - - procedure LOW_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - OVERHEAD : RTEMS.UNSIGNED32; - begin - - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - TIMER_DRIVER.EMPTY_FUNCTION; - end loop; - OVERHEAD := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "RATE_MONOTONIC_PERIOD (blocking)", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - RTEMS_CALLING_OVERHEAD.RATE_MONOTONIC_PERIOD - ); - - TEXT_IO.PUT_LINE( "*** END OF TIME TEST 29 ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end LOW_TASK; - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tm29/tmtest.ads b/c/src/ada-tests/tmtests/tm29/tmtest.ads deleted file mode 100644 index 8661fc28b6..0000000000 --- a/c/src/ada-tests/tmtests/tm29/tmtest.ads +++ /dev/null @@ -1,96 +0,0 @@ --- --- TMTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Test 29 of the RTEMS --- Timing 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; - -package TMTEST is - --- --- The following is the name used for all periods created by this test. --- - - PERIOD_NAME : RTEMS.NAME; - --- --- The following is used to allow all tasks to create and start --- their period timers before the timer is started for timing --- the blocking case of RATE_MONOTONIC_PERIOD. --- - - TASK_COUNT : RTEMS.UNSIGNED32; - --- --- The following variable is set to the execution time returned --- by the timer. --- - - END_TIME : RTEMS.UNSIGNED32; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. It also measures and --- reports the following directive execution times: --- --- + RATE_MONOTONIC_CREATE --- + RATE_MONOTONIC_PERIOD the initial time --- + RATE_MONOTONIC_PERIOD for a period's status --- + RATE_MONOTONIC_CANCEL --- + RATE_MONOTONIC_DELETE of a cancelled period --- + RATE_MONOTONIC_DELETE of an active period --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- TASKS --- --- DESCRIPTION: --- --- The first of these RTEMS tasks starts the timer. All of these --- tasks execute a blocking RATE_MONOTONIC_PERIOD. --- - - procedure TASKS ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASKS); - --- --- LOW_TASK --- --- DESCRIPTION: --- --- This RTEMS task stops the timer and reports the execution --- time for a blocking RATE_MONOTONIC_PERIOD. --- - - procedure LOW_TASK ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, LOW_TASK); - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tmck/Makefile.am b/c/src/ada-tests/tmtests/tmck/Makefile.am deleted file mode 100644 index 7bbe2d7765..0000000000 --- a/c/src/ada-tests/tmtests/tmck/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_tmck -ada_tmck_SOURCES = tmck.adb config.h tmtest.adb tmtest.ads -ada_tmck_SOURCES += ../../support/init.c - -ada_tmck$(EXEEXT): tmck.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/tmtests/tmck/config.h b/c/src/ada-tests/tmtests/tmck/config.h deleted file mode 100644 index 7730385b3c..0000000000 --- a/c/src/ada-tests/tmtests/tmck/config.h +++ /dev/null @@ -1,32 +0,0 @@ -/* config.h - * - * This include file defines the Configuration Table for this test. - * - * COPYRIGHT (c) 1989-1997. - * 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_TMTEST - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 2 -#define CONFIGURE_MAXIMUM_SEMAPHORES 1 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/tmtests/tmck/tmck.adb b/c/src/ada-tests/tmtests/tmck/tmck.adb deleted file mode 100644 index c35d786517..0000000000 --- a/c/src/ada-tests/tmtests/tmck/tmck.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test TMCK of the Timing 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 TMTEST; -with TEST_SUPPORT; - -procedure TMCK 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, - TMTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end TMCK; - diff --git a/c/src/ada-tests/tmtests/tmck/tmtest.adb b/c/src/ada-tests/tmtests/tmck/tmtest.adb deleted file mode 100644 index 8da1ff220a..0000000000 --- a/c/src/ada-tests/tmtests/tmck/tmtest.adb +++ /dev/null @@ -1,214 +0,0 @@ --- --- TMTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Timer Check Test of the RTEMS --- Timing 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 TIMER_DRIVER; -with INTERFACES; use INTERFACES; -with TEST_SUPPORT; -with TEXT_IO; -with TIME_TEST_SUPPORT; -with UNSIGNED32_IO; - -package body TMTEST is - --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TIME TEST CHECK ***" ); - - TIMER_DRIVER.SET_FIND_AVERAGE_OVERHEAD( TRUE ); - - TMTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); - - RTEMS.TASKS.CREATE( - TMTEST.TASK_NAME( 1 ), - 1, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - TMTEST.TASK_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" ); - - RTEMS.TASKS.START( - TMTEST.TASK_ID( 1 ), - TMTEST.TASK_1'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); - - 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); - begin - - TMTEST.CHECK_READ_TIMER; - -TEST_SUPPORT.PAUSE; - - TIMER_DRIVER.INITIALIZE; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - TIME_TEST_SUPPORT.PUT_TIME( - "NULL timer stopped at", - TMTEST.END_TIME, - 1, - 0, - 0 - ); - - TIMER_DRIVER.INITIALIZE; - for INDEX in 0 .. 1000 - loop - TIMER_DRIVER.EMPTY_FUNCTION; - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - TIME_TEST_SUPPORT.PUT_TIME( - "LOOP (1000) timer stopped at", - TMTEST.END_TIME, - 1, - 0, - 0 - ); - - TIMER_DRIVER.INITIALIZE; - for INDEX in 0 .. 10000 - loop - TIMER_DRIVER.EMPTY_FUNCTION; - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - TIME_TEST_SUPPORT.PUT_TIME( - "LOOP (10000) timer stopped at", - TMTEST.END_TIME, - 1, - 0, - 0 - ); - - TIMER_DRIVER.INITIALIZE; - for INDEX in 0 .. 50000 - loop - TIMER_DRIVER.EMPTY_FUNCTION; - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - TIME_TEST_SUPPORT.PUT_TIME( - "LOOP (50000) timer stopped at", - TMTEST.END_TIME, - 1, - 0, - 0 - ); - - TIMER_DRIVER.INITIALIZE; - for INDEX in 0 .. 100000 - loop - TIMER_DRIVER.EMPTY_FUNCTION; - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - TIME_TEST_SUPPORT.PUT_TIME( - "LOOP (100000) timer stopped at", - TMTEST.END_TIME, - 1, - 0, - 0 - ); - - TEXT_IO.PUT_LINE( "*** END OF TIME TEST CHECK ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end TASK_1; - --- --- CHECK_READ_TIMER --- - - procedure CHECK_READ_TIMER - is - TIME : RTEMS.UNSIGNED32; - begin - - for INDEX in TMTEST.DISTRIBUTION'FIRST .. TMTEST.DISTRIBUTION'LAST - loop - TMTEST.DISTRIBUTION( INDEX ) := 0; - end loop; - - for INDEX in 1 .. TMTEST.OPERATION_COUNT - loop - - loop - TIMER_DRIVER.INITIALIZE; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - exit when - TMTEST.END_TIME <= RTEMS.UNSIGNED32( TMTEST.DISTRIBUTION'LAST ); - - TEXT_IO.PUT( "TOO LONG (" ); - UNSIGNED32_IO.PUT( TMTEST.END_TIME ); - TEXT_IO.PUT_LINE( ")!!!" ); - end loop; - - TMTEST.DISTRIBUTION( TMTEST.END_TIME ) := - TMTEST.DISTRIBUTION( TMTEST.END_TIME ) + 1; - - end loop; - - TEXT_IO.PUT_LINE( - "Units may not be in microseconds for this test!!!" - ); - - TIME := 0; - - for INDEX in TMTEST.DISTRIBUTION'FIRST .. TMTEST.DISTRIBUTION'LAST - loop - if TMTEST.DISTRIBUTION( INDEX ) /= 0 then - TIME := TIME + (TMTEST.DISTRIBUTION( INDEX ) * INDEX); - UNSIGNED32_IO.PUT( INDEX ); - TEXT_IO.PUT( " " ); - UNSIGNED32_IO.PUT( TMTEST.DISTRIBUTION( INDEX ) ); - TEXT_IO.NEW_LINE; - end if; - end loop; - - TEXT_IO.PUT( "Total time = " ); - UNSIGNED32_IO.PUT( TIME ); - TEXT_IO.NEW_LINE; - - end CHECK_READ_TIMER; - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tmck/tmtest.ads b/c/src/ada-tests/tmtests/tmck/tmtest.ads deleted file mode 100644 index 6eef577910..0000000000 --- a/c/src/ada-tests/tmtests/tmck/tmtest.ads +++ /dev/null @@ -1,96 +0,0 @@ --- --- TMTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Timer Check Test of the RTEMS --- Timing 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; - -package TMTEST is - --- --- These arrays contain the IDs and NAMEs of all RTEMS tasks created --- by this test. --- - - TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; - TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; - --- --- The following variable is set to the execution time returned --- by the timer. --- - - END_TIME : RTEMS.UNSIGNED32; - --- --- The following defines the number of iterations of each timed --- operation to perform. --- - - OPERATION_COUNT : constant RTEMS.UNSIGNED32 := 100000; - --- --- The following array is used to determine how many times --- each time between 0 and 1000 microseconds was returned --- when simply starting and stopping the timer. - - DISTRIBUTION : array ( RTEMS.UNSIGNED32 range 0 .. 10000 ) of RTEMS.UNSIGNED32; - --- --- 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 invokes CHECK_READ_TIMER before demonstrating --- that increasing the order of magnitude of the number of loop --- iterations performed has a corresponding impact on the time --- reported by the timer driver. --- - - procedure TASK_1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_1); - --- --- CHECK_READ_TIMER --- --- DESCRIPTION: --- --- This subprogram is used to determine the overhead associated --- with starting and stopping the timer. It is also useful --- for determining if unexpected times will be reported. --- - - procedure CHECK_READ_TIMER; - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tmoverhd/Makefile.am b/c/src/ada-tests/tmtests/tmoverhd/Makefile.am deleted file mode 100644 index 316117f789..0000000000 --- a/c/src/ada-tests/tmtests/tmoverhd/Makefile.am +++ /dev/null @@ -1,14 +0,0 @@ -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../testsuites/automake/compile.am - -include $(top_srcdir)/ada.am - -noinst_PROGRAMS = ada_tmoverhd -ada_tmoverhd_SOURCES = tmoverhd.adb config.h tmtest.adb tmtest.ads \ - dummy_rtems.adb dummy_rtems.ads -ada_tmoverhd_SOURCES += ../../support/init.c - -ada_tmoverhd$(EXEEXT): tmoverhd.adb init.$(OBJEXT) - $(GNATCOMPILE) -margs -a $< -o $@ - -include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/tmtests/tmoverhd/README b/c/src/ada-tests/tmtests/tmoverhd/README deleted file mode 100644 index 4e66647830..0000000000 --- a/c/src/ada-tests/tmtests/tmoverhd/README +++ /dev/null @@ -1,5 +0,0 @@ -This test is of marginal usefulness in testing the bindings. It -shows how much overhead is required to call the Ada binding -routine but does not give any indication of how much overhead the -binding itself adds. This information can be inferred by subtracting -the C times from Ada times on the same target processor. diff --git a/c/src/ada-tests/tmtests/tmoverhd/config.h b/c/src/ada-tests/tmtests/tmoverhd/config.h deleted file mode 100644 index 7730385b3c..0000000000 --- a/c/src/ada-tests/tmtests/tmoverhd/config.h +++ /dev/null @@ -1,32 +0,0 @@ -/* config.h - * - * This include file defines the Configuration Table for this test. - * - * COPYRIGHT (c) 1989-1997. - * 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_TMTEST - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 2 -#define CONFIGURE_MAXIMUM_SEMAPHORES 1 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 - -#include - -/* end of include file */ diff --git a/c/src/ada-tests/tmtests/tmoverhd/dummy_rtems.adb b/c/src/ada-tests/tmtests/tmoverhd/dummy_rtems.adb deleted file mode 100644 index 62986dc465..0000000000 --- a/c/src/ada-tests/tmtests/tmoverhd/dummy_rtems.adb +++ /dev/null @@ -1,891 +0,0 @@ --- --- DUMMY_RTEMS / SPECIFICATION --- --- DESCRIPTION: --- --- This package contains implementation of stub routines --- which are used to time the invocation overhead incurred --- with an Ada application program invokes each RTEMS directive. --- --- DEPENDENCIES: --- --- --- --- COPYRIGHT (c) 1989-2009. --- 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. --- - -package body DUMMY_RTEMS is - --- Task Manager - - procedure TASK_CREATE ( - NAME : in RTEMS.NAME; - INITIAL_PRIORITY : in RTEMS.TASKS.PRIORITY; - STACK_SIZE : in RTEMS.UNSIGNED32; - INITIAL_MODES : in RTEMS.MODE; - ATTRIBUTE_SET : in RTEMS.ATTRIBUTE; - ID : out RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(NAME); - pragma Unreferenced(INITIAL_PRIORITY); - pragma Unreferenced(STACK_SIZE); - pragma Unreferenced(INITIAL_MODES); - pragma Unreferenced(ATTRIBUTE_SET); - begin - - ID := 0; - RESULT := RTEMS.SUCCESSFUL; - - end TASK_CREATE; - - procedure TASK_IDENT ( - NAME : in RTEMS.NAME; - NODE : in RTEMS.UNSIGNED32; - ID : out RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(NAME); - pragma Unreferenced(NODE); - begin - - ID := 0; - RESULT := RTEMS.SUCCESSFUL; - - end TASK_IDENT; - - procedure TASK_START ( - ID : in RTEMS.ID; - ENTRY_POINT : in RTEMS.TASKS.ENTRY_POINT; - ARGUMENT : in RTEMS.UNSIGNED32; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(ID); - pragma Unreferenced(ENTRY_POINT); - pragma Unreferenced(ARGUMENT); - begin - - RESULT := RTEMS.SUCCESSFUL; - - end TASK_START; - - procedure TASK_RESTART ( - ID : in RTEMS.ID; - ARGUMENT : in RTEMS.UNSIGNED32; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(ID); - pragma Unreferenced(ARGUMENT); - begin - - RESULT := RTEMS.SUCCESSFUL; - - end TASK_RESTART; - - procedure TASK_DELETE ( - ID : in RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(ID); - begin - - RESULT := RTEMS.SUCCESSFUL; - - end TASK_DELETE; - - procedure TASK_SUSPEND ( - ID : in RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(ID); - begin - - RESULT := RTEMS.SUCCESSFUL; - - end TASK_SUSPEND; - - procedure TASK_RESUME ( - ID : in RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(ID); - begin - - RESULT := RTEMS.SUCCESSFUL; - - end TASK_RESUME; - - procedure TASK_SET_PRIORITY ( - ID : in RTEMS.ID; - NEW_PRIORITY : in RTEMS.TASKS.PRIORITY; - OLD_PRIORITY : out RTEMS.TASKS.PRIORITY; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(ID); - pragma Unreferenced(NEW_PRIORITY); - begin - - OLD_PRIORITY := 0; - RESULT := RTEMS.SUCCESSFUL; - - end TASK_SET_PRIORITY; - - procedure TASK_MODE ( - MODE_SET : in RTEMS.MODE; - MASK : in RTEMS.MODE; - PREVIOUS_MODE_SET : out RTEMS.MODE; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(MODE_SET); - pragma Unreferenced(MASK); - begin - - PREVIOUS_MODE_SET := 0; - RESULT := RTEMS.SUCCESSFUL; - - end TASK_MODE; - - procedure TASK_WAKE_WHEN ( - TIME_BUFFER : in RTEMS.TIME_OF_DAY; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(TIME_BUFFER); - begin - - RESULT := RTEMS.SUCCESSFUL; - - end TASK_WAKE_WHEN; - - procedure TASK_WAKE_AFTER ( - TICKS : in RTEMS.INTERVAL; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(TICKS); - begin - - RESULT := RTEMS.SUCCESSFUL; - - end TASK_WAKE_AFTER; - --- Interrupt Manager - --- procedure INTERRUPT_CATCH ( --- NEW_ISR_HANDLER : in RTEMS.ADDRESS; --- VECTOR : in RTEMS.VECTOR_NUMBER; --- OLD_ISR_HANDLER : out RTEMS.ADDRESS; --- RESULT : out RTEMS.STATUS_CODES --- ) is --- begin --- --- OLD_ISR_HANDLER := RTEMS.Null_Address; --- RESULT := RTEMS.SUCCESSFUL; --- --- end INTERRUPT_CATCH; - --- Clock Manager - - procedure CLOCK_GET_TOD ( - TIME_BUFFER : out RTEMS.TIME_OF_DAY; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(TIME_BUFFER); - begin - - RESULT := RTEMS.SUCCESSFUL; - - end CLOCK_GET_TOD; - - procedure CLOCK_SET ( - TIME_BUFFER : in RTEMS.TIME_OF_DAY; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(TIME_BUFFER); - begin - - RESULT := RTEMS.SUCCESSFUL; - - end CLOCK_SET; - - procedure CLOCK_TICK ( - RESULT : out RTEMS.STATUS_CODES - ) is - begin - - RESULT := RTEMS.SUCCESSFUL; - - end CLOCK_TICK; - --- Timer Manager - - procedure TIMER_CREATE ( - NAME : in RTEMS.NAME; - ID : out RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(NAME); - begin - - ID := 0; - RESULT := RTEMS.SUCCESSFUL; - - end TIMER_CREATE; - - procedure TIMER_DELETE ( - ID : in RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(ID); - begin - - RESULT := RTEMS.SUCCESSFUL; - - end TIMER_DELETE; - - procedure TIMER_IDENT ( - NAME : in RTEMS.NAME; - ID : out RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(NAME); - begin - - ID := 0; - RESULT := RTEMS.SUCCESSFUL; - - end TIMER_IDENT; - - procedure TIMER_FIRE_AFTER ( - ID : in RTEMS.ID; - TICKS : in RTEMS.INTERVAL; - ROUTINE : in RTEMS.TIMER.SERVICE_ROUTINE; - USER_DATA : in RTEMS.ADDRESS; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(ID); - pragma Unreferenced(TICKS); - pragma Unreferenced(ROUTINE); - pragma Unreferenced(USER_DATA); - begin - - RESULT := RTEMS.SUCCESSFUL; - - end TIMER_FIRE_AFTER; - - procedure TIMER_FIRE_WHEN ( - ID : in RTEMS.ID; - WALL_TIME : in RTEMS.TIME_OF_DAY; - ROUTINE : in RTEMS.TIMER.SERVICE_ROUTINE; - USER_DATA : in RTEMS.ADDRESS; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(ID); - pragma Unreferenced(WALL_TIME); - pragma Unreferenced(ROUTINE); - pragma Unreferenced(USER_DATA); - begin - - RESULT := RTEMS.SUCCESSFUL; - - end TIMER_FIRE_WHEN; - - procedure TIMER_RESET ( - ID : in RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(ID); - begin - - RESULT := RTEMS.SUCCESSFUL; - - end TIMER_RESET; - - procedure TIMER_CANCEL ( - ID : in RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(ID); - begin - - RESULT := RTEMS.SUCCESSFUL; - - end TIMER_CANCEL; - --- Semaphore Manager - - procedure SEMAPHORE_CREATE ( - NAME : in RTEMS.NAME; - COUNT : in RTEMS.UNSIGNED32; - ATTRIBUTE_SET : in RTEMS.ATTRIBUTE; - PRIORITY_CEILING : in RTEMS.TASKS.PRIORITY; - ID : out RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(NAME); - pragma Unreferenced(COUNT); - pragma Unreferenced(ATTRIBUTE_SET); - pragma Unreferenced(PRIORITY_CEILING); - begin - - ID := 0; - RESULT := RTEMS.SUCCESSFUL; - - end SEMAPHORE_CREATE; - - procedure SEMAPHORE_DELETE ( - ID : in RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(ID); - begin - - RESULT := RTEMS.SUCCESSFUL; - - end SEMAPHORE_DELETE; - - procedure SEMAPHORE_IDENT ( - NAME : in RTEMS.NAME; - NODE : in RTEMS.UNSIGNED32; - ID : out RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(NAME); - pragma Unreferenced(NODE); - begin - - ID := 0; - RESULT := RTEMS.SUCCESSFUL; - - end SEMAPHORE_IDENT; - - procedure SEMAPHORE_OBTAIN ( - ID : in RTEMS.ID; - OPTION_SET : in RTEMS.OPTION; - TIMEOUT : in RTEMS.INTERVAL; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(ID); - pragma Unreferenced(OPTION_SET); - pragma Unreferenced(TIMEOUT); - begin - - RESULT := RTEMS.SUCCESSFUL; - - end SEMAPHORE_OBTAIN; - - procedure SEMAPHORE_RELEASE ( - ID : in RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(ID); - begin - - RESULT := RTEMS.SUCCESSFUL; - - end SEMAPHORE_RELEASE; - --- Message Queue Manager - - procedure MESSAGE_QUEUE_CREATE ( - Name : in RTEMS.Name; - Count : in RTEMS.Unsigned32; - Max_Message_Size : in RTEMS.Unsigned32; - Attribute_Set : in RTEMS.Attribute; - ID : out RTEMS.ID; - Result : out RTEMS.Status_Codes - ) is - pragma Unreferenced(Name); - pragma Unreferenced(Count); - pragma Unreferenced(Max_Message_Size); - pragma Unreferenced(Attribute_Set); - begin - - ID := 0; - RESULT := RTEMS.SUCCESSFUL; - - end MESSAGE_QUEUE_CREATE; - - procedure MESSAGE_QUEUE_IDENT ( - NAME : in RTEMS.NAME; - NODE : in RTEMS.UNSIGNED32; - ID : out RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(NAME); - pragma Unreferenced(NODE); - begin - - ID := 0; - RESULT := RTEMS.SUCCESSFUL; - - end MESSAGE_QUEUE_IDENT; - - procedure MESSAGE_QUEUE_DELETE ( - ID : in RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(ID); - begin - - RESULT := RTEMS.SUCCESSFUL; - - end MESSAGE_QUEUE_DELETE; - - procedure MESSAGE_QUEUE_SEND ( - ID : in RTEMS.ID; - BUFFER : in RTEMS.ADDRESS; - Size : in RTEMS.Unsigned32; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(ID); - pragma Unreferenced(BUFFER); - pragma Unreferenced(Size); - begin - - RESULT := RTEMS.SUCCESSFUL; - - end MESSAGE_QUEUE_SEND; - - procedure MESSAGE_QUEUE_URGENT ( - ID : in RTEMS.ID; - BUFFER : in RTEMS.ADDRESS; - Size : in RTEMS.Unsigned32; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(ID); - pragma Unreferenced(BUFFER); - pragma Unreferenced(Size); - begin - - RESULT := RTEMS.SUCCESSFUL; - - end MESSAGE_QUEUE_URGENT; - - procedure MESSAGE_QUEUE_BROADCAST ( - ID : in RTEMS.ID; - BUFFER : in RTEMS.ADDRESS; - Size : in RTEMS.Unsigned32; - COUNT : out RTEMS.UNSIGNED32; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(ID); - pragma Unreferenced(BUFFER); - pragma Unreferenced(Size); - begin - - COUNT := 0; - RESULT := RTEMS.SUCCESSFUL; - - end MESSAGE_QUEUE_BROADCAST; - - procedure MESSAGE_QUEUE_RECEIVE ( - ID : in RTEMS.ID; - BUFFER : in RTEMS.ADDRESS; - OPTION_SET : in RTEMS.OPTION; - TIMEOUT : in RTEMS.INTERVAL; - Size : out RTEMS.Unsigned32; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(ID); - pragma Unreferenced(BUFFER); - pragma Unreferenced(OPTION_SET); - pragma Unreferenced(TIMEOUT); - begin - - Size := 0; - RESULT := RTEMS.SUCCESSFUL; - - end MESSAGE_QUEUE_RECEIVE; - - procedure MESSAGE_QUEUE_FLUSH ( - ID : in RTEMS.ID; - COUNT : out RTEMS.UNSIGNED32; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(ID); - begin - - COUNT := 0; - RESULT := RTEMS.SUCCESSFUL; - - end MESSAGE_QUEUE_FLUSH; - --- Event Manager - - procedure EVENT_SEND ( - ID : in RTEMS.ID; - EVENT_IN : in RTEMS.EVENT_SET; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(ID); - pragma Unreferenced(EVENT_IN); - begin - - RESULT := RTEMS.SUCCESSFUL; - - end EVENT_SEND; - - procedure EVENT_RECEIVE ( - EVENT_IN : in RTEMS.EVENT_SET; - OPTION_SET : in RTEMS.OPTION; - TICKS : in RTEMS.INTERVAL; - EVENT_OUT : out RTEMS.EVENT_SET; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(EVENT_IN); - pragma Unreferenced(OPTION_SET); - pragma Unreferenced(TICKS); - begin - - EVENT_OUT := 0; - RESULT := RTEMS.SUCCESSFUL; - - end EVENT_RECEIVE; - --- Signal Manager - - procedure SIGNAL_CATCH ( - ASR_HANDLER : in RTEMS.ASR_HANDLER; - MODE_SET : in RTEMS.MODE; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(ASR_HANDLER); - pragma Unreferenced(MODE_SET); - begin - - RESULT := RTEMS.SUCCESSFUL; - - end SIGNAL_CATCH; - - procedure SIGNAL_SEND ( - ID : in RTEMS.ID; - SIGNAL_SET : in RTEMS.SIGNAL_SET; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(ID); - pragma Unreferenced(SIGNAL_SET); - begin - - RESULT := RTEMS.SUCCESSFUL; - - end SIGNAL_SEND; - --- Partition Manager - - procedure PARTITION_CREATE ( - NAME : in RTEMS.NAME; - STARTING_ADDRESS : in RTEMS.ADDRESS; - LENGTH : in RTEMS.UNSIGNED32; - BUFFER_SIZE : in RTEMS.UNSIGNED32; - ATTRIBUTE_SET : in RTEMS.ATTRIBUTE; - ID : out RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(NAME); - pragma Unreferenced(STARTING_ADDRESS); - pragma Unreferenced(LENGTH); - pragma Unreferenced(BUFFER_SIZE); - pragma Unreferenced(ATTRIBUTE_SET); - begin - - ID := 0; - RESULT := RTEMS.SUCCESSFUL; - - end PARTITION_CREATE; - - procedure PARTITION_IDENT ( - NAME : in RTEMS.NAME; - NODE : in RTEMS.UNSIGNED32; - ID : out RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(NAME); - pragma Unreferenced(NODE); - begin - - ID := 0; - RESULT := RTEMS.SUCCESSFUL; - - end PARTITION_IDENT; - - procedure PARTITION_DELETE ( - ID : in RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(ID); - begin - - RESULT := RTEMS.SUCCESSFUL; - - end PARTITION_DELETE; - - procedure PARTITION_GET_BUFFER ( - ID : in RTEMS.ID; - BUFFER : out RTEMS.ADDRESS; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(ID); - begin - - BUFFER := RTEMS.Null_Address; - RESULT := RTEMS.SUCCESSFUL; - - end PARTITION_GET_BUFFER; - - procedure PARTITION_RETURN_BUFFER ( - ID : in RTEMS.ID; - BUFFER : in RTEMS.ADDRESS; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(ID); - pragma Unreferenced(BUFFER); - begin - - RESULT := RTEMS.SUCCESSFUL; - - end PARTITION_RETURN_BUFFER; - --- Region Manager - - procedure REGION_CREATE ( - NAME : in RTEMS.NAME; - STARTING_ADDRESS : in RTEMS.ADDRESS; - LENGTH : in RTEMS.UNSIGNED32; - PAGE_SIZE : in RTEMS.UNSIGNED32; - ATTRIBUTE_SET : in RTEMS.ATTRIBUTE; - ID : out RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(NAME); - pragma Unreferenced(STARTING_ADDRESS); - pragma Unreferenced(LENGTH); - pragma Unreferenced(PAGE_SIZE); - pragma Unreferenced(ATTRIBUTE_SET); - begin - - ID := 0; - RESULT := RTEMS.SUCCESSFUL; - - end REGION_CREATE; - - procedure REGION_IDENT ( - NAME : in RTEMS.NAME; - ID : out RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(NAME); - begin - - ID := 0; - RESULT := RTEMS.SUCCESSFUL; - - end REGION_IDENT; - - procedure REGION_DELETE ( - ID : in RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(ID); - begin - - RESULT := RTEMS.SUCCESSFUL; - - end REGION_DELETE; - - procedure REGION_GET_SEGMENT ( - ID : in RTEMS.ID; - SIZE : in RTEMS.UNSIGNED32; - OPTION_SET : in RTEMS.OPTION; - TIMEOUT : in RTEMS.INTERVAL; - SEGMENT : out RTEMS.ADDRESS; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(ID); - pragma Unreferenced(SIZE); - pragma Unreferenced(OPTION_SET); - pragma Unreferenced(TIMEOUT); - begin - - SEGMENT := RTEMS.Null_Address; - RESULT := RTEMS.SUCCESSFUL; - - end REGION_GET_SEGMENT; - - procedure REGION_RETURN_SEGMENT ( - ID : in RTEMS.ID; - SEGMENT : in RTEMS.ADDRESS; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(ID); - pragma Unreferenced(SEGMENT); - begin - - RESULT := RTEMS.SUCCESSFUL; - - end REGION_RETURN_SEGMENT; - --- Dual Ported Memory Manager - - procedure PORT_CREATE ( - NAME : in RTEMS.NAME; - INTERNAL_START : in RTEMS.ADDRESS; - EXTERNAL_START : in RTEMS.ADDRESS; - LENGTH : in RTEMS.UNSIGNED32; - ID : out RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(NAME); - pragma Unreferenced(INTERNAL_START); - pragma Unreferenced(EXTERNAL_START); - pragma Unreferenced(LENGTH); - begin - - ID := 0; - RESULT := RTEMS.SUCCESSFUL; - - end PORT_CREATE; - - procedure PORT_IDENT ( - NAME : in RTEMS.NAME; - ID : out RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(NAME); - begin - - ID := 0; - RESULT := RTEMS.SUCCESSFUL; - - end PORT_IDENT; - - procedure PORT_DELETE ( - ID : in RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(ID); - begin - - RESULT := RTEMS.SUCCESSFUL; - - end PORT_DELETE; - - procedure PORT_EXTERNAL_TO_INTERNAL ( - ID : in RTEMS.ID; - EXTERNAL : in RTEMS.ADDRESS; - INTERNAL : out RTEMS.ADDRESS; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(ID); - pragma Unreferenced(EXTERNAL); - begin - - INTERNAL := RTEMS.Null_Address; - RESULT := RTEMS.SUCCESSFUL; - - end PORT_EXTERNAL_TO_INTERNAL; - - procedure PORT_INTERNAL_TO_EXTERNAL ( - ID : in RTEMS.ID; - INTERNAL : in RTEMS.ADDRESS; - EXTERNAL : out RTEMS.ADDRESS; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(ID); - pragma Unreferenced(INTERNAL); - begin - - EXTERNAL := RTEMS.Null_Address; - RESULT := RTEMS.SUCCESSFUL; - - end PORT_INTERNAL_TO_EXTERNAL; - --- Fatal Error Manager - - procedure FATAL_ERROR_OCCURRED ( - THE_ERROR : in RTEMS.UNSIGNED32 - ) is - pragma Unreferenced(THE_ERROR); - begin - - NULL; - - end FATAL_ERROR_OCCURRED; - --- Rate Monotonic Manager - - procedure RATE_MONOTONIC_CREATE ( - NAME : in RTEMS.NAME; - ID : out RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(NAME); - begin - - ID := 0; - RESULT := RTEMS.SUCCESSFUL; - - end RATE_MONOTONIC_CREATE; - - procedure RATE_MONOTONIC_IDENT ( - NAME : in RTEMS.NAME; - ID : out RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(NAME); - begin - - ID := 0; - RESULT := RTEMS.SUCCESSFUL; - - end RATE_MONOTONIC_IDENT; - - procedure RATE_MONOTONIC_DELETE ( - ID : in RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(ID); - begin - - RESULT := RTEMS.SUCCESSFUL; - - end RATE_MONOTONIC_DELETE; - - procedure RATE_MONOTONIC_CANCEL ( - ID : in RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(ID); - begin - - RESULT := RTEMS.SUCCESSFUL; - - end RATE_MONOTONIC_CANCEL; - - procedure RATE_MONOTONIC_PERIOD ( - ID : in RTEMS.ID; - LENGTH : in RTEMS.INTERVAL; - RESULT : out RTEMS.STATUS_CODES - ) is - pragma Unreferenced(ID); - pragma Unreferenced(LENGTH); - begin - - RESULT := RTEMS.SUCCESSFUL; - - end RATE_MONOTONIC_PERIOD; - --- Multiprocessing Manager - - procedure MULTIPROCESSING_ANNOUNCE - is - begin - - NULL; - - end MULTIPROCESSING_ANNOUNCE; - -end DUMMY_RTEMS; diff --git a/c/src/ada-tests/tmtests/tmoverhd/dummy_rtems.ads b/c/src/ada-tests/tmtests/tmoverhd/dummy_rtems.ads deleted file mode 100644 index ea4f129893..0000000000 --- a/c/src/ada-tests/tmtests/tmoverhd/dummy_rtems.ads +++ /dev/null @@ -1,445 +0,0 @@ --- --- DUMMY_RTEMS / SPECIFICATION --- --- DESCRIPTION: --- --- This package contains specifications for stub routines --- which are used to time the invocation overhead incurred --- with an Ada application program invokes each RTEMS directive. --- --- DEPENDENCIES: --- --- --- --- 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. --- - -with RTEMS; -with RTEMS.CLOCK; -with RTEMS.TASKS; -with RTEMS.TIMER; - -package DUMMY_RTEMS is - --- Task Manager - - procedure TASK_CREATE ( - NAME : in RTEMS.NAME; - INITIAL_PRIORITY : in RTEMS.TASKS.PRIORITY; - STACK_SIZE : in RTEMS.UNSIGNED32; - INITIAL_MODES : in RTEMS.MODE; - ATTRIBUTE_SET : in RTEMS.ATTRIBUTE; - ID : out RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure TASK_IDENT ( - NAME : in RTEMS.NAME; - NODE : in RTEMS.UNSIGNED32; - ID : out RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure TASK_START ( - ID : in RTEMS.ID; - ENTRY_POINT : in RTEMS.TASKS.ENTRY_POINT; - ARGUMENT : in RTEMS.UNSIGNED32; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure TASK_RESTART ( - ID : in RTEMS.ID; - ARGUMENT : in RTEMS.UNSIGNED32; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure TASK_DELETE ( - ID : in RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure TASK_SUSPEND ( - ID : in RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure TASK_RESUME ( - ID : in RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure TASK_SET_PRIORITY ( - ID : in RTEMS.ID; - NEW_PRIORITY : in RTEMS.TASKS.PRIORITY; - OLD_PRIORITY : out RTEMS.TASKS.PRIORITY; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure TASK_MODE ( - MODE_SET : in RTEMS.MODE; - MASK : in RTEMS.MODE; - PREVIOUS_MODE_SET : out RTEMS.MODE; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure TASK_WAKE_WHEN ( - TIME_BUFFER : in RTEMS.TIME_OF_DAY; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure TASK_WAKE_AFTER ( - TICKS : in RTEMS.INTERVAL; - RESULT : out RTEMS.STATUS_CODES - ); - --- Interrupt Manager - --- procedure INTERRUPT_CATCH ( --- NEW_ISR_HANDLER : in RTEMS.ADDRESS; --- VECTOR : in RTEMS.VECTOR_NUMBER; --- OLD_ISR_HANDLER : out RTEMS.ADDRESS; --- RESULT : out RTEMS.STATUS_CODES --- ); - --- Clock Manager - - procedure CLOCK_GET_TOD ( - TIME_BUFFER : out RTEMS.TIME_OF_DAY; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure CLOCK_SET ( - TIME_BUFFER : in RTEMS.TIME_OF_DAY; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure CLOCK_TICK ( - RESULT : out RTEMS.STATUS_CODES - ); - --- Timer Manager - - procedure TIMER_CREATE ( - NAME : in RTEMS.NAME; - ID : out RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure TIMER_DELETE ( - ID : in RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure TIMER_IDENT ( - NAME : in RTEMS.NAME; - ID : out RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure TIMER_FIRE_AFTER ( - ID : in RTEMS.ID; - TICKS : in RTEMS.INTERVAL; - ROUTINE : in RTEMS.TIMER.SERVICE_ROUTINE; - USER_DATA : in RTEMS.ADDRESS; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure TIMER_FIRE_WHEN ( - ID : in RTEMS.ID; - WALL_TIME : in RTEMS.TIME_OF_DAY; - ROUTINE : in RTEMS.TIMER.SERVICE_ROUTINE; - USER_DATA : in RTEMS.ADDRESS; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure TIMER_RESET ( - ID : in RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure TIMER_CANCEL ( - ID : in RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ); - --- Semaphore Manager - - procedure SEMAPHORE_CREATE ( - NAME : in RTEMS.NAME; - COUNT : in RTEMS.UNSIGNED32; - ATTRIBUTE_SET : in RTEMS.ATTRIBUTE; - PRIORITY_CEILING : in RTEMS.TASKS.PRIORITY; - ID : out RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure SEMAPHORE_DELETE ( - ID : in RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure SEMAPHORE_IDENT ( - NAME : in RTEMS.NAME; - NODE : in RTEMS.UNSIGNED32; - ID : out RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure SEMAPHORE_OBTAIN ( - ID : in RTEMS.ID; - OPTION_SET : in RTEMS.OPTION; - TIMEOUT : in RTEMS.INTERVAL; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure SEMAPHORE_RELEASE ( - ID : in RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ); - --- Message Queue Manager - - procedure MESSAGE_QUEUE_CREATE ( - Name : in RTEMS.Name; - Count : in RTEMS.Unsigned32; - Max_Message_Size : in RTEMS.Unsigned32; - Attribute_Set : in RTEMS.Attribute; - ID : out RTEMS.ID; - Result : out RTEMS.Status_Codes - ); - - procedure MESSAGE_QUEUE_IDENT ( - NAME : in RTEMS.NAME; - NODE : in RTEMS.UNSIGNED32; - ID : out RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure MESSAGE_QUEUE_DELETE ( - ID : in RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure MESSAGE_QUEUE_SEND ( - ID : in RTEMS.ID; - BUFFER : in RTEMS.ADDRESS; - SIZE : in RTEMS.UNSIGNED32; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure MESSAGE_QUEUE_URGENT ( - ID : in RTEMS.ID; - BUFFER : in RTEMS.ADDRESS; - SIZE : in RTEMS.UNSIGNED32; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure MESSAGE_QUEUE_BROADCAST ( - ID : in RTEMS.ID; - BUFFER : in RTEMS.ADDRESS; - SIZE : in RTEMS.UNSIGNED32; - COUNT : out RTEMS.UNSIGNED32; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure MESSAGE_QUEUE_RECEIVE ( - ID : in RTEMS.ID; - BUFFER : in RTEMS.ADDRESS; - OPTION_SET : in RTEMS.OPTION; - TIMEOUT : in RTEMS.INTERVAL; - SIZE : out RTEMS.UNSIGNED32; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure MESSAGE_QUEUE_FLUSH ( - ID : in RTEMS.ID; - COUNT : out RTEMS.UNSIGNED32; - RESULT : out RTEMS.STATUS_CODES - ); - --- Event Manager - - procedure EVENT_SEND ( - ID : in RTEMS.ID; - EVENT_IN : in RTEMS.EVENT_SET; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure EVENT_RECEIVE ( - EVENT_IN : in RTEMS.EVENT_SET; - OPTION_SET : in RTEMS.OPTION; - TICKS : in RTEMS.INTERVAL; - EVENT_OUT : out RTEMS.EVENT_SET; - RESULT : out RTEMS.STATUS_CODES - ); - --- Signal Manager - - procedure SIGNAL_CATCH ( - ASR_HANDLER : in RTEMS.ASR_HANDLER; - MODE_SET : in RTEMS.MODE; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure SIGNAL_SEND ( - ID : in RTEMS.ID; - SIGNAL_SET : in RTEMS.SIGNAL_SET; - RESULT : out RTEMS.STATUS_CODES - ); - --- Partition Manager - - procedure PARTITION_CREATE ( - NAME : in RTEMS.NAME; - STARTING_ADDRESS : in RTEMS.ADDRESS; - LENGTH : in RTEMS.UNSIGNED32; - BUFFER_SIZE : in RTEMS.UNSIGNED32; - ATTRIBUTE_SET : in RTEMS.ATTRIBUTE; - ID : out RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure PARTITION_IDENT ( - NAME : in RTEMS.NAME; - NODE : in RTEMS.UNSIGNED32; - ID : out RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure PARTITION_DELETE ( - ID : in RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure PARTITION_GET_BUFFER ( - ID : in RTEMS.ID; - BUFFER : out RTEMS.ADDRESS; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure PARTITION_RETURN_BUFFER ( - ID : in RTEMS.ID; - BUFFER : in RTEMS.ADDRESS; - RESULT : out RTEMS.STATUS_CODES - ); - --- Region Manager - - procedure REGION_CREATE ( - NAME : in RTEMS.NAME; - STARTING_ADDRESS : in RTEMS.ADDRESS; - LENGTH : in RTEMS.UNSIGNED32; - PAGE_SIZE : in RTEMS.UNSIGNED32; - ATTRIBUTE_SET : in RTEMS.ATTRIBUTE; - ID : out RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure REGION_IDENT ( - NAME : in RTEMS.NAME; - ID : out RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure REGION_DELETE ( - ID : in RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure REGION_GET_SEGMENT ( - ID : in RTEMS.ID; - SIZE : in RTEMS.UNSIGNED32; - OPTION_SET : in RTEMS.OPTION; - TIMEOUT : in RTEMS.INTERVAL; - SEGMENT : out RTEMS.ADDRESS; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure REGION_RETURN_SEGMENT ( - ID : in RTEMS.ID; - SEGMENT : in RTEMS.ADDRESS; - RESULT : out RTEMS.STATUS_CODES - ); - --- Dual Ported Memory Manager - - procedure PORT_CREATE ( - NAME : in RTEMS.NAME; - INTERNAL_START : in RTEMS.ADDRESS; - EXTERNAL_START : in RTEMS.ADDRESS; - LENGTH : in RTEMS.UNSIGNED32; - ID : out RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure PORT_IDENT ( - NAME : in RTEMS.NAME; - ID : out RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure PORT_DELETE ( - ID : in RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure PORT_EXTERNAL_TO_INTERNAL ( - ID : in RTEMS.ID; - EXTERNAL : in RTEMS.ADDRESS; - INTERNAL : out RTEMS.ADDRESS; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure PORT_INTERNAL_TO_EXTERNAL ( - ID : in RTEMS.ID; - INTERNAL : in RTEMS.ADDRESS; - EXTERNAL : out RTEMS.ADDRESS; - RESULT : out RTEMS.STATUS_CODES - ); - --- Fatal Error Manager - - procedure FATAL_ERROR_OCCURRED ( - THE_ERROR : in RTEMS.UNSIGNED32 - ); - --- Rate Monotonic Manager - - procedure RATE_MONOTONIC_CREATE ( - NAME : in RTEMS.NAME; - ID : out RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure RATE_MONOTONIC_IDENT ( - NAME : in RTEMS.NAME; - ID : out RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure RATE_MONOTONIC_DELETE ( - ID : in RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure RATE_MONOTONIC_CANCEL ( - ID : in RTEMS.ID; - RESULT : out RTEMS.STATUS_CODES - ); - - procedure RATE_MONOTONIC_PERIOD ( - ID : in RTEMS.ID; - LENGTH : in RTEMS.INTERVAL; - RESULT : out RTEMS.STATUS_CODES - ); - --- Multiprocessing Manager - - procedure MULTIPROCESSING_ANNOUNCE; - -end DUMMY_RTEMS; diff --git a/c/src/ada-tests/tmtests/tmoverhd/tmoverhd.adb b/c/src/ada-tests/tmtests/tmoverhd/tmoverhd.adb deleted file mode 100644 index bfe6de4f88..0000000000 --- a/c/src/ada-tests/tmtests/tmoverhd/tmoverhd.adb +++ /dev/null @@ -1,55 +0,0 @@ --- --- MAIN / BODY --- --- DESCRIPTION: --- --- This is the entry point for Test TMOVERHD of the Timing Test Suite. --- --- DEPENDENCIES: --- --- --- --- COPYRIGHT (c) 1989-1997. --- 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 TMTEST; -with TEST_SUPPORT; - -procedure TMOVERHD 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, - TMTEST.INIT'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); - - loop - delay 120.0; - end loop; - -end TMOVERHD; - diff --git a/c/src/ada-tests/tmtests/tmoverhd/tmtest.adb b/c/src/ada-tests/tmtests/tmoverhd/tmtest.adb deleted file mode 100644 index 58c5ad09c6..0000000000 --- a/c/src/ada-tests/tmtests/tmoverhd/tmtest.adb +++ /dev/null @@ -1,1363 +0,0 @@ --- --- TMTEST / BODY --- --- DESCRIPTION: --- --- This package is the implementation of Calling Overhead Test of the RTEMS --- Timing Test Suite. --- --- DEPENDENCIES: --- --- --- --- COPYRIGHT (c) 1989-2009. --- 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 DUMMY_RTEMS; -with TEST_SUPPORT; -with TEXT_IO; -with TIME_TEST_SUPPORT; -with TIMER_DRIVER; - -package body TMTEST is - ---PAGE --- --- INIT --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - STATUS : RTEMS.STATUS_CODES; - begin - - TEXT_IO.NEW_LINE( 2 ); - TEXT_IO.PUT_LINE( "*** TIME TEST OVERHEAD ***" ); - - TIMER_DRIVER.SET_FIND_AVERAGE_OVERHEAD( TRUE ); - - TMTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); - - RTEMS.TASKS.CREATE( - TMTEST.TASK_NAME( 1 ), - 254, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - TMTEST.TASK_ID( 1 ), - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" ); - - RTEMS.TASKS.START( - TMTEST.TASK_ID( 1 ), - TMTEST.TASK_1'ACCESS, - 0, - STATUS - ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); - - RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); - TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); - - end INIT; - ---PAGE --- --- TIMER_HANDLER --- - - procedure TIMER_HANDLER ( - IGNORED_ID : in RTEMS.ID; - IGNORED_ADDRESS : in RTEMS.ADDRESS - ) is - begin - - NULL; - - end TIMER_HANDLER; - ---PAGE --- --- ISR_HANDLER --- - --- procedure ISR_HANDLER ( --- VECTOR : in RTEMS.VECTOR_NUMBER --- ) is --- begin --- --- NULL; --- --- end ISR_HANDLER; - ---PAGE --- --- ASR_HANDLER --- - - procedure ASR_HANDLER ( - SIGNALS : in RTEMS.SIGNAL_SET - ) is - begin - - NULL; - - end ASR_HANDLER; - ---PAGE --- --- TASK_1 --- - - procedure TASK_1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ) is - pragma Unreferenced(ARGUMENT); - NAME : RTEMS.NAME; - OVERHEAD : RTEMS.UNSIGNED32; - ID : RTEMS.ID; - IN_PRIORITY : RTEMS.TASKS.PRIORITY; - OUT_PRIORITY : RTEMS.TASKS.PRIORITY; - IN_MODE : RTEMS.MODE; - MASK : RTEMS.MODE; - OUT_MODE : RTEMS.MODE; - TIME : RTEMS.TIME_OF_DAY; - TIMEOUT : RTEMS.INTERVAL; - SIGNALS : RTEMS.SIGNAL_SET; - ADDRESS_1 : RTEMS.ADDRESS; - EVENTS : RTEMS.SIGNAL_SET; - BUFFER : TMTEST.BUFFER; - BUFFER_POINTER : RTEMS.ADDRESS; - MESSAGE_SIZE : RTEMS.UNSIGNED32; - COUNT : RTEMS.UNSIGNED32; - ERROR : RTEMS.UNSIGNED32; - STATUS : RTEMS.STATUS_CODES; - begin - - NAME := RTEMS.BUILD_NAME( 'N', 'A', 'M', 'E' ); - - BUFFER_POINTER := BUFFER'ADDRESS; - OVERHEAD := 0; - IN_PRIORITY := 0; - IN_MODE := 0; - MASK := 0; - SIGNALS := 0; - EVENTS := 0; - ERROR := 0; - --- TASK_CREATE - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.TASK_CREATE( - NAME, - IN_PRIORITY, - 2048, - RTEMS.DEFAULT_MODES, - RTEMS.DEFAULT_ATTRIBUTES, - ID, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TASK_CREATE", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- TASK_IDENT - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.TASK_IDENT( - NAME, - RTEMS.SEARCH_ALL_NODES, - ID, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TASK_IDENT", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- TASK_START - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.TASK_START( ID, TMTEST.TASK_1'ACCESS, 0, STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TASK_START", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- TASK_RESTART - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.TASK_RESTART( ID, 0, STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TASK_RESTART", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- TASK_DELETE - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.TASK_DELETE( ID, STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TASK_DELETE", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- TASK_SUSPEND - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.TASK_SUSPEND( ID, STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TASK_SUSPEND", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- TASK_RESUME - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.TASK_RESUME( ID, STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TASK_RESUME", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- TASK_SET_PRIORITY - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.TASK_SET_PRIORITY( - ID, - IN_PRIORITY, - OUT_PRIORITY, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TASK_SET_PRIORITY", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- TASK_MODE - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.TASK_MODE( - IN_MODE, - MASK, - OUT_MODE, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TASK_MODE", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- TASK_WAKE_WHEN - - TIME.YEAR := 2000; - TIME.MONTH := 12; - TIME.DAY := 25; - TIME.HOUR := 6; - TIME.MINUTE := 1; - TIME.SECOND := 2; - TIME.TICKS := 0; - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.TASK_WAKE_WHEN( TIME, STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TASK_WAKE_WHEN", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- TASK_WAKE_AFTER - - TIMEOUT := 1; - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.TASK_WAKE_AFTER( TIMEOUT, STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TASK_WAKE_AFTER", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- INTERRUPT_CATCH - --- TIMER_DRIVER.INITIALIZE; --- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT --- loop --- DUMMY_RTEMS.INTERRUPT_CATCH( --- TMTEST.ISR_HANDLER'ADDRESS, --- RTEMS.VECTOR_NUMBER'FIRST, --- ADDRESS_1, --- STATUS --- ); --- end loop; --- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; --- --- TIME_TEST_SUPPORT.PUT_TIME( --- "INTERRUPT_CATCH", --- TMTEST.END_TIME, --- TIME_TEST_SUPPORT.OPERATION_COUNT, --- OVERHEAD, --- 0 --- ); - --- CLOCK_GET_TOD - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.CLOCK_GET_TOD( TIME, STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "CLOCK_GET", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- CLOCK_SET - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.CLOCK_SET( TIME, STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "CLOCK_SET", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- CLOCK_TICK - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.CLOCK_TICK( STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "CLOCK_TICK", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - -TEST_SUPPORT.PAUSE; - --- TIMER_CREATE - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.TIMER_CREATE( NAME, ID, STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TIMER_CREATE", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- TIMER_DELETE - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.TIMER_DELETE( ID, STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TIMER_DELETE", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- TIMER_IDENT - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.TIMER_IDENT( - NAME, - ID, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TIMER_IDENT", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- TIMER_FIRE_AFTER - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.TIMER_FIRE_AFTER( - ID, - TIMEOUT, - TMTEST.TIMER_HANDLER'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TIMER_FIRE_AFTER", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- TIMER_FIRE_WHEN - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.TIMER_FIRE_WHEN( - ID, - TIME, - TMTEST.TIMER_HANDLER'ACCESS, - RTEMS.NULL_ADDRESS, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TIMER_FIRE_WHEN", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- TIMER_RESET - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.TIMER_RESET( ID, STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TIMER_RESET", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- TIMER_CANCEL - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.TIMER_CANCEL( ID, STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "TIMER_CANCEL", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- SEMAPHORE_CREATE - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.SEMAPHORE_CREATE( - NAME, - 128, - RTEMS.DEFAULT_ATTRIBUTES, - RTEMS.TASKS.NO_PRIORITY, - ID, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "SEMAPHORE_CREATE", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- SEMAPHORE_DELETE - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.SEMAPHORE_DELETE( ID, STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "SEMAPHORE_DELETE", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- SEMAPHORE_IDENT - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.SEMAPHORE_IDENT( - NAME, - RTEMS.SEARCH_ALL_NODES, - ID, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "SEMAPHORE_IDENT", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- SEMAPHORE_OBTAIN - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.SEMAPHORE_OBTAIN( - ID, - RTEMS.DEFAULT_OPTIONS, - TIMEOUT, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "SEMAPHORE_OBTAIN", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- SEMAPHORE_RELEASE - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.SEMAPHORE_RELEASE( ID, STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "SEMAPHORE_RELEASE", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- MESSAGE_QUEUE_CREATE - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.MESSAGE_QUEUE_CREATE( - NAME, - 128, - 16, - RTEMS.DEFAULT_ATTRIBUTES, - ID, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "MESSAGE_QUEUE_CREATE", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- MESSAGE_QUEUE_IDENT - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.MESSAGE_QUEUE_IDENT( - NAME, - RTEMS.SEARCH_ALL_NODES, - ID, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "MESSAGE_QUEUE_IDENT", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- MESSAGE_QUEUE_DELETE - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.MESSAGE_QUEUE_DELETE( ID, STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "MESSAGE_QUEUE_DELETE", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- MESSAGE_QUEUE_SEND - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.MESSAGE_QUEUE_SEND( ID, BUFFER_POINTER, 16, STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "MESSAGE_QUEUE_SEND", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- MESSAGE_QUEUE_URGENT - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.MESSAGE_QUEUE_URGENT( ID, BUFFER_POINTER, 16, STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "MESSAGE_QUEUE_URGENT", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- MESSAGE_QUEUE_BROADCAST - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.MESSAGE_QUEUE_BROADCAST( - ID, - BUFFER_POINTER, - 16, - COUNT, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "MESSAGE_QUEUE_BROADCAST", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- MESSAGE_QUEUE_RECEIVE - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.MESSAGE_QUEUE_RECEIVE( - ID, - BUFFER_POINTER, - RTEMS.DEFAULT_OPTIONS, - TIMEOUT, - MESSAGE_SIZE, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "MESSAGE_QUEUE_RECEIVE", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- MESSAGE_QUEUE_FLUSH - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.MESSAGE_QUEUE_FLUSH( ID, COUNT, STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "MESSAGE_QUEUE_FLUSH", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - -TEST_SUPPORT.PAUSE; - --- EVENT_SEND - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.EVENT_SEND( ID, EVENTS, STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "EVENT_SEND", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- EVENT_RECEIVE - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.EVENT_RECEIVE( - RTEMS.EVENT_16, - EVENTS, - RTEMS.DEFAULT_OPTIONS, - TIMEOUT, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "EVENT_RECEIVE", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- SIGNAL_CATCH - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.SIGNAL_CATCH( - TMTEST.ASR_HANDLER'ACCESS, - RTEMS.DEFAULT_MODES, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "SIGNAL_CATCH", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- SIGNAL_SEND - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.SIGNAL_SEND( ID, SIGNALS, STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "SIGNAL_SEND", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- PARTITION_CREATE - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.PARTITION_CREATE( - NAME, - TMTEST.MEMORY_AREA'ADDRESS, - 2048, - 128, - RTEMS.DEFAULT_ATTRIBUTES, - ID, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "PARTITION_CREATE", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- PARTITION_IDENT - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.PARTITION_IDENT( - NAME, - RTEMS.SEARCH_ALL_NODES, - ID, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "PARTITION_IDENT", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- PARTITION_DELETE - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.PARTITION_DELETE( ID, STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "PARTITION_DELETE", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- PARTITION_GET_BUFFER - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.PARTITION_GET_BUFFER( ID, ADDRESS_1, STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "PARTITION_GET_BUFFER", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- PARTITION_RETURN_BUFFER - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.PARTITION_RETURN_BUFFER( ID, ADDRESS_1, STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "PARTITION_RETURN_BUFFER", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- REGION_CREATE - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.REGION_CREATE( - NAME, - TMTEST.MEMORY_AREA'ADDRESS, - 2048, - 128, - RTEMS.DEFAULT_ATTRIBUTES, - ID, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "REGION_CREATE", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- REGION_IDENT - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.REGION_IDENT( - NAME, - ID, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "REGION_IDENT", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- REGION_DELETE - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.REGION_DELETE( ID, STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "REGION_DELETE", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- REGION_GET_SEGMENT - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.REGION_GET_SEGMENT( - ID, - 243, - RTEMS.DEFAULT_OPTIONS, - TIMEOUT, - ADDRESS_1, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "REGION_GET_SEGMENT", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- REGION_RETURN_SEGMENT - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.REGION_RETURN_SEGMENT( ID, ADDRESS_1, STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "REGION_RETURN_SEGMENT", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- PORT_CREATE - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.PORT_CREATE( - NAME, - TMTEST.INTERNAL_PORT_AREA'ADDRESS, - TMTEST.EXTERNAL_PORT_AREA'ADDRESS, - TMTEST.INTERNAL_PORT_AREA'LENGTH, - ID, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "PORT_CREATE", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- PORT_IDENT - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.PORT_IDENT( NAME, ID, STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "PORT_IDENT", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- PORT_DELETE - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.PORT_DELETE( ID, STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "PORT_DELETE", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- PORT_EXTERNAL_TO_INTERNAL - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.PORT_EXTERNAL_TO_INTERNAL( - ID, - TMTEST.EXTERNAL_PORT_AREA( 7 )'ADDRESS, - ADDRESS_1, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "PORT_EXTERNAL_TO_INTERNAL", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- PORT_INTERNAL_TO_EXTERNAL - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.PORT_INTERNAL_TO_EXTERNAL( - ID, - TMTEST.INTERNAL_PORT_AREA( 7 )'ADDRESS, - ADDRESS_1, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "PORT_INTERNAL_TO_EXTERNAL", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - -TEST_SUPPORT.PAUSE; - --- FATAL_ERROR_OCCURRED - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.FATAL_ERROR_OCCURRED( ERROR ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "FATAL_ERROR_OCCURRED", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- RATE_MONOTONIC_CREATE - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.RATE_MONOTONIC_CREATE( NAME, ID, STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "RATE_MONOTONIC_CREATE", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- RATE_MONOTONIC_IDENT - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.RATE_MONOTONIC_IDENT( - NAME, - ID, - STATUS - ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "RATE_MONOTONIC_IDENT", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- RATE_MONOTONIC_DELETE - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.RATE_MONOTONIC_DELETE( ID, STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "RATE_MONOTONIC_DELETE", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- RATE_MONOTONIC_CANCEL - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.RATE_MONOTONIC_CANCEL( ID, STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "RATE_MONOTONIC_CANCEL", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- RATE_MONOTONIC_PERIOD - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.RATE_MONOTONIC_PERIOD( ID, TIMEOUT, STATUS ); - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "RATE_MONOTONIC_PERIOD", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - --- MULTIPROCESSING_ANNOUNCE - - TIMER_DRIVER.INITIALIZE; - for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT - loop - DUMMY_RTEMS.MULTIPROCESSING_ANNOUNCE; - end loop; - TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; - - TIME_TEST_SUPPORT.PUT_TIME( - "MULTIPROCESSING_ANNOUNCE", - TMTEST.END_TIME, - TIME_TEST_SUPPORT.OPERATION_COUNT, - OVERHEAD, - 0 - ); - - TEXT_IO.PUT_LINE( "*** END OF TIME TEST OVERHEAD ***" ); - RTEMS.SHUTDOWN_EXECUTIVE( 0 ); - - end TASK_1; - -end TMTEST; diff --git a/c/src/ada-tests/tmtests/tmoverhd/tmtest.ads b/c/src/ada-tests/tmtests/tmoverhd/tmtest.ads deleted file mode 100644 index 48944077de..0000000000 --- a/c/src/ada-tests/tmtests/tmoverhd/tmtest.ads +++ /dev/null @@ -1,156 +0,0 @@ --- --- TMTEST / SPECIFICATION --- --- DESCRIPTION: --- --- This package is the specification for Calling Overhead Test of the RTEMS --- Timing Test Suite. --- --- DEPENDENCIES: --- --- --- --- COPYRIGHT (c) 1989-2009. --- 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 TMTEST is - --- --- Buffer Record similar to that used by RTEMS 3.2.1. Using this --- avoids changes to the test. --- - - type BUFFER is - record - FIELD1 : RTEMS.UNSIGNED32; -- TEMPORARY UNTIL VARIABLE LENGTH - FIELD2 : RTEMS.UNSIGNED32; - FIELD3 : RTEMS.UNSIGNED32; - FIELD4 : RTEMS.UNSIGNED32; - end record; - --- --- These arrays contain the IDs and NAMEs of all RTEMS tasks created --- by this test. --- - - TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; - TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; - --- --- The following variable is set to the execution time returned --- by the timer. --- - - END_TIME : RTEMS.UNSIGNED32; - --- --- 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 as the --- memory space for a partition and later for a region. --- - - MEMORY_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 255 ) of RTEMS.UNSIGNED8; - for MEMORY_AREA'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT; - --- --- INIT --- --- DESCRIPTION: --- --- This RTEMS task initializes the application. --- - - procedure INIT ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, INIT); - --- --- TIMER_HANDLER --- --- DESCRIPTION: --- --- This subprogram is a timer service routine. --- - - procedure TIMER_HANDLER ( - IGNORED_ID : in RTEMS.ID; - IGNORED_ADDRESS : in RTEMS.ADDRESS - ); - pragma Convention (C, TIMER_HANDLER); - --- --- ISR_HANDLER --- --- DESCRIPTION: --- --- This subprogram is an interrupt service routine. --- - --- procedure ISR_HANDLER ( --- VECTOR : in RTEMS.VECTOR_NUMBER --- ); - --- --- ASR_HANDLER --- --- DESCRIPTION: --- --- This subprogram is an asynchronous signal routine. --- - - procedure ASR_HANDLER ( - SIGNALS : in RTEMS.SIGNAL_SET - ); - pragma Convention (C, ASR_HANDLER); - --- --- TASK_1 --- --- DESCRIPTION: --- --- This RTEMS task is responsible for measuring and --- reporting the calling overhead for all RTEMS --- directives. --- - - procedure TASK_1 ( - ARGUMENT : in RTEMS.TASKS.ARGUMENT - ); - pragma Convention (C, TASK_1); - -end TMTEST; diff --git a/c/src/configure.ac b/c/src/configure.ac index d228b5efe2..0ef63ce80b 100644 --- a/c/src/configure.ac +++ b/c/src/configure.ac @@ -153,15 +153,6 @@ AC_ARG_ENABLE([ada], *) AC_MSG_ERROR(bad value ${enable_ada} for --enable-ada) ;; esac],[enable_ada=no]) -RTEMS_BSP_CONFIG_SUBDIR( - [ada-tests],[ada-tests], - ['--enable-rtems-root=../' \ - '--enable-project-root=${with_project_root}../$RTEMS_BSP' \ - '--with-project-top=${with_project_top}../' \ - '--enable-rtemsbsp=$RTEMS_BSP' \ - ], - [test x"$enable_tests" = xyes && test x"$enable_ada" = xyes]) - # HACK ALERT! # FIXME: Assume multilib implies in-source-tree multilibs diff --git a/testsuites/ada/Makefile.am b/testsuites/ada/Makefile.am new file mode 100644 index 0000000000..4fdae0c211 --- /dev/null +++ b/testsuites/ada/Makefile.am @@ -0,0 +1,13 @@ +ACLOCAL_AMFLAGS = -I aclocal -I ../aclocal + +_SUBDIRS = support samples sptests tmtests +if HAS_MP +_SUBDIRS += mptests +endif + +DIST_SUBDIRS = support samples sptests tmtests mptests + +EXTRA_DIST = ada.am + +include $(top_srcdir)/../automake/subdirs.am +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/aclocal/prog-gnat.m4 b/testsuites/ada/aclocal/prog-gnat.m4 new file mode 100644 index 0000000000..a2b2879c7d --- /dev/null +++ b/testsuites/ada/aclocal/prog-gnat.m4 @@ -0,0 +1,44 @@ +## +## Partially borrowed from gcc-3.2 +## +## WARNING: All the stuff below is pretty immature. + +AC_DEFUN([RTEMS_PROG_GNAT], +[AC_REQUIRE([AC_CHECK_TOOL_PREFIX]) +AC_REQUIRE([RTEMS_PROG_CC_FOR_TARGET]) + +AC_CHECK_TOOL([GNATMAKE],[gnatmake],[]) +AC_CACHE_CHECK([for compiler driver that understands Ada], + [rtems_cv_prog_CCADA], +[cat >conftest.adb <&1 || echo failure` + AS_IF([test -z "$errors"], + [rtems_cv_prog_CCADA=$cand + break]) +done +rm -f conftest.*]) +AC_SUBST([CCADA],[$rtems_cv_prog_CCADA]) + +AS_IF([test -n "$GNATMAKE" && test -n "$CCADA"], + [HAVE_GNAT=yes], + [HAVE_GNAT=no]) +]) diff --git a/testsuites/ada/ada.am b/testsuites/ada/ada.am new file mode 100644 index 0000000000..17084fb753 --- /dev/null +++ b/testsuites/ada/ada.am @@ -0,0 +1,24 @@ +SUFFIXES = .adb .ali .ads .adp + +GNATMAKE = @GNATMAKE@ + +AM_ADAFLAGS = -I$(PROJECT_ROOT)/lib/include/adainclude \ +-I$(PROJECT_ROOT)/@RTEMS_BSP@/lib/include/adainclude \ +-I$(top_srcdir)/support + +GNATCOMPILE = $(GNATMAKE) \ +-bargs -Mgnat_main \ +-margs $(AM_ADAFLAGS) $(ADAFLAGS) \ +-cargs $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) \ + $(GCCSPECS) \ +-largs $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) \ + $(GCCSPECS) \ +$(AM_LDFLAGS) $(LDFLAGS) init.o + +CLEANFILES += *.ali *.o b~*.adb b~*.ads + +#%.o: %.c +# $(CC) $(CFLAGS) -I@srcdir@ -c $< -o $@ + +.adp.adb: + pwd=`pwd` && cd $(srcdir) && $(M4) < $*.adp > $${pwd}/$*.adb diff --git a/testsuites/ada/ada_mvscn b/testsuites/ada/ada_mvscn new file mode 100644 index 0000000000..8c6a5b0a5b --- /dev/null +++ b/testsuites/ada/ada_mvscn @@ -0,0 +1,64 @@ +while read f +do + bname=`basename $f` + # mv $f `dirname $f`/ada_`basename $f` + cvs rm -f $f + cvs add `dirname $f`/ada_`basename $f` +done < + +/* end of include file */ diff --git a/testsuites/ada/mptests/mp01/mp01.adb b/testsuites/ada/mptests/mp01/mp01.adb new file mode 100644 index 0000000000..6e89f9306d --- /dev/null +++ b/testsuites/ada/mptests/mp01/mp01.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test MP01 of the Multiprocessor 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 MPTEST; +with TEST_SUPPORT; + +procedure MP01 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.GLOBAL, + INIT_ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF INIT" ); + + + RTEMS.TASKS.START( + INIT_ID, + MPTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end MP01; + diff --git a/testsuites/ada/mptests/mp01/mptest.adb b/testsuites/ada/mptests/mp01/mptest.adb new file mode 100644 index 0000000000..b76a1af8dc --- /dev/null +++ b/testsuites/ada/mptests/mp01/mptest.adb @@ -0,0 +1,230 @@ +-- +-- MPTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation for Test 1 of the RTEMS +-- Multiprocessor 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 INTERFACES; use INTERFACES; +with RTEMS; +with RTEMS.CLOCK; +with RTEMS.TASKS; +with TEST_SUPPORT; +with TEXT_IO; +with UNSIGNED32_IO; + +package body MPTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + C : CHARACTER; + TIME : RTEMS.TIME_OF_DAY; + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT( "*** TEST 1 -- NODE " ); + UNSIGNED32_IO.PUT( + TEST_SUPPORT.NODE, + WIDTH => 1 + ); + TEXT_IO.PUT_LINE( " ***" ); + + if TEST_SUPPORT.NODE /= 1 then + C := 'S'; + else + C := 'M'; + end if; + + MPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( C, 'A', '1', ' ' ); + MPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( C, 'A', '2', ' ' ); + MPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( C, 'A', '3', ' ' ); + + TIME := ( 1988, 12, 31, 9, 0, 0, 0 ); + + RTEMS.CLOCK.SET( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET" ); + + TEXT_IO.PUT_LINE( "Creating task 1 (Global)" ); + + RTEMS.TASKS.CREATE( + MPTEST.TASK_NAME( 1 ), + 1, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.GLOBAL, + MPTEST.TASK_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" ); + + TEXT_IO.PUT_LINE( "Creating task 2 (Global)" ); + + RTEMS.TASKS.CREATE( + MPTEST.TASK_NAME( 2 ), + 1, + 2048, + RTEMS.TIMESLICE, + RTEMS.GLOBAL, + MPTEST.TASK_ID( 2 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" ); + + TEXT_IO.PUT_LINE( "Creating task 3 (Local)" ); + + RTEMS.TASKS.CREATE( + MPTEST.TASK_NAME( 3 ), + 1, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + MPTEST.TASK_ID( 3 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA3" ); + + RTEMS.TASKS.START( + MPTEST.TASK_ID( 1 ), + MPTEST.TEST_TASK'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); + + RTEMS.TASKS.START( + MPTEST.TASK_ID( 2 ), + MPTEST.TEST_TASK'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" ); + + RTEMS.TASKS.START( + MPTEST.TASK_ID( 3 ), + MPTEST.TEST_TASK'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA3" ); + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- TEST_TASK +-- + + procedure TEST_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + TIME : RTEMS.TIME_OF_DAY; + TID : RTEMS.ID; + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.TASKS.IDENT( RTEMS.SELF, RTEMS.SEARCH_ALL_NODES, TID, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF SELF" ); + + RTEMS.CLOCK.GET_TOD( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); + + TEST_SUPPORT.PUT_NAME( + MPTEST.TASK_NAME( TEST_SUPPORT.TASK_NUMBER( TID ) ), + FALSE + ); + + TEST_SUPPORT.PRINT_TIME( "- clock_get - ", TIME, "" ); + TEXT_IO.NEW_LINE; + + RTEMS.TASKS.WAKE_AFTER( + TEST_SUPPORT.TASK_NUMBER( TID ) * 5 * + TEST_SUPPORT.TICKS_PER_SECOND, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + RTEMS.CLOCK.GET_TOD( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); + + TEST_SUPPORT.PUT_NAME( + MPTEST.TASK_NAME( TEST_SUPPORT.TASK_NUMBER( TID ) ), + FALSE + ); + + TEST_SUPPORT.PRINT_TIME( "- clock_get - ", TIME, "" ); + TEXT_IO.NEW_LINE; + + if TEST_SUPPORT.TASK_NUMBER( TID ) = 1 then -- TASK 1 + + TEST_SUPPORT.PUT_NAME( + MPTEST.TASK_NAME( TEST_SUPPORT.TASK_NUMBER( TID ) ), + FALSE + ); + + TEXT_IO.PUT_LINE( " - deleting self" ); + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + else if TEST_SUPPORT.TASK_NUMBER( TID ) = 2 then -- TASK 2 + + TEST_SUPPORT.PUT_NAME( MPTEST.TASK_NAME( 2 ), FALSE ); + TEXT_IO.PUT( " - waiting to be deleted by " ); + TEST_SUPPORT.PUT_NAME( MPTEST.TASK_NAME( 3 ), TRUE ); + + loop + TEST_SUPPORT.DO_NOTHING; -- can't be optimized away + end loop; + + else -- TASK 3 + + TEST_SUPPORT.PUT_NAME( MPTEST.TASK_NAME( 3 ), FALSE ); + TEXT_IO.PUT( " - getting TID of " ); + TEST_SUPPORT.PUT_NAME( MPTEST.TASK_NAME( 2 ), TRUE ); + + RTEMS.TASKS.IDENT( + MPTEST.TASK_NAME( 2 ), + RTEMS.SEARCH_ALL_NODES, + TID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF TA2" ); + + TEST_SUPPORT.PUT_NAME( MPTEST.TASK_NAME( 3 ), FALSE ); + TEXT_IO.PUT( " - deleting " ); + TEST_SUPPORT.PUT_NAME( MPTEST.TASK_NAME( 2 ), TRUE ); + + RTEMS.TASKS.DELETE( TID, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA2" ); + + end if; + end if; + + TEXT_IO.PUT_LINE( "*** END OF TEST 1 ***" ); + + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end TEST_TASK; + +end MPTEST; diff --git a/testsuites/ada/mptests/mp01/mptest.ads b/testsuites/ada/mptests/mp01/mptest.ads new file mode 100644 index 0000000000..81f004a8e3 --- /dev/null +++ b/testsuites/ada/mptests/mp01/mptest.ads @@ -0,0 +1,60 @@ +-- +-- MPTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 1 of the RTEMS +-- Multiprocessor 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; + +package MPTEST is + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS tasks created +-- by this test. +-- + + TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; + TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- TEST_TASK +-- +-- DESCRIPTION: +-- +-- This is the body of the RTEMS tasks which constitute this test. +-- + + procedure TEST_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TEST_TASK); + +end MPTEST; diff --git a/testsuites/ada/mptests/mp01/node1/Makefile.am b/testsuites/ada/mptests/mp01/node1/Makefile.am new file mode 100644 index 0000000000..154504ae33 --- /dev/null +++ b/testsuites/ada/mptests/mp01/node1/Makefile.am @@ -0,0 +1,19 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +AM_ADAFLAGS += -I$(srcdir)/.. + +noinst_PROGRAMS = mp01_ada_mp01_node1 +mp01_ada_mp01_node1_SOURCES = mp01_node1.adb ../mptest.adb config.h +mp01_ada_mp01_node1_SOURCES += ../mptest.ads +mp01_ada_mp01_node1_SOURCES += ../../../support/init.c + +mp01_ada_mp01_node1$(EXEEXT): mp01_node1.adb ../mptest.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_mp01-node1.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/mptests/mp01/node1/ada_mp01-node1.scn b/testsuites/ada/mptests/mp01/node1/ada_mp01-node1.scn new file mode 100644 index 0000000000..d7495bfa0d --- /dev/null +++ b/testsuites/ada/mptests/mp01/node1/ada_mp01-node1.scn @@ -0,0 +1,15 @@ +*** TEST 1 -- NODE 1 *** +Creating task 1 (Global) +Creating task 2 (Global) +Creating task 3 (Local) +MA1 - clock_get - 9: 0: 0 12/31/1988 +MA2 - clock_get - 9: 0: 0 12/31/1988 +MA3 - clock_get - 9: 0: 0 12/31/1988 +MA1 - clock_get - 9: 0: 5 12/31/1988 +MA1 - deleting self +MA2 - clock_get - 9: 0:10 12/31/1988 +MA2 - waiting to be deleted by MA3 +MA3 - clock_get - 9: 0:15 12/31/1988 +MA3 - getting TID of MA2 +MA3 - deleting MA2 +*** END OF TEST 1 *** diff --git a/testsuites/ada/mptests/mp01/node1/config.h b/testsuites/ada/mptests/mp01/node1/config.h new file mode 100644 index 0000000000..36c9d133e8 --- /dev/null +++ b/testsuites/ada/mptests/mp01/node1/config.h @@ -0,0 +1,21 @@ +/* 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_MP_APPLICATION +#define CONFIGURE_MP_NODE_NUMBER 1 + +#include "../config_base.h" + +/* end of include file */ diff --git a/testsuites/ada/mptests/mp01/node1/mp01_node1.adb b/testsuites/ada/mptests/mp01/node1/mp01_node1.adb new file mode 100644 index 0000000000..c1f54ccd32 --- /dev/null +++ b/testsuites/ada/mptests/mp01/node1/mp01_node1.adb @@ -0,0 +1,56 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test MP01_NODE1 of the Multiprocessor +-- 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 MPTEST; +with TEST_SUPPORT; + +procedure MP01_NODE1 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, + MPTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end MP01_NODE1; + diff --git a/testsuites/ada/mptests/mp01/node2/Makefile.am b/testsuites/ada/mptests/mp01/node2/Makefile.am new file mode 100644 index 0000000000..a58a210b0c --- /dev/null +++ b/testsuites/ada/mptests/mp01/node2/Makefile.am @@ -0,0 +1,19 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +AM_ADAFLAGS += -I$(srcdir)/.. + +noinst_PROGRAMS = mp01_ada_mp01_node2 +mp01_ada_mp01_node2_SOURCES = mp01_node2.adb ../mptest.adb config.h +mp01_ada_mp01_node2_SOURCES += ../mptest.ads +mp01_ada_mp01_node2_SOURCES += ../../../support/init.c + +mp01_ada_mp01_node2$(EXEEXT): mp01_node2.adb ../mptest.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_mp01-node2.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/mptests/mp01/node2/ada_mp01-node2.scn b/testsuites/ada/mptests/mp01/node2/ada_mp01-node2.scn new file mode 100644 index 0000000000..98047240f3 --- /dev/null +++ b/testsuites/ada/mptests/mp01/node2/ada_mp01-node2.scn @@ -0,0 +1,15 @@ +*** TEST 1 -- NODE 2 *** +Creating task 1 (Global) +Creating task 2 (Global) +Creating task 3 (Local) +SA1 - clock_get - 9: 0: 0 12/31/1988 +SA2 - clock_get - 9: 0: 0 12/31/1988 +SA3 - clock_get - 9: 0: 0 12/31/1988 +SA1 - clock_get - 9: 0: 5 12/31/1988 +SA1 - deleting self +SA2 - clock_get - 9: 0:10 12/31/1988 +SA2 - waiting to be deleted by SA3 +SA3 - clock_get - 9: 0:15 12/31/1988 +SA3 - getting TID of SA2 +SA3 - deleting SA2 +*** END OF TEST 1 *** diff --git a/testsuites/ada/mptests/mp01/node2/config.h b/testsuites/ada/mptests/mp01/node2/config.h new file mode 100644 index 0000000000..47edf66149 --- /dev/null +++ b/testsuites/ada/mptests/mp01/node2/config.h @@ -0,0 +1,21 @@ +/* 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_MP_APPLICATION +#define CONFIGURE_MP_NODE_NUMBER 2 + +#include "../config_base.h" + +/* end of include file */ diff --git a/testsuites/ada/mptests/mp01/node2/mp01_node2.adb b/testsuites/ada/mptests/mp01/node2/mp01_node2.adb new file mode 100644 index 0000000000..380df6c5fd --- /dev/null +++ b/testsuites/ada/mptests/mp01/node2/mp01_node2.adb @@ -0,0 +1,56 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test MP01_NODE2 of the Multiprocessor +-- 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 MPTEST; +with TEST_SUPPORT; + +procedure MP01_NODE2 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, + MPTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end MP01_NODE2; + diff --git a/testsuites/ada/mptests/mp03/Makefile.am b/testsuites/ada/mptests/mp03/Makefile.am new file mode 100644 index 0000000000..d1dad5313a --- /dev/null +++ b/testsuites/ada/mptests/mp03/Makefile.am @@ -0,0 +1,4 @@ +_SUBDIRS = node1 node2 + +include $(top_srcdir)/../automake/subdirs.am +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/mptests/mp03/config_base.h b/testsuites/ada/mptests/mp03/config_base.h new file mode 100644 index 0000000000..c1b8f24e86 --- /dev/null +++ b/testsuites/ada/mptests/mp03/config_base.h @@ -0,0 +1,28 @@ +/* config_base.h + * + * This include file defines all of the Configuration Table for this test + * EXCEPT the NODE NUMBER. + * + * 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. + */ + + + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_TASKS 2 + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/mptests/mp03/mptest.adb b/testsuites/ada/mptests/mp03/mptest.adb new file mode 100644 index 0000000000..170b62fd5d --- /dev/null +++ b/testsuites/ada/mptests/mp03/mptest.adb @@ -0,0 +1,267 @@ +-- +-- This package is the implementation for Test 3 of the RTEMS +-- Multiprocessor 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 INTERFACES; use INTERFACES; +with RTEMS; +with RTEMS.EVENT; +with RTEMS.TASKS; +with RTEMS.TIMER; +with TEST_SUPPORT; +with TEXT_IO; +with UNSIGNED32_IO; + +package body MPTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT( "*** TEST 3 -- NODE " ); + UNSIGNED32_IO.PUT( + TEST_SUPPORT.NODE, + WIDTH => 1 + ); + TEXT_IO.PUT_LINE( " ***" ); + + MPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( '1', '1', '1', ' ' ); + MPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( '2', '2', '2', ' ' ); + + TEXT_IO.PUT_LINE( "Creating Test_task (Global)" ); + RTEMS.TASKS.CREATE( + MPTEST.TASK_NAME( TEST_SUPPORT.NODE ), + 1, + 2048, + RTEMS.NO_PREEMPT, + RTEMS.GLOBAL, + MPTEST.TASK_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); + + TEXT_IO.PUT_LINE( "Starting Test_task (Global)" ); + RTEMS.TASKS.START( + MPTEST.TASK_ID( 1 ), + MPTEST.TEST_TASK'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); + + MPTEST.TIMER_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'M', '1', ' ' ); + + RTEMS.TIMER.CREATE( + MPTEST.TIMER_NAME( 1 ), + MPTEST.TIMER_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE" ); + + TEXT_IO.PUT_LINE( "Deleting initialization task" ); + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- DELAYED_SEND_EVENT +-- + + procedure DELAYED_SEND_EVENT ( + IGNORED_ID : in RTEMS.ID; + IGNORED_ADDRESS : in RTEMS.ADDRESS + ) is + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.EVENT.SEND( MPTEST.TASK_ID( 1 ), RTEMS.EVENT_16, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND" ); + + end DELAYED_SEND_EVENT; + +-- +-- TEST_TASK +-- + + procedure TEST_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + TID : RTEMS.ID; + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.TASKS.IDENT( RTEMS.SELF, RTEMS.SEARCH_ALL_NODES, TID, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF SELF" ); + + TEXT_IO.PUT_LINE( "Getting TID of remote task" ); + if TEST_SUPPORT.NODE = 1 then + MPTEST.REMOTE_NODE := 2; + else + MPTEST.REMOTE_NODE := 1; + end if; + + TEXT_IO.PUT( "Remote task's name is : " ); + TEST_SUPPORT.PUT_NAME( MPTEST.TASK_NAME( MPTEST.REMOTE_NODE ), TRUE ); + + loop + + RTEMS.TASKS.IDENT( + MPTEST.TASK_NAME( MPTEST.REMOTE_NODE ), + RTEMS.SEARCH_ALL_NODES, + MPTEST.REMOTE_TID, + STATUS + ); + + exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS ); + + end loop; + + RTEMS.TIMER.FIRE_AFTER( + MPTEST.TIMER_ID( 1 ), + 10 * TEST_SUPPORT.TICKS_PER_SECOND, + MPTEST.DELAYED_SEND_EVENT'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER" ); + + MPTEST.TEST_TASK_SUPPORT( 1 ); + + RTEMS.TIMER.FIRE_AFTER( + MPTEST.TIMER_ID( 1 ), + 11 * TEST_SUPPORT.TICKS_PER_SECOND, + MPTEST.DELAYED_SEND_EVENT'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER" ); + + if TEST_SUPPORT.NODE = 2 then + + RTEMS.TASKS.WAKE_AFTER( + 2 * TEST_SUPPORT.TICKS_PER_SECOND, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + end if; + + MPTEST.TEST_TASK_SUPPORT( 2 ); + + TEXT_IO.PUT_LINE( "*** END OF TEST 3 ***" ); + + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end TEST_TASK; + +-- +-- TEST_TASK_SUPPORT +-- + + + procedure TEST_TASK_SUPPORT ( + NODE : in RTEMS.UNSIGNED32 + ) is + EVENTS : RTEMS.EVENT_SET; + STATUS : RTEMS.STATUS_CODES; + begin + + if TEST_SUPPORT.NODE = NODE then + + loop + + RTEMS.EVENT.RECEIVE( + RTEMS.EVENT_16, + RTEMS.NO_WAIT, + RTEMS.NO_TIMEOUT, + EVENTS, + STATUS + ); + + exit when RTEMS.ARE_STATUSES_EQUAL( RTEMS.SUCCESSFUL, STATUS ); + + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.UNSATISFIED, + "EVENT_RECEIVE" + ); + + RTEMS.TASKS.WAKE_AFTER( + 2 * TEST_SUPPORT.TICKS_PER_SECOND, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + TEST_SUPPORT.PUT_NAME( MPTEST.TASK_NAME( NODE ), FALSE ); + TEXT_IO.PUT_LINE( " - Suspending remote task" ); + RTEMS.TASKS.SUSPEND( MPTEST.REMOTE_TID, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND" ); + + RTEMS.TASKS.WAKE_AFTER( + 2 * TEST_SUPPORT.TICKS_PER_SECOND, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + TEST_SUPPORT.PUT_NAME( MPTEST.TASK_NAME( NODE ), FALSE ); + TEXT_IO.PUT_LINE( " - Resuming remote task" ); + + RTEMS.TASKS.RESUME( MPTEST.REMOTE_TID, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESUME" ); + + end loop; + + else + + loop + + RTEMS.EVENT.RECEIVE( + RTEMS.EVENT_16, + RTEMS.NO_WAIT, + RTEMS.NO_TIMEOUT, + EVENTS, + STATUS + ); + + exit when RTEMS.ARE_STATUSES_EQUAL( RTEMS.SUCCESSFUL, STATUS ); + + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.UNSATISFIED, + "EVENT_RECEIVE" + ); + + TEST_SUPPORT.PUT_NAME( MPTEST.TASK_NAME( REMOTE_NODE ), FALSE ); + TEXT_IO.PUT_LINE( " - have I been suspended???" ); + RTEMS.TASKS.WAKE_AFTER( + TEST_SUPPORT.TICKS_PER_SECOND / 2, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + end loop; + + end if; + + end TEST_TASK_SUPPORT; + +end MPTEST; diff --git a/testsuites/ada/mptests/mp03/mptest.ads b/testsuites/ada/mptests/mp03/mptest.ads new file mode 100644 index 0000000000..6e7f59947e --- /dev/null +++ b/testsuites/ada/mptests/mp03/mptest.ads @@ -0,0 +1,111 @@ +-- +-- MPTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 3 of the RTEMS +-- Multiprocessor 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; + +package MPTEST is + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS tasks created +-- by this test. +-- + + TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; + TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS timers created +-- by this test. +-- + + TIMER_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID; + TIMER_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME; + +-- +-- This variable contains the ID of the remote task with which this +-- test interacts. +-- + + REMOTE_TID : RTEMS.ID; + +-- +-- This variable contains the node on which the remote task with which +-- this test interacts resides. +-- + + REMOTE_NODE : RTEMS.UNSIGNED32; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- DELAYED_SEND_EVENT +-- +-- DESCRIPTION: +-- +-- This subprogram is a timer service routine which sends an +-- event set to a waiting task. +-- + + procedure DELAYED_SEND_EVENT ( + IGNORED_ID : in RTEMS.ID; + IGNORED_ADDRESS : in RTEMS.ADDRESS + ); + pragma Convention (C, DELAYED_SEND_EVENT); + +-- +-- TEST_TASK +-- +-- DESCRIPTION: +-- +-- This is the body of the RTEMS tasks which constitute this test. +-- + + procedure TEST_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TEST_TASK); + +-- +-- TEST_TASK_SUPPORT +-- +-- DESCRIPTION: +-- +-- This subprogram performs the bulk of the test. Based on the NODE +-- specified, this subprogram loops suspending/resuming a remote task +-- or waiting for itself to be suspended/resumed. +-- + + procedure TEST_TASK_SUPPORT ( + NODE : in RTEMS.UNSIGNED32 + ); + +end MPTEST; diff --git a/testsuites/ada/mptests/mp03/node1/Makefile.am b/testsuites/ada/mptests/mp03/node1/Makefile.am new file mode 100644 index 0000000000..5c9b6f67ac --- /dev/null +++ b/testsuites/ada/mptests/mp03/node1/Makefile.am @@ -0,0 +1,19 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +AM_ADAFLAGS += -I$(srcdir)/.. + +noinst_PROGRAMS = mp03_ada_mp03_node1 +mp03_ada_mp03_node1_SOURCES = mp03_node1.adb ../mptest.adb config.h +mp03_ada_mp03_node1_SOURCES += ../mptest.ads +mp03_ada_mp03_node1_SOURCES += ../../../support/init.c + +mp03_ada_mp03_node1$(EXEEXT): mp03_node1.adb ../mptest.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_mp03-node1.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/mptests/mp03/node1/ada_mp03-node1.scn b/testsuites/ada/mptests/mp03/node1/ada_mp03-node1.scn new file mode 100644 index 0000000000..d749db49e2 --- /dev/null +++ b/testsuites/ada/mptests/mp03/node1/ada_mp03-node1.scn @@ -0,0 +1,28 @@ +*** TEST 3 -- NODE 1 *** +Creating Test_task (Global) +Starting Test_task (Global) +Deleting initialization task +Getting TID of remote task +Remote task's name is : 222 +111 - Suspending remote task +111 - Resuming remote task +111 - Suspending remote task +111 - Resuming remote task +111 - Suspending remote task +111 - Resuming remote task +222 - have I been suspended??? +222 - have I been suspended??? +222 - have I been suspended??? +222 - have I been suspended??? +222 - have I been suspended??? +222 - have I been suspended??? +222 - have I been suspended??? +222 - have I been suspended??? +222 - have I been suspended??? +222 - have I been suspended??? +222 - have I been suspended??? +222 - have I been suspended??? +222 - have I been suspended??? +222 - have I been suspended??? +*** END OF TEST 3 *** + diff --git a/testsuites/ada/mptests/mp03/node1/config.h b/testsuites/ada/mptests/mp03/node1/config.h new file mode 100644 index 0000000000..36c9d133e8 --- /dev/null +++ b/testsuites/ada/mptests/mp03/node1/config.h @@ -0,0 +1,21 @@ +/* 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_MP_APPLICATION +#define CONFIGURE_MP_NODE_NUMBER 1 + +#include "../config_base.h" + +/* end of include file */ diff --git a/testsuites/ada/mptests/mp03/node1/mp03_node1.adb b/testsuites/ada/mptests/mp03/node1/mp03_node1.adb new file mode 100644 index 0000000000..80a67ffc94 --- /dev/null +++ b/testsuites/ada/mptests/mp03/node1/mp03_node1.adb @@ -0,0 +1,56 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test MP03_NODE1 of the Multiprocessor +-- 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 MPTEST; +with TEST_SUPPORT; + +procedure MP03_NODE1 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, + MPTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end MP03_NODE1; + diff --git a/testsuites/ada/mptests/mp03/node2/Makefile.am b/testsuites/ada/mptests/mp03/node2/Makefile.am new file mode 100644 index 0000000000..bf8b5446d6 --- /dev/null +++ b/testsuites/ada/mptests/mp03/node2/Makefile.am @@ -0,0 +1,19 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +AM_ADAFLAGS += -I$(srcdir)/.. + +noinst_PROGRAMS = mp03_ada_mp03_node2 +mp03_ada_mp03_node2_SOURCES = mp03_node2.adb ../mptest.adb config.h +mp03_ada_mp03_node2_SOURCES += ../mptest.ads +mp03_ada_mp03_node2_SOURCES += ../../../support/init.c + +mp03_ada_mp03_node2$(EXEEXT): mp03_node2.adb ../mptest.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_mp03-node2.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/mptests/mp03/node2/ada_mp03-node2.scn b/testsuites/ada/mptests/mp03/node2/ada_mp03-node2.scn new file mode 100644 index 0000000000..56298f5b8d --- /dev/null +++ b/testsuites/ada/mptests/mp03/node2/ada_mp03-node2.scn @@ -0,0 +1,28 @@ +*** TEST 3 -- NODE 2 *** +Creating Test_task (Global) +Starting Test_task (Global) +Deleting initialization task +Getting TID of remote task +Remote task's name is : 111 +111 - have I been suspended??? +111 - have I been suspended??? +111 - have I been suspended??? +111 - have I been suspended??? +111 - have I been suspended??? +111 - have I been suspended??? +111 - have I been suspended??? +111 - have I been suspended??? +111 - have I been suspended??? +111 - have I been suspended??? +111 - have I been suspended??? +111 - have I been suspended??? +111 - have I been suspended??? +111 - have I been suspended??? +222 - Suspending remote task +222 - Resuming remote task +222 - Suspending remote task +222 - Resuming remote task +222 - Suspending remote task +222 - Resuming remote task +*** END OF TEST 3 *** + diff --git a/testsuites/ada/mptests/mp03/node2/config.h b/testsuites/ada/mptests/mp03/node2/config.h new file mode 100644 index 0000000000..47edf66149 --- /dev/null +++ b/testsuites/ada/mptests/mp03/node2/config.h @@ -0,0 +1,21 @@ +/* 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_MP_APPLICATION +#define CONFIGURE_MP_NODE_NUMBER 2 + +#include "../config_base.h" + +/* end of include file */ diff --git a/testsuites/ada/mptests/mp03/node2/mp03_node2.adb b/testsuites/ada/mptests/mp03/node2/mp03_node2.adb new file mode 100644 index 0000000000..aec5b91edd --- /dev/null +++ b/testsuites/ada/mptests/mp03/node2/mp03_node2.adb @@ -0,0 +1,56 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test MP03_NODE2 of the Multiprocessor +-- 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 MPTEST; +with TEST_SUPPORT; + +procedure MP03_NODE2 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, + MPTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end MP03_NODE2; + diff --git a/testsuites/ada/mptests/mp04/Makefile.am b/testsuites/ada/mptests/mp04/Makefile.am new file mode 100644 index 0000000000..d1dad5313a --- /dev/null +++ b/testsuites/ada/mptests/mp04/Makefile.am @@ -0,0 +1,4 @@ +_SUBDIRS = node1 node2 + +include $(top_srcdir)/../automake/subdirs.am +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/mptests/mp04/config_base.h b/testsuites/ada/mptests/mp04/config_base.h new file mode 100644 index 0000000000..c1b8f24e86 --- /dev/null +++ b/testsuites/ada/mptests/mp04/config_base.h @@ -0,0 +1,28 @@ +/* config_base.h + * + * This include file defines all of the Configuration Table for this test + * EXCEPT the NODE NUMBER. + * + * 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. + */ + + + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_TASKS 2 + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/mptests/mp04/mptest.adb b/testsuites/ada/mptests/mp04/mptest.adb new file mode 100644 index 0000000000..a7a2bdd3ea --- /dev/null +++ b/testsuites/ada/mptests/mp04/mptest.adb @@ -0,0 +1,163 @@ +-- +-- MPTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation for Test 4 of the RTEMS +-- Multiprocessor 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 INTERFACES; use INTERFACES; +with RTEMS; +with RTEMS.TASKS; +with TEST_SUPPORT; +with TEXT_IO; +with UNSIGNED32_IO; + +package body MPTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT( "*** TEST 4 -- NODE " ); + UNSIGNED32_IO.PUT( + TEST_SUPPORT.NODE, + WIDTH => 1 + ); + TEXT_IO.PUT_LINE( " ***" ); + + MPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( '1', '1', '1', ' ' ); + MPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( '2', '2', '2', ' ' ); + + TEXT_IO.PUT_LINE( "Creating Test_task (Global)" ); + + RTEMS.TASKS.CREATE( + MPTEST.TASK_NAME( TEST_SUPPORT.NODE ), + TEST_SUPPORT.NODE, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.GLOBAL, + MPTEST.TASK_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); + + TEXT_IO.PUT_LINE( "Starting Test_task (Global)" ); + + RTEMS.TASKS.START( + MPTEST.TASK_ID( 1 ), + MPTEST.TEST_TASK'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); + + TEXT_IO.PUT_LINE( "Deleting initialization task" ); + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- TEST_TASK +-- + + procedure TEST_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + TID : RTEMS.ID; + PREVIOUS_PRIORITY : RTEMS.TASKS.PRIORITY; + PREVIOUS_PRIORITY_1 : RTEMS.TASKS.PRIORITY; + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.TASKS.IDENT( RTEMS.SELF, RTEMS.SEARCH_ALL_NODES, TID, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF SELF" ); + + TEXT_IO.PUT_LINE( "Getting TID of remote task" ); + if TEST_SUPPORT.NODE = 1 then + MPTEST.REMOTE_NODE := 2; + else + MPTEST.REMOTE_NODE := 1; + end if; + + TEXT_IO.PUT( "Remote task's name is : " ); + TEST_SUPPORT.PUT_NAME( MPTEST.TASK_NAME( MPTEST.REMOTE_NODE ), TRUE ); + + loop + + RTEMS.TASKS.IDENT( + MPTEST.TASK_NAME( MPTEST.REMOTE_NODE ), + RTEMS.SEARCH_ALL_NODES, + MPTEST.REMOTE_TID, + STATUS + ); + + exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS ); + + end loop; + + RTEMS.TASKS.SET_PRIORITY( + MPTEST.REMOTE_TID, + TEST_SUPPORT.NODE, + PREVIOUS_PRIORITY, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" ); + + if PREVIOUS_PRIORITY /= MPTEST.REMOTE_NODE then + + TEXT_IO.PUT( "Remote priority (0x" ); + UNSIGNED32_IO.PUT( PREVIOUS_PRIORITY, BASE => 16 ); + TEXT_IO.PUT( "does not match remote node (0x" ); + UNSIGNED32_IO.PUT( MPTEST.REMOTE_NODE, BASE => 16 ); + TEXT_IO.PUT_LINE( ")!!!" ); + + RTEMS.SHUTDOWN_EXECUTIVE( 16#F00000# ); + + end if; + + loop + + RTEMS.TASKS.SET_PRIORITY( + RTEMS.SELF, + RTEMS.TASKS.CURRENT_PRIORITY, + PREVIOUS_PRIORITY_1, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" ); + + exit when PREVIOUS_PRIORITY_1 = MPTEST.REMOTE_NODE; + + end loop; + + + TEXT_IO.PUT_LINE( "Local task priority has been set" ); + + TEXT_IO.PUT_LINE( "*** END OF TEST 4 ***" ); + + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end TEST_TASK; + +end MPTEST; diff --git a/testsuites/ada/mptests/mp04/mptest.ads b/testsuites/ada/mptests/mp04/mptest.ads new file mode 100644 index 0000000000..ddf2c82878 --- /dev/null +++ b/testsuites/ada/mptests/mp04/mptest.ads @@ -0,0 +1,74 @@ +-- +-- MPTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 4 of the RTEMS +-- Multiprocessor 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; + +package MPTEST is + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS tasks created +-- by this test. +-- + + TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; + TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; + +-- +-- This variable contains the ID of the remote task with which this +-- test interacts. +-- + + REMOTE_TID : RTEMS.ID; + +-- +-- This variable contains the node on which the remote task with which +-- this test interacts resides. +-- + + REMOTE_NODE : RTEMS.UNSIGNED32; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- TEST_TASK +-- +-- DESCRIPTION: +-- +-- This is the body of the RTEMS tasks which constitute this test. +-- + + procedure TEST_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TEST_TASK); + +end MPTEST; diff --git a/testsuites/ada/mptests/mp04/node1/Makefile.am b/testsuites/ada/mptests/mp04/node1/Makefile.am new file mode 100644 index 0000000000..633209a092 --- /dev/null +++ b/testsuites/ada/mptests/mp04/node1/Makefile.am @@ -0,0 +1,19 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +AM_ADAFLAGS += -I$(srcdir)/.. + +noinst_PROGRAMS = mp04_ada_mp04_node1 +mp04_ada_mp04_node1_SOURCES = mp04_node1.adb ../mptest.adb config.h +mp04_ada_mp04_node1_SOURCES += ../mptest.ads +mp04_ada_mp04_node1_SOURCES += ../../../support/init.c + +mp04_ada_mp04_node1$(EXEEXT): mp04_node1.adb ../mptest.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_mp04-node1.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/mptests/mp04/node1/ada_mp04-node1.scn b/testsuites/ada/mptests/mp04/node1/ada_mp04-node1.scn new file mode 100644 index 0000000000..e9518f3ac2 --- /dev/null +++ b/testsuites/ada/mptests/mp04/node1/ada_mp04-node1.scn @@ -0,0 +1,8 @@ +*** TEST 4 -- NODE 1 *** +Creating Test_task (Global) +Starting Test_task (Global) +Deleting initialization task +Getting TID of remote task +Remote task's name is : 222 +Local task priority has been set +*** END OF TEST 4 *** diff --git a/testsuites/ada/mptests/mp04/node1/config.h b/testsuites/ada/mptests/mp04/node1/config.h new file mode 100644 index 0000000000..36c9d133e8 --- /dev/null +++ b/testsuites/ada/mptests/mp04/node1/config.h @@ -0,0 +1,21 @@ +/* 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_MP_APPLICATION +#define CONFIGURE_MP_NODE_NUMBER 1 + +#include "../config_base.h" + +/* end of include file */ diff --git a/testsuites/ada/mptests/mp04/node1/mp04_node1.adb b/testsuites/ada/mptests/mp04/node1/mp04_node1.adb new file mode 100644 index 0000000000..c88c019992 --- /dev/null +++ b/testsuites/ada/mptests/mp04/node1/mp04_node1.adb @@ -0,0 +1,56 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test MP04_NODE1 of the Multiprocessor +-- 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 MPTEST; +with TEST_SUPPORT; + +procedure MP04_NODE1 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, + MPTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end MP04_NODE1; + diff --git a/testsuites/ada/mptests/mp04/node2/Makefile.am b/testsuites/ada/mptests/mp04/node2/Makefile.am new file mode 100644 index 0000000000..cce97cd2a2 --- /dev/null +++ b/testsuites/ada/mptests/mp04/node2/Makefile.am @@ -0,0 +1,19 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +AM_ADAFLAGS += -I$(srcdir)/.. + +noinst_PROGRAMS = mp04_ada_mp04_node2 +mp04_ada_mp04_node2_SOURCES = mp04_node2.adb ../mptest.adb config.h +mp04_ada_mp04_node2_SOURCES += ../mptest.ads +mp04_ada_mp04_node2_SOURCES += ../../../support/init.c + +mp04_ada_mp04_node2$(EXEEXT): mp04_node2.adb ../mptest.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_mp04-node2.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/mptests/mp04/node2/ada_mp04-node2.scn b/testsuites/ada/mptests/mp04/node2/ada_mp04-node2.scn new file mode 100644 index 0000000000..8ccfcfef79 --- /dev/null +++ b/testsuites/ada/mptests/mp04/node2/ada_mp04-node2.scn @@ -0,0 +1,8 @@ +*** TEST 4 -- NODE 2 *** +Creating Test_task (Global) +Starting Test_task (Global) +Deleting initialization task +Getting TID of remote task +Remote task's name is : 111 +Local task priority has been set +*** END OF TEST 4 *** diff --git a/testsuites/ada/mptests/mp04/node2/config.h b/testsuites/ada/mptests/mp04/node2/config.h new file mode 100644 index 0000000000..47edf66149 --- /dev/null +++ b/testsuites/ada/mptests/mp04/node2/config.h @@ -0,0 +1,21 @@ +/* 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_MP_APPLICATION +#define CONFIGURE_MP_NODE_NUMBER 2 + +#include "../config_base.h" + +/* end of include file */ diff --git a/testsuites/ada/mptests/mp04/node2/mp04_node2.adb b/testsuites/ada/mptests/mp04/node2/mp04_node2.adb new file mode 100644 index 0000000000..4cd9f0e3b3 --- /dev/null +++ b/testsuites/ada/mptests/mp04/node2/mp04_node2.adb @@ -0,0 +1,56 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test MP04_NODE2 of the Multiprocessor +-- 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 MPTEST; +with TEST_SUPPORT; + +procedure MP04_NODE2 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, + MPTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end MP04_NODE2; + diff --git a/testsuites/ada/mptests/mp05/Makefile.am b/testsuites/ada/mptests/mp05/Makefile.am new file mode 100644 index 0000000000..d1dad5313a --- /dev/null +++ b/testsuites/ada/mptests/mp05/Makefile.am @@ -0,0 +1,4 @@ +_SUBDIRS = node1 node2 + +include $(top_srcdir)/../automake/subdirs.am +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/mptests/mp05/config_base.h b/testsuites/ada/mptests/mp05/config_base.h new file mode 100644 index 0000000000..c1b8f24e86 --- /dev/null +++ b/testsuites/ada/mptests/mp05/config_base.h @@ -0,0 +1,28 @@ +/* config_base.h + * + * This include file defines all of the Configuration Table for this test + * EXCEPT the NODE NUMBER. + * + * 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. + */ + + + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_TASKS 2 + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/mptests/mp05/mptest.adb b/testsuites/ada/mptests/mp05/mptest.adb new file mode 100644 index 0000000000..a206b80b85 --- /dev/null +++ b/testsuites/ada/mptests/mp05/mptest.adb @@ -0,0 +1,247 @@ +-- +-- MPTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation for Test 5 of the RTEMS +-- Multiprocessor 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 INTERFACES; use INTERFACES; +with RTEMS; +with RTEMS.FATAL; +with RTEMS.SIGNAL; +with RTEMS.TASKS; +with RTEMS.TIMER; +with TEST_SUPPORT; +with TEXT_IO; +with UNSIGNED32_IO; + +package body MPTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT( "*** TEST 5 -- NODE " ); + UNSIGNED32_IO.PUT( + TEST_SUPPORT.NODE, + WIDTH => 1 + ); + TEXT_IO.PUT_LINE( " ***" ); + + MPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( '1', '1', '1', ' ' ); + MPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( '2', '2', '2', ' ' ); + + TEXT_IO.PUT_LINE( "Creating Test_task (Global)" ); + + RTEMS.TASKS.CREATE( + MPTEST.TASK_NAME( TEST_SUPPORT.NODE ), + 1, + 2048, + RTEMS.TIMESLICE, + RTEMS.GLOBAL, + MPTEST.TASK_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); + + TEXT_IO.PUT_LINE( "Starting Test_task (Global)" ); + + RTEMS.TASKS.START( + MPTEST.TASK_ID( 1 ), + MPTEST.TEST_TASK'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); + + MPTEST.TIMER_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'M', '1', ' ' ); + MPTEST.TIMER_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'M', '2', ' ' ); + + RTEMS.TIMER.CREATE( + MPTEST.TIMER_NAME( TEST_SUPPORT.NODE ), + MPTEST.TIMER_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE" ); + + TEXT_IO.PUT_LINE( "Deleting initialization task" ); + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- PROCESS_ASR +-- + + procedure PROCESS_ASR ( + SIGNAL : in RTEMS.SIGNAL_SET + ) + is + begin + + if SIGNAL /= MPTEST.EXPECTED_SIGNAL then + + TEXT_IO.PUT( "ERROR: I was expecting signal 0x" ); + UNSIGNED32_IO.PUT( EXPECTED_SIGNAL, BASE => 16 ); + TEXT_IO.PUT( " got 0x" ); + UNSIGNED32_IO.PUT( SIGNAL, BASE => 16 ); + TEXT_IO.NEW_LINE; + + RTEMS.FATAL.ERROR_OCCURRED( 16#000F_0000# ); + + end if; + + MPTEST.SIGNAL_CAUGHT := TRUE; + + end PROCESS_ASR; + +-- +-- STOP_TEST_TSR +-- + + procedure STOP_TEST_TSR ( + IGNORED_ID : in RTEMS.ID; + IGNORED_ADDRESS : in RTEMS.ADDRESS + ) is + begin + + MPTEST.STOP_TEST := TRUE; + + end STOP_TEST_TSR; + +-- +-- TEST_TASK +-- + + procedure TEST_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + STATUS : RTEMS.STATUS_CODES; + begin + + MPTEST.STOP_TEST := FALSE; + + MPTEST.SIGNAL_CAUGHT := FALSE; + MPTEST.SIGNAL_COUNT := 0; + + TEXT_IO.PUT_LINE( "signal_catch: initializing signal catcher" ); + RTEMS.SIGNAL.CATCH( + MPTEST.PROCESS_ASR'ACCESS, + RTEMS.NO_ASR + RTEMS.NO_PREEMPT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SIGNAL_CATCH" ); + + if TEST_SUPPORT.NODE = 1 then + MPTEST.REMOTE_NODE := 2; + MPTEST.REMOTE_SIGNAL := RTEMS.SIGNAL_18; + MPTEST.EXPECTED_SIGNAL := RTEMS.SIGNAL_17; + else + MPTEST.REMOTE_NODE := 1; + MPTEST.REMOTE_SIGNAL := RTEMS.SIGNAL_17; + MPTEST.EXPECTED_SIGNAL := RTEMS.SIGNAL_18; + end if; + + TEXT_IO.PUT( "Remote task's name is : " ); + TEST_SUPPORT.PUT_NAME( MPTEST.TASK_NAME( MPTEST.REMOTE_NODE ), TRUE ); + + TEXT_IO.PUT_LINE( "Getting TID of remote task" ); + loop + + RTEMS.TASKS.IDENT( + MPTEST.TASK_NAME( MPTEST.REMOTE_NODE ), + RTEMS.SEARCH_ALL_NODES, + MPTEST.REMOTE_TID, + STATUS + ); + + exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS ); + + end loop; + + RTEMS.TIMER.FIRE_AFTER( + MPTEST.TIMER_ID( 1 ), + 3 * TEST_SUPPORT.TICKS_PER_SECOND, + MPTEST.STOP_TEST_TSR'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER" ); + + if TEST_SUPPORT.NODE = 1 then + + TEXT_IO.PUT_LINE( "Sending signal to remote task" ); + loop + RTEMS.SIGNAL.SEND( + MPTEST.REMOTE_TID, + MPTEST.REMOTE_SIGNAL, + STATUS + ); + + exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS ); + + exit when not RTEMS.ARE_STATUSES_EQUAL(STATUS, RTEMS.NOT_DEFINED); + + end loop; + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SIGNAL_SEND" ); + + end if; + + loop + + exit when MPTEST.STOP_TEST = TRUE; + + if MPTEST.SIGNAL_CAUGHT = TRUE then + + MPTEST.SIGNAL_CAUGHT := FALSE; + MPTEST.SIGNAL_COUNT := MPTEST.SIGNAL_COUNT + 1; + + if MPTEST.SIGNAL_COUNT >= MPTEST.SIGNALS_PER_DOT then + + MPTEST.SIGNAL_COUNT := 0; + + TEST_SUPPORT.PUT_DOT( "." ); + + end if; + + RTEMS.SIGNAL.SEND( + MPTEST.REMOTE_TID, + MPTEST.REMOTE_SIGNAL, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SIGNAL_SEND" ); + + end if; + + end loop; + + TEXT_IO.NEW_LINE; + TEXT_IO.PUT_LINE( "*** END OF TEST 5 ***" ); + + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end TEST_TASK; + +end MPTEST; diff --git a/testsuites/ada/mptests/mp05/mptest.ads b/testsuites/ada/mptests/mp05/mptest.ads new file mode 100644 index 0000000000..13d5ced1d6 --- /dev/null +++ b/testsuites/ada/mptests/mp05/mptest.ads @@ -0,0 +1,142 @@ +-- +-- MPTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 5 of the RTEMS +-- Multiprocessor 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.SIGNAL; +with RTEMS.TASKS; + +package MPTEST is + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS tasks created +-- by this test. +-- + + TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; + TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS timers created +-- by this test. +-- + + TIMER_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID; + TIMER_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME; + +-- +-- This variable is set when the test should stop executing. +-- + STOP_TEST : BOOLEAN; + +-- +-- This variable contains the ID of the remote task with which this +-- test interacts. +-- + + REMOTE_TID : RTEMS.ID; + +-- +-- This variable contains the node on which the remote task with which +-- this test interacts resides. +-- + + REMOTE_NODE : RTEMS.UNSIGNED32; + +-- +-- This is the signal set which is sent to the task on the other node. +-- + + REMOTE_SIGNAL : RTEMS.SIGNAL_SET; + +-- +-- This is the signal set the task on this node expects to receive +-- from the other node. +-- + + EXPECTED_SIGNAL : RTEMS.SIGNAL_SET; + +-- +-- These keep track of if a signal set has been caught and how many +-- signal sets have been caught cumulative. +-- + + SIGNAL_CAUGHT : BOOLEAN; + SIGNAL_COUNT : RTEMS.UNSIGNED32; + +-- +-- The number of signals to process per dot printed out. +-- + + SIGNALS_PER_DOT : constant RTEMS.UNSIGNED32 := 15; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- PROCESS_ASR +-- +-- DESCRIPTION: +-- +-- This subprogram is an ASR for TEST_TASK. +-- + + procedure PROCESS_ASR ( + SIGNAL : in RTEMS.SIGNAL_SET + ); + pragma Convention (C, PROCESS_ASR); + +-- +-- STOP_TEST_TSR +-- +-- DESCRIPTION: +-- +-- This subprogram is a TSR which sets the "stop test" flag. +-- + + procedure STOP_TEST_TSR ( + IGNORED_ID : in RTEMS.ID; + IGNORED_ADDRESS : in RTEMS.ADDRESS + ); + pragma Convention (C, STOP_TEST_TSR); + +-- +-- TEST_TASK +-- +-- DESCRIPTION: +-- +-- This is the body of the RTEMS tasks which constitute this test. +-- + + procedure TEST_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TEST_TASK); + +end MPTEST; diff --git a/testsuites/ada/mptests/mp05/node1/Makefile.am b/testsuites/ada/mptests/mp05/node1/Makefile.am new file mode 100644 index 0000000000..669235ea2d --- /dev/null +++ b/testsuites/ada/mptests/mp05/node1/Makefile.am @@ -0,0 +1,19 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +AM_ADAFLAGS += -I$(srcdir)/.. + +noinst_PROGRAMS = mp05_ada_mp05_node1 +mp05_ada_mp05_node1_SOURCES = mp05_node1.adb ../mptest.adb config.h +mp05_ada_mp05_node1_SOURCES += ../mptest.ads +mp05_ada_mp05_node1_SOURCES += ../../../support/init.c + +mp05_ada_mp05_node1$(EXEEXT): mp05_node1.adb ../mptest.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_mp05-node1.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/mptests/mp05/node1/ada_mp05-node1.scn b/testsuites/ada/mptests/mp05/node1/ada_mp05-node1.scn new file mode 100644 index 0000000000..6f0ea4b639 --- /dev/null +++ b/testsuites/ada/mptests/mp05/node1/ada_mp05-node1.scn @@ -0,0 +1,11 @@ +*** TEST 5 -- NODE 1 *** +Creating Test_task (Global) +Starting Test_task (Global) +Deleting initialization task +signal_catch: initializing signal catcher +Remote task's name is : 222 +Getting TID of remote task +Sending signal to remote task +.................................................... +.................................................... +*** END OF TEST 5 *** diff --git a/testsuites/ada/mptests/mp05/node1/config.h b/testsuites/ada/mptests/mp05/node1/config.h new file mode 100644 index 0000000000..36c9d133e8 --- /dev/null +++ b/testsuites/ada/mptests/mp05/node1/config.h @@ -0,0 +1,21 @@ +/* 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_MP_APPLICATION +#define CONFIGURE_MP_NODE_NUMBER 1 + +#include "../config_base.h" + +/* end of include file */ diff --git a/testsuites/ada/mptests/mp05/node1/mp05_node1.adb b/testsuites/ada/mptests/mp05/node1/mp05_node1.adb new file mode 100644 index 0000000000..529406450b --- /dev/null +++ b/testsuites/ada/mptests/mp05/node1/mp05_node1.adb @@ -0,0 +1,56 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test MP05_NODE1 of the Multiprocessor +-- 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 MPTEST; +with TEST_SUPPORT; + +procedure MP05_NODE1 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, + MPTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end MP05_NODE1; + diff --git a/testsuites/ada/mptests/mp05/node2/Makefile.am b/testsuites/ada/mptests/mp05/node2/Makefile.am new file mode 100644 index 0000000000..15de8d5810 --- /dev/null +++ b/testsuites/ada/mptests/mp05/node2/Makefile.am @@ -0,0 +1,19 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +AM_ADAFLAGS += -I$(srcdir)/.. + +noinst_PROGRAMS = mp05_ada_mp05_node2 +mp05_ada_mp05_node2_SOURCES = mp05_node2.adb ../mptest.adb config.h +mp05_ada_mp05_node2_SOURCES += ../mptest.ads +mp05_ada_mp05_node2_SOURCES += ../../../support/init.c + +mp05_ada_mp05_node2$(EXEEXT): mp05_node2.adb ../mptest.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_mp05-node2.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/mptests/mp05/node2/ada_mp05-node2.scn b/testsuites/ada/mptests/mp05/node2/ada_mp05-node2.scn new file mode 100644 index 0000000000..1fb18c132b --- /dev/null +++ b/testsuites/ada/mptests/mp05/node2/ada_mp05-node2.scn @@ -0,0 +1,10 @@ +*** TEST 5 -- NODE 2 *** +Creating Test_task (Global) +Starting Test_task (Global) +Deleting initialization task +signal_catch: initializing signal catcher +Remote task's name is : 111 +Getting TID of remote task +.................................................... +.................................................... +*** END OF TEST 5 *** diff --git a/testsuites/ada/mptests/mp05/node2/config.h b/testsuites/ada/mptests/mp05/node2/config.h new file mode 100644 index 0000000000..47edf66149 --- /dev/null +++ b/testsuites/ada/mptests/mp05/node2/config.h @@ -0,0 +1,21 @@ +/* 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_MP_APPLICATION +#define CONFIGURE_MP_NODE_NUMBER 2 + +#include "../config_base.h" + +/* end of include file */ diff --git a/testsuites/ada/mptests/mp05/node2/mp05_node2.adb b/testsuites/ada/mptests/mp05/node2/mp05_node2.adb new file mode 100644 index 0000000000..faa4aa2266 --- /dev/null +++ b/testsuites/ada/mptests/mp05/node2/mp05_node2.adb @@ -0,0 +1,56 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test MP05_NODE2 of the Multiprocessor +-- 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 MPTEST; +with TEST_SUPPORT; + +procedure MP05_NODE2 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, + MPTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end MP05_NODE2; + diff --git a/testsuites/ada/mptests/mp06/Makefile.am b/testsuites/ada/mptests/mp06/Makefile.am new file mode 100644 index 0000000000..d1dad5313a --- /dev/null +++ b/testsuites/ada/mptests/mp06/Makefile.am @@ -0,0 +1,4 @@ +_SUBDIRS = node1 node2 + +include $(top_srcdir)/../automake/subdirs.am +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/mptests/mp06/config_base.h b/testsuites/ada/mptests/mp06/config_base.h new file mode 100644 index 0000000000..c1b8f24e86 --- /dev/null +++ b/testsuites/ada/mptests/mp06/config_base.h @@ -0,0 +1,28 @@ +/* config_base.h + * + * This include file defines all of the Configuration Table for this test + * EXCEPT the NODE NUMBER. + * + * 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. + */ + + + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_TASKS 2 + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/mptests/mp06/mptest.adb b/testsuites/ada/mptests/mp06/mptest.adb new file mode 100644 index 0000000000..d4522e653b --- /dev/null +++ b/testsuites/ada/mptests/mp06/mptest.adb @@ -0,0 +1,252 @@ +-- +-- MPTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation for Test 6 of the RTEMS +-- Multiprocessor 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 INTERFACES; use INTERFACES; +with RTEMS; +with RTEMS.EVENT; +with RTEMS.TASKS; +with RTEMS.TIMER; +with TEST_SUPPORT; +with TEXT_IO; +with UNSIGNED32_IO; + +package body MPTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT( "*** TEST 6 -- NODE " ); + UNSIGNED32_IO.PUT( + TEST_SUPPORT.NODE, + WIDTH => 1 + ); + TEXT_IO.PUT_LINE( " ***" ); + + MPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( '1', '1', '1', ' ' ); + MPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( '2', '2', '2', ' ' ); + + TEXT_IO.PUT_LINE( "Creating Test_task (Global)" ); + + RTEMS.TASKS.CREATE( + MPTEST.TASK_NAME( TEST_SUPPORT.NODE ), + TEST_SUPPORT.NODE, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.GLOBAL, + MPTEST.TASK_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); + + TEXT_IO.PUT_LINE( "Starting Test_task (Global)" ); + + RTEMS.TASKS.START( + MPTEST.TASK_ID( 1 ), + MPTEST.TEST_TASK'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); + + MPTEST.TIMER_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'M', '1', ' ' ); + MPTEST.TIMER_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'M', '2', ' ' ); + + RTEMS.TIMER.CREATE( + MPTEST.TIMER_NAME( TEST_SUPPORT.NODE ), + MPTEST.TIMER_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE" ); + + TEXT_IO.PUT_LINE( "Deleting initialization task" ); + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- STOP_TEST_TSR +-- + + procedure STOP_TEST_TSR ( + IGNORED1 : in RTEMS.ID; + IGNORED2 : in RTEMS.ADDRESS + ) is + begin + + MPTEST.STOP_TEST := TRUE; + + end STOP_TEST_TSR; + +-- +-- TEST_TASK +-- + + procedure TEST_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + COUNT : RTEMS.UNSIGNED32; + EVENT_OUT : RTEMS.EVENT_SET; + EVENT_FOR_THIS_ITERATION : RTEMS.EVENT_SET; + STATUS : RTEMS.STATUS_CODES; + begin + + MPTEST.STOP_TEST := FALSE; + + if TEST_SUPPORT.NODE = 1 then + MPTEST.REMOTE_NODE := 2; + else + MPTEST.REMOTE_NODE := 1; + end if; + + TEXT_IO.PUT( "Remote task's name is : " ); + TEST_SUPPORT.PUT_NAME( MPTEST.TASK_NAME( MPTEST.REMOTE_NODE ), TRUE ); + + TEXT_IO.PUT_LINE( "Getting TID of remote task" ); + + loop + + RTEMS.TASKS.IDENT( + MPTEST.TASK_NAME( MPTEST.REMOTE_NODE ), + RTEMS.SEARCH_ALL_NODES, + MPTEST.REMOTE_TID, + STATUS + ); + + exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS ); + + end loop; + + if TEST_SUPPORT.NODE = 1 then + TEXT_IO.PUT_LINE( "Sending events to remote task" ); + else + TEXT_IO.PUT_LINE( "Receiving events from remote task" ); + end if; + + RTEMS.TIMER.FIRE_AFTER( + MPTEST.TIMER_ID( 1 ), + 5 * TEST_SUPPORT.TICKS_PER_SECOND, + MPTEST.STOP_TEST_TSR'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER" ); + + COUNT := 0; + + loop + + exit when MPTEST.STOP_TEST = TRUE; + + EVENT_FOR_THIS_ITERATION := + MPTEST.EVENT_SET_TABLE( + INTEGER( COUNT ) mod MPTEST.EVENT_SET_TABLE'LAST + 1 + ); + + if TEST_SUPPORT.NODE = 1 then + + RTEMS.EVENT.SEND( + MPTEST.REMOTE_TID, + EVENT_FOR_THIS_ITERATION, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND" ); + + else + + RTEMS.EVENT.RECEIVE( + EVENT_FOR_THIS_ITERATION, + RTEMS.DEFAULT_OPTIONS, + 1 * TEST_SUPPORT.TICKS_PER_SECOND, + EVENT_OUT, + STATUS + ); + + if RTEMS.ARE_STATUSES_EQUAL( STATUS, RTEMS.TIMEOUT ) then + TEXT_IO.NEW_LINE( 1 ); + + if TEST_SUPPORT.NODE = 2 then + TEXT_IO.PUT_LINE( + "Correct behavior if the other node exitted." + ); + else + TEXT_IO.PUT_LINE( + "ERROR... node 1 died" + ); + end if; + + exit; + + else + + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE" ); + + end if; + + end if; + + if (COUNT mod MPTEST.MAXIMUM_DOTS) = 0 then + + TEST_SUPPORT.PUT_DOT( "." ); + + end if; + + COUNT := COUNT + 1; + + end loop; + + TEXT_IO.NEW_LINE; + + if TEST_SUPPORT.NODE = 2 then + + RTEMS.EVENT.RECEIVE( + RTEMS.EVENT_16, + RTEMS.DEFAULT_OPTIONS, + 1 * TEST_SUPPORT.TICKS_PER_SECOND, + EVENT_OUT, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + RTEMS.TIMEOUT, + STATUS, + "EVENT_RECEIVE" + ); + + TEXT_IO.NEW_LINE; + TEXT_IO.PUT_LINE( "event_receive - correctly returned TIMEOUT" ); + + end if; + + TEXT_IO.PUT_LINE( "*** END OF TEST 6 ***" ); + + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end TEST_TASK; + +end MPTEST; diff --git a/testsuites/ada/mptests/mp06/mptest.ads b/testsuites/ada/mptests/mp06/mptest.ads new file mode 100644 index 0000000000..5c3668d3ac --- /dev/null +++ b/testsuites/ada/mptests/mp06/mptest.ads @@ -0,0 +1,148 @@ +-- +-- MPTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 6 of the RTEMS +-- Multiprocessor 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.EVENT; +with RTEMS.TASKS; + +package MPTEST is + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS tasks created +-- by this test. +-- + + TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; + TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS timers created +-- by this test. +-- + + TIMER_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID; + TIMER_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME; + +-- +-- This variable is set when the test should stop executing. +-- + STOP_TEST : BOOLEAN; + +-- +-- This variable contains the ID of the remote task with which this +-- test interacts. +-- + + REMOTE_TID : RTEMS.ID; + +-- +-- This variable contains the node on which the remote task with which +-- this test interacts resides. +-- + + REMOTE_NODE : RTEMS.UNSIGNED32; + +-- +-- The number of signals to process per dot printed out. +-- + + MAXIMUM_DOTS : constant RTEMS.UNSIGNED32 := 25; + +-- +-- The following is a table of the event sets which consist of +-- a single event. This test cycles through all of these +-- events. +-- + + EVENT_SET_TABLE : constant array ( 0 .. 30 ) of RTEMS.EVENT_SET := ( + RTEMS.EVENT_0, + RTEMS.EVENT_1, + RTEMS.EVENT_2, + RTEMS.EVENT_3, + RTEMS.EVENT_4, + RTEMS.EVENT_5, + RTEMS.EVENT_6, + RTEMS.EVENT_7, + RTEMS.EVENT_8, + RTEMS.EVENT_9, + RTEMS.EVENT_10, + RTEMS.EVENT_11, + RTEMS.EVENT_12, + RTEMS.EVENT_13, + RTEMS.EVENT_14, + RTEMS.EVENT_15, + RTEMS.EVENT_16, + RTEMS.EVENT_17, + RTEMS.EVENT_18, + RTEMS.EVENT_19, + RTEMS.EVENT_20, + RTEMS.EVENT_21, + RTEMS.EVENT_22, + RTEMS.EVENT_23, + RTEMS.EVENT_24, + RTEMS.EVENT_25, + RTEMS.EVENT_26, + RTEMS.EVENT_27, + RTEMS.EVENT_28, + RTEMS.EVENT_29, + RTEMS.EVENT_30 + ); + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- STOP_TEST_TSR +-- +-- DESCRIPTION: +-- +-- This subprogram is a TSR which sets the "stop test" flag. +-- + + procedure STOP_TEST_TSR ( + IGNORED1 : in RTEMS.ID; + IGNORED2 : in RTEMS.ADDRESS + ); + pragma Convention (C, STOP_TEST_TSR); + +-- +-- TEST_TASK +-- +-- DESCRIPTION: +-- +-- This is the body of the RTEMS tasks which constitute this test. +-- + + procedure TEST_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TEST_TASK); + +end MPTEST; diff --git a/testsuites/ada/mptests/mp06/node1/Makefile.am b/testsuites/ada/mptests/mp06/node1/Makefile.am new file mode 100644 index 0000000000..45bde9a044 --- /dev/null +++ b/testsuites/ada/mptests/mp06/node1/Makefile.am @@ -0,0 +1,19 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +AM_ADAFLAGS += -I$(srcdir)/.. + +noinst_PROGRAMS = mp06_ada_mp06_node1 +mp06_ada_mp06_node1_SOURCES = mp06_node1.adb ../mptest.adb config.h +mp06_ada_mp06_node1_SOURCES += ../mptest.ads +mp06_ada_mp06_node1_SOURCES += ../../../support/init.c + +mp06_ada_mp06_node1$(EXEEXT): mp06_node1.adb ../mptest.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_mp06-node1.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/mptests/mp06/node1/ada_mp06-node1.scn b/testsuites/ada/mptests/mp06/node1/ada_mp06-node1.scn new file mode 100644 index 0000000000..71da651eca --- /dev/null +++ b/testsuites/ada/mptests/mp06/node1/ada_mp06-node1.scn @@ -0,0 +1,10 @@ +*** TEST 6 -- NODE 1 *** +Creating Test_task (Global) +Starting Test_task (Global) +Deleting initialization task +Remote task's name is : 222 +Getting TID of remote task +Sending events to remote task +.................................................... +.................................................... +*** END OF TEST 6 *** diff --git a/testsuites/ada/mptests/mp06/node1/config.h b/testsuites/ada/mptests/mp06/node1/config.h new file mode 100644 index 0000000000..36c9d133e8 --- /dev/null +++ b/testsuites/ada/mptests/mp06/node1/config.h @@ -0,0 +1,21 @@ +/* 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_MP_APPLICATION +#define CONFIGURE_MP_NODE_NUMBER 1 + +#include "../config_base.h" + +/* end of include file */ diff --git a/testsuites/ada/mptests/mp06/node1/mp06_node1.adb b/testsuites/ada/mptests/mp06/node1/mp06_node1.adb new file mode 100644 index 0000000000..ebde32ca1c --- /dev/null +++ b/testsuites/ada/mptests/mp06/node1/mp06_node1.adb @@ -0,0 +1,56 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test MP06_NODE1 of the Multiprocessor +-- 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 MPTEST; +with TEST_SUPPORT; + +procedure MP06_NODE1 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, + MPTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end MP06_NODE1; + diff --git a/testsuites/ada/mptests/mp06/node2/Makefile.am b/testsuites/ada/mptests/mp06/node2/Makefile.am new file mode 100644 index 0000000000..e16512e279 --- /dev/null +++ b/testsuites/ada/mptests/mp06/node2/Makefile.am @@ -0,0 +1,19 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +AM_ADAFLAGS += -I$(srcdir)/.. + +noinst_PROGRAMS = mp06_ada_mp06_node2 +mp06_ada_mp06_node2_SOURCES = mp06_node2.adb ../mptest.adb config.h +mp06_ada_mp06_node2_SOURCES += ../mptest.ads +mp06_ada_mp06_node2_SOURCES += ../../../support/init.c + +mp06_ada_mp06_node2$(EXEEXT): mp06_node2.adb ../mptest.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_mp06-node2.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/mptests/mp06/node2/ada_mp06-node2.scn b/testsuites/ada/mptests/mp06/node2/ada_mp06-node2.scn new file mode 100644 index 0000000000..da449041b4 --- /dev/null +++ b/testsuites/ada/mptests/mp06/node2/ada_mp06-node2.scn @@ -0,0 +1,11 @@ +*** TEST 6 -- NODE 2 *** +Creating Test_task (Global) +Starting Test_task (Global) +Deleting initialization task +Remote task's name is : 111 +Getting TID of remote task +Receiving events from remote task +.................................................... +.................................................... +event_receive - correctly returned TIMEOUT +*** END OF TEST 6 *** diff --git a/testsuites/ada/mptests/mp06/node2/config.h b/testsuites/ada/mptests/mp06/node2/config.h new file mode 100644 index 0000000000..47edf66149 --- /dev/null +++ b/testsuites/ada/mptests/mp06/node2/config.h @@ -0,0 +1,21 @@ +/* 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_MP_APPLICATION +#define CONFIGURE_MP_NODE_NUMBER 2 + +#include "../config_base.h" + +/* end of include file */ diff --git a/testsuites/ada/mptests/mp06/node2/mp06_node2.adb b/testsuites/ada/mptests/mp06/node2/mp06_node2.adb new file mode 100644 index 0000000000..3637d8827e --- /dev/null +++ b/testsuites/ada/mptests/mp06/node2/mp06_node2.adb @@ -0,0 +1,56 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test MP06_NODE2 of the Multiprocessor +-- 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 MPTEST; +with TEST_SUPPORT; + +procedure MP06_NODE2 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, + MPTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end MP06_NODE2; + diff --git a/testsuites/ada/mptests/mp07/Makefile.am b/testsuites/ada/mptests/mp07/Makefile.am new file mode 100644 index 0000000000..d1dad5313a --- /dev/null +++ b/testsuites/ada/mptests/mp07/Makefile.am @@ -0,0 +1,4 @@ +_SUBDIRS = node1 node2 + +include $(top_srcdir)/../automake/subdirs.am +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/mptests/mp07/config_base.h b/testsuites/ada/mptests/mp07/config_base.h new file mode 100644 index 0000000000..c1b8f24e86 --- /dev/null +++ b/testsuites/ada/mptests/mp07/config_base.h @@ -0,0 +1,28 @@ +/* config_base.h + * + * This include file defines all of the Configuration Table for this test + * EXCEPT the NODE NUMBER. + * + * 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. + */ + + + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_TASKS 2 + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/mptests/mp07/mptest.adb b/testsuites/ada/mptests/mp07/mptest.adb new file mode 100644 index 0000000000..20dbc9cd84 --- /dev/null +++ b/testsuites/ada/mptests/mp07/mptest.adb @@ -0,0 +1,204 @@ +-- +-- MPTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation for Test 7 of the RTEMS +-- Multiprocessor 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 INTERFACES; use INTERFACES; +with RTEMS; +with RTEMS.EVENT; +with RTEMS.TASKS; +with RTEMS.TIMER; +with TEST_SUPPORT; +with TEXT_IO; +with UNSIGNED32_IO; + +package body MPTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT( "*** TEST 7 -- NODE " ); + UNSIGNED32_IO.PUT( + TEST_SUPPORT.NODE, + WIDTH => 1 + ); + TEXT_IO.PUT_LINE( " ***" ); + + MPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( '1', '1', '1', ' ' ); + MPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( '2', '2', '2', ' ' ); + + TEXT_IO.PUT_LINE( "Creating Test_task (Global)" ); + RTEMS.TASKS.CREATE( + MPTEST.TASK_NAME( TEST_SUPPORT.NODE ), + TEST_SUPPORT.NODE, + 2048, + RTEMS.TIMESLICE, + RTEMS.GLOBAL, + MPTEST.TASK_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); + + TEXT_IO.PUT_LINE( "Starting Test_task (Global)" ); + RTEMS.TASKS.START( + MPTEST.TASK_ID( 1 ), + MPTEST.TEST_TASK'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); + + MPTEST.TIMER_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'M', '1', ' ' ); + + RTEMS.TIMER.CREATE( + MPTEST.TIMER_NAME( 1 ), + MPTEST.TIMER_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE" ); + + TEXT_IO.PUT_LINE( "Deleting initialization task" ); + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- STOP_TEST_TSR +-- + + procedure STOP_TEST_TSR ( + IGNORED1 : in RTEMS.ID; + IGNORED2 : in RTEMS.ADDRESS + ) is + begin + + MPTEST.STOP_TEST := TRUE; + + end STOP_TEST_TSR; + +-- +-- TEST_TASK +-- + + procedure TEST_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + EVENT_OUT : RTEMS.EVENT_SET; + STATUS : RTEMS.STATUS_CODES; + begin + + MPTEST.STOP_TEST := FALSE; + + if TEST_SUPPORT.NODE = 1 then + MPTEST.REMOTE_NODE := 2; + else + MPTEST.REMOTE_NODE := 1; + end if; + + TEXT_IO.PUT( "Remote task's name is : " ); + TEST_SUPPORT.PUT_NAME( MPTEST.TASK_NAME( MPTEST.REMOTE_NODE ), TRUE ); + + TEXT_IO.PUT_LINE( "Getting TID of remote task" ); + loop + RTEMS.TASKS.IDENT( + MPTEST.TASK_NAME( MPTEST.REMOTE_NODE ), + RTEMS.SEARCH_ALL_NODES, + MPTEST.REMOTE_TID, + STATUS + ); + + exit when RTEMS.ARE_STATUSES_EQUAL( STATUS, RTEMS.SUCCESSFUL ); + + end loop; + + if TEST_SUPPORT.NODE = 1 then + + TEXT_IO.PUT_LINE( "Sending first event to remote task" ); + RTEMS.EVENT.SEND( + MPTEST.REMOTE_TID, + RTEMS.EVENT_16, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND" ); + + end if; + + RTEMS.TIMER.FIRE_AFTER( + MPTEST.TIMER_ID( 1 ), + 5 * TEST_SUPPORT.TICKS_PER_SECOND, + MPTEST.STOP_TEST_TSR'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER" ); + + loop + + exit when MPTEST.STOP_TEST = TRUE; + + for COUNT in 1 .. MPTEST.PER_DOT + loop + + RTEMS.EVENT.RECEIVE( + RTEMS.EVENT_16, + RTEMS.DEFAULT_OPTIONS, + TEST_SUPPORT.TICKS_PER_SECOND, + EVENT_OUT, + STATUS + ); + if RTEMS.ARE_STATUSES_EQUAL( STATUS, RTEMS.TIMEOUT ) then + TEXT_IO.NEW_LINE; + TEXT_IO.PUT_LINE( + "TA1 - TIMEOUT .. probably OK if the other node exits" + ); + exit; + else + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE" ); + end if; + + RTEMS.EVENT.SEND( + MPTEST.REMOTE_TID, + RTEMS.EVENT_16, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND" ); + + end loop; + + TEST_SUPPORT.PUT_DOT( "." ); + + end loop; + + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT_LINE( "*** END OF TEST 7 ***" ); + + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end TEST_TASK; + +end MPTEST; diff --git a/testsuites/ada/mptests/mp07/mptest.ads b/testsuites/ada/mptests/mp07/mptest.ads new file mode 100644 index 0000000000..499628b5d0 --- /dev/null +++ b/testsuites/ada/mptests/mp07/mptest.ads @@ -0,0 +1,107 @@ +-- +-- MPTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 7 of the RTEMS +-- Multiprocessor 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; + +package MPTEST is + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS tasks created +-- by this test. +-- + + TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; + TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS timers created +-- by this test. +-- + + TIMER_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID; + TIMER_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME; + +-- +-- This variable is set when the test should stop executing. +-- + STOP_TEST : BOOLEAN; + +-- +-- This variable contains the ID of the remote task with which this +-- test interacts. +-- + + REMOTE_TID : RTEMS.ID; + +-- +-- This variable contains the node on which the remote task with which +-- this test interacts resides. +-- + + REMOTE_NODE : RTEMS.UNSIGNED32; + +-- +-- The number of events to process per dot printed out. +-- + + PER_DOT : constant RTEMS.UNSIGNED32 := 100; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- STOP_TEST_TSR +-- +-- DESCRIPTION: +-- +-- This subprogram is a TSR which sets the "stop test" flag. +-- + + procedure STOP_TEST_TSR ( + IGNORED1 : in RTEMS.ID; + IGNORED2 : in RTEMS.ADDRESS + ); + pragma Convention (C, STOP_TEST_TSR); + +-- +-- TEST_TASK +-- +-- DESCRIPTION: +-- +-- This is the body of the RTEMS tasks which constitute this test. +-- + + procedure TEST_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TEST_TASK); + +end MPTEST; diff --git a/testsuites/ada/mptests/mp07/node1/Makefile.am b/testsuites/ada/mptests/mp07/node1/Makefile.am new file mode 100644 index 0000000000..c6b77cd1e3 --- /dev/null +++ b/testsuites/ada/mptests/mp07/node1/Makefile.am @@ -0,0 +1,19 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +AM_ADAFLAGS += -I$(srcdir)/.. + +noinst_PROGRAMS = mp07_ada_mp07_node1 +mp07_ada_mp07_node1_SOURCES = mp07_node1.adb ../mptest.adb config.h +mp07_ada_mp07_node1_SOURCES += ../mptest.ads +mp07_ada_mp07_node1_SOURCES += ../../../support/init.c + +mp07_ada_mp07_node1$(EXEEXT): mp07_node1.adb ../mptest.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_mp07-node1.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/mptests/mp07/node1/ada_mp07-node1.scn b/testsuites/ada/mptests/mp07/node1/ada_mp07-node1.scn new file mode 100644 index 0000000000..71e0956329 --- /dev/null +++ b/testsuites/ada/mptests/mp07/node1/ada_mp07-node1.scn @@ -0,0 +1,10 @@ +*** TEST 7 -- NODE 1 *** +Creating Test_task (Global) +Starting Test_task (Global) +Deleting initialization task +Remote task's name is : 222 +Getting TID of remote task +Sending first event to remote task +.................................................... +.................................................... +*** END OF TEST 7 *** diff --git a/testsuites/ada/mptests/mp07/node1/config.h b/testsuites/ada/mptests/mp07/node1/config.h new file mode 100644 index 0000000000..36c9d133e8 --- /dev/null +++ b/testsuites/ada/mptests/mp07/node1/config.h @@ -0,0 +1,21 @@ +/* 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_MP_APPLICATION +#define CONFIGURE_MP_NODE_NUMBER 1 + +#include "../config_base.h" + +/* end of include file */ diff --git a/testsuites/ada/mptests/mp07/node1/mp07_node1.adb b/testsuites/ada/mptests/mp07/node1/mp07_node1.adb new file mode 100644 index 0000000000..a6d9ef4db0 --- /dev/null +++ b/testsuites/ada/mptests/mp07/node1/mp07_node1.adb @@ -0,0 +1,56 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test MP07_NODE1 of the Multiprocessor +-- 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 MPTEST; +with TEST_SUPPORT; + +procedure MP07_NODE1 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, + MPTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end MP07_NODE1; + diff --git a/testsuites/ada/mptests/mp07/node2/Makefile.am b/testsuites/ada/mptests/mp07/node2/Makefile.am new file mode 100644 index 0000000000..95e310850d --- /dev/null +++ b/testsuites/ada/mptests/mp07/node2/Makefile.am @@ -0,0 +1,19 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +AM_ADAFLAGS += -I$(srcdir)/.. + +noinst_PROGRAMS = mp07_ada_mp07_node2 +mp07_ada_mp07_node2_SOURCES = mp07_node2.adb ../mptest.adb config.h +mp07_ada_mp07_node2_SOURCES += ../mptest.ads +mp07_ada_mp07_node2_SOURCES += ../../../support/init.c + +mp07_ada_mp07_node2$(EXEEXT): mp07_node2.adb ../mptest.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_mp07-node2.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/mptests/mp07/node2/ada_mp07-node2.scn b/testsuites/ada/mptests/mp07/node2/ada_mp07-node2.scn new file mode 100644 index 0000000000..c31011e85c --- /dev/null +++ b/testsuites/ada/mptests/mp07/node2/ada_mp07-node2.scn @@ -0,0 +1,9 @@ +*** TEST 7 -- NODE 2 *** +Creating Test_task (Global) +Starting Test_task (Global) +Deleting initialization task +Remote task's name is : 111 +Getting TID of remote task +.................................................... +.................................................... +*** END OF TEST 7 *** diff --git a/testsuites/ada/mptests/mp07/node2/config.h b/testsuites/ada/mptests/mp07/node2/config.h new file mode 100644 index 0000000000..47edf66149 --- /dev/null +++ b/testsuites/ada/mptests/mp07/node2/config.h @@ -0,0 +1,21 @@ +/* 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_MP_APPLICATION +#define CONFIGURE_MP_NODE_NUMBER 2 + +#include "../config_base.h" + +/* end of include file */ diff --git a/testsuites/ada/mptests/mp07/node2/mp07_node2.adb b/testsuites/ada/mptests/mp07/node2/mp07_node2.adb new file mode 100644 index 0000000000..0e0db0bbdd --- /dev/null +++ b/testsuites/ada/mptests/mp07/node2/mp07_node2.adb @@ -0,0 +1,56 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test MP07_NODE2 of the Multiprocessor +-- 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 MPTEST; +with TEST_SUPPORT; + +procedure MP07_NODE2 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, + MPTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end MP07_NODE2; + diff --git a/testsuites/ada/mptests/mp08/Makefile.am b/testsuites/ada/mptests/mp08/Makefile.am new file mode 100644 index 0000000000..d1dad5313a --- /dev/null +++ b/testsuites/ada/mptests/mp08/Makefile.am @@ -0,0 +1,4 @@ +_SUBDIRS = node1 node2 + +include $(top_srcdir)/../automake/subdirs.am +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/mptests/mp08/config_base.h b/testsuites/ada/mptests/mp08/config_base.h new file mode 100644 index 0000000000..c1b8f24e86 --- /dev/null +++ b/testsuites/ada/mptests/mp08/config_base.h @@ -0,0 +1,28 @@ +/* config_base.h + * + * This include file defines all of the Configuration Table for this test + * EXCEPT the NODE NUMBER. + * + * 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. + */ + + + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_TASKS 2 + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/mptests/mp08/mptest.adb b/testsuites/ada/mptests/mp08/mptest.adb new file mode 100644 index 0000000000..2910ec83e7 --- /dev/null +++ b/testsuites/ada/mptests/mp08/mptest.adb @@ -0,0 +1,203 @@ +-- +-- MPTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation for Test 8 of the RTEMS +-- Multiprocessor 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 INTERFACES; use INTERFACES; +with RTEMS; +with RTEMS.OBJECT; +with RTEMS.SEMAPHORE; +with RTEMS.TASKS; +with TEST_SUPPORT; +with TEXT_IO; +with UNSIGNED32_IO; + +package body MPTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT( "*** TEST 8 -- NODE " ); + UNSIGNED32_IO.PUT( + TEST_SUPPORT.NODE, + WIDTH => 1 + ); + TEXT_IO.PUT_LINE( " ***" ); + + MPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( '1', '1', '1', ' ' ); + MPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( '2', '2', '2', ' ' ); + + MPTEST.SEMAPHORE_NAME( 1 ) := RTEMS.BUILD_NAME( 'S', 'E', 'M', ' ' ); + + if TEST_SUPPORT.NODE = 1 then + + TEXT_IO.PUT_LINE( "Creating Semaphore(Global)" ); + + RTEMS.SEMAPHORE.CREATE( + MPTEST.SEMAPHORE_NAME( 1 ), + 1, + RTEMS.GLOBAL, + MPTEST.SEMAPHORE_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE" ); + + end if; + + TEXT_IO.PUT_LINE( "Creating Test_task (Global)" ); + RTEMS.TASKS.CREATE( + MPTEST.TASK_NAME( TEST_SUPPORT.NODE ), + TEST_SUPPORT.NODE, + 2048, + RTEMS.TIMESLICE, + RTEMS.GLOBAL, + MPTEST.TASK_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); + + TEXT_IO.PUT_LINE( "Starting Test_task (Global)" ); + RTEMS.TASKS.START( + MPTEST.TASK_ID( 1 ), + MPTEST.TEST_TASK'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); + + TEXT_IO.PUT_LINE( "Deleting initialization task" ); + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- TEST_TASK +-- + + procedure TEST_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + DOTS : RTEMS.UNSIGNED32; + COUNT : RTEMS.UNSIGNED32; + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.PUT_LINE( "Getting SMID of semaphore" ); + loop + + RTEMS.SEMAPHORE.IDENT( + MPTEST.SEMAPHORE_NAME( 1 ), + RTEMS.SEARCH_ALL_NODES, + MPTEST.SEMAPHORE_ID( 1 ), + STATUS + ); + + exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS ); + + end loop; + + if TEST_SUPPORT.NODE = 2 then + + RTEMS.SEMAPHORE.DELETE( + MPTEST.SEMAPHORE_ID( 1 ), + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.ILLEGAL_ON_REMOTE_OBJECT, + "SEMAPHORE_DELETE" + ); + + TEXT_IO.PUT_LINE( + "semaphore_delete correctly returned ILLEGAL_ON_REMOTE_OBJECT" + ); + + end if; + + COUNT := 0; + + loop + + TEST_SUPPORT.PUT_DOT( "p" ); + + RTEMS.SEMAPHORE.OBTAIN( + MPTEST.SEMAPHORE_ID( 1 ), + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + STATUS + ); + + if not RTEMS.IS_STATUS_SUCCESSFUL( STATUS ) then + + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.OBJECT_WAS_DELETED, + "SEMAPHORE_OBTAIN" + ); + + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT_LINE( "Global semaphore deleted" ); + + TEXT_IO.PUT_LINE( "*** END OF TEST 8 ***" ); + + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end if; + + COUNT := COUNT + 1; + + if TEST_SUPPORT.NODE = 1 and then + COUNT >= 1000 then + + RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT_LINE( "Deleting global semaphore" ); + + RTEMS.SEMAPHORE.DELETE( MPTEST.SEMAPHORE_ID( 1 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_DELETE" ); + + TEXT_IO.PUT_LINE( "*** END OF TEST 8 ***" ); + + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end if; + + TEST_SUPPORT.PUT_DOT( "v" ); + + RTEMS.SEMAPHORE.RELEASE( MPTEST.SEMAPHORE_ID( 1 ), STATUS ); + + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE" ); + + end loop; + + end TEST_TASK; + +end MPTEST; diff --git a/testsuites/ada/mptests/mp08/mptest.ads b/testsuites/ada/mptests/mp08/mptest.ads new file mode 100644 index 0000000000..07df76322e --- /dev/null +++ b/testsuites/ada/mptests/mp08/mptest.ads @@ -0,0 +1,88 @@ +-- +-- MPTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 8 of the RTEMS +-- Multiprocessor 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; + +package MPTEST is + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS tasks created +-- by this test. +-- + + TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; + TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS semaphores created +-- by this test. +-- + + SEMAPHORE_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID; + SEMAPHORE_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME; + +-- +-- This variable contains the ID of the remote task with which this +-- test interacts. +-- + + REMOTE_TID : RTEMS.ID; + +-- +-- This variable contains the node on which the remote task with which +-- this test interacts resides. +-- + + REMOTE_NODE : RTEMS.UNSIGNED32; + +-- +-- The number of events to process per dot printed out. +-- + + PER_DOT : constant RTEMS.UNSIGNED32 := 100; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- TEST_TASK +-- +-- DESCRIPTION: +-- +-- This is the body of the RTEMS tasks which constitute this test. +-- + + procedure TEST_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TEST_TASK); + +end MPTEST; diff --git a/testsuites/ada/mptests/mp08/node1/Makefile.am b/testsuites/ada/mptests/mp08/node1/Makefile.am new file mode 100644 index 0000000000..be1b6ce643 --- /dev/null +++ b/testsuites/ada/mptests/mp08/node1/Makefile.am @@ -0,0 +1,19 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +AM_ADAFLAGS += -I$(srcdir)/.. + +noinst_PROGRAMS = mp08_ada_mp08_node1 +mp08_ada_mp08_node1_SOURCES = mp08_node1.adb ../mptest.adb config.h +mp08_ada_mp08_node1_SOURCES += ../mptest.ads +mp08_ada_mp08_node1_SOURCES += ../../../support/init.c + +mp08_ada_mp08_node1$(EXEEXT): mp08_node1.adb ../mptest.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_mp08-node1.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/mptests/mp08/node1/ada_mp08-node1.scn b/testsuites/ada/mptests/mp08/node1/ada_mp08-node1.scn new file mode 100644 index 0000000000..ba9f089e96 --- /dev/null +++ b/testsuites/ada/mptests/mp08/node1/ada_mp08-node1.scn @@ -0,0 +1,9 @@ +*** TEST 8 -- NODE 1 *** +Creating Test_task (Global) +Starting Test_task (Global) +Deleting initialization task +Getting SMID of semaphore +pvpvpvpvpvp....... +(continued) pvp +Deleting global semaphore +*** END OF TEST 8 *** diff --git a/testsuites/ada/mptests/mp08/node1/config.h b/testsuites/ada/mptests/mp08/node1/config.h new file mode 100644 index 0000000000..36c9d133e8 --- /dev/null +++ b/testsuites/ada/mptests/mp08/node1/config.h @@ -0,0 +1,21 @@ +/* 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_MP_APPLICATION +#define CONFIGURE_MP_NODE_NUMBER 1 + +#include "../config_base.h" + +/* end of include file */ diff --git a/testsuites/ada/mptests/mp08/node1/mp08_node1.adb b/testsuites/ada/mptests/mp08/node1/mp08_node1.adb new file mode 100644 index 0000000000..75a1a985be --- /dev/null +++ b/testsuites/ada/mptests/mp08/node1/mp08_node1.adb @@ -0,0 +1,56 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test MP08_NODE1 of the Multiprocessor +-- 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 MPTEST; +with TEST_SUPPORT; + +procedure MP08_NODE1 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, + MPTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end MP08_NODE1; + diff --git a/testsuites/ada/mptests/mp08/node2/Makefile.am b/testsuites/ada/mptests/mp08/node2/Makefile.am new file mode 100644 index 0000000000..1a3271d713 --- /dev/null +++ b/testsuites/ada/mptests/mp08/node2/Makefile.am @@ -0,0 +1,19 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +AM_ADAFLAGS += -I$(srcdir)/.. + +noinst_PROGRAMS = mp08_ada_mp08_node2 +mp08_ada_mp08_node2_SOURCES = mp08_node2.adb ../mptest.adb config.h +mp08_ada_mp08_node2_SOURCES += ../mptest.ads +mp08_ada_mp08_node2_SOURCES += ../../../support/init.c + +mp08_ada_mp08_node2$(EXEEXT): mp08_node2.adb ../mptest.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_mp08-node2.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/mptests/mp08/node2/ada_mp08-node2.scn b/testsuites/ada/mptests/mp08/node2/ada_mp08-node2.scn new file mode 100644 index 0000000000..8ac712ae93 --- /dev/null +++ b/testsuites/ada/mptests/mp08/node2/ada_mp08-node2.scn @@ -0,0 +1,10 @@ +*** TEST 8 -- NODE 2 *** +Creating Test_task (Global) +Starting Test_task (Global) +Deleting initialization task +Getting SMID of semaphore +semaphore_delete correctly returned ILLEGAL_ON_REMOTE_OBJECT +pvpvpvpvpvp....... +(continued) pvp +Global semaphore deleted +*** END OF TEST 8 *** diff --git a/testsuites/ada/mptests/mp08/node2/config.h b/testsuites/ada/mptests/mp08/node2/config.h new file mode 100644 index 0000000000..47edf66149 --- /dev/null +++ b/testsuites/ada/mptests/mp08/node2/config.h @@ -0,0 +1,21 @@ +/* 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_MP_APPLICATION +#define CONFIGURE_MP_NODE_NUMBER 2 + +#include "../config_base.h" + +/* end of include file */ diff --git a/testsuites/ada/mptests/mp08/node2/mp08_node2.adb b/testsuites/ada/mptests/mp08/node2/mp08_node2.adb new file mode 100644 index 0000000000..84dd6b5371 --- /dev/null +++ b/testsuites/ada/mptests/mp08/node2/mp08_node2.adb @@ -0,0 +1,56 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test MP08_NODE2 of the Multiprocessor +-- 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 MPTEST; +with TEST_SUPPORT; + +procedure MP08_NODE2 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, + MPTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end MP08_NODE2; + diff --git a/testsuites/ada/mptests/mp09/Makefile.am b/testsuites/ada/mptests/mp09/Makefile.am new file mode 100644 index 0000000000..d1dad5313a --- /dev/null +++ b/testsuites/ada/mptests/mp09/Makefile.am @@ -0,0 +1,4 @@ +_SUBDIRS = node1 node2 + +include $(top_srcdir)/../automake/subdirs.am +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/mptests/mp09/config_base.h b/testsuites/ada/mptests/mp09/config_base.h new file mode 100644 index 0000000000..c1b8f24e86 --- /dev/null +++ b/testsuites/ada/mptests/mp09/config_base.h @@ -0,0 +1,28 @@ +/* config_base.h + * + * This include file defines all of the Configuration Table for this test + * EXCEPT the NODE NUMBER. + * + * 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. + */ + + + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_TASKS 2 + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/mptests/mp09/mptest.adb b/testsuites/ada/mptests/mp09/mptest.adb new file mode 100644 index 0000000000..f68268788d --- /dev/null +++ b/testsuites/ada/mptests/mp09/mptest.adb @@ -0,0 +1,373 @@ +-- +-- MPTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation for Test 9 of the RTEMS +-- Multiprocessor 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 INTERFACES; use INTERFACES; +with RTEMS; +with RTEMS.MESSAGE_QUEUE; +with RTEMS.OBJECT; +with RTEMS.TASKS; +with TEST_SUPPORT; +with TEXT_IO; +with UNSIGNED32_IO; + +package body MPTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT( "*** TEST 9 -- NODE " ); + UNSIGNED32_IO.PUT( + TEST_SUPPORT.NODE, + WIDTH => 1 + ); + TEXT_IO.PUT_LINE( " ***" ); + + MPTEST.RECEIVE_BUFFER := + RTEMS.TO_BUFFER_POINTER( MPTEST.RECEIVE_BUFFER_AREA'ADDRESS ); + + MPTEST.BUFFER_1 := + RTEMS.TO_BUFFER_POINTER( MPTEST.BUFFER_AREA_1'ADDRESS ); + + MPTEST.BUFFER_2 := + RTEMS.TO_BUFFER_POINTER( MPTEST.BUFFER_AREA_2'ADDRESS ); + + MPTEST.BUFFER_3 := + RTEMS.TO_BUFFER_POINTER( MPTEST.BUFFER_AREA_3'ADDRESS ); + + MPTEST.BUFFER_4 := + RTEMS.TO_BUFFER_POINTER( MPTEST.BUFFER_AREA_4'ADDRESS ); + + MPTEST.FILL_BUFFER( "123456789012345 ", MPTEST.BUFFER_AREA_1 ); + MPTEST.FILL_BUFFER( "abcdefghijklmno ", MPTEST.BUFFER_AREA_2 ); + MPTEST.FILL_BUFFER( "ABCDEFGHIJKLMNO ", MPTEST.BUFFER_AREA_3 ); + MPTEST.FILL_BUFFER( "PQRSTUVWXYZ(){} ", MPTEST.BUFFER_AREA_4 ); + + MPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( '1', '1', '1', ' ' ); + MPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( '2', '2', '2', ' ' ); + + MPTEST.QUEUE_NAME( 1 ) := RTEMS.BUILD_NAME( 'M', 'S', 'G', ' ' ); + + if TEST_SUPPORT.NODE = 1 then + + TEXT_IO.PUT_LINE( "Creating Message Queue (Global)" ); + RTEMS.MESSAGE_QUEUE.CREATE( + MPTEST.QUEUE_NAME( 1 ), + 3, + RTEMS.GLOBAL + RTEMS.LIMIT, + MPTEST.QUEUE_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_CREATE" ); + + end if; + + TEXT_IO.PUT_LINE( "Creating Test_task (local)" ); + RTEMS.TASKS.CREATE( + MPTEST.TASK_NAME( TEST_SUPPORT.NODE ), + TEST_SUPPORT.NODE, + 2048, + RTEMS.TIMESLICE, + RTEMS.DEFAULT_ATTRIBUTES, + MPTEST.TASK_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); + + TEXT_IO.PUT_LINE( "Starting Test_task (local)" ); + RTEMS.TASKS.START( + MPTEST.TASK_ID( 1 ), + MPTEST.TEST_TASK'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); + + TEXT_IO.PUT_LINE( "Deleting initialization task" ); + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- SEND_MESSAGES +-- + + procedure SEND_MESSAGES is + BROADCAST_COUNT : RTEMS.UNSIGNED32; + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.PUT( "message_queue_send : " ); + MPTEST.PUT_BUFFER( MPTEST.BUFFER_AREA_1 ); + TEXT_IO.NEW_LINE; + + RTEMS.MESSAGE_QUEUE.SEND( + MPTEST.QUEUE_ID( 1 ), + MPTEST.BUFFER_1, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); + + TEXT_IO.PUT_LINE( "Delaying for a second" ); + RTEMS.TASKS.WAKE_AFTER( + 1 * TEST_SUPPORT.TICKS_PER_SECOND, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + TEXT_IO.PUT( "message_queue_urgent : " ); + MPTEST.PUT_BUFFER( MPTEST.BUFFER_AREA_2 ); + TEXT_IO.NEW_LINE; + + RTEMS.MESSAGE_QUEUE.URGENT( + MPTEST.QUEUE_ID( 1 ), + MPTEST.BUFFER_2, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_URGENT" ); + + TEXT_IO.PUT_LINE( "Delaying for a second" ); + RTEMS.TASKS.WAKE_AFTER( + 1 * TEST_SUPPORT.TICKS_PER_SECOND, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + TEXT_IO.PUT( "message_queue_broadcast : " ); + MPTEST.PUT_BUFFER( MPTEST.BUFFER_AREA_3 ); + TEXT_IO.NEW_LINE; + + RTEMS.MESSAGE_QUEUE.BROADCAST( + MPTEST.QUEUE_ID( 1 ), + MPTEST.BUFFER_3, + BROADCAST_COUNT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_BROADCAST" ); + + TEXT_IO.PUT_LINE( "Delaying for a second" ); + RTEMS.TASKS.WAKE_AFTER( + 1 * TEST_SUPPORT.TICKS_PER_SECOND, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + end SEND_MESSAGES; + +-- +-- RECEIVE_MESSAGES +-- + + procedure RECEIVE_MESSAGES is + INDEX : RTEMS.UNSIGNED32; + STATUS : RTEMS.STATUS_CODES; + begin + + for INDEX in 1 .. 3 + loop + + TEXT_IO.PUT_LINE( "Receiving message ..." ); + RTEMS.MESSAGE_QUEUE.RECEIVE( + MPTEST.QUEUE_ID( 1 ), + MPTEST.RECEIVE_BUFFER, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" ); + + TEXT_IO.PUT( "Received : " ); + MPTEST.PUT_BUFFER( MPTEST.RECEIVE_BUFFER_AREA ); + TEXT_IO.NEW_LINE; + + end loop; + + TEXT_IO.PUT_LINE( "Receiver delaying for a second" ); + + RTEMS.TASKS.WAKE_AFTER( 1 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + end RECEIVE_MESSAGES; + +-- +-- FILL_BUFFER +-- + +-- +-- Depends on tricks to make the copy work. +-- + + procedure FILL_BUFFER ( + SOURCE : in STRING; + BUFFER : out RTEMS.BUFFER + ) is + SOURCE_BUFFER : RTEMS.BUFFER_POINTER; + begin + + SOURCE_BUFFER := RTEMS.TO_BUFFER_POINTER( + SOURCE( SOURCE'FIRST )'ADDRESS + ); + + BUFFER.FIELD1 := SOURCE_BUFFER.FIELD1; + BUFFER.FIELD2 := SOURCE_BUFFER.FIELD2; + BUFFER.FIELD3 := SOURCE_BUFFER.FIELD3; + BUFFER.FIELD4 := SOURCE_BUFFER.FIELD4; + + end FILL_BUFFER; + +-- +-- PUT_BUFFER +-- + +-- +-- Depends on tricks to make the output work. +-- + + procedure PUT_BUFFER ( + BUFFER : in RTEMS.BUFFER + ) is + begin + + TEST_SUPPORT.PUT_NAME( BUFFER.FIELD1, FALSE ); + TEST_SUPPORT.PUT_NAME( BUFFER.FIELD2, FALSE ); + TEST_SUPPORT.PUT_NAME( BUFFER.FIELD3, FALSE ); + TEST_SUPPORT.PUT_NAME( BUFFER.FIELD4, FALSE ); + + end PUT_BUFFER; + +-- +-- TEST_TASK +-- + + procedure TEST_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + COUNT : RTEMS.UNSIGNED32; + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.TASKS.WAKE_AFTER( 1 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + TEXT_IO.PUT_LINE( "Getting QID of message queue" ); + + loop + + RTEMS.MESSAGE_QUEUE.IDENT( + MPTEST.QUEUE_NAME( 1 ), + RTEMS.SEARCH_ALL_NODES, + MPTEST.QUEUE_ID( 1 ), + STATUS + ); + + exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS ); + + end loop; + + if TEST_SUPPORT.NODE = 2 then + + RTEMS.MESSAGE_QUEUE.DELETE( MPTEST.QUEUE_ID( 1 ), STATUS ); + + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.ILLEGAL_ON_REMOTE_OBJECT, + "MESSAGE_QUEUE_DELETE" + ); + + TEXT_IO.PUT_LINE( + "message_queue_delete correctly returned ILLEGAL_ON_REMOTE_OBJECT" + ); + + MPTEST.SEND_MESSAGES; + + MPTEST.RECEIVE_MESSAGES; + + TEXT_IO.PUT_LINE( "Flushing remote empty queue" ); + RTEMS.MESSAGE_QUEUE.FLUSH( MPTEST.QUEUE_ID( 1 ), COUNT, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_FLUSH" ); + UNSIGNED32_IO.PUT( COUNT, WIDTH => 1 ); + TEXT_IO.PUT_LINE( + " messages were flushed from remote empty queue" + ); + + TEXT_IO.PUT_LINE( + "Send messages to be flushed from remote queue" + ); + RTEMS.MESSAGE_QUEUE.SEND( + MPTEST.QUEUE_ID( 1 ), + MPTEST.BUFFER_1, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); + + TEXT_IO.PUT_LINE( "Flushing remote queue" ); + RTEMS.MESSAGE_QUEUE.FLUSH( MPTEST.QUEUE_ID( 1 ), COUNT, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_FLUSH" ); + UNSIGNED32_IO.PUT( COUNT, WIDTH => 1 ); + TEXT_IO.PUT_LINE( + " messages were flushed from the remote queue" + ); + + TEXT_IO.PUT_LINE( "Waiting for message queue to be deleted" ); + RTEMS.MESSAGE_QUEUE.RECEIVE( + MPTEST.QUEUE_ID( 1 ), + MPTEST.RECEIVE_BUFFER, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.OBJECT_WAS_DELETED, + "MESSAGE_QUEUE_FLUSH" + ); + + else + + MPTEST.RECEIVE_MESSAGES; + + MPTEST.SEND_MESSAGES; + + RTEMS.TASKS.WAKE_AFTER( + 5 * TEST_SUPPORT.TICKS_PER_SECOND, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + RTEMS.MESSAGE_QUEUE.DELETE( MPTEST.QUEUE_ID( 1 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_DELETE" ); + + end if; + + TEXT_IO.PUT_LINE( "*** END OF TEST 9 ***" ); + + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end TEST_TASK; + +end MPTEST; diff --git a/testsuites/ada/mptests/mp09/mptest.ads b/testsuites/ada/mptests/mp09/mptest.ads new file mode 100644 index 0000000000..360aebb491 --- /dev/null +++ b/testsuites/ada/mptests/mp09/mptest.ads @@ -0,0 +1,150 @@ +-- +-- MPTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 9 of the RTEMS +-- Multiprocessor 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; + +package MPTEST is + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS tasks created +-- by this test. +-- + + TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; + TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS message +-- queues created by this test. +-- + + QUEUE_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID; + QUEUE_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME; + +-- +-- The following are message buffers used to contain the test messages +-- and pointers to those buffers. +-- + + RECEIVE_BUFFER_AREA : RTEMS.BUFFER; + BUFFER_AREA_1 : RTEMS.BUFFER; + BUFFER_AREA_2 : RTEMS.BUFFER; + BUFFER_AREA_3 : RTEMS.BUFFER; + BUFFER_AREA_4 : RTEMS.BUFFER; + + RECEIVE_BUFFER : RTEMS.BUFFER_POINTER; + BUFFER_1 : RTEMS.BUFFER_POINTER; + BUFFER_2 : RTEMS.BUFFER_POINTER; + BUFFER_3 : RTEMS.BUFFER_POINTER; + BUFFER_4 : RTEMS.BUFFER_POINTER; + +-- +-- This variable contains the ID of the remote task with which this +-- test interacts. +-- + + REMOTE_TID : RTEMS.ID; + +-- +-- This variable contains the node on which the remote task with which +-- this test interacts resides. +-- + + REMOTE_NODE : RTEMS.UNSIGNED32; + +-- +-- The number of events to process per dot printed out. +-- + + PER_DOT : constant RTEMS.UNSIGNED32 := 100; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- SEND_MESSAGES +-- +-- This subprogram prints and sends a sequence of three test messages. +-- One of the messages is sent, one is urgent, and one is broadcast. +-- A one second pause is between each the sending of each message. +-- + + procedure SEND_MESSAGES; + +-- +-- RECEIVE_MESSAGES +-- +-- This subprogram receives and prints a sequence of three test messages. +-- + + procedure RECEIVE_MESSAGES; + +-- +-- FILL_BUFFER +-- +-- DESCRIPTION: +-- +-- This subprogram takes the SOURCE input string and places +-- up to the first sixteen characters of that string into +-- the message BUFFER. +-- + + procedure FILL_BUFFER ( + SOURCE : in STRING; + BUFFER : out RTEMS.BUFFER + ); + +-- +-- PUT_BUFFER +-- +-- DESCRIPTION: +-- +-- This subprogram prints the specified message BUFFER. +-- + + procedure PUT_BUFFER ( + BUFFER : in RTEMS.BUFFER + ); + +-- +-- TEST_TASK +-- +-- DESCRIPTION: +-- +-- This is the body of the RTEMS tasks which constitute this test. +-- + + procedure TEST_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TEST_TASK); + +end MPTEST; diff --git a/testsuites/ada/mptests/mp09/node1/Makefile.am b/testsuites/ada/mptests/mp09/node1/Makefile.am new file mode 100644 index 0000000000..54e44188f9 --- /dev/null +++ b/testsuites/ada/mptests/mp09/node1/Makefile.am @@ -0,0 +1,19 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +AM_ADAFLAGS += -I$(srcdir)/.. + +noinst_PROGRAMS = mp09_ada_mp09_node1 +mp09_ada_mp09_node1_SOURCES = mp09_node1.adb ../mptest.adb config.h +mp09_ada_mp09_node1_SOURCES += ../mptest.ads +mp09_ada_mp09_node1_SOURCES += ../../../support/init.c + +mp09_ada_mp09_node1$(EXEEXT): mp09_node1.adb ../mptest.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_mp09-node1.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/mptests/mp09/node1/ada_mp09-node1.scn b/testsuites/ada/mptests/mp09/node1/ada_mp09-node1.scn new file mode 100644 index 0000000000..167d6e18a5 --- /dev/null +++ b/testsuites/ada/mptests/mp09/node1/ada_mp09-node1.scn @@ -0,0 +1,20 @@ +*** TEST 9 -- NODE 1 *** +Creating Message Queue (Global) +Creating Test_task (local) +Starting Test_task (local) +Deleting initialization task +Getting QID of message queue +Receiving message ... +Received : 123456789012345 +Receiving message ... +Received : abcdefghijklmno +Receiving message ... +Received : ABCDEFGHIJKLMNO +Receiver delaying for a second +message_queue_send : 123456789012345 +Delaying for a second +message_queue_urgent : abcdefghijklmno +Delaying for a second +message_queue_broadcast : ABCDEFGHIJKLMNO +Delaying for a second +*** END OF TEST 9 *** diff --git a/testsuites/ada/mptests/mp09/node1/config.h b/testsuites/ada/mptests/mp09/node1/config.h new file mode 100644 index 0000000000..36c9d133e8 --- /dev/null +++ b/testsuites/ada/mptests/mp09/node1/config.h @@ -0,0 +1,21 @@ +/* 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_MP_APPLICATION +#define CONFIGURE_MP_NODE_NUMBER 1 + +#include "../config_base.h" + +/* end of include file */ diff --git a/testsuites/ada/mptests/mp09/node1/mp09_node1.adb b/testsuites/ada/mptests/mp09/node1/mp09_node1.adb new file mode 100644 index 0000000000..df2a6ab344 --- /dev/null +++ b/testsuites/ada/mptests/mp09/node1/mp09_node1.adb @@ -0,0 +1,56 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test MP09_NODE1 of the Multiprocessor +-- 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 MPTEST; +with TEST_SUPPORT; + +procedure MP09_NODE1 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, + MPTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end MP09_NODE1; + diff --git a/testsuites/ada/mptests/mp09/node2/Makefile.am b/testsuites/ada/mptests/mp09/node2/Makefile.am new file mode 100644 index 0000000000..e2ec626ab1 --- /dev/null +++ b/testsuites/ada/mptests/mp09/node2/Makefile.am @@ -0,0 +1,19 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +AM_ADAFLAGS += -I$(srcdir)/.. + +noinst_PROGRAMS = mp09_ada_mp09_node2 +mp09_ada_mp09_node2_SOURCES = mp09_node2.adb ../mptest.adb config.h +mp09_ada_mp09_node2_SOURCES += ../mptest.ads +mp09_ada_mp09_node2_SOURCES += ../../../support/init.c + +mp09_ada_mp09_node2$(EXEEXT): mp09_node2.adb ../mptest.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_mp09-node2.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/mptests/mp09/node2/ada_mp09-node2.scn b/testsuites/ada/mptests/mp09/node2/ada_mp09-node2.scn new file mode 100644 index 0000000000..4cd8a7bff7 --- /dev/null +++ b/testsuites/ada/mptests/mp09/node2/ada_mp09-node2.scn @@ -0,0 +1,26 @@ +*** TEST 9 -- NODE 2 *** +Creating Test_task (local) +Starting Test_task (local) +Deleting initialization task +Getting QID of message queue +message_queue_delete correctly returned ILLEGAL_ON_REMOTE_OBJECT +message_queue_send : 123456789012345 +Delaying for a second +message_queue_urgent : abcdefghijklmno +Delaying for a second +message_queue_broadcast : ABCDEFGHIJKLMNO +Delaying for a second +Receiving message ... +Received : 123456789012345 +Receiving message ... +Received : abcdefghijklmno +Receiving message ... +Received : ABCDEFGHIJKLMNO +Receiver delaying for a second +Flushing remote empty queue +0 messages were flushed from remote empty queue +Send messages to be flushed from remote queue +Flushing remote queue +1 messages were flushed from the remote queue +Waiting for message queue to be deleted +*** END OF TEST 9 *** diff --git a/testsuites/ada/mptests/mp09/node2/config.h b/testsuites/ada/mptests/mp09/node2/config.h new file mode 100644 index 0000000000..47edf66149 --- /dev/null +++ b/testsuites/ada/mptests/mp09/node2/config.h @@ -0,0 +1,21 @@ +/* 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_MP_APPLICATION +#define CONFIGURE_MP_NODE_NUMBER 2 + +#include "../config_base.h" + +/* end of include file */ diff --git a/testsuites/ada/mptests/mp09/node2/mp09_node2.adb b/testsuites/ada/mptests/mp09/node2/mp09_node2.adb new file mode 100644 index 0000000000..adedcd20c6 --- /dev/null +++ b/testsuites/ada/mptests/mp09/node2/mp09_node2.adb @@ -0,0 +1,56 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test MP09_NODE2 of the Multiprocessor +-- 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 MPTEST; +with TEST_SUPPORT; + +procedure MP09_NODE2 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, + MPTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end MP09_NODE2; + diff --git a/testsuites/ada/mptests/mp10/Makefile.am b/testsuites/ada/mptests/mp10/Makefile.am new file mode 100644 index 0000000000..d1dad5313a --- /dev/null +++ b/testsuites/ada/mptests/mp10/Makefile.am @@ -0,0 +1,4 @@ +_SUBDIRS = node1 node2 + +include $(top_srcdir)/../automake/subdirs.am +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/mptests/mp10/config_base.h b/testsuites/ada/mptests/mp10/config_base.h new file mode 100644 index 0000000000..c1b8f24e86 --- /dev/null +++ b/testsuites/ada/mptests/mp10/config_base.h @@ -0,0 +1,28 @@ +/* config_base.h + * + * This include file defines all of the Configuration Table for this test + * EXCEPT the NODE NUMBER. + * + * 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. + */ + + + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_TASKS 2 + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/mptests/mp10/mptest.adb b/testsuites/ada/mptests/mp10/mptest.adb new file mode 100644 index 0000000000..d773976a3e --- /dev/null +++ b/testsuites/ada/mptests/mp10/mptest.adb @@ -0,0 +1,295 @@ +-- +-- MPTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation for Test 10 of the RTEMS +-- Multiprocessor 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 INTERFACES; use INTERFACES; +with RTEMS; +with RTEMS.MESSAGE_QUEUE; +with RTEMS.SEMAPHORE; +with RTEMS.TASKS; +with TEST_SUPPORT; +with TEXT_IO; +with UNSIGNED32_IO; + +package body MPTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT( "*** TEST 10 -- NODE " ); + UNSIGNED32_IO.PUT( + TEST_SUPPORT.NODE, + WIDTH => 1 + ); + TEXT_IO.PUT_LINE( " ***" ); + + + MPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); + MPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' ); + MPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'S', 'A', '3', ' ' ); + + MPTEST.QUEUE_NAME( 1 ) := RTEMS.BUILD_NAME( 'M', 'S', 'G', ' ' ); + + MPTEST.SEMAPHORE_NAME( 1 ) := RTEMS.BUILD_NAME( 'S', 'E', 'M', ' ' ); + + if TEST_SUPPORT.NODE = 1 then + + TEXT_IO.PUT_LINE( "Creating Message Queue (Global)" ); + RTEMS.MESSAGE_QUEUE.CREATE( + MPTEST.QUEUE_NAME( 1 ), + 3, + RTEMS.GLOBAL + RTEMS.LIMIT, + MPTEST.QUEUE_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_CREATE" ); + + TEXT_IO.PUT_LINE( "Creating Semaphore (Global)" ); + RTEMS.SEMAPHORE.CREATE( + MPTEST.SEMAPHORE_NAME( 1 ), + 0, + RTEMS.GLOBAL + RTEMS.PRIORITY, + MPTEST.SEMAPHORE_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE" ); + + RTEMS.TASKS.WAKE_AFTER( 10 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + else + + TEXT_IO.PUT_LINE( "Creating Test_task 1 (local)" ); + RTEMS.TASKS.CREATE( + MPTEST.TASK_NAME( 1 ), + 1, + 2048, + RTEMS.TIMESLICE, + RTEMS.DEFAULT_ATTRIBUTES, + MPTEST.TASK_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); + + TEXT_IO.PUT_LINE( "Starting Test_task 1 (local)" ); + RTEMS.TASKS.START( + MPTEST.TASK_ID( 1 ), + MPTEST.TEST_TASK_1'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); + + TEXT_IO.PUT_LINE( "Creating Test_task 2 (local)" ); + RTEMS.TASKS.CREATE( + MPTEST.TASK_NAME( 2 ), + 1, + 2048, + RTEMS.TIMESLICE, + RTEMS.DEFAULT_ATTRIBUTES, + MPTEST.TASK_ID( 2 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); + + TEXT_IO.PUT_LINE( "Starting Test_task 2 (local)" ); + RTEMS.TASKS.START( + MPTEST.TASK_ID( 2 ), + MPTEST.TEST_TASK_2'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); + + TEXT_IO.PUT_LINE( "Creating Test_task 3 (local)" ); + RTEMS.TASKS.CREATE( + MPTEST.TASK_NAME( 3 ), + 1, + 2048, + RTEMS.TIMESLICE, + RTEMS.DEFAULT_ATTRIBUTES, + MPTEST.TASK_ID( 3 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); + + TEXT_IO.PUT_LINE( "Starting Test_task 3 (local)" ); + RTEMS.TASKS.START( + MPTEST.TASK_ID( 3 ), + MPTEST.TEST_TASK_3'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); + + TEXT_IO.PUT_LINE( "Sleeping for 1 second ..." ); + RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + TEXT_IO.PUT_LINE( "Deleting Test_task 2" ); + RTEMS.TASKS.DELETE( MPTEST.TASK_ID( 2 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF 2" ); + + TEXT_IO.PUT_LINE( "Deleting Test_task 1" ); + RTEMS.TASKS.DELETE( MPTEST.TASK_ID( 1 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF 1" ); + + TEXT_IO.PUT_LINE( "Restarting Test_task 3" ); + RTEMS.TASKS.RESTART( MPTEST.TASK_ID( 3 ), 1, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESTART OF 3" ); + + end if; + + TEXT_IO.PUT_LINE( "*** END OF TEST 10 ***" ); + + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end INIT; + +-- +-- TEST_TASK_1 +-- + + procedure TEST_TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + COUNT : RTEMS.UNSIGNED32; + RECEIVE_BUFFER_AREA : RTEMS.BUFFER; + RECEIVE_BUFFER : RTEMS.BUFFER_POINTER; + STATUS : RTEMS.STATUS_CODES; + begin + + RECEIVE_BUFFER := + RTEMS.TO_BUFFER_POINTER( RECEIVE_BUFFER_AREA'ADDRESS ); + + TEXT_IO.PUT_LINE( "Getting QID of message queue" ); + + loop + + RTEMS.MESSAGE_QUEUE.IDENT( + MPTEST.QUEUE_NAME( 1 ), + RTEMS.SEARCH_ALL_NODES, + MPTEST.QUEUE_ID( 1 ), + STATUS + ); + + exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS ); + + end loop; + + TEXT_IO.PUT_LINE( "Attempting to receive message ..." ); + RTEMS.MESSAGE_QUEUE.RECEIVE( + MPTEST.QUEUE_ID( 1 ), + RECEIVE_BUFFER, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" ); + + end TEST_TASK_1; + +-- +-- TEST_TASK_2 +-- + + procedure TEST_TASK_2 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.PUT_LINE( "Getting SMID of semaphore" ); + + loop + + RTEMS.SEMAPHORE.IDENT( + MPTEST.SEMAPHORE_NAME( 1 ), + RTEMS.SEARCH_ALL_NODES, + MPTEST.SEMAPHORE_ID( 1 ), + STATUS + ); + + exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS ); + + end loop; + + TEXT_IO.PUT_LINE( "Attempting to acquire semaphore ..." ); + RTEMS.SEMAPHORE.OBTAIN( + MPTEST.SEMAPHORE_ID( 1 ), + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN" ); + + end TEST_TASK_2; + +-- +-- TEST_TASK_3 +-- + + procedure TEST_TASK_3 ( + RESTART : in RTEMS.TASKS.ARGUMENT + ) is + STATUS : RTEMS.STATUS_CODES; + begin + + if RESTART = 1 then + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE" ); + + end if; + + TEXT_IO.PUT_LINE( "Getting SMID of semaphore" ); + + loop + + RTEMS.SEMAPHORE.IDENT( + MPTEST.SEMAPHORE_NAME( 1 ), + RTEMS.SEARCH_ALL_NODES, + MPTEST.SEMAPHORE_ID( 1 ), + STATUS + ); + + exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS ); + + end loop; + + TEXT_IO.PUT_LINE( "Attempting to acquire semaphore ..." ); + RTEMS.SEMAPHORE.OBTAIN( + MPTEST.SEMAPHORE_ID( 1 ), + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN" ); + + end TEST_TASK_3; + +end MPTEST; diff --git a/testsuites/ada/mptests/mp10/mptest.ads b/testsuites/ada/mptests/mp10/mptest.ads new file mode 100644 index 0000000000..05764ebf0b --- /dev/null +++ b/testsuites/ada/mptests/mp10/mptest.ads @@ -0,0 +1,122 @@ +-- +-- MPTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 10 of the RTEMS +-- Multiprocessor 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; + +package MPTEST is + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS tasks created +-- by this test. +-- + + TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; + TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS message +-- queues created by this test. +-- + + QUEUE_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID; + QUEUE_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME; + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS semaphore +-- created by this test. +-- + + SEMAPHORE_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID; + SEMAPHORE_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME; + +-- +-- This variable contains the ID of the remote task with which this +-- test interacts. +-- + + REMOTE_TID : RTEMS.ID; + +-- +-- This variable contains the node on which the remote task with which +-- this test interacts resides. +-- + + REMOTE_NODE : RTEMS.UNSIGNED32; + +-- +-- The number of events to process per dot printed out. +-- + + PER_DOT : constant RTEMS.UNSIGNED32 := 100; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- TEST_TASK_1 +-- +-- DESCRIPTION: +-- +-- This is the body of one of the RTEMS tasks which constitute this test. +-- + + procedure TEST_TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TEST_TASK_1); + +-- +-- TEST_TASK_2 +-- +-- DESCRIPTION: +-- +-- This is the body of one of the RTEMS tasks which constitute this test. +-- + + procedure TEST_TASK_2 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TEST_TASK_2); + +-- +-- TEST_TASK_3 +-- +-- DESCRIPTION: +-- +-- This is the body of one of the RTEMS tasks which constitute this test. +-- + + procedure TEST_TASK_3 ( + RESTART : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TEST_TASK_3); + +end MPTEST; diff --git a/testsuites/ada/mptests/mp10/node1/Makefile.am b/testsuites/ada/mptests/mp10/node1/Makefile.am new file mode 100644 index 0000000000..f682f3275e --- /dev/null +++ b/testsuites/ada/mptests/mp10/node1/Makefile.am @@ -0,0 +1,19 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +AM_ADAFLAGS += -I$(srcdir)/.. + +noinst_PROGRAMS = mp10_ada_mp10_node1 +mp10_ada_mp10_node1_SOURCES = mp10_node1.adb ../mptest.adb config.h +mp10_ada_mp10_node1_SOURCES += ../mptest.ads +mp10_ada_mp10_node1_SOURCES += ../../../support/init.c + +mp10_ada_mp10_node1$(EXEEXT): mp10_node1.adb ../mptest.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_mp10-node1.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/mptests/mp10/node1/ada_mp10-node1.scn b/testsuites/ada/mptests/mp10/node1/ada_mp10-node1.scn new file mode 100644 index 0000000000..deeafc0a9a --- /dev/null +++ b/testsuites/ada/mptests/mp10/node1/ada_mp10-node1.scn @@ -0,0 +1,4 @@ +*** TEST 10 -- NODE 1 *** +Creating Message Queue (Global) +Creating Semaphore (Global) +*** END OF TEST 10 *** diff --git a/testsuites/ada/mptests/mp10/node1/config.h b/testsuites/ada/mptests/mp10/node1/config.h new file mode 100644 index 0000000000..36c9d133e8 --- /dev/null +++ b/testsuites/ada/mptests/mp10/node1/config.h @@ -0,0 +1,21 @@ +/* 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_MP_APPLICATION +#define CONFIGURE_MP_NODE_NUMBER 1 + +#include "../config_base.h" + +/* end of include file */ diff --git a/testsuites/ada/mptests/mp10/node1/mp10_node1.adb b/testsuites/ada/mptests/mp10/node1/mp10_node1.adb new file mode 100644 index 0000000000..9174d74a7d --- /dev/null +++ b/testsuites/ada/mptests/mp10/node1/mp10_node1.adb @@ -0,0 +1,56 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test MP10_NODE1 of the Multiprocessor +-- 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 MPTEST; +with TEST_SUPPORT; + +procedure MP10_NODE1 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, + MPTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end MP10_NODE1; + diff --git a/testsuites/ada/mptests/mp10/node2/Makefile.am b/testsuites/ada/mptests/mp10/node2/Makefile.am new file mode 100644 index 0000000000..cc6335b4e7 --- /dev/null +++ b/testsuites/ada/mptests/mp10/node2/Makefile.am @@ -0,0 +1,19 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +AM_ADAFLAGS += -I$(srcdir)/.. + +noinst_PROGRAMS = mp10_ada_mp10_node2 +mp10_ada_mp10_node2_SOURCES = mp10_node2.adb ../mptest.adb config.h +mp10_ada_mp10_node2_SOURCES += ../mptest.ads +mp10_ada_mp10_node2_SOURCES += ../../../support/init.c + +mp10_ada_mp10_node2$(EXEEXT): mp10_node2.adb ../mptest.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_mp10-node2.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/mptests/mp10/node2/ada_mp10-node2.scn b/testsuites/ada/mptests/mp10/node2/ada_mp10-node2.scn new file mode 100644 index 0000000000..c0337fdacf --- /dev/null +++ b/testsuites/ada/mptests/mp10/node2/ada_mp10-node2.scn @@ -0,0 +1,18 @@ +*** TEST 10 -- NODE 2 *** +Creating Test_task 1 (local) +Starting Test_task 1 (local) +Creating Test_task 2 (local) +Starting Test_task 2 (local) +Creating Test_task 3 (local) +Starting Test_task 3 (local) +Sleeping for 1 second ... +Getting QID of message queue +Attempting to receive message ... +Getting SMID of semaphore +Attempting to acquire semaphore ... +Getting SMID of semaphore +Attempting to acquire semaphore ... +Deleting Test_task 2 +Deleting Test_task 1 +Restarting Test_task 3 +*** END OF TEST 10 *** diff --git a/testsuites/ada/mptests/mp10/node2/config.h b/testsuites/ada/mptests/mp10/node2/config.h new file mode 100644 index 0000000000..47edf66149 --- /dev/null +++ b/testsuites/ada/mptests/mp10/node2/config.h @@ -0,0 +1,21 @@ +/* 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_MP_APPLICATION +#define CONFIGURE_MP_NODE_NUMBER 2 + +#include "../config_base.h" + +/* end of include file */ diff --git a/testsuites/ada/mptests/mp10/node2/mp10_node2.adb b/testsuites/ada/mptests/mp10/node2/mp10_node2.adb new file mode 100644 index 0000000000..ee7bb6bcc8 --- /dev/null +++ b/testsuites/ada/mptests/mp10/node2/mp10_node2.adb @@ -0,0 +1,56 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test MP10_NODE2 of the Multiprocessor +-- 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 MPTEST; +with TEST_SUPPORT; + +procedure MP10_NODE2 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, + MPTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end MP10_NODE2; + diff --git a/testsuites/ada/mptests/mp11/Makefile.am b/testsuites/ada/mptests/mp11/Makefile.am new file mode 100644 index 0000000000..d1dad5313a --- /dev/null +++ b/testsuites/ada/mptests/mp11/Makefile.am @@ -0,0 +1,4 @@ +_SUBDIRS = node1 node2 + +include $(top_srcdir)/../automake/subdirs.am +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/mptests/mp11/config_base.h b/testsuites/ada/mptests/mp11/config_base.h new file mode 100644 index 0000000000..c1b8f24e86 --- /dev/null +++ b/testsuites/ada/mptests/mp11/config_base.h @@ -0,0 +1,28 @@ +/* config_base.h + * + * This include file defines all of the Configuration Table for this test + * EXCEPT the NODE NUMBER. + * + * 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. + */ + + + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_TASKS 2 + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/mptests/mp11/mptest.adb b/testsuites/ada/mptests/mp11/mptest.adb new file mode 100644 index 0000000000..9ad9f52fca --- /dev/null +++ b/testsuites/ada/mptests/mp11/mptest.adb @@ -0,0 +1,136 @@ +-- +-- MPTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation for Test 11 of the RTEMS +-- Multiprocessor 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 INTERFACES; use INTERFACES; +with RTEMS; +with RTEMS.MESSAGE_QUEUE; +with RTEMS.PARTITION; +with RTEMS.SEMAPHORE; +with RTEMS.TASKS; +with TEST_SUPPORT; +with TEXT_IO; +with UNSIGNED32_IO; + +package body MPTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT( "*** TEST 11 -- NODE " ); + UNSIGNED32_IO.PUT( + TEST_SUPPORT.NODE, + WIDTH => 1 + ); + TEXT_IO.PUT_LINE( " ***" ); + + MPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( '1', '1', '1', ' ' ); + MPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( '2', '2', '2', ' ' ); + + MPTEST.QUEUE_NAME( 1 ) := RTEMS.BUILD_NAME( 'M', 'S', 'G', ' ' ); + + MPTEST.SEMAPHORE_NAME( 1 ) := RTEMS.BUILD_NAME( 'S', 'E', 'M', ' ' ); + + MPTEST.PARTITION_NAME( 1 ) := RTEMS.BUILD_NAME( 'P', 'A', 'R', ' ' ); + + if TEST_SUPPORT.NODE = 1 then + + TEXT_IO.PUT_LINE( "Attempting to create Test_task (Global)" ); + RTEMS.TASKS.CREATE( + MPTEST.TASK_NAME( 1 ), + 1, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.GLOBAL, + MPTEST.TASK_ID( 1 ), + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.TOO_MANY, + "TASK_CREATE" + ); + TEXT_IO.PUT_LINE( "task_create correctly returned TOO_MANY" ); + + TEXT_IO.PUT_LINE( "Attempting to create Message Queue (Global)" ); + RTEMS.MESSAGE_QUEUE.CREATE( + MPTEST.QUEUE_NAME( 1 ), + 3, + RTEMS.GLOBAL + RTEMS.LIMIT, + MPTEST.QUEUE_ID( 1 ), + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.TOO_MANY, + "MESSAGE_QUEUE_CREATE" + ); + TEXT_IO.PUT_LINE( + "message_queue_create correctly returned TOO_MANY" + ); + + TEXT_IO.PUT_LINE( "Creating Semaphore (Global)" ); + RTEMS.SEMAPHORE.CREATE( + MPTEST.SEMAPHORE_NAME( 1 ), + 1, + RTEMS.GLOBAL, + MPTEST.SEMAPHORE_ID( 1 ), + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.TOO_MANY, + "SEMAPHORE_CREATE" + ); + TEXT_IO.PUT_LINE( "semaphore_create correctly returned TOO_MANY" ); + + TEXT_IO.PUT_LINE( "Creating Partition (Global)" ); + RTEMS.PARTITION.CREATE( + MPTEST.PARTITION_NAME( 1 ), + MPTEST.PARTITION_AREA( 0 )'ADDRESS, + 128, + 64, + RTEMS.GLOBAL, + MPTEST.PARTITION_ID( 1 ), + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.TOO_MANY, + "PARTITION_CREATE" + ); + TEXT_IO.PUT_LINE( "partition_create correctly returned TOO_MANY" ); + + end if; + + TEXT_IO.PUT_LINE( "*** END OF TEST 11 ***" ); + + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end INIT; + +end MPTEST; diff --git a/testsuites/ada/mptests/mp11/mptest.ads b/testsuites/ada/mptests/mp11/mptest.ads new file mode 100644 index 0000000000..2899df8e34 --- /dev/null +++ b/testsuites/ada/mptests/mp11/mptest.ads @@ -0,0 +1,79 @@ +-- +-- MPTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 11 of the RTEMS +-- Multiprocessor 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; + +package MPTEST is + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS tasks created +-- by this test. +-- + + TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; + TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS message +-- queues created by this test. +-- + + QUEUE_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID; + QUEUE_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME; + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS semaphore +-- created by this test. +-- + + SEMAPHORE_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID; + SEMAPHORE_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME; + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS partition +-- created by this test. +-- + + PARTITION_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID; + PARTITION_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME; + +-- +-- This is the area used for the partition. +-- + + PARTITION_AREA : + array ( RTEMS.UNSIGNED32 range 0 .. 1023 ) of RTEMS.UNSIGNED8; + for PARTITION_AREA'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +end MPTEST; diff --git a/testsuites/ada/mptests/mp11/node1/Makefile.am b/testsuites/ada/mptests/mp11/node1/Makefile.am new file mode 100644 index 0000000000..0511699d9f --- /dev/null +++ b/testsuites/ada/mptests/mp11/node1/Makefile.am @@ -0,0 +1,19 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +AM_ADAFLAGS += -I$(srcdir)/.. + +noinst_PROGRAMS = mp11_ada_mp11_node1 +mp11_ada_mp11_node1_SOURCES = mp11_node1.adb ../mptest.adb config.h +mp11_ada_mp11_node1_SOURCES += ../mptest.ads +mp11_ada_mp11_node1_SOURCES += ../../../support/init.c + +mp11_ada_mp11_node1$(EXEEXT): mp11_node1.adb ../mptest.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_mp11-node1.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/mptests/mp11/node1/ada_mp11-node1.scn b/testsuites/ada/mptests/mp11/node1/ada_mp11-node1.scn new file mode 100644 index 0000000000..013426bf91 --- /dev/null +++ b/testsuites/ada/mptests/mp11/node1/ada_mp11-node1.scn @@ -0,0 +1,10 @@ +*** TEST 11 -- NODE 1 *** +Attempting to create Test_task (Global) +task_create correctly returned TOO_MANY +Attempting to create Message Queue (Global) +message_queue_create correctly returned TOO_MANY +Creating Semaphore (Global) +semaphore_create correctly returned TOO_MANY +Creating Partition (Global) +partition_create correctly returned TOO_MANY +*** END OF TEST 11 *** diff --git a/testsuites/ada/mptests/mp11/node1/config.h b/testsuites/ada/mptests/mp11/node1/config.h new file mode 100644 index 0000000000..36c9d133e8 --- /dev/null +++ b/testsuites/ada/mptests/mp11/node1/config.h @@ -0,0 +1,21 @@ +/* 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_MP_APPLICATION +#define CONFIGURE_MP_NODE_NUMBER 1 + +#include "../config_base.h" + +/* end of include file */ diff --git a/testsuites/ada/mptests/mp11/node1/mp11_node1.adb b/testsuites/ada/mptests/mp11/node1/mp11_node1.adb new file mode 100644 index 0000000000..859cbc4ac8 --- /dev/null +++ b/testsuites/ada/mptests/mp11/node1/mp11_node1.adb @@ -0,0 +1,56 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test MP11_NODE1 of the Multiprocessor +-- 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 MPTEST; +with TEST_SUPPORT; + +procedure MP11_NODE1 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, + MPTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end MP11_NODE1; + diff --git a/testsuites/ada/mptests/mp11/node2/Makefile.am b/testsuites/ada/mptests/mp11/node2/Makefile.am new file mode 100644 index 0000000000..7055fcc093 --- /dev/null +++ b/testsuites/ada/mptests/mp11/node2/Makefile.am @@ -0,0 +1,19 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +AM_ADAFLAGS += -I$(srcdir)/.. + +noinst_PROGRAMS = mp11_ada_mp11_node2 +mp11_ada_mp11_node2_SOURCES = mp11_node2.adb ../mptest.adb config.h +mp11_ada_mp11_node2_SOURCES += ../mptest.ads +mp11_ada_mp11_node2_SOURCES += ../../../support/init.c + +mp11_ada_mp11_node2$(EXEEXT): mp11_node2.adb ../mptest.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_mp11-node2.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/mptests/mp11/node2/ada_mp11-node2.scn b/testsuites/ada/mptests/mp11/node2/ada_mp11-node2.scn new file mode 100644 index 0000000000..49bd8a3219 --- /dev/null +++ b/testsuites/ada/mptests/mp11/node2/ada_mp11-node2.scn @@ -0,0 +1,2 @@ +*** TEST 11 -- NODE 2 *** +*** END OF TEST 11 *** diff --git a/testsuites/ada/mptests/mp11/node2/config.h b/testsuites/ada/mptests/mp11/node2/config.h new file mode 100644 index 0000000000..47edf66149 --- /dev/null +++ b/testsuites/ada/mptests/mp11/node2/config.h @@ -0,0 +1,21 @@ +/* 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_MP_APPLICATION +#define CONFIGURE_MP_NODE_NUMBER 2 + +#include "../config_base.h" + +/* end of include file */ diff --git a/testsuites/ada/mptests/mp11/node2/mp11_node2.adb b/testsuites/ada/mptests/mp11/node2/mp11_node2.adb new file mode 100644 index 0000000000..601b21574b --- /dev/null +++ b/testsuites/ada/mptests/mp11/node2/mp11_node2.adb @@ -0,0 +1,56 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test MP11_NODE2 of the Multiprocessor +-- 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 MPTEST; +with TEST_SUPPORT; + +procedure MP11_NODE2 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, + MPTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end MP11_NODE2; + diff --git a/testsuites/ada/mptests/mp12/Makefile.am b/testsuites/ada/mptests/mp12/Makefile.am new file mode 100644 index 0000000000..d1dad5313a --- /dev/null +++ b/testsuites/ada/mptests/mp12/Makefile.am @@ -0,0 +1,4 @@ +_SUBDIRS = node1 node2 + +include $(top_srcdir)/../automake/subdirs.am +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/mptests/mp12/config_base.h b/testsuites/ada/mptests/mp12/config_base.h new file mode 100644 index 0000000000..c1b8f24e86 --- /dev/null +++ b/testsuites/ada/mptests/mp12/config_base.h @@ -0,0 +1,28 @@ +/* config_base.h + * + * This include file defines all of the Configuration Table for this test + * EXCEPT the NODE NUMBER. + * + * 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. + */ + + + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_TASKS 2 + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/mptests/mp12/mptest.adb b/testsuites/ada/mptests/mp12/mptest.adb new file mode 100644 index 0000000000..74dd2e86bd --- /dev/null +++ b/testsuites/ada/mptests/mp12/mptest.adb @@ -0,0 +1,148 @@ +-- +-- MPTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation for Test 12 of the RTEMS +-- Multiprocessor 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 INTERFACES; use INTERFACES; +with RTEMS; +with RTEMS.PARTITION; +with RTEMS.TASKS; +with TEST_SUPPORT; +with TEXT_IO; +with UNSIGNED32_IO; + +package body MPTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + BUFFER_ADDRESS : RTEMS.ADDRESS; + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT( "*** TEST 12 -- NODE " ); + UNSIGNED32_IO.PUT( + TEST_SUPPORT.NODE, + WIDTH => 1 + ); + TEXT_IO.PUT_LINE( " ***" ); + + MPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( '1', '1', '1', ' ' ); + MPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( '2', '2', '2', ' ' ); + + MPTEST.PARTITION_NAME( 1 ) := RTEMS.BUILD_NAME( 'P', 'A', 'R', ' ' ); + + TEXT_IO.PUT_LINE( "Got to the initialization task" ); + + if TEST_SUPPORT.NODE = 2 then + + RTEMS.TASKS.WAKE_AFTER( 1 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + TEXT_IO.PUT_LINE( "Getting ID of remote Partition (Global)" ); + + loop + + RTEMS.PARTITION.IDENT( + MPTEST.PARTITION_NAME( 1 ), + RTEMS.SEARCH_ALL_NODES, + MPTEST.PARTITION_ID( 1 ), + STATUS + ); + + exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS ); + + end loop; + + TEXT_IO.PUT_LINE( + "Attempting to delete remote Partition (Global)" + ); + + RTEMS.PARTITION.DELETE( MPTEST.PARTITION_ID( 1 ), STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.ILLEGAL_ON_REMOTE_OBJECT, + "PARTITION_DELETE" + ); + + TEXT_IO.PUT_LINE( + "partition_delete correctly returned ILLEGAL_ON_REMOTE_OBJECT!!" + ); + + TEXT_IO.PUT_LINE( "Obtaining a buffer from the global partition" ); + + RTEMS.PARTITION.GET_BUFFER( + MPTEST.PARTITION_ID( 1 ), + BUFFER_ADDRESS, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_GET_BUFFER" ); + TEXT_IO.PUT( "Address returned was : " ); + UNSIGNED32_IO.PUT( + RTEMS.SUBTRACT( BUFFER_ADDRESS, RTEMS.NULL_ADDRESS ), + WIDTH => 8, + BASE => 16 + ); + TEXT_IO.NEW_LINE; + + RTEMS.PARTITION.RETURN_BUFFER( + MPTEST.PARTITION_ID( 1 ), + BUFFER_ADDRESS, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_RETURN_BUFFER" ); + + RTEMS.TASKS.WAKE_AFTER( 2 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + else + + TEXT_IO.PUT_LINE( "Creating Partition (Global)" ); + RTEMS.PARTITION.CREATE( + MPTEST.PARTITION_NAME( 1 ), + MPTEST.PARTITION_AREA( 0 )'ADDRESS, + 128, + 64, + RTEMS.GLOBAL, + MPTEST.PARTITION_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_CREATE" ); + + TEXT_IO.PUT_LINE( "Sleeping for three seconds" ); + RTEMS.TASKS.WAKE_AFTER( 3 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + TEXT_IO.PUT_LINE( "Deleting Partition (Global)" ); + RTEMS.PARTITION.DELETE( MPTEST.PARTITION_ID( 1 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_DELETE" ); + + end if; + + TEXT_IO.PUT_LINE( "*** END OF TEST 12 ***" ); + + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end INIT; + +end MPTEST; diff --git a/testsuites/ada/mptests/mp12/mptest.ads b/testsuites/ada/mptests/mp12/mptest.ads new file mode 100644 index 0000000000..dd33b558bb --- /dev/null +++ b/testsuites/ada/mptests/mp12/mptest.ads @@ -0,0 +1,77 @@ +-- +-- MPTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 12 of the RTEMS +-- Multiprocessor 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; + +package MPTEST is + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS tasks created +-- by this test. +-- + + TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; + TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS semaphore +-- created by this test. +-- + + PARTITION_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID; + PARTITION_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME; + +-- +-- This variable contains the ID of the remote task with which this +-- test interacts. +-- + + REMOTE_TID : RTEMS.ID; + +-- +-- This variable contains the node on which the remote task with which +-- this test interacts resides. +-- + + REMOTE_NODE : RTEMS.UNSIGNED32; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- This is the area used for the partition. +-- + + PARTITION_AREA : + array ( RTEMS.UNSIGNED32 range 0 .. 1023 ) of RTEMS.UNSIGNED8; + for PARTITION_AREA'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT; + +end MPTEST; diff --git a/testsuites/ada/mptests/mp12/node1/Makefile.am b/testsuites/ada/mptests/mp12/node1/Makefile.am new file mode 100644 index 0000000000..9daa6a0c71 --- /dev/null +++ b/testsuites/ada/mptests/mp12/node1/Makefile.am @@ -0,0 +1,19 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +AM_ADAFLAGS += -I$(srcdir)/.. + +noinst_PROGRAMS = mp12_ada_mp12_node1 +mp12_ada_mp12_node1_SOURCES = mp12_node1.adb ../mptest.adb config.h +mp12_ada_mp12_node1_SOURCES += ../mptest.ads +mp12_ada_mp12_node1_SOURCES += ../../../support/init.c + +mp12_ada_mp12_node1$(EXEEXT): mp12_node1.adb ../mptest.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_mp12-node1.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/mptests/mp12/node1/ada_mp12-node1.scn b/testsuites/ada/mptests/mp12/node1/ada_mp12-node1.scn new file mode 100644 index 0000000000..40646722eb --- /dev/null +++ b/testsuites/ada/mptests/mp12/node1/ada_mp12-node1.scn @@ -0,0 +1,6 @@ +*** TEST 12 -- NODE 1 *** +Got to the initialization task +Creating Partition (Global) +Sleeping for three seconds +Deleting Partition (Global) +*** END OF TEST 12 *** diff --git a/testsuites/ada/mptests/mp12/node1/config.h b/testsuites/ada/mptests/mp12/node1/config.h new file mode 100644 index 0000000000..36c9d133e8 --- /dev/null +++ b/testsuites/ada/mptests/mp12/node1/config.h @@ -0,0 +1,21 @@ +/* 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_MP_APPLICATION +#define CONFIGURE_MP_NODE_NUMBER 1 + +#include "../config_base.h" + +/* end of include file */ diff --git a/testsuites/ada/mptests/mp12/node1/mp12_node1.adb b/testsuites/ada/mptests/mp12/node1/mp12_node1.adb new file mode 100644 index 0000000000..04c049cb5d --- /dev/null +++ b/testsuites/ada/mptests/mp12/node1/mp12_node1.adb @@ -0,0 +1,56 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test MP12_NODE1 of the Multiprocessor +-- 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 MPTEST; +with TEST_SUPPORT; + +procedure MP12_NODE1 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, + MPTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end MP12_NODE1; + diff --git a/testsuites/ada/mptests/mp12/node2/Makefile.am b/testsuites/ada/mptests/mp12/node2/Makefile.am new file mode 100644 index 0000000000..b3e8df357c --- /dev/null +++ b/testsuites/ada/mptests/mp12/node2/Makefile.am @@ -0,0 +1,19 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +AM_ADAFLAGS += -I$(srcdir)/.. + +noinst_PROGRAMS = mp12_ada_mp12_node2 +mp12_ada_mp12_node2_SOURCES = mp12_node2.adb ../mptest.adb config.h +mp12_ada_mp12_node2_SOURCES += ../mptest.ads +mp12_ada_mp12_node2_SOURCES += ../../../support/init.c + +mp12_ada_mp12_node2$(EXEEXT): mp12_node2.adb ../mptest.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_mp12-node2.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/mptests/mp12/node2/ada_mp12-node2.scn b/testsuites/ada/mptests/mp12/node2/ada_mp12-node2.scn new file mode 100644 index 0000000000..2189ae9959 --- /dev/null +++ b/testsuites/ada/mptests/mp12/node2/ada_mp12-node2.scn @@ -0,0 +1,9 @@ +*** TEST 12 -- NODE 2 *** +Got to the initialization task +Getting ID of remote Partition (Global) +Attempting to delete remote Partition (Global) +partition_delete correctly returned ILLEGAL_ON_REMOTE_OBJECT!! +Obtaining a buffer from the global partition +Address returned was : 0x200f0000 +NOTE: Address printed will probably differ!!! +*** END OF TEST 12 *** diff --git a/testsuites/ada/mptests/mp12/node2/config.h b/testsuites/ada/mptests/mp12/node2/config.h new file mode 100644 index 0000000000..47edf66149 --- /dev/null +++ b/testsuites/ada/mptests/mp12/node2/config.h @@ -0,0 +1,21 @@ +/* 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_MP_APPLICATION +#define CONFIGURE_MP_NODE_NUMBER 2 + +#include "../config_base.h" + +/* end of include file */ diff --git a/testsuites/ada/mptests/mp12/node2/mp12_node2.adb b/testsuites/ada/mptests/mp12/node2/mp12_node2.adb new file mode 100644 index 0000000000..0f046593d6 --- /dev/null +++ b/testsuites/ada/mptests/mp12/node2/mp12_node2.adb @@ -0,0 +1,56 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test MP12_NODE2 of the Multiprocessor +-- 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 MPTEST; +with TEST_SUPPORT; + +procedure MP12_NODE2 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, + MPTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end MP12_NODE2; + diff --git a/testsuites/ada/mptests/mp13/Makefile.am b/testsuites/ada/mptests/mp13/Makefile.am new file mode 100644 index 0000000000..d1dad5313a --- /dev/null +++ b/testsuites/ada/mptests/mp13/Makefile.am @@ -0,0 +1,4 @@ +_SUBDIRS = node1 node2 + +include $(top_srcdir)/../automake/subdirs.am +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/mptests/mp13/config_base.h b/testsuites/ada/mptests/mp13/config_base.h new file mode 100644 index 0000000000..c1b8f24e86 --- /dev/null +++ b/testsuites/ada/mptests/mp13/config_base.h @@ -0,0 +1,28 @@ +/* config_base.h + * + * This include file defines all of the Configuration Table for this test + * EXCEPT the NODE NUMBER. + * + * 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. + */ + + + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_TASKS 2 + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/mptests/mp13/mptest.adb b/testsuites/ada/mptests/mp13/mptest.adb new file mode 100644 index 0000000000..6dc79ab486 --- /dev/null +++ b/testsuites/ada/mptests/mp13/mptest.adb @@ -0,0 +1,323 @@ +-- +-- MPTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation for Test 13 of the RTEMS +-- Multiprocessor 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 INTERFACES; use INTERFACES; +with RTEMS; +with RTEMS.MESSAGE_QUEUE; +with RTEMS.SEMAPHORE; +with RTEMS.TASKS; +with TEST_SUPPORT; +with TEXT_IO; +with UNSIGNED32_IO; + +package body MPTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT( "*** TEST 13 -- NODE " ); + UNSIGNED32_IO.PUT( + TEST_SUPPORT.NODE, + WIDTH => 1 + ); + TEXT_IO.PUT_LINE( " ***" ); + + MPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( '1', '1', '1', ' ' ); + MPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( '2', '2', '2', ' ' ); + + MPTEST.QUEUE_NAME( 1 ) := RTEMS.BUILD_NAME( 'M', 'S', 'G', ' ' ); + + MPTEST.SEMAPHORE_NAME( 1 ) := RTEMS.BUILD_NAME( 'S', 'E', 'M', ' ' ); + + if TEST_SUPPORT.NODE = 1 then + + TEXT_IO.PUT_LINE( "Creating Message Queue (Global)" ); + RTEMS.MESSAGE_QUEUE.CREATE( + MPTEST.QUEUE_NAME( 1 ), + 3, + RTEMS.GLOBAL + RTEMS.LIMIT, + MPTEST.QUEUE_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_CREATE" ); + + TEXT_IO.PUT_LINE( "Creating Semaphore (Global)" ); + RTEMS.SEMAPHORE.CREATE( + MPTEST.SEMAPHORE_NAME( 1 ), + 1, + RTEMS.GLOBAL + RTEMS.PRIORITY, + MPTEST.SEMAPHORE_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE" ); + + RTEMS.SEMAPHORE.OBTAIN( + MPTEST.SEMAPHORE_ID( 1 ), + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN" ); + + end if; + + TEXT_IO.PUT_LINE( "Creating Test_task 1 (local)" ); + RTEMS.TASKS.CREATE( + MPTEST.TASK_NAME( 1 ), + 1, + 2048, + RTEMS.TIMESLICE, + RTEMS.DEFAULT_ATTRIBUTES, + MPTEST.TASK_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); + + TEXT_IO.PUT_LINE( "Starting Test_task 1 (local)" ); + RTEMS.TASKS.START( + MPTEST.TASK_ID( 1 ), + MPTEST.TEST_TASK_1'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); + + TEXT_IO.PUT_LINE( "Creating Test_task 2 (local)" ); + RTEMS.TASKS.CREATE( + MPTEST.TASK_NAME( 2 ), + 1, + 2048, + RTEMS.TIMESLICE, + RTEMS.DEFAULT_ATTRIBUTES, + MPTEST.TASK_ID( 2 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); + + TEXT_IO.PUT_LINE( "Starting Test_task 2 (local)" ); + RTEMS.TASKS.START( + MPTEST.TASK_ID( 2 ), + MPTEST.TEST_TASK_2'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); + + if TEST_SUPPORT.NODE = 1 then + + RTEMS.TASKS.WAKE_AFTER( 5 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + TEXT_IO.PUT_LINE( "*** END OF TEST 13 ***" ); + + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end if; + + TEXT_IO.PUT_LINE( "Deleting initialization task" ); + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- TEST_TASK_1 +-- + + procedure TEST_TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + COUNT : RTEMS.UNSIGNED32; + RECEIVE_BUFFER_AREA : RTEMS.BUFFER; + RECEIVE_BUFFER : RTEMS.BUFFER_POINTER; + STATUS : RTEMS.STATUS_CODES; + begin + + RECEIVE_BUFFER := + RTEMS.TO_BUFFER_POINTER( RECEIVE_BUFFER_AREA'ADDRESS ); + + TEXT_IO.PUT_LINE( "Getting QID of message queue" ); + + loop + + RTEMS.MESSAGE_QUEUE.IDENT( + MPTEST.QUEUE_NAME( 1 ), + RTEMS.SEARCH_ALL_NODES, + MPTEST.QUEUE_ID( 1 ), + STATUS + ); + + exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS ); + + end loop; + + if TEST_SUPPORT.NODE = 1 then + + TEXT_IO.PUT_LINE( "Receiving message ..." ); + RTEMS.MESSAGE_QUEUE.RECEIVE( + MPTEST.QUEUE_ID( 1 ), + RECEIVE_BUFFER, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + STATUS + ); + TEXT_IO.PUT_LINE( "How did I get back from here???" ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" ); + + end if; + + RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + TEXT_IO.PUT_LINE( "Receiving message ..." ); + RTEMS.MESSAGE_QUEUE.RECEIVE( + MPTEST.QUEUE_ID( 1 ), + RECEIVE_BUFFER, + RTEMS.DEFAULT_OPTIONS, + 2 * TEST_SUPPORT.TICKS_PER_SECOND, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.TIMEOUT, + "MESSAGE_QUEUE_RECEIVE" + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.TIMEOUT, + "MESSAGE_QUEUE_OBTAIN" + ); + + TEXT_IO.PUT_LINE( + "message_queue_receive correctly returned TIMEOUT" + ); + + TEXT_IO.PUT_LINE( "Deleting self" ); + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end TEST_TASK_1; + +-- +-- TEST_TASK_2 +-- + + procedure TEST_TASK_2 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.PUT_LINE( "Getting SMID of semaphore" ); + + loop + + RTEMS.SEMAPHORE.IDENT( + MPTEST.SEMAPHORE_NAME( 1 ), + RTEMS.SEARCH_ALL_NODES, + MPTEST.SEMAPHORE_ID( 1 ), + STATUS + ); + + exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS ); + + end loop; + + if TEST_SUPPORT.NODE = 1 then + + RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + TEXT_IO.PUT_LINE( "Releasing semaphore ..." ); + RTEMS.SEMAPHORE.RELEASE( MPTEST.SEMAPHORE_ID( 1 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE" ); + + RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND / 2, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + TEXT_IO.PUT_LINE( "Getting semaphore ..." ); + RTEMS.SEMAPHORE.OBTAIN( + MPTEST.SEMAPHORE_ID( 1 ), + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN" ); + + TEXT_IO.PUT_LINE( "Getting semaphore ..." ); + RTEMS.SEMAPHORE.OBTAIN( + MPTEST.SEMAPHORE_ID( 1 ), + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + STATUS + ); + TEXT_IO.PUT_LINE( "How did I get back from here???" ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN" ); + + end if; + + RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND / 2, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + TEXT_IO.PUT_LINE( "Getting semaphore ..." ); + RTEMS.SEMAPHORE.OBTAIN( + MPTEST.SEMAPHORE_ID( 1 ), + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN" ); + + TEXT_IO.PUT_LINE( "Releasing semaphore ..." ); + RTEMS.SEMAPHORE.RELEASE( MPTEST.SEMAPHORE_ID( 1 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE" ); + + RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + TEXT_IO.PUT_LINE( "Getting semaphore ..." ); + RTEMS.SEMAPHORE.OBTAIN( + MPTEST.SEMAPHORE_ID( 1 ), + RTEMS.DEFAULT_OPTIONS, + 2 * TEST_SUPPORT.TICKS_PER_SECOND, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.TIMEOUT, + "SEMAPHORE_OBTAIN" + ); + TEXT_IO.PUT_LINE( "semaphore_obtain correctly returned TIMEOUT" ); + + TEXT_IO.PUT_LINE( "*** END OF TEST 13 ***" ); + + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end TEST_TASK_2; + +end MPTEST; diff --git a/testsuites/ada/mptests/mp13/mptest.ads b/testsuites/ada/mptests/mp13/mptest.ads new file mode 100644 index 0000000000..8caa2347c9 --- /dev/null +++ b/testsuites/ada/mptests/mp13/mptest.ads @@ -0,0 +1,103 @@ +-- +-- MPTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 13 of the RTEMS +-- Multiprocessor 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; + +package MPTEST is + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS tasks created +-- by this test. +-- + + TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; + TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS message +-- queues created by this test. +-- + + QUEUE_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID; + QUEUE_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME; + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS semaphore +-- created by this test. +-- + + SEMAPHORE_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID; + SEMAPHORE_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME; + +-- +-- This variable contains the ID of the remote task with which this +-- test interacts. +-- + + REMOTE_TID : RTEMS.ID; + +-- +-- This variable contains the node on which the remote task with which +-- this test interacts resides. +-- + + REMOTE_NODE : RTEMS.UNSIGNED32; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- TEST_TASK_1 +-- +-- DESCRIPTION: +-- +-- This is the body of one of the RTEMS tasks which constitute this test. +-- + + procedure TEST_TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TEST_TASK_1); + +-- +-- TEST_TASK_2 +-- +-- DESCRIPTION: +-- +-- This is the body of one of the RTEMS tasks which constitute this test. +-- + + procedure TEST_TASK_2 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TEST_TASK_2); + +end MPTEST; diff --git a/testsuites/ada/mptests/mp13/node1/Makefile.am b/testsuites/ada/mptests/mp13/node1/Makefile.am new file mode 100644 index 0000000000..bf641cec25 --- /dev/null +++ b/testsuites/ada/mptests/mp13/node1/Makefile.am @@ -0,0 +1,19 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +AM_ADAFLAGS += -I$(srcdir)/.. + +noinst_PROGRAMS = mp13_ada_mp13_node1 +mp13_ada_mp13_node1_SOURCES = mp13_node1.adb ../mptest.adb config.h +mp13_ada_mp13_node1_SOURCES += ../mptest.ads +mp13_ada_mp13_node1_SOURCES += ../../../support/init.c + +mp13_ada_mp13_node1$(EXEEXT): mp13_node1.adb ../mptest.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_mp13-node1.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/mptests/mp13/node1/ada_mp13-node1.scn b/testsuites/ada/mptests/mp13/node1/ada_mp13-node1.scn new file mode 100644 index 0000000000..d3bd11f65e --- /dev/null +++ b/testsuites/ada/mptests/mp13/node1/ada_mp13-node1.scn @@ -0,0 +1,14 @@ +*** TEST 13 -- NODE 1 *** +Creating Message Queue (Global) +Creating Semaphore (Global) +Creating Test_task 1 (local) +Starting Test_task 1 (local) +Creating Test_task 2 (local) +Starting Test_task 2 (local) +Getting QID of message queue +Receiving message ... +Getting SMID of semaphore +Releasing semaphore ... +Getting semaphore ... +Getting semaphore ... +*** END OF TEST 13 *** diff --git a/testsuites/ada/mptests/mp13/node1/config.h b/testsuites/ada/mptests/mp13/node1/config.h new file mode 100644 index 0000000000..36c9d133e8 --- /dev/null +++ b/testsuites/ada/mptests/mp13/node1/config.h @@ -0,0 +1,21 @@ +/* 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_MP_APPLICATION +#define CONFIGURE_MP_NODE_NUMBER 1 + +#include "../config_base.h" + +/* end of include file */ diff --git a/testsuites/ada/mptests/mp13/node1/mp13_node1.adb b/testsuites/ada/mptests/mp13/node1/mp13_node1.adb new file mode 100644 index 0000000000..561bc67ba5 --- /dev/null +++ b/testsuites/ada/mptests/mp13/node1/mp13_node1.adb @@ -0,0 +1,56 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test MP13_NODE1 of the Multiprocessor +-- 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 MPTEST; +with TEST_SUPPORT; + +procedure MP13_NODE1 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, + MPTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end MP13_NODE1; + diff --git a/testsuites/ada/mptests/mp13/node2/Makefile.am b/testsuites/ada/mptests/mp13/node2/Makefile.am new file mode 100644 index 0000000000..95e9798ad7 --- /dev/null +++ b/testsuites/ada/mptests/mp13/node2/Makefile.am @@ -0,0 +1,19 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +AM_ADAFLAGS += -I$(srcdir)/.. + +noinst_PROGRAMS = mp13_ada_mp13_node2 +mp13_ada_mp13_node2_SOURCES = mp13_node2.adb ../mptest.adb config.h +mp13_ada_mp13_node2_SOURCES += ../mptest.ads +mp13_ada_mp13_node2_SOURCES += ../../../support/init.c + +mp13_ada_mp13_node2$(EXEEXT): mp13_node2.adb ../mptest.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_mp13-node2.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/mptests/mp13/node2/ada_mp13-node2.scn b/testsuites/ada/mptests/mp13/node2/ada_mp13-node2.scn new file mode 100644 index 0000000000..3254046292 --- /dev/null +++ b/testsuites/ada/mptests/mp13/node2/ada_mp13-node2.scn @@ -0,0 +1,16 @@ +*** TEST 13 -- NODE 2 *** +Creating Test_task 1 (local) +Starting Test_task 1 (local) +Creating Test_task 2 (local) +Starting Test_task 2 (local) +Deleting initialization task +Getting QID of message queue +Getting SMID of semaphore +Getting semaphore ... +Releasing semaphore ... +Receiving message ... +Getting semaphore ... +message_queue_receive correctly returned TIMEOUT +Deleting self +semaphore_obtain correctly returned TIMEOUT +*** END OF TEST 13 *** diff --git a/testsuites/ada/mptests/mp13/node2/config.h b/testsuites/ada/mptests/mp13/node2/config.h new file mode 100644 index 0000000000..47edf66149 --- /dev/null +++ b/testsuites/ada/mptests/mp13/node2/config.h @@ -0,0 +1,21 @@ +/* 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_MP_APPLICATION +#define CONFIGURE_MP_NODE_NUMBER 2 + +#include "../config_base.h" + +/* end of include file */ diff --git a/testsuites/ada/mptests/mp13/node2/mp13_node2.adb b/testsuites/ada/mptests/mp13/node2/mp13_node2.adb new file mode 100644 index 0000000000..e197f5aa12 --- /dev/null +++ b/testsuites/ada/mptests/mp13/node2/mp13_node2.adb @@ -0,0 +1,56 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test MP13_NODE2 of the Multiprocessor +-- 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 MPTEST; +with TEST_SUPPORT; + +procedure MP13_NODE2 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, + MPTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end MP13_NODE2; + diff --git a/testsuites/ada/mptests/mp14/Makefile.am b/testsuites/ada/mptests/mp14/Makefile.am new file mode 100644 index 0000000000..d1dad5313a --- /dev/null +++ b/testsuites/ada/mptests/mp14/Makefile.am @@ -0,0 +1,4 @@ +_SUBDIRS = node1 node2 + +include $(top_srcdir)/../automake/subdirs.am +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/mptests/mp14/config_base.h b/testsuites/ada/mptests/mp14/config_base.h new file mode 100644 index 0000000000..c1b8f24e86 --- /dev/null +++ b/testsuites/ada/mptests/mp14/config_base.h @@ -0,0 +1,28 @@ +/* config_base.h + * + * This include file defines all of the Configuration Table for this test + * EXCEPT the NODE NUMBER. + * + * 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. + */ + + + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_TASKS 2 + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/mptests/mp14/mptest.adb b/testsuites/ada/mptests/mp14/mptest.adb new file mode 100644 index 0000000000..c795dc28bd --- /dev/null +++ b/testsuites/ada/mptests/mp14/mptest.adb @@ -0,0 +1,766 @@ +-- +-- MPTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation for Test 14 of the RTEMS +-- Multiprocessor 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 INTERFACES; use INTERFACES; +with INTERFACES.C; +with RTEMS; +with RTEMS.EVENT; +with RTEMS.MESSAGE_QUEUE; +with RTEMS.PARTITION; +with RTEMS.SEMAPHORE; +with RTEMS.TASKS; +with RTEMS.TIMER; +with TEST_SUPPORT; +with TEXT_IO; +with UNSIGNED32_IO; + +with System.Storage_Elements; use System.Storage_Elements; + +package body MPTEST is + +-- +-- STOP_TEST_TSR +-- + + procedure STOP_TEST_TSR ( + IGNORED_ID : in RTEMS.ID; + IGNORED_ADDRESS : in RTEMS.ADDRESS + ) is + begin + + MPTEST.STOP_TEST := TRUE; + + end STOP_TEST_TSR; + +-- +-- EXIT_TEST +-- + + procedure EXIT_TEST is + OLD_MODE : RTEMS.MODE; + STATUS : RTEMS.STATUS_CODES; + procedure BSP_MPCI_PRINT_STATISTICS; + pragma Import (C, BSP_MPCI_PRINT_STATISTICS, "MPCI_Print_statistics" ); + begin + + RTEMS.TASKS.MODE(RTEMS.NO_PREEMPT, RTEMS.PREEMPT_MASK, OLD_MODE, STATUS); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); + + BSP_MPCI_PRINT_STATISTICS; + + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end EXIT_TEST; + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + INDEX : RTEMS.UNSIGNED32; + STATUS : RTEMS.STATUS_CODES; + PREVIOUS_PRIORITY : RTEMS.TASKS.PRIORITY; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT( "*** TEST 14 -- NODE " ); + UNSIGNED32_IO.PUT( + TEST_SUPPORT.NODE, + WIDTH => 1 + ); + TEXT_IO.PUT_LINE( " ***" ); + + MPTEST.STOP_TIMER_NAME := RTEMS.BUILD_NAME( 'S', 'T', 'O', 'P' ); + + MPTEST.STOP_TEST := FALSE; + + RTEMS.TIMER.CREATE( + MPTEST.STOP_TIMER_NAME, + MPTEST.STOP_TIMER_ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE" ); + + RTEMS.TIMER.FIRE_AFTER( + MPTEST.STOP_TIMER_ID, + TEST_SUPPORT.MAXIMUM_LONG_TEST_DURATION * + TEST_SUPPORT.TICKS_PER_SECOND, + MPTEST.STOP_TEST_TSR'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER" ); + + MPTEST.EVENT_TASK_NAME( 1 ) := RTEMS.BUILD_NAME( '1', '1', '1', ' ' ); + MPTEST.EVENT_TASK_NAME( 2 ) := RTEMS.BUILD_NAME( '2', '2', '2', ' ' ); + + MPTEST.QUEUE_TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'M', 'T', '1', ' ' ); + MPTEST.QUEUE_TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'M', 'T', '2', ' ' ); + + MPTEST.PARTITION_TASK_NAME( 1 ) := + RTEMS.BUILD_NAME( 'P', 'T', '1', ' ' ); + MPTEST.PARTITION_TASK_NAME( 2 ) := + RTEMS.BUILD_NAME( 'P', 'T', '2', ' ' ); + + MPTEST.SEMAPHORE_TASK_NAME( 1 ) := + RTEMS.BUILD_NAME( 'S', 'M', '1', ' ' ); + MPTEST.SEMAPHORE_TASK_NAME( 2 ) := + RTEMS.BUILD_NAME( 'S', 'M', '2', ' ' ); + + MPTEST.SEMAPHORE_NAME( 1 ) := RTEMS.BUILD_NAME( 'S', 'E', 'M', ' ' ); + + MPTEST.QUEUE_NAME( 1 ) := RTEMS.BUILD_NAME( 'M', 'S', 'G', ' ' ); + + MPTEST.PARTITION_NAME( 1 ) := RTEMS.BUILD_NAME( 'P', 'A', 'R', ' ' ); + + MPTEST.TIMER_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'M', 'R', ' ' ); + + for INDEX in MPTEST.BUFFERS'FIRST .. MPTEST.BUFFERS'LAST + loop + + MPTEST.BUFFERS( INDEX ) := + MPTEST.BUFFER_AREAS( INDEX )'ADDRESS; + + end loop; + + if TEST_SUPPORT.NODE = 1 then + + TEXT_IO.PUT_LINE( "Creating Semaphore (Global)" ); + RTEMS.SEMAPHORE.CREATE( + MPTEST.SEMAPHORE_NAME( 1 ), + 1, + RTEMS.GLOBAL, + MPTEST.SEMAPHORE_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE" ); + + TEXT_IO.PUT_LINE( "Creating Message Queue (Global)" ); + RTEMS.MESSAGE_QUEUE.CREATE( + MPTEST.QUEUE_NAME( 1 ), + 1, + RTEMS.GLOBAL, + MPTEST.QUEUE_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_CREATE" ); + + TEXT_IO.PUT_LINE( "Creating Partition (Global)" ); + RTEMS.PARTITION.CREATE( + MPTEST.PARTITION_NAME( 1 ), + MPTEST.PARTITION_AREA( 0 )'ADDRESS, + 16#8000#, + 16#3000#, + RTEMS.GLOBAL, + MPTEST.PARTITION_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_CREATE" ); + + end if; + + TEXT_IO.PUT_LINE( "Creating Event task (Global)" ); + RTEMS.TASKS.CREATE( + MPTEST.EVENT_TASK_NAME( + TEST_SUPPORT.NODE + ), + 2, + 2048, + RTEMS.TIMESLICE, + RTEMS.GLOBAL, + MPTEST.EVENT_TASK_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); + + TEXT_IO.PUT_LINE( "Starting Event task (Global)" ); + RTEMS.TASKS.START( + MPTEST.EVENT_TASK_ID( 1 ), + MPTEST.TEST_TASK'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); + + TEXT_IO.PUT_LINE( "Creating Semaphore task (Global)" ); + RTEMS.TASKS.CREATE( + MPTEST.SEMAPHORE_TASK_NAME( + TEST_SUPPORT.NODE + ), + 2, + 2048, + RTEMS.TIMESLICE, + RTEMS.GLOBAL, + MPTEST.SEMAPHORE_TASK_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); + + TEXT_IO.PUT_LINE( "Starting Semaphore task (Global)" ); + RTEMS.TASKS.START( + MPTEST.SEMAPHORE_TASK_ID( 1 ), + MPTEST.SEMAPHORE_TASK'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); + + TEXT_IO.PUT_LINE( "Creating Message Queue task (Global)" ); + RTEMS.TASKS.CREATE( + MPTEST.QUEUE_TASK_NAME( + TEST_SUPPORT.NODE + ), + 2, + 2048, + RTEMS.TIMESLICE, + RTEMS.GLOBAL, + MPTEST.QUEUE_TASK_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); + + TEXT_IO.PUT_LINE( "Starting Message Queue task (Global)" ); + RTEMS.TASKS.START( + MPTEST.QUEUE_TASK_ID( 1 ), + MPTEST.MESSAGE_QUEUE_TASK'ACCESS, + 1, -- index of buffer + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); + + TEXT_IO.PUT_LINE( "Creating Partition task (Global)" ); + RTEMS.TASKS.CREATE( + MPTEST.PARTITION_TASK_NAME( + TEST_SUPPORT.NODE + ), + 2, + 2048, + RTEMS.TIMESLICE, + RTEMS.GLOBAL, + MPTEST.PARTITION_TASK_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); + + TEXT_IO.PUT_LINE( "Starting Partition task (Global)" ); + RTEMS.TASKS.START( + MPTEST.PARTITION_TASK_ID( 1 ), + MPTEST.PARTITION_TASK'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); + + RTEMS.TASKS.SET_PRIORITY( RTEMS.SELF, 2, PREVIOUS_PRIORITY, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" ); + + MPTEST.DELAYED_EVENTS_TASK( 1 ); + + end INIT; + +-- +-- DELAYED_SEND_EVENT +-- +-- DESCRIPTION: +-- +-- This subprogram is a timer service routine which sends an +-- event set to a waiting task. +-- + + procedure DELAYED_SEND_EVENT ( + TIMER_ID : in RTEMS.ID; + IGNORED_ADDRESS : in RTEMS.ADDRESS + ) is + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.EVENT.SEND( + MPTEST.TASK_ID( RTEMS.GET_INDEX( TIMER_ID ) ), + RTEMS.EVENT_16, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND" ); + + end DELAYED_SEND_EVENT; + +-- +-- TEST_TASK +-- +-- DESCRIPTION: +-- +-- This is one of the test tasks. +-- + + procedure TEST_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + REMOTE_NODE : RTEMS.UNSIGNED32; + REMOTE_TID : RTEMS.ID; + COUNT : RTEMS.UNSIGNED32; + EVENT_OUT : RTEMS.EVENT_SET; + STATUS : RTEMS.STATUS_CODES; + begin + + if TEST_SUPPORT.NODE = 1 then + REMOTE_NODE := 2; + else + REMOTE_NODE := 1; + end if; + + TEXT_IO.PUT_LINE( "About to go to sleep!" ); + RTEMS.TASKS.WAKE_AFTER( 1 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + TEXT_IO.PUT_LINE( "Waking up!" ); + + TEXT_IO.PUT( "Remote task's name is : " ); + TEST_SUPPORT.PUT_NAME( MPTEST.EVENT_TASK_NAME( REMOTE_NODE ), TRUE ); + + TEXT_IO.PUT_LINE( "Getting TID of remote task" ); + + loop + + RTEMS.TASKS.IDENT( + MPTEST.EVENT_TASK_NAME( REMOTE_NODE ), + RTEMS.SEARCH_ALL_NODES, + REMOTE_TID, + STATUS + ); + + exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS ); + + TEXT_IO.PUT_LINE( "task_ident" ); + + end loop; + + if TEST_SUPPORT.NODE = 1 then + TEXT_IO.PUT_LINE( "Sending events to remote task" ); + + loop + exit when MPTEST.STOP_TEST = TRUE; + + for COUNT in 1 .. MPTEST.EVENT_TASK_DOT_COUNT + loop + RTEMS.EVENT.SEND( + REMOTE_TID, + RTEMS.EVENT_16, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND" ); + + exit when MPTEST.STOP_TEST = TRUE; + + end loop; + + TEST_SUPPORT.PUT_DOT( "e" ); + + end loop; + + end if; + + TEXT_IO.PUT_LINE( "Receiving events from remote task" ); + + loop + exit when MPTEST.STOP_TEST = TRUE; + + for COUNT in 1 .. MPTEST.EVENT_TASK_DOT_COUNT + loop + exit when MPTEST.STOP_TEST = TRUE; + + RTEMS.EVENT.RECEIVE( + RTEMS.EVENT_16, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + EVENT_OUT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE" ); + + end loop; + + TEST_SUPPORT.PUT_DOT( "e" ); + + end loop; + + MPTEST.EXIT_TEST; + + end TEST_TASK; + +-- +-- DELAYED_EVENTS_TASK +-- +-- DESCRIPTION: +-- +-- This is one of the test tasks. +-- + + procedure DELAYED_EVENTS_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + COUNT : RTEMS.UNSIGNED32; + PREVIOUS_MODE : RTEMS.MODE; + EVENTS_OUT : RTEMS.EVENT_SET; + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.TASKS.MODE( + RTEMS.PREEMPT + RTEMS.TIMESLICE, + RTEMS.PREEMPT_MASK + RTEMS.TIMESLICE_MASK, + PREVIOUS_MODE, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); + + RTEMS.TIMER.CREATE( + MPTEST.TIMER_NAME( 1 ), + MPTEST.TIMER_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE" ); + + RTEMS.TASKS.IDENT( + RTEMS.SELF, + RTEMS.SEARCH_ALL_NODES, + MPTEST.TASK_ID( RTEMS.GET_INDEX( MPTEST.TIMER_ID( 1 ) ) ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENTS" ); + + loop + + for COUNT in 1 .. MPTEST.DELAYED_EVENT_DOT_COUNT + loop + RTEMS.TIMER.FIRE_AFTER( + MPTEST.TIMER_ID( 1 ), + 1, + MPTEST.DELAYED_SEND_EVENT'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER" ); + + RTEMS.EVENT.RECEIVE( + RTEMS.EVENT_16, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + EVENTS_OUT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE" ); + + end loop; + + TEST_SUPPORT.PUT_DOT( "." ); + + end loop; + + MPTEST.EXIT_TEST; + + end DELAYED_EVENTS_TASK; + +-- +-- MESSAGE_QUEUE_TASK +-- +-- DESCRIPTION: +-- +-- This is one of the test tasks. +-- + + procedure MESSAGE_QUEUE_TASK ( + INDEX : in RTEMS.TASKS.ARGUMENT + ) is + COUNT : RTEMS.UNSIGNED32; + YIELD_COUNT : RTEMS.UNSIGNED32; + OVERFLOW_COUNT : RTEMS.UNSIGNED32_POINTER; + BUFFER_COUNT : RTEMS.UNSIGNED32_POINTER; + STATUS : RTEMS.STATUS_CODES; + begin + + MPTEST.BUFFERS( INDEX ).FIELD1 := 0; + MPTEST.BUFFERS( INDEX ).FIELD2 := 0; + MPTEST.BUFFERS( INDEX ).FIELD3 := 0; + MPTEST.BUFFERS( INDEX ).FIELD4 := 0; + + TEXT_IO.PUT_LINE( "Getting ID of message queue" ); + + loop + + RTEMS.MESSAGE_QUEUE.IDENT( + MPTEST.QUEUE_NAME( 1 ), + RTEMS.SEARCH_ALL_NODES, + MPTEST.QUEUE_ID( 1 ), + STATUS + ); + exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS ); + + TEXT_IO.PUT_LINE( "message_queue_ident FAILED!!" ); + + end loop; + + if TEST_SUPPORT.NODE = 1 then + + RTEMS.MESSAGE_QUEUE.SEND( + MPTEST.QUEUE_ID( 1 ), + MPTEST.BUFFERS( INDEX ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); + + OVERFLOW_COUNT := RTEMS.TO_UNSIGNED32_POINTER( + MPTEST.BUFFERS( INDEX ).FIELD1'ADDRESS + ); + + BUFFER_COUNT := RTEMS.TO_UNSIGNED32_POINTER( + MPTEST.BUFFERS( INDEX ).FIELD2'ADDRESS + ); + + else + + OVERFLOW_COUNT := RTEMS.TO_UNSIGNED32_POINTER( + MPTEST.BUFFERS( INDEX ).FIELD3'ADDRESS + ); + + BUFFER_COUNT := RTEMS.TO_UNSIGNED32_POINTER( + MPTEST.BUFFERS( INDEX ).FIELD4'ADDRESS + ); + + end if; + + loop + + exit when MPTEST.STOP_TEST = TRUE; + + YIELD_COUNT := 100; + + for COUNT in 1 .. MPTEST.MESSAGE_DOT_COUNT + loop + + exit when MPTEST.STOP_TEST = TRUE; + + RTEMS.MESSAGE_QUEUE.RECEIVE( + MPTEST.QUEUE_ID( 1 ), + MPTEST.BUFFERS( INDEX ), + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( + STATUS, + "MESSAGE_QUEUE_RECEIVE" + ); + + if BUFFER_COUNT.ALL = RTEMS.UNSIGNED32'LAST then + BUFFER_COUNT.ALL := 0; + OVERFLOW_COUNT.ALL := OVERFLOW_COUNT.ALL + 1; + else + BUFFER_COUNT.ALL := BUFFER_COUNT.ALL + 1; + end if; + + RTEMS.MESSAGE_QUEUE.SEND( + MPTEST.QUEUE_ID( 1 ), + MPTEST.BUFFERS( INDEX ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); + + if MPTEST.STOP_TEST = FALSE then + if TEST_SUPPORT.NODE = 1 then + + YIELD_COUNT := YIELD_COUNT - 1; + + if YIELD_COUNT = 0 then + + RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "YIELD" ); + + YIELD_COUNT := 100; + + end if; + + end if; + + end if; + + end loop; + + TEST_SUPPORT.PUT_DOT( "m" ); + + end loop; + + MPTEST.EXIT_TEST; + + end MESSAGE_QUEUE_TASK; + +-- +-- PARTITION_TASK +-- +-- DESCRIPTION: +-- +-- This is one of the test tasks. +-- + + procedure PARTITION_TASK ( + IGNORED : in RTEMS.TASKS.ARGUMENT + ) is + COUNT : RTEMS.UNSIGNED32; + BUFFER : RTEMS.ADDRESS; + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.PUT_LINE( "Getting ID of partition" ); + + loop + + RTEMS.PARTITION.IDENT( + MPTEST.PARTITION_NAME( 1 ), + RTEMS.SEARCH_ALL_NODES, + MPTEST.PARTITION_ID( 1 ), + STATUS + ); + exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS ); + + TEXT_IO.PUT_LINE( "partition_ident FAILED!!" ); + + end loop; + + loop + + exit when MPTEST.STOP_TEST = TRUE; + + for COUNT in 1 .. MPTEST.PARTITION_DOT_COUNT + loop + + exit when MPTEST.STOP_TEST = TRUE; + + RTEMS.PARTITION.GET_BUFFER( + MPTEST.PARTITION_ID( 1 ), + BUFFER, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_GET_BUFFER" ); + + RTEMS.PARTITION.RETURN_BUFFER( + MPTEST.PARTITION_ID( 1 ), + BUFFER, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( + STATUS, + "PARTITION_RETURN_BUFFER" + ); + + if TEST_SUPPORT.NODE = 1 then + + RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "YIELD" ); + + end if; + + end loop; + + TEST_SUPPORT.PUT_DOT( "p" ); + + end loop; + + MPTEST.EXIT_TEST; + + end PARTITION_TASK; + +-- +-- SEMAPHORE_TASK +-- +-- DESCRIPTION: +-- +-- This is one of the test tasks. +-- + + procedure SEMAPHORE_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + COUNT : RTEMS.UNSIGNED32; + YIELD_COUNT : RTEMS.UNSIGNED32; + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.PUT_LINE( "Getting ID of semaphore" ); + + loop + + RTEMS.SEMAPHORE.IDENT( + MPTEST.SEMAPHORE_NAME( 1 ), + RTEMS.SEARCH_ALL_NODES, + MPTEST.SEMAPHORE_ID( 1 ), + STATUS + ); + exit when RTEMS.IS_STATUS_SUCCESSFUL( STATUS ); + + TEXT_IO.PUT_LINE( "semaphore_ident FAILED!!" ); + + end loop; + + loop + + YIELD_COUNT := 100; + + exit when MPTEST.STOP_TEST = TRUE; + + for COUNT in 1 .. MPTEST.SEMAPHORE_DOT_COUNT + loop + + exit when MPTEST.STOP_TEST = TRUE; + + RTEMS.SEMAPHORE.OBTAIN( + MPTEST.SEMAPHORE_ID( 1 ), + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN" ); + + RTEMS.SEMAPHORE.RELEASE( MPTEST.SEMAPHORE_ID( 1 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE" ); + + if TEST_SUPPORT.NODE = 1 then + + YIELD_COUNT := YIELD_COUNT - 1; + + if YIELD_COUNT = 0 then + + RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "YIELD" ); + + YIELD_COUNT := 100; + + end if; + + end if; + + end loop; + + TEST_SUPPORT.PUT_DOT( "s" ); + + end loop; + + MPTEST.EXIT_TEST; + + end SEMAPHORE_TASK; + +end MPTEST; diff --git a/testsuites/ada/mptests/mp14/mptest.ads b/testsuites/ada/mptests/mp14/mptest.ads new file mode 100644 index 0000000000..1cf0b80942 --- /dev/null +++ b/testsuites/ada/mptests/mp14/mptest.ads @@ -0,0 +1,246 @@ +-- +-- MPTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 14 of the RTEMS +-- Multiprocessor 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; + +package MPTEST is + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS tasks created +-- by this test for passing event sets. +-- + + TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.ID; + TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.NAME; +-- +-- These arrays contain the IDs and NAMEs of all RTEMS tasks created +-- by this test for passing event sets. +-- + + EVENT_TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.ID; + EVENT_TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.NAME; + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS tasks created +-- by this test for manipulating semaphores. +-- + + SEMAPHORE_TASK_ID : + array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.ID; + SEMAPHORE_TASK_NAME : + array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.NAME; + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS tasks created +-- by this test for passing messages. +-- + + QUEUE_TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.ID; + QUEUE_TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.NAME; + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS tasks created +-- by this test for manipulating the global partitions. +-- + + PARTITION_TASK_ID : + array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.ID; + PARTITION_TASK_NAME : + array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.NAME; + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS partitions +-- created by this test. +-- + + PARTITION_ID : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.ID; + PARTITION_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.NAME; + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS semaphores +-- created by this test. +-- + + SEMAPHORE_ID : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.ID; + SEMAPHORE_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.NAME; + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS message_queues +-- created by this test. +-- + + QUEUE_ID : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.ID; + QUEUE_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.NAME; + +-- +-- +-- These arrays contain the IDs and NAMEs of all RTEMS timers +-- created by this test. +-- + + TIMER_ID : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.ID; + TIMER_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.NAME; + +-- +-- The following are message buffers used to contain the test messages +-- and pointers to those buffers. +-- + + BUFFER_AREAS : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.BUFFER; + BUFFERS : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.ADDRESS; + +-- +-- This is the area used for the partition. +-- + + PARTITION_AREA : + array ( RTEMS.UNSIGNED32 range 0 .. 16#7FFF# ) of RTEMS.UNSIGNED8; + for PARTITION_AREA'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT; + +-- +-- The following constants control the flow of "dot" indicators +-- from the various test componenents. +-- + + EVENT_TASK_DOT_COUNT : constant RTEMS.UNSIGNED32 := 100; + EVENT_SEND_DOT_COUNT : constant RTEMS.UNSIGNED32 := 100; + DELAYED_EVENT_DOT_COUNT : constant RTEMS.UNSIGNED32 := 1000; + MESSAGE_DOT_COUNT : constant RTEMS.UNSIGNED32 := 200; + PARTITION_DOT_COUNT : constant RTEMS.UNSIGNED32 := 200; + SEMAPHORE_DOT_COUNT : constant RTEMS.UNSIGNED32 := 200; + +-- +-- These contain the IDs and NAMEs of the RTEMS timers used +-- by this test to stop. +-- + + STOP_TIMER_ID : RTEMS.ID; + STOP_TIMER_NAME : RTEMS.NAME; + +-- +-- This variable is set when the test should stop executing. +-- + + STOP_TEST : BOOLEAN; + +-- +-- EXIT_TEST +-- +-- DESCRIPTION: +-- +-- This subprogram is invoked to stop this test. +-- + + procedure EXIT_TEST; + +-- +-- DELAYED_SEND_EVENT +-- +-- DESCRIPTION: +-- +-- This subprogram is a timer service routine which sends an +-- event set to a waiting task. +-- + + procedure DELAYED_SEND_EVENT ( + TIMER_ID : in RTEMS.ID; + IGNORED_ADDRESS : in RTEMS.ADDRESS + ); + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- TEST_TASK +-- +-- DESCRIPTION: +-- +-- This is one of the test tasks. +-- + + procedure TEST_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TEST_TASK); + +-- +-- DELAYED_EVENTS_TASK +-- +-- DESCRIPTION: +-- +-- This is one of the test tasks. +-- + + procedure DELAYED_EVENTS_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, DELAYED_EVENTS_TASK); + +-- +-- MESSAGE_QUEUE_TASK +-- +-- DESCRIPTION: +-- +-- This is one of the test tasks. +-- + + procedure MESSAGE_QUEUE_TASK ( + INDEX : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, MESSAGE_QUEUE_TASK); + +-- +-- PARTITION_TASK +-- +-- DESCRIPTION: +-- +-- This is one of the test tasks. +-- + + procedure PARTITION_TASK ( + IGNORED : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, PARTITION_TASK); + +-- +-- SEMAPHORE_TASK +-- +-- DESCRIPTION: +-- +-- This is one of the test tasks. +-- + + procedure SEMAPHORE_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, SEMAPHORE_TASK); + +end MPTEST; diff --git a/testsuites/ada/mptests/mp14/node1/Makefile.am b/testsuites/ada/mptests/mp14/node1/Makefile.am new file mode 100644 index 0000000000..6e2a21263f --- /dev/null +++ b/testsuites/ada/mptests/mp14/node1/Makefile.am @@ -0,0 +1,19 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +AM_ADAFLAGS += -I$(srcdir)/.. + +noinst_PROGRAMS = mp14_ada_mp14_node1 +mp14_ada_mp14_node1_SOURCES = mp14_node1.adb ../mptest.adb config.h +mp14_ada_mp14_node1_SOURCES += ../mptest.ads +mp14_ada_mp14_node1_SOURCES += ../../../support/init.c + +mp14_ada_mp14_node1$(EXEEXT): mp14_node1.adb ../mptest.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_mp14-node1.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/mptests/mp14/node1/ada_mp14-node1.scn b/testsuites/ada/mptests/mp14/node1/ada_mp14-node1.scn new file mode 100644 index 0000000000..d1b6feefe9 --- /dev/null +++ b/testsuites/ada/mptests/mp14/node1/ada_mp14-node1.scn @@ -0,0 +1,33 @@ +*** TEST 14 -- NODE 1 *** +Creating Semaphore (Global) +Creating Message Queue (Global) +Creating Partition (Global) +Creating Event task (Global) +Starting Event task (Global) +Creating Semaphore task (Global) +About to go to sleep! +Starting Semaphore task (Global) +Creating Message Queue task (Global) +Getting SMID of semaphore +Starting Message Queue task (Global) +Creating Partition task (Global) +Getting ID of msg queue +Starting Partition task (Global) +Getting ID of partition +Waking up! +Remote task's name is : 222 +Getting TID of remote task +Sending events to remote task + +. - indicates 100 iterations of +tm_evafter of 1 tick and event_receive. +e - indicates that 100 +events have been sent to the remote task. +m - indicates 100 iterations of +message_queue_send and message_queue_receive. +p - indicates 100 iterations of +partition_get_buffer and partition_return_buffer. +s - indicates 100 iterations of +semaphore_obtain and semaphore_release. +NOTE: The characters in the stream could begin to appear whenever any +task is started. diff --git a/testsuites/ada/mptests/mp14/node1/config.h b/testsuites/ada/mptests/mp14/node1/config.h new file mode 100644 index 0000000000..36c9d133e8 --- /dev/null +++ b/testsuites/ada/mptests/mp14/node1/config.h @@ -0,0 +1,21 @@ +/* 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_MP_APPLICATION +#define CONFIGURE_MP_NODE_NUMBER 1 + +#include "../config_base.h" + +/* end of include file */ diff --git a/testsuites/ada/mptests/mp14/node1/mp14_node1.adb b/testsuites/ada/mptests/mp14/node1/mp14_node1.adb new file mode 100644 index 0000000000..766fc5d816 --- /dev/null +++ b/testsuites/ada/mptests/mp14/node1/mp14_node1.adb @@ -0,0 +1,56 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test MP14_NODE1 of the Multiprocessor +-- 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 MPTEST; +with TEST_SUPPORT; + +procedure MP14_NODE1 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, + MPTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end MP14_NODE1; + diff --git a/testsuites/ada/mptests/mp14/node2/Makefile.am b/testsuites/ada/mptests/mp14/node2/Makefile.am new file mode 100644 index 0000000000..b694774c46 --- /dev/null +++ b/testsuites/ada/mptests/mp14/node2/Makefile.am @@ -0,0 +1,19 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +AM_ADAFLAGS += -I$(srcdir)/.. + +noinst_PROGRAMS = mp14_ada_mp14_node2 +mp14_ada_mp14_node2_SOURCES = mp14_node2.adb ../mptest.adb config.h +mp14_ada_mp14_node2_SOURCES += ../mptest.ads +mp14_ada_mp14_node2_SOURCES += ../../../support/init.c + +mp14_ada_mp14_node2$(EXEEXT): mp14_node2.adb ../mptest.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_mp14-node2.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/mptests/mp14/node2/ada_mp14-node2.scn b/testsuites/ada/mptests/mp14/node2/ada_mp14-node2.scn new file mode 100644 index 0000000000..a245b11faa --- /dev/null +++ b/testsuites/ada/mptests/mp14/node2/ada_mp14-node2.scn @@ -0,0 +1,28 @@ +*** TEST 14 -- NODE 2 *** +Creating Event task (Global) +Starting Event task (Global) +Creating Semaphore task (Global) +About to go to sleep! +Starting Semaphore task (Global) +Creating Message Queue task (Global) +Getting SMID of semaphore +Starting Message Queue task (Global) +Creating Partition task (Global) +Getting ID of msg queue +Starting Partition task (Global) +Getting ID of partition +Waking up! +Remote task's name is : 111 +Getting TID of remote task +Receiving events from remote task + +. - indicates 100 iterations of +tm_evafter of 1 tick and event_receive. +e - indicates that 100 +events have been sent to the remote task. +m - indicates 100 iterations of +message_queue_send and message_queue_receive. +p - indicates 100 iterations of +partition_get_buffer and partition_return_buffer. +s - indicates 100 iterations of +semaphore_obtain and semaphore_release. diff --git a/testsuites/ada/mptests/mp14/node2/config.h b/testsuites/ada/mptests/mp14/node2/config.h new file mode 100644 index 0000000000..47edf66149 --- /dev/null +++ b/testsuites/ada/mptests/mp14/node2/config.h @@ -0,0 +1,21 @@ +/* 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_MP_APPLICATION +#define CONFIGURE_MP_NODE_NUMBER 2 + +#include "../config_base.h" + +/* end of include file */ diff --git a/testsuites/ada/mptests/mp14/node2/mp14_node2.adb b/testsuites/ada/mptests/mp14/node2/mp14_node2.adb new file mode 100644 index 0000000000..fb92b69554 --- /dev/null +++ b/testsuites/ada/mptests/mp14/node2/mp14_node2.adb @@ -0,0 +1,56 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test MP14_NODE2 of the Multiprocessor +-- 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 MPTEST; +with TEST_SUPPORT; + +procedure MP14_NODE2 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, + MPTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end MP14_NODE2; + diff --git a/testsuites/ada/samples/Makefile.am b/testsuites/ada/samples/Makefile.am new file mode 100644 index 0000000000..0aa25affad --- /dev/null +++ b/testsuites/ada/samples/Makefile.am @@ -0,0 +1,9 @@ +_SUBDIRS = hello ticker base_sp nsecs + +if HAS_MP +_SUBDIRS += base_mp +endif +DIST_SUBDIRS = hello ticker base_sp base_mp nsecs + +include $(top_srcdir)/../automake/subdirs.am +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/samples/base_mp/Makefile.am b/testsuites/ada/samples/base_mp/Makefile.am new file mode 100644 index 0000000000..ed05ebbd72 --- /dev/null +++ b/testsuites/ada/samples/base_mp/Makefile.am @@ -0,0 +1,21 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +_SUBDIRS = node1 node2 +#include $(top_srcdir)/ada.am + +#mptest$(EXEEXT): mptest.adb +# $(GNATCOMPILE) -margs -a $< -o $@ + +#if EXPADA +#noinst_PROGRAMS = mptest +#endif + +#mptest_exe_SOURCES = mptest.adb mptest.ads + +#EXTRA_DIST += node1/mptest-per_node_configuration.adb + +#EXTRA_DIST += node2/mptest-per_node_configuration.adb + +include $(top_srcdir)/../automake/subdirs.am +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/samples/base_mp/config.h b/testsuites/ada/samples/base_mp/config.h new file mode 100644 index 0000000000..33c9288f4c --- /dev/null +++ b/testsuites/ada/samples/base_mp/config.h @@ -0,0 +1,34 @@ +/* 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.rtems.org/license/LICENSE. + */ + +/* configuration information */ + +#define CONFIGURE_MP_APPLICATION + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER + +#define CONFIGURE_MAXIMUM_TASKS 2 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +/* + * Put the overrides of default configuration parameters here. + */ + +#include + +/* end of include file */ diff --git a/testsuites/ada/samples/base_mp/mptest.adb b/testsuites/ada/samples/base_mp/mptest.adb new file mode 100644 index 0000000000..d4eef0a29f --- /dev/null +++ b/testsuites/ada/samples/base_mp/mptest.adb @@ -0,0 +1,100 @@ +-- +-- MPTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation for Test 1 of the RTEMS +-- Multiprocessor 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 INTERFACES; use INTERFACES; +with RTEMS; +with RTEMS.INTERRUPT; +with RTEMS.TASKS; +with TEST_SUPPORT; +with TEXT_IO; +with UNSIGNED32_IO; + +package body MPTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT( "*** SAMPLE MULTIPROCESSOR APPLICATION ***" ); + TEXT_IO.PUT( "Creating and starting an application task" ); + + + MPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); + + RTEMS.TASKS.CREATE( + MPTEST.TASK_NAME( 1 ), + 1, + 2048, + RTEMS.INTERRUPT_LEVEL( 0 ), + RTEMS.DEFAULT_ATTRIBUTES, + MPTEST.TASK_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" ); + + RTEMS.TASKS.START( + MPTEST.TASK_ID( 1 ), + MPTEST.APPLICATION_TASK'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- APPLICATION_TASK +-- + + procedure APPLICATION_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + TID : RTEMS.ID; + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.TASKS.IDENT( RTEMS.SELF, RTEMS.SEARCH_ALL_NODES, TID, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF SELF" ); + + TEXT_IO.PUT( "This task was invoked with node argument (" ); + UNSIGNED32_IO.PUT( ARGUMENT ); + TEXT_IO.PUT_LINE( ")" ); + + TEXT_IO.PUT( "This task has the id of 0x" ); + UNSIGNED32_IO.PUT( TID, BASE => 16 ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT_LINE( "*** END OF SAMPLE MULTIPROCESSOR APPLICATION ***" ); + + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end APPLICATION_TASK; + +end MPTEST; diff --git a/testsuites/ada/samples/base_mp/mptest.ads b/testsuites/ada/samples/base_mp/mptest.ads new file mode 100644 index 0000000000..f246b4e0ed --- /dev/null +++ b/testsuites/ada/samples/base_mp/mptest.ads @@ -0,0 +1,62 @@ +-- +-- MPTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 1 of the RTEMS +-- Multiprocessor 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; + +package MPTEST is + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS tasks created +-- by this test. +-- + + TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; + TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- APPLICATION_TASK +-- +-- DESCRIPTION: +-- +-- This routine is as an example of an application task which +-- prints a message including its RTEMS task id. This task +-- then invokes exit to return to the monitor. +-- + + procedure APPLICATION_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, APPLICATION_TASK); + +end MPTEST; diff --git a/testsuites/ada/samples/base_mp/node1/Makefile.am b/testsuites/ada/samples/base_mp/node1/Makefile.am new file mode 100644 index 0000000000..c6ec8cd42b --- /dev/null +++ b/testsuites/ada/samples/base_mp/node1/Makefile.am @@ -0,0 +1,22 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +AM_ADAFLAGS += -I$(srcdir)/.. + +if EXPADA +noinst_PROGRAMS = ada_base_mp_node1 +ada_base_mp_node1_SOURCES = mptest-per_node_configuration.adb +endif + +ada_base_mp_node1$(EXEEXT): ../mptest.adb init.o + $(GNATCOMPILE) -margs -a $< -o $@ + +init.o: ../../../support/init.c + $(COMPILE.c) -DNODE_NUMBER=1 -I$(srcdir)/.. -c $< + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_base_mp-node1.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/samples/base_mp/node1/ada_base_mp-node1.scn b/testsuites/ada/samples/base_mp/node1/ada_base_mp-node1.scn new file mode 100644 index 0000000000..a2d2f359be --- /dev/null +++ b/testsuites/ada/samples/base_mp/node1/ada_base_mp-node1.scn @@ -0,0 +1,5 @@ +*** SAMPLE MULTIPROCESSOR APPLICATION *** +Creating and starting an application task +This task was invoked with the node argument (1) +This task has the id of 0x10002 +*** END OF SAMPLE MULTIPROCESSOR APPLICATION *** diff --git a/testsuites/ada/samples/base_mp/node2/Makefile.am b/testsuites/ada/samples/base_mp/node2/Makefile.am new file mode 100644 index 0000000000..9095902a0b --- /dev/null +++ b/testsuites/ada/samples/base_mp/node2/Makefile.am @@ -0,0 +1,22 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +AM_ADAFLAGS += -I$(srcdir)/.. + +if EXPADA +noinst_PROGRAMS = ada_base_mp_node2 +ada_base_mp_node2_SOURCES = mptest-per_node_configuration.adb +endif + +ada_base_mp_node2$(EXEEXT): ../mptest.adb init.o + $(GNATCOMPILE) -margs -a $< -o $@ + +init.o: ../../../support/init.c + $(COMPILE.c) -DNODE_NUMBER=2 -I$(srcdir)/.. -c $< + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_base_mp-node2.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/samples/base_mp/node2/ada_base_mp-node2.scn b/testsuites/ada/samples/base_mp/node2/ada_base_mp-node2.scn new file mode 100644 index 0000000000..95bc96a808 --- /dev/null +++ b/testsuites/ada/samples/base_mp/node2/ada_base_mp-node2.scn @@ -0,0 +1,5 @@ +*** SAMPLE MULTIPROCESSOR APPLICATION *** +Creating and starting an application task +This task was invoked with the node argument (2) +This task has the id of 0x20002 +*** END OF SAMPLE MULTIPROCESSOR APPLICATION *** diff --git a/testsuites/ada/samples/base_sp/Makefile.am b/testsuites/ada/samples/base_sp/Makefile.am new file mode 100644 index 0000000000..c6b2628735 --- /dev/null +++ b/testsuites/ada/samples/base_sp/Makefile.am @@ -0,0 +1,19 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +ada_base_sp$(EXEEXT): base_sp.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +init.$(OBJEXT): ../../support/init.c + $(COMPILE.c) -I$(srcdir) -c $< + +noinst_PROGRAMS = ada_base_sp + +ada_base_sp_SOURCES = base_sp.adb config.h sptest.adb sptest.ads + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_base_sp.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/samples/base_sp/ada_base_sp.scn b/testsuites/ada/samples/base_sp/ada_base_sp.scn new file mode 100644 index 0000000000..7b8867dc85 --- /dev/null +++ b/testsuites/ada/samples/base_sp/ada_base_sp.scn @@ -0,0 +1,4 @@ +*** SAMPLE SINGLE PROCESSOR APPLICATION *** +Creating and starting an application task +Application task was invoked with argument ( 0) and has id of 0x16#A010002# +*** END OF SAMPLE SINGLE PROCESSOR APPLICATION *** diff --git a/testsuites/ada/samples/base_sp/base_sp.adb b/testsuites/ada/samples/base_sp/base_sp.adb new file mode 100644 index 0000000000..aaa1ab3bca --- /dev/null +++ b/testsuites/ada/samples/base_sp/base_sp.adb @@ -0,0 +1,56 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Base Single Process Example of the +-- Sample 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 Base_SP 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 Base_SP; + diff --git a/testsuites/ada/samples/base_sp/config.h b/testsuites/ada/samples/base_sp/config.h new file mode 100644 index 0000000000..083d52515e --- /dev/null +++ b/testsuites/ada/samples/base_sp/config.h @@ -0,0 +1,30 @@ +/* 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_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#define CONFIGURE_MAXIMUM_TASKS 2 + +#include + +/* end of include file */ diff --git a/testsuites/ada/samples/base_sp/sptest.adb b/testsuites/ada/samples/base_sp/sptest.adb new file mode 100644 index 0000000000..85a847f281 --- /dev/null +++ b/testsuites/ada/samples/base_sp/sptest.adb @@ -0,0 +1,93 @@ +-- +-- SPTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 1 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 TEST_SUPPORT; +with TEXT_IO; +with UNSIGNED32_IO; + +package body SPTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** SAMPLE SINGLE PROCESSOR APPLICATION ***" ); + TEXT_IO.PUT_LINE( "Creating and starting an application task" ); + + SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 1 ), + 1, + 2048, + RTEMS.INTERRUPT_LEVEL( 0 ), + 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.APPLICATION_TASK'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- APPLICATION_TASK +-- + + procedure APPLICATION_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + TID : RTEMS.ID; + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.TASKS.IDENT( RTEMS.SELF, RTEMS.SEARCH_ALL_NODES, TID, STATUS ); + + TEXT_IO.PUT( "Application task was invoked with argument (" ); + UNSIGNED32_IO.PUT( ARGUMENT ); + TEXT_IO.PUT( ") and has id of 0x" ); + UNSIGNED32_IO.PUT( TID, BASE => 16 ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT_LINE( "*** END OF SAMPLE SINGLE PROCESSOR APPLICATION ***" ); + + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end APPLICATION_TASK; + +end SPTEST; diff --git a/testsuites/ada/samples/base_sp/sptest.ads b/testsuites/ada/samples/base_sp/sptest.ads new file mode 100644 index 0000000000..e35751cd32 --- /dev/null +++ b/testsuites/ada/samples/base_sp/sptest.ads @@ -0,0 +1,60 @@ +-- +-- SPTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 1 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; + +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 .. 3 ) of RTEMS.ID; + TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- APPLICATION_TASK +-- +-- DESCRIPTION: +-- +-- This is the body of the RTEMS task which constitutes this test. +-- + + procedure APPLICATION_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, APPLICATION_TASK); + +end SPTEST; diff --git a/testsuites/ada/samples/hello/Makefile.am b/testsuites/ada/samples/hello/Makefile.am new file mode 100644 index 0000000000..9a6aa5eeb6 --- /dev/null +++ b/testsuites/ada/samples/hello/Makefile.am @@ -0,0 +1,19 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +ada_hello$(EXEEXT): hello.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +init.$(OBJEXT): ../../support/init.c + $(COMPILE.c) -I$(srcdir) -c $< + +noinst_PROGRAMS = ada_hello + +ada_hello_SOURCES = hello.adb config.h sptest.adb sptest.ads + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_hello.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/samples/hello/ada_hello.scn b/testsuites/ada/samples/hello/ada_hello.scn new file mode 100644 index 0000000000..d9e92d81d5 --- /dev/null +++ b/testsuites/ada/samples/hello/ada_hello.scn @@ -0,0 +1,3 @@ +*** HELLO WORLD TEST *** +Hello World +*** END OF HELLO WORLD TEST *** diff --git a/testsuites/ada/samples/hello/config.h b/testsuites/ada/samples/hello/config.h new file mode 100644 index 0000000000..2be186cc2a --- /dev/null +++ b/testsuites/ada/samples/hello/config.h @@ -0,0 +1,31 @@ +/* config.h + * + * This include file defines the Configuration Table for this test. + * + * COPYRIGHT (c) 1989-2008. + * 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_APPLICATION + +/* NOTICE: the clock driver is explicitly disabled */ +#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#define CONFIGURE_MAXIMUM_TASKS 1 + +#include + +/* end of include file */ diff --git a/testsuites/ada/samples/hello/hello.adb b/testsuites/ada/samples/hello/hello.adb new file mode 100644 index 0000000000..f7748f3607 --- /dev/null +++ b/testsuites/ada/samples/hello/hello.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test Hello of the Sample 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 Hello 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 Hello; + diff --git a/testsuites/ada/samples/hello/sptest.adb b/testsuites/ada/samples/hello/sptest.adb new file mode 100644 index 0000000000..8c29155eba --- /dev/null +++ b/testsuites/ada/samples/hello/sptest.adb @@ -0,0 +1,44 @@ +-- +-- SPTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 1 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 TEXT_IO; + +package body SPTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** HELLO WORLD TEST ***" ); + TEXT_IO.PUT_LINE( "Hello World" ); + TEXT_IO.PUT_LINE( "*** END OF HELLO WORLD TEST ***" ); + + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end INIT; + +end SPTEST; diff --git a/testsuites/ada/samples/hello/sptest.ads b/testsuites/ada/samples/hello/sptest.ads new file mode 100644 index 0000000000..62993b0220 --- /dev/null +++ b/testsuites/ada/samples/hello/sptest.ads @@ -0,0 +1,48 @@ +-- +-- SPTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for the Hello World Test of the RTEMS +-- Sample 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; + +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 .. 3 ) of RTEMS.ID; + TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + + +end SPTEST; diff --git a/testsuites/ada/samples/nsecs/Makefile.am b/testsuites/ada/samples/nsecs/Makefile.am new file mode 100644 index 0000000000..64a8145818 --- /dev/null +++ b/testsuites/ada/samples/nsecs/Makefile.am @@ -0,0 +1,19 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +ada_nsecs$(EXEEXT): nsecs.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +init.$(OBJEXT): ../../support/init.c + $(COMPILE.c) -I$(srcdir) -c $< + +noinst_PROGRAMS = ada_nsecs + +ada_nsecs_SOURCES = nsecs.adb config.h sptest.adb sptest.ads + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_nsecs.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/samples/nsecs/ada_nsecs.scn b/testsuites/ada/samples/nsecs/ada_nsecs.scn new file mode 100644 index 0000000000..458f12c874 --- /dev/null +++ b/testsuites/ada/samples/nsecs/ada_nsecs.scn @@ -0,0 +1,27 @@ +*** NANOSECOND CLOCK TEST *** +10 iterations of getting TOD NOT tested in Ada + +10 iterations of getting Uptime +0: 9025000 0: 9034000 --> 0: 9000 +0: 10724000 0: 10733000 --> 0: 9000 +0: 12400000 0: 12409000 --> 0: 9000 +0: 14076000 0: 14085000 --> 0: 9000 +0: 15752000 0: 15761000 --> 0: 9000 +0: 17428000 0: 17438000 --> 0: 10000 +0: 19108000 0: 19117000 --> 0: 9000 +0: 20814000 0: 20823000 --> 0: 9000 +0: 22490000 0: 22499000 --> 0: 9000 +0: 24166000 0: 24175000 --> 0: 9000 + +10 iterations of getting Uptime with different loop values +loop of 10000 0: 26747000 0: 29758000 --> 0: 3011000 +loop of 20000 0: 31927000 0: 37938000 --> 0: 6011000 +loop of 30000 0: 40108000 0: 49118000 --> 0: 9010000 +loop of 40000 0: 51287000 0: 63327000 --> 0: 12040000 +loop of 50000 0: 65471000 0: 80541000 --> 0: 15070000 +loop of 60000 0: 82684000 0:100754000 --> 0: 18070000 +loop of 70000 0:102892000 0:123963000 --> 0: 21071000 +loop of 80000 0:126096000 0:150196000 --> 0: 24100000 +loop of 90000 0:152329000 0:179399000 --> 0: 27070000 +loop of 100000 0:181562000 0:211662000 --> 0: 30100000 +*** END OF NANOSECOND CLOCK TEST *** diff --git a/testsuites/ada/samples/nsecs/config.h b/testsuites/ada/samples/nsecs/config.h new file mode 100644 index 0000000000..7703e721f0 --- /dev/null +++ b/testsuites/ada/samples/nsecs/config.h @@ -0,0 +1,30 @@ +/* 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_APPLICATION + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#define CONFIGURE_MAXIMUM_TASKS 1 + +#include + +/* end of include file */ diff --git a/testsuites/ada/samples/nsecs/nsecs.adb b/testsuites/ada/samples/nsecs/nsecs.adb new file mode 100644 index 0000000000..0a8f84a606 --- /dev/null +++ b/testsuites/ada/samples/nsecs/nsecs.adb @@ -0,0 +1,54 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test Nsecs of the Sample 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 Nsecs 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 Nsecs; + diff --git a/testsuites/ada/samples/nsecs/sptest.adb b/testsuites/ada/samples/nsecs/sptest.adb new file mode 100644 index 0000000000..193fa09a45 --- /dev/null +++ b/testsuites/ada/samples/nsecs/sptest.adb @@ -0,0 +1,153 @@ +-- +-- SPTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of the Nanosecond test of the +-- Sample 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 Ada.Integer_Text_IO; +with Interfaces.C; +with RTEMS; +with RTEMS.Clock; +with Text_IO; +use type Interfaces.C.Long; +use type RTEMS.Time_T; + +package body SPTEST is + + Dummy_Variable : Natural := 0; + + procedure Simple_Procedure is + begin + Dummy_Variable := Dummy_Variable + 1; + end Simple_Procedure; + + procedure Subtract_Em ( + Start : in RTEMS.Timespec; + Stop : in RTEMS.Timespec; + Result : out RTEMS.Timespec + ) is + Nanoseconds_Per_Second : constant := 1000000000; + begin + if (Stop.TV_Nsec < Start.TV_Nsec) then + Result.TV_Sec := Stop.TV_Sec - Start.TV_Sec - 1; + Result.TV_Nsec := + (Nanoseconds_Per_Second - Start.TV_Nsec) + Stop.TV_Nsec; + else + Result.TV_Sec := Stop.TV_Sec - Start.TV_Sec; + Result.TV_Nsec := Stop.TV_Nsec - Start.TV_Nsec; + end if; + end Subtract_Em; + + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + Status : RTEMS.Status_Codes; + Start : RTEMS.Timespec; + Stop : RTEMS.Timespec; + Diff : RTEMS.Timespec; + Max : Integer; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** NANOSECOND CLOCK TEST ***" ); + + -- + -- Iterate 10 times showing difference in TOD + -- + + TEXT_IO.PUT_LINE( "10 iterations of getting TOD NOT tested in Ada" ); + + -- + -- Iterate 10 times showing difference in Uptime + -- + + TEXT_IO.NEW_LINE; + TEXT_IO.PUT_LINE( "10 iterations of getting Uptime" ); + + for Index in 1 .. 10 loop + + RTEMS.Clock.Get_Uptime( Start, Status ); + RTEMS.Clock.Get_Uptime( Stop, Status ); + + Subtract_Em( Start, Stop, Diff ); + + Ada.Integer_Text_IO.Put( Integer( Start.TV_Sec ), 1 ); + Text_IO.Put( ":" ); + Ada.Integer_Text_IO.Put( Integer( Start.TV_Nsec ), 9 ); + Text_IO.Put( " " ); + Ada.Integer_Text_IO.Put( Integer( Stop.TV_Sec ), 1 ); + Text_IO.Put( ":" ); + Ada.Integer_Text_IO.Put( Integer( Stop.TV_Nsec ), 9 ); + Text_IO.Put( " --> " ); + Ada.Integer_Text_IO.Put( Integer( Diff.TV_Sec ), 1 ); + Text_IO.Put( ":" ); + Ada.Integer_Text_IO.Put( Integer( Diff.TV_Nsec ), 9 ); + Text_IO.New_Line; + end loop; + + -- + -- Iterate 10 times showing difference in Uptime with different counts + -- + + TEXT_IO.NEW_LINE; + TEXT_IO.PUT_LINE( + "10 iterations of getting Uptime with different loop values" + ); + + for Index in 1 .. 10 loop + Max := (Index * 10000); + RTEMS.Clock.Get_Uptime( Start, Status ); + for j in 1 .. Max loop + Simple_Procedure; + end loop; + RTEMS.Clock.Get_Uptime( Stop, Status ); + + Subtract_Em( Start, Stop, Diff ); + + Text_IO.Put( "loop of " ); + Ada.Integer_Text_IO.Put( Max, 6 ); + Text_IO.Put( " " ); + Ada.Integer_Text_IO.Put( Integer( Start.TV_Sec ), 1 ); + Text_IO.Put( ":" ); + Ada.Integer_Text_IO.Put( Integer( Start.TV_Nsec ), 9 ); + Text_IO.Put( " " ); + Ada.Integer_Text_IO.Put( Integer( Stop.TV_Sec ), 1 ); + Text_IO.Put( ":" ); + Ada.Integer_Text_IO.Put( Integer( Stop.TV_Nsec ), 9 ); + Text_IO.Put( " --> " ); + Ada.Integer_Text_IO.Put( Integer( Diff.TV_Sec ), 1 ); + Text_IO.Put( ":" ); + Ada.Integer_Text_IO.Put( Integer( Diff.TV_Nsec ), 9 ); + Text_IO.New_Line; + + end loop; + + delay( 1.0 ); + + TEXT_IO.PUT_LINE( "*** END OF NANOSECOND CLOCK TEST ***" ); + + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end INIT; + +end SPTEST; diff --git a/testsuites/ada/samples/nsecs/sptest.ads b/testsuites/ada/samples/nsecs/sptest.ads new file mode 100644 index 0000000000..97fa00ac2c --- /dev/null +++ b/testsuites/ada/samples/nsecs/sptest.ads @@ -0,0 +1,39 @@ +-- +-- SPTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for the Nsecs Test of the RTEMS +-- Sample 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; + +package SPTEST is + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +end SPTEST; diff --git a/testsuites/ada/samples/ticker/Makefile.am b/testsuites/ada/samples/ticker/Makefile.am new file mode 100644 index 0000000000..12594586b3 --- /dev/null +++ b/testsuites/ada/samples/ticker/Makefile.am @@ -0,0 +1,19 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +ada_ticker$(EXEEXT): ticker.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +init.$(OBJEXT): ../../support/init.c + $(COMPILE.c) -I$(srcdir) -c $< + +noinst_PROGRAMS = ada_ticker + +ada_ticker_SOURCES = ticker.adb config.h sptest.adb sptest.ads + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_ticker.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/samples/ticker/ada_ticker.scn b/testsuites/ada/samples/ticker/ada_ticker.scn new file mode 100644 index 0000000000..89cd8b3204 --- /dev/null +++ b/testsuites/ada/samples/ticker/ada_ticker.scn @@ -0,0 +1,16 @@ +*** TEST 1 *** +TA1 - clock_get - 9: 0: 0 12/31/1988 +TA2 - clock_get - 9: 0: 0 12/31/1988 +TA3 - clock_get - 9: 0: 0 12/31/1988 +TA1 - clock_get - 9: 0: 5 12/31/1988 +TA2 - clock_get - 9: 0:10 12/31/1988 +TA1 - clock_get - 9: 0:10 12/31/1988 +TA3 - clock_get - 9: 0:15 12/31/1988 +TA1 - clock_get - 9: 0:15 12/31/1988 +TA2 - clock_get - 9: 0:20 12/31/1988 +TA1 - clock_get - 9: 0:20 12/31/1988 +TA1 - clock_get - 9: 0:25 12/31/1988 +TA3 - clock_get - 9: 0:30 12/31/1988 +TA1 - clock_get - 9: 0:30 12/31/1988 +TA2 - clock_get - 9: 0:30 12/31/1988 +*** END OF CLOCK TICK TEST *** diff --git a/testsuites/ada/samples/ticker/config.h b/testsuites/ada/samples/ticker/config.h new file mode 100644 index 0000000000..17d957c94a --- /dev/null +++ b/testsuites/ada/samples/ticker/config.h @@ -0,0 +1,30 @@ +/* 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_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#define CONFIGURE_MAXIMUM_TASKS 4 + +#include + +/* end of include file */ diff --git a/testsuites/ada/samples/ticker/sptest.adb b/testsuites/ada/samples/ticker/sptest.adb new file mode 100644 index 0000000000..2de8b35b79 --- /dev/null +++ b/testsuites/ada/samples/ticker/sptest.adb @@ -0,0 +1,159 @@ +-- +-- SPTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 1 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 INTERFACES; use INTERFACES; +with TEST_SUPPORT; +with TEXT_IO; +with RTEMS.CLOCK; + +package body SPTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + TIME : RTEMS.TIME_OF_DAY; + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TEST 1 ***" ); + + TIME := ( 1988, 12, 31, 9, 0, 0, 0 ); + + RTEMS.CLOCK.SET( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET" ); + + SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); + SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' ); + SPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' ); + + 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.CREATE( + SPTEST.TASK_NAME( 2 ), + 1, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 2 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 3 ), + 1, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 3 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA3" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 1 ), + SPTEST.TASK_1_THROUGH_3'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 2 ), + SPTEST.TASK_1_THROUGH_3'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 3 ), + SPTEST.TASK_1_THROUGH_3'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA3" ); + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- TASK_1_THROUGH_3 +-- + + procedure TASK_1_THROUGH_3 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + TID : RTEMS.ID; + TIME : RTEMS.TIME_OF_DAY; + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.TASKS.IDENT( RTEMS.SELF, RTEMS.SEARCH_ALL_NODES, TID, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF SELF" ); + + loop + + RTEMS.CLOCK.GET_TOD( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); + + if TIME.SECOND >= 35 then + TEXT_IO.PUT_LINE( "*** END OF CLOCK TICK TEST ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + end if; + + TEST_SUPPORT.PUT_NAME( + SPTEST.TASK_NAME( TEST_SUPPORT.TASK_NUMBER( TID ) ), + FALSE + ); + + TEST_SUPPORT.PRINT_TIME( "- clock_get - ", TIME, "" ); + TEXT_IO.NEW_LINE; + + RTEMS.TASKS.WAKE_AFTER( + TEST_SUPPORT.TASK_NUMBER( TID ) * 5 * + TEST_SUPPORT.TICKS_PER_SECOND, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + end loop; + + end TASK_1_THROUGH_3; + +end SPTEST; diff --git a/testsuites/ada/samples/ticker/sptest.ads b/testsuites/ada/samples/ticker/sptest.ads new file mode 100644 index 0000000000..8753d3edad --- /dev/null +++ b/testsuites/ada/samples/ticker/sptest.ads @@ -0,0 +1,60 @@ +-- +-- SPTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 1 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; + +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 .. 3 ) of RTEMS.ID; + TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- TASK_1_THROUGH_3 +-- +-- DESCRIPTION: +-- +-- This is the body of the RTEMS tasks which constitute this test. +-- + + procedure TASK_1_THROUGH_3 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_1_THROUGH_3); + +end SPTEST; diff --git a/testsuites/ada/samples/ticker/ticker.adb b/testsuites/ada/samples/ticker/ticker.adb new file mode 100644 index 0000000000..08a1fb9e31 --- /dev/null +++ b/testsuites/ada/samples/ticker/ticker.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test Ticker of the Sample 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 Ticker 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 Ticker; + diff --git a/testsuites/ada/sptests/Makefile.am b/testsuites/ada/sptests/Makefile.am new file mode 100644 index 0000000000..fda256fe4c --- /dev/null +++ b/testsuites/ada/sptests/Makefile.am @@ -0,0 +1,28 @@ +_SUBDIRS = +_SUBDIRS += sp01 +_SUBDIRS += sp02 +_SUBDIRS += sp03 +_SUBDIRS += sp04 +_SUBDIRS += sp05 +_SUBDIRS += sp06 +_SUBDIRS += sp07 +_SUBDIRS += sp08 +_SUBDIRS += sp09 +_SUBDIRS += sp11 +_SUBDIRS += sp12 +_SUBDIRS += sp13 +_SUBDIRS += sp14 +_SUBDIRS += sp15 +_SUBDIRS += sp16 +_SUBDIRS += sp17 +_SUBDIRS += sp19 +_SUBDIRS += sp20 +_SUBDIRS += sp22 +_SUBDIRS += sp23 +_SUBDIRS += sp24 +_SUBDIRS += sp25 +_SUBDIRS += spname01 +_SUBDIRS += spatcb01 + +include $(top_srcdir)/../automake/subdirs.am +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/sptests/sp01/Makefile.am b/testsuites/ada/sptests/sp01/Makefile.am new file mode 100644 index 0000000000..0fc6a6d6d6 --- /dev/null +++ b/testsuites/ada/sptests/sp01/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_sp01 +ada_sp01_SOURCES = sp01.adb config.h sptest.adb sptest.ads +ada_sp01_SOURCES += ../../support/init.c + +ada_sp01$(EXEEXT): sp01.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_sp01.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/sptests/sp01/ada_sp01.scn b/testsuites/ada/sptests/sp01/ada_sp01.scn new file mode 100644 index 0000000000..7ba3bea626 --- /dev/null +++ b/testsuites/ada/sptests/sp01/ada_sp01.scn @@ -0,0 +1,16 @@ +*** TEST 1 *** +TA1 - clock_get - 9: 0: 0 12/31/1988 +TA2 - clock_get - 9: 0: 0 12/31/1988 +TA3 - clock_get - 9: 0: 0 12/31/1988 +TA1 - clock_get - 9: 0: 5 12/31/1988 +TA1 - clock_get - 9: 0:10 12/31/1988 +TA2 - clock_get - 9: 0:10 12/31/1988 +TA1 - clock_get - 9: 0:15 12/31/1988 +TA3 - clock_get - 9: 0:15 12/31/1988 +TA1 - clock_get - 9: 0:20 12/31/1988 +TA2 - clock_get - 9: 0:20 12/31/1988 +TA1 - clock_get - 9: 0:25 12/31/1988 +TA1 - clock_get - 9: 0:30 12/31/1988 +TA3 - clock_get - 9: 0:30 12/31/1988 +TA2 - clock_get - 9: 0:30 12/31/1988 +*** END OF TEST 1 *** diff --git a/testsuites/ada/sptests/sp01/config.h b/testsuites/ada/sptests/sp01/config.h new file mode 100644 index 0000000000..3a11342306 --- /dev/null +++ b/testsuites/ada/sptests/sp01/config.h @@ -0,0 +1,30 @@ +/* config.h + * + * This include file defines the Configuration Table for this test. + * + * COPYRIGHT (c) 1989-1997. + * 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_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#define CONFIGURE_MAXIMUM_TASKS 4 + +#include + +/* end of include file */ diff --git a/testsuites/ada/sptests/sp01/sp01.adb b/testsuites/ada/sptests/sp01/sp01.adb new file mode 100644 index 0000000000..656a6ff009 --- /dev/null +++ b/testsuites/ada/sptests/sp01/sp01.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test SP01 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 SP01 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 SP01; + diff --git a/testsuites/ada/sptests/sp01/sptest.adb b/testsuites/ada/sptests/sp01/sptest.adb new file mode 100644 index 0000000000..46e48e9b04 --- /dev/null +++ b/testsuites/ada/sptests/sp01/sptest.adb @@ -0,0 +1,159 @@ +-- +-- SPTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 1 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 INTERFACES; use INTERFACES; +with TEST_SUPPORT; +with TEXT_IO; +with RTEMS.CLOCK; + +package body SPTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + TIME : RTEMS.TIME_OF_DAY; + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TEST 1 ***" ); + + TIME := ( 1988, 12, 31, 9, 0, 0, 0 ); + + RTEMS.CLOCK.SET( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET" ); + + SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); + SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' ); + SPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 1 ), + 1, + 2048, + RTEMS.INTERRUPT_LEVEL( 31 ), + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 2 ), + 1, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 2 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 3 ), + 1, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 3 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA3" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 1 ), + SPTEST.TASK_1_THROUGH_3'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 2 ), + SPTEST.TASK_1_THROUGH_3'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 3 ), + SPTEST.TASK_1_THROUGH_3'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA3" ); + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- TASK_1_THROUGH_3 +-- + + procedure TASK_1_THROUGH_3 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + TID : RTEMS.ID; + TIME : RTEMS.TIME_OF_DAY; + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.TASKS.IDENT( RTEMS.SELF, RTEMS.SEARCH_ALL_NODES, TID, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF SELF" ); + + loop + + RTEMS.CLOCK.GET_TOD( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); + + if TIME.SECOND >= 35 then + TEXT_IO.PUT_LINE( "*** END OF TEST 1 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + end if; + + TEST_SUPPORT.PUT_NAME( + SPTEST.TASK_NAME( TEST_SUPPORT.TASK_NUMBER( TID ) ), + FALSE + ); + + TEST_SUPPORT.PRINT_TIME( "- clock_get - ", TIME, "" ); + TEXT_IO.NEW_LINE; + + RTEMS.TASKS.WAKE_AFTER( + TEST_SUPPORT.TASK_NUMBER( TID ) * 5 * + TEST_SUPPORT.TICKS_PER_SECOND, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + end loop; + + end TASK_1_THROUGH_3; + +end SPTEST; diff --git a/testsuites/ada/sptests/sp01/sptest.ads b/testsuites/ada/sptests/sp01/sptest.ads new file mode 100644 index 0000000000..8753d3edad --- /dev/null +++ b/testsuites/ada/sptests/sp01/sptest.ads @@ -0,0 +1,60 @@ +-- +-- SPTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 1 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; + +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 .. 3 ) of RTEMS.ID; + TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- TASK_1_THROUGH_3 +-- +-- DESCRIPTION: +-- +-- This is the body of the RTEMS tasks which constitute this test. +-- + + procedure TASK_1_THROUGH_3 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_1_THROUGH_3); + +end SPTEST; diff --git a/testsuites/ada/sptests/sp02/Makefile.am b/testsuites/ada/sptests/sp02/Makefile.am new file mode 100644 index 0000000000..7e681207ef --- /dev/null +++ b/testsuites/ada/sptests/sp02/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_sp02 +ada_sp02_SOURCES = sp02.adb config.h sptest.adb sptest.ads +ada_sp02_SOURCES += ../../support/init.c + +ada_sp02$(EXEEXT): sp02.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_sp02.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/sptests/sp02/ada_sp02.scn b/testsuites/ada/sptests/sp02/ada_sp02.scn new file mode 100644 index 0000000000..722dfff1de --- /dev/null +++ b/testsuites/ada/sptests/sp02/ada_sp02.scn @@ -0,0 +1,15 @@ +*** TEST 2 *** +INIT - task_wake_after - yielding processor +PREEMPT - task_delete - deleting self +INIT - suspending TA2 while middle task on a ready chain +TA1 - task_wake_after - sleep 1 second +TA2 - task_wake_after - sleep 1 minute +TA3 - task_wake_after - sleep 5 seconds +TA1 - task_ident - tid of TA2 (16#A010004#) +TA1 - task_ident - tid of TA3 (16#A010002#) +TA1 - task_set_priority - set TA3's priority to 2 +TA1 - task_suspend - suspend TA2 +TA1 - task_delete - delete TA2 +TA1 - task_wake_after - sleep for 5 seconds +TA3 - task_delete - delete self +*** END OF TEST 2 *** diff --git a/testsuites/ada/sptests/sp02/config.h b/testsuites/ada/sptests/sp02/config.h new file mode 100644 index 0000000000..17d957c94a --- /dev/null +++ b/testsuites/ada/sptests/sp02/config.h @@ -0,0 +1,30 @@ +/* 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_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#define CONFIGURE_MAXIMUM_TASKS 4 + +#include + +/* end of include file */ diff --git a/testsuites/ada/sptests/sp02/sp02.adb b/testsuites/ada/sptests/sp02/sp02.adb new file mode 100644 index 0000000000..adbc97f66c --- /dev/null +++ b/testsuites/ada/sptests/sp02/sp02.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test SP02 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 SP02 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 SP02; + diff --git a/testsuites/ada/sptests/sp02/sptest.adb b/testsuites/ada/sptests/sp02/sptest.adb new file mode 100644 index 0000000000..45fb4ac5c2 --- /dev/null +++ b/testsuites/ada/sptests/sp02/sptest.adb @@ -0,0 +1,327 @@ +-- +-- SPTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 2 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 INTERFACES; use INTERFACES; +with TEST_SUPPORT; +with TEXT_IO; +with UNSIGNED32_IO; + +package body SPTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TEST 2 ***" ); + + SPTEST.PREEMPT_TASK_NAME := RTEMS.BUILD_NAME( 'P', 'R', 'M', 'T' ); + + RTEMS.TASKS.CREATE( + SPTEST.PREEMPT_TASK_NAME, + 1, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.PREEMPT_TASK_ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF PREEMPT" ); + + RTEMS.TASKS.START( + SPTEST.PREEMPT_TASK_ID, + SPTEST.PREEMPT_TASK'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF PREEMPT" ); + + TEXT_IO.PUT_LINE( "INIT - task_wake_after - yielding processor" ); + RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); + SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' ); + SPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 1 ), + 3, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 2 ), + 3, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 2 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 3 ), + 3, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 3 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA3" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 1 ), + SPTEST.TASK_1'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 2 ), + SPTEST.TASK_2'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 3 ), + SPTEST.TASK_3'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA3" ); + + TEXT_IO.PUT_LINE( + "INIT - suspending TA2 while middle task on a ready chain" + ); + + RTEMS.TASKS.SUSPEND( SPTEST.TASK_ID( 2 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND OF TA2" ); + + RTEMS.TASKS.DELETE( SPTEST.TASK_ID( 1 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA1" ); + + RTEMS.TASKS.DELETE( SPTEST.TASK_ID( 2 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA2" ); + + RTEMS.TASKS.DELETE( SPTEST.TASK_ID( 3 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA3" ); + + 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.CREATE( + SPTEST.TASK_NAME( 2 ), + 3, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 2 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 3 ), + 3, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 3 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA3" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 1 ), + SPTEST.TASK_1'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 2 ), + SPTEST.TASK_2'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 3 ), + SPTEST.TASK_3'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA3" ); + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- PREEMPT_TASK +-- + + procedure PREEMPT_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.PUT_LINE( "PREEMPT - task_delete - deleting self" ); + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF PREEMPT" ); + + end PREEMPT_TASK; + +-- +-- TASK_1 +-- + + procedure TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + TID2 : RTEMS.ID; + TID3 : RTEMS.ID; + STATUS : RTEMS.STATUS_CODES; + PREVIOUS_PRIORITY : RTEMS.TASKS.PRIORITY; + begin + + TEXT_IO.PUT_LINE( "TA1 - task_wake_after - sleep 1 second" ); + RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + RTEMS.TASKS.IDENT( + SPTEST.TASK_NAME( 2 ), + RTEMS.SEARCH_ALL_NODES, + TID2, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF TA2" ); + + TEXT_IO.PUT( "TA1 - task_ident - tid of TA2 (" ); + UNSIGNED32_IO.PUT( TID2, WIDTH => 8, BASE => 10#16# ); + TEXT_IO.PUT_LINE( ")" ); + + RTEMS.TASKS.IDENT( + SPTEST.TASK_NAME( 3 ), + RTEMS.SEARCH_ALL_NODES, + TID3, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF TA3" ); + + TEXT_IO.PUT( "TA1 - task_ident - tid of TA3 (" ); + UNSIGNED32_IO.PUT( TID3, WIDTH => 8, BASE => 10#16# ); + TEXT_IO.PUT_LINE( ")" ); + + RTEMS.TASKS.SET_PRIORITY( TID3, 2, PREVIOUS_PRIORITY, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" ); + + TEXT_IO.PUT_LINE( + "TA1 - task_set_priority - set TA3's priority to 2" + ); + + TEXT_IO.PUT_LINE( "TA1 - task_suspend - suspend TA2" ); + RTEMS.TASKS.SUSPEND( TID2, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND OF TA2" ); + + TEXT_IO.PUT_LINE( "TA1 - task_delete - delete TA2" ); + RTEMS.TASKS.DELETE( TID2, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA2" ); + + TEXT_IO.PUT_LINE( "TA1 - task_wake_after - sleep for 5 seconds" ); + RTEMS.TASKS.WAKE_AFTER( 5 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + TEXT_IO.PUT_LINE( "*** END OF TEST 2 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end TASK_1; + +-- +-- TASK_2 +-- + + procedure TASK_2 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.PUT_LINE( "TA2 - task_wake_after - sleep 1 minute" ); + RTEMS.TASKS.WAKE_AFTER( 60 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER IN TA2" ); + + end TASK_2; + +-- +-- TASK_3 +-- + + procedure TASK_3 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.PUT_LINE( "TA3 - task_wake_after - sleep 5 seconds" ); + RTEMS.TASKS.WAKE_AFTER( 5 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER IN TA3" ); + + TEXT_IO.PUT_LINE( "TA3 - task_delete - delete self" ); + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA3" ); + + end TASK_3; + +end SPTEST; diff --git a/testsuites/ada/sptests/sp02/sptest.ads b/testsuites/ada/sptests/sp02/sptest.ads new file mode 100644 index 0000000000..20122e3cbd --- /dev/null +++ b/testsuites/ada/sptests/sp02/sptest.ads @@ -0,0 +1,102 @@ +-- +-- SPTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 2 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; + +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 .. 3 ) of RTEMS.ID; + TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; + + PREEMPT_TASK_ID : RTEMS.ID; + PREEMPT_TASK_NAME : RTEMS.NAME; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- PREEMPT_TASK +-- +-- DESCRIPTION: +-- +-- This RTEMS task tests the basic preemption capability. +-- + + procedure PREEMPT_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, PREEMPT_TASK); + +-- +-- TASK_1 +-- +-- DESCRIPTION: +-- +-- This RTEMS task tests some of the capabilities of the Task Manager. +-- + + procedure TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_1); + +-- +-- TASK_2 +-- +-- DESCRIPTION: +-- +-- This RTEMS task tests some of the capabilities of the Task Manager. +-- + + procedure TASK_2 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_2); + +-- +-- TASK_3 +-- +-- DESCRIPTION: +-- +-- This RTEMS task tests some of the capabilities of the Task Manager. +-- + + procedure TASK_3 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_3); + +end SPTEST; diff --git a/testsuites/ada/sptests/sp03/Makefile.am b/testsuites/ada/sptests/sp03/Makefile.am new file mode 100644 index 0000000000..9a7ccfa1b8 --- /dev/null +++ b/testsuites/ada/sptests/sp03/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_sp03 +ada_sp03_SOURCES = sp03.adb config.h sptest.adb sptest.ads +ada_sp03_SOURCES += ../../support/init.c + +ada_sp03$(EXEEXT): sp03.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_sp03.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/sptests/sp03/ada_sp03.scn b/testsuites/ada/sptests/sp03/ada_sp03.scn new file mode 100644 index 0000000000..a2a04c6951 --- /dev/null +++ b/testsuites/ada/sptests/sp03/ada_sp03.scn @@ -0,0 +1,26 @@ +*** TEST 3 *** +TA1 sets clock: 9:15: 0 12/31/1988 +TA1 going to sleep: 9:15: 0 12/31/1988 +TA2 9:15: 1 12/31/1988 +TA2 9:15: 2 12/31/1988 +TA2 9:15: 3 12/31/1988 +TA2 9:15: 4 12/31/1988 +TA1 awakened: 9:15: 5 12/31/1988 +TA1 going to sleep: 9:15: 5 12/31/1988 +TA2 9:15: 5 12/31/1988 +TA2 9:15: 6 12/31/1988 +TA2 9:15: 7 12/31/1988 +TA2 9:15: 8 12/31/1988 +TA2 9:15: 9 12/31/1988 +TA1 awakened: 9:15:10 12/31/1988 +TA1 going to sleep: 9:15:10 12/31/1988 +TA2 9:15:10 12/31/1988 +TA2 9:15:11 12/31/1988 +TA2 9:15:12 12/31/1988 +TA2 9:15:13 12/31/1988 +TA2 9:15:14 12/31/1988 +TA1 awakened: 9:15:15 12/31/1988 +TA1 going to sleep: 9:15:15 12/31/1988 +TA2 9:15:15 12/31/1988 +TA2 9:15:16 12/31/1988 +*** END OF TEST 3 *** diff --git a/testsuites/ada/sptests/sp03/config.h b/testsuites/ada/sptests/sp03/config.h new file mode 100644 index 0000000000..393afc4b28 --- /dev/null +++ b/testsuites/ada/sptests/sp03/config.h @@ -0,0 +1,30 @@ +/* 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_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#define CONFIGURE_MAXIMUM_TASKS 3 + +#include + +/* end of include file */ diff --git a/testsuites/ada/sptests/sp03/sp03.adb b/testsuites/ada/sptests/sp03/sp03.adb new file mode 100644 index 0000000000..5f081d4879 --- /dev/null +++ b/testsuites/ada/sptests/sp03/sp03.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test SP03 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 SP03 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 SP03; + diff --git a/testsuites/ada/sptests/sp03/sptest.adb b/testsuites/ada/sptests/sp03/sptest.adb new file mode 100644 index 0000000000..24be47eb1c --- /dev/null +++ b/testsuites/ada/sptests/sp03/sptest.adb @@ -0,0 +1,169 @@ +-- +-- SPTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 3 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 INTERFACES; use INTERFACES; +with TEST_SUPPORT; +with TEXT_IO; +with RTEMS.CLOCK; + +package body SPTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TEST 3 ***" ); + + SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); + SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 1 ), + 1, + RTEMS.MINIMUM_STACK_SIZE, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 2 ), + 1, + RTEMS.MINIMUM_STACK_SIZE, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 2 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 1 ), + SPTEST.TASK_1'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 2 ), + SPTEST.TASK_2'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" ); + + 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); + TIME : RTEMS.TIME_OF_DAY; + STATUS : RTEMS.STATUS_CODES; + begin + + TIME := ( 1988, 12, 31, 9, 15, 0, 0 ); + + RTEMS.CLOCK.SET( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET" ); + + TEST_SUPPORT.PUT_NAME( SPTEST.TASK_NAME( 1 ), FALSE ); + TEST_SUPPORT.PRINT_TIME( "sets clock: ", TIME, "" ); + TEXT_IO.NEW_LINE; + + loop + + RTEMS.CLOCK.GET_TOD( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); + + TEST_SUPPORT.PUT_NAME( SPTEST.TASK_NAME( 1 ), FALSE ); + TEST_SUPPORT.PRINT_TIME( "going to sleep: ", TIME, "" ); + TEXT_IO.NEW_LINE; + + TIME.SECOND := TIME.SECOND + 5; + TIME.MINUTE := TIME.MINUTE + (TIME.SECOND / 60 ); + TIME.SECOND := TIME.SECOND mod 60; + TIME.HOUR := TIME.HOUR + (TIME.MINUTE / 60 ); + TIME.MINUTE := TIME.MINUTE mod 60; + TIME.HOUR := TIME.HOUR mod 24; + + RTEMS.TASKS.WAKE_WHEN( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_WHEN" ); + + TEST_SUPPORT.PUT_NAME( SPTEST.TASK_NAME( 1 ), FALSE ); + TEST_SUPPORT.PRINT_TIME( "awakened: ", TIME, "" ); + TEXT_IO.NEW_LINE; + + end loop; + + end TASK_1; + +-- +-- TASK_2 +-- + + procedure TASK_2 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + TIME : RTEMS.TIME_OF_DAY; + STATUS : RTEMS.STATUS_CODES; + begin + + loop + + RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + RTEMS.CLOCK.GET_TOD( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); + + if TIME.SECOND >= 17 then + TEXT_IO.PUT_LINE( "*** END OF TEST 3 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + end if; + + TEST_SUPPORT.PUT_NAME( SPTEST.TASK_NAME( 2 ), FALSE ); + TEST_SUPPORT.PRINT_TIME( " ", TIME, "" ); + TEXT_IO.NEW_LINE; + + end loop; + + end TASK_2; + +end SPTEST; diff --git a/testsuites/ada/sptests/sp03/sptest.ads b/testsuites/ada/sptests/sp03/sptest.ads new file mode 100644 index 0000000000..60a2531ba1 --- /dev/null +++ b/testsuites/ada/sptests/sp03/sptest.ads @@ -0,0 +1,75 @@ +-- +-- SPTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 3 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; + +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 .. 3 ) of RTEMS.ID; + TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; + +-- +-- 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 TASK_WAKE_WHEN directive of +-- the Task Manager. +-- + + procedure TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_1); + +-- +-- TASK_2 +-- +-- DESCRIPTION: +-- +-- This RTEMS task tests the TASK_WAKE_AFTER directive of +-- the Task Manager. +-- + + procedure TASK_2 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_2); + +end SPTEST; diff --git a/testsuites/ada/sptests/sp04/Makefile.am b/testsuites/ada/sptests/sp04/Makefile.am new file mode 100644 index 0000000000..fc5d2be018 --- /dev/null +++ b/testsuites/ada/sptests/sp04/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_sp04 +ada_sp04_SOURCES = sp04.adb config.h sptest.adb sptest.ads +ada_sp04_SOURCES += ../../support/init.c + +ada_sp04$(EXEEXT): sp04.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_sp04.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/sptests/sp04/README b/testsuites/ada/sptests/sp04/README new file mode 100644 index 0000000000..43ff165261 --- /dev/null +++ b/testsuites/ada/sptests/sp04/README @@ -0,0 +1,9 @@ +This test is broken as it is currently implemented. It is illegal for +a task to do Ada IO during a extension since the Ada run-time uses +locks to safeguard data structures. Dispatching is disabled and the +call to Text_IO in the Switch extension will lock the system up. + +The proper solution is to have the Switch extension lock task and +time when it a switch occurs and have a single task print this +information as necessary. + diff --git a/testsuites/ada/sptests/sp04/ada_sp04.scn b/testsuites/ada/sptests/sp04/ada_sp04.scn new file mode 100644 index 0000000000..76d9f0c665 --- /dev/null +++ b/testsuites/ada/sptests/sp04/ada_sp04.scn @@ -0,0 +1,25 @@ +*** TEST 4 *** +TA1 - task_suspend - on Task 2 +TA1 - task_suspend - on Task 3 +TA1 - killing time +TA1 - task_resume - on Task 2 +TA1 - task_resume - on Task 3 +TA1 - task_mode - change mode to NO PREEMPT +TA1 - 9:15:10 12/31/1988 +TA1 - 9:15:11 12/31/1988 +TA1 - 9:15:12 12/31/1988 +TA1 - 9:15:13 12/31/1988 +TA1 - 9:15:14 12/31/1988 +TA1 - 9:15:15 12/31/1988 +TA1 - task_mode - change mode to PREEMPT +TA1 - 9:15: 0 12/31/1988 +TA2 - 9:15: 4 12/31/1988 +TA3 - 9:15: 5 12/31/1988 +TA1 - 9:15: 6 12/31/1988 +TA2 - 9:15: 7 12/31/1988 +TA3 - 9:15: 8 12/31/1988 +TA1 - 9:15: 9 12/31/1988 +TA2 - 9:15:16 12/31/1988 +TA3 - 9:15:17 12/31/1988 +TA1 - 9:15:18 12/31/1988 +*** END OF TEST 4 *** diff --git a/testsuites/ada/sptests/sp04/config.h b/testsuites/ada/sptests/sp04/config.h new file mode 100644 index 0000000000..45fc324df8 --- /dev/null +++ b/testsuites/ada/sptests/sp04/config.h @@ -0,0 +1,33 @@ +/* config.h + * + * This include file defines the Configuration Table for this test. + * + * COPYRIGHT (c) 1989-1997. + * 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_USER_EXTENSIONS 1 +#define CONFIGURE_TICKS_PER_TIMESLICE 100 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#define CONFIGURE_MAXIMUM_TASKS 4 + +#include + +/* end of include file */ diff --git a/testsuites/ada/sptests/sp04/sp04.adb b/testsuites/ada/sptests/sp04/sp04.adb new file mode 100644 index 0000000000..9d91593b36 --- /dev/null +++ b/testsuites/ada/sptests/sp04/sp04.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test SP04 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 SP04 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 SP04; + diff --git a/testsuites/ada/sptests/sp04/sptest.adb b/testsuites/ada/sptests/sp04/sptest.adb new file mode 100644 index 0000000000..01283d3fec --- /dev/null +++ b/testsuites/ada/sptests/sp04/sptest.adb @@ -0,0 +1,348 @@ +-- +-- SPTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 4 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 INTERFACES; use INTERFACES; +with TEST_SUPPORT; +with TEXT_IO; +with RTEMS.CLOCK; +with RTEMS.EXTENSION; +with RTEMS.FATAL; + +package body SPTEST is + + TestsFinished : Boolean := False; + pragma Volatile (TestsFinished); + + type Task_Event is record + Task_Index : RTEMS.Unsigned32; + When_Switched : RTEMS.Time_Of_Day; + end record; + + Task_Events : array (1 .. 15) of Task_Event; + Task_Events_Index : Natural := Task_Events'First; + + procedure Log_Task_Event ( + Task_Index : RTEMS.Unsigned32; + When_Switched : RTEMS.Time_Of_Day + ) is + begin + if Task_Events_Index = Task_Events'Last then + RTEMS.Fatal.Error_Occurred ( 1 ); -- no other choice + else + Task_Events (Task_Events_Index).Task_Index := Task_Index; + Task_Events (Task_Events_Index).When_Switched := When_Switched; + Task_Events_Index := Task_Events_Index + 1; + end if; + end Log_Task_Event; + + procedure Flush_Task_Event_Log is + begin + for I in Task_Events'First .. Task_Events_Index - 1 loop + + TEST_SUPPORT.PUT_NAME( + SPTEST.TASK_NAME( Task_Events (I).Task_Index ), FALSE + ); + TEST_SUPPORT.PRINT_TIME( "- ", Task_Events (I).When_Switched, "" ); + TEXT_IO.NEW_LINE; + + end loop; + + end Flush_Task_Event_Log; + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + TIME : RTEMS.TIME_OF_DAY; + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TEST 4 ***" ); + + TIME := ( 1988, 12, 31, 9, 15, 0, 0 ); + + RTEMS.CLOCK.SET( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET" ); + + SPTEST.EXTENSION_NAME( 1 ) := RTEMS.BUILD_NAME( 'E', 'X', 'T', ' ' ); + + RTEMS.EXTENSION.CREATE( + SPTEST.EXTENSION_NAME( 1 ), + SPTEST.EXTENSIONS'ACCESS, + EXTENSION_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EXTENSION_CREATE" ); + + SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); + SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' ); + SPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' ); + + SPTEST.RUN_COUNT( 1 ) := 0; + SPTEST.RUN_COUNT( 2 ) := 0; + SPTEST.RUN_COUNT( 3 ) := 0; + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 1 ), + 1, + 2048, + RTEMS.TIMESLICE, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 2 ), + 1, + 2048, + RTEMS.TIMESLICE, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 2 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 3 ), + 1, + 2048, + RTEMS.TIMESLICE, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 3 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA3" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 1 ), + SPTEST.TASK_1'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 2 ), + SPTEST.TASK_2'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 3 ), + SPTEST.TASK_3'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA3" ); + + 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); + SECONDS : RTEMS.UNSIGNED32; + OLD_SECONDS : RTEMS.UNSIGNED32; + PREVIOUS_MODE : RTEMS.MODE; + TIME : RTEMS.TIME_OF_DAY; + START_TIME : RTEMS.INTERVAL; + END_TIME : RTEMS.INTERVAL; + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.PUT_LINE( "TA1 - task_suspend - on Task 2" ); + RTEMS.TASKS.SUSPEND( TASK_ID( 2 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND OF TA2" ); + + TEXT_IO.PUT_LINE( "TA1 - task_suspend - on Task 3" ); + RTEMS.TASKS.SUSPEND( TASK_ID( 3 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND OF TA3" ); + + TEXT_IO.PUT_LINE( "TA1 - killing time" ); + + RTEMS.CLOCK.GET_SECONDS_SINCE_EPOCH( START_TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_SECONDS_SINCE_EPOCH" ); + + loop + RTEMS.CLOCK.GET_SECONDS_SINCE_EPOCH( START_TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED(STATUS, "CLOCK_GET_SECONDS_SINCE_EPOCH"); + + exit when END_TIME > (START_TIME + 2); + end loop; + + TEXT_IO.PUT_LINE( "TA1 - task_resume - on Task 2" ); + RTEMS.TASKS.RESUME( TASK_ID( 2 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESUME OF TA2" ); + + TEXT_IO.PUT_LINE( "TA1 - task_resume - on Task 3" ); + RTEMS.TASKS.RESUME( TASK_ID( 3 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESUME OF TA3" ); + + loop + + if SPTEST.RUN_COUNT( 1 ) = 3 then + + TEXT_IO.PUT_LINE( + "TA1 - task_mode - change mode to NO PREEMPT" + ); + RTEMS.TASKS.MODE( + RTEMS.NO_PREEMPT, + RTEMS.PREEMPT_MASK, + PREVIOUS_MODE, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); + + RTEMS.CLOCK.GET_TOD( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); + + OLD_SECONDS := TIME.SECOND; + + SECONDS := 0; + loop + + exit when SECONDS >= 6; + + RTEMS.CLOCK.GET_TOD( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); + + if TIME.SECOND /= OLD_SECONDS then + OLD_SECONDS := TIME.SECOND; + SECONDS := SECONDS + 1; + TEST_SUPPORT.PRINT_TIME( "TA1 - ", TIME, "" ); + TEXT_IO.NEW_LINE; + end if; + + end loop; + + TEXT_IO.PUT_LINE( + "TA1 - task_mode - change mode to PREEMPT" + ); + + RTEMS.TASKS.MODE( + RTEMS.PREEMPT, + RTEMS.PREEMPT_MASK, + PREVIOUS_MODE, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); + + while not TestsFinished loop + NULL; + END LOOP; + Flush_Task_Event_Log; + TEXT_IO.PUT_LINE( "*** END OF TEST 4 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end if; + + end loop; + + end TASK_1; + +-- +-- TASK_2 +-- + + procedure TASK_2 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + begin + + LOOP + NULL; + END LOOP; + + end TASK_2; + +-- +-- TASK_3 +-- + + procedure TASK_3 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + begin + + LOOP + NULL; + END LOOP; + + end TASK_3; + +-- +-- TASK_SWITCH +-- + + procedure TASK_SWITCH ( + UNUSED : in RTEMS.TCB_POINTER; + HEIR : in RTEMS.TCB_POINTER + ) is + pragma Unreferenced(UNUSED); + INDEX : RTEMS.UNSIGNED32; + TIME : RTEMS.TIME_OF_DAY; + STATUS : RTEMS.STATUS_CODES; + function TCB_To_ID ( + TCB : RTEMS.TCB_POINTER + ) return RTEMS.ID; + pragma Import (C, TCB_To_ID, "tcb_to_id" ); + + begin + + INDEX := TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( HEIR ) ); + + case INDEX is + when 1 | 2 | 3 => + SPTEST.RUN_COUNT( INDEX ) := SPTEST.RUN_COUNT( INDEX ) + 1; + + RTEMS.CLOCK.GET_TOD( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); + + Log_Task_Event ( INDEX, TIME ); + + if TIME.SECOND >= 16 then + TestsFinished := True; + end if; + + when others => + NULL; + end case; + + end TASK_SWITCH; + +end SPTEST; diff --git a/testsuites/ada/sptests/sp04/sptest.ads b/testsuites/ada/sptests/sp04/sptest.ads new file mode 100644 index 0000000000..36f1202118 --- /dev/null +++ b/testsuites/ada/sptests/sp04/sptest.ads @@ -0,0 +1,136 @@ +-- +-- SPTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 4 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; + +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 .. 3 ) of RTEMS.ID; + TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS extensions created +-- by this test. +-- + + EXTENSION_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; + EXTENSION_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; + +-- +-- This array contains the number of times each of the test tasks has +-- been context switched TO. +-- + + RUN_COUNT : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.UNSIGNED32; + +-- +-- 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 some of the capabilities of the Task Manager. +-- + + procedure TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_1); + +-- +-- TASK_2 +-- +-- DESCRIPTION: +-- +-- This RTEMS task is used as a background task to suspend, resume, +-- and context switch to. +-- + + procedure TASK_2 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_2); + +-- +-- TASK_3 +-- +-- DESCRIPTION: +-- +-- This RTEMS task is used as a background task to suspend, resume, +-- and context switch to. +-- + + procedure TASK_3 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_3); + +-- +-- TASK_SWITCH +-- +-- DESCRIPTION: +-- +-- This subprogram is the TASK_SWITCH extension for this test. +-- It is invoked at each context switch and counts the number +-- of times each application task has been context switched to. +-- + + procedure TASK_SWITCH ( + UNUSED : in RTEMS.TCB_POINTER; + HEIR : in RTEMS.TCB_POINTER + ); + pragma Convention (C, TASK_SWITCH); + +-- +-- This is the User Extension Table for this test. +-- + + EXTENSIONS : aliased RTEMS.EXTENSIONS_TABLE := + ( + NULL, -- Task create + NULL, -- Task start + NULL, -- Task restart + NULL, -- Task delete + SPTEST.TASK_SWITCH'ACCESS, -- Task switch + NULL, -- Task post switch + NULL, -- Task begin + NULL, -- Task exitted + NULL -- Fatal error + ); + +end SPTEST; diff --git a/testsuites/ada/sptests/sp05/Makefile.am b/testsuites/ada/sptests/sp05/Makefile.am new file mode 100644 index 0000000000..d206e1b5da --- /dev/null +++ b/testsuites/ada/sptests/sp05/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_sp05 +ada_sp05_SOURCES = sp05.adb config.h sptest.adb sptest.ads +ada_sp05_SOURCES += ../../support/init.c + +ada_sp05$(EXEEXT): sp05.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_sp05.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/sptests/sp05/ada_sp05.scn b/testsuites/ada/sptests/sp05/ada_sp05.scn new file mode 100644 index 0000000000..591397f760 --- /dev/null +++ b/testsuites/ada/sptests/sp05/ada_sp05.scn @@ -0,0 +1,47 @@ +*** TEST 5 *** +TA1 - task_wake_after - sleep 5 seconds +TA2 - task_suspend - suspend self +TA3 - task_suspend - suspend self +TA1 - task_suspend - suspend TA3 +TA1 - task_resume - resume TA2 +TA1 - task_wake_after - sleep 5 seconds +TA2 - task_wake_after - sleep 1 second +TA2 - task_wake_after - sleep 1 second +TA2 - task_wake_after - sleep 1 second +TA2 - task_wake_after - sleep 1 second +TA2 - task_wake_after - sleep 1 second +TA1 - task_suspend - suspend TA2 +TA1 - task_resume - resume TA3 +TA1 - task_wake_after - sleep 5 seconds +TA3 - task_wake_after - sleep 1 second +TA3 - task_wake_after - sleep 1 second +TA3 - task_wake_after - sleep 1 second +TA3 - task_wake_after - sleep 1 second +TA3 - task_wake_after - sleep 1 second +TA1 - task_suspend - suspend TA3 +TA1 - task_resume - resume TA2 +TA1 - task_wake_after - sleep 5 seconds +TA2 - task_wake_after - sleep 1 second +TA2 - task_wake_after - sleep 1 second +TA2 - task_wake_after - sleep 1 second +TA2 - task_wake_after - sleep 1 second +TA2 - task_wake_after - sleep 1 second +TA1 - task_suspend - suspend TA2 +TA1 - task_resume - resume TA3 +TA1 - task_wake_after - sleep 5 seconds +TA3 - task_wake_after - sleep 1 second +TA3 - task_wake_after - sleep 1 second +TA3 - task_wake_after - sleep 1 second +TA3 - task_wake_after - sleep 1 second +TA3 - task_wake_after - sleep 1 second +TA1 - task_suspend - suspend TA3 +TA1 - task_resume - resume TA2 +TA1 - task_wake_after - sleep 5 seconds +TA2 - task_wake_after - sleep 1 second +TA2 - task_wake_after - sleep 1 second +TA2 - task_wake_after - sleep 1 second +TA2 - task_wake_after - sleep 1 second +TA2 - task_wake_after - sleep 1 second +TA1 - task_suspend - suspend TA2 +TA1 - task_resume - resume TA3 +*** END OF TEST 5 *** diff --git a/testsuites/ada/sptests/sp05/config.h b/testsuites/ada/sptests/sp05/config.h new file mode 100644 index 0000000000..d85c77e62b --- /dev/null +++ b/testsuites/ada/sptests/sp05/config.h @@ -0,0 +1,32 @@ +/* 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_TICKS_PER_TIMESLICE 100 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#define CONFIGURE_MAXIMUM_TASKS 4 + +#include + +/* end of include file */ diff --git a/testsuites/ada/sptests/sp05/sp05.adb b/testsuites/ada/sptests/sp05/sp05.adb new file mode 100644 index 0000000000..842657a699 --- /dev/null +++ b/testsuites/ada/sptests/sp05/sp05.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test SP05 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 SP05 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 SP05; + diff --git a/testsuites/ada/sptests/sp05/sptest.adb b/testsuites/ada/sptests/sp05/sptest.adb new file mode 100644 index 0000000000..1a9b974419 --- /dev/null +++ b/testsuites/ada/sptests/sp05/sptest.adb @@ -0,0 +1,224 @@ +-- +-- SPTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 5 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 INTERFACES; use INTERFACES; +with TEST_SUPPORT; +with TEXT_IO; + +package body SPTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TEST 5 ***" ); + + SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); + SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' ); + SPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' ); + + 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.CREATE( + SPTEST.TASK_NAME( 2 ), + 1, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 2 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 3 ), + 1, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 3 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA3" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 1 ), + SPTEST.TASK_1'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 2 ), + SPTEST.TASK_2'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 3 ), + SPTEST.TASK_3'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA3" ); + + 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); + TID2 : RTEMS.ID; + TID3 : RTEMS.ID; + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.TASKS.IDENT( + SPTEST.TASK_NAME( 2 ), + 1, + TID2, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF TA2" ); + + RTEMS.TASKS.IDENT( + SPTEST.TASK_NAME( 3 ), + 1, + TID3, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF TA3" ); + + for PASS in 1 .. 3 + loop + + TEXT_IO.PUT_LINE( "TA1 - task_wake_after - sleep 5 seconds" ); + RTEMS.TASKS.WAKE_AFTER( 5 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER OF TA1" ); + + TEXT_IO.PUT_LINE( "TA1 - task_suspend - suspend TA3" ); + RTEMS.TASKS.SUSPEND( TID3, STATUS ); + if PASS = 1 then + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.ALREADY_SUSPENDED, + "TASK_SUSPEND OF TA3" + ); + else + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND OF TA3" ); + end if; + + TEXT_IO.PUT_LINE( "TA1 - task_resume - resume TA2" ); + RTEMS.TASKS.RESUME( TID2, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESUME OF TA2" ); + + TEXT_IO.PUT_LINE( "TA1 - task_wake_after - sleep 5 seconds" ); + RTEMS.TASKS.WAKE_AFTER( 5 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + TEXT_IO.PUT_LINE( "TA1 - task_suspend - suspend TA2" ); + RTEMS.TASKS.SUSPEND( TID2, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND OF TA2" ); + + TEXT_IO.PUT_LINE( "TA1 - task_resume - resume TA3" ); + RTEMS.TASKS.RESUME( TID3, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESUME OF TA3" ); + + end loop; + + TEXT_IO.PUT_LINE( "*** END OF TEST 5 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end TASK_1; + +-- +-- TASK_2 +-- + + procedure TASK_2 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.PUT_LINE( "TA2 - task_suspend - suspend self" ); + RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND OF TA2" ); + + loop + TEXT_IO.PUT_LINE( "TA2 - task_wake_after - sleep 1 second" ); + RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER OF TA2" ); + end loop; + + end TASK_2; + +-- +-- TASK_3 +-- + + procedure TASK_3 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.PUT_LINE( "TA3 - task_suspend - suspend self" ); + RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND OF TA3" ); + + loop + TEXT_IO.PUT_LINE( "TA3 - task_wake_after - sleep 1 second" ); + RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER OF TA3" ); + end loop; + + end TASK_3; + +end SPTEST; diff --git a/testsuites/ada/sptests/sp05/sptest.ads b/testsuites/ada/sptests/sp05/sptest.ads new file mode 100644 index 0000000000..9fe136ec8b --- /dev/null +++ b/testsuites/ada/sptests/sp05/sptest.ads @@ -0,0 +1,86 @@ +-- +-- SPTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 5 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; + +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 .. 3 ) of RTEMS.ID; + TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; + +-- +-- 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 some of the capabilities of the Task Manager. +-- + + procedure TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_1); + +-- +-- TASK_2 +-- +-- DESCRIPTION: +-- +-- This RTEMS task tests some of the capabilities of the Task Manager. +-- + + procedure TASK_2 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_2); + +-- +-- TASK_3 +-- +-- DESCRIPTION: +-- +-- This RTEMS task tests the Message Queue Manager. +-- + + procedure TASK_3 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_3); + +end SPTEST; diff --git a/testsuites/ada/sptests/sp06/Makefile.am b/testsuites/ada/sptests/sp06/Makefile.am new file mode 100644 index 0000000000..145423b0b4 --- /dev/null +++ b/testsuites/ada/sptests/sp06/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_sp06 +ada_sp06_SOURCES = sp06.adb config.h sptest.adb sptest.ads +ada_sp06_SOURCES += ../../support/init.c + +ada_sp06$(EXEEXT): sp06.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_sp06.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/sptests/sp06/ada_sp06.scn b/testsuites/ada/sptests/sp06/ada_sp06.scn new file mode 100644 index 0000000000..8dc6c6afae --- /dev/null +++ b/testsuites/ada/sptests/sp06/ada_sp06.scn @@ -0,0 +1,38 @@ +*** TEST 6 *** +TA1 - is beginning to run +TA1 - restarting TA3 +TA2 - is beginning to run +TA2 - task_wake_after - sleep 1/2 second +TA2 - task_wake_after - sleep 1/2 second +TA1 - task_restart - restarting TA2 +TA2 - is beginning to run +TA2 - task_wake_after - sleep 1/2 second +TA2 - task_wake_after - sleep 1/2 second +TA1 - task_restart - restarting self +TA2 - task_wake_after - sleep 1/2 second +TA1 - is beginning to run +TA2 - task_wake_after - sleep 1/2 second +TA1 - task_restart - restarting TA2 +TA2 - is beginning to run +TA2 - task_wake_after - sleep 1/2 second +TA2 - task_wake_after - sleep 1/2 second +TA1 - task_restart - restarting self +TA2 - task_wake_after - sleep 1/2 second +TA1 - is beginning to run +TA2 - task_wake_after - sleep 1/2 second +TA1 - task_restart - restarting TA2 +TA2 - is beginning to run +TA2 - task_wake_after - sleep 1/2 second +TA2 - task_wake_after - sleep 1/2 second +TA1 - task_restart - restarting self +TA2 - task_wake_after - sleep 1/2 second +TA1 - is beginning to run +TA2 - task_wake_after - sleep 1/2 second +TA1 - task_restart - restarting TA2 +TA2 - is beginning to run +TA2 - task_wake_after - sleep 1/2 second +TA2 - task_wake_after - sleep 1/2 second +TA1 - task_restart - restarting self +TA2 - task_wake_after - sleep 1/2 second +TA1 - is beginning to run +*** END OF TEST 6 *** diff --git a/testsuites/ada/sptests/sp06/config.h b/testsuites/ada/sptests/sp06/config.h new file mode 100644 index 0000000000..d85c77e62b --- /dev/null +++ b/testsuites/ada/sptests/sp06/config.h @@ -0,0 +1,32 @@ +/* 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_TICKS_PER_TIMESLICE 100 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#define CONFIGURE_MAXIMUM_TASKS 4 + +#include + +/* end of include file */ diff --git a/testsuites/ada/sptests/sp06/sp06.adb b/testsuites/ada/sptests/sp06/sp06.adb new file mode 100644 index 0000000000..4caba9ae73 --- /dev/null +++ b/testsuites/ada/sptests/sp06/sp06.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test SP06 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 SP06 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 SP06; + diff --git a/testsuites/ada/sptests/sp06/sptest.adb b/testsuites/ada/sptests/sp06/sptest.adb new file mode 100644 index 0000000000..f19fd068ee --- /dev/null +++ b/testsuites/ada/sptests/sp06/sptest.adb @@ -0,0 +1,216 @@ +-- +-- SPTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 6 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 INTERFACES; use INTERFACES; +with TEST_SUPPORT; +with TEXT_IO; + +package body SPTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + PREVIOUS_PRIORITY : RTEMS.TASKS.PRIORITY; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TEST 6 ***" ); + + SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); + SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' ); + SPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' ); + + SPTEST.ARGUMENT := 0; + SPTEST.RESTART_ARGUMENT := 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.CREATE( + SPTEST.TASK_NAME( 2 ), + 1, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 2 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 3 ), + 10, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 3 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA3" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 1 ), + SPTEST.TASK_1'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 2 ), + SPTEST.TASK_2'ACCESS, + SPTEST.ARGUMENT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 3 ), + SPTEST.TASK_3'ACCESS, + SPTEST.ARGUMENT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA3" ); + + RTEMS.TASKS.SET_PRIORITY( + SPTEST.TASK_ID( 3 ), + 5, + PREVIOUS_PRIORITY, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY OF TA3" ); + + 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 + PASS : RTEMS.UNSIGNED32; + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.PUT_LINE( "TA1 - is beginning to run" ); + + PASS := ARGUMENT + 1; + + if PASS = 5 then + TEXT_IO.PUT_LINE( "*** END OF TEST 6 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + end if; + + if PASS = 1 then + TEXT_IO.PUT_LINE( "TA1 - restarting TA3" ); + RTEMS.TASKS.RESTART( + SPTEST.TASK_ID( 3 ), + SPTEST.RESTART_ARGUMENT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESTART OF TA3" ); + + RTEMS.TASKS.WAKE_AFTER( 2 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + end if; + + RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + TEXT_IO.PUT_LINE( "TA1 - task_restart - restarting TA2" ); + RTEMS.TASKS.RESTART( + SPTEST.TASK_ID( 2 ), + SPTEST.RESTART_ARGUMENT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESTART OF TA2" ); + + RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + TEXT_IO.PUT_LINE( "TA1 - task_restart - restarting self" ); + RTEMS.TASKS.RESTART( SPTEST.TASK_ID( 1 ), PASS, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESTART OF SELF" ); + + end TASK_1; + +-- +-- TASK_2 +-- + + procedure TASK_2 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.PUT_LINE( "TA2 - is beginning to run" ); + + if ARGUMENT = SPTEST.ARGUMENT then + RTEMS.TASKS.WAKE_AFTER( 2 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + end if; + + loop + + TEXT_IO.PUT_LINE( "TA2 - task_wake_after - sleep 1/2 second" ); + RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND / 2, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + end loop; + + end TASK_2; + +-- +-- TASK_3 +-- + + procedure TASK_3 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end TASK_3; + +end SPTEST; diff --git a/testsuites/ada/sptests/sp06/sptest.ads b/testsuites/ada/sptests/sp06/sptest.ads new file mode 100644 index 0000000000..29fa897210 --- /dev/null +++ b/testsuites/ada/sptests/sp06/sptest.ads @@ -0,0 +1,93 @@ +-- +-- SPTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 6 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; + +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 .. 3 ) of RTEMS.ID; + TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; + +-- +-- The following are used as arguments to the various RTEMS tasks +-- in this test to indicate when a restart should be performed. + + ARGUMENT : RTEMS.UNSIGNED32; + RESTART_ARGUMENT : RTEMS.UNSIGNED32; + +-- +-- 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 some of the capabilities of the Task Manager. +-- + + procedure TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_1); + +-- +-- TASK_2 +-- +-- DESCRIPTION: +-- +-- This RTEMS task tests some of the capabilities of the Task Manager. +-- + + procedure TASK_2 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_2); + +-- +-- TASK_3 +-- +-- DESCRIPTION: +-- +-- This RTEMS task tests some of the capabilities of the Task Manager. +-- + + procedure TASK_3 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_3); + +end SPTEST; diff --git a/testsuites/ada/sptests/sp07/Makefile.am b/testsuites/ada/sptests/sp07/Makefile.am new file mode 100644 index 0000000000..076b97d64c --- /dev/null +++ b/testsuites/ada/sptests/sp07/Makefile.am @@ -0,0 +1,17 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +noinst_PROGRAMS = ada_sp07 + +ada_sp07_SOURCES = sp07.adb config.h sptest.adb sptest.ads +ada_sp07_SOURCES += ../../support/init.c + +ada_sp07$(EXEEXT): sp07.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_sp07.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/sptests/sp07/ada_sp07.scn b/testsuites/ada/sptests/sp07/ada_sp07.scn new file mode 100644 index 0000000000..9748dda74c --- /dev/null +++ b/testsuites/ada/sptests/sp07/ada_sp07.scn @@ -0,0 +1,23 @@ +*** TEST 7 *** +TASKS_CREATE - TA1 - created. +TASKS_CREATE - TA2 - created. +TASKS_CREATE - TA3 - created. +TASKS_CREATE - TA4 - created. +TASKS_START - TA1 - started. +TASKS_START - TA2 - started. +TASKS_START - TA3 - started. +TASKS_START - TA4 - started. +TASKS_RESTART - TA3 - restarted. + +TA1 - task_set_priority - get initial priority of self: 4 +TA1 - task_set_priority - set TA2's priority: 3 +TA2 - task_set_priority - set TA1's priority: 2 +TA1 - task_set_priority - set TA2's priority: 1 +TA2 - task_suspend - suspend TA1 +TA2 - task_set_priority - set priority of TA1 ( blocked ) +TASKS_DELETE - TA2 deleting TA1 +TASKS_DELETE - TA2 deleting TA3 +TASKS_DELETE - TA2 deleting TA2 +TA4 - exitting task +TASK_EXITTED - user extension invoked correctly +*** END OF TEST 7 *** diff --git a/testsuites/ada/sptests/sp07/config.h b/testsuites/ada/sptests/sp07/config.h new file mode 100644 index 0000000000..2aa307a46c --- /dev/null +++ b/testsuites/ada/sptests/sp07/config.h @@ -0,0 +1,33 @@ +/* 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_USER_EXTENSIONS 1 +#define CONFIGURE_TICKS_PER_TIMESLICE 100 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#define CONFIGURE_MAXIMUM_TASKS 5 + +#include + +/* end of include file */ diff --git a/testsuites/ada/sptests/sp07/sp07.adb b/testsuites/ada/sptests/sp07/sp07.adb new file mode 100644 index 0000000000..177de946b8 --- /dev/null +++ b/testsuites/ada/sptests/sp07/sp07.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test SP07 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 SP07 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 SP07; + diff --git a/testsuites/ada/sptests/sp07/sptest.adb b/testsuites/ada/sptests/sp07/sptest.adb new file mode 100644 index 0000000000..d55aa73bf8 --- /dev/null +++ b/testsuites/ada/sptests/sp07/sptest.adb @@ -0,0 +1,513 @@ +-- +-- SPTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 7 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 INTERFACES; use INTERFACES; +with TEST_SUPPORT; +with TEXT_IO; +with UNSIGNED32_IO; +with RTEMS.EXTENSION; +with RTEMS.FATAL; + +package body SPTEST is + + type Task_Event_Type is ( + Created, + Deleted, + Restarted, + Started + ); + + type Task_Event is record + The_Event : Task_Event_Type; + Task1 : RTEMS.Unsigned32; + Task2 : RTEMS.Unsigned32; + end record; + + Task_Events : array (1 .. 10) of Task_Event; + Task_Events_Index : Natural := Task_Events'First; + + procedure Log_Task_Event ( + The_Event : in Task_Event_Type; + Task1 : in RTEMS.Unsigned32; + Task2 : in RTEMS.Unsigned32 + ) is + begin + if Task_Events_Index = Task_Events'Last then + RTEMS.Fatal.Error_Occurred ( 1 ); -- no other choice + else + Task_Events (Task_Events_Index).The_Event := The_Event; + Task_Events (Task_Events_Index).Task1 := Task1; + Task_Events (Task_Events_Index).Task2 := Task2; + Task_Events_Index := Task_Events_Index + 1; + end if; + end Log_Task_Event; + + procedure Flush_Task_Event_Log is + begin + for I in Task_Events'First .. Task_Events_Index - 1 loop + + case Task_Events (I).The_Event is + + when Created => + TEXT_IO.PUT( "TASKS_CREATE - " ); + TEST_SUPPORT.PUT_NAME( + SPTEST.TASK_NAME( Task_Events (I).Task1 ), + FALSE + ); + TEXT_IO.PUT_LINE( " - created." ); + + when Deleted => + TEXT_IO.PUT( "TASKS_DELETE - " ); + TEST_SUPPORT.PUT_NAME( + SPTEST.TASK_NAME( Task_Events (I).Task1 ), + FALSE + ); + + TEXT_IO.PUT( " deleting " ); + TEST_SUPPORT.PUT_NAME( + SPTEST.TASK_NAME( Task_Events (I).Task2 ), + TRUE + ); + + when Restarted => + TEXT_IO.PUT( "TASKS_RESTART - " ); + TEST_SUPPORT.PUT_NAME( + SPTEST.TASK_NAME( Task_Events (I).Task1 ), + FALSE + ); + TEXT_IO.PUT_LINE( " - restarted." ); + + when Started => + TEXT_IO.PUT( "TASKS_START - " ); + TEST_SUPPORT.PUT_NAME( + SPTEST.TASK_NAME( Task_Events (I).Task1 ), + FALSE + ); + TEXT_IO.PUT_LINE( " - started." ); + + end case; + end loop; + + -- Reset the events list + Task_Events_Index := Task_Events'First; + + end Flush_Task_Event_Log; + +-- +-- TCB_To_ID +-- + + function TCB_To_ID ( + TCB : RTEMS.TCB_POINTER + ) return RTEMS.ID; + pragma Import (C, TCB_To_ID, "tcb_to_id" ); + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TEST 7 ***" ); + + SPTEST.EXTENSION_NAME( 1 ) := RTEMS.BUILD_NAME( 'E', 'X', 'T', ' ' ); + + RTEMS.EXTENSION.CREATE( + SPTEST.EXTENSION_NAME( 1 ), + SPTEST.EXTENSIONS'ACCESS, + EXTENSION_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EXTENSION_CREATE" ); + + SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); + SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' ); + SPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' ); + SPTEST.TASK_NAME( 4 ) := RTEMS.BUILD_NAME( 'T', 'A', '4', ' ' ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 1 ), + 4, + RTEMS.MINIMUM_STACK_SIZE, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 2 ), + 4, + RTEMS.MINIMUM_STACK_SIZE, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 2 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 3 ), + 250, + RTEMS.MINIMUM_STACK_SIZE, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 3 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA3" ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 4 ), + 254, + RTEMS.MINIMUM_STACK_SIZE, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 4 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA4" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 1 ), + SPTEST.TASK_1'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 2 ), + SPTEST.TASK_2'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 3 ), + SPTEST.TASK_3'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA3" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 4 ), + SPTEST.TASK_4'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA4" ); + + RTEMS.TASKS.RESTART( SPTEST.TASK_ID( 3 ), 0, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESTART OF TA3" ); + + Flush_Task_Event_Log; + + 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); + STATUS : RTEMS.STATUS_CODES; + THE_PRIORITY : RTEMS.TASKS.PRIORITY; + PREVIOUS_PRIORITY : RTEMS.TASKS.PRIORITY; + begin + + TEST_SUPPORT.PAUSE; + + RTEMS.TASKS.SET_PRIORITY( + RTEMS.SELF, + RTEMS.TASKS.CURRENT_PRIORITY, + THE_PRIORITY, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" ); + TEXT_IO.PUT( "TA1 - task_set_priority - "); + TEXT_IO.PUT( "get initial priority of self: "); + UNSIGNED32_IO.PUT( THE_PRIORITY, BASE => 10, WIDTH => 2 ); + TEXT_IO.NEW_LINE; + + loop + + THE_PRIORITY := THE_PRIORITY - 1; + + if THE_PRIORITY = 0 then + TEXT_IO.PUT_LINE( "TA1 - task_suspend - suspend TA2" ); + RTEMS.TASKS.SUSPEND( SPTEST.TASK_ID( 2 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND" ); + + TEXT_IO.PUT( "TA1 - task_set_priority - "); + TEXT_IO.PUT_LINE( "set priority of TA2 ( blocked )"); + RTEMS.TASKS.SET_PRIORITY( + SPTEST.TASK_ID( 2 ), + 5, + PREVIOUS_PRIORITY, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" ); + + RTEMS.TASKS.DELETE( SPTEST.TASK_ID( 2 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA2" ); + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end if; + + TEXT_IO.PUT("TA1 - task_set_priority - set TA2's priority: "); + UNSIGNED32_IO.PUT( THE_PRIORITY, BASE => 10, WIDTH => 2 ); + TEXT_IO.NEW_LINE; + RTEMS.TASKS.SET_PRIORITY( + SPTEST.TASK_ID( 2 ), + THE_PRIORITY, + PREVIOUS_PRIORITY, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" ); + + end loop; + + end TASK_1; + +-- +-- TASK_2 +-- + + procedure TASK_2 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + THE_PRIORITY : RTEMS.TASKS.PRIORITY; + PREVIOUS_PRIORITY : RTEMS.TASKS.PRIORITY; + begin + + loop + + THE_PRIORITY := THE_PRIORITY - 1; + + if THE_PRIORITY = 0 then + TEXT_IO.PUT_LINE( "TA2 - task_suspend - suspend TA1" ); + RTEMS.TASKS.SUSPEND( SPTEST.TASK_ID( 1 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND" ); + + TEXT_IO.PUT( "TA2 - task_set_priority - "); + TEXT_IO.PUT_LINE( "set priority of TA1 ( blocked )"); + RTEMS.TASKS.SET_PRIORITY( + SPTEST.TASK_ID( 1 ), + 5, + PREVIOUS_PRIORITY, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" ); + + RTEMS.TASKS.DELETE( + SPTEST.TASK_ID( 1 ), + STATUS + ); -- TA1 is blocked + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA1" ); + + RTEMS.TASKS.DELETE( + SPTEST.TASK_ID( 3 ), + STATUS + ); -- TA3 is ready + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA3" ); + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + else + + TEXT_IO.PUT( "TA2 - task_set_priority - "); + TEXT_IO.PUT( "set TA1's priority: "); + UNSIGNED32_IO.PUT( THE_PRIORITY, BASE => 10, WIDTH => 2); + TEXT_IO.NEW_LINE; + RTEMS.TASKS.SET_PRIORITY( + SPTEST.TASK_ID( 1 ), + THE_PRIORITY, + PREVIOUS_PRIORITY, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" ); + + end if; + + end loop; + + end TASK_2; + +-- +-- TASK_3 +-- + + procedure TASK_3 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + loop + + RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + end loop; + + end TASK_3; + +-- +-- TASK_4 +-- + + procedure TASK_4 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + begin + + Flush_Task_Event_Log; + + TEXT_IO.PUT_LINE( "TA4 - exitting task" ); + + end TASK_4; + +-- +-- TASK_EXIT_EXTENSION +-- + + procedure TASK_EXIT_EXTENSION ( + RUNNING_TASK : in RTEMS.TCB_POINTER + ) is + begin + + if TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( RUNNING_TASK ) ) > 0 then + TEXT_IO.PUT_LINE( "TASK_EXITTED - user extension invoked correctly" ); + end if; + + TEXT_IO.PUT_LINE( "*** END OF TEST 7 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end TASK_EXIT_EXTENSION; + +-- +-- TASK_CREATE_EXTENSION +-- + + function TASK_CREATE_EXTENSION ( + UNUSED : in RTEMS.TCB_POINTER; + CREATED_TASK : in RTEMS.TCB_POINTER + ) return RTEMS.Boolean is + pragma Unreferenced(UNUSED); + begin + + if TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( CREATED_TASK ) ) > 0 then + Log_Task_Event ( + Created, + TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( CREATED_TASK ) ), + 0 + ); + end if; + + return RTEMS.True; + + end TASK_CREATE_EXTENSION; + +-- +-- TASK_DELETE_EXTENSION +-- + + procedure TASK_DELETE_EXTENSION ( + RUNNING_TASK : in RTEMS.TCB_POINTER; + DELETED_TASK : in RTEMS.TCB_POINTER + ) is + begin + + if TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( RUNNING_TASK ) ) > 0 and + TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( DELETED_TASK ) ) > 0 then + Log_Task_Event ( + Deleted, + TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( RUNNING_TASK ) ), + TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( DELETED_TASK ) ) + ); + end if; + + end TASK_DELETE_EXTENSION; + +-- +-- TASK_RESTART_EXTENSION +-- + + procedure TASK_RESTART_EXTENSION ( + UNUSED : in RTEMS.TCB_POINTER; + RESTARTED_TASK : in RTEMS.TCB_POINTER + ) is + pragma Unreferenced(UNUSED); + begin + + if TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( RESTARTED_TASK ) ) > 0 then + Log_Task_Event ( + Restarted, + TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( RESTARTED_TASK ) ), + 0 + ); + end if; + + end TASK_RESTART_EXTENSION; + +-- +-- TASK_START_EXTENSION +-- + + procedure TASK_START_EXTENSION ( + UNUSED : in RTEMS.TCB_POINTER; + STARTED_TASK : in RTEMS.TCB_POINTER + ) is + pragma Unreferenced(UNUSED); + begin + + if TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( STARTED_TASK ) ) > 0 then + Log_Task_Event ( + Started, + TEST_SUPPORT.TASK_NUMBER( TCB_To_ID( STARTED_TASK ) ), + 0 + ); + end if; + + end TASK_START_EXTENSION; + +end SPTEST; diff --git a/testsuites/ada/sptests/sp07/sptest.ads b/testsuites/ada/sptests/sp07/sptest.ads new file mode 100644 index 0000000000..3984c64ee1 --- /dev/null +++ b/testsuites/ada/sptests/sp07/sptest.ads @@ -0,0 +1,194 @@ +-- +-- SPTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 7 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; + +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 .. 4 ) of RTEMS.ID; + TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.NAME; + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS extensions created +-- by this test. +-- + + EXTENSION_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; + EXTENSION_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; + +-- +-- 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 some of the capabilities of the Task Manager. +-- + + procedure TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_1); + +-- +-- TASK_2 +-- +-- DESCRIPTION: +-- +-- This RTEMS task tests some of the capabilities of the Task Manager. +-- + + procedure TASK_2 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_2); + +-- +-- TASK_3 +-- +-- DESCRIPTION: +-- +-- This RTEMS task tests some of the capabilities of the Task Manager. +-- + + procedure TASK_3 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_3); + +-- +-- TASK_4 +-- +-- DESCRIPTION: +-- +-- This RTEMS task tests the Message Queue Manager. +-- + + procedure TASK_4 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_4); + +-- +-- TASK_CREATE_EXTENSION +-- +-- DESCRIPTION: +-- +-- This subprogram is the TASK_CREATE extension for this test. +-- + + function TASK_CREATE_EXTENSION ( + UNUSED : in RTEMS.TCB_POINTER; + CREATED_TASK : in RTEMS.TCB_POINTER + ) return RTEMS.Boolean; + pragma Convention (C, TASK_CREATE_EXTENSION); + +-- +-- TASK_DELETE_EXTENSION +-- +-- DESCRIPTION: +-- +-- This subprogram is the TASK_DELETE extension for this test. +-- + + procedure TASK_DELETE_EXTENSION ( + RUNNING_TASK : in RTEMS.TCB_POINTER; + DELETED_TASK : in RTEMS.TCB_POINTER + ); + pragma Convention (C, TASK_DELETE_EXTENSION); + +-- +-- TASK_RESTART_EXTENSION +-- +-- DESCRIPTION: +-- +-- This subprogram is the TASK_RESTART extension for this test. +-- + + procedure TASK_RESTART_EXTENSION ( + UNUSED : in RTEMS.TCB_POINTER; + RESTARTED_TASK : in RTEMS.TCB_POINTER + ); + pragma Convention (C, TASK_RESTART_EXTENSION); + +-- +-- TASK_START_EXTENSION +-- +-- DESCRIPTION: +-- +-- This subprogram is the TASK_START extension for this test. +-- + + procedure TASK_START_EXTENSION ( + UNUSED : in RTEMS.TCB_POINTER; + STARTED_TASK : in RTEMS.TCB_POINTER + ); + pragma Convention (C, TASK_START_EXTENSION); + +-- +-- TASK_EXIT_EXTENSION +-- +-- DESCRIPTION: +-- +-- This subprogram is the TASK_EXIT extension for this test. +-- It is invoked when a RTEMS task exits from its entry point. +-- + + procedure TASK_EXIT_EXTENSION ( + RUNNING_TASK : in RTEMS.TCB_POINTER + ); + pragma Convention (C, TASK_EXIT_EXTENSION); + +-- +-- This is the User Extension Table for this test. +-- + + EXTENSIONS : aliased RTEMS.EXTENSIONS_TABLE := + ( + SPTEST.TASK_CREATE_EXTENSION'ACCESS, -- Task create + SPTEST.TASK_START_EXTENSION'ACCESS, -- Task start + SPTEST.TASK_RESTART_EXTENSION'ACCESS, -- Task restart + SPTEST.TASK_DELETE_EXTENSION'ACCESS, -- Task delete + NULL, -- Task switch + NULL, -- Task post switch + NULL, -- Task begin + SPTEST.TASK_EXIT_EXTENSION'ACCESS, -- Task exitted + NULL -- Fatal error + ); + +end SPTEST; diff --git a/testsuites/ada/sptests/sp08/Makefile.am b/testsuites/ada/sptests/sp08/Makefile.am new file mode 100644 index 0000000000..5c6fc3e74e --- /dev/null +++ b/testsuites/ada/sptests/sp08/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_sp08 +ada_sp08_SOURCES = sp08.adb config.h sptest.adb sptest.ads +ada_sp08_SOURCES += ../../support/init.c + +ada_sp08$(EXEEXT): sp08.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_sp08.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/sptests/sp08/ada_sp08.scn b/testsuites/ada/sptests/sp08/ada_sp08.scn new file mode 100644 index 0000000000..d0081437fe --- /dev/null +++ b/testsuites/ada/sptests/sp08/ada_sp08.scn @@ -0,0 +1,20 @@ +*** TEST 8 *** +TA1 - task_mode - ASR - previous mode: 16#0# +TA1 - task_mode - NO_ASR - previous mode: 16#0# +TA1 - task_mode - NO_ASR - previous mode: 16#400# +TA1 - task_mode - ASR - previous mode: 16#400# +TA1 - task_mode - NO_TIMESLICE - previous mode: 16#0# +TA1 - task_mode - TIMESLICE - previous mode: 16#0# +TA1 - task_mode - TIMESLICE - previous mode: 16#200# +TA1 - task_mode - NO_TIMESLICE - previous mode: 16#200# +TA1 - task_mode - PREEMPT - previous mode: 16#0# +TA1 - task_mode - NO_PREEMPT - previous mode: 16#0# +TA1 - task_mode - NO_PREEMPT - previous mode: 16#100# +TA1 - task_mode - PREEMPT - previous mode: 16#100# +TA1 - task_mode - INTERRUPT_LEVEL( 3 ) - previous mode: 16#0# +TA1 - task_mode - INTERRUPT_LEVEL( 5 ) - previous mode: 16#1# +TA1 - task_mode - set all modes - previous mode: 16#1# +TA1 - task_mode - set all modes - previous mode: 16#701# +TA1 - task_mode - clear all modes - previous mode: 16#701# +TA1 - task_mode - get current mode - previous mode: 16#0# +*** END OF TEST 8 *** diff --git a/testsuites/ada/sptests/sp08/config.h b/testsuites/ada/sptests/sp08/config.h new file mode 100644 index 0000000000..6ada011600 --- /dev/null +++ b/testsuites/ada/sptests/sp08/config.h @@ -0,0 +1,32 @@ +/* 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_TICKS_PER_TIMESLICE 100 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#define CONFIGURE_MAXIMUM_TASKS 2 + +#include + +/* end of include file */ diff --git a/testsuites/ada/sptests/sp08/sp08.adb b/testsuites/ada/sptests/sp08/sp08.adb new file mode 100644 index 0000000000..f881ad4e71 --- /dev/null +++ b/testsuites/ada/sptests/sp08/sp08.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test SP08 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 SP08 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 SP08; + diff --git a/testsuites/ada/sptests/sp08/sptest.adb b/testsuites/ada/sptests/sp08/sptest.adb new file mode 100644 index 0000000000..2bec479285 --- /dev/null +++ b/testsuites/ada/sptests/sp08/sptest.adb @@ -0,0 +1,346 @@ +-- +-- SPTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 8 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 INTERFACES; use INTERFACES; +with TEST_SUPPORT; +with TEXT_IO; +with UNSIGNED32_IO; + +package body SPTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TEST 8 ***" ); + + 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" ); + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- PUT_MODE +-- + + procedure PUT_MODE( + COMMENT : in STRING; + OUTPUT_MODE : in RTEMS.MODE + ) is + begin + + TEXT_IO.PUT( COMMENT ); + UNSIGNED32_IO.PUT( OUTPUT_MODE, BASE => 16, WIDTH => 8 ); + TEXT_IO.NEW_LINE; + + end PUT_MODE; + +-- +-- TASK_1 +-- + + procedure TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + PREVIOUS_MODE : RTEMS.MODE; + STATUS : RTEMS.STATUS_CODES; + begin + +-- BEGINNING OF ASR + + RTEMS.TASKS.MODE( + RTEMS.ASR, + RTEMS.ASR_MASK, + PREVIOUS_MODE, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); + SPTEST.PUT_MODE( + "TA1 - task_mode - ASR - previous mode: ", + PREVIOUS_MODE + ); + + RTEMS.TASKS.MODE( + RTEMS.NO_ASR, + RTEMS.ASR_MASK, + PREVIOUS_MODE, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); + SPTEST.PUT_MODE( + "TA1 - task_mode - NO_ASR - previous mode: ", + PREVIOUS_MODE + ); + + RTEMS.TASKS.MODE( + RTEMS.NO_ASR, + RTEMS.ASR_MASK, + PREVIOUS_MODE, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); + SPTEST.PUT_MODE( + "TA1 - task_mode - NO_ASR - previous mode: ", + PREVIOUS_MODE + ); + + RTEMS.TASKS.MODE( + RTEMS.ASR, + RTEMS.ASR_MASK, + PREVIOUS_MODE, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); + SPTEST.PUT_MODE( + "TA1 - task_mode - ASR - previous mode: ", + PREVIOUS_MODE + ); + +-- END OF ASR + +-- BEGINNING OF TIMESLICE + + RTEMS.TASKS.MODE( + RTEMS.NO_TIMESLICE, + RTEMS.TIMESLICE_MASK, + PREVIOUS_MODE, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); + SPTEST.PUT_MODE( + "TA1 - task_mode - NO_TIMESLICE - previous mode: ", + PREVIOUS_MODE + ); + + RTEMS.TASKS.MODE( + RTEMS.TIMESLICE, + RTEMS.TIMESLICE_MASK, + PREVIOUS_MODE, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); + SPTEST.PUT_MODE( + "TA1 - task_mode - TIMESLICE - previous mode: ", + PREVIOUS_MODE + ); + + RTEMS.TASKS.MODE( + RTEMS.TIMESLICE, + RTEMS.TIMESLICE_MASK, + PREVIOUS_MODE, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); + SPTEST.PUT_MODE( + "TA1 - task_mode - TIMESLICE - previous mode: ", + PREVIOUS_MODE + ); + + RTEMS.TASKS.MODE( + RTEMS.NO_TIMESLICE, + RTEMS.TIMESLICE_MASK, + PREVIOUS_MODE, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); + SPTEST.PUT_MODE( + "TA1 - task_mode - NO_TIMESLICE - previous mode: ", + PREVIOUS_MODE + ); + +-- END OF TIMESLICE + +-- BEGINNING OF PREEMPT + + RTEMS.TASKS.MODE( + RTEMS.PREEMPT, + RTEMS.PREEMPT_MASK, + PREVIOUS_MODE, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); + SPTEST.PUT_MODE( + "TA1 - task_mode - PREEMPT - previous mode: ", + PREVIOUS_MODE + ); + + RTEMS.TASKS.MODE( + RTEMS.NO_PREEMPT, + RTEMS.PREEMPT_MASK, + PREVIOUS_MODE, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); + SPTEST.PUT_MODE( + "TA1 - task_mode - NO_PREEMPT - previous mode: ", + PREVIOUS_MODE + ); + + RTEMS.TASKS.MODE( + RTEMS.NO_PREEMPT, + RTEMS.PREEMPT_MASK, + PREVIOUS_MODE, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); + SPTEST.PUT_MODE( + "TA1 - task_mode - NO_PREEMPT - previous mode: ", + PREVIOUS_MODE + ); + + RTEMS.TASKS.MODE( + RTEMS.PREEMPT, + RTEMS.PREEMPT_MASK, + PREVIOUS_MODE, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); + SPTEST.PUT_MODE( + "TA1 - task_mode - PREEMPT - previous mode: ", + PREVIOUS_MODE + ); + +-- END OF PREEMPT + +-- BEGINNING OF INTERRUPT_LEVEL + + RTEMS.TASKS.MODE( + RTEMS.INTERRUPT_LEVEL( 3 ), + RTEMS.INTERRUPT_MASK, + PREVIOUS_MODE, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); + SPTEST.PUT_MODE( + "TA1 - task_mode - INTERRUPT_LEVEL( 3 ) - previous mode: ", + PREVIOUS_MODE + ); + + RTEMS.TASKS.MODE( + RTEMS.INTERRUPT_LEVEL( 5 ), + RTEMS.INTERRUPT_MASK, + PREVIOUS_MODE, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); + SPTEST.PUT_MODE( + "TA1 - task_mode - INTERRUPT_LEVEL( 5 ) - previous mode: ", + PREVIOUS_MODE + ); + +-- END OF INTERRUPT_LEVEL + +-- BEGINNING OF COMBINATIONS + + RTEMS.TASKS.MODE( + RTEMS.INTERRUPT_LEVEL( 3 ) + RTEMS.NO_ASR + + RTEMS.TIMESLICE + RTEMS.NO_PREEMPT, + RTEMS.INTERRUPT_MASK + RTEMS.ASR_MASK + + RTEMS.TIMESLICE_MASK + RTEMS.PREEMPT_MASK, + PREVIOUS_MODE, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); + SPTEST.PUT_MODE( + "TA1 - task_mode - set all modes - previous mode: ", + PREVIOUS_MODE + ); + + RTEMS.TASKS.MODE( + RTEMS.INTERRUPT_LEVEL( 3 ) + RTEMS.NO_ASR + + RTEMS.TIMESLICE + RTEMS.NO_PREEMPT, + RTEMS.INTERRUPT_MASK + RTEMS.ASR_MASK + + RTEMS.TIMESLICE_MASK + RTEMS.PREEMPT_MASK, + PREVIOUS_MODE, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); + SPTEST.PUT_MODE( + "TA1 - task_mode - set all modes - previous mode: ", + PREVIOUS_MODE + ); + + RTEMS.TASKS.MODE( + RTEMS.INTERRUPT_LEVEL( 0 ) + RTEMS.ASR + + RTEMS.NO_TIMESLICE + RTEMS.PREEMPT, + RTEMS.INTERRUPT_MASK + RTEMS.ASR_MASK + + RTEMS.TIMESLICE_MASK + RTEMS.PREEMPT_MASK, + PREVIOUS_MODE, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); + SPTEST.PUT_MODE( + "TA1 - task_mode - clear all modes - previous mode: ", + PREVIOUS_MODE + ); + +-- END OF COMBINATIONS + +-- BEGINNING OF CURRENT MODE + + RTEMS.TASKS.MODE( + RTEMS.CURRENT_MODE, + RTEMS.CURRENT_MODE, + PREVIOUS_MODE, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); + SPTEST.PUT_MODE( + "TA1 - task_mode - get current mode - previous mode: ", + PREVIOUS_MODE + ); + +-- END OF CURRENT MODE + + TEXT_IO.PUT_LINE( "*** END OF TEST 8 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + end TASK_1; + +end SPTEST; diff --git a/testsuites/ada/sptests/sp08/sptest.ads b/testsuites/ada/sptests/sp08/sptest.ads new file mode 100644 index 0000000000..09e9f8383f --- /dev/null +++ b/testsuites/ada/sptests/sp08/sptest.ads @@ -0,0 +1,74 @@ +-- +-- SPTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 8 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; + +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 .. 3 ) of RTEMS.ID; + TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- PUT_MODE +-- +-- DESCRIPTION: +-- +-- This subprogram prints the COMMENT and the OUTPUT_MODE followed +-- by a carriage return. +-- + + procedure PUT_MODE( + COMMENT : in STRING; + OUTPUT_MODE : in RTEMS.MODE + ); + +-- +-- TASK_1 +-- +-- DESCRIPTION: +-- +-- This RTEMS task tests the TASK_MODE directive of the Task Manager. +-- + + procedure TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_1); + +end SPTEST; diff --git a/testsuites/ada/sptests/sp09/Makefile.am b/testsuites/ada/sptests/sp09/Makefile.am new file mode 100644 index 0000000000..8956a388d5 --- /dev/null +++ b/testsuites/ada/sptests/sp09/Makefile.am @@ -0,0 +1,21 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +# Prevents Ada from raising a constraint so that the error +# handling can be verified in the binding. +AM_ADAFLAGS += -gnatp + +noinst_PROGRAMS = ada_sp09 + +ada_sp09_SOURCES = sp09.adb config.h sptest.adb sptest.ads +ada_sp09_SOURCES += ../../support/init.c + +ada_sp09$(EXEEXT): sp09.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_sp09.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/sptests/sp09/ada_sp09.scn b/testsuites/ada/sptests/sp09/ada_sp09.scn new file mode 100644 index 0000000000..de199d7dd5 --- /dev/null +++ b/testsuites/ada/sptests/sp09/ada_sp09.scn @@ -0,0 +1,246 @@ +*** TEST 9 *** +INIT - task_create - INVALID_PRIORITY +INIT - task_restart - INCORRECT_STATE +TA1 - task_delete - INVALID_ID +TA1 - task_ident - current task SUCCESSFUL +TA1 - task_ident - global INVALID_NAME +TA1 - task_ident - local INVALID_NAME +TA1 - task_ident - INVALID_NODE +TA1 - task_restart - INVALID_ID +TA1 - task_resume - INVALID_ID +TA1 - task_resume - INCORRECT_STATE +TA1 - task_set_priority - INVALID_PRIORITY +TA1 - task_set_priority - INVALID_ID +TA1 - task_start - INVALID_ID +TA1 - task_start - INCORRECT_STATE +TA1 - task_suspend - INVALID_ID + +TA1 - clock_get - NOT_DEFINED +TA1 - task_wake_when - NOT_DEFINED +TA1 - timer_fire_when - NOT_DEFINED +TA1 - clock_set - 8:30:45 2/ 5/1987 - INVALID_CLOCK +TA1 - clock_set - 8:30:45 15/ 5/1988 - INVALID_CLOCK +TA1 - clock_set - 8:30:45 2/32/1988 - INVALID_CLOCK +TA1 - clock_set - 25:30:45 2/ 5/1988 - INVALID_CLOCK +TA1 - clock_set - 8:61:45 2/ 5/1988 - INVALID_CLOCK +TA1 - clock_set - 8:30:61 2/ 5/1988 - INVALID_CLOCK +TA1 - clock_set - 8:30:45 2/ 5/1988 - INVALID_CLOCK +TA1 - clock_set - 8:30:45 2/ 5/1988 - SUCCESSFUL +TA1 - task_wake_when - TICK INVALID - sleep about 3 seconds +TA1 - task_wake_when - TICK INVALID - woke up SUCCESSFUL +TA1 - task_wake_when - 8:30:48 2/ 5/1961 - INVALID_CLOCK +TA1 - task_wake_when - 25:30:48 2/ 5/1988 - INVALID_CLOCK +TA1 - current time - 8:30:48 2/ 5/1988 +TA1 - task_wake_when - 8:30:48 1/ 5/1988 - INVALID_CLOCK + +TA1 - task_create - INVALID_NAME +TA1 - task_create - stack size - UNSATISFIED +TA1 - task_create - TA2 created - SUCCESSFUL +TA1 - task_suspend - suspend TA2 - SUCCESSFUL +TA1 - task_suspend - suspend TA2 - ALREADY_SUSPENDED +TA1 - task_resume - TA2 resumed - SUCCESSFUL +TA1 - task_create - TA3 created - SUCCESSFUL +TA1 - task_create - 4 created - SUCCESSFUL +TA1 - task_create - 5 created - SUCCESSFUL +TA1 - task_create - 6 created - SUCCESSFUL +TA1 - task_create - 7 created - SUCCESSFUL +TA1 - task_create - 8 created - SUCCESSFUL +TA1 - task_create - 9 created - SUCCESSFUL +TA1 - task_create - 10 created - SUCCESSFUL +TA1 - task_create - 11 - TOO_MANY +TA1 - task_create - MP_NOT_CONFIGURED + +TA1 - event_receive - UNSATISFIED ( all conditions ) +TA1 - event_receive - UNSATISFIED ( any conditions ) +TA1 - event_receive - timeout in 3 seconds +TA1 - event_receive - woke with TIMEOUT +TA1 - event_send - INVALID_ID +TA1 - task_wake_after - sleep 1 second - SUCCESSFUL +TA1 - clock_set - 8:30:45 2/ 5/1988 - SUCCESSFUL + +TA1 - semaphore_create - INVALID_NAME +TA1 - semaphore_create - 1 - SUCCESSFUL +TA1 - semaphore_create - 2 - SUCCESSFUL +TA1 - semaphore_create - 3 - TOO_MANY +TA1 - semaphore_create - NOT_DEFINED +TA1 - semaphore_create - NOT_DEFINED +TA1 - semaphore_create - INVALID_NUMBER +TA1 - semaphore_create - MP_NOT_CONFIGURED +TA1 - semaphore_delete - unknown INVALID_ID +TA1 - semaphore_delete - local INVALID_ID +TA1 - semaphore_ident - global INVALID_NAME +TA1 - semaphore_ident - local INVALID_NAME + +TA1 - semaphore_obtain - INVALID_ID +TA1 - semaphore_obtain - got sem 1 - SUCCESSFUL +TA1 - semaphore_obtain - UNSATISFIED +TA1 - semaphore_obtain - timeout in 3 seconds +TA1 - semaphore_obtain - woke with TIMEOUT +TA1 - semaphore_release - NOT_OWNER_OF_RESOURCE +TA1 - semaphore_release - INVALID_ID +TA1 - task_start - start TA2 - SUCCESSFUL +TA1 - task_wake_after - yield processor - SUCCESSFUL +TA2 - semaphore_obtain - sem 1 - WAIT FOREVER +TA1 - semaphore_delete - delete sem 1 - SUCCESSFUL +TA1 - semaphore_obtain - binary semaphore +TA1 - semaphore_delete - delete sem 2 - RESOURCE_IN_USE +TA1 - task_wake_after - yield processor - SUCCESSFUL +TA2 - semaphore_obtain - woke up with OBJECT_WAS_DELETED +TA2 - task_delete - delete self - SUCCESSFUL +TA1 - task_delete TA2 - already deleted INVALID_ID + +TA1 - message_queue_broadcast - INVALID_ID +TA1 - message_queue_create - Q 1 - INVALID_NAME +TA1 - message_queue_create - Q 1 - MP_NOT_CONFIGURED +TA1 - message_queue_create - Q 1 - 2 DEEP - SUCCESSFUL +TA1 - message_queue_create - Q 2 - TOO_MANY +TA1 - message_queue_delete - unknown INVALID_ID +TA1 - message_queue_delete - local INVALID_ID +TA1 - message_queue_ident - INVALID_NAME +TA1 - message_queue_get_number_pending - INVALID_ID +TA1 - message_queue_flush - INVALID_ID +TA1 - message_queue_receive - INVALID_ID +TA1 - message_queue_receive - Q 1 - UNSATISFIED +TA1 - message_queue_receive - Q 1 - timeout in 3 seconds +TA1 - message_queue_receive - Q 1 - woke up with TIMEOUT +TA1 - message_queue_send - INVALID_ID +TA1 - message_queue_send - BUFFER 1 TO Q 1 - SUCCESSFUL +TA1 - message_queue_send - BUFFER 2 TO Q 1 - SUCCESSFUL +TA1 - message_queue_send - BUFFER 3 TO Q 1 - TOO_MANY + +TA1 - message_queue_delete - Q 1 - SUCCESSFUL +TA1 - message_queue_create - Q 1 - 2 DEEP - SUCCESSFUL +TA1 - message_queue_send - BUFFER 1 TO Q 1 - SUCCESSFUL +TA1 - message_queue_send - BUFFER 2 TO Q 1 - SUCCESSFUL +TA1 - message_queue_send - BUFFER 3 TO Q 1 - TOO_MANY +TA1 - message_queue_delete - Q 1 - SUCCESSFUL +TA1 - message_queue_create - Q 1 - 3 DEEP - SUCCESSFUL +TA1 - message_queue_send - BUFFER 1 TO Q 1 - SUCCESSFUL +TA1 - message_queue_send - BUFFER 2 TO Q 1 - SUCCESSFUL +TA1 - message_queue_send - BUFFER 3 TO Q 1 - SUCCESSFUL +TA1 - message_queue_send - BUFFER 4 TO Q 1 - TOO_MANY +TA1 - message_queue_delete - Q 1 - SUCCESSFUL +TA1 - message_queue_create - Q 1 - 3 DEEP - SUCCESSFUL +TA1 - task_start - start TA3 - SUCCESSFUL +TA1 - task_wake_after - yield processor - SUCCESSFUL +TA3 - message_queue_receive - Q 1 - WAIT FOREVER +TA1 - message_queue_delete - delete Q 1 - SUCCESSFUL +TA1 - task_wake_after - yield processor - SUCCESSFUL +TA3 - message_queue_receive - woke up with OBJECT_WAS_DELETED +TA3 - task_delete - delete self - SUCCESSFUL + +TA1 - port_create - INVALID_NAME +TA1 - port_create - INVALID_ADDRESS +TA1 - port_create - TOO_MANY +TA1 - port_delete - INVALID_ID +TA1 - port_ident - INVALID_NAME +TA1 - port_internal_to_external - INVALID_ID +TA1 - port_external_to_internal - INVALID_ID + +TA1 - rate_monotonic_create - INVALID_NAME +TA1 - rate_monotonic_create - SUCCESSFUL +TA1 - rate_monotonic_create - TOO_MANY +TA1 - rate_monotonic_ident - INVALID_NAME +TA1 - rate_monotonic_period - unknown INVALID_ID +TA1 - rate_monotonic_period - local INVALID_ID +TA1 - rate_monotonic_period( STATUS ) - NOT_DEFINED +TA1 - rate_monotonic_period - 100 ticks - SUCCESSFUL +TA1 - rate_monotonic_period( STATUS ) - SUCCESSFUL +TA1 - rate_monotonic_period( STATUS ) - TIMEOUT +TA1 - rate_monotonic_cancel - unknown INVALID_ID +TA1 - rate_monotonic_cancel - local INVALID_ID +TA1 - rate_monotonic_cancel - SUCCESSFUL +TA1 - rate_monotonic_period - 5 ticks - TIMEOUT +TA1 - task_wake_after - yielding to TA4 +TA4 - rate_monotonic_cancel - NOT_OWNER_OF_RESOURCE +TA4 - rate_monotonic_period - NOT_OWNER_OF_RESOURCE +TA4 - task_delete - delete self - SUCCESSFUL +TA1 - rate_monotonic_delete - unknown INVALID_ID +TA1 - rate_monotonic_delete - local INVALID_ID +TA1 - rate_monotonic_delete - SUCCESSFUL + +TA1 - partition_create - INVALID_NAME +TA1 - partition_create - length - INVALID_SIZE +TA1 - partition_create - buffer size - INVALID_SIZE +TA1 - partition_create - length < buffer size - INVALID_SIZE +TA1 - partition_create - MP_NOT_CONFIGURED +TA1 - partition_create - INVALID_ADDRESS +TA1 - partition_create - INVALID_SIZE +TA1 - partition_delete - unknown INVALID_ID +TA1 - partition_delete - local INVALID_ID +TA1 - partition_get_buffer - INVALID_ID +TA1 - partition_ident - INVALID_NAME +TA1 - partition_return_buffer - INVALID_ID +TA1 - partition_create - SUCCESSFUL +TA1 - partition_create - TOO_MANY +TA1 - partition_get_buffer - SUCCESSFUL +TA1 - partition_get_buffer - SUCCESSFUL +TA1 - partition_get_buffer - UNSATISFIED +TA1 - partition_delete - RESOURCE_IN_USE +TA1 - partition_return_buffer - INVALID_ADDRESS - out of range +TA1 - partition_return_buffer - INVALID_ADDRESS - not on boundary + +TA1 - region_create - INVALID_NAME +TA1 - region_create - INVALID_ADDRESS +TA1 - region_create - INVALID_SIZE +TA1 - region_create - SUCCESSFUL +TA1 - region_create - TOO_MANY +TA1 - region_delete - unknown INVALID_ID +TA1 - region_delete - local INVALID_ID +TA1 - region_ident - INVALID_NAME +TA1 - region_get_segment - INVALID_ID +TA1 - region_get_segment - INVALID_SIZE +TA1 - region_get_segment - SUCCESSFUL +TA1 - region_get_segment - UNSATISFIED +TA1 - region_get_segment - timeout in 3 seconds +TA1 - region_get_segment - woke up with TIMEOUT +TA1 - region_delete - RESOURCE_IN_USE +TA1 - region_return_segment - INVALID_ID +TA1 - region_return_segment - INVALID_ADDRESS +TA1 - debug_disable - DEBUG_REGION +TA1 - region_return_segment - INVALID_ADDRESS - SKIPPED +TA1 - region_return_segment - INVALID_ADDRESS - SKIPPED +TA1 - debug_enable - DEBUG_REGION +TA1 - region_extend - INVALID_ID +TA1 - region_extend - within heap - INVALID_ADDRESS +TA1 - region_extend - non-contiguous lower - NOT_IMPLEMENTED +TA1 - region_extend - contiguous lower - NOT_IMPLEMENTED +TA1 - region_extend - non-contiguous higher - NOT_IMPLEMENTED + +TA1 - clock_set - 23:59:59 12/31/2000 - SUCCESSFUL +TA1 - clock_get - 0: 0: 0 1/ 1/2001 - SUCCESSFUL +TA1 - clock_set - 23:59:59 12/31/1999 - SUCCESSFUL +TA1 - clock_get - 0: 0: 0 1/ 1/2000 - SUCCESSFUL +TA1 - clock_set - 23:59:59 12/31/2100 - SUCCESSFUL +TA1 - clock_get - 17:31:44 11/25/1964 - SUCCESSFUL +TA1 - clock_set - 23:59:59 12/31/2099 - SUCCESSFUL +TA1 - clock_get - 17:31:44 11/25/1963 - SUCCESSFUL +TA1 - clock_set - 23:59:59 12/31/1991 - SUCCESSFUL +TA1 - clock_get - 0: 0: 0 1/ 1/1992 - SUCCESSFUL + +TA1 - timer_create - INVALID_NAME +TA1 - timer_create - 1 - SUCCESSFUL +TA1 - timer_create - 2 - TOO_MANY +TA1 - timer_delete - local INVALID_ID +TA1 - timer_delete - global INVALID_ID +TA1 - timer_ident - INVALID_NAME +TA1 - timer_cancel - INVALID_ID +TA1 - timer_reset - INVALID_ID +TA1 - timer_reset - NOT_DEFINED +TA1 - timer_fire_after - INVALID_ID +TA1 - timer_fire_when - INVALID_ID +TA1 - timer_fire_after - INVALID_NUMBER +TA1 - timer_fire_when - 8:30:45 2/ 5/1987 - INVALID_CLOCK +TA1 - clock_get - 0: 0: 0 1/ 1/1992 +TA1 - timer_fire_when - 8:30:45 2/ 5/1990 - before INVALID_CLOCK +TA1 - timer_server_fire_after - INCORRECT_STATE +TA1 - timer_server_fire_when - INCORRECT_STATE +TA1 - timer_initiate_server - INVALID_PRIORITY +TA1 - timer_initiate_server +TA1 - timer_server_fire_after - INVALID_ID +TA1 - timer_server_fire_when - INVALID_ID +TA1 - timer_server_fire_after - INVALID_NUMBER +TA1 - timer_server_fire_when - 8:30:45 2/ 5/1987 - INVALID_CLOCK +TA1 - clock_get - 0: 0: 0 1/ 1/1992 +TA1 - timer_server_fire_when - 8:30:45 2/ 5/1990 - before INVALID_CLOCK +*** END OF TEST 9 *** diff --git a/testsuites/ada/sptests/sp09/config.h b/testsuites/ada/sptests/sp09/config.h new file mode 100644 index 0000000000..a94c222fa1 --- /dev/null +++ b/testsuites/ada/sptests/sp09/config.h @@ -0,0 +1,38 @@ +/* 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 10 +#define CONFIGURE_MAXIMUM_TIMERS 1 +#define CONFIGURE_MAXIMUM_SEMAPHORES 2 +#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 +#define CONFIGURE_MAXIMUM_PARTITIONS 1 +#define CONFIGURE_MAXIMUM_REGIONS 1 +#define CONFIGURE_MAXIMUM_PERIODS 1 +#define CONFIGURE_MAXIMUM_USER_EXTENSIONS 0 +#define CONFIGURE_TICKS_PER_TIMESLICE 100 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/sptests/sp09/sp09.adb b/testsuites/ada/sptests/sp09/sp09.adb new file mode 100644 index 0000000000..de3a8a91a0 --- /dev/null +++ b/testsuites/ada/sptests/sp09/sp09.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test SP09 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 SP09 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 SP09; + diff --git a/testsuites/ada/sptests/sp09/sptest.adb b/testsuites/ada/sptests/sp09/sptest.adb new file mode 100644 index 0000000000..218fbaed49 --- /dev/null +++ b/testsuites/ada/sptests/sp09/sptest.adb @@ -0,0 +1,3117 @@ +-- +-- SPTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 9 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 INTERFACES; use INTERFACES; +with TEST_SUPPORT; +with TEXT_IO; +with RTEMS.CLOCK; +with RTEMS.EVENT; +with RTEMS.MESSAGE_QUEUE; +with RTEMS.PARTITION; +with RTEMS.PORT; +with RTEMS.RATE_MONOTONIC; +with RTEMS.REGION; +with RTEMS.SEMAPHORE; +with RTEMS.TIMER; + +package body SPTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TEST 9 ***" ); + + SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); + SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' ); + SPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' ); + SPTEST.TASK_NAME( 4 ) := RTEMS.BUILD_NAME( 'T', 'A', '4', ' ' ); + SPTEST.TASK_NAME( 5 ) := RTEMS.BUILD_NAME( 'T', 'A', '5', ' ' ); + SPTEST.TASK_NAME( 6 ) := RTEMS.BUILD_NAME( 'T', 'A', '6', ' ' ); + SPTEST.TASK_NAME( 7 ) := RTEMS.BUILD_NAME( 'T', 'A', '7', ' ' ); + SPTEST.TASK_NAME( 8 ) := RTEMS.BUILD_NAME( 'T', 'A', '8', ' ' ); + SPTEST.TASK_NAME( 9 ) := RTEMS.BUILD_NAME( 'T', 'A', '9', ' ' ); + SPTEST.TASK_NAME( 10 ) := RTEMS.BUILD_NAME( 'T', 'A', 'A', ' ' ); + + SPTEST.TIMER_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'M', '1', ' ' ); + + SPTEST.SEMAPHORE_NAME( 1 ) := RTEMS.BUILD_NAME( 'S', 'M', '1', ' ' ); + SPTEST.SEMAPHORE_NAME( 2 ) := RTEMS.BUILD_NAME( 'S', 'M', '2', ' ' ); + SPTEST.SEMAPHORE_NAME( 3 ) := RTEMS.BUILD_NAME( 'S', 'M', '3', ' ' ); + + SPTEST.QUEUE_NAME( 1 ) := RTEMS.BUILD_NAME( 'M', 'Q', '1', ' ' ); + SPTEST.QUEUE_NAME( 2 ) := RTEMS.BUILD_NAME( 'M', 'Q', '2', ' ' ); + + SPTEST.PARTITION_NAME( 1 ) := RTEMS.BUILD_NAME( 'P', 'T', '1', ' ' ); + + SPTEST.REGION_NAME( 1 ) := RTEMS.BUILD_NAME( 'R', 'N', '1', ' ' ); + + SPTEST.PORT_NAME( 1 ) := RTEMS.BUILD_NAME( 'D', 'P', '1', ' ' ); + + SPTEST.PERIOD_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'M', '1', ' ' ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 1 ), + 0, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 1 ), + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_PRIORITY, + "TASK_CREATE WITH ILLEGAL PRIORITY" + ); + TEXT_IO.PUT_LINE( "INIT - task_create - INVALID_PRIORITY" ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 1 ), + 4, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" ); + + RTEMS.TASKS.RESTART( + SPTEST.TASK_ID( 1 ), + 0, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INCORRECT_STATE, + "TASK_RESTART OF DORMANT TASK" + ); + TEXT_IO.PUT_LINE( "INIT - task_restart - INCORRECT_STATE" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 1 ), + SPTEST.TASK_1'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- DELAYED_SUBPROGRAM +-- + + procedure DELAYED_SUBPROGRAM ( + IGNORED_ID : in RTEMS.ID; + IGNORED_ADDRESS : in RTEMS.ADDRESS + ) is + begin + + NULL; + + end DELAYED_SUBPROGRAM; + +-- +-- SCREEN_1 +-- + + procedure SCREEN_1 + is + SELF_ID : RTEMS.ID; + PREVIOUS_PRIORITY : RTEMS.TASKS.PRIORITY; + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.TASKS.DELETE( 100, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "TASK_DELETE WITH ILLEGAL ID" + ); + TEXT_IO.PUT_LINE( "TA1 - task_delete - INVALID_ID" ); + + RTEMS.TASKS.IDENT( + RTEMS.SELF, + RTEMS.SEARCH_ALL_NODES, + SELF_ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF SELF" ); + if SELF_ID /= SPTEST.TASK_ID( 1 ) then + TEXT_IO.PUT_LINE( "ERROR - task_ident - incorrect ID returned!" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + end if; + TEXT_IO.PUT_LINE( + "TA1 - task_ident - current task SUCCESSFUL" + ); + + RTEMS.TASKS.IDENT( + 100, + RTEMS.SEARCH_ALL_NODES, + SPTEST.JUNK_ID, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_NAME, + "TASK_IDENT WITH ILLEGAL NAME (local)" + ); + TEXT_IO.PUT_LINE( "TA1 - task_ident - global INVALID_NAME" ); + + RTEMS.TASKS.IDENT( 100, 1, SPTEST.JUNK_ID, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_NAME, + "TASK_IDENT WITH ILLEGAL NAME (global)" + ); + TEXT_IO.PUT_LINE( "TA1 - task_ident - local INVALID_NAME" ); + + RTEMS.TASKS.IDENT( 100, 2, SPTEST.JUNK_ID, STATUS ); + if TEST_SUPPORT.Is_Configured_Multiprocessing then + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_NODE, + "TASK_IDENT WITH ILLEGAL NODE" + ); + else + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_NAME, + "TASK_IDENT WITH ILLEGAL NODE" + ); + end if; + TEXT_IO.PUT_LINE( "TA1 - task_ident - INVALID_NODE" ); + + RTEMS.TASKS.RESTART( 100, 0, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "TASK_RESTART WITH ILLEGAL ID" + ); + TEXT_IO.PUT_LINE( "TA1 - task_restart - INVALID_ID" ); + + RTEMS.TASKS.RESUME( 100, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "TASK_RESUME WITH ILLEGAL ID" + ); + TEXT_IO.PUT_LINE( "TA1 - task_resume - INVALID_ID" ); + + RTEMS.TASKS.RESUME( RTEMS.SELF, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INCORRECT_STATE, + "TASK_RESUME OF READY TASK" + ); + TEXT_IO.PUT_LINE( "TA1 - task_resume - INCORRECT_STATE" ); + + begin + RTEMS.TASKS.SET_PRIORITY( RTEMS.SELF, 512, PREVIOUS_PRIORITY, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_PRIORITY, + "TASK_SET_PRIORITY WITH ILLEGAL PRIORITY" + ); + TEXT_IO.PUT_LINE( + "TA1 - task_set_priority - INVALID_PRIORITY" + ); + exception + when others => + TEXT_IO.PUT_LINE( + "TA1 - task_set_priority - INVALID_PRIORITY -- constraint error" + ); + end; + + RTEMS.TASKS.SET_PRIORITY( 100, 8, PREVIOUS_PRIORITY, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "TASK_SET_PRIORITY WITH ILLEGAL ID" + ); + TEXT_IO.PUT_LINE( "TA1 - task_set_priority - INVALID_ID" ); + + RTEMS.TASKS.START( 100, SPTEST.TASK_1'ACCESS, 0, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "TASK_START WITH ILLEGAL ID" + ); + TEXT_IO.PUT_LINE( "TA1 - task_start - INVALID_ID" ); + + RTEMS.TASKS.START( RTEMS.SELF, SPTEST.TASK_1'ACCESS, 0, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INCORRECT_STATE, + "TASK_START OF READY TASK" + ); + TEXT_IO.PUT_LINE( "TA1 - task_start - INCORRECT_STATE" ); + + RTEMS.TASKS.SUSPEND( 100, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "TASK_SUSPEND WITH INVALID ID" + ); + TEXT_IO.PUT_LINE( "TA1 - task_suspend - INVALID_ID" ); + + end SCREEN_1; + +-- +-- SCREEN_2 +-- + + procedure SCREEN_2 + is + TIME : RTEMS.TIME_OF_DAY; + STATUS : RTEMS.STATUS_CODES; + begin + +-- errors before clock is set + + RTEMS.CLOCK.GET_TOD( TIME, STATUS ); + if RTEMS.IS_STATUS_SUCCESSFUL( STATUS ) then + TEXT_IO.PUT_LINE( + "TA1 - clock_get - NOT_DEFINED -- DID THE BSP SET THE TIME OF DAY?" + ); + else + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.NOT_DEFINED, + "CLOCK_GET BEFORE CLOCK IS SET" + ); + TEXT_IO.PUT_LINE( "TA1 - clock_get - NOT_DEFINED" ); + end if; + + RTEMS.TASKS.WAKE_WHEN( TIME, STATUS ); + if RTEMS.IS_STATUS_SUCCESSFUL( STATUS ) then + TEXT_IO.PUT( "TA1 - task_wake_when - NOT_DEFINED -- " ); + TEXT_IO.PUT_LINE( "DID THE BSP SET THE TIME OF DAY?" ); + else + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.NOT_DEFINED, + "TASK_WAKE_WHEN BEFORE CLOCK IS SET" + ); + TEXT_IO.PUT_LINE( "TA1 - task_wake_when - NOT_DEFINED" ); + end if; + + RTEMS.TIMER.FIRE_WHEN( + 0, + TIME, + SPTEST.DELAYED_SUBPROGRAM'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + + if RTEMS.IS_STATUS_SUCCESSFUL( STATUS ) then + TEXT_IO.PUT( "TA1 - task_fire_when - NOT_DEFINED -- " ); + TEXT_IO.PUT_LINE( "DID THE BSP SET THE TIME OF DAY?" ); + else + + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.NOT_DEFINED, + "TIMER_FIRE_WHEN BEFORE CLOCK IS SET" + ); + TEXT_IO.PUT_LINE( "TA1 - timer_fire_when - NOT_DEFINED" ); + + end if; + +-- invalid time of day field + + TIME := ( 1987, 2, 5, 8, 30, 45, 0 ); + TEST_SUPPORT.PRINT_TIME( "TA1 - clock_set - ", TIME, "" ); + RTEMS.CLOCK.SET( TIME, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_CLOCK, + "CLOCK_SET WITH INVALID YEAR" + ); + TEXT_IO.PUT_LINE( " - INVALID_CLOCK" ); + + TIME := ( 1988, 15, 5, 8, 30, 45, 0 ); + TEST_SUPPORT.PRINT_TIME( "TA1 - clock_set - ", TIME, "" ); + RTEMS.CLOCK.SET( TIME, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_CLOCK, + "CLOCK_SET WITH INVALID MONTH" + ); + TEXT_IO.PUT_LINE( " - INVALID_CLOCK" ); + + TIME := ( 1988, 2, 32, 8, 30, 45, 0 ); + TEST_SUPPORT.PRINT_TIME( "TA1 - clock_set - ", TIME, "" ); + RTEMS.CLOCK.SET( TIME, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_CLOCK, + "CLOCK_SET WITH INVALID DAY" + ); + TEXT_IO.PUT_LINE( " - INVALID_CLOCK" ); + + TIME := ( 1988, 2, 5, 25, 30, 45, 0 ); + TEST_SUPPORT.PRINT_TIME( "TA1 - clock_set - ", TIME, "" ); + RTEMS.CLOCK.SET( TIME, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_CLOCK, + "CLOCK_SET WITH INVALID HOUR" + ); + TEXT_IO.PUT_LINE( " - INVALID_CLOCK" ); + + TIME := ( 1988, 2, 5, 8, 61, 45, 0 ); + TEST_SUPPORT.PRINT_TIME( "TA1 - clock_set - ", TIME, "" ); + RTEMS.CLOCK.SET( TIME, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_CLOCK, + "CLOCK_SET WITH INVALID MINUTE" + ); + TEXT_IO.PUT_LINE( " - INVALID_CLOCK" ); + + TIME := ( 1988, 2, 5, 8, 30, 61, 0 ); + TEST_SUPPORT.PRINT_TIME( "TA1 - clock_set - ", TIME, "" ); + RTEMS.CLOCK.SET( TIME, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_CLOCK, + "CLOCK_SET WITH INVALID SECOND" + ); + TEXT_IO.PUT_LINE( " - INVALID_CLOCK" ); + + TIME := ( 1988, 2, 5, 8, 30, 45, TEST_SUPPORT.TICKS_PER_SECOND + 1 ); + TEST_SUPPORT.PRINT_TIME( "TA1 - clock_set - ", TIME, "" ); + RTEMS.CLOCK.SET( TIME, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_CLOCK, + "CLOCK_SET WITH INVALID TICKS PER SECOND" + ); + TEXT_IO.PUT_LINE( " - INVALID_CLOCK" ); + + TIME := ( 1988, 2, 5, 8, 30, 45, 0 ); + TEST_SUPPORT.PRINT_TIME( "TA1 - clock_set - ", TIME, "" ); + RTEMS.CLOCK.SET( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET SUCCESSFUL" ); + TEXT_IO.PUT_LINE( " - SUCCESSFUL" ); + +-- task_wake_when + + TIME := ( 1988, 2, 5, 8, 30, 48, TEST_SUPPORT.TICKS_PER_SECOND + 1 ); + TEXT_IO.PUT( "TA1 - task_wake_when - TICK INVALID - " ); + TEXT_IO.PUT_LINE( "sleep about 3 seconds" ); + RTEMS.TASKS.WAKE_WHEN( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( + STATUS, + "TASK_WAKE_WHEN WITH INVALID TICKS PER SECOND" + ); + TEXT_IO.PUT( "TA1 - task_wake_when - TICK INVALID - " ); + TEXT_IO.PUT_LINE( "woke up SUCCESSFUL" ); + + TIME := ( 1961, 2, 5, 8, 30, 48, 0 ); + TEST_SUPPORT.PRINT_TIME( "TA1 - task_wake_when - ", TIME, "" ); + RTEMS.TASKS.WAKE_WHEN( TIME, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_CLOCK, + "TASK_WAKE_WHEN WITH INVALID YEAR" + ); + TEXT_IO.PUT_LINE( " - INVALID_CLOCK" ); + + TIME := ( 1988, 2, 5, 25, 30, 48, 0 ); + TEST_SUPPORT.PRINT_TIME( "TA1 - task_wake_when - ", TIME, "" ); + RTEMS.TASKS.WAKE_WHEN( TIME, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_CLOCK, + "TASK_WAKE_WHEN WITH INVALID HOUR" + ); + TEXT_IO.PUT_LINE( " - INVALID_CLOCK" ); + + RTEMS.CLOCK.GET_TOD( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); + TEST_SUPPORT.PRINT_TIME( "TA1 - current time - ", TIME, "" ); + TEXT_IO.NEW_LINE; + + TIME.MONTH := 1; + TEST_SUPPORT.PRINT_TIME( "TA1 - task_wake_when - ", TIME, "" ); + RTEMS.TASKS.WAKE_WHEN( TIME, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_CLOCK, + "TASK_WAKE_WHEN BEFORE CURRENT TIME" + ); + TEXT_IO.PUT_LINE( " - INVALID_CLOCK" ); + + end SCREEN_2; + +-- +-- SCREEN_3 +-- + + procedure SCREEN_3 + is + TASK_NAME : RTEMS.NAME; + STATUS : RTEMS.STATUS_CODES; + begin + + TASK_NAME := 1; + + RTEMS.TASKS.CREATE( + 0, + 1, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.JUNK_ID, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_NAME, + "TASK_CREATE WITH ILLEGAL NAME" + ); + TEXT_IO.PUT_LINE( + "TA1 - task_create - INVALID_NAME" + ); + + RTEMS.TASKS.CREATE( + TASK_NAME, + 1, + TEST_SUPPORT.WORK_SPACE_SIZE, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.JUNK_ID, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.UNSATISFIED, + "TASK_CREATE WITH A STACK SIZE LARGER THAN THE WORKSPACE" + ); + TEXT_IO.PUT_LINE( + "TA1 - task_create - stack size - UNSATISFIED" + ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 2 ), + 4, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 2 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" ); + TEXT_IO.PUT_LINE( + "TA1 - task_create - TA2 created - SUCCESSFUL" + ); + + RTEMS.TASKS.SUSPEND( SPTEST.TASK_ID( 2 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND OF TA2" ); + TEXT_IO.PUT_LINE( + "TA1 - task_suspend - suspend TA2 - SUCCESSFUL" + ); + + RTEMS.TASKS.SUSPEND( SPTEST.TASK_ID( 2 ), STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.ALREADY_SUSPENDED, + "TASK_SUSPEND ON SUSPENDED TA2" + ); + TEXT_IO.PUT_LINE( + "TA1 - task_suspend - suspend TA2 - ALREADY_SUSPENDED" + ); + + RTEMS.TASKS.RESUME( SPTEST.TASK_ID( 2 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESUME OF TA2" ); + TEXT_IO.PUT_LINE( + "TA1 - task_resume - TA2 resumed - SUCCESSFUL" + ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 3 ), + 4, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 3 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA3" ); + TEXT_IO.PUT_LINE( + "TA1 - task_create - TA3 created - SUCCESSFUL" + ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 4 ), + 4, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 4 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA4" ); + TEXT_IO.PUT_LINE( + "TA1 - task_create - 4 created - SUCCESSFUL" + ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 5 ), + 4, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 5 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA5" ); + TEXT_IO.PUT_LINE( + "TA1 - task_create - 5 created - SUCCESSFUL" + ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 6 ), + 4, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 6 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA6" ); + TEXT_IO.PUT_LINE( + "TA1 - task_create - 6 created - SUCCESSFUL" + ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 7 ), + 4, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 7 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA7" ); + TEXT_IO.PUT_LINE( + "TA1 - task_create - 7 created - SUCCESSFUL" + ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 8 ), + 4, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 8 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA8" ); + TEXT_IO.PUT_LINE( + "TA1 - task_create - 8 created - SUCCESSFUL" + ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 9 ), + 4, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 9 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA9" ); + TEXT_IO.PUT_LINE( + "TA1 - task_create - 9 created - SUCCESSFUL" + ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 10 ), + 4, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 10 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA10" ); + TEXT_IO.PUT_LINE( + "TA1 - task_create - 10 created - SUCCESSFUL" + ); + + RTEMS.TASKS.CREATE( + TASK_NAME, + 4, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.JUNK_ID, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.TOO_MANY, + "TASK_CREATE FOR TOO MANY TASKS" + ); + TEXT_IO.PUT_LINE( "TA1 - task_create - 11 - TOO_MANY" ); + + if TEST_SUPPORT.Is_Configured_Multiprocessing then + RTEMS.TASKS.CREATE( + TASK_NAME, + 4, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.GLOBAL, + SPTEST.JUNK_ID, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.MP_NOT_CONFIGURED, + "TASK_CREATE OF GLOBAL TASK IN SINGLE CPU SYSTEM" + ); + end if; + TEXT_IO.PUT_LINE( "TA1 - task_create - MP_NOT_CONFIGURED" ); + + end SCREEN_3; + +-- +-- SCREEN_4 +-- + + procedure SCREEN_4 + is + EVENT_OUT : RTEMS.EVENT_SET; + TIME : RTEMS.TIME_OF_DAY; + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.EVENT.RECEIVE( + RTEMS.EVENT_16, + RTEMS.NO_WAIT, + RTEMS.NO_TIMEOUT, + EVENT_OUT, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.UNSATISFIED, + "EVENT_RECEIVE UNSATISFIED (ALL)" + ); + TEXT_IO.PUT_LINE( + "TA1 - event_receive - UNSATISFIED ( all conditions )" + ); + + RTEMS.EVENT.RECEIVE( + RTEMS.EVENT_16, + RTEMS.NO_WAIT + RTEMS.EVENT_ANY, + RTEMS.NO_TIMEOUT, + EVENT_OUT, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.UNSATISFIED, + "EVENT_RECEIVE UNSATISFIED (ANY)" + ); + TEXT_IO.PUT_LINE( + "TA1 - event_receive - UNSATISFIED ( any conditions )" + ); + + TEXT_IO.PUT_LINE( "TA1 - event_receive - timeout in 3 seconds" ); + RTEMS.EVENT.RECEIVE( + RTEMS.EVENT_16, + RTEMS.DEFAULT_OPTIONS, + 3 * TEST_SUPPORT.TICKS_PER_SECOND, + EVENT_OUT, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.TIMEOUT, + "EVENT_RECEIVE AFTER 3 SECOND TIMEOUT" + ); + TEXT_IO.PUT_LINE( + "TA1 - event_receive - woke with TIMEOUT" + ); + + RTEMS.EVENT.SEND( + 100, + RTEMS.EVENT_16, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "EVENT_SEND WITH ILLEGAL ID" + ); + TEXT_IO.PUT_LINE( + "TA1 - event_send - INVALID_ID" + ); + + TEXT_IO.PUT_LINE( + "TA1 - task_wake_after - sleep 1 second - SUCCESSFUL" + ); + RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER (1 SECOND)" ); + + TIME := ( 1988, 2, 5, 8, 30, 45, 0 ); + TEST_SUPPORT.PRINT_TIME( "TA1 - clock_set - ", TIME, "" ); + RTEMS.CLOCK.SET( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET SUCCESSFUL" ); + TEXT_IO.PUT_LINE( " - SUCCESSFUL" ); + + end SCREEN_4; + +-- +-- SCREEN_5 +-- + + procedure SCREEN_5 + is + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.SEMAPHORE.CREATE( + 0, + 1, + RTEMS.DEFAULT_ATTRIBUTES, + RTEMS.TASKS.NO_PRIORITY, + SPTEST.JUNK_ID, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_NAME, + "SEMAPHORE_CREATE WITH ILLEGAL NAME" + ); + TEXT_IO.PUT_LINE( "TA1 - semaphore_create - INVALID_NAME" ); + + RTEMS.SEMAPHORE.CREATE( + SPTEST.SEMAPHORE_NAME( 1 ), + 1, + RTEMS.DEFAULT_ATTRIBUTES, + RTEMS.TASKS.NO_PRIORITY, + SPTEST.SEMAPHORE_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( + STATUS, + "SEMAPHORE_CREATE SUCCESSFUL" + ); + TEXT_IO.PUT_LINE( "TA1 - semaphore_create - 1 - SUCCESSFUL" ); + + RTEMS.SEMAPHORE.CREATE( + SPTEST.SEMAPHORE_NAME( 2 ), + 1, + (RTEMS.BINARY_SEMAPHORE or RTEMS.PRIORITY or RTEMS.INHERIT_PRIORITY), + RTEMS.TASKS.NO_PRIORITY, + SPTEST.SEMAPHORE_ID( 2 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( + STATUS, + "SEMAPHORE_CREATE SUCCESSFUL" + ); + TEXT_IO.PUT_LINE( "TA1 - semaphore_create - 2 - SUCCESSFUL" ); + + loop + RTEMS.SEMAPHORE.CREATE( + SPTEST.SEMAPHORE_NAME( 3 ), + 1, + RTEMS.DEFAULT_ATTRIBUTES, + RTEMS.TASKS.NO_PRIORITY, + SPTEST.JUNK_ID, + STATUS + ); + + exit when not RTEMS.ARE_STATUSES_EQUAL( STATUS, RTEMS.SUCCESSFUL ); + end loop; + + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.TOO_MANY, + "SEMAPHORE_CREATE OF TOO MANY" + ); + TEXT_IO.PUT_LINE( "TA1 - semaphore_create - 3 - TOO_MANY" ); + + RTEMS.SEMAPHORE.CREATE( + SPTEST.SEMAPHORE_NAME( 1 ), + 1, + RTEMS.INHERIT_PRIORITY + RTEMS.BINARY_SEMAPHORE + RTEMS.FIFO, + RTEMS.TASKS.NO_PRIORITY, + SPTEST.JUNK_ID, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.NOT_DEFINED, + "SEMAPHORE_CREATE OF FIFO INHERIT PRIORITY" + ); + TEXT_IO.PUT_LINE("TA1 - semaphore_create - NOT_DEFINED"); + + RTEMS.SEMAPHORE.CREATE( + SPTEST.SEMAPHORE_NAME( 1 ), + 1, + RTEMS.INHERIT_PRIORITY + RTEMS.COUNTING_SEMAPHORE + RTEMS.PRIORITY, + RTEMS.TASKS.NO_PRIORITY, + SPTEST.JUNK_ID, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.NOT_DEFINED, + "SEMAPHORE_CREATE OF COUNTING_SEMAPHORE INHERIT PRIORITY" + ); + TEXT_IO.PUT_LINE("TA1 - semaphore_create - NOT_DEFINED"); + + RTEMS.SEMAPHORE.CREATE( + SPTEST.SEMAPHORE_NAME( 1 ), + 2, + RTEMS.BINARY_SEMAPHORE, + RTEMS.TASKS.NO_PRIORITY, + SPTEST.JUNK_ID, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_NUMBER, + "SEMAPHORE_CREATE OF BINARY_SEMAPHORE with COUNT > 1" + ); + TEXT_IO.PUT_LINE("TA1 - semaphore_create - INVALID_NUMBER"); + + if TEST_SUPPORT.Is_Configured_Multiprocessing then + RTEMS.SEMAPHORE.CREATE( + SPTEST.SEMAPHORE_NAME( 3 ), + 1, + RTEMS.GLOBAL, + RTEMS.TASKS.NO_PRIORITY, + SPTEST.JUNK_ID, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.MP_NOT_CONFIGURED, + "SEMAPHORE_CREATE OF MP_NOT_CONFIGURED" + ); + end if; + TEXT_IO.PUT_LINE("TA1 - semaphore_create - MP_NOT_CONFIGURED"); + + RTEMS.SEMAPHORE.DELETE( 100, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "SEMAPHORE_DELETE WITH ILLEGAL ID" + ); + TEXT_IO.PUT_LINE( + "TA1 - semaphore_delete - unknown INVALID_ID" + ); + + RTEMS.SEMAPHORE.DELETE( 16#10100#, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "SEMAPHORE_DELETE WITH LOCAL ILLEGAL ID" + ); + TEXT_IO.PUT_LINE( + "TA1 - semaphore_delete - local INVALID_ID" + ); + + RTEMS.SEMAPHORE.IDENT( + 100, + RTEMS.SEARCH_ALL_NODES, + SPTEST.JUNK_ID, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_NAME, + "SEMAPHORE_IDENT WITH ILLEGAL NAME (local)" + ); + TEXT_IO.PUT_LINE( + "TA1 - semaphore_ident - global INVALID_NAME" + ); + + RTEMS.SEMAPHORE.IDENT( 100, 1, SPTEST.JUNK_ID, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_NAME, + "SEMAPHORE_IDENT WITH ILLEGAL NAME (global)" + ); + TEXT_IO.PUT_LINE( + "TA1 - semaphore_ident - local INVALID_NAME" + ); + + end SCREEN_5; + +-- +-- SCREEN_6 +-- + + procedure SCREEN_6 + is + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.SEMAPHORE.OBTAIN( + 100, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "SEMAPHORE_OBTAIN WITH ILLEGAL ID" + ); + TEXT_IO.PUT_LINE( "TA1 - semaphore_obtain - INVALID_ID" ); + + RTEMS.SEMAPHORE.OBTAIN( + SPTEST.SEMAPHORE_ID( 1 ), + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED(STATUS, "SEMAPHORE_OBTAIN SUCCESSFUL"); + TEXT_IO.PUT_LINE( + "TA1 - semaphore_obtain - got sem 1 - SUCCESSFUL" + ); + + RTEMS.SEMAPHORE.OBTAIN( + SPTEST.SEMAPHORE_ID( 1 ), + RTEMS.NO_WAIT, + RTEMS.NO_TIMEOUT, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.UNSATISFIED, + "SEMAPHORE_OBTAIN NOT AVAILABLE" + ); + TEXT_IO.PUT_LINE( "TA1 - semaphore_obtain - UNSATISFIED" ); + + TEXT_IO.PUT_LINE( "TA1 - semaphore_obtain - timeout in 3 seconds" ); + RTEMS.SEMAPHORE.OBTAIN( + SPTEST.SEMAPHORE_ID( 1 ), + RTEMS.DEFAULT_OPTIONS, + 3 * TEST_SUPPORT.TICKS_PER_SECOND, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.TIMEOUT, + "SEMAPHORE_OBTAIN NOT AVAILABLE" + ); + TEXT_IO.PUT_LINE( + "TA1 - semaphore_obtain - woke with TIMEOUT" + ); + + RTEMS.SEMAPHORE.RELEASE( SPTEST.SEMAPHORE_ID( 2 ), STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.NOT_OWNER_OF_RESOURCE, + "SEMAPHORE_RELEASE AND NOT OWNER" + ); + TEXT_IO.PUT_LINE( + "TA1 - semaphore_release - NOT_OWNER_OF_RESOURCE" + ); + + RTEMS.SEMAPHORE.RELEASE( 100, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "SEMAPHORE_RELEASE WITH ILLEGAL ID" + ); + TEXT_IO.PUT_LINE( "TA1 - semaphore_release - INVALID_ID" ); + + TEXT_IO.PUT_LINE( + "TA1 - task_start - start TA2 - SUCCESSFUL" + ); + RTEMS.TASKS.START( + SPTEST.TASK_ID( 2 ), + SPTEST.TASK_2'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" ); + + TEXT_IO.PUT_LINE( + "TA1 - task_wake_after - yield processor - SUCCESSFUL" + ); + RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER (yield)" ); + + TEXT_IO.PUT_LINE( + "TA1 - semaphore_delete - delete sem 1 - SUCCESSFUL" + ); + RTEMS.SEMAPHORE.DELETE( SPTEST.SEMAPHORE_ID( 1 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_DELETE OF SM1" ); + + TEXT_IO.PUT_LINE( "TA1 - semaphore_obtain - binary semaphore" ); + RTEMS.SEMAPHORE.OBTAIN( + SPTEST.SEMAPHORE_ID( 2 ), + RTEMS.NO_WAIT, + RTEMS.NO_TIMEOUT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN" ); + + TEXT_IO.PUT_LINE( + "TA1 - semaphore_delete - delete sem 2 - RESOURCE_IN_USE" + ); + RTEMS.SEMAPHORE.DELETE( SPTEST.SEMAPHORE_ID( 2 ), STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.RESOURCE_IN_USE, + "SEMAPHORE_DELETE OF SM2" + ); + + TEXT_IO.PUT_LINE( + "TA1 - task_wake_after - yield processor - SUCCESSFUL" + ); + RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER (yield)" ); + + RTEMS.TASKS.DELETE( SPTEST.TASK_ID( 2 ), STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "TASK_DELETE AFTER THE TASK HAS BEEN DELETED" + ); + TEXT_IO.PUT_LINE( + "TA1 - task_delete TA2 - already deleted INVALID_ID" + ); + + end SCREEN_6; + +-- +-- SCREEN_7 +-- + + procedure SCREEN_7 + is + BUFFER : SPTEST.BUFFER; + BUFFER_POINTER : RTEMS.ADDRESS; + COUNT : RTEMS.UNSIGNED32; + MESSAGE_SIZE : RTEMS.UNSIGNED32 := 0; + STATUS : RTEMS.STATUS_CODES; + begin + + BUFFER_POINTER := BUFFER'ADDRESS; + + RTEMS.MESSAGE_QUEUE.BROADCAST( + 100, + BUFFER_POINTER, + 16, + COUNT, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "MESSAGE_QUEUE_BROADCAST WITH ILLEGAL ID" + ); + TEXT_IO.PUT_LINE( + "TA1 - message_queue_broadcast - INVALID_ID" + ); + + RTEMS.MESSAGE_QUEUE.CREATE( + 0, + 3, + 16, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.JUNK_ID, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_NAME, + "MESSAGE_QUEUE_CREATE WITH ILLEGAL NAME" + ); + TEXT_IO.PUT_LINE( + "TA1 - message_queue_create - Q 1 - INVALID_NAME" + ); + + if TEST_SUPPORT.Is_Configured_Multiprocessing then + RTEMS.MESSAGE_QUEUE.CREATE( + SPTEST.QUEUE_NAME( 1 ), + 1, + 16, + RTEMS.GLOBAL, + SPTEST.JUNK_ID, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.MP_NOT_CONFIGURED, + "MESSAGE_QUEUE_CREATE OF MP NOT CONFIGURED" + ); + end if; + TEXT_IO.PUT_LINE( + "TA1 - message_queue_create - Q 1 - MP_NOT_CONFIGURED"); + + RTEMS.MESSAGE_QUEUE.CREATE( + SPTEST.QUEUE_NAME( 1 ), + 2, + 16, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.QUEUE_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( + STATUS, + "MESSAGE_QUEUE_CREATE SUCCESSFUL" + ); + TEXT_IO.PUT_LINE( + "TA1 - message_queue_create - Q 1 - 2 DEEP - SUCCESSFUL" + ); + + RTEMS.MESSAGE_QUEUE.CREATE( + SPTEST.QUEUE_NAME( 2 ), + 1, + 16, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.JUNK_ID, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.TOO_MANY, + "MESSAGE_QUEUE_CREATE OF TOO MANY" + ); + TEXT_IO.PUT_LINE( + "TA1 - message_queue_create - Q 2 - TOO_MANY" + ); + + RTEMS.MESSAGE_QUEUE.DELETE( 100, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "MESSAGE_QUEUE_DELETE WITH ILLEGAL ID" + ); + TEXT_IO.PUT_LINE( + "TA1 - message_queue_delete - unknown INVALID_ID" + ); + + RTEMS.MESSAGE_QUEUE.DELETE( 16#10100#, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "MESSAGE_QUEUE_DELETE WITH LOCAL ILLEGAL ID" + ); + TEXT_IO.PUT_LINE( + "TA1 - message_queue_delete - local INVALID_ID" + ); + + RTEMS.MESSAGE_QUEUE.IDENT( + 100, + RTEMS.SEARCH_ALL_NODES, + SPTEST.JUNK_ID, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_NAME, + "MESSAGE_QUEUE_IDENT WITH ILLEGAL NAME" + ); + TEXT_IO.PUT_LINE( "TA1 - message_queue_ident - INVALID_NAME" ); + + RTEMS.MESSAGE_QUEUE.GET_NUMBER_PENDING( 100, COUNT, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "MESSAGE_QUEUE_GET_NUMBER_PENDING WITH ILLEGAL ID" + ); + TEXT_IO.PUT_LINE("TA1 - message_queue_get_number_pending - INVALID_ID"); + + RTEMS.MESSAGE_QUEUE.FLUSH( 100, COUNT, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "MESSAGE_QUEUE_FLUSH WITH ILLEGAL ID" + ); + TEXT_IO.PUT_LINE( "TA1 - message_queue_flush - INVALID_ID" ); + + RTEMS.MESSAGE_QUEUE.RECEIVE( + 100, + BUFFER_POINTER, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + MESSAGE_SIZE, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "MESSAGE_QUEUE_RECEIVE WITH ILLEGAL ID" + ); + TEXT_IO.PUT_LINE( "TA1 - message_queue_receive - INVALID_ID" ); + + RTEMS.MESSAGE_QUEUE.RECEIVE( + SPTEST.QUEUE_ID( 1 ), + BUFFER_POINTER, + RTEMS.NO_WAIT, + RTEMS.NO_TIMEOUT, + MESSAGE_SIZE, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.UNSATISFIED, + "MESSAGE_QUEUE_RECEIVE UNSATISFIED" + ); + TEXT_IO.PUT_LINE( + "TA1 - message_queue_receive - Q 1 - UNSATISFIED" + ); + + TEXT_IO.PUT_LINE( + "TA1 - message_queue_receive - Q 1 - timeout in 3 seconds" + ); + RTEMS.MESSAGE_QUEUE.RECEIVE( + SPTEST.QUEUE_ID( 1 ), + BUFFER_POINTER, + RTEMS.DEFAULT_OPTIONS, + 3 * TEST_SUPPORT.TICKS_PER_SECOND, + MESSAGE_SIZE, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.TIMEOUT, + "MESSAGE_QUEUE_RECEIVE 3 SECOND TIMEOUT" + ); + TEXT_IO.PUT_LINE( + "TA1 - message_queue_receive - Q 1 - woke up with TIMEOUT" + ); + + RTEMS.MESSAGE_QUEUE.SEND( 100, BUFFER_POINTER, 16, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "MESSAGE_QUEUE_SEND WITH ILLEGAL ID" + ); + TEXT_IO.PUT_LINE( "TA1 - message_queue_send - INVALID_ID" ); + + RTEMS.MESSAGE_QUEUE.SEND( + SPTEST.QUEUE_ID( 1 ), + BUFFER_POINTER, + 16, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); + TEXT_IO.PUT_LINE( + "TA1 - message_queue_send - BUFFER 1 TO Q 1 - SUCCESSFUL" + ); + + RTEMS.MESSAGE_QUEUE.SEND( + SPTEST.QUEUE_ID( 1 ), + BUFFER_POINTER, + 16, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); + TEXT_IO.PUT_LINE( + "TA1 - message_queue_send - BUFFER 2 TO Q 1 - SUCCESSFUL" + ); + + RTEMS.MESSAGE_QUEUE.SEND( + SPTEST.QUEUE_ID( 1 ), + BUFFER_POINTER, + 16, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.TOO_MANY, + "MESSAGE_QUEUE_SEND TOO MANY TO LIMITED QUEUE" + ); + TEXT_IO.PUT_LINE( + "TA1 - message_queue_send - BUFFER 3 TO Q 1 - TOO_MANY" + ); + + end SCREEN_7; + +-- +-- SCREEN_8 +-- + + procedure SCREEN_8 + is + BUFFER : SPTEST.BUFFER; + BUFFER_POINTER : RTEMS.ADDRESS; + STATUS : RTEMS.STATUS_CODES; + begin + + BUFFER_POINTER := BUFFER'ADDRESS; + + RTEMS.MESSAGE_QUEUE.DELETE( SPTEST.QUEUE_ID( 1 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( + STATUS, + "MESSAGE_QUEUE_DELETE SUCCESSFUL" + ); + TEXT_IO.PUT_LINE( + "TA1 - message_queue_delete - Q 1 - SUCCESSFUL" + ); + + RTEMS.MESSAGE_QUEUE.CREATE( + SPTEST.QUEUE_NAME( 1 ), + 2, + 16, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.QUEUE_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( + STATUS, + "MESSAGE_QUEUE_CREATE SUCCESSFUL" + ); + TEXT_IO.PUT_LINE( + "TA1 - message_queue_create - Q 1 - 2 DEEP - SUCCESSFUL" + ); + + RTEMS.MESSAGE_QUEUE.SEND( + SPTEST.QUEUE_ID( 1 ), + BUFFER_POINTER, + 16, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); + TEXT_IO.PUT_LINE( + "TA1 - message_queue_send - BUFFER 1 TO Q 1 - SUCCESSFUL" + ); + + RTEMS.MESSAGE_QUEUE.SEND( + SPTEST.QUEUE_ID( 1 ), + BUFFER_POINTER, + 16, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); + TEXT_IO.PUT_LINE( + "TA1 - message_queue_send - BUFFER 2 TO Q 1 - SUCCESSFUL" + ); + + RTEMS.MESSAGE_QUEUE.SEND( + SPTEST.QUEUE_ID( 1 ), + BUFFER_POINTER, + 16, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.TOO_MANY, + "MESSAGE_QUEUE_SEND TOO MANY TO LIMITED QUEUE" + ); + TEXT_IO.PUT_LINE( + "TA1 - message_queue_send - BUFFER 3 TO Q 1 - TOO_MANY" + ); + + RTEMS.MESSAGE_QUEUE.DELETE( SPTEST.QUEUE_ID( 1 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( + STATUS, + "MESSAGE_QUEUE_DELETE SUCCESSFUL" + ); + TEXT_IO.PUT_LINE( + "TA1 - message_queue_delete - Q 1 - SUCCESSFUL" + ); + + RTEMS.MESSAGE_QUEUE.CREATE( + SPTEST.QUEUE_NAME( 1 ), + 3, + 16, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.QUEUE_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( + STATUS, + "MESSAGE_QUEUE_CREATE SUCCESSFUL" + ); + TEXT_IO.PUT_LINE( + "TA1 - message_queue_create - Q 1 - 3 DEEP - SUCCESSFUL" + ); + + RTEMS.MESSAGE_QUEUE.SEND( + SPTEST.QUEUE_ID( 1 ), + BUFFER_POINTER, + 16, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); + TEXT_IO.PUT_LINE( + "TA1 - message_queue_send - BUFFER 1 TO Q 1 - SUCCESSFUL" + ); + + RTEMS.MESSAGE_QUEUE.SEND( + SPTEST.QUEUE_ID( 1 ), + BUFFER_POINTER, + 16, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); + TEXT_IO.PUT_LINE( + "TA1 - message_queue_send - BUFFER 2 TO Q 1 - SUCCESSFUL" + ); + + RTEMS.MESSAGE_QUEUE.SEND( + SPTEST.QUEUE_ID( 1 ), + BUFFER_POINTER, + 16, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); + TEXT_IO.PUT_LINE( + "TA1 - message_queue_send - BUFFER 3 TO Q 1 - SUCCESSFUL" + ); + + RTEMS.MESSAGE_QUEUE.SEND( + SPTEST.QUEUE_ID( 1 ), + BUFFER_POINTER, + 16, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.TOO_MANY, + "MESSAGE_QUEUE_SEND TOO MANY TO LIMITED QUEUE" + ); + TEXT_IO.PUT_LINE( + "TA1 - message_queue_send - BUFFER 4 TO Q 1 - TOO_MANY" + ); + + RTEMS.MESSAGE_QUEUE.DELETE( SPTEST.QUEUE_ID( 1 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( + STATUS, + "MESSAGE_QUEUE_DELETE SUCCESSFUL" + ); + TEXT_IO.PUT_LINE( + "TA1 - message_queue_delete - Q 1 - SUCCESSFUL" + ); + + RTEMS.MESSAGE_QUEUE.CREATE( + SPTEST.QUEUE_NAME( 1 ), + 2, + 16, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.QUEUE_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( + STATUS, + "MESSAGE_QUEUE_CREATE SUCCESSFUL" + ); + TEXT_IO.PUT_LINE( + "TA1 - message_queue_create - Q 1 - 3 DEEP - SUCCESSFUL" + ); + + TEXT_IO.PUT_LINE( + "TA1 - task_start - start TA3 - SUCCESSFUL" + ); + RTEMS.TASKS.START( + SPTEST.TASK_ID( 3 ), + SPTEST.TASK_3'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA3" ); + + TEXT_IO.PUT_LINE( + "TA1 - task_wake_after - yield processor - SUCCESSFUL" + ); + RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER (yield)" ); + + RTEMS.MESSAGE_QUEUE.DELETE( SPTEST.QUEUE_ID( 1 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( + STATUS, + "MESSAGE_QUEUE_DELETE SUCCESSFUL" + ); + TEXT_IO.PUT_LINE( + "TA1 - message_queue_delete - delete Q 1 - SUCCESSFUL" + ); + + TEXT_IO.PUT_LINE( + "TA1 - task_wake_after - yield processor - SUCCESSFUL" + ); + RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER (yield)" ); + + end SCREEN_8; + +-- +-- SCREEN_9 +-- + + procedure SCREEN_9 + is + CONVERTED : RTEMS.ADDRESS; + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.PORT.CREATE( + 0, + SPTEST.INTERNAL_PORT_AREA'ADDRESS, + SPTEST.EXTERNAL_PORT_AREA'ADDRESS, + SPTEST.INTERNAL_PORT_AREA'LENGTH, + SPTEST.JUNK_ID, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_NAME, + "PORT_CREATE WITH ILLEGAL NAME" + ); + TEXT_IO.PUT_LINE( "TA1 - port_create - INVALID_NAME" ); + + RTEMS.PORT.CREATE( + SPTEST.PORT_NAME( 1 ), + SPTEST.INTERNAL_PORT_AREA( 1 )'ADDRESS, + SPTEST.EXTERNAL_PORT_AREA'ADDRESS, + SPTEST.INTERNAL_PORT_AREA'LENGTH, + SPTEST.JUNK_ID, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ADDRESS, + "PORT_CREATE WITH ILLEGAL ADDRESS" + ); + TEXT_IO.PUT_LINE( "TA1 - port_create - INVALID_ADDRESS" ); + + RTEMS.PORT.CREATE( + SPTEST.PORT_NAME( 1 ), + SPTEST.INTERNAL_PORT_AREA'ADDRESS, + SPTEST.EXTERNAL_PORT_AREA'ADDRESS, + SPTEST.INTERNAL_PORT_AREA'LENGTH, + SPTEST.JUNK_ID, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.TOO_MANY, + "PORT_CREATE OF TOO MANY" + ); + TEXT_IO.PUT_LINE( "TA1 - port_create - TOO_MANY" ); + + RTEMS.PORT.DELETE( 0, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "PORT_DELETE WITH ILLEGAL ID" + ); + TEXT_IO.PUT_LINE( "TA1 - port_delete - INVALID_ID" ); + + RTEMS.PORT.IDENT( 0, SPTEST.JUNK_ID, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_NAME, + "PORT_IDENT WITH ILLEGAL NAME" + ); + TEXT_IO.PUT_LINE( "TA1 - port_ident - INVALID_NAME" ); + + RTEMS.PORT.INTERNAL_TO_EXTERNAL( + 100, + SPTEST.INTERNAL_PORT_AREA'ADDRESS, + CONVERTED, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "PORT_INTERNAL_TO_EXTERNAL WITH ILLEGAL ID" + ); + TEXT_IO.PUT_LINE( + "TA1 - port_internal_to_external - INVALID_ID" + ); + + RTEMS.PORT.EXTERNAL_TO_INTERNAL( + 100, + SPTEST.EXTERNAL_PORT_AREA'ADDRESS, + CONVERTED, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "PORT_EXTERNAL_TO_INTERNAL WITH ILLEGAL ID" + ); + TEXT_IO.PUT_LINE( + "TA1 - port_external_to_internal - INVALID_ID" + ); + + end SCREEN_9; + +-- +-- SCREEN_10 +-- + + procedure SCREEN_10 + is + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.RATE_MONOTONIC.CREATE( 0, SPTEST.JUNK_ID, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_NAME, + "RATE_MONOTONIC_CREATE WITH ILLEGAL NAME" + ); + TEXT_IO.PUT_LINE( + "TA1 - rate_monotonic_create - INVALID_NAME" + ); + + RTEMS.RATE_MONOTONIC.CREATE( + SPTEST.PERIOD_NAME( 1 ), + SPTEST.PERIOD_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "RATE_MONOTONIC_CREATE" ); + TEXT_IO.PUT_LINE( + "TA1 - rate_monotonic_create - SUCCESSFUL" + ); + + RTEMS.RATE_MONOTONIC.CREATE( + SPTEST.PERIOD_NAME( 1 ), + SPTEST.JUNK_ID, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.TOO_MANY, + "RATE_MONOTONIC_CREATE FOR TOO MANY" + ); + TEXT_IO.PUT_LINE( "TA1 - rate_monotonic_create - TOO_MANY" ); + + RTEMS.RATE_MONOTONIC.IDENT( 0, SPTEST.JUNK_ID, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_NAME, + "RATE_MONOTONIC_IDENT WITH ILLEGAL NAME" + ); + TEXT_IO.PUT_LINE( + "TA1 - rate_monotonic_ident - INVALID_NAME" + ); + + RTEMS.RATE_MONOTONIC.PERIOD( 100, 5, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "RATE_MONOTONIC_PERIOD WITH ILLEGAL ID" + ); + TEXT_IO.PUT_LINE( + "TA1 - rate_monotonic_period - unknown INVALID_ID" + ); + + RTEMS.RATE_MONOTONIC.PERIOD( 16#10100#, 5, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "RATE_MONOTONIC_PERIOD WITH ILLEGAL ID" + ); + TEXT_IO.PUT_LINE( + "TA1 - rate_monotonic_period - local INVALID_ID" + ); + + RTEMS.RATE_MONOTONIC.PERIOD( + SPTEST.PERIOD_ID( 1 ), + RTEMS.RATE_MONOTONIC_PERIOD_STATUS, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.NOT_DEFINED, + "RATE_MONOTONIC_PERIOD STATUS NOT DEFINED" + ); + TEXT_IO.PUT_LINE( + "TA1 - rate_monotonic_period( STATUS ) - NOT_DEFINED" + ); + + RTEMS.RATE_MONOTONIC.PERIOD( SPTEST.PERIOD_ID( 1 ), 100, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( + STATUS, + "RATE_MONOTONIC_PERIOD 100 TICKS" + ); + TEXT_IO.PUT( "TA1 - rate_monotonic_period - 100 ticks - " ); + TEXT_IO.PUT_LINE( "SUCCESSFUL" ); + + RTEMS.RATE_MONOTONIC.PERIOD( + SPTEST.PERIOD_ID( 1 ), + RTEMS.RATE_MONOTONIC_PERIOD_STATUS, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( + STATUS, + "RATE_MONOTONIC_PERIOD STATUS" + ); + TEXT_IO.PUT( "TA1 - rate_monotonic_period( STATUS ) - " ); + TEXT_IO.PUT_LINE( "SUCCESSFUL" ); + + loop + + RTEMS.RATE_MONOTONIC.PERIOD( + SPTEST.PERIOD_ID( 1 ), + RTEMS.RATE_MONOTONIC_PERIOD_STATUS, + STATUS + ); + + exit when RTEMS.ARE_STATUSES_EQUAL( STATUS, RTEMS.TIMEOUT ); + + TEST_SUPPORT.DIRECTIVE_FAILED( + STATUS, + "RATE_MONOTONIC_PERIOD STATUS WAITING FOR TIMEOUT" + ); + + end loop; + TEXT_IO.PUT( "TA1 - rate_monotonic_period( STATUS ) - " ); + TEXT_IO.PUT_LINE( "TIMEOUT" ); + + RTEMS.RATE_MONOTONIC.CANCEL( 100, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "RATE_MONOTONIC_CANCEL WITH ILLEGAL ID" + ); + TEXT_IO.PUT_LINE( + "TA1 - rate_monotonic_cancel - unknown INVALID_ID" + ); + + RTEMS.RATE_MONOTONIC.CANCEL( 16#10100#, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "RATE_MONOTONIC_CANCEL WITH ILLEGAL ID" + ); + TEXT_IO.PUT_LINE( + "TA1 - rate_monotonic_cancel - local INVALID_ID" + ); + + RTEMS.RATE_MONOTONIC.CANCEL( SPTEST.PERIOD_ID( 1 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "RATE_MONOTONIC_CANCEL" ); + TEXT_IO.PUT_LINE( "TA1 - rate_monotonic_cancel - SUCCESSFUL" ); + + RTEMS.RATE_MONOTONIC.PERIOD( SPTEST.PERIOD_ID( 1 ), 5, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( + STATUS, + "RATE_MONOTONIC_PERIOD RESTART" + ); + + RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + RTEMS.RATE_MONOTONIC.PERIOD( SPTEST.PERIOD_ID( 1 ), 5, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.TIMEOUT, + "RATE_MONOTONIC_PERIOD TIMED OUT" + ); + TEXT_IO.PUT_LINE( + "TA1 - rate_monotonic_period - 5 ticks - TIMEOUT" + ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 4 ), + SPTEST.TASK_4'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA4" ); + + TEXT_IO.PUT_LINE( "TA1 - task_wake_after - yielding to TA4" ); + RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER (yield)" ); + + RTEMS.RATE_MONOTONIC.DELETE( 100, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "RATE_MONOTONIC_DELETE WITH ILLEGAL ID" + ); + TEXT_IO.PUT_LINE( + "TA1 - rate_monotonic_delete - unknown INVALID_ID" + ); + + RTEMS.RATE_MONOTONIC.DELETE( 16#10100#, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "RATE_MONOTONIC_DELETE WITH ILLEGAL ID" + ); + TEXT_IO.PUT_LINE( + "TA1 - rate_monotonic_delete - local INVALID_ID" + ); + + RTEMS.RATE_MONOTONIC.DELETE( SPTEST.PERIOD_ID( 1 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "RATE_MONOTONIC_DELETE" ); + TEXT_IO.PUT_LINE( + "TA1 - rate_monotonic_delete - SUCCESSFUL" + ); + + end SCREEN_10; + +-- +-- SCREEN_11 +-- + + procedure SCREEN_11 + is + BUFFER_ADDRESS_1 : RTEMS.ADDRESS; + BUFFER_ADDRESS_2 : RTEMS.ADDRESS; + BUFFER_ADDRESS_3 : RTEMS.ADDRESS; + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.PARTITION.CREATE( + 0, + SPTEST.PARTITION_GOOD_AREA'ADDRESS, + 128, + 40, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.JUNK_ID, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_NAME, + "PARTITION_CREATE WITH ILLEGAL NAME" + ); + TEXT_IO.PUT_LINE( "TA1 - partition_create - INVALID_NAME" ); + + RTEMS.PARTITION.CREATE( + SPTEST.PARTITION_NAME( 1 ), + SPTEST.PARTITION_GOOD_AREA'ADDRESS, + 0, + 80, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.JUNK_ID, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_SIZE, + "PARTITION_CREATE WITH ILLEGAL LENGTH" + ); + TEXT_IO.PUT_LINE( + "TA1 - partition_create - length - INVALID_SIZE" + ); + + RTEMS.PARTITION.CREATE( + SPTEST.PARTITION_NAME( 1 ), + SPTEST.PARTITION_GOOD_AREA'ADDRESS, + 128, + 0, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.JUNK_ID, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_SIZE, + "PARTITION_CREATE WITH ILLEGAL BUFFER_SIZE" + ); + TEXT_IO.PUT_LINE( + "TA1 - partition_create - buffer size - INVALID_SIZE" + ); + + RTEMS.PARTITION.CREATE( + SPTEST.PARTITION_NAME( 1 ), + SPTEST.PARTITION_GOOD_AREA'ADDRESS, + 128, + 256, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.JUNK_ID, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_SIZE, + "PARTITION_CREATE WITH BUFFER_SIZE > LENGTH" + ); + TEXT_IO.PUT_LINE( + "TA1 - partition_create - length < buffer size - INVALID_SIZE" + ); + + if TEST_SUPPORT.Is_Configured_Multiprocessing then + RTEMS.PARTITION.CREATE( + SPTEST.PARTITION_NAME( 1 ), + SPTEST.PARTITION_GOOD_AREA'ADDRESS, + 128, + 64, + RTEMS.GLOBAL, + SPTEST.JUNK_ID, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.MP_NOT_CONFIGURED, + "PARTITION_CREATE OF GLOBAL" + ); + end if; + TEXT_IO.PUT_LINE("TA1 - partition_create - MP_NOT_CONFIGURED"); + + RTEMS.PARTITION.CREATE( + SPTEST.PARTITION_NAME( 1 ), + SPTEST.PARTITION_BAD_AREA'ADDRESS, + 128, + 64, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.JUNK_ID, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ADDRESS, + "PARTITION_CREATE WITH BAD ADDRESS" + ); + TEXT_IO.PUT_LINE( "TA1 - partition_create - INVALID_ADDRESS" ); + + RTEMS.PARTITION.CREATE( + SPTEST.PARTITION_NAME( 1 ), + SPTEST.PARTITION_GOOD_AREA'ADDRESS, + 128, + 34, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.JUNK_ID, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_SIZE, + "PARTITION_CREATE WITH UNALIGNED BUFFER_SIZE" + ); + TEXT_IO.PUT_LINE( "TA1 - partition_create - INVALID_SIZE" ); + + RTEMS.PARTITION.DELETE( 100, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "PARTITION_DELETE WITH ILLEGAL ID" + ); + TEXT_IO.PUT_LINE( + "TA1 - partition_delete - unknown INVALID_ID" + ); + + RTEMS.PARTITION.DELETE( 16#10100#, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "PARTITION_DELETE WITH ILLEGAL ID" + ); + TEXT_IO.PUT_LINE( + "TA1 - partition_delete - local INVALID_ID" + ); + + RTEMS.PARTITION.GET_BUFFER( 100, BUFFER_ADDRESS_1, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "PARTITION_GET_BUFFER WITH ILLEGAL ID" + ); + TEXT_IO.PUT_LINE( "TA1 - partition_get_buffer - INVALID_ID" ); + + RTEMS.PARTITION.IDENT( + 0, + RTEMS.SEARCH_ALL_NODES, + SPTEST.JUNK_ID, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_NAME, + "PARTITION_IDENT WITH ILLEGAL NAME" + ); + TEXT_IO.PUT_LINE( "TA1 - partition_ident - INVALID_NAME" ); + + RTEMS.PARTITION.RETURN_BUFFER( 100, BUFFER_ADDRESS_1, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "PARTITION_RETURN WITH ILLEGAL ID" + ); + TEXT_IO.PUT_LINE( + "TA1 - partition_return_buffer - INVALID_ID" + ); + + RTEMS.PARTITION.CREATE( + SPTEST.PARTITION_NAME( 1 ), + SPTEST.PARTITION_GOOD_AREA'ADDRESS, + 128, + 64, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.PARTITION_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_CREATE" ); + TEXT_IO.PUT_LINE( "TA1 - partition_create - SUCCESSFUL" ); + + RTEMS.PARTITION.CREATE( + SPTEST.PARTITION_NAME( 1 ), + SPTEST.PARTITION_GOOD_AREA'ADDRESS, + 128, + 64, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.JUNK_ID, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.TOO_MANY, + "PARTITION_CREATE OF TOO MANY" + ); + TEXT_IO.PUT_LINE( "TA1 - partition_create - TOO_MANY" ); + + RTEMS.PARTITION.GET_BUFFER( + SPTEST.PARTITION_ID( 1 ), + BUFFER_ADDRESS_1, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_GET_BUFFER" ); + TEXT_IO.PUT_LINE( "TA1 - partition_get_buffer - SUCCESSFUL" ); + + RTEMS.PARTITION.GET_BUFFER( + SPTEST.PARTITION_ID( 1 ), + BUFFER_ADDRESS_2, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_GET_BUFFER" ); + TEXT_IO.PUT_LINE( "TA1 - partition_get_buffer - SUCCESSFUL" ); + + RTEMS.PARTITION.GET_BUFFER( + SPTEST.PARTITION_ID( 1 ), + BUFFER_ADDRESS_3, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.UNSATISFIED, + "PARTITION_GET_BUFFER UNSATISFIED" + ); + TEXT_IO.PUT_LINE( "TA1 - partition_get_buffer - UNSATISFIED" ); + + RTEMS.PARTITION.DELETE( + SPTEST.PARTITION_ID( 1 ), + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.RESOURCE_IN_USE, + "PARTITION_DELETE WITH BUFFERS IN USE" + ); + TEXT_IO.PUT_LINE( "TA1 - partition_delete - RESOURCE_IN_USE" ); + + RTEMS.PARTITION.RETURN_BUFFER( + SPTEST.PARTITION_ID( 1 ), + SPTEST.REGION_GOOD_AREA( 0 )'ADDRESS, -- NOTE: REGION + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ADDRESS, + "PARTITION_RETURN WITH BUFFER ADDRESS OUT OF PARTITION" + ); + TEXT_IO.PUT( "TA1 - partition_return_buffer - " ); + TEXT_IO.PUT_LINE( "INVALID_ADDRESS - out of range" ); + + RTEMS.PARTITION.RETURN_BUFFER( + SPTEST.PARTITION_ID( 1 ), + SPTEST.PARTITION_GOOD_AREA( 7 )'ADDRESS, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ADDRESS, + "PARTITION_RETURN WITH BUFFER ADDRESS NOT ON BOUNDARY" + ); + TEXT_IO.PUT( "TA1 - partition_return_buffer - " ); + TEXT_IO.PUT_LINE( "INVALID_ADDRESS - not on boundary" ); + + + end SCREEN_11; + +-- +-- SCREEN_12 +-- + + procedure SCREEN_12 + is + SEGMENT_ADDRESS_1 : RTEMS.ADDRESS; + SEGMENT_ADDRESS_2 : RTEMS.ADDRESS; + SEGMENT_ADDRESS_3 : RTEMS.ADDRESS; +-- OFFSET : RTEMS.UNSIGNED32; +-- GOOD_FRONT_FLAG : RTEMS.UNSIGNED32; +-- GOOD_BACK_FLAG : RTEMS.UNSIGNED32; + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.REGION.CREATE( + 0, + SPTEST.REGION_GOOD_AREA'ADDRESS, + 16#40#, + 32, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.JUNK_ID, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_NAME, + "REGION_CREATE WITH ILLEGAL NAME" + ); + TEXT_IO.PUT_LINE( "TA1 - region_create - INVALID_NAME" ); + + RTEMS.REGION.CREATE( + SPTEST.REGION_NAME( 1 ), + SPTEST.REGION_BAD_AREA'ADDRESS, + 16#40#, + 32, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.JUNK_ID, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ADDRESS, + "REGION_CREATE WITH ILLEGAL ADDRESS" + ); + TEXT_IO.PUT_LINE( "TA1 - region_create - INVALID_ADDRESS" ); + + RTEMS.REGION.CREATE( + SPTEST.REGION_NAME( 1 ), + SPTEST.REGION_GOOD_AREA'ADDRESS, + 34, + 34, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.JUNK_ID, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_SIZE, + "REGION_CREATE WITH ILLEGAL SIZE" + ); + TEXT_IO.PUT_LINE( "TA1 - region_create - INVALID_SIZE" ); + + RTEMS.REGION.CREATE( + SPTEST.REGION_NAME( 1 ), + SPTEST.REGION_GOOD_AREA( SPTEST.REGION_START_OFFSET )'ADDRESS, + SPTEST.REGION_LENGTH, + 16#40#, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.REGION_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_CREATE" ); + TEXT_IO.PUT_LINE( "TA1 - region_create - SUCCESSFUL" ); + + RTEMS.REGION.CREATE( + SPTEST.REGION_NAME( 1 ), + SPTEST.REGION_GOOD_AREA'ADDRESS, + SPTEST.REGION_LENGTH, + 16#40#, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.JUNK_ID, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.TOO_MANY, + "REGION_CREATE FOR TOO MANY" + ); + TEXT_IO.PUT_LINE( "TA1 - region_create - TOO_MANY" ); + + RTEMS.REGION.DELETE( 100, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "REGION_DELETE WITH ILLEGAL ID" + ); + TEXT_IO.PUT_LINE( "TA1 - region_delete - unknown INVALID_ID" ); + + RTEMS.REGION.DELETE( 16#10100#, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "REGION_DELETE WITH ILLEGAL ID" + ); + TEXT_IO.PUT_LINE( "TA1 - region_delete - local INVALID_ID" ); + + RTEMS.REGION.IDENT( 0, SPTEST.JUNK_ID, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_NAME, + "REGION_IDENT WITH ILLEGAL NAME" + ); + TEXT_IO.PUT_LINE( "TA1 - region_ident - INVALID_NAME" ); + + RTEMS.REGION.GET_SEGMENT( + 100, + 16#40#, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + SEGMENT_ADDRESS_1, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "REGION_GET_SEGMENT WITH ILLEGAL ID" + ); + TEXT_IO.PUT_LINE( "TA1 - region_get_segment - INVALID_ID" ); + + RTEMS.REGION.GET_SEGMENT( + SPTEST.REGION_ID( 1 ), + (SPTEST.REGION_GOOD_AREA'SIZE / 8) * 2, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + SEGMENT_ADDRESS_1, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_SIZE, + "REGION_GET_SEGMENT WITH ILLEGAL SIZE" + ); + TEXT_IO.PUT_LINE( "TA1 - region_get_segment - INVALID_SIZE" ); + + RTEMS.REGION.GET_SEGMENT( + SPTEST.REGION_ID( 1 ), + 384, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + SEGMENT_ADDRESS_1, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); + TEXT_IO.PUT_LINE( "TA1 - region_get_segment - SUCCESSFUL" ); + + RTEMS.REGION.GET_SEGMENT( + SPTEST.REGION_ID( 1 ), + SPTEST.REGION_LENGTH / 2, + RTEMS.NO_WAIT, + RTEMS.NO_TIMEOUT, + SEGMENT_ADDRESS_2, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.UNSATISFIED, + "REGION_GET_SEGMENT UNSATISFIED" + ); + TEXT_IO.PUT_LINE( "TA1 - region_get_segment - UNSATISFIED" ); + + TEXT_IO.PUT_LINE( "TA1 - region_get_segment - timeout in 3 seconds" ); + RTEMS.REGION.GET_SEGMENT( + SPTEST.REGION_ID( 1 ), + 128, + RTEMS.DEFAULT_OPTIONS, + 3 * TEST_SUPPORT.TICKS_PER_SECOND, + SEGMENT_ADDRESS_3, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.TIMEOUT, + "REGION_GET_SEGMENT TIMEOUT" + ); + TEXT_IO.PUT_LINE( + "TA1 - region_get_segment - woke up with TIMEOUT" + ); + + RTEMS.REGION.DELETE( SPTEST.REGION_ID( 1 ), STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.RESOURCE_IN_USE, + "REGION_DELETE WITH BUFFERS IN USE" + ); + TEXT_IO.PUT_LINE( "TA1 - region_delete - RESOURCE_IN_USE" ); + + RTEMS.REGION.RETURN_SEGMENT( + 100, + SEGMENT_ADDRESS_1, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "REGION_RETURN_SEGMENT WITH ILLEGAL ID" + ); + TEXT_IO.PUT_LINE( "TA1 - region_return_segment - INVALID_ID" ); + + RTEMS.REGION.RETURN_SEGMENT( + SPTEST.REGION_ID( 1 ), + SPTEST.REGION_GOOD_AREA'ADDRESS, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ADDRESS, + "REGION_RETURN_SEGMENT WITH ILLEGAL SEGMENT" + ); + TEXT_IO.PUT_LINE( + "TA1 - region_return_segment - INVALID_ADDRESS" + ); + +-- OFFSET := 0; +-- GOOD_BACK_FLAG := 0; +-- GOOD_FRONT_FLAG := 0; + + TEXT_IO.PUT_LINE( + "TA1 - region_return_segment - INVALID_ADDRESS - SKIPPED" + ); + TEXT_IO.PUT_LINE( + "TA1 - region_return_segment - INVALID_ADDRESS - SKIPPED" + ); + + +-- OFFSET := RTEMS.SUBTRACT( +-- SEGMENT_ADDRESS_1, +-- SPTEST.REGION_GOOD_AREA'ADDRESS +-- ) / 4; +-- +-- +-- -- bad FRONT_FLAG error +-- +-- GOOD_FRONT_FLAG := SPTEST.REGION_GOOD_AREA( OFFSET - 1 ); +-- SPTEST.REGION_GOOD_AREA( OFFSET - 1 ) := GOOD_FRONT_FLAG + 2; +-- +-- RTEMS.REGION.RETURN_SEGMENT( +-- SPTEST.REGION_ID( 1 ), +-- SEGMENT_ADDRESS_1, +-- STATUS +-- ); +-- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( +-- STATUS, +-- RTEMS.INVALID_ADDRESS, +-- "REGION_RETURN_SEGMENT WITH BACK_FLAG /= FRONT_FLAG" +-- ); +-- TEXT_IO.PUT_LINE( +-- "TA1 - region_return_segment - INVALID_ADDRESS" +-- ); +-- +-- SPTEST.REGION_GOOD_AREA( OFFSET - 1 ) := GOOD_FRONT_FLAG; +-- +-- -- bad BACK_FLAG error +-- +-- GOOD_BACK_FLAG := SPTEST.REGION_GOOD_AREA( OFFSET - 2 ); +-- SPTEST.REGION_GOOD_AREA( OFFSET - 2 ) := 1024; +-- +-- RTEMS.REGION.RETURN_SEGMENT( +-- SPTEST.REGION_ID( 1 ), +-- SEGMENT_ADDRESS_1, +-- STATUS +-- ); +-- TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( +-- STATUS, +-- RTEMS.INVALID_ADDRESS, +-- "REGION_RETURN_SEGMENT WITH BACK_FLAG /= FRONT_FLAG" +-- ); +-- TEXT_IO.PUT_LINE( +-- "TA1 - region_return_segment - INVALID_ADDRESS" +-- ); +-- +-- SPTEST.REGION_GOOD_AREA( OFFSET - 2 ) := GOOD_BACK_FLAG; + + RTEMS.REGION.EXTEND( + 100, + SPTEST.REGION_GOOD_AREA'ADDRESS, + 128, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "REGION_EXTEND WITH INVALID_ID" + ); + TEXT_IO.PUT_LINE( + "TA1 - region_extend - INVALID_ID" + ); + + RTEMS.REGION.EXTEND( + SPTEST.REGION_ID( 1 ), + SPTEST.REGION_GOOD_AREA( SPTEST.REGION_START_OFFSET + 16 )'ADDRESS, + 128, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ADDRESS, + "REGION_EXTEND WITH INVALID_ADDRESS" + ); + TEXT_IO.PUT_LINE( + "TA1 - region_extend - within heap - INVALID_ADDRESS" + ); + + RTEMS.REGION.EXTEND( + SPTEST.REGION_ID( 1 ), + SPTEST.REGION_BAD_AREA'ADDRESS, + 128, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.NOT_IMPLEMENTED, + "REGION_EXTEND WITH NOT_IMPLEMENTED" + ); + TEXT_IO.PUT_LINE( + "TA1 - region_extend - non-contiguous lower - NOT_IMPLEMENTED" + ); + + RTEMS.REGION.EXTEND( + SPTEST.REGION_ID( 1 ), + SPTEST.REGION_GOOD_AREA( + SPTEST.REGION_START_OFFSET - SPTEST.REGION_LENGTH )'ADDRESS, + 128, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.NOT_IMPLEMENTED, + "REGION_EXTEND WITH NOT_IMPLEMENTED" + ); + TEXT_IO.PUT_LINE( + "TA1 - region_extend - contiguous lower - NOT_IMPLEMENTED" + ); + + RTEMS.REGION.EXTEND( + SPTEST.REGION_ID( 1 ), + SPTEST.REGION_GOOD_AREA( + SPTEST.REGION_START_OFFSET + SPTEST.REGION_LENGTH + 16 )'ADDRESS, + 128, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.NOT_IMPLEMENTED, + "REGION_EXTEND WITH NOT_IMPLEMENTED" + ); + TEXT_IO.PUT_LINE( + "TA1 - region_extend - non-contiguous higher - NOT_IMPLEMENTED" + ); + + end SCREEN_12; + +-- +-- SCREEN_13 +-- + + procedure SCREEN_13 + is + TIME : RTEMS.TIME_OF_DAY; + STATUS : RTEMS.STATUS_CODES; + begin + TIME := ( 2000, 12, 31, 23, 59, 59, 0 ); + RTEMS.CLOCK.SET( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET SUCCESSFUL" ); + TEST_SUPPORT.PRINT_TIME( + "TA1 - clock_set - ", + TIME, + " - SUCCESSFUL" + ); + TEXT_IO.NEW_LINE; + RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + RTEMS.CLOCK.GET_TOD( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); + TEST_SUPPORT.PRINT_TIME( + "TA1 - clock_get - ", + TIME, + " - SUCCESSFUL" + ); + TEXT_IO.NEW_LINE; + + TIME := ( 1999, 12, 31, 23, 59, 59, 0 ); + RTEMS.CLOCK.SET( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET SUCCESSFUL" ); + TEST_SUPPORT.PRINT_TIME( + "TA1 - clock_set - ", + TIME, + " - SUCCESSFUL" + ); + TEXT_IO.NEW_LINE; + RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + RTEMS.CLOCK.GET_TOD( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); + TEST_SUPPORT.PRINT_TIME( + "TA1 - clock_get - ", + TIME, + " - SUCCESSFUL" + ); + TEXT_IO.NEW_LINE; + + TIME := ( 2100, 12, 31, 23, 59, 59, 0 ); + RTEMS.CLOCK.SET( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET SUCCESSFUL" ); + TEST_SUPPORT.PRINT_TIME( + "TA1 - clock_set - ", + TIME, + " - SUCCESSFUL" + ); + TEXT_IO.NEW_LINE; + RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + RTEMS.CLOCK.GET_TOD( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); + TEST_SUPPORT.PRINT_TIME( + "TA1 - clock_get - ", + TIME, + " - SUCCESSFUL" + ); + TEXT_IO.NEW_LINE; + + TIME := ( 2099, 12, 31, 23, 59, 59, 0 ); + RTEMS.CLOCK.SET( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET SUCCESSFUL" ); + TEST_SUPPORT.PRINT_TIME( + "TA1 - clock_set - ", + TIME, + " - SUCCESSFUL" + ); + TEXT_IO.NEW_LINE; + RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + RTEMS.CLOCK.GET_TOD( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); + TEST_SUPPORT.PRINT_TIME( + "TA1 - clock_get - ", + TIME, + " - SUCCESSFUL" + ); + TEXT_IO.NEW_LINE; + + TIME := ( 1991, 12, 31, 23, 59, 59, 0 ); + RTEMS.CLOCK.SET( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET SUCCESSFUL" ); + TEST_SUPPORT.PRINT_TIME( + "TA1 - clock_set - ", + TIME, + " - SUCCESSFUL" + ); + TEXT_IO.NEW_LINE; + RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + RTEMS.CLOCK.GET_TOD( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); + TEST_SUPPORT.PRINT_TIME( + "TA1 - clock_get - ", + TIME, + " - SUCCESSFUL" + ); + TEXT_IO.NEW_LINE; + + end SCREEN_13; + +-- +-- SCREEN_14 +-- + + procedure SCREEN_14 + is + TIME : RTEMS.TIME_OF_DAY; + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.TIMER.CREATE( 0, SPTEST.JUNK_ID, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_NAME, + "TIMER_CREATE WITH ILLEGAL NAME" + ); + TEXT_IO.PUT_LINE( "TA1 - timer_create - INVALID_NAME" ); + + RTEMS.TIMER.CREATE( + SPTEST.TIMER_NAME( 1 ), + SPTEST.TIMER_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE" ); + TEXT_IO.PUT_LINE( "TA1 - timer_create - 1 - SUCCESSFUL" ); + + RTEMS.TIMER.CREATE( + SPTEST.TIMER_NAME( 1 ), + SPTEST.JUNK_ID, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.TOO_MANY, + "TIMER_CREATE FOR TOO MANY" + ); + TEXT_IO.PUT_LINE( "TA1 - timer_create - 2 - TOO_MANY" ); + + RTEMS.TIMER.DELETE( 100, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "TIMER_DELETE WITH ILLEGAL ID" + ); + TEXT_IO.PUT_LINE( "TA1 - timer_delete - local INVALID_ID" ); + + RTEMS.TIMER.DELETE( 16#10100#, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "TIMER_DELETE WITH ILLEGAL ID" + ); + TEXT_IO.PUT_LINE( "TA1 - timer_delete - global INVALID_ID" ); + + RTEMS.TIMER.IDENT( 0, SPTEST.JUNK_ID, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_NAME, + "TIMER_IDENT WITH ILLEGAL NAME" + ); + TEXT_IO.PUT_LINE( "TA1 - timer_ident - INVALID_NAME" ); + + RTEMS.TIMER.CANCEL( 16#10100#, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "TIMER_CANCEL WITH ILLEGAL ID" + ); + TEXT_IO.PUT_LINE( "TA1 - timer_cancel - INVALID_ID" ); + + RTEMS.TIMER.RESET( 16#10100#, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "TIMER_RESET WITH ILLEGAL ID" + ); + TEXT_IO.PUT_LINE( "TA1 - timer_reset - INVALID_ID" ); + + RTEMS.TIMER.RESET( SPTEST.TIMER_ID( 1 ), STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.NOT_DEFINED, + "TIMER_RESET BEFORE INITIATED" + ); + TEXT_IO.PUT_LINE( "TA1 - timer_reset - NOT_DEFINED" ); + + RTEMS.TIMER.FIRE_AFTER( + 16#10100#, + 5 * TEST_SUPPORT.TICKS_PER_SECOND, + SPTEST.DELAYED_SUBPROGRAM'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "TIMER_FIRE_AFTER WITH ILLEGAL ID" + ); + TEXT_IO.PUT_LINE( "TA1 - timer_fire_after - INVALID_ID" ); + + TIME := ( 1994, 12, 31, 1, 0, 0, 0 ); + RTEMS.TIMER.FIRE_WHEN( + 16#10100#, + TIME, + SPTEST.DELAYED_SUBPROGRAM'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "TIMER_FIRE_WHEN WITH ILLEGAL ID" + ); + TEXT_IO.PUT_LINE( "TA1 - timer_fire_when - INVALID_ID" ); + + RTEMS.TIMER.FIRE_AFTER( + SPTEST.TIMER_ID( 1 ), + 0, + SPTEST.DELAYED_SUBPROGRAM'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_NUMBER, + "TIMER_FIRE_AFTER WITH 0 TICKS" + ); + TEXT_IO.PUT_LINE( "TA1 - timer_fire_after - INVALID_NUMBER" ); + + TIME := ( 1987, 2, 5, 8, 30, 45, 0 ); + RTEMS.TIMER.FIRE_WHEN( + SPTEST.TIMER_ID( 1 ), + TIME, + SPTEST.DELAYED_SUBPROGRAM'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_CLOCK, + "TIMER_FIRE_WHEN WITH ILLEGAL TIME" + ); + TEST_SUPPORT.PRINT_TIME( + "TA1 - timer_fire_when - ", + TIME, + " - INVALID_CLOCK" + ); + TEXT_IO.NEW_LINE; + + RTEMS.CLOCK.GET_TOD( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET SUCCESSFUL" ); + TEST_SUPPORT.PRINT_TIME( "TA1 - clock_get - ", TIME, "" ); + TEXT_IO.NEW_LINE; + + TIME := ( 1990, 2, 5, 8, 30, 45, 0 ); + RTEMS.TIMER.FIRE_WHEN( + SPTEST.TIMER_ID( 1 ), + TIME, + SPTEST.DELAYED_SUBPROGRAM'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_CLOCK, + "TIMER_FIRE_WHEN BEFORE CURRENT TIME" + ); + TEST_SUPPORT.PRINT_TIME( + "TA1 - timer_fire_when - ", + TIME, + " - before INVALID_CLOCK" + ); + TEXT_IO.NEW_LINE; + + RTEMS.TIMER.SERVER_FIRE_AFTER( + 0, 5, SPTEST.DELAYED_SUBPROGRAM'ACCESS, RTEMS.NULL_ADDRESS, STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INCORRECT_STATE, + "TIMER_SERVER_FIRE_AFTER INCORRECT STATE" + ); + TEXT_IO.PUT_LINE( "TA1 - timer_server_fire_after - INCORRECT_STATE" ); + + RTEMS.TIMER.SERVER_FIRE_WHEN( + 0, TIME, SPTEST.DELAYED_SUBPROGRAM'ACCESS, RTEMS.NULL_ADDRESS, STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INCORRECT_STATE, + "TIMER_SERVER_FIRE_WHEN INCORRECT STATE" + ); + TEXT_IO.PUT_LINE( "TA1 - timer_server_fire_when - INCORRECT_STATE" ); + + RTEMS.TIMER.INITIATE_SERVER( 0, 0, 0, STATUS ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_PRIORITY, + "timer_initiate_server invalid priority" + ); + TEXT_IO.PUT_LINE( "TA1 - timer_initiate_server - INVALID_PRIORITY" ); + + RTEMS.TIMER.INITIATE_SERVER( +-- XXX ask Joel +-- RTEMS.TIMER.SERVER_DEFAULT_PRIORITY, 0, 0, STATUS + -1, 0, 0, STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "timer_initiate_server" ); + TEXT_IO.PUT_LINE( "TA1 - timer_initiate_server" ); + + RTEMS.TIMER.SERVER_FIRE_AFTER( + 16#010100#, + 5 * TEST_SUPPORT.TICKS_PER_SECOND, + SPTEST.DELAYED_SUBPROGRAM'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "TIMER_SERVER_FIRE_AFTER ILLEGAL ID" + ); + TEXT_IO.PUT_LINE( "TA1 - timer_server_fire_after - INVALID_ID" ); + + TIME := ( 1994, 12, 31, 9, 0, 0, 0 ); + RTEMS.TIMER.SERVER_FIRE_WHEN( + 16#010100#, + TIME, + SPTEST.DELAYED_SUBPROGRAM'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_ID, + "TIMER_SERVER_FIRE_WHEN WITH ILLEGAL ID" + ); + TEXT_IO.PUT_LINE( "TA1 - timer_server_fire_when - INVALID_ID" ); + + RTEMS.TIMER.SERVER_FIRE_AFTER( + SPTEST.TIMER_ID( 1 ), + 0, + SPTEST.DELAYED_SUBPROGRAM'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_NUMBER, + "TIMER_SERVER_FIRE_AFTER WITH 0 TICKS" + ); + TEXT_IO.PUT_LINE( "TA1 - timer_server_fire_after - INVALID_NUMBER" ); + + TIME := ( 1987, 2, 5, 8, 30, 45, 0 ); + RTEMS.TIMER.SERVER_FIRE_WHEN( + SPTEST.TIMER_ID( 1 ), + TIME, + SPTEST.DELAYED_SUBPROGRAM'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_CLOCK, + "TIMER_SERVER_FIRE_WHEN WITH ILLEGAL TIME" + ); + TEST_SUPPORT.PRINT_TIME( + "TA1 - timer_server_fire_when - ", + TIME, + " - INVALID_CLOCK" + ); + TEXT_IO.NEW_LINE; + + RTEMS.CLOCK.GET_TOD( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "clock_set" ); + TEST_SUPPORT.PRINT_TIME( "TA1 - clock_get - ", TIME, "" ); + TEXT_IO.NEW_LINE; + + TIME := ( 1990, 2, 5, 8, 30, 45, 0 ); + RTEMS.TIMER.SERVER_FIRE_WHEN( + SPTEST.TIMER_ID( 1 ), + TIME, + SPTEST.DELAYED_SUBPROGRAM'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.INVALID_CLOCK, + "TIMER_SERVER_FIRE_WHEN BEFORE CURRENT TIME" + ); + TEST_SUPPORT.PRINT_TIME( + "TA1 - timer_server_fire_when - ", + TIME, + " - before INVALID_CLOCK" + ); + TEXT_IO.NEW_LINE; + + end SCREEN_14; + +-- +-- TASK_1 +-- + + procedure TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + begin + + SPTEST.SCREEN_1; + TEST_SUPPORT.PAUSE_AND_SCREEN_NUMBER( 2 ); + + SPTEST.SCREEN_2; + TEST_SUPPORT.PAUSE_AND_SCREEN_NUMBER( 3 ); + + SPTEST.SCREEN_3; + TEST_SUPPORT.PAUSE_AND_SCREEN_NUMBER( 4 ); + + SPTEST.SCREEN_4; + TEST_SUPPORT.PAUSE_AND_SCREEN_NUMBER( 5 ); + + SPTEST.SCREEN_5; + TEST_SUPPORT.PAUSE_AND_SCREEN_NUMBER( 6 ); + + SPTEST.SCREEN_6; + TEST_SUPPORT.PAUSE_AND_SCREEN_NUMBER( 7 ); + + SPTEST.SCREEN_7; + TEST_SUPPORT.PAUSE_AND_SCREEN_NUMBER( 8 ); + + SPTEST.SCREEN_8; + TEST_SUPPORT.PAUSE_AND_SCREEN_NUMBER( 9 ); + + SPTEST.SCREEN_9; + TEST_SUPPORT.PAUSE_AND_SCREEN_NUMBER( 10 ); + + SPTEST.SCREEN_10; + TEST_SUPPORT.PAUSE_AND_SCREEN_NUMBER( 11 ); + + SPTEST.SCREEN_11; + TEST_SUPPORT.PAUSE_AND_SCREEN_NUMBER( 12 ); + + SPTEST.SCREEN_12; + TEST_SUPPORT.PAUSE_AND_SCREEN_NUMBER( 13 ); + + SPTEST.SCREEN_13; + TEST_SUPPORT.PAUSE_AND_SCREEN_NUMBER( 14 ); + + SPTEST.SCREEN_14; + + TEXT_IO.PUT_LINE( "*** END OF TEST 9 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end TASK_1; + +-- +-- TASK_2 +-- + + procedure TASK_2 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.PUT_LINE( "TA2 - semaphore_obtain - sem 1 - WAIT FOREVER" ); + RTEMS.SEMAPHORE.OBTAIN( + SPTEST.SEMAPHORE_ID( 1 ), + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.OBJECT_WAS_DELETED, + "SEMAPHORE_OBTAIN WAITING TO BE DELETED" + ); + TEXT_IO.PUT_LINE( + "TA2 - semaphore_obtain - woke up with OBJECT_WAS_DELETED" + ); + + TEXT_IO.PUT_LINE( + "TA2 - task_delete - delete self - SUCCESSFUL" + ); + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA2" ); + + end TASK_2; + +-- +-- TASK_3 +-- + + procedure TASK_3 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + BUFFER : SPTEST.BUFFER; + BUFFER_POINTER : RTEMS.ADDRESS; + MESSAGE_SIZE : RTEMS.UNSIGNED32 := 0; + STATUS : RTEMS.STATUS_CODES; + begin + + BUFFER_POINTER := BUFFER'ADDRESS; + + TEXT_IO.PUT_LINE( + "TA3 - message_queue_receive - Q 1 - WAIT FOREVER" + ); + RTEMS.MESSAGE_QUEUE.RECEIVE( + SPTEST.QUEUE_ID( 1 ), + BUFFER_POINTER, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + MESSAGE_SIZE, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.OBJECT_WAS_DELETED, + "MESSAGE_QUEUE_RECEIVE WAITING TO BE DELETED" + ); + TEXT_IO.PUT( "TA3 - message_queue_receive - woke up " ); + TEXT_IO.PUT_LINE( "with OBJECT_WAS_DELETED" ); + + TEXT_IO.PUT_LINE( + "TA3 - task_delete - delete self - SUCCESSFUL" + ); + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA3" ); + + end TASK_3; + +-- +-- TASK_4 +-- + + procedure TASK_4 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.RATE_MONOTONIC.CANCEL( + SPTEST.PERIOD_ID( 1 ), + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.NOT_OWNER_OF_RESOURCE, + "RATE_MONOTONIC_CANCEL NOT THE OWNER" + ); + TEXT_IO.PUT_LINE( + "TA4 - rate_monotonic_cancel - NOT_OWNER_OF_RESOURCE" + ); + + RTEMS.RATE_MONOTONIC.PERIOD( + SPTEST.PERIOD_ID( 1 ), + 5, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.NOT_OWNER_OF_RESOURCE, + "RATE_MONOTONIC_PERIOD NOT THE OWNER" + ); + TEXT_IO.PUT_LINE( + "TA4 - rate_monotonic_period - NOT_OWNER_OF_RESOURCE" + ); + + TEXT_IO.PUT_LINE( + "TA4 - task_delete - delete self - SUCCESSFUL" + ); + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA4" ); + + + end TASK_4; + +end SPTEST; diff --git a/testsuites/ada/sptests/sp09/sptest.ads b/testsuites/ada/sptests/sp09/sptest.ads new file mode 100644 index 0000000000..9fdad75c3a --- /dev/null +++ b/testsuites/ada/sptests/sp09/sptest.ads @@ -0,0 +1,393 @@ +-- +-- SPTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 9 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 + +-- +-- Buffer Record similar to that used by RTEMS 3.2.1. Using this +-- avoids changes to the test. +-- + + type BUFFER is + record + FIELD1 : RTEMS.UNSIGNED32; -- TEMPORARY UNTIL VARIABLE LENGTH + FIELD2 : RTEMS.UNSIGNED32; + FIELD3 : RTEMS.UNSIGNED32; + FIELD4 : RTEMS.UNSIGNED32; + end record; + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS tasks created +-- by this test. +-- + + TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 11 ) of RTEMS.ID; + TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 11 ) of RTEMS.NAME; + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS timers created +-- by this test. +-- + + TIMER_ID : array ( RTEMS.UNSIGNED32 range 1 .. 1 ) of RTEMS.ID; + TIMER_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 1 ) of RTEMS.NAME; + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS semaphores created +-- by this test. +-- + + SEMAPHORE_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; + SEMAPHORE_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS message queues +-- created by this test. +-- + + QUEUE_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID; + QUEUE_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME; + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS partitions created +-- by this test. +-- + + PARTITION_ID : array ( RTEMS.UNSIGNED32 range 1 .. 1 ) of RTEMS.ID; + PARTITION_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 1 ) of RTEMS.NAME; + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS regions created +-- by this test. +-- + + REGION_ID : array ( RTEMS.UNSIGNED32 range 1 .. 1 ) of RTEMS.ID; + REGION_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; + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS periods created +-- by this test. +-- + + PERIOD_ID : array ( RTEMS.UNSIGNED32 range 1 .. 1 ) of RTEMS.ID; + PERIOD_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 1 ) of RTEMS.NAME; + +-- +-- This variable is used as the output ID on directives which return +-- an ID but are invoked in a manner which returns a non-SUCCESSFUL +-- status code. +-- + + JUNK_ID : RTEMS.ID; + +-- +-- 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 as the +-- memory space for a partition. +-- + + PARTITION_GOOD_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 255 ) + of RTEMS.UNSIGNED8; + for PARTITION_GOOD_AREA'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT; + +-- +-- The following area defines a memory area to be used as the +-- memory space for a partition which starts at an invalid address. +-- + + PARTITION_BAD_AREA_ADDRESS : constant System.Address := + System.Storage_Elements.To_Address(16#00000006#); + + PARTITION_BAD_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 255 ) + of RTEMS.UNSIGNED8; + for PARTITION_BAD_AREA'Address use PARTITION_BAD_AREA_ADDRESS; + +-- +-- The following area defines a memory area to be used as the +-- memory space for a region and constants used to define the regions +-- starting area and length. +-- + + REGION_GOOD_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 4095 ) + of RTEMS.UNSIGNED32; + for REGION_GOOD_AREA'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT; + + REGION_START_OFFSET : constant RTEMS.UNSIGNED32 := 1024; + REGION_LENGTH : constant RTEMS.UNSIGNED32 := 512; + +-- +-- The following area defines a memory area to be used as the +-- memory space for a region which starts at an invalid address. +-- + + REGION_BAD_AREA_ADDRESS : constant System.Address := + System.Storage_Elements.To_Address(16#00000006#); + + REGION_BAD_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 255 ) + of RTEMS.UNSIGNED8; + for REGION_BAD_AREA'Address use REGION_BAD_AREA_ADDRESS; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- DELAYED_SUBPROGRAM +-- +-- DESCRIPTION: +-- +-- This subprogram is scheduled as a timer service routine. +-- It performs no actions if it fires. +-- + + procedure DELAYED_SUBPROGRAM ( + IGNORED_ID : in RTEMS.ID; + IGNORED_ADDRESS : in RTEMS.ADDRESS + ); + pragma Convention (C, DELAYED_SUBPROGRAM); + +-- +-- TASK_1 +-- +-- DESCRIPTION: +-- +-- This RTEMS task tests numerous error conditions. +-- + + procedure TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_1); + +-- +-- TASK_2 +-- +-- DESCRIPTION: +-- +-- This RTEMS task tests numerous error conditions. +-- + + procedure TASK_2 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_2); + +-- +-- TASK_3 +-- +-- DESCRIPTION: +-- +-- This RTEMS task tests numerous error conditions. +-- + + procedure TASK_3 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_3); + +-- +-- TASK_4 +-- +-- DESCRIPTION: +-- +-- This RTEMS task tests numerous error conditions. +-- + + procedure TASK_4 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_4); + +-- +-- SCREEN_1 +-- +-- DESCRIPTION: +-- +-- This subprogram processes the a single output screen of this test. +-- + + procedure SCREEN_1; + +-- +-- SCREEN_2 +-- +-- DESCRIPTION: +-- +-- This subprogram processes the a single output screen of this test. +-- + + procedure SCREEN_2; + +-- +-- SCREEN_3 +-- +-- DESCRIPTION: +-- +-- This subprogram processes the a single output screen of this test. +-- + + procedure SCREEN_3; + +-- +-- SCREEN_4 +-- +-- DESCRIPTION: +-- +-- This subprogram processes the a single output screen of this test. +-- + + procedure SCREEN_4; + +-- +-- SCREEN_5 +-- +-- DESCRIPTION: +-- +-- This subprogram processes the a single output screen of this test. +-- + + procedure SCREEN_5; + +-- +-- SCREEN_6 +-- +-- DESCRIPTION: +-- +-- This subprogram processes the a single output screen of this test. +-- + + procedure SCREEN_6; + +-- +-- SCREEN_7 +-- +-- DESCRIPTION: +-- +-- This subprogram processes the a single output screen of this test. +-- + + procedure SCREEN_7; + +-- +-- SCREEN_8 +-- +-- DESCRIPTION: +-- +-- This subprogram processes the a single output screen of this test. +-- + + procedure SCREEN_8; + +-- +-- SCREEN_9 +-- +-- DESCRIPTION: +-- +-- This subprogram processes the a single output screen of this test. +-- + + procedure SCREEN_9; + +-- +-- SCREEN_10 +-- +-- DESCRIPTION: +-- +-- This subprogram processes the a single output screen of this test. +-- + + procedure SCREEN_10; + +-- +-- SCREEN_11 +-- +-- DESCRIPTION: +-- +-- This subprogram processes the a single output screen of this test. +-- + + procedure SCREEN_11; + +-- +-- SCREEN_12 +-- +-- DESCRIPTION: +-- +-- This subprogram processes the a single output screen of this test. +-- + + procedure SCREEN_12; + +-- +-- SCREEN_13 +-- +-- DESCRIPTION: +-- +-- This subprogram processes the a single output screen of this test. +-- + + procedure SCREEN_13; + +end SPTEST; diff --git a/testsuites/ada/sptests/sp11/Makefile.am b/testsuites/ada/sptests/sp11/Makefile.am new file mode 100644 index 0000000000..ec4ded6183 --- /dev/null +++ b/testsuites/ada/sptests/sp11/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_sp11 +ada_sp11_SOURCES = sp11.adb config.h sptest.adb sptest.ads +ada_sp11_SOURCES += ../../support/init.c + +ada_sp11$(EXEEXT): sp11.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_sp11.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/sptests/sp11/ada_sp11.scn b/testsuites/ada/sptests/sp11/ada_sp11.scn new file mode 100644 index 0000000000..cbb6c4ab88 --- /dev/null +++ b/testsuites/ada/sptests/sp11/ada_sp11.scn @@ -0,0 +1,74 @@ +*** TEST 11 *** +TA1 - event_send - send EVENT_16 to TA2 +TA1 - event_receive - waiting forever on EVENT_14 and EVENT_15 +TA2 - event_receive - waiting forever on EVENT_16 +TA2 - EVENT_16 received - eventout => 16#10000# +TA2 - event_send - send EVENT_14 and EVENT_15 to TA1 +TA2 - event_receive - waiting forever on EVENT_17 or EVENT_18 - EVENT_ANY +TA1 - EVENT_14 and EVENT_15 received - eventout => 16#C000# +TA1 - event_send - send EVENT_18 to TA2 +TA1 - event_receive - waiting with 10 second timeout on EVENT_14 +TA2 - EVENT_17 or EVENT_18 received - eventout => 16#40000# +TA2 - event_send - send EVENT_14 to TA1 +TA2 - clock_set - 8:15: 0 2/12/1988 +TA2 - event_send - sending EVENT_10 to self after 5 seconds +TA2 - event_receive - waiting forever on EVENT_10 +TA1 - EVENT_14 received - eventout => 16#4000# +TA1 - event_send - send EVENT_19 to TA2 +TA1 - clock_get - 8:15: 0 2/12/1988 + +TA1 - event_send - send EVENT_18 to self after 5 seconds +TA1 - event_receive - waiting forever on EVENT_18 +TA2 - EVENT_10 received - eventout => 16#400# +TA1 - clock_get - 8:15: 5 2/12/1988 +TA2 - event_receive - PENDING_EVENTS +TA2 - eventout => 16#80000# +TA2 - event_receive - EVENT_19 - NO_WAIT +TA2 - EVENT_19 received - eventout => 16#80000# +TA2 - task_delete - deletes self +TA1 - EVENT_18 received - eventout => 16#40000# +TA1 - clock_get - 8:15: 5 2/12/1988 +TA1 - event_send - send EVENT_3 to self +TA1 - event_receive - EVENT_3 or EVENT_22 - NO_WAIT and EVENT_ANY +TA1 - EVENT_3 received - eventout => 16#8# +TA1 - event_send - send EVENT_4 to self +TA1 - event_receive - waiting forever on EVENT_4 or EVENT_5 - EVENT_ANY +TA1 - EVENT_4 received - eventout => 16#10# + +TA1 - event_send - send EVENT_18 to self after 5 seconds +TA1 - timer_cancel - cancelling timer for event EVENT_18 +TA1 - event_send - send EVENT_8 to self after 60 seconds +TA1 - event_send - send EVENT_9 to self after 60 seconds +TA1 - event_send - send EVENT_10 to self after 60 seconds +TA1 - timer_cancel - cancelling timer for event EVENT_8 +TA1 - clock_set - 8:15: 0 2/12/1988 +TA1 - event_send - send EVENT_1 every second +TA1 - EVENT_1 received - eventout => 16#2# - at 8:15: 1 2/12/1988 +TA1 - EVENT_1 received - eventout => 16#2# - at 8:15: 2 2/12/1988 +TA1 - EVENT_1 received - eventout => 16#2# - at 8:15: 3 2/12/1988 +TA1 - timer_cancel - cancelling timer for event EVENT_1 + +TA1 - event_send - send EVENT_11 to self in 1 day +TA1 - event_send - send EVENT_11 to self in 1 day +TA1 - event_send - send EVENT_11 to self in 2 days +TA1 - timer_cancel - cancelling EVENT_11 to self in 1 day +TA1 - timer_cancel - cancelling EVENT_11 to self in 2 days +TA1 - event_send - resending EVENT_11 to self in 2 days +TA1 - clock_set - 8:15: 3 2/15/1988 +TA1 - event_receive - waiting forever on EVENT_11 +TA1 - EVENT_11 received - eventout => 16#800# + +TA1 - event_send/event_receive combination +TA1 - clock_set - 8:15: 0 2/12/1988 +TA1 - event_receive all outstanding events +TA1 - event_send - send EVENT_10 to self in 1 day +TA1 - event_send - send EVENT_11 to self in 2 days +TA1 - clock_set - 7:15: 0 2/12/1988 +TA1 - set time backwards +TA1 - no events received +TA1 - clock_set - 7:15: 0 2/14/1988 +TA1 - set time forwards (leave a timer) +TA1 - EVENT_10 received +TA1 - event_send - send EVENT_11 to self in 100 ticks +TA1 - event_send - send EVENT_11 to self in 200 ticks +*** END OF TEST 11 *** diff --git a/testsuites/ada/sptests/sp11/config.h b/testsuites/ada/sptests/sp11/config.h new file mode 100644 index 0000000000..41506d08ee --- /dev/null +++ b/testsuites/ada/sptests/sp11/config.h @@ -0,0 +1,32 @@ +/* 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 3 +#define CONFIGURE_MAXIMUM_TIMERS 6 +#define CONFIGURE_TICKS_PER_TIMESLICE 100 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/sptests/sp11/sp11.adb b/testsuites/ada/sptests/sp11/sp11.adb new file mode 100644 index 0000000000..b39fd4b2be --- /dev/null +++ b/testsuites/ada/sptests/sp11/sp11.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test SP11 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 SP11 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 SP11; + diff --git a/testsuites/ada/sptests/sp11/sptest.adb b/testsuites/ada/sptests/sp11/sptest.adb new file mode 100644 index 0000000000..95dd17846b --- /dev/null +++ b/testsuites/ada/sptests/sp11/sptest.adb @@ -0,0 +1,906 @@ +-- +-- SPTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 11 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 INTERFACES; use INTERFACES; +with TEST_SUPPORT; +with TEXT_IO; +with UNSIGNED32_IO; +with RTEMS.CLOCK; +with RTEMS.EVENT; +with RTEMS.TIMER; + +package body SPTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TEST 11 ***" ); + + SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); + SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 1 ), + 4, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 2 ), + 4, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 2 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 1 ), + SPTEST.TASK_1'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 2 ), + SPTEST.TASK_2'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" ); + + SPTEST.TIMER_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'M', '1', ' ' ); + SPTEST.TIMER_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'M', '2', ' ' ); + SPTEST.TIMER_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'M', '3', ' ' ); + SPTEST.TIMER_NAME( 4 ) := RTEMS.BUILD_NAME( 'T', 'M', '4', ' ' ); + SPTEST.TIMER_NAME( 5 ) := RTEMS.BUILD_NAME( 'T', 'M', '5', ' ' ); + SPTEST.TIMER_NAME( 6 ) := RTEMS.BUILD_NAME( 'T', 'M', '6', ' ' ); + + RTEMS.TIMER.CREATE( + SPTEST.TIMER_NAME( 1 ), + SPTEST.TIMER_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE OF TM1" ); + + RTEMS.TIMER.CREATE( + SPTEST.TIMER_NAME( 2 ), + SPTEST.TIMER_ID( 2 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE OF TM2" ); + + RTEMS.TIMER.CREATE( + SPTEST.TIMER_NAME( 3 ), + SPTEST.TIMER_ID( 3 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE OF TM3" ); + + RTEMS.TIMER.CREATE( + SPTEST.TIMER_NAME( 4 ), + SPTEST.TIMER_ID( 4 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE OF TM4" ); + + RTEMS.TIMER.CREATE( + SPTEST.TIMER_NAME( 5 ), + SPTEST.TIMER_ID( 5 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE OF TM5" ); + + RTEMS.TIMER.CREATE( + SPTEST.TIMER_NAME( 6 ), + SPTEST.TIMER_ID( 6 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE OF TM6" ); + + 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); + EVENTOUT : RTEMS.EVENT_SET; + TIME : RTEMS.TIME_OF_DAY; + STATUS : RTEMS.STATUS_CODES; + INDEX : RTEMS.UNSIGNED32; + begin + + TEXT_IO.PUT_LINE( "TA1 - event_send - send EVENT_16 to TA2" ); + RTEMS.EVENT.SEND( SPTEST.TASK_ID( 2 ), RTEMS.EVENT_16, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND of 16" ); + + TEXT_IO.PUT_LINE( + "TA1 - event_receive - waiting forever on EVENT_14 and EVENT_15" + ); + RTEMS.EVENT.RECEIVE( + RTEMS.EVENT_14 + RTEMS.EVENT_15, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + EVENTOUT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE of 14 and 15" ); + TEXT_IO.PUT( "TA1 - EVENT_14 and EVENT_15 received - eventout => "); + UNSIGNED32_IO.PUT( EVENTOUT, BASE => 16, WIDTH => 8 ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT_LINE( "TA1 - event_send - send EVENT_18 to TA2" ); + RTEMS.EVENT.SEND( SPTEST.TASK_ID( 2 ), RTEMS.EVENT_18, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND of 18" ); + + TEXT_IO.PUT_LINE( + "TA1 - event_receive - waiting with 10 second timeout on EVENT_14" + ); + RTEMS.EVENT.RECEIVE( + RTEMS.EVENT_14, + RTEMS.DEFAULT_OPTIONS, + 10 * TEST_SUPPORT.TICKS_PER_SECOND, + EVENTOUT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE of 14" ); + TEXT_IO.PUT( "TA1 - EVENT_14 received - eventout => "); + UNSIGNED32_IO.PUT( EVENTOUT, BASE => 16, WIDTH => 8 ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT_LINE( "TA1 - event_send - send EVENT_19 to TA2" ); + RTEMS.EVENT.SEND( SPTEST.TASK_ID( 2 ), RTEMS.EVENT_19, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND of 19" ); + + RTEMS.CLOCK.GET_TOD( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); + TEST_SUPPORT.PRINT_TIME( "TA1 - clock_get - ", TIME, "" ); + TEXT_IO.NEW_LINE; + + TEST_SUPPORT.PAUSE; + + TEXT_IO.PUT_LINE( + "TA1 - event_send - send EVENT_18 to self after 5 seconds" + ); + RTEMS.TIMER.FIRE_AFTER( + SPTEST.TIMER_ID( 1 ), + 5 * TEST_SUPPORT.TICKS_PER_SECOND, + SPTEST.TA1_SEND_18_TO_SELF_5_SECONDS'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER 5 seconds" ); + + TEXT_IO.PUT_LINE( + "TA1 - event_receive - waiting forever on EVENT_18" + ); + RTEMS.EVENT.RECEIVE( + RTEMS.EVENT_18, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + EVENTOUT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE of 18" ); + + RTEMS.CLOCK.GET_TOD( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); + + TEXT_IO.PUT( "TA1 - EVENT_18 received - eventout => "); + UNSIGNED32_IO.PUT( EVENTOUT, BASE => 16, WIDTH => 8 ); + TEXT_IO.NEW_LINE; + + TEST_SUPPORT.PRINT_TIME( "TA1 - clock_get - ", TIME, "" ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT_LINE( "TA1 - event_send - send EVENT_3 to self" ); + RTEMS.EVENT.SEND( RTEMS.SELF, RTEMS.EVENT_3, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND of 3" ); + + TEXT_IO.PUT_LINE( + "TA1 - event_receive - EVENT_3 or EVENT_22 - NO_WAIT and EVENT_ANY" + ); + RTEMS.EVENT.RECEIVE( + RTEMS.EVENT_3 + RTEMS.EVENT_22, + RTEMS.NO_WAIT + RTEMS.EVENT_ANY, + RTEMS.NO_TIMEOUT, + EVENTOUT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE of 3 and 22" ); + TEXT_IO.PUT( "TA1 - EVENT_3 received - eventout => "); + UNSIGNED32_IO.PUT( EVENTOUT, BASE => 16, WIDTH => 8 ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT_LINE( "TA1 - event_send - send EVENT_4 to self" ); + RTEMS.EVENT.SEND( RTEMS.SELF, RTEMS.EVENT_4, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND of 4" ); + + TEXT_IO.PUT_LINE( +"TA1 - event_receive - waiting forever on EVENT_4 or EVENT_5 - EVENT_ANY" + ); + RTEMS.EVENT.RECEIVE( + RTEMS.EVENT_4 + RTEMS.EVENT_5, + RTEMS.EVENT_ANY, + RTEMS.NO_TIMEOUT, + EVENTOUT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE of 4 and 5" ); + TEXT_IO.PUT( "TA1 - EVENT_4 received - eventout => "); + UNSIGNED32_IO.PUT( EVENTOUT, BASE => 16, WIDTH => 8 ); + TEXT_IO.NEW_LINE; + + TEST_SUPPORT.PAUSE; + + TEXT_IO.PUT_LINE( + "TA1 - event_send - send EVENT_18 to self after 5 seconds" + ); + RTEMS.TIMER.FIRE_AFTER( + SPTEST.TIMER_ID( 1 ), + 5 * TEST_SUPPORT.TICKS_PER_SECOND, + SPTEST.TA1_SEND_18_TO_SELF_5_SECONDS'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER 5 seconds" ); + + TEXT_IO.PUT_LINE( + "TA1 - timer_cancel - cancelling timer for event EVENT_18" + ); + RTEMS.TIMER.CANCEL( SPTEST.TIMER_ID( 1 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CANCEL" ); + + TEXT_IO.PUT_LINE( + "TA1 - event_send - send EVENT_8 to self after 60 seconds" + ); + RTEMS.TIMER.FIRE_AFTER( + SPTEST.TIMER_ID( 1 ), + 60 * TEST_SUPPORT.TICKS_PER_SECOND, + SPTEST.TA1_SEND_8_TO_SELF_60_SECONDS'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER 60 secs" ); + + TEXT_IO.PUT_LINE( + "TA1 - event_send - send EVENT_9 to self after 60 seconds" + ); + RTEMS.TIMER.FIRE_AFTER( + SPTEST.TIMER_ID( 2 ), + 60 * TEST_SUPPORT.TICKS_PER_SECOND, + SPTEST.TA1_SEND_9_TO_SELF_60_SECONDS'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER 60 secs" ); + + TEXT_IO.PUT_LINE( + "TA1 - event_send - send EVENT_10 to self after 60 seconds" + ); + RTEMS.TIMER.FIRE_AFTER( + SPTEST.TIMER_ID( 3 ), + 60 * TEST_SUPPORT.TICKS_PER_SECOND, + SPTEST.TA1_SEND_10_TO_SELF'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER 60 secs" ); + + TEXT_IO.PUT_LINE( + "TA1 - timer_cancel - cancelling timer for event EVENT_8" + ); + RTEMS.TIMER.CANCEL( SPTEST.TIMER_ID( 1 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CANCEL" ); + + TIME := ( 1988, 2, 12, 8, 15, 0, 0 ); + + TEST_SUPPORT.PRINT_TIME( "TA1 - clock_set - ", TIME, "" ); + TEXT_IO.NEW_LINE; + RTEMS.CLOCK.SET( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TA1 CLOCK_SET" ); + + TEXT_IO.PUT_LINE( + "TA1 - event_send - send EVENT_1 every second" + ); + RTEMS.TIMER.FIRE_AFTER( + SPTEST.TIMER_ID( 1 ), + TEST_SUPPORT.TICKS_PER_SECOND, + SPTEST.TA1_SEND_1_TO_SELF_EVERY_SECOND'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER 1 SECOND" ); + + INDEX := 0; + + loop + + exit when INDEX = 3; + + RTEMS.EVENT.RECEIVE( + RTEMS.EVENT_1, + RTEMS.EVENT_ANY, + RTEMS.NO_TIMEOUT, + EVENTOUT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE of 1" ); + + RTEMS.CLOCK.GET_TOD( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); + + TEXT_IO.PUT( "TA1 - EVENT_1 received - eventout => "); + UNSIGNED32_IO.PUT( EVENTOUT, BASE => 16, WIDTH => 8 ); + TEST_SUPPORT.PRINT_TIME( " - at ", TIME, "" ); + TEXT_IO.NEW_LINE; + + if INDEX < 2 then + RTEMS.TIMER.RESET( SPTEST.TIMER_ID( 1 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TA1 TIMER RESET" ); + end if; + + INDEX := INDEX + 1; + end loop; + + TEXT_IO.PUT_LINE( + "TA1 - timer_cancel - cancelling timer for event EVENT_1" + ); + RTEMS.TIMER.CANCEL( SPTEST.TIMER_ID( 1 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CANCEL" ); + + TEST_SUPPORT.PAUSE; + + TIME.DAY := 13; + TEXT_IO.PUT_LINE( + "TA1 - event_send - send EVENT_11 to self in 1 day" + ); + RTEMS.TIMER.FIRE_WHEN( + SPTEST.TIMER_ID( 1 ), + TIME, + SPTEST.TA1_SEND_11_TO_SELF'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_WHEN 1 day" ); + + TIME.HOUR := 7; + TEXT_IO.PUT_LINE( + "TA1 - event_send - send EVENT_11 to self in 1 day" + ); + RTEMS.TIMER.FIRE_WHEN( + SPTEST.TIMER_ID( 2 ), + TIME, + SPTEST.TA1_SEND_11_TO_SELF'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_WHEN 1 day" ); + TIME.HOUR := 8; + + TIME.DAY := 14; + TEXT_IO.PUT_LINE( + "TA1 - event_send - send EVENT_11 to self in 2 days" + ); + RTEMS.TIMER.FIRE_WHEN( + SPTEST.TIMER_ID( 3 ), + TIME, + SPTEST.TA1_SEND_11_TO_SELF'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_WHEN 2 days" ); + + TEXT_IO.PUT_LINE( + "TA1 - timer_cancel - cancelling EVENT_11 to self in 1 day" + ); + RTEMS.TIMER.CANCEL( SPTEST.TIMER_ID( 1 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CANCEL" ); + + TEXT_IO.PUT_LINE( + "TA1 - timer_cancel - cancelling EVENT_11 to self in 2 days" + ); + RTEMS.TIMER.CANCEL( SPTEST.TIMER_ID( 3 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CANCEL" ); + + TEXT_IO.PUT_LINE( + "TA1 - event_send - resending EVENT_11 to self in 2 days" + ); + RTEMS.TIMER.FIRE_WHEN( + SPTEST.TIMER_ID( 3 ), + TIME, + SPTEST.TA1_SEND_11_TO_SELF'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_WHEN 2 days" ); + + TIME.DAY := 15; + TEST_SUPPORT.PRINT_TIME( "TA1 - clock_set - ", TIME, "" ); + TEXT_IO.NEW_LINE; + RTEMS.CLOCK.SET( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TA1 CLOCK_SET" ); + TEXT_IO.PUT_LINE( + "TA1 - event_receive - waiting forever on EVENT_11" + ); + RTEMS.EVENT.RECEIVE( + RTEMS.EVENT_11, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + EVENTOUT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE of 11" ); + TEXT_IO.PUT( "TA1 - EVENT_11 received - eventout => "); + UNSIGNED32_IO.PUT( EVENTOUT, BASE => 16, WIDTH => 8 ); + TEXT_IO.NEW_LINE; + + TEST_SUPPORT.PAUSE; + +-- The following code tests the case of deleting a timer ??? + + TEXT_IO.PUT_LINE( "TA1 - event_send/event_receive combination" ); + RTEMS.TIMER.FIRE_AFTER( + SPTEST.TIMER_ID( 1 ), + 10, + SPTEST.TA1_SEND_11_TO_SELF'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER 10 ticks" ); + RTEMS.EVENT.RECEIVE( + RTEMS.EVENT_11, + RTEMS.DEFAULT_OPTIONS, + 11, + EVENTOUT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE" ); + + TIME := ( 1988, 2, 12, 8, 15, 0, 0 ); + + TEST_SUPPORT.PRINT_TIME( "TA1 - clock_set - ", TIME, "" ); + TEXT_IO.NEW_LINE; + RTEMS.CLOCK.SET( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TA1 CLOCK_SET" ); + + TIME.DAY := 13; + TEXT_IO.PUT_LINE( + "TA1 - event_receive all outstanding events" + ); + RTEMS.EVENT.RECEIVE( + RTEMS.ALL_EVENTS, + RTEMS.NO_WAIT + RTEMS.EVENT_ANY, + RTEMS.NO_TIMEOUT, + EVENTOUT, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.UNSATISFIED, + "EVENT_RECEIVE all events" + ); + + TEXT_IO.PUT_LINE( + "TA1 - event_send - send EVENT_10 to self in 1 day" + ); + RTEMS.TIMER.FIRE_WHEN( + SPTEST.TIMER_ID( 1 ), + TIME, + SPTEST.TA1_SEND_10_TO_SELF'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_WHEN 1 day" ); + + TIME.DAY := 14; + TEXT_IO.PUT_LINE( + "TA1 - event_send - send EVENT_11 to self in 2 days" + ); + RTEMS.TIMER.FIRE_WHEN( + SPTEST.TIMER_ID( 2 ), + TIME, + SPTEST.TA1_SEND_11_TO_SELF'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_WHEN 2 days" ); + + TIME := ( 1988, 2, 12, 7, 15, 0, 0 ); + + TEST_SUPPORT.PRINT_TIME( "TA1 - clock_set - ", TIME, "" ); + TEXT_IO.NEW_LINE; + TEXT_IO.PUT_LINE( "TA1 - set time backwards" ); + RTEMS.CLOCK.SET( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TA1 CLOCK_SET" ); + + RTEMS.EVENT.RECEIVE( + RTEMS.ALL_EVENTS, + RTEMS.NO_WAIT + RTEMS.EVENT_ANY, + RTEMS.NO_TIMEOUT, + EVENTOUT, + STATUS + ); + if EVENTOUT >= RTEMS.EVENT_0 then + TEXT_IO.PUT( "ERROR - " ); + UNSIGNED32_IO.PUT( EVENTOUT, BASE => 16, WIDTH => 8 ); + TEXT_IO.PUT_LINE( " events received" ); + else + TEXT_IO.PUT_LINE( "TA1 - no events received" ); + end if; + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.UNSATISFIED, + "EVENT_RECEIVE all events" + ); + + TIME := ( 1988, 2, 14, 7, 15, 0, 0 ); + + TEST_SUPPORT.PRINT_TIME( "TA1 - clock_set - ", TIME, "" ); + TEXT_IO.NEW_LINE; + TEXT_IO.PUT_LINE( "TA1 - set time forwards (leave a timer)" ); + RTEMS.CLOCK.SET( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TA1 CLOCK_SET" ); + + RTEMS.EVENT.RECEIVE( + RTEMS.ALL_EVENTS, + RTEMS.NO_WAIT + RTEMS.EVENT_ANY, + RTEMS.NO_TIMEOUT, + EVENTOUT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE all events" ); + if EVENTOUT = RTEMS.EVENT_10 then + TEXT_IO.PUT_LINE( "TA1 - EVENT_10 received" ); + else + TEXT_IO.PUT( "ERROR - " ); + UNSIGNED32_IO.PUT( EVENTOUT, BASE => 16, WIDTH => 8 ); + TEXT_IO.PUT_LINE( " events received" ); + end if; + + TEXT_IO.PUT_LINE( + "TA1 - event_send - send EVENT_11 to self in 100 ticks" + ); + RTEMS.TIMER.FIRE_AFTER( + SPTEST.TIMER_ID( 1 ), + 100, + SPTEST.TA1_SEND_11_TO_SELF'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER 100 ticks" ); + + TEXT_IO.PUT_LINE( + "TA1 - event_send - send EVENT_11 to self in 200 ticks" + ); + RTEMS.TIMER.FIRE_AFTER( + SPTEST.TIMER_ID( 2 ), + 100, + SPTEST.TA1_SEND_11_TO_SELF'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER 200 ticks" ); + + TEXT_IO.PUT_LINE( "*** END OF TEST 11 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end TASK_1; + +-- +-- TASK_2 +-- + + procedure TASK_2 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + EVENTOUT : RTEMS.EVENT_SET; + TIME : RTEMS.TIME_OF_DAY; + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.TASKS.WAKE_AFTER( 1 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + TEXT_IO.PUT_LINE( + "TA2 - event_receive - waiting forever on EVENT_16" + ); + RTEMS.EVENT.RECEIVE( + RTEMS.EVENT_16, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + EVENTOUT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE of 16" ); + TEXT_IO.PUT( "TA2 - EVENT_16 received - eventout => "); + UNSIGNED32_IO.PUT( EVENTOUT, BASE => 16, WIDTH => 8 ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT_LINE( + "TA2 - event_send - send EVENT_14 and EVENT_15 to TA1" + ); + RTEMS.EVENT.SEND( + SPTEST.TASK_ID( 1 ), + RTEMS.EVENT_14 + RTEMS.EVENT_15, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND of 14 and 15" ); + + TEXT_IO.PUT_LINE( + "TA2 - event_receive - waiting forever on EVENT_17 or EVENT_18 - EVENT_ANY" + ); + RTEMS.EVENT.RECEIVE( + RTEMS.EVENT_17 + RTEMS.EVENT_18, + RTEMS.EVENT_ANY, + RTEMS.NO_TIMEOUT, + EVENTOUT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE of 17 and 18" ); + TEXT_IO.PUT( "TA2 - EVENT_17 or EVENT_18 received - eventout => "); + UNSIGNED32_IO.PUT( EVENTOUT, BASE => 16, WIDTH => 8 ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT_LINE( + "TA2 - event_send - send EVENT_14 to TA1" + ); + RTEMS.EVENT.SEND( + SPTEST.TASK_ID( 1 ), + RTEMS.EVENT_14, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND of 14" ); + + TIME := ( 1988, 2, 12, 8, 15, 0, 0 ); + + TEST_SUPPORT.PRINT_TIME( "TA2 - clock_set - ", TIME, "" ); + TEXT_IO.NEW_LINE; + RTEMS.CLOCK.SET( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TA2 CLOCK_SET" ); + + TIME.SECOND := TIME.SECOND + 5; + TEXT_IO.PUT_LINE( + "TA2 - event_send - sending EVENT_10 to self after 5 seconds" + ); + RTEMS.TIMER.FIRE_WHEN( + SPTEST.TIMER_ID( 5 ), + TIME, + SPTEST.TA2_SEND_10_TO_SELF'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_WHEN 5 SECONDS" ); + + TEXT_IO.PUT_LINE( + "TA2 - event_receive - waiting forever on EVENT_10" + ); + RTEMS.EVENT.RECEIVE( + RTEMS.EVENT_10, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + EVENTOUT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE of 10" ); + + RTEMS.CLOCK.GET_TOD( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); + + TEXT_IO.PUT( "TA2 - EVENT_10 received - eventout => "); + UNSIGNED32_IO.PUT( EVENTOUT, BASE => 16, WIDTH => 8 ); + TEXT_IO.NEW_LINE; + + TEST_SUPPORT.PRINT_TIME( "TA1 - clock_get - ", TIME, "" ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT_LINE( "TA2 - event_receive - PENDING_EVENTS" ); + RTEMS.EVENT.RECEIVE( + RTEMS.PENDING_EVENTS, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + EVENTOUT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE of 10" ); + TEXT_IO.PUT( "TA2 - eventout => "); + UNSIGNED32_IO.PUT( EVENTOUT, BASE => 16, WIDTH => 8 ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT_LINE( + "TA2 - event_receive - EVENT_19 - NO_WAIT" + ); + RTEMS.EVENT.RECEIVE( + RTEMS.EVENT_19, + RTEMS.NO_WAIT, + RTEMS.NO_TIMEOUT, + EVENTOUT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE of 10" ); + TEXT_IO.PUT( "TA2 - EVENT_19 received - eventout => "); + UNSIGNED32_IO.PUT( EVENTOUT, BASE => 16, WIDTH => 8 ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT_LINE( "TA2 - task_delete - deletes self" ); + RTEMS.TASKS.DELETE( SPTEST.TASK_ID( 2 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE of TA2" ); + + end TASK_2; + +-- +-- TA1_SEND_18_TO_SELF_5_SECONDS +-- + + procedure TA1_SEND_18_TO_SELF_5_SECONDS ( + IGNORED_ID : in RTEMS.ID; + IGNORED_ADDRESS : in RTEMS.ADDRESS + ) + is + pragma Unreferenced(IGNORED_ID); + pragma Unreferenced(IGNORED_ADDRESS); + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.EVENT.SEND( SPTEST.TASK_ID( 1 ), RTEMS.EVENT_18, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND of 18" ); + + end TA1_SEND_18_TO_SELF_5_SECONDS; + +-- +-- TA1_SEND_8_TO_SELF_60_SECONDS +-- + + procedure TA1_SEND_8_TO_SELF_60_SECONDS ( + IGNORED_ID : in RTEMS.ID; + IGNORED_ADDRESS : in RTEMS.ADDRESS + ) + is + pragma Unreferenced(IGNORED_ID); + pragma Unreferenced(IGNORED_ADDRESS); + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.EVENT.SEND( SPTEST.TASK_ID( 1 ), RTEMS.EVENT_8, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND of 8" ); + + end TA1_SEND_8_TO_SELF_60_SECONDS; + +-- +-- TA1_SEND_9_TO_SELF_60_SECONDS +-- + + procedure TA1_SEND_9_TO_SELF_60_SECONDS ( + IGNORED_ID : in RTEMS.ID; + IGNORED_ADDRESS : in RTEMS.ADDRESS + ) + is + pragma Unreferenced(IGNORED_ID); + pragma Unreferenced(IGNORED_ADDRESS); + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.EVENT.SEND( SPTEST.TASK_ID( 1 ), RTEMS.EVENT_9, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND of 9" ); + + end TA1_SEND_9_TO_SELF_60_SECONDS; + +-- +-- TA1_SEND_10_TO_SELF +-- + + procedure TA1_SEND_10_TO_SELF ( + IGNORED_ID : in RTEMS.ID; + IGNORED_ADDRESS : in RTEMS.ADDRESS + ) + is + pragma Unreferenced(IGNORED_ID); + pragma Unreferenced(IGNORED_ADDRESS); + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.EVENT.SEND( SPTEST.TASK_ID( 1 ), RTEMS.EVENT_10, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND of 10" ); + + end TA1_SEND_10_TO_SELF; + +-- +-- TA1_SEND_1_TO_SELF_EVERY_SECOND +-- + + procedure TA1_SEND_1_TO_SELF_EVERY_SECOND ( + IGNORED_ID : in RTEMS.ID; + IGNORED_ADDRESS : in RTEMS.ADDRESS + ) + is + pragma Unreferenced(IGNORED_ID); + pragma Unreferenced(IGNORED_ADDRESS); + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.EVENT.SEND( SPTEST.TASK_ID( 1 ), RTEMS.EVENT_1, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND of 1" ); + + end TA1_SEND_1_TO_SELF_EVERY_SECOND; + +-- +-- TA1_SEND_11_TO_SELF +-- + + procedure TA1_SEND_11_TO_SELF ( + IGNORED_ID : in RTEMS.ID; + IGNORED_ADDRESS : in RTEMS.ADDRESS + ) + is + pragma Unreferenced(IGNORED_ID); + pragma Unreferenced(IGNORED_ADDRESS); + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.EVENT.SEND( SPTEST.TASK_ID( 1 ), RTEMS.EVENT_11, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND of 11" ); + + end TA1_SEND_11_TO_SELF; + +-- +-- TA2_SEND_10_TO_SELF +-- + + procedure TA2_SEND_10_TO_SELF ( + IGNORED_ID : in RTEMS.ID; + IGNORED_ADDRESS : in RTEMS.ADDRESS + ) + is + pragma Unreferenced(IGNORED_ID); + pragma Unreferenced(IGNORED_ADDRESS); + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.EVENT.SEND( SPTEST.TASK_ID( 2 ), RTEMS.EVENT_10, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND of 10" ); + + end TA2_SEND_10_TO_SELF; + +end SPTEST; diff --git a/testsuites/ada/sptests/sp11/sptest.ads b/testsuites/ada/sptests/sp11/sptest.ads new file mode 100644 index 0000000000..b7f03b8f4c --- /dev/null +++ b/testsuites/ada/sptests/sp11/sptest.ads @@ -0,0 +1,186 @@ +-- +-- SPTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 11 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; + +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 .. 3 ) of RTEMS.ID; + TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS timers created +-- by this test. +-- + + TIMER_ID : array ( RTEMS.UNSIGNED32 range 1 .. 6 ) of RTEMS.ID; + TIMER_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 6 ) of RTEMS.NAME; + +-- +-- TA1_SEND_18_TO_SELF_5_SECONDS +-- +-- DESCRIPTION: +-- +-- This subprogram is scheduled to be fired by a timer after 5 seconds +-- and to send EVENT_18 to TASK_1. +-- + + procedure TA1_SEND_18_TO_SELF_5_SECONDS ( + IGNORED_ID : in RTEMS.ID; + IGNORED_ADDRESS : in RTEMS.ADDRESS + ); + pragma Convention (C, TA1_SEND_18_TO_SELF_5_SECONDS); + +-- +-- TA1_SEND_8_TO_SELF_60_SECONDS +-- +-- DESCRIPTION: +-- +-- This subprogram is scheduled to be fired by a timer after 60 seconds +-- and to send EVENT_8 to TASK_1. +-- + + procedure TA1_SEND_8_TO_SELF_60_SECONDS ( + IGNORED_ID : in RTEMS.ID; + IGNORED_ADDRESS : in RTEMS.ADDRESS + ); + pragma Convention (C, TA1_SEND_8_TO_SELF_60_SECONDS); + +-- +-- TA1_SEND_9_TO_SELF_5_SECONDS +-- +-- DESCRIPTION: +-- +-- This subprogram is scheduled to be fired by a timer after 60 seconds +-- and to send EVENT_9 to TASK_1. +-- + + procedure TA1_SEND_9_TO_SELF_60_SECONDS ( + IGNORED_ID : in RTEMS.ID; + IGNORED_ADDRESS : in RTEMS.ADDRESS + ); + pragma Convention (C, TA1_SEND_9_TO_SELF_60_SECONDS); + +-- +-- TA1_SEND_10_TO_SELF +-- +-- DESCRIPTION: +-- +-- This subprogram is scheduled to be fired by a timer after 60 seconds +-- and to send EVENT_10 to TASK_1. +-- + + procedure TA1_SEND_10_TO_SELF ( + IGNORED_ID : in RTEMS.ID; + IGNORED_ADDRESS : in RTEMS.ADDRESS + ); + pragma Convention (C, TA1_SEND_10_TO_SELF); + +-- +-- TA1_SEND_1_TO_SELF_EVERY_SECOND +-- +-- DESCRIPTION: +-- +-- This subprogram is scheduled to be fired by a timer every second +-- and to send EVENT_1 to TASK_1 until the timer is cancelled. +-- + + procedure TA1_SEND_1_TO_SELF_EVERY_SECOND ( + IGNORED_ID : in RTEMS.ID; + IGNORED_ADDRESS : in RTEMS.ADDRESS + ); + pragma Convention (C, TA1_SEND_1_TO_SELF_EVERY_SECOND); + +-- +-- TA1_SEND_11_TO_SELF +-- +-- DESCRIPTION: +-- +-- This subprogram is scheduled to be fired by a timer at a +-- specific time of day and to send EVENT_11 to TASK_1. +-- + + procedure TA1_SEND_11_TO_SELF ( + IGNORED_ID : in RTEMS.ID; + IGNORED_ADDRESS : in RTEMS.ADDRESS + ); + pragma Convention (C, TA1_SEND_11_TO_SELF); + +-- +-- TA2_SEND_10_TO_SELF +-- +-- DESCRIPTION: +-- +-- This subprogram is scheduled to be fired by a timer after 5 seconds +-- and to send EVENT_10 to TASK_2. +-- + + procedure TA2_SEND_10_TO_SELF ( + IGNORED_ID : in RTEMS.ID; + IGNORED_ADDRESS : in RTEMS.ADDRESS + ); + pragma Convention (C, TA2_SEND_10_TO_SELF); + +-- +-- 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 Event and Timer Managers. +-- + + procedure TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_1); + +-- +-- TASK_2 +-- +-- DESCRIPTION: +-- +-- This RTEMS task tests the Event and Timer Managers. +-- + + procedure TASK_2 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_2); + +end SPTEST; diff --git a/testsuites/ada/sptests/sp12/Makefile.am b/testsuites/ada/sptests/sp12/Makefile.am new file mode 100644 index 0000000000..0a99682f1a --- /dev/null +++ b/testsuites/ada/sptests/sp12/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_sp12 +ada_sp12_SOURCES = sp12.adb config.h sptest.adb sptest.ads +ada_sp12_SOURCES += ../../support/init.c + +ada_sp12$(EXEEXT): sp12.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_sp12.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/sptests/sp12/ada_sp12.scn b/testsuites/ada/sptests/sp12/ada_sp12.scn new file mode 100644 index 0000000000..d1753e5ace --- /dev/null +++ b/testsuites/ada/sptests/sp12/ada_sp12.scn @@ -0,0 +1,78 @@ +*** TEST 12 *** +INIT - Forward priority queue test +PRI1 - semaphore_obtain - wait forever on SM2 +PRI2 - semaphore_obtain - wait forever on SM2 +PRI3 - semaphore_obtain - wait forever on SM2 +PRI4 - semaphore_obtain - wait forever on SM2 +PRI5 - semaphore_obtain - wait forever on SM2 +INIT - Backward priority queue test +PRI5 - semaphore_obtain - wait forever on SM2 +PRI4 - semaphore_obtain - wait forever on SM2 +PRI3 - semaphore_obtain - wait forever on SM2 +PRI2 - semaphore_obtain - wait forever on SM2 +PRI1 - semaphore_obtain - wait forever on SM2 + +INIT - Binary Semaphore and Priority Inheritance Test +INIT - semaphore_create - allocated binary semaphore +INIT - semaphore_release - allocated binary semaphore +INIT - semaphore_delete - allocated binary semaphore +PRI5 - semaphore_obtain - wait forever on SM2 +PRI5 - task_suspend - until all priority tasks blocked +PDRV - priority of PRI5 is 67 +PRI4 - semaphore_obtain - wait forever on SM2 +PDRV - change priority of PRI5 from 67 to 68 +PDRV - priority of PRI5 is 67 +PRI3 - semaphore_obtain - wait forever on SM2 +PDRV - priority of PRI5 is 67 +PRI2 - semaphore_obtain - wait forever on SM2 +PDRV - priority of PRI5 is 66 +PRI1 - semaphore_obtain - wait forever on SM2 +PDRV - priority of PRI5 is 65 +PDRV - task_resume - PRI5 +PRI5 - task_delete - all tasks waiting on SM2 +PRI5 - semaphore_obtain - nested +PRI5 - semaphore_release - nested +PRI5 - semaphore_release - restore priority +PRI5 - priority of PRI5 is 68 + +TA1 - semaphore_ident - smid => 16#1A010009# +TA1 - semaphore_obtain - wait forever on SM2 +TA1 - got SM2 +TA1 - semaphore_obtain - wait forever on SM3 +TA1 - got SM3 +TA1 - semaphore_obtain - get SM1 - NO_WAIT +TA1 - got SM1 +TA1 - task_wake_after - sleep 5 seconds +TA2 - semaphore_obtain - wait forever on SM1 +TA3 - semaphore_obtain - wait forever on SM2 + +TA1 - semaphore_release - release SM1 +TA1 - semaphore_obtain - waiting for SM1 with 10 second timeout +TA2 - got SM1 +TA2 - semaphore_release - release SM1 +TA2 - task_set_priority - make self highest priority task +TA2 - semaphore_obtain - wait forever on SM2 +TA1 - got SM1 +TA1 - semaphore_release - release SM2 +TA2 - got SM2 +TA2 - semaphore_release - release SM2 +TA2 - task_delete - delete self +TA1 - task_wake_after - sleep 5 seconds +TA3 - got SM2 +TA3 - semaphore_release - release SM2 +TA3 - semaphore_obtain - wait forever on SM3 + +TA1 - task_delete - delete TA3 +TA1 - task_wake_after - sleep 5 seconds +TA4 - semaphore_obtain - wait forever on SM1 +TA5 - semaphore_obtain - wait forever on SM1 +TA1 - task_delete - delete TA4 +TA1 - semaphore_release - release SM1 +TA1 - task_wake_after - sleep 5 seconds +TA5 - got SM1 +TA5 - semaphore_obtain - wait forever on SM1 +TA1 - semaphore_delete - delete SM1 +TA1 - semaphore_delete - delete SM3 +TA1 - task_delete - delete self +TA5 - SM1 deleted by TA1 +*** END OF TEST 12 *** diff --git a/testsuites/ada/sptests/sp12/config.h b/testsuites/ada/sptests/sp12/config.h new file mode 100644 index 0000000000..cd574e737f --- /dev/null +++ b/testsuites/ada/sptests/sp12/config.h @@ -0,0 +1,32 @@ +/* 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 8 +#define CONFIGURE_MAXIMUM_SEMAPHORES 10 +#define CONFIGURE_TICKS_PER_TIMESLICE 100 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/sptests/sp12/sp12.adb b/testsuites/ada/sptests/sp12/sp12.adb new file mode 100644 index 0000000000..62a5761e51 --- /dev/null +++ b/testsuites/ada/sptests/sp12/sp12.adb @@ -0,0 +1,56 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test SP12 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 Interfaces; use Interfaces; +with RTEMS; +with RTEMS.TASKS; +with SPTEST; +with TEST_SUPPORT; + +procedure SP12 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 * 2, + 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 SP12; + diff --git a/testsuites/ada/sptests/sp12/sptest.adb b/testsuites/ada/sptests/sp12/sptest.adb new file mode 100644 index 0000000000..c1d9f627f8 --- /dev/null +++ b/testsuites/ada/sptests/sp12/sptest.adb @@ -0,0 +1,809 @@ +-- +-- SPTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 12 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 INTERFACES; use INTERFACES; +with TEST_SUPPORT; +with TEXT_IO; +with UNSIGNED32_IO; +with RTEMS.SEMAPHORE; + +package body SPTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TEST 12 ***" ); + + SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); + SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' ); + SPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' ); + SPTEST.TASK_NAME( 4 ) := RTEMS.BUILD_NAME( 'T', 'A', '4', ' ' ); + SPTEST.TASK_NAME( 5 ) := RTEMS.BUILD_NAME( 'T', 'A', '5', ' ' ); + + SPTEST.PRIORITY_TASK_NAME( 1 ) := + RTEMS.BUILD_NAME( 'P', 'R', 'I', '1' ); + SPTEST.PRIORITY_TASK_NAME( 2 ) := + RTEMS.BUILD_NAME( 'P', 'R', 'I', '2' ); + SPTEST.PRIORITY_TASK_NAME( 3 ) := + RTEMS.BUILD_NAME( 'P', 'R', 'I', '3' ); + SPTEST.PRIORITY_TASK_NAME( 4 ) := + RTEMS.BUILD_NAME( 'P', 'R', 'I', '4' ); + SPTEST.PRIORITY_TASK_NAME( 5 ) := + RTEMS.BUILD_NAME( 'P', 'R', 'I', '5' ); + + SPTEST.SEMAPHORE_NAME( 1 ) := RTEMS.BUILD_NAME( 'S', 'M', '1', ' ' ); + SPTEST.SEMAPHORE_NAME( 2 ) := RTEMS.BUILD_NAME( 'S', 'M', '2', ' ' ); + SPTEST.SEMAPHORE_NAME( 3 ) := RTEMS.BUILD_NAME( 'S', 'M', '3', ' ' ); + + RTEMS.SEMAPHORE.CREATE( + SPTEST.SEMAPHORE_NAME( 1 ), + 1, + RTEMS.DEFAULT_ATTRIBUTES, + RTEMS.TASKS.NO_PRIORITY, + SPTEST.SEMAPHORE_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE OF SM1" ); + + RTEMS.SEMAPHORE.CREATE( + SPTEST.SEMAPHORE_NAME( 2 ), + 0, + RTEMS.PRIORITY, + RTEMS.TASKS.NO_PRIORITY, + SPTEST.SEMAPHORE_ID( 2 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE OF SM2" ); + + RTEMS.SEMAPHORE.CREATE( + SPTEST.SEMAPHORE_NAME( 3 ), + 1, + RTEMS.DEFAULT_ATTRIBUTES, + RTEMS.TASKS.NO_PRIORITY, + SPTEST.SEMAPHORE_ID( 3 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE OF SM3" ); + + TEXT_IO.PUT_LINE( "INIT - Forward priority queue test" ); + SPTEST.PRIORITY_TEST_DRIVER( 0 ); + + TEXT_IO.PUT_LINE( "INIT - Backward priority queue test" ); + SPTEST.PRIORITY_TEST_DRIVER( 32 ); + +TEST_SUPPORT.PAUSE; + + TEXT_IO.PUT_LINE( + "INIT - Binary Semaphore and Priority Inheritance Test" + ); + + RTEMS.SEMAPHORE.DELETE( SPTEST.SEMAPHORE_ID( 2 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_DELETE OF SM2" ); + + TEXT_IO.PUT_LINE( + "INIT - semaphore_create - allocated binary semaphore" + ); + RTEMS.SEMAPHORE.CREATE( + SPTEST.SEMAPHORE_NAME( 2 ), + 0, + RTEMS.BINARY_SEMAPHORE + RTEMS.PRIORITY + RTEMS.INHERIT_PRIORITY, + RTEMS.TASKS.NO_PRIORITY, + SPTEST.SEMAPHORE_ID( 2 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE OF SM2" ); + + TEXT_IO.PUT_LINE( + "INIT - semaphore_release - allocated binary semaphore" + ); + RTEMS.SEMAPHORE.RELEASE( SPTEST.SEMAPHORE_ID( 2 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE OF SM2" ); + + TEXT_IO.PUT_LINE( + "INIT - semaphore_delete - allocated binary semaphore" + ); + RTEMS.SEMAPHORE.DELETE( SPTEST.SEMAPHORE_ID( 2 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_DELETE OF SM2" ); + + RTEMS.SEMAPHORE.CREATE( + SPTEST.SEMAPHORE_NAME( 2 ), + 1, + RTEMS.BINARY_SEMAPHORE + RTEMS.PRIORITY + RTEMS.INHERIT_PRIORITY, + RTEMS.TASKS.NO_PRIORITY, + SPTEST.SEMAPHORE_ID( 2 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE OF SM2" ); + + SPTEST.PRIORITY_TEST_DRIVER( 64 ); + +TEST_SUPPORT.PAUSE; + + RTEMS.SEMAPHORE.DELETE( SPTEST.SEMAPHORE_ID( 2 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_DELETE OF SM2" ); + + RTEMS.SEMAPHORE.CREATE( + SPTEST.SEMAPHORE_NAME( 2 ), + 0, + RTEMS.PRIORITY, + RTEMS.TASKS.NO_PRIORITY, + SPTEST.SEMAPHORE_ID( 2 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE OF SM2" ); + + RTEMS.SEMAPHORE.RELEASE( SPTEST.SEMAPHORE_ID( 2 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE OF SM2" ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 1 ), + 4, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 2 ), + 4, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 2 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 3 ), + 4, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 3 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA3" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 1 ), + SPTEST.TASK_1'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 2 ), + SPTEST.TASK_2'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 3 ), + SPTEST.TASK_3'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA3" ); + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- PRIORITY_TEST_DRIVER +-- + + procedure PRIORITY_TEST_DRIVER ( + PRIORITY_BASE : in RTEMS.UNSIGNED32 + ) is + PREVIOUS_PRIORITY : RTEMS.TASKS.PRIORITY; + STATUS : RTEMS.STATUS_CODES; + begin + + for INDEX in 1 .. 5 + loop + + case INDEX is + when 1 | 2 | 3 => + SPTEST.TASK_PRIORITY( INDEX ) := + PRIORITY_BASE + RTEMS.TASKS.PRIORITY( INDEX ); + when others => + SPTEST.TASK_PRIORITY( INDEX ) := PRIORITY_BASE + 3; + end case; + + RTEMS.TASKS.CREATE( + SPTEST.PRIORITY_TASK_NAME( INDEX ), + SPTEST.TASK_PRIORITY( INDEX ), + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.PRIORITY_TASK_ID( INDEX ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); + + end loop; + + if PRIORITY_BASE = 0 then + + for INDEX in 1 .. 5 + loop + + RTEMS.TASKS.START( + SPTEST.PRIORITY_TASK_ID( INDEX ), + SPTEST.PRIORITY_TASK'ACCESS, + RTEMS.TASKS.ARGUMENT( INDEX ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); + + end loop; + + else + + for INDEX in reverse 1 .. 5 + loop + + RTEMS.TASKS.START( + SPTEST.PRIORITY_TASK_ID( INDEX ), + SPTEST.PRIORITY_TASK'ACCESS, + RTEMS.TASKS.ARGUMENT( INDEX ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); + + RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER LOOP" ); + + if PRIORITY_BASE = 64 then + if INDEX = 4 then + RTEMS.TASKS.SET_PRIORITY( + SPTEST.PRIORITY_TASK_ID( 5 ), + PRIORITY_BASE + 4, + PREVIOUS_PRIORITY, + STATUS + ); + TEXT_IO.PUT( "PDRV - change priority of PRI5 from " ); + UNSIGNED32_IO.PUT( PREVIOUS_PRIORITY ); + TEXT_IO.PUT( " to " ); + UNSIGNED32_IO.PUT( PRIORITY_BASE + 4 ); + TEXT_IO.NEW_LINE; + TEST_SUPPORT.DIRECTIVE_FAILED( + STATUS, + "PDRV TASK_SET_PRIORITY" + ); + end if; + + RTEMS.TASKS.SET_PRIORITY( + SPTEST.PRIORITY_TASK_ID( 5 ), + RTEMS.TASKS.CURRENT_PRIORITY, + PREVIOUS_PRIORITY, + STATUS + ); + TEXT_IO.PUT( "PDRV - priority of PRI5 is " ); + UNSIGNED32_IO.PUT( PREVIOUS_PRIORITY ); + TEXT_IO.NEW_LINE; + TEST_SUPPORT.DIRECTIVE_FAILED( + STATUS, + "PDRV TASK_SET_PRIORITY" + ); + end if; + + end loop; + + end if; + + RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER AFTER LOOP" ); + + if PRIORITY_BASE = 0 then + for INDEX in 1 .. 5 + loop + + RTEMS.SEMAPHORE.RELEASE( + SPTEST.SEMAPHORE_ID( 2 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( + STATUS, + "SEMAPHORE_RELEASE LOOP" + ); + + end loop; + end if; + + if PRIORITY_BASE = 64 then + + TEXT_IO.PUT_LINE( "PDRV - task_resume - PRI5" ); + RTEMS.TASKS.RESUME( SPTEST.PRIORITY_TASK_ID( 5 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESUME" ); + + RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( + STATUS, + "TASK_WAKE_AFTER SO PRI5 can run" + ); + + RTEMS.TASKS.DELETE( SPTEST.PRIORITY_TASK_ID( 5 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF PRI5" ); + else + + for INDEX in 1 .. 5 + loop + + RTEMS.TASKS.DELETE( + SPTEST.PRIORITY_TASK_ID( INDEX ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE LOOP" ); + + end loop; + end if; + + + end PRIORITY_TEST_DRIVER; + +-- +-- PRIORITY_TASK +-- + + procedure PRIORITY_TASK ( + ITS_INDEX : in RTEMS.TASKS.ARGUMENT + ) is + TIMEOUT : RTEMS.INTERVAL; + ITS_PRIORITY : RTEMS.TASKS.PRIORITY; + CURRENT_PRIORITY : RTEMS.TASKS.PRIORITY; + STATUS : RTEMS.STATUS_CODES; + begin + + ITS_PRIORITY := SPTEST.TASK_PRIORITY( INTEGER( ITS_INDEX ) ); + + if ITS_PRIORITY < 3 then + TIMEOUT := 5 * TEST_SUPPORT.TICKS_PER_SECOND; + else + TIMEOUT := RTEMS.NO_TIMEOUT; + end if; + + TEST_SUPPORT.PUT_NAME( PRIORITY_TASK_NAME( INTEGER(ITS_INDEX) ), FALSE ); + TEXT_IO.PUT_LINE( " - semaphore_obtain - wait forever on SM2" ); + + RTEMS.SEMAPHORE.OBTAIN( + SPTEST.SEMAPHORE_ID( 2 ), + RTEMS.DEFAULT_OPTIONS, + TIMEOUT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN OF SM2" ); + + if ITS_PRIORITY < 64 then + TEXT_IO.PUT( "PRI" ); + UNSIGNED32_IO.PUT( ITS_INDEX ); + TEXT_IO.PUT( " - WHY AM I HERE? (priority = " ); + UNSIGNED32_IO.PUT( ITS_PRIORITY ); + TEXT_IO.PUT_LINE( " )" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + end if; + + if ITS_INDEX = 5 then + TEXT_IO.PUT_LINE( + "PRI5 - task_suspend - until all priority tasks blocked" + ); + end if; + + RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND" ); + + TEXT_IO.PUT_LINE( "PRI5 - task_delete - all tasks waiting on SM2" ); + for INDEX in 1 .. 4 + loop + + RTEMS.TASKS.DELETE( SPTEST.PRIORITY_TASK_ID( INDEX ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE LOOP" ); + + end loop; + + TEXT_IO.PUT_LINE( "PRI5 - semaphore_obtain - nested" ); + RTEMS.SEMAPHORE.OBTAIN( + SPTEST.SEMAPHORE_ID( 2 ), + RTEMS.DEFAULT_OPTIONS, + TIMEOUT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN NESTED" ); + + TEXT_IO.PUT_LINE( "PRI5 - semaphore_release - nested" ); + RTEMS.SEMAPHORE.RELEASE( SPTEST.SEMAPHORE_ID( 2 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE NESTED" ); + + TEXT_IO.PUT_LINE( "PRI5 - semaphore_release - restore priority" ); + RTEMS.SEMAPHORE.RELEASE( SPTEST.SEMAPHORE_ID( 2 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE" ); + + RTEMS.TASKS.SET_PRIORITY( + SPTEST.PRIORITY_TASK_ID( 5 ), + RTEMS.TASKS.CURRENT_PRIORITY, + CURRENT_PRIORITY, + STATUS + ); + TEXT_IO.PUT( "PRI5 - priority of PRI5 is " ); + UNSIGNED32_IO.PUT( CURRENT_PRIORITY ); + TEXT_IO.NEW_LINE; + TEST_SUPPORT.DIRECTIVE_FAILED( + STATUS, + "PRI5 TASK_SET_PRIORITY CURRENT" + ); + RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS ); + -- DOES NOT RETURN. Following check makes compiler happy + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND" ); + + end PRIORITY_TASK; + +-- +-- TASK_1 +-- + + procedure TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + SMID : RTEMS.ID; + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.SEMAPHORE.IDENT( + SPTEST.SEMAPHORE_NAME( 1 ), + RTEMS.SEARCH_ALL_NODES, + SMID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_IDENT OF SM1" ); + TEXT_IO.PUT( "TA1 - semaphore_ident - smid => " ); + UNSIGNED32_IO.PUT( SMID, WIDTH => 8, BASE => 16 ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT_LINE( "TA1 - semaphore_obtain - wait forever on SM2" ); + RTEMS.SEMAPHORE.OBTAIN( + SPTEST.SEMAPHORE_ID( 2 ), + RTEMS.DEFAULT_MODES, + RTEMS.NO_TIMEOUT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN ON SM2" ); + + TEXT_IO.PUT_LINE( "TA1 - got SM2" ); + + TEXT_IO.PUT_LINE( "TA1 - semaphore_obtain - wait forever on SM3" ); + RTEMS.SEMAPHORE.OBTAIN( + SPTEST.SEMAPHORE_ID( 3 ), + RTEMS.DEFAULT_MODES, + RTEMS.NO_TIMEOUT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN ON SM3" ); + + TEXT_IO.PUT_LINE( "TA1 - got SM3" ); + + TEXT_IO.PUT_LINE( "TA1 - semaphore_obtain - get SM1 - NO_WAIT" ); + RTEMS.SEMAPHORE.OBTAIN( + SPTEST.SEMAPHORE_ID( 1 ), + RTEMS.NO_WAIT, + RTEMS.NO_TIMEOUT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN ON SM1" ); + + TEXT_IO.PUT_LINE( "TA1 - got SM1" ); + + TEXT_IO.PUT_LINE( "TA1 - task_wake_after - sleep 5 seconds" ); + RTEMS.TASKS.WAKE_AFTER( 5 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + +TEST_SUPPORT.PAUSE; + + TEXT_IO.PUT_LINE( "TA1 - semaphore_release - release SM1" ); + RTEMS.SEMAPHORE.RELEASE( SPTEST.SEMAPHORE_ID( 1 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE ON SM1" ); + + TEXT_IO.PUT_LINE( + "TA1 - semaphore_obtain - waiting for SM1 with 10 second timeout" + ); + RTEMS.SEMAPHORE.OBTAIN( + SPTEST.SEMAPHORE_ID( 1 ), + RTEMS.DEFAULT_MODES, + 10 * TEST_SUPPORT.TICKS_PER_SECOND, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN ON SM3" ); + + TEXT_IO.PUT_LINE( "TA1 - got SM1" ); + + TEXT_IO.PUT_LINE( "TA1 - semaphore_release - release SM2" ); + RTEMS.SEMAPHORE.RELEASE( + SPTEST.SEMAPHORE_ID( 2 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE ON SM2" ); + + TEXT_IO.PUT_LINE( "TA1 - task_wake_after - sleep 5 seconds" ); + RTEMS.TASKS.WAKE_AFTER( 5 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + +TEST_SUPPORT.PAUSE; + + TEXT_IO.PUT_LINE( "TA1 - task_delete - delete TA3" ); + RTEMS.TASKS.DELETE( SPTEST.TASK_ID( 3 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA3" ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 4 ), + 4, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 4 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA4" ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 5 ), + 4, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 5 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA5" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 4 ), + SPTEST.TASK_4'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA4" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 5 ), + SPTEST.TASK_5'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA5" ); + + TEXT_IO.PUT_LINE( "TA1 - task_wake_after - sleep 5 seconds" ); + RTEMS.TASKS.WAKE_AFTER( 5 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + TEXT_IO.PUT_LINE( "TA1 - task_delete - delete TA4" ); + RTEMS.TASKS.DELETE( SPTEST.TASK_ID( 4 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA4" ); + + TEXT_IO.PUT_LINE( "TA1 - semaphore_release - release SM1" ); + RTEMS.SEMAPHORE.RELEASE( + SPTEST.SEMAPHORE_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE ON SM1" ); + + TEXT_IO.PUT_LINE( "TA1 - task_wake_after - sleep 5 seconds" ); + RTEMS.TASKS.WAKE_AFTER( 5 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + TEXT_IO.PUT_LINE( "TA1 - semaphore_delete - delete SM1" ); + RTEMS.SEMAPHORE.DELETE( SPTEST.SEMAPHORE_ID( 1 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_DELETE OF SM1" ); + + TEXT_IO.PUT_LINE( "TA1 - semaphore_delete - delete SM3" ); + RTEMS.SEMAPHORE.DELETE( SPTEST.SEMAPHORE_ID( 3 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_DELETE OF SM3" ); + + TEXT_IO.PUT_LINE( "TA1 - task_delete - delete self" ); + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA1" ); + + end TASK_1; + +-- +-- TASK_2 +-- + + procedure TASK_2 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + PREVIOUS_PRIORITY : RTEMS.TASKS.PRIORITY; + begin + + TEXT_IO.PUT_LINE( "TA2 - semaphore_obtain - wait forever on SM1" ); + RTEMS.SEMAPHORE.OBTAIN( + SPTEST.SEMAPHORE_ID( 1 ), + RTEMS.DEFAULT_MODES, + RTEMS.NO_TIMEOUT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN ON SM1" ); + + TEXT_IO.PUT_LINE( "TA2 - got SM1" ); + + TEXT_IO.PUT_LINE( "TA2 - semaphore_release - release SM1" ); + RTEMS.SEMAPHORE.RELEASE( + SPTEST.SEMAPHORE_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE ON SM1" ); + + TEXT_IO.PUT_LINE( + "TA2 - task_set_priority - make self highest priority task" + ); + RTEMS.TASKS.SET_PRIORITY( + RTEMS.SELF, + 3, + PREVIOUS_PRIORITY, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY ON TA2" ); + + TEXT_IO.PUT_LINE( "TA2 - semaphore_obtain - wait forever on SM2" ); + RTEMS.SEMAPHORE.OBTAIN( + SPTEST.SEMAPHORE_ID( 2 ), + RTEMS.DEFAULT_MODES, + RTEMS.NO_TIMEOUT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN ON SM2" ); + + TEXT_IO.PUT_LINE( "TA2 - got SM2" ); + + TEXT_IO.PUT_LINE( "TA2 - semaphore_release - release SM2" ); + RTEMS.SEMAPHORE.RELEASE( + SPTEST.SEMAPHORE_ID( 2 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE ON SM2" ); + + TEXT_IO.PUT_LINE( "TA2 - task_delete - delete self" ); + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA2" ); + + end TASK_2; + +-- +-- TASK_3 +-- + + procedure TASK_3 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.PUT_LINE( "TA3 - semaphore_obtain - wait forever on SM2" ); + RTEMS.SEMAPHORE.OBTAIN( + SPTEST.SEMAPHORE_ID( 2 ), + RTEMS.DEFAULT_MODES, + RTEMS.NO_TIMEOUT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN ON SM2" ); + TEXT_IO.PUT_LINE( "TA3 - got SM2" ); + + TEXT_IO.PUT_LINE( "TA3 - semaphore_release - release SM2" ); + RTEMS.SEMAPHORE.RELEASE( + SPTEST.SEMAPHORE_ID( 2 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE ON SM2" ); + + TEXT_IO.PUT_LINE( "TA3 - semaphore_obtain - wait forever on SM3" ); + RTEMS.SEMAPHORE.OBTAIN( + SPTEST.SEMAPHORE_ID( 3 ), + RTEMS.DEFAULT_MODES, + RTEMS.NO_TIMEOUT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN ON SM3" ); + + end TASK_3; + +-- +-- TASK_4 +-- + + procedure TASK_4 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.PUT_LINE( "TA4 - semaphore_obtain - wait forever on SM1" ); + RTEMS.SEMAPHORE.OBTAIN( + SPTEST.SEMAPHORE_ID( 1 ), + RTEMS.DEFAULT_MODES, + RTEMS.NO_TIMEOUT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN ON SM1" ); + + end TASK_4; + +-- +-- TASK_5 +-- + + procedure TASK_5 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.PUT_LINE( "TA5 - semaphore_obtain - wait forever on SM1" ); + RTEMS.SEMAPHORE.OBTAIN( + SPTEST.SEMAPHORE_ID( 1 ), + RTEMS.DEFAULT_MODES, + RTEMS.NO_TIMEOUT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN ON SM1" ); + + TEXT_IO.PUT_LINE( "TA5 - got SM1" ); + + TEXT_IO.PUT_LINE( "TA5 - semaphore_obtain - wait forever on SM1" ); + RTEMS.SEMAPHORE.OBTAIN( + SPTEST.SEMAPHORE_ID( 1 ), + RTEMS.DEFAULT_MODES, + RTEMS.NO_TIMEOUT, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.OBJECT_WAS_DELETED, + "SEMAPHORE_OBTAIN ON SM1" + ); + TEXT_IO.PUT_LINE( "TA5 - SM1 deleted by TA1" ); + + TEXT_IO.PUT_LINE( "*** END OF TEST 12 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end TASK_5; + +end SPTEST; diff --git a/testsuites/ada/sptests/sp12/sptest.ads b/testsuites/ada/sptests/sp12/sptest.ads new file mode 100644 index 0000000000..663faa7686 --- /dev/null +++ b/testsuites/ada/sptests/sp12/sptest.ads @@ -0,0 +1,147 @@ +-- +-- SPTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 12 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; + +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 .. 5 ) of RTEMS.ID; + TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 5 ) of RTEMS.NAME; + + PRIORITY_TASK_ID : array ( 1 .. 5 ) of RTEMS.ID; + PRIORITY_TASK_NAME : array ( 1 .. 5 ) of RTEMS.NAME; + TASK_PRIORITY : array ( 1 .. 5 ) of RTEMS.TASKS.PRIORITY; + + SEMAPHORE_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; + SEMAPHORE_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- PRIORITY_TEST_DRIVER +-- +-- DESCRIPTION: +-- +-- This subprogram creates and starts RTEMS tasks of different priority +-- so that those tasks may exercise the priority blocking algorithm. +-- + + procedure PRIORITY_TEST_DRIVER ( + PRIORITY_BASE : in RTEMS.UNSIGNED32 + ); + +-- +-- PRIORITY_TASK +-- +-- DESCRIPTION: +-- +-- Copies of this RTEMS are executed at different priorities and each +-- instantiation blocks on a semaphore with priority blocking. This +-- is done to exercise the priority blocking algorithms. +-- + + procedure PRIORITY_TASK ( + ITS_INDEX : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, PRIORITY_TASK); + +-- +-- TASK_1 +-- +-- DESCRIPTION: +-- +-- This RTEMS task tests the Semaphore Manager. +-- + + procedure TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_1); + +-- +-- TASK_2 +-- +-- DESCRIPTION: +-- +-- This RTEMS task tests the Semaphore Manager. +-- + + procedure TASK_2 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_2); + +-- +-- TASK_3 +-- +-- DESCRIPTION: +-- +-- This RTEMS task tests the Semaphore Manager. +-- + + procedure TASK_3 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_3); + +-- +-- TASK_4 +-- +-- DESCRIPTION: +-- +-- This RTEMS task tests the Semaphore Manager. +-- + + procedure TASK_4 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_4); + +-- +-- TASK_5 +-- +-- DESCRIPTION: +-- +-- This RTEMS task tests the Semaphore Manager. +-- + + procedure TASK_5 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_5); + +end SPTEST; diff --git a/testsuites/ada/sptests/sp13/Makefile.am b/testsuites/ada/sptests/sp13/Makefile.am new file mode 100644 index 0000000000..19a8ed23ff --- /dev/null +++ b/testsuites/ada/sptests/sp13/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_sp13 +ada_sp13_SOURCES = sp13.adb config.h sptest.adb sptest.ads +ada_sp13_SOURCES += ../../support/init.c + +ada_sp13$(EXEEXT): sp13.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_sp13.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/sptests/sp13/ada_sp13.scn b/testsuites/ada/sptests/sp13/ada_sp13.scn new file mode 100644 index 0000000000..f54a497a58 --- /dev/null +++ b/testsuites/ada/sptests/sp13/ada_sp13.scn @@ -0,0 +1,78 @@ +*** TEST 13 *** +TA1 - message_queue_ident - qid => 16#22010001# +TA1 - message_queue_send - BUFFER 1 TO Q 1 +TA1 - message_queue_send - BUFFER 2 TO Q 1 +TA1 - task_wake_after - sleep 5 seconds +TA2 - message_queue_receive - receive from queue 1 - NO_WAIT +TA2 - buffer received: BUFFER 1 TO Q 1 +TA2 - message_queue_receive - receive from queue 1 - WAIT FOREVER +TA2 - buffer received: BUFFER 2 TO Q 1 +TA2 - message_queue_receive - receive from queue 1 - WAIT FOREVER +TA3 - message_queue_receive - receive from queue 2 - WAIT FOREVER +TA1 - message_queue_send - BUFFER 3 TO Q 1 +TA1 - task_wake_after - sleep 5 seconds +TA2 - buffer received: BUFFER 3 TO Q 1 +TA2 - task_set_priority - make self highest priority task +TA2 - message_queue_receive - receive from queue 2 - WAIT FOREVER + +TA1 - message_queue_send - BUFFER 1 TO Q 2 +TA2 - buffer received: BUFFER 1 TO Q 2 +TA2 - message_queue_send - BUFFER 2 TO Q 2 +TA2 - message_queue_receive - receive from queue 1 - 10 second timeout +TA1 - message_queue_receive - receive from queue 1 - 10 second timeout +TA3 - buffer received: BUFFER 2 TO Q 2 +TA3 - message_queue_broadcast - BUFFER 3 TO Q 1 +TA2 - buffer received: BUFFER 3 TO Q 1 +TA2 - message_queue_receive - receive from queue 3 - WAIT FOREVER +TA3 - number of tasks awakened = 2 +TA3 - message_queue_receive - receive from queue 3 - WAIT FOREVER +TA1 - buffer received: BUFFER 3 TO Q 1 +TA1 - task_delete - delete TA2 +TA1 - message_queue_send - BUFFER 1 TO Q 3 +TA1 - task_wake_after - sleep 5 seconds +TA3 - buffer received: BUFFER 1 TO Q 3 +TA3 - task_delete - delete self + +TA1 - message_queue_send - BUFFER 2 TO Q 3 +TA1 - message_queue_send - BUFFER 3 TO Q 3 +TA1 - message_queue_send - BUFFER 4 TO Q 3 +TA1 - message_queue_urgent - BUFFER 5 TO Q 3 +TA1 - message_queue_receive - receive from queue 3 - WAIT FOREVER +TA1 - buffer received: BUFFER 5 TO Q 3 +TA1 - message_queue_receive - receive from queue 3 - WAIT FOREVER +TA1 - buffer received: BUFFER 2 TO Q 3 +TA1 - message_queue_receive - receive from queue 3 - WAIT FOREVER +TA1 - buffer received: BUFFER 3 TO Q 3 +TA1 - message_queue_receive - receive from queue 3 - WAIT FOREVER +TA1 - buffer received: BUFFER 4 TO Q 3 +TA1 - message_queue_urgent - BUFFER 3 TO Q 2 +TA1 - message_queue_receive - receive from queue 2 - WAIT FOREVER +TA1 - buffer received: BUFFER 3 TO Q 2 + +TA1 - message_queue_delete - delete queue 1 +TA1 - message_queue_urgent - BUFFER 3 TO Q 2 +TA1 - message_queue_delete - delete queue 2 +TA1 - message_queue_get_number_pending - check Q 3 +TA1 - 0 messages are pending on Q 3 +TA1 - message_queue_flush - empty Q 3 +TA1 - 0 messages were flushed from Q 3 +TA1 - message_queue_send - BUFFER 1 TO Q 3 +TA1 - message_queue_send - BUFFER 2 TO Q 3 +TA1 - message_queue_broadcast - NO BUFFER TO Q1 +TA1 - number of tasks awakened = 0 +TA1 - message_queue_get_number_pending - check Q 3 +TA1 - 2 messages are pending on Q 3 +TA1 - message_queue_send - BUFFER 3 TO Q 3 +TA1 - message_queue_flush - Q 3 +TA1 - 3 messages were flushed from Q 3 +TA1 - message_queue_send - until all message buffers consumed +TA1 - message_queue_send - all message buffers consumed +TA1 - message_queue_flush - Q 3 +TA1 - 100 messages were flushed from Q 3 + +TA1 - create message queue of 20 bytes on queue 1 +TA1 - message_queue_delete - delete queue 1 + +TA1 - message_queue_create - variable sizes +TA1 - message_queue_create and send - variable sizes +*** END OF TEST 13 *** diff --git a/testsuites/ada/sptests/sp13/config.h b/testsuites/ada/sptests/sp13/config.h new file mode 100644 index 0000000000..8e7821e061 --- /dev/null +++ b/testsuites/ada/sptests/sp13/config.h @@ -0,0 +1,32 @@ +/* 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 4 +#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 10 +#define CONFIGURE_TICKS_PER_TIMESLICE 100 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/sptests/sp13/sp13.adb b/testsuites/ada/sptests/sp13/sp13.adb new file mode 100644 index 0000000000..503e8fb989 --- /dev/null +++ b/testsuites/ada/sptests/sp13/sp13.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test SP13 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 SP13 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 SP13; + diff --git a/testsuites/ada/sptests/sp13/sptest.adb b/testsuites/ada/sptests/sp13/sptest.adb new file mode 100644 index 0000000000..7b61b9e7ba --- /dev/null +++ b/testsuites/ada/sptests/sp13/sptest.adb @@ -0,0 +1,891 @@ +-- +-- SPTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 13 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 INTERFACES; use INTERFACES; +with RTEMS; +with RTEMS.MESSAGE_QUEUE; +with TEST_SUPPORT; +with TEXT_IO; +with UNSIGNED32_IO; +use type RTEMS.STATUS_CODES; + +package body SPTEST is + + type BIG_BUFFER_TYPE is array (1 .. 2048) of RTEMS.UNSIGNED8; + + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TEST 13 ***" ); + + SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); + SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' ); + SPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 1 ), + 4, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 2 ), + 4, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 2 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 3 ), + 4, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 3 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA3" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 1 ), + SPTEST.TASK_1'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 2 ), + SPTEST.TASK_2'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 3 ), + SPTEST.TASK_3'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA3" ); + + SPTEST.QUEUE_NAME( 1 ) := RTEMS.BUILD_NAME( 'Q', '1', ' ', ' ' ); + SPTEST.QUEUE_NAME( 2 ) := RTEMS.BUILD_NAME( 'Q', '2', ' ', ' ' ); + SPTEST.QUEUE_NAME( 3 ) := RTEMS.BUILD_NAME( 'Q', '3', ' ', ' ' ); + + RTEMS.MESSAGE_QUEUE.CREATE( + SPTEST.QUEUE_NAME( 1 ), + 100, + 16, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.QUEUE_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "QUEUE_CREATE OF Q1" ); + + RTEMS.MESSAGE_QUEUE.CREATE( + SPTEST.QUEUE_NAME( 2 ), + 10, + 16, + RTEMS.PRIORITY, + SPTEST.QUEUE_ID( 2 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "QUEUE_CREATE OF Q2" ); + + RTEMS.MESSAGE_QUEUE.CREATE( + SPTEST.QUEUE_NAME( 3 ), + 100, + 16, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.QUEUE_ID( 3 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "QUEUE_CREATE OF Q3" ); + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- FILL_BUFFER +-- + +-- +-- Depends on tricks to make the copy work. +-- + + procedure FILL_BUFFER ( + SOURCE : in STRING; + BUFFER : out SPTEST.BUFFER + ) is + begin + + BUFFER.FIELD1 := RTEMS.BUILD_NAME( + SOURCE( SOURCE'FIRST ), + SOURCE( SOURCE'FIRST + 1 ), + SOURCE( SOURCE'FIRST + 2 ), + SOURCE( SOURCE'FIRST + 3 ) + ); + + BUFFER.FIELD2 := RTEMS.BUILD_NAME( + SOURCE( SOURCE'FIRST + 4 ), + SOURCE( SOURCE'FIRST + 5 ), + SOURCE( SOURCE'FIRST + 6 ), + SOURCE( SOURCE'FIRST + 7 ) + ); + + BUFFER.FIELD3 := RTEMS.BUILD_NAME( + SOURCE( SOURCE'FIRST + 8 ), + SOURCE( SOURCE'FIRST + 9 ), + SOURCE( SOURCE'FIRST + 10 ), + SOURCE( SOURCE'FIRST + 11 ) + ); + + BUFFER.FIELD4 := RTEMS.BUILD_NAME( + SOURCE( SOURCE'FIRST + 12 ), + SOURCE( SOURCE'FIRST + 13 ), + SOURCE( SOURCE'FIRST + 14 ), + SOURCE( SOURCE'FIRST + 15 ) + ); + + end FILL_BUFFER; + +-- +-- PUT_BUFFER +-- + +-- +-- Depends on tricks to make the output work. +-- + + procedure PUT_BUFFER ( + BUFFER : in SPTEST.BUFFER + ) is + begin + + TEST_SUPPORT.PUT_NAME( BUFFER.FIELD1, FALSE ); + TEST_SUPPORT.PUT_NAME( BUFFER.FIELD2, FALSE ); + TEST_SUPPORT.PUT_NAME( BUFFER.FIELD3, FALSE ); + TEST_SUPPORT.PUT_NAME( BUFFER.FIELD4, FALSE ); + + end PUT_BUFFER; + +-- +-- TASK_1 +-- + + procedure TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + QID : RTEMS.ID; + BIG_SEND_BUFFER : BIG_BUFFER_TYPE; + BIG_SEND_BUFFER_POINTER : constant RTEMS.ADDRESS + := BIG_SEND_BUFFER'ADDRESS; + BIG_RECEIVE_BUFFER : BIG_BUFFER_TYPE; + BIG_RECEIVE_BUFFER_POINTER : constant RTEMS.ADDRESS + := BIG_RECEIVE_BUFFER'ADDRESS; + BUFFER : SPTEST.BUFFER; + BUFFER_POINTER : constant RTEMS.ADDRESS := BUFFER'ADDRESS; + COUNT : RTEMS.UNSIGNED32; + MESSAGE_SIZE : RTEMS.UNSIGNED32 := 0; + STATUS : RTEMS.STATUS_CODES; + SIZE : RTEMS.UNSIGNED32 := 0; + begin + + RTEMS.MESSAGE_QUEUE.IDENT( + SPTEST.QUEUE_NAME( 1 ), + RTEMS.SEARCH_ALL_NODES, + QID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_IDENT" ); + TEXT_IO.PUT( "TA1 - message_queue_ident - qid => " ); + UNSIGNED32_IO.PUT( QID, WIDTH => 8, BASE => 16 ); + TEXT_IO.NEW_LINE; + + SPTEST.FILL_BUFFER( "BUFFER 1 TO Q 1 ", BUFFER ); + TEXT_IO.PUT_LINE( "TA1 - message_queue_send - BUFFER 1 TO Q 1" ); + RTEMS.MESSAGE_QUEUE.SEND( + SPTEST.QUEUE_ID( 1 ), + BUFFER_POINTER, + 16, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); + + SPTEST.FILL_BUFFER( "BUFFER 2 TO Q 1 ", BUFFER ); + TEXT_IO.PUT_LINE( "TA1 - message_queue_send - BUFFER 2 TO Q 1" ); + RTEMS.MESSAGE_QUEUE.SEND( + SPTEST.QUEUE_ID( 1 ), + BUFFER_POINTER, + 16, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); + + TEXT_IO.PUT_LINE( "TA1 - task_wake_after - sleep 5 seconds" ); + RTEMS.TASKS.WAKE_AFTER( 5 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + SPTEST.FILL_BUFFER( "BUFFER 3 TO Q 1 ", BUFFER ); + TEXT_IO.PUT_LINE( "TA1 - message_queue_send - BUFFER 3 TO Q 1" ); + RTEMS.MESSAGE_QUEUE.SEND( + SPTEST.QUEUE_ID( 1 ), + BUFFER_POINTER, + 16, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); + + TEXT_IO.PUT_LINE( "TA1 - task_wake_after - sleep 5 seconds" ); + RTEMS.TASKS.WAKE_AFTER( 5 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + +TEST_SUPPORT.PAUSE; + + SPTEST.FILL_BUFFER( "BUFFER 1 TO Q 2 ", BUFFER ); + TEXT_IO.PUT_LINE( "TA1 - message_queue_send - BUFFER 1 TO Q 2" ); + RTEMS.MESSAGE_QUEUE.SEND( + SPTEST.QUEUE_ID( 2 ), + BUFFER_POINTER, + 16, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); + + TEXT_IO.PUT( + "TA1 - message_queue_receive - receive from queue 1 - " + ); + TEXT_IO.PUT_LINE( "10 second timeout" ); + RTEMS.MESSAGE_QUEUE.RECEIVE( + SPTEST.QUEUE_ID( 1 ), + BUFFER_POINTER, + RTEMS.DEFAULT_OPTIONS, + 10 * TEST_SUPPORT.TICKS_PER_SECOND, + MESSAGE_SIZE, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" ); + TEXT_IO.PUT( "TA1 - buffer received: " ); + SPTEST.PUT_BUFFER( BUFFER ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT_LINE( "TA1 - task_delete - delete TA2" ); + RTEMS.TASKS.DELETE( SPTEST.TASK_ID( 2 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE" ); + + SPTEST.FILL_BUFFER( "BUFFER 1 TO Q 3 ", BUFFER ); + TEXT_IO.PUT_LINE( "TA1 - message_queue_send - BUFFER 1 TO Q 3" ); + RTEMS.MESSAGE_QUEUE.SEND( + SPTEST.QUEUE_ID( 3 ), + BUFFER_POINTER, + 16, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); + + TEXT_IO.PUT_LINE( "TA1 - task_wake_after - sleep 5 seconds" ); + RTEMS.TASKS.WAKE_AFTER( 5 * TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + +TEST_SUPPORT.PAUSE; + + SPTEST.FILL_BUFFER( "BUFFER 2 TO Q 3 ", BUFFER ); + TEXT_IO.PUT_LINE( "TA1 - message_queue_send - BUFFER 2 TO Q 3" ); + RTEMS.MESSAGE_QUEUE.SEND( + SPTEST.QUEUE_ID( 3 ), + BUFFER_POINTER, + 16, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); + + SPTEST.FILL_BUFFER( "BUFFER 3 TO Q 3 ", BUFFER ); + TEXT_IO.PUT_LINE( "TA1 - message_queue_send - BUFFER 3 TO Q 3" ); + RTEMS.MESSAGE_QUEUE.SEND( + SPTEST.QUEUE_ID( 3 ), + BUFFER_POINTER, + 16, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); + + SPTEST.FILL_BUFFER( "BUFFER 4 TO Q 3 ", BUFFER ); + TEXT_IO.PUT_LINE( "TA1 - message_queue_send - BUFFER 4 TO Q 3" ); + RTEMS.MESSAGE_QUEUE.SEND( + SPTEST.QUEUE_ID( 3 ), + BUFFER_POINTER, + 16, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); + + SPTEST.FILL_BUFFER( "BUFFER 5 TO Q 3 ", BUFFER ); + TEXT_IO.PUT_LINE( "TA1 - message_queue_urgent - BUFFER 5 TO Q 3" ); + RTEMS.MESSAGE_QUEUE.URGENT( + SPTEST.QUEUE_ID( 3 ), + BUFFER_POINTER, + 16, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_URGENT" ); + + for TIMES in 1 .. 4 + loop + TEXT_IO.PUT( + "TA1 - message_queue_receive - receive from queue 3 - " + ); + TEXT_IO.PUT_LINE( "WAIT FOREVER" ); + RTEMS.MESSAGE_QUEUE.RECEIVE( + SPTEST.QUEUE_ID( 3 ), + BUFFER_POINTER, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + MESSAGE_SIZE, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" ); + TEXT_IO.PUT( "TA1 - buffer received: " ); + SPTEST.PUT_BUFFER( BUFFER ); + TEXT_IO.NEW_LINE; + end loop; + + SPTEST.FILL_BUFFER( "BUFFER 3 TO Q 2 ", BUFFER ); + TEXT_IO.PUT_LINE( "TA1 - message_queue_urgent - BUFFER 3 TO Q 2" ); + RTEMS.MESSAGE_QUEUE.URGENT( + SPTEST.QUEUE_ID( 2 ), + BUFFER_POINTER, + 16, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_URGENT" ); + + TEXT_IO.PUT( + "TA1 - message_queue_receive - receive from queue 2 - " + ); + TEXT_IO.PUT_LINE( "WAIT FOREVER" ); + RTEMS.MESSAGE_QUEUE.RECEIVE( + SPTEST.QUEUE_ID( 2 ), + BUFFER_POINTER, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + MESSAGE_SIZE, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" ); + TEXT_IO.PUT( "TA1 - buffer received: " ); + SPTEST.PUT_BUFFER( BUFFER ); + TEXT_IO.NEW_LINE; + +TEST_SUPPORT.PAUSE; + + TEXT_IO.PUT_LINE( "TA1 - message_queue_delete - delete queue 1" ); + RTEMS.MESSAGE_QUEUE.DELETE( SPTEST.QUEUE_ID( 1 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_DELETE" ); + + SPTEST.FILL_BUFFER( "BUFFER 3 TO Q 2 ", BUFFER ); + TEXT_IO.PUT_LINE( "TA1 - message_queue_urgent - BUFFER 3 TO Q 2" ); + RTEMS.MESSAGE_QUEUE.URGENT( + SPTEST.QUEUE_ID( 2 ), + BUFFER_POINTER, + 16, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_URGENT" ); + + TEXT_IO.PUT_LINE( "TA1 - message_queue_delete - delete queue 2" ); + RTEMS.MESSAGE_QUEUE.DELETE( SPTEST.QUEUE_ID( 2 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_DELETE" ); + + TEXT_IO.PUT_LINE( "TA1 - message_queue_get_number_pending - check Q 3" ); + RTEMS.MESSAGE_QUEUE.GET_NUMBER_PENDING( + SPTEST.QUEUE_ID( 3 ), COUNT, STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( + STATUS, "MESSAGE_QUEUE_GET_NUMBER_PENDING" + ); + TEXT_IO.PUT( "TA1 - " ); + UNSIGNED32_IO.PUT( COUNT, WIDTH => 3, BASE => 10 ); + TEXT_IO.PUT_LINE( " messages are pending on Q 3" ); + + TEXT_IO.PUT_LINE( "TA1 - message_queue_flush - empty Q 3" ); + RTEMS.MESSAGE_QUEUE.FLUSH( SPTEST.QUEUE_ID( 3 ), COUNT, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_FLUSH" ); + TEXT_IO.PUT( "TA1 - " ); + UNSIGNED32_IO.PUT( COUNT, WIDTH => 3, BASE => 10 ); + TEXT_IO.PUT_LINE( " messages were flushed from Q 3" ); + + SPTEST.FILL_BUFFER( "BUFFER 1 TO Q 3 ", BUFFER ); + TEXT_IO.PUT_LINE( "TA1 - message_queue_send - BUFFER 1 TO Q 3" ); + RTEMS.MESSAGE_QUEUE.SEND( + SPTEST.QUEUE_ID( 3 ), + BUFFER_POINTER, + 16, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); + + SPTEST.FILL_BUFFER( "BUFFER 2 TO Q 3 ", BUFFER ); + TEXT_IO.PUT_LINE( "TA1 - message_queue_send - BUFFER 2 TO Q 3" ); + RTEMS.MESSAGE_QUEUE.SEND( + SPTEST.QUEUE_ID( 3 ), + BUFFER_POINTER, + 16, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); + + -- this broadcast should have no effect on the queue + SPTEST.FIlL_BUFFER( "NO BUFFER TO Q1 ", BUFFER ); + TEXT_IO.PUT_LINE( "TA1 - message_queue_broadcast - NO BUFFER TO Q1" ); + RTEMS.MESSAGE_QUEUE.BROADCAST( + SPTEST.QUEUE_ID( 1 ), + BUFFER_POINTER, + 16, + COUNT, + STATUS + ); + TEXT_IO.PUT( "TA1 - number of tasks awakened = " ); + UNSIGNED32_IO.PUT( COUNT, WIDTH => 3, BASE => 10 ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT_LINE( "TA1 - message_queue_get_number_pending - check Q 3" ); + RTEMS.MESSAGE_QUEUE.GET_NUMBER_PENDING( + SPTEST.QUEUE_ID( 3 ), COUNT, STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( + STATUS, "MESSAGE_QUEUE_GET_NUMBER_PENDING" + ); + TEXT_IO.PUT( "TA1 - " ); + UNSIGNED32_IO.PUT( COUNT, WIDTH => 3, BASE => 10 ); + TEXT_IO.PUT_LINE( " messages are pending on Q 3" ); + + SPTEST.FILL_BUFFER( "BUFFER 3 TO Q 3 ", BUFFER ); + TEXT_IO.PUT_LINE( "TA1 - message_queue_send - BUFFER 3 TO Q 3" ); + RTEMS.MESSAGE_QUEUE.SEND( + SPTEST.QUEUE_ID( 3 ), + BUFFER_POINTER, + 16, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); + + TEXT_IO.PUT_LINE( "TA1 - message_queue_flush - Q 3" ); + RTEMS.MESSAGE_QUEUE.FLUSH( SPTEST.QUEUE_ID( 3 ), COUNT, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_FLUSH" ); + TEXT_IO.PUT( "TA1 - " ); + UNSIGNED32_IO.PUT( COUNT, WIDTH => 3, BASE => 10 ); + TEXT_IO.PUT_LINE( " messages were flushed from Q 3" ); + + TEXT_IO.PUT_LINE( + "TA1 - message_queue_send - until all message buffers consumed" + ); + loop + + RTEMS.MESSAGE_QUEUE.SEND( + SPTEST.QUEUE_ID( 3 ), + BUFFER_POINTER, + 16, + STATUS + ); + + exit when RTEMS.ARE_STATUSES_EQUAL( STATUS, RTEMS.TOO_MANY ); + + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); + + end loop; + + TEXT_IO.PUT_LINE( + "TA1 - message_queue_send - all message buffers consumed" + ); + + TEXT_IO.PUT_LINE( "TA1 - message_queue_flush - Q 3" ); + RTEMS.MESSAGE_QUEUE.FLUSH( SPTEST.QUEUE_ID( 3 ), COUNT, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_FLUSH" ); + TEXT_IO.PUT( "TA1 - " ); + UNSIGNED32_IO.PUT( COUNT, WIDTH => 3, BASE => 10 ); + TEXT_IO.PUT_LINE( " messages were flushed from Q 3" ); + +TEST_SUPPORT.PAUSE; + + TEXT_IO.PUT_LINE( "TA1 - create message queue of 20 bytes on queue 1" ); + RTEMS.MESSAGE_QUEUE.CREATE( + SPTEST.QUEUE_NAME( 1 ), + 100, + 20, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.QUEUE_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( + STATUS, "MESSAGE_QUEUE_CREATE of Q1; 20 bytes each" + ); + RTEMS.MESSAGE_QUEUE.SEND( + SPTEST.QUEUE_ID( 1 ), BIG_SEND_BUFFER_POINTER, 40, STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, RTEMS.INVALID_SIZE, "expected INVALID_SIZE" + ); + + TEXT_IO.PUT_LINE( "TA1 - message_queue_delete - delete queue 1" ); + RTEMS.MESSAGE_QUEUE.DELETE( SPTEST.QUEUE_ID( 1 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_DELETE" ); + +TEST_SUPPORT.PAUSE; + + TEXT_IO.PUT_LINE( "TA1 - message_queue_create - variable sizes " ); + for QUEUE_SIZE in 1 .. 1029 loop + RTEMS.MESSAGE_QUEUE.CREATE( + SPTEST.QUEUE_NAME( 1 ), + 2, -- just 2 msgs each + RTEMS.UNSIGNED32( QUEUE_SIZE ), + RTEMS.DEFAULT_ATTRIBUTES, + QUEUE_ID( 1 ), + STATUS + ); + if STATUS /= RTEMS.SUCCESSFUL then + TEXT_IO.PUT( "TA1 - msq que size: " ); + UNSIGNED32_IO.PUT( + RTEMS.UNSIGNED32( QUEUE_SIZE ), WIDTH => 3, BASE => 10 + ); + TEXT_IO.NEW_LINE; + TEST_SUPPORT.DIRECTIVE_FAILED( + STATUS, "message_queue_create of Q1" + ); + end if; + + RTEMS.MESSAGE_QUEUE.DELETE( SPTEST.QUEUE_ID( 1 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "message_queue_delete" ); + end loop; + + TEXT_IO.PUT_LINE( + "TA1 - message_queue_create and send - variable sizes " + ); + for QUEUE_SIZE in 1 .. 1029 loop + + RTEMS.MESSAGE_QUEUE.CREATE( + SPTEST.QUEUE_NAME( 1 ), + 2, -- just 2 msgs each + RTEMS.UNSIGNED32( QUEUE_SIZE ), + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.QUEUE_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED(status, "message_queue_create of Q1"); + + BIG_SEND_BUFFER := (others => CHARACTER'POS( 'A' )); + BIG_RECEIVE_BUFFER := (others => CHARACTER'POS( 'Z' )); + + -- send a msg too big + RTEMS.MESSAGE_QUEUE.SEND( + SPTEST.QUEUE_ID( 1 ), + BIG_SEND_BUFFER_POINTER, + RTEMS.UNSIGNED32( QUEUE_SIZE + 1 ), + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, RTEMS.INVALID_SIZE, "message_queue_send too large" + ); + + -- send a msg that is just right + RTEMS.MESSAGE_QUEUE.SEND( + SPTEST.QUEUE_ID( 1 ), + BIG_SEND_BUFFER_POINTER, + RTEMS.UNSIGNED32( QUEUE_SIZE ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( + STATUS, "message_queue_send exact size" + ); + + -- now read and verify the message just sent + SIZE := INTERFACES.UNSIGNED_32(QUEUE_SIZE); + RTEMS.MESSAGE_QUEUE.RECEIVE( + SPTEST.QUEUE_ID( 1 ), + BIG_RECEIVE_BUFFER_POINTER, + RTEMS.DEFAULT_OPTIONS, + 1 * TEST_SUPPORT.TICKS_PER_SECOND, + SIZE, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( + STATUS, "message_queue_receive exact size" + ); + if SIZE /= RTEMS.UNSIGNED32( QUEUE_SIZE ) then + TEXT_IO.PUT( + "TA1 - exact size size match failed for queue_size = " + ); + UNSIGNED32_IO.PUT( + RTEMS.UNSIGNED32( QUEUE_SIZE ), WIDTH => 3, BASE => 10 + ); + TEXT_IO.NEW_LINE; + end if; + + if (BIG_SEND_BUFFER( BIG_SEND_BUFFER'FIRST .. Integer( SIZE )) /= + BIG_RECEIVE_BUFFER( BIG_RECEIVE_BUFFER'FIRST .. Integer( SIZE ))) + then + TEXT_IO.PUT_LINE("TA1 - exact size data match failed"); + end if; + + for I in Integer( SIZE + 1 ) .. BIG_RECEIVE_BUFFER'LAST loop + if BIG_RECEIVE_BUFFER( I ) /= CHARACTER'POS( 'Z' ) then + TEXT_IO.PUT_LINE("TA1 - exact size overrun match failed"); + end if; + end loop; + + -- all done with this one; delete it + RTEMS.MESSAGE_QUEUE.DELETE( SPTEST.QUEUE_ID( 1 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "message_queue_delete" ); + end loop; + + TEXT_IO.PUT_LINE( "*** END OF TEST 13 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end TASK_1; + +-- +-- TASK_2 +-- + + procedure TASK_2 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + BUFFER : SPTEST.BUFFER; + BUFFER_POINTER : RTEMS.ADDRESS; + PREVIOUS_PRIORITY : RTEMS.TASKS.PRIORITY; + MESSAGE_SIZE : RTEMS.UNSIGNED32 := 0; + STATUS : RTEMS.STATUS_CODES; + begin + + BUFFER_POINTER := BUFFER'ADDRESS; + + TEXT_IO.PUT_LINE( + "TA2 - message_queue_receive - receive from queue 1 - NO_WAIT" + ); + RTEMS.MESSAGE_QUEUE.RECEIVE( + SPTEST.QUEUE_ID( 1 ), + BUFFER_POINTER, + RTEMS.NO_WAIT, + RTEMS.NO_TIMEOUT, + MESSAGE_SIZE, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" ); + TEXT_IO.PUT( "TA2 - buffer received: " ); + SPTEST.PUT_BUFFER( BUFFER ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT_LINE( + "TA2 - message_queue_receive - receive from queue 1 - WAIT FOREVER" + ); + RTEMS.MESSAGE_QUEUE.RECEIVE( + SPTEST.QUEUE_ID( 1 ), + BUFFER_POINTER, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + MESSAGE_SIZE, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" ); + TEXT_IO.PUT( "TA2 - buffer received: " ); + SPTEST.PUT_BUFFER( BUFFER ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT_LINE( + "TA2 - message_queue_receive - receive from queue 1 - WAIT FOREVER" + ); + RTEMS.MESSAGE_QUEUE.RECEIVE( + SPTEST.QUEUE_ID( 1 ), + BUFFER_POINTER, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + MESSAGE_SIZE, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" ); + TEXT_IO.PUT( "TA2 - buffer received: " ); + SPTEST.PUT_BUFFER( BUFFER ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT_LINE( + "TA2 - task_set_priority - make self highest priority task" + ); + RTEMS.TASKS.SET_PRIORITY( + RTEMS.SELF, + 3, + PREVIOUS_PRIORITY, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" ); + + TEXT_IO.PUT_LINE( + "TA2 - message_queue_receive - receive from queue 2 - WAIT FOREVER" + ); + RTEMS.MESSAGE_QUEUE.RECEIVE( + SPTEST.QUEUE_ID( 2 ), + BUFFER_POINTER, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + MESSAGE_SIZE, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" ); + TEXT_IO.PUT( "TA2 - buffer received: " ); + SPTEST.PUT_BUFFER( BUFFER ); + TEXT_IO.NEW_LINE; + + SPTEST.FILL_BUFFER( "BUFFER 2 TO Q 2 ", BUFFER ); + TEXT_IO.PUT_LINE( "TA2 - message_queue_send - BUFFER 2 TO Q 2" ); + RTEMS.MESSAGE_QUEUE.SEND( + SPTEST.QUEUE_ID( 2 ), + BUFFER_POINTER, + 16, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); + + TEXT_IO.PUT_LINE( + "TA2 - message_queue_receive - receive from queue 1 - 10 second timeout" + ); + RTEMS.MESSAGE_QUEUE.RECEIVE( + SPTEST.QUEUE_ID( 1 ), + BUFFER_POINTER, + RTEMS.DEFAULT_OPTIONS, + 10 * TEST_SUPPORT.TICKS_PER_SECOND, + MESSAGE_SIZE, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" ); + TEXT_IO.PUT( "TA2 - buffer received: " ); + SPTEST.PUT_BUFFER( BUFFER ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT_LINE( + "TA2 - message_queue_receive - receive from queue 3 - WAIT FOREVER" + ); + RTEMS.MESSAGE_QUEUE.RECEIVE( + SPTEST.QUEUE_ID( 3 ), + BUFFER_POINTER, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + MESSAGE_SIZE, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" ); + TEXT_IO.PUT( "TA2 - buffer received: " ); + SPTEST.PUT_BUFFER( BUFFER ); + TEXT_IO.NEW_LINE; + + end TASK_2; + +-- +-- TASK_3 +-- + + procedure TASK_3 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + BUFFER : SPTEST.BUFFER; + BUFFER_POINTER : RTEMS.ADDRESS; + COUNT : RTEMS.UNSIGNED32; + MESSAGE_SIZE : RTEMS.UNSIGNED32 := 0; + STATUS : RTEMS.STATUS_CODES; + begin + + BUFFER_POINTER := BUFFER'ADDRESS; + + TEXT_IO.PUT_LINE( + "TA3 - message_queue_receive - receive from queue 2 - WAIT FOREVER" + ); + RTEMS.MESSAGE_QUEUE.RECEIVE( + SPTEST.QUEUE_ID( 2 ), + BUFFER_POINTER, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + MESSAGE_SIZE, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" ); + TEXT_IO.PUT( "TA3 - buffer received: " ); + SPTEST.PUT_BUFFER( BUFFER ); + TEXT_IO.NEW_LINE; + + SPTEST.FILL_BUFFER( "BUFFER 3 TO Q 1 ", BUFFER ); + TEXT_IO.PUT_LINE( "TA3 - message_queue_broadcast - BUFFER 3 TO Q 1" ); + RTEMS.MESSAGE_QUEUE.BROADCAST( + SPTEST.QUEUE_ID( 1 ), + BUFFER_POINTER, + 16, + COUNT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_BROADCAST" ); + TEXT_IO.PUT( "TA3 - number of tasks awakened = " ); + UNSIGNED32_IO.PUT( COUNT, WIDTH => 3, BASE => 10 ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT_LINE( + "TA3 - message_queue_receive - receive from queue 3 - WAIT FOREVER" + ); + RTEMS.MESSAGE_QUEUE.RECEIVE( + SPTEST.QUEUE_ID( 3 ), + BUFFER_POINTER, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + MESSAGE_SIZE, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" ); + TEXT_IO.PUT( "TA3 - buffer received: " ); + SPTEST.PUT_BUFFER( BUFFER ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT_LINE( "TA3 - task_delete - delete self" ); + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end TASK_3; + +end SPTEST; diff --git a/testsuites/ada/sptests/sp13/sptest.ads b/testsuites/ada/sptests/sp13/sptest.ads new file mode 100644 index 0000000000..9b92b3ba61 --- /dev/null +++ b/testsuites/ada/sptests/sp13/sptest.ads @@ -0,0 +1,134 @@ +-- +-- SPTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 13 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; + +package SPTEST is + +-- +-- Buffer Record similar to that used by RTEMS 3.2.1. Using this +-- avoids changes to the test. +-- + + type BUFFER is + record + FIELD1 : RTEMS.NAME; -- TEMPORARY UNTIL VARIABLE LENGTH + FIELD2 : RTEMS.NAME; + FIELD3 : RTEMS.NAME; + FIELD4 : RTEMS.NAME; + end record; + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS tasks created +-- by this test. +-- + + TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; + TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS message +-- queues created by this test. +-- + + QUEUE_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; + QUEUE_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- FILL_BUFFER +-- +-- DESCRIPTION: +-- +-- This subprogram takes the SOURCE input string and places +-- up to the first sixteen characters of that string into +-- the message BUFFER. +-- + + procedure FILL_BUFFER ( + SOURCE : in STRING; + BUFFER : out SPTEST.BUFFER + ); + +-- +-- PUT_BUFFER +-- +-- DESCRIPTION: +-- +-- This subprogram prints the specified message BUFFER. +-- + + procedure PUT_BUFFER ( + BUFFER : in SPTEST.BUFFER + ); + +-- +-- TASK_1 +-- +-- DESCRIPTION: +-- +-- This RTEMS task tests the Message Queue Manager. +-- + + procedure TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_1); + +-- +-- TASK_2 +-- +-- DESCRIPTION: +-- +-- This RTEMS task tests the Message Queue Manager. +-- + + procedure TASK_2 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_2); + +-- +-- TASK_3 +-- +-- DESCRIPTION: +-- +-- This RTEMS task tests the Message Queue Manager. +-- + + procedure TASK_3 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_3); + +end SPTEST; diff --git a/testsuites/ada/sptests/sp14/Makefile.am b/testsuites/ada/sptests/sp14/Makefile.am new file mode 100644 index 0000000000..501cd32ea1 --- /dev/null +++ b/testsuites/ada/sptests/sp14/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_sp14 +ada_sp14_SOURCES = sp14.adb config.h sptest.adb sptest.ads +ada_sp14_SOURCES += ../../support/init.c + +ada_sp14$(EXEEXT): sp14.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_sp14.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/sptests/sp14/ada_sp14.scn b/testsuites/ada/sptests/sp14/ada_sp14.scn new file mode 100644 index 0000000000..09b33721ef --- /dev/null +++ b/testsuites/ada/sptests/sp14/ada_sp14.scn @@ -0,0 +1,33 @@ +*** TEST 14 *** +TA1 - signal_catch - INTERRUPT_LEVEL( 3 ) +TA1 - signal_send - SIGNAL_16 to self +ASR - ENTRY - signal => 16#10000# +ASR - EXIT - signal => 16#10000# +TA1 - signal_send - SIGNAL_0 to self +ASR - ENTRY - signal => 16#1# +ASR - task_wake_after - yield processor +TA2 - signal_send - SIGNAL_17 to TA1 +TA2 - task_wake_after - yield processor +ASR - ENTRY - signal => 16#20000# +ASR - EXIT - signal => 16#20000# +ASR - EXIT - signal => 16#1# +TA1 - signal_catch - NO_ASR + +TA1 - signal_send - SIGNAL_1 to self +ASR - ENTRY - signal => 16#2# +ASR - task_wake_after - yield processor +TA2 - signal_send - SIGNAL_18 and SIGNAL_19 to TA1 +TA2 - task_wake_after - yield processor +ASR - EXIT - signal => 16#2# +ASR - ENTRY - signal => 16#C0000# +ASR - EXIT - signal => 16#C0000# +TA1 - task_mode - disable ASRs +TA1 - sending signal to SELF from timer +TA1 - waiting for signal to arrive +TA1 - timer routine got the correct arguments +TA1 - task_mode - enable ASRs +ASR - ENTRY - signal => 16#8# +ASR - EXIT - signal => 16#8# +TA1 - signal_catch - ASR ADDRESS of NULL +TA1 - task_delete - delete self +*** END OF TEST 14 *** diff --git a/testsuites/ada/sptests/sp14/config.h b/testsuites/ada/sptests/sp14/config.h new file mode 100644 index 0000000000..2c046d6db3 --- /dev/null +++ b/testsuites/ada/sptests/sp14/config.h @@ -0,0 +1,32 @@ +/* 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 3 +#define CONFIGURE_MAXIMUM_TIMERS 1 +#define CONFIGURE_TICKS_PER_TIMESLICE 100 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/sptests/sp14/sp14.adb b/testsuites/ada/sptests/sp14/sp14.adb new file mode 100644 index 0000000000..2149694ecc --- /dev/null +++ b/testsuites/ada/sptests/sp14/sp14.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test SP14 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 SP14 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 SP14; + diff --git a/testsuites/ada/sptests/sp14/sptest.adb b/testsuites/ada/sptests/sp14/sptest.adb new file mode 100644 index 0000000000..3b74c9f256 --- /dev/null +++ b/testsuites/ada/sptests/sp14/sptest.adb @@ -0,0 +1,325 @@ +-- +-- SPTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 14 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 INTERFACES; use INTERFACES; +with RTEMS.TIMER; +with RTEMS.SIGNAL; + +package body SPTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TEST 14 ***" ); + + SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); + SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 1 ), + 1, + RTEMS.MINIMUM_STACK_SIZE * 2, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 2 ), + 1, + RTEMS.MINIMUM_STACK_SIZE * 2, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 2 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 1 ), + SPTEST.TASK_1'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 2 ), + SPTEST.TASK_2'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" ); + + SPTEST.TIMER_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'M', '1', ' ' ); + + RTEMS.TIMER.CREATE( + SPTEST.TIMER_NAME( 1 ), + SPTEST.TIMER_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE OF TM1" ); + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- SIGNAL_3_TO_TASK_1 +-- + + procedure SIGNAL_3_TO_TASK_1 ( + ID : in RTEMS.ID; + POINTER : in RTEMS.ADDRESS + ) is + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.SIGNAL.SEND( SPTEST.TASK_ID( 1 ), RTEMS.SIGNAL_3, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SIGNAL_SEND of 3" ); + + SPTEST.TIMER_GOT_THIS_ID := ID; + SPTEST.TIMER_GOT_THIS_POINTER := POINTER; + + SPTEST.SIGNAL_SENT := TRUE; + + end SIGNAL_3_TO_TASK_1; + +-- +-- TASK_1 +-- + + procedure TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + PREVIOUS_MODE : RTEMS.MODE; + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.PUT_LINE( "TA1 - signal_catch - INTERRUPT_LEVEL( 3 )" ); + RTEMS.SIGNAL.CATCH( + SPTEST.PROCESS_ASR'ACCESS, + RTEMS.INTERRUPT_LEVEL( 3 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SIGNAL_CATCH INTERRUPT(3)" ); + + TEXT_IO.PUT_LINE( "TA1 - signal_send - SIGNAL_16 to self" ); + RTEMS.SIGNAL.SEND( RTEMS.SELF, RTEMS.SIGNAL_16, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( + STATUS, + "SIGNAL_SEND - SIGNAL_16 to SELF" + ); + + TEXT_IO.PUT_LINE( "TA1 - signal_send - SIGNAL_0 to self" ); + RTEMS.SIGNAL.SEND( RTEMS.SELF, RTEMS.SIGNAL_0, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( + STATUS, + "SIGNAL_SEND - SIGNAL_0 to SELF" + ); + + TEXT_IO.PUT_LINE( "TA1 - signal_catch - NO_ASR" ); + RTEMS.SIGNAL.CATCH(SPTEST.PROCESS_ASR'ACCESS, RTEMS.NO_ASR, STATUS); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SIGNAL_CATCH - NO_ASR" ); + + TEST_SUPPORT.PAUSE; + + TEXT_IO.PUT_LINE( "TA1 - signal_send - SIGNAL_1 to self" ); + RTEMS.SIGNAL.SEND( RTEMS.SELF, RTEMS.SIGNAL_1, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( + STATUS, + "SIGNAL_SEND - SIGNAL_1 to SELF" + ); + + TEXT_IO.PUT_LINE( "TA1 - task_mode - disable ASRs" ); + RTEMS.TASKS.MODE( + RTEMS.NO_ASR, + RTEMS.ASR_MASK, + PREVIOUS_MODE, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); + + SPTEST.TIMER_GOT_THIS_ID := 0; + SPTEST.TIMER_GOT_THIS_POINTER := RTEMS.NULL_ADDRESS; + + TEXT_IO.PUT_LINE( "TA1 - sending signal to SELF from timer" ); + RTEMS.TIMER.FIRE_AFTER( + SPTEST.TIMER_ID( 1 ), + TEST_SUPPORT.TICKS_PER_SECOND / 2, + SPTEST.SIGNAL_3_TO_TASK_1'ACCESS, + SPTEST.TASK_1'ADDRESS, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER" ); + + TEXT_IO.PUT_LINE( "TA1 - waiting for signal to arrive" ); + + SPTEST.SIGNAL_SENT := FALSE; + SPTEST.ASR_FIRED := FALSE; + + loop + exit when SPTEST.SIGNAL_SENT; + end loop; + + if SPTEST.TIMER_GOT_THIS_ID = SPTEST.TIMER_ID( 1 ) and then + RTEMS.ARE_EQUAL(SPTEST.TIMER_GOT_THIS_POINTER, + SPTEST.TASK_1'ADDRESS) then + + TEXT_IO.PUT_LINE( "TA1 - timer routine got the correct arguments" ); + + else + + TEXT_IO.PUT( "TA1 - timer got (" ); + UNSIGNED32_IO.PUT( SPTEST.TIMER_GOT_THIS_ID ); + TEXT_IO.PUT( "," ); + ADDRESS_IO.PUT( SPTEST.TIMER_GOT_THIS_POINTER ); + TEXT_IO.PUT( ") instead of (" ); + UNSIGNED32_IO.PUT( SPTEST.TIMER_ID( 1 ) ); + TEXT_IO.PUT( "," ); + ADDRESS_IO.PUT( SPTEST.TASK_1'ADDRESS ); + TEXT_IO.PUT_LINE( ")!!!!" ); + + end if; + + TEXT_IO.PUT_LINE( "TA1 - task_mode - enable ASRs" ); + RTEMS.TASKS.MODE( + RTEMS.ASR, + RTEMS.ASR_MASK, + PREVIOUS_MODE, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); + + TEXT_IO.PUT_LINE( "TA1 - signal_catch - ASR ADDRESS of NULL" ); + RTEMS.SIGNAL.CATCH( NULL, RTEMS.DEFAULT_MODES, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( + STATUS, + "SIGNAL_CATCH - NULL ADDRESS" + ); + + TEXT_IO.PUT_LINE( "TA1 - task_delete - delete self" ); + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end TASK_1; + +-- +-- TASK_2 +-- + + procedure TASK_2 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.PUT_LINE( "TA2 - signal_send - SIGNAL_17 to TA1" ); + RTEMS.SIGNAL.SEND( SPTEST.TASK_ID( 1 ), RTEMS.SIGNAL_17, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( + STATUS, + "SIGNAL_SEND - SIGNAL_17 to TA1" + ); + + TEXT_IO.PUT_LINE( "TA2 - task_wake_after - yield processor" ); + RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER YIELD" ); + + TEXT_IO.PUT_LINE( + "TA2 - signal_send - SIGNAL_18 and SIGNAL_19 to TA1" + ); + RTEMS.SIGNAL.SEND( + SPTEST.TASK_ID( 1 ), + RTEMS.SIGNAL_18 + RTEMS.SIGNAL_19, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( + STATUS, + "SIGNAL_SEND - SIGNAL_18 and SIGNAL_19 to TA1" + ); + + TEXT_IO.PUT_LINE( "TA2 - task_wake_after - yield processor" ); + RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER YIELD" ); + + TEXT_IO.PUT_LINE( "*** END OF TEST 14 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end TASK_2; + +-- +-- PROCESS_ASR +-- + + procedure PROCESS_ASR ( + THE_SIGNAL_SET : in RTEMS.SIGNAL_SET + ) is + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.PUT( "ASR - ENTRY - signal => " ); + UNSIGNED32_IO.PUT( THE_SIGNAL_SET, BASE => 16, WIDTH => 8 ); + TEXT_IO.NEW_LINE; + + if THE_SIGNAL_SET = RTEMS.SIGNAL_16 or else + THE_SIGNAL_SET = RTEMS.SIGNAL_17 or else + THE_SIGNAL_SET = RTEMS.SIGNAL_18 + RTEMS.SIGNAL_19 then + NULL; + + elsif THE_SIGNAL_SET = RTEMS.SIGNAL_0 or else + THE_SIGNAL_SET = RTEMS.SIGNAL_1 then + TEXT_IO.PUT_LINE( "ASR - task_wake_after - yield processor" ); + RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( + STATUS, + "TASK_WAKE_AFTER YIELD" + ); + + elsif THE_SIGNAL_SET = RTEMS.SIGNAL_3 then + + SPTEST.ASR_FIRED := TRUE; + + end if; + + TEXT_IO.PUT( "ASR - EXIT - signal => " ); + UNSIGNED32_IO.PUT( THE_SIGNAL_SET, BASE => 16, WIDTH => 8 ); + TEXT_IO.NEW_LINE; + + end PROCESS_ASR; + +end SPTEST; diff --git a/testsuites/ada/sptests/sp14/sptest.ads b/testsuites/ada/sptests/sp14/sptest.ads new file mode 100644 index 0000000000..ecf6f93dff --- /dev/null +++ b/testsuites/ada/sptests/sp14/sptest.ads @@ -0,0 +1,134 @@ +-- +-- SPTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 14 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; + +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 .. 2 ) of RTEMS.ID; + TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME; + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS timers created +-- by this test. +-- + + TIMER_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID; + TIMER_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME; + +-- +-- SIGNAL_SENT is set to TRUE to indicate that a signal set has +-- been sent from an ISR to the executing task. +-- + + SIGNAL_SENT : BOOLEAN; + pragma volatile( SIGNAL_SENT ); + +-- +-- These hold the arguments passed to the timer service routine. +-- + + TIMER_GOT_THIS_ID : RTEMS.ID; + pragma volatile( TIMER_GOT_THIS_ID ); + + TIMER_GOT_THIS_POINTER : RTEMS.ADDRESS; + pragma volatile( TIMER_GOT_THIS_POINTER ); + +-- +-- ASR_FIRED is set to TRUE to indicate that the ASR has executed +-- and was passed the correct signal set. +-- + + ASR_FIRED : BOOLEAN; + pragma volatile( ASR_FIRED ); + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- SIGNAL_3_TO_TASK_1 +-- +-- DESCRIPTION: +-- +-- This subprogram sends signal 3 to TASK_1. +-- + + procedure SIGNAL_3_TO_TASK_1 ( + ID : in RTEMS.ID; + POINTER : in RTEMS.ADDRESS + ); + pragma Convention (C, SIGNAL_3_TO_TASK_1); + +-- +-- PROCESS_ASR +-- +-- DESCRIPTION: +-- +-- This subprogram is an ASR for TASK_1. +-- + + procedure PROCESS_ASR ( + THE_SIGNAL_SET : in RTEMS.SIGNAL_SET + ); + pragma Convention (C, PROCESS_ASR); + +-- +-- TASK_1 +-- +-- DESCRIPTION: +-- +-- This RTEMS task tests the Signal Manager. +-- + + procedure TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_1); + +-- +-- TASK_2 +-- +-- DESCRIPTION: +-- +-- This RTEMS task tests the Signal Manager. +-- + + procedure TASK_2 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_2); + +end SPTEST; diff --git a/testsuites/ada/sptests/sp15/Makefile.am b/testsuites/ada/sptests/sp15/Makefile.am new file mode 100644 index 0000000000..e1fe83bcd5 --- /dev/null +++ b/testsuites/ada/sptests/sp15/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_sp15 +ada_sp15_SOURCES = sp15.adb config.h sptest.adb sptest.ads +ada_sp15_SOURCES += ../../support/init.c + +ada_sp15$(EXEEXT): sp15.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_sp15.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/sptests/sp15/ada_sp15.scn b/testsuites/ada/sptests/sp15/ada_sp15.scn new file mode 100644 index 0000000000..9c9e68f3d7 --- /dev/null +++ b/testsuites/ada/sptests/sp15/ada_sp15.scn @@ -0,0 +1,16 @@ +*** TEST 15 *** +INIT - partition_create - partition 1 +INIT - partition_create - partition 2 +TA1 - partition_ident - partition 1 id = 16#2A010001# +TA1 - partition_ident - partition 2 id = 16#2A010002# +TA1 - partition_get_buffer - get buffer 1 from partition 1 - 16#0# +TA1 - partition_get_buffer - get buffer 2 from partition 1 - 16#200# +TA1 - partition_get_buffer - get buffer 1 from partition 2 - 16#0# +TA1 - partition_get_buffer - get buffer 2 from partition 2 - 16#80# +TA1 - partition_return_buffer - return buffer 1 to partition 1 - 16#0# +TA1 - partition_return_buffer - return buffer 2 to partition 1 - 16#200# +TA1 - partition_return_buffer - return buffer 1 to partition 2 - 16#0# +TA1 - partition_return_buffer - return buffer 2 to partition 2 - 16#80# +TA1 - partition_delete - delete partition 1 +TA1 - partition_delete - delete partition 2 +*** END OF TEST 15 *** diff --git a/testsuites/ada/sptests/sp15/config.h b/testsuites/ada/sptests/sp15/config.h new file mode 100644 index 0000000000..7774f3563c --- /dev/null +++ b/testsuites/ada/sptests/sp15/config.h @@ -0,0 +1,32 @@ +/* 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_PARTITIONS 2 +#define CONFIGURE_TICKS_PER_TIMESLICE 100 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/sptests/sp15/sp15.adb b/testsuites/ada/sptests/sp15/sp15.adb new file mode 100644 index 0000000000..77e8f27144 --- /dev/null +++ b/testsuites/ada/sptests/sp15/sp15.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test SP15 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 SP15 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 SP15; + diff --git a/testsuites/ada/sptests/sp15/sptest.adb b/testsuites/ada/sptests/sp15/sptest.adb new file mode 100644 index 0000000000..39e887dd2f --- /dev/null +++ b/testsuites/ada/sptests/sp15/sptest.adb @@ -0,0 +1,278 @@ +-- +-- SPTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 15 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 TEST_SUPPORT; +with TEXT_IO; +with UNSIGNED32_IO; +with RTEMS.PARTITION; + +package body SPTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TEST 15 ***" ); + + SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); + + SPTEST.PARTITION_NAME( 1 ) := RTEMS.BUILD_NAME( 'P', 'T', '1', ' ' ); + SPTEST.PARTITION_NAME( 2 ) := RTEMS.BUILD_NAME( 'P', 'T', '2', ' ' ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 1 ), + 4, + 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" ); + + TEXT_IO.PUT_LINE( "INIT - partition_create - partition 1" ); + RTEMS.PARTITION.CREATE( + SPTEST.PARTITION_NAME( 1 ), + AREA_1'ADDRESS, + 4096, + 512, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.PARTITION_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_CREATE OF PT1" ); + + TEXT_IO.PUT_LINE( "INIT - partition_create - partition 2" ); + RTEMS.PARTITION.CREATE( + SPTEST.PARTITION_NAME( 2 ), + AREA_2'ADDRESS, + 274, + 128, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.PARTITION_ID( 2 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_CREATE OF PT2" ); + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- PUT_ADDRESS_FROM_AREA_1 +-- + + procedure PUT_ADDRESS_FROM_AREA_1 ( + TO_BE_PRINTED : in RTEMS.ADDRESS + ) is + + begin + + UNSIGNED32_IO.PUT( + RTEMS.SUBTRACT( TO_BE_PRINTED, SPTEST.AREA_1'ADDRESS ), + WIDTH => 8, + BASE => 16 + ); + + end PUT_ADDRESS_FROM_AREA_1; + +-- +-- PUT_ADDRESS_FROM_AREA_2 +-- + + procedure PUT_ADDRESS_FROM_AREA_2 ( + TO_BE_PRINTED : in RTEMS.ADDRESS + ) is + begin + + UNSIGNED32_IO.PUT( + RTEMS.SUBTRACT( TO_BE_PRINTED, SPTEST.AREA_2'ADDRESS ), + WIDTH => 8, + BASE => 16 + ); + + end PUT_ADDRESS_FROM_AREA_2; + +-- +-- TASK_1 +-- + + procedure TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + PTID_1 : RTEMS.ID; + PTID_2 : RTEMS.ID; + BUFFER_ADDRESS_1 : RTEMS.ADDRESS; + BUFFER_ADDRESS_2 : RTEMS.ADDRESS; + BUFFER_ADDRESS_3 : RTEMS.ADDRESS; + BUFFER_ADDRESS_4 : RTEMS.ADDRESS; + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.PUT( "TA1 - partition_ident - partition 1 id = " ); + RTEMS.PARTITION.IDENT( + SPTEST.PARTITION_NAME( 1 ), + RTEMS.SEARCH_ALL_NODES, + PTID_1, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_IDENT OF PT1" ); + UNSIGNED32_IO.PUT( PTID_1, WIDTH => 8, BASE => 16 ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT( "TA1 - partition_ident - partition 2 id = " ); + RTEMS.PARTITION.IDENT( + SPTEST.PARTITION_NAME( 2 ), + RTEMS.SEARCH_ALL_NODES, + PTID_2, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_IDENT OF PT2" ); + UNSIGNED32_IO.PUT( PTID_2, WIDTH => 8, BASE => 16 ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT( + "TA1 - partition_get_buffer - get buffer 1 from partition 1 - " + ); + RTEMS.PARTITION.GET_BUFFER( + SPTEST.PARTITION_ID( 1 ), + BUFFER_ADDRESS_1, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_GET_BUFFER" ); + SPTEST.PUT_ADDRESS_FROM_AREA_1( BUFFER_ADDRESS_1 ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT( + "TA1 - partition_get_buffer - get buffer 2 from partition 1 - " + ); + RTEMS.PARTITION.GET_BUFFER( + SPTEST.PARTITION_ID( 1 ), + BUFFER_ADDRESS_2, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_GET_BUFFER" ); + SPTEST.PUT_ADDRESS_FROM_AREA_1( BUFFER_ADDRESS_2 ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT( + "TA1 - partition_get_buffer - get buffer 1 from partition 2 - " + ); + RTEMS.PARTITION.GET_BUFFER( + SPTEST.PARTITION_ID( 2 ), + BUFFER_ADDRESS_3, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_GET_BUFFER" ); + SPTEST.PUT_ADDRESS_FROM_AREA_2( BUFFER_ADDRESS_3 ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT( + "TA1 - partition_get_buffer - get buffer 2 from partition 2 - " + ); + RTEMS.PARTITION.GET_BUFFER( + SPTEST.PARTITION_ID( 2 ), + BUFFER_ADDRESS_4, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_GET_BUFFER" ); + SPTEST.PUT_ADDRESS_FROM_AREA_2( BUFFER_ADDRESS_4 ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT( + "TA1 - partition_return_buffer - return buffer 1 to partition 1 - " + ); + SPTEST.PUT_ADDRESS_FROM_AREA_1( BUFFER_ADDRESS_1 ); + TEXT_IO.NEW_LINE; + RTEMS.PARTITION.RETURN_BUFFER( + SPTEST.PARTITION_ID( 1 ), + BUFFER_ADDRESS_1, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_RETURN_BUFFER" ); + + TEXT_IO.PUT( + "TA1 - partition_return_buffer - return buffer 2 to partition 1 - " + ); + SPTEST.PUT_ADDRESS_FROM_AREA_1( BUFFER_ADDRESS_2 ); + TEXT_IO.NEW_LINE; + RTEMS.PARTITION.RETURN_BUFFER( + SPTEST.PARTITION_ID( 1 ), + BUFFER_ADDRESS_2, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_RETURN_BUFFER" ); + + TEXT_IO.PUT( + "TA1 - partition_return_buffer - return buffer 1 to partition 2 - " + ); + SPTEST.PUT_ADDRESS_FROM_AREA_2( BUFFER_ADDRESS_3 ); + TEXT_IO.NEW_LINE; + RTEMS.PARTITION.RETURN_BUFFER( + SPTEST.PARTITION_ID( 2 ), + BUFFER_ADDRESS_3, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_RETURN_BUFFER" ); + + TEXT_IO.PUT( + "TA1 - partition_return_buffer - return buffer 2 to partition 2 - " + ); + SPTEST.PUT_ADDRESS_FROM_AREA_2( BUFFER_ADDRESS_4 ); + TEXT_IO.NEW_LINE; + RTEMS.PARTITION.RETURN_BUFFER( + SPTEST.PARTITION_ID( 2 ), + BUFFER_ADDRESS_4, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_RETURN_BUFFER" ); + + TEXT_IO.PUT_LINE( "TA1 - partition_delete - delete partition 1" ); + RTEMS.PARTITION.DELETE( SPTEST.PARTITION_ID( 1 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_DELETE OF SELF" ); + + TEXT_IO.PUT_LINE( "TA1 - partition_delete - delete partition 2" ); + RTEMS.PARTITION.DELETE( SPTEST.PARTITION_ID( 2 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_DELETE OF SELF" ); + + TEXT_IO.PUT_LINE( "*** END OF TEST 15 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end TASK_1; + +end SPTEST; diff --git a/testsuites/ada/sptests/sp15/sptest.ads b/testsuites/ada/sptests/sp15/sptest.ads new file mode 100644 index 0000000000..5af0e61503 --- /dev/null +++ b/testsuites/ada/sptests/sp15/sptest.ads @@ -0,0 +1,118 @@ +-- +-- SPTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 15 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; + +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 .. 3 ) of RTEMS.ID; + TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS partitions created +-- by this test. +-- + + PARTITION_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; + PARTITION_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; + +-- +-- These arrays define the memory areas used for the partitions in +-- this test. +-- + + AREA_1 : array ( RTEMS.UNSIGNED32 range 0 .. 4095 ) of RTEMS.UNSIGNED8; + for AREA_1'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT; + + AREA_2 : array ( RTEMS.UNSIGNED32 range 0 .. 273 ) of RTEMS.UNSIGNED8; + for AREA_2'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT; + + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- PUT_ADDRESS_FROM_AREA_1 +-- +-- DESCRIPTION: +-- +-- This subpgram prints the offset of the address TO_BE_PRINTED +-- from the first byte of AREA_1. +-- +-- NOTE: +-- +-- This subprogram is used because the actual address of AREA_1 +-- varies based upon the size of the executable, the target board, +-- and the target processor. +-- + + procedure PUT_ADDRESS_FROM_AREA_1 ( + TO_BE_PRINTED : in RTEMS.ADDRESS + ); + +-- +-- PUT_ADDRESS_FROM_AREA_2 +-- +-- DESCRIPTION: +-- +-- This subprogram prints the offset of the address TO_BE_PRINTED +-- from the first byte of AREA_2. +-- +-- NOTE: +-- +-- This subprogram is used because the actual address of AREA_1 +-- varies based upon the size of the executable, the target board, +-- and the target processor. +-- + + procedure PUT_ADDRESS_FROM_AREA_2 ( + TO_BE_PRINTED : in RTEMS.ADDRESS + ); + +-- +-- TASK_1 +-- +-- DESCRIPTION: +-- +-- This RTEMS task tests the Partition Manager. +-- + + procedure TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_1); + +end SPTEST; diff --git a/testsuites/ada/sptests/sp16/Makefile.am b/testsuites/ada/sptests/sp16/Makefile.am new file mode 100644 index 0000000000..4959ca2d62 --- /dev/null +++ b/testsuites/ada/sptests/sp16/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_sp16 +ada_sp16_SOURCES = sp16.adb config.h sptest.adb sptest.ads +ada_sp16_SOURCES += ../../support/init.c + +ada_sp16$(EXEEXT): sp16.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_sp16.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/sptests/sp16/ada_sp16.scn b/testsuites/ada/sptests/sp16/ada_sp16.scn new file mode 100644 index 0000000000..928dc4a9cf --- /dev/null +++ b/testsuites/ada/sptests/sp16/ada_sp16.scn @@ -0,0 +1,58 @@ +*** TEST 16 *** +TA1 - region_ident - rnid => 16#32010001# +TA1 - region_get_segment - wait on 100 byte segment from region 2 +TA1 - got segment from region 2 - 16#70# +TA1 - region_get_segment - wait on 3K segment from region 3 +TA1 - got segment from region 3 - 16#70# +TA1 - region_get_segment - get 3080 byte segment from region 1 - NO_WAIT +TA1 - got segment from region 1 - 16#60# +TA1 - task_wake_after - yield processor +TA2 - region_get_segment - wait on 2K segment from region 1 +TA3 - region_get_segment - wait on 3950 byte segment from region 2 + +TA1 - region_return_segment - return segment to region 1 - 16#60# +TA1 - region_get_segment - wait 10 seconds for 3K segment from region 1 +TA2 - got segment from region 1 - 16#60# +TA2 - region_return_segment - return segment to region 1 - 16#60# +TA2 - task_set_priority - make self highest priority task +TA2 - region_get_segment - wait on 3950 byte segment from region 2 +TA1 - got segment from region 1 - 16#60# +TA1 - region_return_segment - return segment to region 2 - 16#70# +TA2 - got segment from region 2 - 16#70# +TA2 - region_return_segment - return segment to region 2 - 16#70# +TA2 - task_delete - delete self +TA1 - task_wake_after - yield processor +TA3 - got segment from region 2 - 16#70# +TA3 - region_get_segment - wait on 2K segment from region 3 +TA1 - task_delete - delete TA3 + +TA1 - task_wake_after - yield processor +TA4 - region_get_segment - wait on 1.5K segment from region 1 +TA5 - region_get_segment - wait on 1.5K segment from region 1 +TA1 - region_return_segment - return segment to region 1 - 16#60# +TA1 - task_wake_after - yield processor +TA4 - got and returned 16#60# +TA5 - got and returned 16#6E0# +TA1 - region_get_segment - wait 10 seconds for 3K segment from region 1 +TA1 - got segment from region 1 - 16#60# +TA1 - task_wake_after - yield processor +TA5 - region_get_segment - wait on 3K segment from region 1 +TA4 - region_get_segment - wait on 3K segment from region 1 +TA1 - task_delete - delete TA4 +TA1 - region_return_segment - return segment to region 1 - 16#60# +TA1 - task_wake_after - yield processor +TA5 - got segment from region 1 - 16#60# +TA5 - region_return_segment - return segment to region 1 - 16#60# +TA5 - task_delete - delete self +TA1 - region_delete - delete region 1 +TA1 - region_get_segment - get 3K segment from region 4 +TA1 - got segment from region 4 - 16#70# +TA1 - region_get_segment - attempt to get 3K segment from region 4 +TA1 - task_get_note - UNSATISFIED +TA1 - region_extend - extend region 4 by 4K +TA1 - region_get_segment - attempt to get 3K segment from region 4 +TA1 - got 3K segment from region 4 - 16#CF0# +TA1 - return_segment - return segment to region 4 - 16#70# +TA1 - region_return_segment - return segment to region 4 - 16#CF0# +TA1 - region_delete - delete region 4 +*** END OF TEST 16 *** diff --git a/testsuites/ada/sptests/sp16/config.h b/testsuites/ada/sptests/sp16/config.h new file mode 100644 index 0000000000..087a4c5a49 --- /dev/null +++ b/testsuites/ada/sptests/sp16/config.h @@ -0,0 +1,32 @@ +/* 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 4 +#define CONFIGURE_MAXIMUM_REGIONS 4 +#define CONFIGURE_TICKS_PER_TIMESLICE 100 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/sptests/sp16/sp16.adb b/testsuites/ada/sptests/sp16/sp16.adb new file mode 100644 index 0000000000..4280c67665 --- /dev/null +++ b/testsuites/ada/sptests/sp16/sp16.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test SP16 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 SP16 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 SP16; + diff --git a/testsuites/ada/sptests/sp16/sptest.adb b/testsuites/ada/sptests/sp16/sptest.adb new file mode 100644 index 0000000000..a62eedd104 --- /dev/null +++ b/testsuites/ada/sptests/sp16/sptest.adb @@ -0,0 +1,789 @@ +-- +-- SPTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 16 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 INTERFACES; use INTERFACES; +with TEST_SUPPORT; +with TEXT_IO; +with UNSIGNED32_IO; +with RTEMS.REGION; + +package body SPTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TEST 16 ***" ); + + SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); + SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' ); + SPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' ); + SPTEST.TASK_NAME( 4 ) := RTEMS.BUILD_NAME( 'T', 'A', '4', ' ' ); + SPTEST.TASK_NAME( 5 ) := RTEMS.BUILD_NAME( 'T', 'A', '5', ' ' ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 1 ), + SPTEST.BASE_PRIORITY, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 2 ), + SPTEST.BASE_PRIORITY, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 2 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 3 ), + SPTEST.BASE_PRIORITY, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 3 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA3" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 1 ), + SPTEST.TASK_1'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 2 ), + SPTEST.TASK_2'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 3 ), + SPTEST.TASK_3'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA3" ); + + SPTEST.REGION_NAME( 1 ) := RTEMS.BUILD_NAME( 'R', 'N', '1', ' ' ); + SPTEST.REGION_NAME( 2 ) := RTEMS.BUILD_NAME( 'R', 'N', '2', ' ' ); + SPTEST.REGION_NAME( 3 ) := RTEMS.BUILD_NAME( 'R', 'N', '3', ' ' ); + SPTEST.REGION_NAME( 4 ) := RTEMS.BUILD_NAME( 'R', 'N', '4', ' ' ); + + RTEMS.REGION.CREATE( + SPTEST.REGION_NAME( 1 ), + SPTEST.AREA_1'ADDRESS, + 4096, + 128, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.REGION_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_CREATE OF RN1" ); + + RTEMS.REGION.CREATE( + SPTEST.REGION_NAME( 2 ), + SPTEST.AREA_2'ADDRESS, + 4096, + 128, + RTEMS.PRIORITY, + SPTEST.REGION_ID( 2 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_CREATE OF RN2" ); + + RTEMS.REGION.CREATE( + SPTEST.REGION_NAME( 3 ), + SPTEST.AREA_3'ADDRESS, + 4096, + 128, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.REGION_ID( 3 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_CREATE OF RN3" ); + + RTEMS.REGION.CREATE( + SPTEST.REGION_NAME( 4 ), + SPTEST.AREA_4'ADDRESS, + 4096, + 128, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.REGION_ID( 4 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_CREATE OF RN4" ); + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- PUT_ADDRESS_FROM_AREA_1 +-- + + procedure PUT_ADDRESS_FROM_AREA_1 ( + TO_BE_PRINTED : in RTEMS.ADDRESS + ) is + + begin + + UNSIGNED32_IO.PUT( + RTEMS.SUBTRACT( TO_BE_PRINTED, SPTEST.AREA_1'ADDRESS ), + WIDTH => 8, + BASE => 16 + ); + + end PUT_ADDRESS_FROM_AREA_1; + +-- +-- PUT_ADDRESS_FROM_AREA_2 +-- + + procedure PUT_ADDRESS_FROM_AREA_2 ( + TO_BE_PRINTED : in RTEMS.ADDRESS + ) is + begin + + UNSIGNED32_IO.PUT( + RTEMS.SUBTRACT( TO_BE_PRINTED, SPTEST.AREA_2'ADDRESS ), + WIDTH => 8, + BASE => 16 + ); + + end PUT_ADDRESS_FROM_AREA_2; + +-- +-- PUT_ADDRESS_FROM_AREA_3 +-- + + procedure PUT_ADDRESS_FROM_AREA_3 ( + TO_BE_PRINTED : in RTEMS.ADDRESS + ) is + begin + + UNSIGNED32_IO.PUT( + RTEMS.SUBTRACT( TO_BE_PRINTED, SPTEST.AREA_3'ADDRESS ), + WIDTH => 8, + BASE => 16 + ); + + end PUT_ADDRESS_FROM_AREA_3; + +-- +-- PUT_ADDRESS_FROM_AREA_4 +-- + + procedure PUT_ADDRESS_FROM_AREA_4 ( + TO_BE_PRINTED : in RTEMS.ADDRESS + ) is + begin + + UNSIGNED32_IO.PUT( + RTEMS.SUBTRACT( TO_BE_PRINTED, SPTEST.AREA_4'ADDRESS ), + WIDTH => 8, + BASE => 16 + ); + + end PUT_ADDRESS_FROM_AREA_4; + +-- +-- TASK_1 +-- + + procedure TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + RNID : RTEMS.ID; + SEGMENT_ADDRESS_1 : RTEMS.ADDRESS; + SEGMENT_ADDRESS_2 : RTEMS.ADDRESS; + SEGMENT_ADDRESS_3 : RTEMS.ADDRESS; + SEGMENT_ADDRESS_4 : RTEMS.ADDRESS; + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.REGION.IDENT( SPTEST.REGION_NAME( 1 ), RNID, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_IDENT OF RN1" ); + TEXT_IO.PUT( "TA1 - region_ident - rnid => " ); + UNSIGNED32_IO.PUT( RNID, WIDTH => 8, BASE => 16 ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT( "TA1 - region_get_segment - wait on " ); + TEXT_IO.PUT_LINE( "100 byte segment from region 2" ); + RTEMS.REGION.GET_SEGMENT( + SPTEST.REGION_ID( 2 ), + 100, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + SEGMENT_ADDRESS_1, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); + TEXT_IO.PUT( "TA1 - got segment from region 2 - " ); + SPTEST.PUT_ADDRESS_FROM_AREA_2( SEGMENT_ADDRESS_1 ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT( "TA1 - region_get_segment - wait on " ); + TEXT_IO.PUT_LINE( "3K segment from region 3" ); + RTEMS.REGION.GET_SEGMENT( + SPTEST.REGION_ID( 3 ), + 3072, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + SEGMENT_ADDRESS_2, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); + TEXT_IO.PUT( "TA1 - got segment from region 3 - " ); + SPTEST.PUT_ADDRESS_FROM_AREA_3( SEGMENT_ADDRESS_2 ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT( "TA1 - region_get_segment - get 3080 byte segment " ); + TEXT_IO.PUT_LINE( "from region 1 - NO_WAIT" ); + RTEMS.REGION.GET_SEGMENT( + SPTEST.REGION_ID( 1 ), + 3080, + RTEMS.NO_WAIT, + RTEMS.NO_TIMEOUT, + SEGMENT_ADDRESS_3, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); + TEXT_IO.PUT( "TA1 - got segment from region 1 - " ); + SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_3 ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT_LINE( "TA1 - task_wake_after - yield processor" ); + RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + +TEST_SUPPORT.PAUSE; + + TEXT_IO.PUT( + "TA1 - region_return_segment - return segment to region 1 - " + ); + SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_3 ); + RTEMS.REGION.RETURN_SEGMENT( + SPTEST.REGION_ID( 1 ), + SEGMENT_ADDRESS_3, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT( "TA1 - region_get_segment - wait 10 seconds for 3K " ); + TEXT_IO.PUT_LINE( "segment from region 1" ); + RTEMS.REGION.GET_SEGMENT( + SPTEST.REGION_ID( 1 ), + 3072, + RTEMS.DEFAULT_OPTIONS, + 10 * TEST_SUPPORT.TICKS_PER_SECOND, + SEGMENT_ADDRESS_4, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); + TEXT_IO.PUT( "TA1 - got segment from region 1 - " ); + SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_4 ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT( + "TA1 - region_return_segment - return segment to region 2 - " + ); + SPTEST.PUT_ADDRESS_FROM_AREA_2( SEGMENT_ADDRESS_1 ); + TEXT_IO.NEW_LINE; + RTEMS.REGION.RETURN_SEGMENT( + SPTEST.REGION_ID( 2 ), + SEGMENT_ADDRESS_1, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" ); + + TEXT_IO.PUT_LINE( "TA1 - task_wake_after - yield processor" ); + RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + TEXT_IO.PUT_LINE( "TA1 - task_delete - delete TA3" ); + RTEMS.TASKS.DELETE( SPTEST.TASK_ID( 3 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA3" ); + +TEST_SUPPORT.PAUSE; + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 4 ), + SPTEST.BASE_PRIORITY, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 4 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA4" ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 5 ), + SPTEST.BASE_PRIORITY, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 5 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA5" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 4 ), + SPTEST.TASK_4'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA4" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 5 ), + SPTEST.TASK_5'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA5" ); + + TEXT_IO.PUT_LINE( "TA1 - task_wake_after - yield processor" ); + RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + TEXT_IO.PUT( + "TA1 - region_return_segment - return segment to region 1 - " + ); + SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_4 ); + RTEMS.REGION.RETURN_SEGMENT( + SPTEST.REGION_ID( 1 ), + SEGMENT_ADDRESS_4, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT_LINE( "TA1 - task_wake_after - yield processor" ); + RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + TEXT_IO.PUT( "TA1 - region_get_segment - wait 10 seconds for 3K " ); + TEXT_IO.PUT_LINE( "segment from region 1" ); + RTEMS.REGION.GET_SEGMENT( + SPTEST.REGION_ID( 1 ), + 3072, + RTEMS.DEFAULT_OPTIONS, + 10 * TEST_SUPPORT.TICKS_PER_SECOND, + SEGMENT_ADDRESS_4, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); + TEXT_IO.PUT( "TA1 - got segment from region 1 - " ); + SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_4 ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT_LINE( "TA1 - task_wake_after - yield processor" ); + RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + TEXT_IO.PUT_LINE( "TA1 - task_delete - delete TA4" ); + RTEMS.TASKS.DELETE( SPTEST.TASK_ID( 4 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA4" ); + + TEXT_IO.PUT( + "TA1 - region_return_segment - return segment to region 1 - " + ); + SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_4 ); + RTEMS.REGION.RETURN_SEGMENT( + SPTEST.REGION_ID( 1 ), + SEGMENT_ADDRESS_4, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT_LINE( "TA1 - task_wake_after - yield processor" ); + RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + TEXT_IO.PUT_LINE( "TA1 - region_delete - delete region 1" ); + RTEMS.REGION.DELETE( SPTEST.REGION_ID( 1 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_DELETE OF RN1" ); +--XXX + TEXT_IO.PUT_LINE( + "TA1 - region_get_segment - get 3K segment from region 4" + ); + RTEMS.REGION.GET_SEGMENT( + SPTEST.REGION_ID( 4 ), + 3072, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + segment_address_1, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "region_get_segment" ); + TEXT_IO.PUT( "TA1 - got segment from region 4 - " ); + PUT_ADDRESS_FROM_AREA_4( segment_address_1 ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT_LINE( + "TA1 - region_get_segment - attempt to get 3K segment from region 4" + ); + RTEMS.REGION.GET_SEGMENT( + SPTEST.REGION_ID( 4 ), + 3072, + RTEMS.NO_WAIT, + RTEMS.NO_TIMEOUT, + SEGMENT_ADDRESS_2, + STATUS + ); + TEST_SUPPORT.FATAL_DIRECTIVE_STATUS( + STATUS, + RTEMS.UNSATISFIED, + "task_get_segment with no memory left" + ); + TEXT_IO.PUT_LINE( "TA1 - task_get_note - UNSATISFIED" ); + + TEXT_IO.PUT_LINE( "TA1 - region_extend - extend region 4 by 4K" ); + RTEMS.REGION.EXTEND( + SPTEST.REGION_ID( 4 ), + SPTEST.AREA_4( 4096 )'ADDRESS, + 4096, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( status, "region_extend" ); + + TEXT_IO.PUT_LINE( + "TA1 - region_get_segment - attempt to get 3K segment from region 4" + ); + RTEMS.REGION.GET_SEGMENT( + SPTEST.REGION_ID( 4 ), + 3072, + RTEMS.NO_WAIT, + RTEMS.NO_TIMEOUT, + segment_address_3, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( status, "region_get_segment" ); + TEXT_IO.PUT( "TA1 - got 3K segment from region 4 - " ); + PUT_ADDRESS_FROM_AREA_4( segment_address_3 ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT( + "TA1 - return_segment - return segment to region 4 - " + ); + PUT_ADDRESS_FROM_AREA_4( segment_address_1 ); + RTEMS.REGION.RETURN_SEGMENT( + SPTEST.REGION_ID( 4 ), segment_address_1, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( status, "region_return_segment" ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT( + "TA1 - region_return_segment - return segment to region 4 - " + ); + PUT_ADDRESS_FROM_AREA_4( segment_address_3 ); + RTEMS.REGION.RETURN_SEGMENT( + SPTEST.REGION_ID( 4 ), segment_address_3, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( status, "region_return_segment" ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT_LINE( "TA1 - region_delete - delete region 4" ); + RTEMS.REGION.DELETE( SPTEST.REGION_ID( 4 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( status, "region_delete" ); + + TEXT_IO.PUT_LINE( "*** END OF TEST 16 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end TASK_1; + +-- +-- TASK_2 +-- + + procedure TASK_2 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + PREVIOUS_PRIORITY : RTEMS.TASKS.PRIORITY; + SEGMENT_ADDRESS_1 : RTEMS.ADDRESS; + SEGMENT_ADDRESS_2 : RTEMS.ADDRESS; + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.PUT( "TA2 - region_get_segment - wait on 2K segment " ); + TEXT_IO.PUT_LINE( "from region 1" ); + RTEMS.REGION.GET_SEGMENT( + SPTEST.REGION_ID( 1 ), + 2048, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + SEGMENT_ADDRESS_1, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); + TEXT_IO.PUT( "TA2 - got segment from region 1 - " ); + SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_1 ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT( + "TA2 - region_return_segment - return segment to region 1 - " + ); + SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_1 ); + RTEMS.REGION.RETURN_SEGMENT( + SPTEST.REGION_ID( 1 ), + SEGMENT_ADDRESS_1, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT( "TA2 - task_set_priority - make self " ); + TEXT_IO.PUT_LINE( "highest priority task" ); + RTEMS.TASKS.SET_PRIORITY( + RTEMS.SELF, + SPTEST.BASE_PRIORITY - 1, + PREVIOUS_PRIORITY, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" ); + + TEXT_IO.PUT( + "TA2 - region_get_segment - wait on 3950 byte segment " + ); + TEXT_IO.PUT_LINE( "from region 2" ); + RTEMS.REGION.GET_SEGMENT( + SPTEST.REGION_ID( 2 ), + 3950, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + SEGMENT_ADDRESS_2, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); + TEXT_IO.PUT( "TA2 - got segment from region 2 - " ); + SPTEST.PUT_ADDRESS_FROM_AREA_2( SEGMENT_ADDRESS_2 ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT( + "TA2 - region_return_segment - return segment to region 2 - " + ); + SPTEST.PUT_ADDRESS_FROM_AREA_2( SEGMENT_ADDRESS_2 ); + RTEMS.REGION.RETURN_SEGMENT( + SPTEST.REGION_ID( 2 ), + SEGMENT_ADDRESS_2, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT_LINE( "TA2 - task_delete - delete self" ); + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA2" ); + + end TASK_2; + +-- +-- TASK_3 +-- + + procedure TASK_3 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + SEGMENT_ADDRESS_1 : RTEMS.ADDRESS; + SEGMENT_ADDRESS_2 : RTEMS.ADDRESS; + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.PUT( "TA3 - region_get_segment - wait on 3950 byte segment " ); + TEXT_IO.PUT_LINE( "from region 2" ); + RTEMS.REGION.GET_SEGMENT( + SPTEST.REGION_ID( 2 ), + 3950, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + SEGMENT_ADDRESS_1, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); + TEXT_IO.PUT( "TA3 - got segment from region 2 - " ); + SPTEST.PUT_ADDRESS_FROM_AREA_2( SEGMENT_ADDRESS_1 ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT( "TA3 - region_get_segment - wait on 2K segment " ); + TEXT_IO.PUT_LINE( "from region 3" ); + RTEMS.REGION.GET_SEGMENT( + SPTEST.REGION_ID( 3 ), + 2048, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + SEGMENT_ADDRESS_2, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); + + end TASK_3; + +-- +-- TASK_4 +-- + + procedure TASK_4 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + SEGMENT_ADDRESS_1 : RTEMS.ADDRESS; + SEGMENT_ADDRESS_2 : RTEMS.ADDRESS; + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.PUT( "TA4 - region_get_segment - wait on 1.5K segment " ); + TEXT_IO.PUT_LINE( "from region 1" ); + RTEMS.REGION.GET_SEGMENT( + SPTEST.REGION_ID( 1 ), + 1536, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + SEGMENT_ADDRESS_1, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); + + RTEMS.REGION.RETURN_SEGMENT( + SPTEST.REGION_ID( 1 ), + SEGMENT_ADDRESS_1, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" ); + TEXT_IO.PUT( "TA4 - got and returned " ); + SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_1 ); + TEXT_IO.NEW_LINE; + + RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + TEXT_IO.PUT( "TA4 - region_get_segment - wait on 3K segment " ); + TEXT_IO.PUT_LINE( "from region 1" ); + RTEMS.REGION.GET_SEGMENT( + SPTEST.REGION_ID( 1 ), + 3072, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + SEGMENT_ADDRESS_2, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); + + end TASK_4; + +-- +-- TASK_5 +-- + + procedure TASK_5 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + SEGMENT_ADDRESS_1 : RTEMS.ADDRESS; + SEGMENT_ADDRESS_2 : RTEMS.ADDRESS; + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.PUT( "TA5 - region_get_segment - wait on 1.5K segment " ); + TEXT_IO.PUT_LINE( "from region 1" ); + RTEMS.REGION.GET_SEGMENT( + SPTEST.REGION_ID( 1 ), + 1536, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + SEGMENT_ADDRESS_1, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); + + RTEMS.REGION.RETURN_SEGMENT( + SPTEST.REGION_ID( 1 ), + SEGMENT_ADDRESS_1, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" ); + TEXT_IO.PUT( "TA5 - got and returned " ); + SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_1 ); + TEXT_IO.NEW_LINE; + + RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + TEXT_IO.PUT( "TA5 - region_get_segment - wait on 3K segment " ); + TEXT_IO.PUT_LINE( "from region 1" ); + RTEMS.REGION.GET_SEGMENT( + SPTEST.REGION_ID( 1 ), + 3072, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + SEGMENT_ADDRESS_2, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); + TEXT_IO.PUT( "TA5 - got segment from region 1 - " ); + SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_2 ); + TEXT_IO.NEW_LINE; + + RTEMS.REGION.RETURN_SEGMENT( + SPTEST.REGION_ID( 1 ), + SEGMENT_ADDRESS_2, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" ); + TEXT_IO.PUT( + "TA5 - region_return_segment - return segment to region 1 - " + ); + SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_2 ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT_LINE( "TA5 - task_delete - delete self" ); + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA5" ); + + end TASK_5; + +end SPTEST; diff --git a/testsuites/ada/sptests/sp16/sptest.ads b/testsuites/ada/sptests/sp16/sptest.ads new file mode 100644 index 0000000000..7f028a0274 --- /dev/null +++ b/testsuites/ada/sptests/sp16/sptest.ads @@ -0,0 +1,202 @@ +-- +-- SPTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 16 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; + +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 .. 5 ) of RTEMS.ID; + TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 5 ) of RTEMS.NAME; + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS regions created +-- by this test. +-- + + REGION_ID : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.ID; + REGION_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 4 ) of RTEMS.NAME; + +-- +-- The following constant defines the priority of most of the +-- RTEMS tasks in this test. This allows one of the tasks to +-- easily set itself to a higher priority than the rest. +-- + + BASE_PRIORITY : constant RTEMS.TASKS.PRIORITY := 140; + +-- +-- These arrays define the memory areas used for the regions in +-- this test. +-- + + AREA_1 : array ( RTEMS.UNSIGNED32 range 0 .. 4095 ) of RTEMS.UNSIGNED8; + for AREA_1'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT; + + AREA_2 : array ( RTEMS.UNSIGNED32 range 0 .. 4095 ) of RTEMS.UNSIGNED8; + for AREA_2'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT; + + AREA_3 : array ( RTEMS.UNSIGNED32 range 0 .. 4095 ) of RTEMS.UNSIGNED8; + for AREA_3'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT; + + AREA_4 : array ( RTEMS.UNSIGNED32 range 0 .. 8191 ) of RTEMS.UNSIGNED8; + for AREA_4'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- PUT_ADDRESS_FROM_AREA_1 +-- +-- DESCRIPTION: +-- +-- This subprogram prints the offset of the address TO_BE_PRINTED +-- from the first byte of AREA_1. +-- +-- NOTE: +-- +-- This subprogram is used because the actual address of AREA_1 +-- varies based upon the size of the executable, the target board, +-- and the target processor. +-- + + procedure PUT_ADDRESS_FROM_AREA_1 ( + TO_BE_PRINTED : in RTEMS.ADDRESS + ); + +-- +-- PUT_ADDRESS_FROM_AREA_2 +-- +-- DESCRIPTION: +-- +-- This subprogram prints the offset of the address TO_BE_PRINTED +-- from the first byte of AREA_2. +-- +-- NOTE: +-- +-- This subprogram is used because the actual address of AREA_2 +-- varies based upon the size of the executable, the target board, +-- and the target processor. +-- + + procedure PUT_ADDRESS_FROM_AREA_2 ( + TO_BE_PRINTED : in RTEMS.ADDRESS + ); + +-- +-- PUT_ADDRESS_FROM_AREA_3 +-- +-- DESCRIPTION: +-- +-- This subprogram prints the offset of the address TO_BE_PRINTED +-- from the first byte of AREA_3. +-- +-- NOTE: +-- +-- This subprogram is used because the actual address of AREA_3 +-- varies based upon the size of the executable, the target board, +-- and the target processor. +-- + + procedure PUT_ADDRESS_FROM_AREA_3 ( + TO_BE_PRINTED : in RTEMS.ADDRESS + ); + +-- +-- TASK_1 +-- +-- DESCRIPTION: +-- +-- This RTEMS task tests the Region Manager. +-- + + procedure TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_1); + +-- +-- TASK_2 +-- +-- DESCRIPTION: +-- +-- This RTEMS task tests the Region Manager. +-- + + procedure TASK_2 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_2); + +-- +-- TASK_3 +-- +-- DESCRIPTION: +-- +-- This RTEMS task tests the Region Manager. +-- + + procedure TASK_3 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_3); + +-- +-- TASK_4 +-- +-- DESCRIPTION: +-- +-- This RTEMS task tests the Region Manager. +-- + + procedure TASK_4 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_4); + +-- +-- TASK_5 +-- +-- DESCRIPTION: +-- +-- This RTEMS task tests the Region Manager. +-- + + procedure TASK_5 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_5); + +end SPTEST; diff --git a/testsuites/ada/sptests/sp17/Makefile.am b/testsuites/ada/sptests/sp17/Makefile.am new file mode 100644 index 0000000000..9a5b2a3505 --- /dev/null +++ b/testsuites/ada/sptests/sp17/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_sp17 +ada_sp17_SOURCES = sp17.adb config.h sptest.adb sptest.ads +ada_sp17_SOURCES += ../../support/init.c + +ada_sp17$(EXEEXT): sp17.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_sp17.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/sptests/sp17/ada_sp17.scn b/testsuites/ada/sptests/sp17/ada_sp17.scn new file mode 100644 index 0000000000..887284d877 --- /dev/null +++ b/testsuites/ada/sptests/sp17/ada_sp17.scn @@ -0,0 +1,8 @@ +*** TEST 17 *** +TA2 - Suspending self +TA1 - signal_catch: initializing signal catcher +TA1 - Sending signal to self +TA2 - signal_return preempted correctly +TA1 - TA2 correctly preempted me +TA1 - Got Back!!! +*** END OF TEST 17 *** diff --git a/testsuites/ada/sptests/sp17/config.h b/testsuites/ada/sptests/sp17/config.h new file mode 100644 index 0000000000..0ceab6f736 --- /dev/null +++ b/testsuites/ada/sptests/sp17/config.h @@ -0,0 +1,32 @@ +/* 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 3 +#define CONFIGURE_MICROSECONDS_PER_TICK RTEMS_MILLISECONDS_TO_MICROSECONDS(25) +#define CONFIGURE_TICKS_PER_TIMESLICE 1000 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/sptests/sp17/sp17.adb b/testsuites/ada/sptests/sp17/sp17.adb new file mode 100644 index 0000000000..5c06ef0b44 --- /dev/null +++ b/testsuites/ada/sptests/sp17/sp17.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test SP17 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 SP17 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 SP17; + diff --git a/testsuites/ada/sptests/sp17/sptest.adb b/testsuites/ada/sptests/sp17/sptest.adb new file mode 100644 index 0000000000..e2402a50cf --- /dev/null +++ b/testsuites/ada/sptests/sp17/sptest.adb @@ -0,0 +1,170 @@ +-- +-- SPTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 17 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 INTERFACES; use INTERFACES; +with TEST_SUPPORT; +with TEXT_IO; +with RTEMS.SIGNAL; + +package body SPTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TEST 17 ***" ); + + SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); + SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' ); + + SPTEST.TASK_2_PREEMPTED := FALSE; + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 1 ), + 2, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 2 ), + 1, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 2 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 1 ), + SPTEST.TASK_1'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 2 ), + SPTEST.TASK_2'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" ); + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- PROCESS_ASR +-- + + procedure PROCESS_ASR ( + SIGNALS : in RTEMS.SIGNAL_SET + ) is + pragma Unreferenced(SIGNALS); + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.TASKS.RESUME( SPTEST.TASK_ID( 2 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "ASR - TASK_RESUME OF TA2" ); + + end PROCESS_ASR; + +-- +-- TASK_1 +-- + + procedure TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.PUT_LINE( "TA1 - signal_catch: initializing signal catcher" ); + RTEMS.SIGNAL.CATCH( + SPTEST.PROCESS_ASR'ACCESS, + RTEMS.NO_ASR + RTEMS.NO_PREEMPT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SIGNAL_CATCH" ); + + TEXT_IO.PUT_LINE( "TA1 - Sending signal to self" ); + RTEMS.SIGNAL.SEND( + SPTEST.TASK_ID( 1 ), + RTEMS.SIGNAL_16, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SIGNAL_SEND" ); + + if SPTEST.TASK_2_PREEMPTED then + TEXT_IO.PUT_LINE( "TA1 - TA2 correctly preempted me" ); + end if; + + TEXT_IO.PUT_LINE( "TA1 - Got Back!!!" ); + + TEXT_IO.PUT_LINE( "*** END OF TEST 17 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end TASK_1; + +-- +-- TASK_2 +-- + + procedure TASK_2 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + SPTEST.TASK_2_PREEMPTED := FALSE; + + TEXT_IO.PUT_LINE( "TA2 - Suspending self" ); + RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND OF TA2" ); + + TEXT_IO.PUT_LINE( "TA2 - signal_return preempted correctly" ); + + SPTEST.TASK_2_PREEMPTED := TRUE; + + RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND OF TA2" ); + + end TASK_2; + +end SPTEST; diff --git a/testsuites/ada/sptests/sp17/sptest.ads b/testsuites/ada/sptests/sp17/sptest.ads new file mode 100644 index 0000000000..428114c9a0 --- /dev/null +++ b/testsuites/ada/sptests/sp17/sptest.ads @@ -0,0 +1,95 @@ +-- +-- SPTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 17 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; + +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 .. 3 ) of RTEMS.ID; + TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; + +-- +-- The following is set to TRUE by TASK_2 when it preempts TASK_1. +-- + + TASK_2_PREEMPTED : STANDARD.BOOLEAN; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- PROCESS_ASR +-- +-- DESCRIPTION: +-- +-- This subprogram is the ASR for TASK_1. +-- + + procedure PROCESS_ASR ( + SIGNALS : in RTEMS.SIGNAL_SET + ); + pragma Convention (C, PROCESS_ASR); + +-- +-- TASK_1 +-- +-- DESCRIPTION: +-- +-- This RTEMS task tests that when the transfer from the task +-- to the ASR (and vice-versa) is performed, that the new mode +-- is taken into account. If this occurs, then TASK_2 will be +-- able to preempt upon completion of the ASR of TASK_1. +-- + + procedure TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_1); + +-- +-- TASK_2 +-- +-- DESCRIPTION: +-- +-- This RTEMS task is designed to preempt TASK_1. +-- + + procedure TASK_2 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_2); + +end SPTEST; diff --git a/testsuites/ada/sptests/sp19/Makefile.am b/testsuites/ada/sptests/sp19/Makefile.am new file mode 100644 index 0000000000..27e7d7ca28 --- /dev/null +++ b/testsuites/ada/sptests/sp19/Makefile.am @@ -0,0 +1,20 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +AM_ADAFLAGS += -I. + +noinst_PROGRAMS = ada_sp19 +ada_sp19_SOURCES = sp19.adb sptest.adb config.h sptest.ads +ada_sp19_SOURCES += ../../support/init.c + +CLEANFILES += sptest.adb + +ada_sp19$(EXEEXT): sp19.adb sptest.adb sptest.ads init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_sp19.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/sptests/sp19/README b/testsuites/ada/sptests/sp19/README new file mode 100644 index 0000000000..4fd698381e --- /dev/null +++ b/testsuites/ada/sptests/sp19/README @@ -0,0 +1,19 @@ +This is a "problem" test in Ada versus the C equivalent. In C, +we used macros to : + + + declare a LOT of local integer and floating point variables + + load them with values + + check them at certain times + + to avoid floating point operations on CPUs w/o hardware support + +The macros are not equivalent to subprograms doing the same thing. +We are trying to insure that the register set is fully utilized and +checking that it survives context switches. If the routines are +subprograms, then calling conventions and scoping rules apply. Thus +the variables do not exist throughout the entire life of the task +as in the C test. + +It seems to point out that although the conditional compilation +and macro capabilities of C are often abused, they do provide +capabilities which are difficult if not impossible to mimic entirely +with subprograms. diff --git a/testsuites/ada/sptests/sp19/ada_sp19.scn b/testsuites/ada/sptests/sp19/ada_sp19.scn new file mode 100644 index 0000000000..573860bb59 --- /dev/null +++ b/testsuites/ada/sptests/sp19/ada_sp19.scn @@ -0,0 +1,55 @@ +*** TEST 19 *** +FP1 - integer base = ( 16#6000#) +FP1 - float base = ( 6.00060E+03) +FP1 - integer base = ( 16#6000#) +FP1 - float base = ( 6.00060E+03) +TA1 - integer base = ( 16#1000#) +TA1 - clock_get - 9: 0: 0 12/31/1988 +TA2 - integer base = ( 16#2000#) +TA2 - clock_get - 9: 0: 0 12/31/1988 +TA3 - integer base = ( 16#3000#) +TA3 - clock_get - 9: 0: 0 12/31/1988 +TA4 - integer base = ( 16#4000#) +TA4 - float base = ( 4.00040E+03) +TA4 - clock_get - 9: 0: 0 12/31/1988 +TA5 - integer base = ( 16#5000#) +TA5 - float base = ( 5.00050E+03) +TA5 - clock_get - 9: 0: 0 12/31/1988 +TA4 - clock_get - 9: 0: 1 12/31/1988 +TA5 - clock_get - 9: 0: 1 12/31/1988 +TA4 - clock_get - 9: 0: 2 12/31/1988 +TA5 - clock_get - 9: 0: 2 12/31/1988 +TA4 - clock_get - 9: 0: 3 12/31/1988 +TA5 - clock_get - 9: 0: 3 12/31/1988 +TA4 - clock_get - 9: 0: 4 12/31/1988 +TA5 - clock_get - 9: 0: 4 12/31/1988 +TA1 - clock_get - 9: 0: 5 12/31/1988 +TA4 - clock_get - 9: 0: 5 12/31/1988 +TA5 - clock_get - 9: 0: 5 12/31/1988 +TA4 - clock_get - 9: 0: 6 12/31/1988 +TA5 - clock_get - 9: 0: 6 12/31/1988 +TA4 - clock_get - 9: 0: 7 12/31/1988 +TA5 - clock_get - 9: 0: 7 12/31/1988 +TA4 - clock_get - 9: 0: 8 12/31/1988 +TA5 - clock_get - 9: 0: 8 12/31/1988 +TA4 - clock_get - 9: 0: 9 12/31/1988 +TA5 - clock_get - 9: 0: 9 12/31/1988 +TA2 - clock_get - 9: 0:10 12/31/1988 +TA1 - clock_get - 9: 0:10 12/31/1988 +TA4 - clock_get - 9: 0:10 12/31/1988 +TA5 - clock_get - 9: 0:10 12/31/1988 +TA4 - clock_get - 9: 0:11 12/31/1988 +TA5 - clock_get - 9: 0:11 12/31/1988 +TA4 - clock_get - 9: 0:12 12/31/1988 +TA5 - clock_get - 9: 0:12 12/31/1988 +TA4 - clock_get - 9: 0:13 12/31/1988 +TA5 - clock_get - 9: 0:13 12/31/1988 +TA4 - clock_get - 9: 0:14 12/31/1988 +TA5 - clock_get - 9: 0:14 12/31/1988 +TA1 - clock_get - 9: 0:15 12/31/1988 +TA3 - clock_get - 9: 0:15 12/31/1988 +TA4 - clock_get - 9: 0:15 12/31/1988 +TA5 - clock_get - 9: 0:15 12/31/1988 +TA4 - task_delete - self +TA5 - task_delete - TA3 +*** END OF TEST 19 *** diff --git a/testsuites/ada/sptests/sp19/config.h b/testsuites/ada/sptests/sp19/config.h new file mode 100644 index 0000000000..278aaf69b0 --- /dev/null +++ b/testsuites/ada/sptests/sp19/config.h @@ -0,0 +1,30 @@ +/* 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_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#define CONFIGURE_MAXIMUM_TASKS 7 + +#include + +/* end of include file */ diff --git a/testsuites/ada/sptests/sp19/sp19.adb b/testsuites/ada/sptests/sp19/sp19.adb new file mode 100644 index 0000000000..f2cfddb97a --- /dev/null +++ b/testsuites/ada/sptests/sp19/sp19.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test SP19 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 SP19 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.FLOATING_POINT, + 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 SP19; + diff --git a/testsuites/ada/sptests/sp19/sptest.adp b/testsuites/ada/sptests/sp19/sptest.adp new file mode 100644 index 0000000000..d49bf41aac --- /dev/null +++ b/testsuites/ada/sptests/sp19/sptest.adp @@ -0,0 +1,397 @@ +-- +-- SPTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 19 of the RTEMS +-- Single Processor Test Suite. +-- +-- DEPENDENCIES: +-- +-- +-- +-- COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. +-- On-Line Applications Research Corporation (OAR). +-- + +with INTERFACES; use INTERFACES; +with FLOAT_IO; +with TEST_SUPPORT; +with TEXT_IO; +with UNSIGNED32_IO; +with RTEMS.CLOCK; + +include(../../support/fp.inc) +include(../../support/integer.inc) + +package body SPTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TEST 19 ***" ); + + SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); + SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' ); + SPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' ); + SPTEST.TASK_NAME( 4 ) := RTEMS.BUILD_NAME( 'T', 'A', '4', ' ' ); + SPTEST.TASK_NAME( 5 ) := RTEMS.BUILD_NAME( 'T', 'A', '5', ' ' ); + SPTEST.TASK_NAME( 6 ) := RTEMS.BUILD_NAME( 'F', 'P', '1', ' ' ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 1 ), + 2, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.FLOATING_POINT, + SPTEST.TASK_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 2 ), + 2, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 2 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA2" ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 3 ), + 2, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( 3 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA3" ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 4 ), + 2, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.FLOATING_POINT, + SPTEST.TASK_ID( 4 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA4" ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 5 ), + 2, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.FLOATING_POINT, + SPTEST.TASK_ID( 5 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA5" ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 6 ), + 1, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.FLOATING_POINT, + SPTEST.TASK_ID( 6 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF FP1" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 6 ), + SPTEST.FIRST_FP_TASK'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF FP1" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 1 ), + SPTEST.TASK_1'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 2 ), + SPTEST.TASK_1'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA2" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 3 ), + SPTEST.TASK_1'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA3" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 4 ), + SPTEST.FP_TASK'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA4" ); + + RTEMS.TASKS.START( + SPTEST.TASK_ID( 5 ), + SPTEST.FP_TASK'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA5" ); + + -- + -- Load "task dependent factors" in the context areas + -- + + SPTEST.FP_FACTORS( 0 ) := 0.0; + SPTEST.FP_FACTORS( 1 ) := 1000.1; + SPTEST.FP_FACTORS( 2 ) := 2000.2; + SPTEST.FP_FACTORS( 3 ) := 3000.3; + SPTEST.FP_FACTORS( 4 ) := 4000.4; + SPTEST.FP_FACTORS( 5 ) := 5000.5; + SPTEST.FP_FACTORS( 6 ) := 6000.6; + SPTEST.FP_FACTORS( 7 ) := 7000.7; + SPTEST.FP_FACTORS( 8 ) := 8000.8; + SPTEST.FP_FACTORS( 9 ) := 9000.9; + + SPTEST.INTEGER_FACTORS( 0 ) := 16#0000#; + SPTEST.INTEGER_FACTORS( 1 ) := 16#1000#; + SPTEST.INTEGER_FACTORS( 2 ) := 16#2000#; + SPTEST.INTEGER_FACTORS( 3 ) := 16#3000#; + SPTEST.INTEGER_FACTORS( 4 ) := 16#4000#; + SPTEST.INTEGER_FACTORS( 5 ) := 16#5000#; + SPTEST.INTEGER_FACTORS( 6 ) := 16#6000#; + SPTEST.INTEGER_FACTORS( 7 ) := 16#7000#; + SPTEST.INTEGER_FACTORS( 8 ) := 16#8000#; + SPTEST.INTEGER_FACTORS( 9 ) := 16#9000#; + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- FIRST_FP_TASK +-- + + procedure FIRST_FP_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + STATUS : RTEMS.STATUS_CODES; + TID : RTEMS.ID; + TIME : RTEMS.TIME_OF_DAY; + TASK_INDEX : RTEMS.UNSIGNED32; + INTEGER_DECLARE; + FP_DECLARE; + begin + + RTEMS.TASKS.IDENT( RTEMS.SELF, RTEMS.SEARCH_ALL_NODES, TID, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF SELF" ); + + TASK_INDEX := TEST_SUPPORT.TASK_NUMBER( TID ); + + INTEGER_LOAD( INTEGER_FACTORS( TASK_INDEX ) ); + FP_LOAD( FP_FACTORS( TASK_INDEX ) ); + + TEST_SUPPORT.PUT_NAME( SPTEST.TASK_NAME( TASK_INDEX ), FALSE ); + TEXT_IO.PUT( " - integer base = (" ); + UNSIGNED32_IO.PUT( INTEGER_FACTORS( TASK_INDEX ), BASE => 16 ); + TEXT_IO.PUT_LINE( ")" ); + + -- + -- C implementation prints NA if no hardware FP support. + -- + + TEST_SUPPORT.PUT_NAME( + SPTEST.TASK_NAME( TEST_SUPPORT.TASK_NUMBER( TID ) ), + FALSE + ); + TEXT_IO.PUT( " - float base = (" ); + FLOAT_IO.PUT( FP_FACTORS( TASK_INDEX ) ); + TEXT_IO.PUT_LINE( ")" ); + + FP_CHECK( FP_FACTORS( TASK_INDEX ) ); + INTEGER_CHECK( INTEGER_FACTORS( TASK_INDEX ) ); + if ARGUMENT = 0 then + RTEMS.TASKS.RESTART( + RTEMS.SELF, + 1, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESTART OF SELF" ); + else + TIME := ( 1988, 12, 31, 9, 0, 0, 0 ); + RTEMS.CLOCK.SET( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET" ); + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + end if; + + end FIRST_FP_TASK; + +-- +-- FP_TASK +-- + + procedure FP_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + TID : RTEMS.ID; + TIME : RTEMS.TIME_OF_DAY; + TASK_INDEX : RTEMS.UNSIGNED32; + INTEGER_DECLARE; + FP_DECLARE; + begin + + RTEMS.TASKS.IDENT( RTEMS.SELF, RTEMS.SEARCH_ALL_NODES, TID, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF SELF" ); + + TASK_INDEX := TEST_SUPPORT.TASK_NUMBER( TID ); + + INTEGER_LOAD( INTEGER_FACTORS( TASK_INDEX ) ); + FP_LOAD( FP_FACTORS( TASK_INDEX ) ); + + TEST_SUPPORT.PUT_NAME( + SPTEST.TASK_NAME( TEST_SUPPORT.TASK_NUMBER( TID ) ), + FALSE + ); + TEXT_IO.PUT( " - integer base = (" ); + UNSIGNED32_IO.PUT( INTEGER_FACTORS( TASK_INDEX ), BASE => 16 ); + TEXT_IO.PUT_LINE( ")" ); + + -- + -- C implementation prints NA if no hardware FP support. + -- + + TEST_SUPPORT.PUT_NAME( + SPTEST.TASK_NAME( TEST_SUPPORT.TASK_NUMBER( TID ) ), + FALSE + ); + TEXT_IO.PUT( " - float base = (" ); + FLOAT_IO.PUT( FP_FACTORS( TASK_INDEX ) ); + TEXT_IO.PUT_LINE( ")" ); + + loop + + RTEMS.CLOCK.GET_TOD( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); + + if TIME.SECOND >= 16 then + + if TEST_SUPPORT.TASK_NUMBER( TID ) = 4 then + TEXT_IO.PUT_LINE( "TA4 - task_delete - self" ); + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA4" ); + end if; + + TEXT_IO.PUT_LINE( "TA5 - task_delete - TA3" ); + RTEMS.TASKS.DELETE( SPTEST.TASK_ID( 3 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF TA3" ); + + TEXT_IO.PUT_LINE( "*** END OF TEST 19 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + end if; + + TEST_SUPPORT.PUT_NAME( + SPTEST.TASK_NAME( TEST_SUPPORT.TASK_NUMBER( TID ) ), + FALSE + ); + + TEST_SUPPORT.PRINT_TIME( " - clock_get - ", TIME, "" ); + TEXT_IO.NEW_LINE; + + INTEGER_CHECK( INTEGER_FACTORS( TASK_INDEX ) ); + FP_CHECK( FP_FACTORS( TASK_INDEX ) ); + + RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + end loop; + + end FP_TASK; + +-- +-- TASK_1 +-- + + procedure TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + TID : RTEMS.ID; + TIME : RTEMS.TIME_OF_DAY; + TASK_INDEX : RTEMS.UNSIGNED32; + INTEGER_DECLARE; + FP_DECLARE; + begin + + RTEMS.TASKS.IDENT( RTEMS.SELF, RTEMS.SEARCH_ALL_NODES, TID, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF SELF" ); + + TASK_INDEX := TEST_SUPPORT.TASK_NUMBER( TID ); + + INTEGER_LOAD( INTEGER_FACTORS( TASK_INDEX ) ); + FP_LOAD( FP_FACTORS( TASK_INDEX ) ); + + TEST_SUPPORT.PUT_NAME( + SPTEST.TASK_NAME( TEST_SUPPORT.TASK_NUMBER( TID ) ), + FALSE + ); + TEXT_IO.PUT( " - integer base = (" ); + UNSIGNED32_IO.PUT( INTEGER_FACTORS( TASK_INDEX ), BASE => 16 ); + TEXT_IO.PUT_LINE( ")" ); + + loop + + RTEMS.CLOCK.GET_TOD( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); + + TEST_SUPPORT.PUT_NAME( + SPTEST.TASK_NAME( TEST_SUPPORT.TASK_NUMBER( TID ) ), + FALSE + ); + + TEST_SUPPORT.PRINT_TIME( " - clock_get - ", TIME, "" ); + TEXT_IO.NEW_LINE; + + INTEGER_CHECK( INTEGER_FACTORS( TASK_INDEX ) ); + FP_CHECK( FP_FACTORS( TASK_INDEX ) ); + + RTEMS.TASKS.WAKE_AFTER( + TEST_SUPPORT.TASK_NUMBER( TID ) * 5 * + TEST_SUPPORT.TICKS_PER_SECOND, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + end loop; + + end TASK_1; + +end SPTEST; diff --git a/testsuites/ada/sptests/sp19/sptest.ads b/testsuites/ada/sptests/sp19/sptest.ads new file mode 100644 index 0000000000..3befd7cc3a --- /dev/null +++ b/testsuites/ada/sptests/sp19/sptest.ads @@ -0,0 +1,119 @@ +-- +-- SPTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 19 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; + +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 .. 6 ) of RTEMS.ID; + TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 6 ) of RTEMS.NAME; + +-- +-- This array contains the floating point factors used by the +-- floating point tasks in this test. +-- + + FP_FACTORS : array ( RTEMS.UNSIGNED32 range 0 .. 9 ) of FLOAT; + +-- +-- This array contains the integer factors used by the +-- integer tasks in this test. +-- + + INTEGER_FACTORS : array ( RTEMS.UNSIGNED32 range 0 .. 9 ) of + RTEMS.UNSIGNED32; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- FIRST_FP_TASK +-- +-- DESCRIPTION: +-- +-- This RTEMS task tests the restart and deletion of floating point tasks. +-- + + procedure FIRST_FP_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, FIRST_FP_TASK); + +-- +-- FP_TASK +-- +-- DESCRIPTION: +-- +-- This RTEMS task tests the basic capabilities of a floating point +-- task. +-- + + procedure FP_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, FP_TASK); + +-- +-- TASK_1 +-- +-- DESCRIPTION: +-- +-- This RTEMS task provides a non-floating point task to test +-- that an application can utilize a mixture of floating point +-- and non-floating point tasks. +-- + + procedure TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_1); + +-- +-- Add_Float +-- +-- DESCRIPTION: +-- +-- This method ensures the compilers thinks we are using the variables. +-- + + function Add_Float( + n : in Float; + factor : in Float + ) return Float; + pragma Interface (C, Add_Float); + pragma Interface_Name (Add_Float, "add_float"); + +end SPTEST; diff --git a/testsuites/ada/sptests/sp20/Makefile.am b/testsuites/ada/sptests/sp20/Makefile.am new file mode 100644 index 0000000000..de7b240d5c --- /dev/null +++ b/testsuites/ada/sptests/sp20/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_sp20 +ada_sp20_SOURCES = sp20.adb config.h sptest.adb sptest.ads +ada_sp20_SOURCES += ../../support/init.c + +ada_sp20$(EXEEXT): sp20.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_sp20.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/sptests/sp20/ada_sp20.scn b/testsuites/ada/sptests/sp20/ada_sp20.scn new file mode 100644 index 0000000000..5411361d76 --- /dev/null +++ b/testsuites/ada/sptests/sp20/ada_sp20.scn @@ -0,0 +1,40 @@ +*** TEST 20 *** +TA1 - rate_monotonic_create id = 16#42010001# +TA1 - rate_monotonic_ident id = 16#42010001# +TA1 - (16#42010001#) period 2 +TA2 - rate_monotonic_create id = 16#42010002# +TA2 - rate_monotonic_ident id = 16#42010002# +TA2 - (16#42010002#) period 2 +TA3 - rate_monotonic_create id = 16#42010003# +TA3 - rate_monotonic_ident id = 16#42010003# +TA3 - (16#42010003#) period 2 +TA4 - rate_monotonic_create id = 16#42010004# +TA4 - rate_monotonic_ident id = 16#42010004# +TA4 - (16#42010004#) period 2 +TA5 - rate_monotonic_create id = 16#42010005# +TA5 - rate_monotonic_ident id = 16#42010005# +TA5 - (16#42010005#) period 100 +TA6 - rate_monotonic_create id = 16#42010006# +TA6 - rate_monotonic_ident id = 16#42010006# +TA6 - (16#42010006#) period 0 +TA5 - PERIODS CHECK OK (1) +TA5 - PERIODS CHECK OK (2) +TA5 - PERIODS CHECK OK (3) +TA5 - PERIODS CHECK OK (4) +TA5 - PERIODS CHECK OK (5) +TA6 - Actual: 10 Expected: 10 - OK +TA6 - Actual: 20 Expected: 20 - OK +TA6 - Actual: 30 Expected: 30 - OK +TA6 - Actual: 40 Expected: 40 - OK +TA6 - Actual: 50 Expected: 50 - OK +TA6 - Actual: 60 Expected: 60 - OK +TA6 - Actual: 70 Expected: 70 - OK +TA6 - Actual: 80 Expected: 80 - OK +TA6 - Actual: 90 Expected: 90 - OK +TA6 - Actual: 100 Expected: 100 - OK +TA5 - PERIODS CHECK OK (6) +TA5 - PERIODS CHECK OK (7) +TA5 - PERIODS CHECK OK (8) +TA5 - PERIODS CHECK OK (9) +TA5 - PERIODS CHECK OK (10) +*** END OF TEST 20 *** diff --git a/testsuites/ada/sptests/sp20/config.h b/testsuites/ada/sptests/sp20/config.h new file mode 100644 index 0000000000..daf598bf4c --- /dev/null +++ b/testsuites/ada/sptests/sp20/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 7 +#define CONFIGURE_MAXIMUM_PERIODS 10 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/sptests/sp20/sp20.adb b/testsuites/ada/sptests/sp20/sp20.adb new file mode 100644 index 0000000000..898b96c119 --- /dev/null +++ b/testsuites/ada/sptests/sp20/sp20.adb @@ -0,0 +1,54 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test SP20 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 SP20 is + INIT_ID : RTEMS.ID; + STATUS : RTEMS.STATUS_CODES; +begin + + RTEMS.TASKS.CREATE( + RTEMS.BUILD_NAME( 'I', 'N', 'I', 'T' ), + 10, + RTEMS.MINIMUM_STACK_SIZE, + RTEMS.DEFAULT_MODES, + 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 SP20; + diff --git a/testsuites/ada/sptests/sp20/sptest.adb b/testsuites/ada/sptests/sp20/sptest.adb new file mode 100644 index 0000000000..1929fd958f --- /dev/null +++ b/testsuites/ada/sptests/sp20/sptest.adb @@ -0,0 +1,310 @@ +-- +-- SPTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 20 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 INTERFACES; use INTERFACES; +with TEST_SUPPORT; +with TEXT_IO; +with UNSIGNED32_IO; +with RTEMS.CLOCK; +with RTEMS.RATE_MONOTONIC; + +package body SPTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TEST 20 ***" ); + + SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); + SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' ); + SPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' ); + SPTEST.TASK_NAME( 4 ) := RTEMS.BUILD_NAME( 'T', 'A', '4', ' ' ); + SPTEST.TASK_NAME( 5 ) := RTEMS.BUILD_NAME( 'T', 'A', '5', ' ' ); + SPTEST.TASK_NAME( 6 ) := RTEMS.BUILD_NAME( 'T', 'A', '6', ' ' ); + + for INDEX in 1 .. 6 + loop + + SPTEST.COUNT( INDEX ) := 0; + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( INDEX ), + SPTEST.PRIORITIES( INDEX ), + 4096, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( INDEX ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); + + end loop; + + for INDEX in 1 .. 6 + loop + + RTEMS.TASKS.START( + SPTEST.TASK_ID( INDEX ), + SPTEST.TASK_1_THROUGH_6'ACCESS, + RTEMS.TASKS.ARGUMENT( INDEX ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); + + end loop; + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- TASK_1_THROUGH_6 +-- + + procedure TASK_1_THROUGH_6 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + RMID : RTEMS.ID; + TEST_RMID : RTEMS.ID; + PASS : RTEMS.UNSIGNED32; + FAILED : RTEMS.UNSIGNED32; + STATUS : RTEMS.STATUS_CODES; + TIME : array( 0 .. 10 ) of RTEMS.INTERVAL; + PERIOD : RTEMS.INTERVAL; + MEASURE : RTEMS.INTERVAL; + begin + + RTEMS.RATE_MONOTONIC.CREATE( ARGUMENT, RMID, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "RATE_MONOTONIC_CREATE" ); + TEST_SUPPORT.PUT_NAME( SPTEST.TASK_NAME( INTEGER( ARGUMENT ) ), FALSE ); + TEXT_IO.PUT( "- rate_monotonic_create id = " ); + UNSIGNED32_IO.PUT( RMID, WIDTH => 8, BASE => 16 ); + TEXT_IO.NEW_LINE; + + RTEMS.RATE_MONOTONIC.IDENT( ARGUMENT, TEST_RMID, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "RATE_MONOTONIC_IDENT" ); + TEST_SUPPORT.PUT_NAME( SPTEST.TASK_NAME( INTEGER( ARGUMENT ) ), FALSE ); + TEXT_IO.PUT( "- rate_monotonic_ident id = " ); + UNSIGNED32_IO.PUT( RMID, WIDTH => 8, BASE => 16 ); + TEXT_IO.NEW_LINE; + if TEST_RMID /= RMID then + TEXT_IO.PUT_LINE( "RMID's DO NOT MATCH!!!" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + end if; + + TEST_SUPPORT.PUT_NAME( SPTEST.TASK_NAME( INTEGER( ARGUMENT ) ), FALSE ); + TEXT_IO.PUT( " - (" ); + UNSIGNED32_IO.PUT( RMID, WIDTH => 1, BASE => 16 ); + TEXT_IO.PUT( ") period " ); + UNSIGNED32_IO.PUT( + SPTEST.PERIODS( INTEGER( ARGUMENT ) ), + WIDTH => 1, + BASE => 10 + ); + TEXT_IO.NEW_LINE; + + RTEMS.TASKS.WAKE_AFTER( 2, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + case ARGUMENT is + when 1 .. 4 => + loop + RTEMS.RATE_MONOTONIC.PERIOD( + RMID, + SPTEST.PERIODS( INTEGER( ARGUMENT ) ), + STATUS + ); + + TEST_SUPPORT.DIRECTIVE_FAILED( + STATUS, + "RATE_MONOTONIC_PERIOD" + ); + + SPTEST.COUNT( INTEGER( ARGUMENT ) ) := + SPTEST.COUNT( INTEGER( ARGUMENT ) ) + 1; + + end loop; + + when 5 => + + PASS := 0; + FAILED := 0; + + RTEMS.RATE_MONOTONIC.PERIOD( + RMID, + SPTEST.PERIODS( INTEGER( ARGUMENT ) ), + STATUS + ); + + TEST_SUPPORT.DIRECTIVE_FAILED( + STATUS, + "RATE_MONOTONIC_PERIOD 1 OF TA5" + ); + + SPTEST.GET_ALL_COUNTERS; + + loop + + RTEMS.RATE_MONOTONIC.PERIOD( + RMID, + SPTEST.PERIODS( INTEGER( ARGUMENT ) ), + STATUS + ); + + TEST_SUPPORT.DIRECTIVE_FAILED( + STATUS, + "RATE_MONOTONIC_PERIOD 2 OF TA5" + ); + + SPTEST.GET_ALL_COUNTERS; + + for INDEX in 1 .. 4 loop + + if SPTEST.TEMPORARY_COUNT( INDEX ) /= + SPTEST.ITERATIONS( INDEX ) then + + TEXT_IO.PUT( "FAIL -- " ); + TEST_SUPPORT.PUT_NAME( + SPTEST.TASK_NAME( INDEX ), + FALSE + ); + TEXT_IO.PUT( "ACTUAL=" ); + UNSIGNED32_IO.PUT( + SPTEST.TEMPORARY_COUNT( INDEX ), + WIDTH => 3, + BASE => 10 + ); + TEXT_IO.PUT( " EXPECTED=" ); + UNSIGNED32_IO.PUT( + SPTEST.ITERATIONS( INDEX ), + WIDTH => 3, + BASE => 10 + ); + TEXT_IO.NEW_LINE; + + FAILED := FAILED + 1; + + end if; + + end loop; + + if FAILED = 5 then + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + end if; + + PASS := PASS + 1; + TEXT_IO.PUT( "TA5 - PERIODS CHECK OK (" ); + UNSIGNED32_IO.PUT( PASS, WIDTH => 1, BASE => 10 ); + TEXT_IO.PUT_LINE( ")" ); + + if PASS = 10 then + TEXT_IO.PUT_LINE( "*** END OF TEST 20 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + end if; + + end loop; + + when 6 => + -- test changing periods + for INDEX in 0 .. 10 loop + PERIOD := RTEMS.INTERVAL( ( INDEX + 1 ) * 10 ); + RTEMS.RATE_MONOTONIC.PERIOD( RMID, PERIOD, STATUS); + TEST_SUPPORT.DIRECTIVE_FAILED( + STATUS, "rate_monotonic_period of TA6" + ); + + -- timestamp + Time( INDEX ) := RTEMS.CLOCK.GET_TICKS_SINCE_BOOT; + end loop; + + for INDEX in 1 .. 10 loop + MEASURE := TIME( INDEX ) - TIME( INDEX - 1 ); + PERIOD := RTEMS.INTERVAL( INDEX * 10 ); + TEXT_IO.PUT( "TA6 - Actual: " ); + UNSIGNED32_IO.PUT( MEASURE, WIDTH => 3, BASE => 10 ); + TEXT_IO.PUT( " Expected: " ); + UNSIGNED32_IO.PUT( PERIOD, WIDTH => 3, BASE => 10 ); + if PERIOD = MEASURE then + TEXT_IO.PUT_LINE( " - OK" ); + else + TEXT_IO.PUT_LINE( " - FAILED" ); + end if; + end loop; + + RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( + STATUS, "task_suspend of TA6" + ); + + when others => + NULL; + + end case; + + end TASK_1_THROUGH_6; + +-- +-- GET_ALL_COUNTERS +-- + + procedure GET_ALL_COUNTERS + is + PREVIOUS_MODE : RTEMS.MODE; + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.TASKS.MODE( + RTEMS.NO_PREEMPT, + RTEMS.PREEMPT_MASK, + PREVIOUS_MODE, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE TO NO_PREEMPT" ); + + SPTEST.TEMPORARY_COUNT := SPTEST.COUNT; + + for INDEX in 1 .. 5 + loop + + SPTEST.COUNT( INDEX ) := 0; + + end loop; + + RTEMS.TASKS.MODE( + RTEMS.PREEMPT, + RTEMS.PREEMPT_MASK, + PREVIOUS_MODE, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE TO PREEMPT" ); + + end GET_ALL_COUNTERS; + +end SPTEST; diff --git a/testsuites/ada/sptests/sp20/sptest.ads b/testsuites/ada/sptests/sp20/sptest.ads new file mode 100644 index 0000000000..384cc1dac5 --- /dev/null +++ b/testsuites/ada/sptests/sp20/sptest.ads @@ -0,0 +1,105 @@ +-- +-- SPTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 20 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; + +package SPTEST is + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS tasks created +-- by this test. +-- + + TASK_ID : array ( 1 .. 6 ) of RTEMS.ID; + TASK_NAME : array ( 1 .. 6 ) of RTEMS.NAME; + +-- +-- These arrays contain the parameters which define the execution +-- characteristics and periods of each instantiation of the +-- copies of the RTEMS task TASKS_1_THROUGH_6. +-- + + PERIODS : constant array ( 1 .. 6 ) + of RTEMS.UNSIGNED32 := ( 2, 2, 2, 2, 100, 0 ); + + ITERATIONS : constant array ( 1 .. 6 ) + of RTEMS.UNSIGNED32 := ( 50, 50, 50, 50, 1, 10 ); + + PRIORITIES : constant array ( 1 .. 6 ) + of RTEMS.UNSIGNED32 := ( 1, 1, 3, 4, 5, 1 ); + +-- +-- The following type defines the array used to manage the +-- execution counts of each task's period. +-- + + type COUNT_ARRAY is array ( 1 .. 6 ) of RTEMS.UNSIGNED32; + +-- +-- These arrays contains the number of periods successfully completed +-- by each of the tasks. At each of its periods, the fifth task +-- will copy the contents of the COUNT array to TEMPORARY_COUNT, +-- and clear the COUNT array. The copy is performed to insure +-- that no periods fire while it is verifying the correctness +-- of the test's execution. +-- + + COUNT : SPTEST.COUNT_ARRAY; + TEMPORARY_COUNT : SPTEST.COUNT_ARRAY; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- TASK_1_THROUGH_6 +-- +-- DESCRIPTION: +-- +-- These RTEMS tasks test the Rate Monotonic Manager. +-- + + procedure TASK_1_THROUGH_6 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_1_THROUGH_6); + +-- +-- GET_ALL_COUNTERS +-- +-- DESCRIPTION: +-- +-- This subprogram atomically copies the contents of COUNTER to +-- TEMPORARY_COUNTER. +-- + + procedure GET_ALL_COUNTERS; + +end SPTEST; diff --git a/testsuites/ada/sptests/sp22/Makefile.am b/testsuites/ada/sptests/sp22/Makefile.am new file mode 100644 index 0000000000..8b24be6768 --- /dev/null +++ b/testsuites/ada/sptests/sp22/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_sp22 +ada_sp22_SOURCES = sp22.adb config.h sptest.adb sptest.ads +ada_sp22_SOURCES += ../../support/init.c + +ada_sp22$(EXEEXT): sp22.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_sp22.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/sptests/sp22/ada_sp22.scn b/testsuites/ada/sptests/sp22/ada_sp22.scn new file mode 100644 index 0000000000..3e96936e24 --- /dev/null +++ b/testsuites/ada/sptests/sp22/ada_sp22.scn @@ -0,0 +1,29 @@ +*** TEST 22 *** +INIT - timer_create - creating timer 1 +INIT - timer 1 has id (16#12010001#) +TA1 - timer_ident - identing timer 1 +TA1 - timer 1 has id (16#12010001#) +TA1 - clock_get - 9: 0: 0 12/31/1988 +TA1 - timer_after - timer 1 in 3 seconds +TA1 - task_suspend( SELF ) +TA1 - clock_get - 9: 0: 3 12/31/1988 +TA1 - timer_after - timer 1 in 3 seconds +TA1 - task_wake_after - 1 second +TA1 - clock_get - 9: 0: 4 12/31/1988 +TA1 - timer_reset - timer 1 +TA1 - task_suspend( SELF ) +TA1 - clock_get - 9: 0: 7 12/31/1988 + +TA1 - timer_after - timer 1 in 3 seconds +TA1 - timer_cancel - timer 1 +TA1 - clock_get - 9: 0: 7 12/31/1988 +TA1 - timer_when - timer 1 in 3 seconds +TA1 - task_suspend( SELF ) +TA1 - clock_get - 9: 0:10 12/31/1988 +TA1 - timer_when - timer 1 in 3 seconds +TA1 - task_wake_after - 1 second +TA1 - clock_get - 9: 0:11 12/31/1988 +TA1 - timer_cancel - timer 1 +TA1 - task_wake_after - YIELD (only task at priority) +TA1 - timer_delete - timer 1 +*** END OF TEST 22 *** diff --git a/testsuites/ada/sptests/sp22/config.h b/testsuites/ada/sptests/sp22/config.h new file mode 100644 index 0000000000..b8ed5c97d0 --- /dev/null +++ b/testsuites/ada/sptests/sp22/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_TIMERS 2 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/sptests/sp22/sp22.adb b/testsuites/ada/sptests/sp22/sp22.adb new file mode 100644 index 0000000000..842bc7338e --- /dev/null +++ b/testsuites/ada/sptests/sp22/sp22.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test SP22 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 SP22 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 SP22; + diff --git a/testsuites/ada/sptests/sp22/sptest.adb b/testsuites/ada/sptests/sp22/sptest.adb new file mode 100644 index 0000000000..a947628db5 --- /dev/null +++ b/testsuites/ada/sptests/sp22/sptest.adb @@ -0,0 +1,297 @@ +-- +-- SPTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 22 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 INTERFACES; use INTERFACES; +with TEST_SUPPORT; +with TEXT_IO; +with UNSIGNED32_IO; +with RTEMS.CLOCK; +with RTEMS.TIMER; + +package body SPTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + TIME : RTEMS.TIME_OF_DAY; + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TEST 22 ***" ); + + TIME := ( 1988, 12, 31, 9, 0, 0, 0 ); + + RTEMS.CLOCK.SET( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET" ); + + SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); + SPTEST.TIMER_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'M', '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" ); + + TEXT_IO.PUT_LINE( "INIT - timer_create - creating timer 1" ); + RTEMS.TIMER.CREATE( + SPTEST.TIMER_NAME( 1 ), + SPTEST.TIMER_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE OF TM1" ); + TEXT_IO.PUT( "INIT - timer 1 has id (" ); + UNSIGNED32_IO.PUT( SPTEST.TIMER_ID( 1 ), WIDTH => 8, BASE => 16 ); + TEXT_IO.PUT_LINE( ")" ); + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- DELAYED_RESUME +-- + + procedure DELAYED_RESUME ( + IGNORED_ID : in RTEMS.ID; + IGNORED_ADDRESS : in RTEMS.ADDRESS + ) is + pragma Unreferenced(IGNORED_ID); + pragma Unreferenced(IGNORED_ADDRESS); + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.TASKS.RESUME( SPTEST.TASK_ID( 1 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESUME OF SELF" ); + + end DELAYED_RESUME; + +-- +-- PRINT_TIME +-- + + procedure PRINT_TIME + is + TIME : RTEMS.TIME_OF_DAY; + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.CLOCK.GET_TOD( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); + + TEST_SUPPORT.PUT_NAME( + SPTEST.TASK_NAME( 1 ), + FALSE + ); + + TEST_SUPPORT.PRINT_TIME( "- clock_get - ", TIME, "" ); + TEXT_IO.NEW_LINE; + + end PRINT_TIME; + +-- +-- TASK_1 +-- + + procedure TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + TMID : RTEMS.ID; + TIME : RTEMS.TIME_OF_DAY; + STATUS : RTEMS.STATUS_CODES; + begin + +-- GET ID + + TEXT_IO.PUT_LINE( "TA1 - timer_ident - identing timer 1" ); + RTEMS.TIMER.IDENT( SPTEST.TIMER_NAME( 1 ), TMID, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_IDENT OF TM1" ); + TEXT_IO.PUT( "TA1 - timer 1 has id (" ); + UNSIGNED32_IO.PUT( SPTEST.TIMER_ID( 1 ), WIDTH => 8, BASE => 16 ); + TEXT_IO.PUT_LINE( ")" ); + +-- AFTER WHICH IS ALLOWED TO FIRE + + SPTEST.PRINT_TIME; + + TEXT_IO.PUT_LINE( "TA1 - timer_after - timer 1 in 3 seconds" ); + RTEMS.TIMER.FIRE_AFTER( + TMID, + 3 * TEST_SUPPORT.TICKS_PER_SECOND, + SPTEST.DELAYED_RESUME'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER" ); + + TEXT_IO.PUT_LINE( "TA1 - task_suspend( SELF )" ); + RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND" ); + + SPTEST.PRINT_TIME; + +-- AFTER WHICH IS RESET AND ALLOWED TO FIRE + + TEXT_IO.PUT_LINE( "TA1 - timer_after - timer 1 in 3 seconds" ); + RTEMS.TIMER.FIRE_AFTER( + TMID, + 3 * TEST_SUPPORT.TICKS_PER_SECOND, + SPTEST.DELAYED_RESUME'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER" ); + + TEXT_IO.PUT_LINE( "TA1 - task_wake_after - 1 second" ); + RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + SPTEST.PRINT_TIME; + + TEXT_IO.PUT_LINE( "TA1 - timer_reset - timer 1" ); + RTEMS.TIMER.RESET( TMID, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_RESET" ); + + TEXT_IO.PUT_LINE( "TA1 - task_suspend( SELF )" ); + RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND" ); + + SPTEST.PRINT_TIME; + +TEST_SUPPORT.PAUSE; + +-- +-- Reset the time since we do not know how long the user waited +-- before pressing at the pause. This insures that the +-- actual output matches the screen. +-- + + TIME := ( 1988, 12, 31, 9, 0, 7, 0 ); + + RTEMS.CLOCK.SET( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET" ); + +-- after which is canceled + + TEXT_IO.PUT_LINE( "TA1 - timer_after - timer 1 in 3 seconds" ); + RTEMS.TIMER.FIRE_AFTER( + TMID, + 3 * TEST_SUPPORT.TICKS_PER_SECOND, + SPTEST.DELAYED_RESUME'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER" ); + + TEXT_IO.PUT_LINE( "TA1 - timer_cancel - timer 1" ); + RTEMS.TIMER.CANCEL( TMID, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CANCEL" ); + +-- when which is allowed to fire + + SPTEST.PRINT_TIME; + + RTEMS.CLOCK.GET_TOD( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); + + TIME.SECOND := TIME.SECOND + 3; + + TEXT_IO.PUT_LINE( "TA1 - timer_when - timer 1 in 3 seconds" ); + RTEMS.TIMER.FIRE_WHEN( + TMID, + TIME, + SPTEST.DELAYED_RESUME'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_WHEN" ); + + TEXT_IO.PUT_LINE( "TA1 - task_suspend( SELF )" ); + RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND" ); + + SPTEST.PRINT_TIME; + +-- when which is canceled + + RTEMS.CLOCK.GET_TOD( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); + + TIME.SECOND := TIME.SECOND + 3; + + TEXT_IO.PUT_LINE( "TA1 - timer_when - timer 1 in 3 seconds" ); + RTEMS.TIMER.FIRE_WHEN( + TMID, + TIME, + SPTEST.DELAYED_RESUME'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_WHEN" ); + + TEXT_IO.PUT_LINE( "TA1 - task_wake_after - 1 second" ); + RTEMS.TASKS.WAKE_AFTER( TEST_SUPPORT.TICKS_PER_SECOND, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + SPTEST.PRINT_TIME; + + TEXT_IO.PUT_LINE( "TA1 - timer_cancel - timer 1" ); + RTEMS.TIMER.CANCEL( TMID, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CANCEL" ); + +-- delete + + TEXT_IO.PUT_LINE( + "TA1 - task_wake_after - YIELD (only task at priority)" + ); + RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER YIELD" ); + + TEXT_IO.PUT_LINE( "TA1 - timer_delete - timer 1" ); + RTEMS.TIMER.DELETE( TMID, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_DELETE" ); + + TEXT_IO.PUT_LINE( "*** END OF TEST 22 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end TASK_1; + +end SPTEST; diff --git a/testsuites/ada/sptests/sp22/sptest.ads b/testsuites/ada/sptests/sp22/sptest.ads new file mode 100644 index 0000000000..af312fafb8 --- /dev/null +++ b/testsuites/ada/sptests/sp22/sptest.ads @@ -0,0 +1,93 @@ +-- +-- SPTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 22 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; + +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 timers created +-- by this test. +-- + + TIMER_ID : array ( RTEMS.UNSIGNED32 range 1 .. 1 ) of RTEMS.ID; + TIMER_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 1 ) of RTEMS.NAME; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- DELAYED_RESUME +-- +-- DESCRIPTION: +-- +-- This subprogram is scheduled to be fired as a timer service +-- routine. When fired this subprogram resumes TASK_1. +-- + + procedure DELAYED_RESUME ( + IGNORED_ID : in RTEMS.ID; + IGNORED_ADDRESS : in RTEMS.ADDRESS + ); + pragma Convention (C, DELAYED_RESUME); + +-- +-- PRINT_TIME +-- +-- DESCRIPTION: +-- +-- This subprogram prints the name of TASK_1 and the current TIME of day. +-- + + procedure PRINT_TIME; + +-- +-- TASK_1 +-- +-- DESCRIPTION: +-- +-- This RTEMS task tests the Timer Manager. +-- + + procedure TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_1); + +end SPTEST; 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 + +/* 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; diff --git a/testsuites/ada/sptests/sp24/Makefile.am b/testsuites/ada/sptests/sp24/Makefile.am new file mode 100644 index 0000000000..a8ebaecb52 --- /dev/null +++ b/testsuites/ada/sptests/sp24/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_sp24 +ada_sp24_SOURCES = sp24.adb config.h sptest.adb sptest.ads +ada_sp24_SOURCES += ../../support/init.c + +ada_sp24$(EXEEXT): sp24.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_sp24.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/sptests/sp24/ada_sp24.scn b/testsuites/ada/sptests/sp24/ada_sp24.scn new file mode 100644 index 0000000000..eb626eb6b2 --- /dev/null +++ b/testsuites/ada/sptests/sp24/ada_sp24.scn @@ -0,0 +1,16 @@ +*** TEST 24 *** +TA1 - clock_get - 9: 0: 0 12/31/1988 +TA2 - clock_get - 9: 0: 0 12/31/1988 +TA3 - clock_get - 9: 0: 0 12/31/1988 +TA1 - clock_get - 9: 0: 5 12/31/1988 +TA1 - clock_get - 9: 0:10 12/31/1988 +TA2 - clock_get - 9: 0:10 12/31/1988 +TA1 - clock_get - 9: 0:15 12/31/1988 +TA3 - clock_get - 9: 0:15 12/31/1988 +TA1 - clock_get - 9: 0:20 12/31/1988 +TA2 - clock_get - 9: 0:20 12/31/1988 +TA1 - clock_get - 9: 0:25 12/31/1988 +TA1 - clock_get - 9: 0:30 12/31/1988 +TA3 - clock_get - 9: 0:30 12/31/1988 +TA2 - clock_get - 9: 0:30 12/31/1988 +*** END OF TEST 24 *** diff --git a/testsuites/ada/sptests/sp24/config.h b/testsuites/ada/sptests/sp24/config.h new file mode 100644 index 0000000000..a72dd35dac --- /dev/null +++ b/testsuites/ada/sptests/sp24/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 4 +#define CONFIGURE_MAXIMUM_TIMERS 3 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/sptests/sp24/sp24.adb b/testsuites/ada/sptests/sp24/sp24.adb new file mode 100644 index 0000000000..e56802640b --- /dev/null +++ b/testsuites/ada/sptests/sp24/sp24.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test SP24 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 SP24 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 SP24; + diff --git a/testsuites/ada/sptests/sp24/sptest.adb b/testsuites/ada/sptests/sp24/sptest.adb new file mode 100644 index 0000000000..4245036995 --- /dev/null +++ b/testsuites/ada/sptests/sp24/sptest.adb @@ -0,0 +1,167 @@ +-- +-- SPTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 24 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 INTERFACES; use INTERFACES; +with TEST_SUPPORT; +with TEXT_IO; +with RTEMS.CLOCK; +with RTEMS.TIMER; + +package body SPTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + TIME : RTEMS.TIME_OF_DAY; + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TEST 24 ***" ); + + TIME := ( 1988, 12, 31, 9, 0, 0, 0 ); + + RTEMS.CLOCK.SET( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET" ); + + SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); + SPTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' ); + SPTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' ); + + SPTEST.TIMER_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'M', '1', ' ' ); + SPTEST.TIMER_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'M', '2', ' ' ); + SPTEST.TIMER_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'M', '3', ' ' ); + + for INDEX in 1 .. 3 + loop + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( INDEX ), + 1, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.TASK_ID( INDEX ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); + + RTEMS.TIMER.CREATE( + SPTEST.TIMER_NAME( INDEX ), + SPTEST.TIMER_ID( INDEX ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE LOOP" ); + + end loop; + + for INDEX in 1 .. 3 + loop + + RTEMS.TASKS.START( + SPTEST.TASK_ID( INDEX ), + SPTEST.TASK_1_THROUGH_3'ACCESS, + RTEMS.TASKS.ARGUMENT( INDEX ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); + + end loop; + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- RESUME_TASK +-- + + procedure RESUME_TASK ( + TIMER_ID : in RTEMS.ID; + IGNORED_ADDRESS : in RTEMS.ADDRESS + ) is + pragma Unreferenced(IGNORED_ADDRESS); + TASK_TO_RESUME : RTEMS.ID; + STATUS : RTEMS.STATUS_CODES; + begin + + TASK_TO_RESUME := SPTEST.TASK_ID(INTEGER( RTEMS.GET_INDEX( TIMER_ID ) )); + RTEMS.TASKS.RESUME( TASK_TO_RESUME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESUME" ); + + end RESUME_TASK; + +-- +-- TASK_1_THROUGH_3 +-- + + procedure TASK_1_THROUGH_3 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + TID : RTEMS.ID; + TIME : RTEMS.TIME_OF_DAY; + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.TASKS.IDENT( RTEMS.SELF, RTEMS.SEARCH_ALL_NODES, TID, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_IDENT OF SELF" ); + + loop + + RTEMS.TIMER.FIRE_AFTER( + SPTEST.TIMER_ID( INTEGER( ARGUMENT ) ), + TEST_SUPPORT.TASK_NUMBER( TID ) * 5 * + TEST_SUPPORT.TICKS_PER_SECOND, + SPTEST.RESUME_TASK'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER" ); + + RTEMS.CLOCK.GET_TOD( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); + + if TIME.SECOND >= 35 then + TEXT_IO.PUT_LINE( "*** END OF TEST 24 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + end if; + + TEST_SUPPORT.PUT_NAME( + SPTEST.TASK_NAME( INTEGER( TEST_SUPPORT.TASK_NUMBER( TID ) ) ), + FALSE + ); + + TEST_SUPPORT.PRINT_TIME( " - clock_get - ", TIME, "" ); + TEXT_IO.NEW_LINE; + + RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND" ); + + end loop; + + end TASK_1_THROUGH_3; + +end SPTEST; diff --git a/testsuites/ada/sptests/sp24/sptest.ads b/testsuites/ada/sptests/sp24/sptest.ads new file mode 100644 index 0000000000..166ee812b3 --- /dev/null +++ b/testsuites/ada/sptests/sp24/sptest.ads @@ -0,0 +1,83 @@ +-- +-- SPTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 24 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; + +package SPTEST is + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS tasks created +-- by this test. +-- + + TASK_ID : array ( 1 .. 3 ) of RTEMS.ID; + TASK_NAME : array ( 1 .. 3 ) of RTEMS.NAME; + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS timers created +-- by this test. +-- + + TIMER_ID : array ( 1 .. 3 ) of RTEMS.ID; + TIMER_NAME : array ( 1 .. 3 ) of RTEMS.NAME; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- RESUME_TASK +-- +-- DESCRIPTION: +-- +-- This subprogram is scheduled as a timer service routine. When +-- it fires it resumes the task which is mapped to this timer. +-- + + procedure RESUME_TASK ( + TIMER_ID : in RTEMS.ID; + IGNORED_ADDRESS : in RTEMS.ADDRESS + ); + pragma Convention (C, RESUME_TASK); + +-- +-- TASK_1_THROUGH_3 +-- +-- DESCRIPTION: +-- +-- This RTEMS task tests the Timer Manager. +-- + + procedure TASK_1_THROUGH_3 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_1_THROUGH_3); + +end SPTEST; diff --git a/testsuites/ada/sptests/sp25/Makefile.am b/testsuites/ada/sptests/sp25/Makefile.am new file mode 100644 index 0000000000..b4b864d8d7 --- /dev/null +++ b/testsuites/ada/sptests/sp25/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_sp25 +ada_sp25_SOURCES = sp25.adb config.h sptest.adb sptest.ads +ada_sp25_SOURCES += ../../support/init.c + +ada_sp25$(EXEEXT): sp25.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_sp25.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/sptests/sp25/ada_sp25.scn b/testsuites/ada/sptests/sp25/ada_sp25.scn new file mode 100644 index 0000000000..bb568001ac --- /dev/null +++ b/testsuites/ada/sptests/sp25/ada_sp25.scn @@ -0,0 +1,29 @@ +*** TEST 25 *** +TA1 - region_ident - rnid => 16#32010001# +TA1 - region_get_segment - wait on 64 byte segment from region 1 +TA1 - got segment from region 1 - 16#10# +TA1 - region_get_segment - wait on 128 byte segment from region 1 +TA1 - got segment from region 1 - 16#70# +TA1 - region_get_segment - wait on 256 byte segment from region 1 +TA1 - got segment from region 1 - 16#110# +TA1 - region_get_segment - wait on 512 byte segment from region 1 +TA1 - got segment from region 1 - 16#230# +TA1 - region_get_segment - wait on 1024 byte segment from region 1 +TA1 - got segment from region 1 - 16#450# +TA1 - region_get_segment - wait on 2048 byte segment from region 1 +TA1 - got segment from region 1 - 16#870# +TA1 - region_get_segment - wait on 4096 byte segment from region 1 +TA1 - got segment from region 1 - 16#1090# +TA1 - region_get_segment - wait on 8192 byte segment from region 1 +TA1 - got segment from region 1 - 16#20B0# + +TA1 - region_return_segment - return segment to region 1 - 16#110# +TA1 - region_return_segment - return segment to region 1 - 16#230# +TA1 - region_return_segment - return segment to region 1 - 16#10# +TA1 - region_return_segment - return segment to region 1 - 16#70# +TA1 - region_return_segment - return segment to region 1 - 16#1090# +TA1 - region_return_segment - return segment to region 1 - 16#870# +TA1 - region_return_segment - return segment to region 1 - 16#20B0# +TA1 - region_return_segment - return segment to region 1 - 16#450# +TA1 - region_delete - walks heap if debug enabled +*** END OF TEST 25 *** diff --git a/testsuites/ada/sptests/sp25/config.h b/testsuites/ada/sptests/sp25/config.h new file mode 100644 index 0000000000..aa74afdd45 --- /dev/null +++ b/testsuites/ada/sptests/sp25/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_REGIONS 1 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/sptests/sp25/sp25.adb b/testsuites/ada/sptests/sp25/sp25.adb new file mode 100644 index 0000000000..00db138fa9 --- /dev/null +++ b/testsuites/ada/sptests/sp25/sp25.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test SP25 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 SP25 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 SP25; + diff --git a/testsuites/ada/sptests/sp25/sptest.adb b/testsuites/ada/sptests/sp25/sptest.adb new file mode 100644 index 0000000000..1fb103e966 --- /dev/null +++ b/testsuites/ada/sptests/sp25/sptest.adb @@ -0,0 +1,362 @@ +-- +-- SPTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 25 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 TEST_SUPPORT; +with TEXT_IO; +with UNSIGNED32_IO; +with RTEMS.REGION; + +package body SPTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TEST 25 ***" ); + + SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); + + RTEMS.TASKS.CREATE( + SPTEST.TASK_NAME( 1 ), + SPTEST.BASE_PRIORITY, + 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.REGION_NAME( 1 ) := RTEMS.BUILD_NAME( 'R', 'N', '1', ' ' ); + + RTEMS.REGION.CREATE( + SPTEST.REGION_NAME( 1 ), + SPTEST.AREA_1'ADDRESS, + 64000, + 32, + RTEMS.DEFAULT_ATTRIBUTES, + SPTEST.REGION_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_CREATE OF RN1" ); + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- PUT_ADDRESS_FROM_AREA_1 +-- + + procedure PUT_ADDRESS_FROM_AREA_1 ( + TO_BE_PRINTED : in RTEMS.ADDRESS + ) is + + begin + + UNSIGNED32_IO.PUT( + RTEMS.SUBTRACT( TO_BE_PRINTED, SPTEST.AREA_1'ADDRESS ), + WIDTH => 8, + BASE => 16 + ); + + end PUT_ADDRESS_FROM_AREA_1; + +-- +-- TASK_1 +-- + + procedure TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + RNID : RTEMS.ID; + SEGMENT_ADDRESS_1 : RTEMS.ADDRESS; + SEGMENT_ADDRESS_2 : RTEMS.ADDRESS; + SEGMENT_ADDRESS_3 : RTEMS.ADDRESS; + SEGMENT_ADDRESS_4 : RTEMS.ADDRESS; + SEGMENT_ADDRESS_5 : RTEMS.ADDRESS; + SEGMENT_ADDRESS_6 : RTEMS.ADDRESS; + SEGMENT_ADDRESS_7 : RTEMS.ADDRESS; + SEGMENT_ADDRESS_8 : RTEMS.ADDRESS; + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.REGION.IDENT( SPTEST.REGION_NAME( 1 ), RNID, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_IDENT OF RN1" ); + TEXT_IO.PUT( "TA1 - region_ident - rnid => " ); + UNSIGNED32_IO.PUT( RNID, WIDTH => 8, BASE => 16 ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT( "TA1 - region_get_segment - wait on " ); + TEXT_IO.PUT_LINE( "64 byte segment from region 1" ); + RTEMS.REGION.GET_SEGMENT( + SPTEST.REGION_ID( 1 ), + 64, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + SEGMENT_ADDRESS_1, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); + TEXT_IO.PUT( "TA1 - got segment from region 1 - " ); + SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_1 ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT( "TA1 - region_get_segment - wait on " ); + TEXT_IO.PUT_LINE( "128 byte segment from region 1" ); + RTEMS.REGION.GET_SEGMENT( + SPTEST.REGION_ID( 1 ), + 128, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + SEGMENT_ADDRESS_2, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); + TEXT_IO.PUT( "TA1 - got segment from region 1 - " ); + SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_2 ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT( "TA1 - region_get_segment - wait on " ); + TEXT_IO.PUT_LINE( "256 byte segment from region 1" ); + RTEMS.REGION.GET_SEGMENT( + SPTEST.REGION_ID( 1 ), + 256, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + SEGMENT_ADDRESS_3, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); + TEXT_IO.PUT( "TA1 - got segment from region 1 - " ); + SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_3 ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT( "TA1 - region_get_segment - wait on " ); + TEXT_IO.PUT_LINE( "512 byte segment from region 1" ); + RTEMS.REGION.GET_SEGMENT( + SPTEST.REGION_ID( 1 ), + 512, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + SEGMENT_ADDRESS_4, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); + TEXT_IO.PUT( "TA1 - got segment from region 1 - " ); + SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_4 ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT( "TA1 - region_get_segment - wait on " ); + TEXT_IO.PUT_LINE( "1024 byte segment from region 1" ); + RTEMS.REGION.GET_SEGMENT( + SPTEST.REGION_ID( 1 ), + 1024, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + SEGMENT_ADDRESS_5, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); + TEXT_IO.PUT( "TA1 - got segment from region 1 - " ); + SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_5 ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT( "TA1 - region_get_segment - wait on " ); + TEXT_IO.PUT_LINE( "2048 byte segment from region 1" ); + RTEMS.REGION.GET_SEGMENT( + SPTEST.REGION_ID( 1 ), + 2048, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + SEGMENT_ADDRESS_6, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); + TEXT_IO.PUT( "TA1 - got segment from region 1 - " ); + SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_6 ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT( "TA1 - region_get_segment - wait on " ); + TEXT_IO.PUT_LINE( "4096 byte segment from region 1" ); + RTEMS.REGION.GET_SEGMENT( + SPTEST.REGION_ID( 1 ), + 4096, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + SEGMENT_ADDRESS_7, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); + TEXT_IO.PUT( "TA1 - got segment from region 1 - " ); + SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_7 ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT( "TA1 - region_get_segment - wait on " ); + TEXT_IO.PUT_LINE( "8192 byte segment from region 1" ); + RTEMS.REGION.GET_SEGMENT( + SPTEST.REGION_ID( 1 ), + 8192, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + SEGMENT_ADDRESS_8, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); + TEXT_IO.PUT( "TA1 - got segment from region 1 - " ); + SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_8 ); + TEXT_IO.NEW_LINE; + +TEST_SUPPORT.PAUSE; + + TEXT_IO.PUT( + "TA1 - region_return_segment - return segment to region 1 - " + ); + SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_3 ); + RTEMS.REGION.RETURN_SEGMENT( + SPTEST.REGION_ID( 1 ), + SEGMENT_ADDRESS_3, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" ); + TEXT_IO.NEW_LINE; + -- SEGMENT_ADDRESS_3 := RTEMS.NULL_ADDRESS; + + TEXT_IO.PUT( + "TA1 - region_return_segment - return segment to region 1 - " + ); + SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_4 ); + RTEMS.REGION.RETURN_SEGMENT( + SPTEST.REGION_ID( 1 ), + SEGMENT_ADDRESS_4, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" ); + TEXT_IO.NEW_LINE; + -- SEGMENT_ADDRESS_4 := RTEMS.NULL_ADDRESS; + + TEXT_IO.PUT( + "TA1 - region_return_segment - return segment to region 1 - " + ); + SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_1 ); + RTEMS.REGION.RETURN_SEGMENT( + SPTEST.REGION_ID( 1 ), + SEGMENT_ADDRESS_1, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" ); + TEXT_IO.NEW_LINE; + -- SEGMENT_ADDRESS_1 := RTEMS.NULL_ADDRESS; + + TEXT_IO.PUT( + "TA1 - region_return_segment - return segment to region 1 - " + ); + SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_2 ); + RTEMS.REGION.RETURN_SEGMENT( + SPTEST.REGION_ID( 1 ), + SEGMENT_ADDRESS_2, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" ); + TEXT_IO.NEW_LINE; + -- SEGMENT_ADDRESS_2 := RTEMS.NULL_ADDRESS; + + TEXT_IO.PUT( + "TA1 - region_return_segment - return segment to region 1 - " + ); + SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_7 ); + RTEMS.REGION.RETURN_SEGMENT( + SPTEST.REGION_ID( 1 ), + SEGMENT_ADDRESS_7, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" ); + TEXT_IO.NEW_LINE; + -- SEGMENT_ADDRESS_7 := RTEMS.NULL_ADDRESS; + + TEXT_IO.PUT( + "TA1 - region_return_segment - return segment to region 1 - " + ); + SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_6 ); + RTEMS.REGION.RETURN_SEGMENT( + SPTEST.REGION_ID( 1 ), + SEGMENT_ADDRESS_6, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" ); + TEXT_IO.NEW_LINE; + -- SEGMENT_ADDRESS_6 := RTEMS.NULL_ADDRESS; + + TEXT_IO.PUT( + "TA1 - region_return_segment - return segment to region 1 - " + ); + SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_8 ); + RTEMS.REGION.RETURN_SEGMENT( + SPTEST.REGION_ID( 1 ), + SEGMENT_ADDRESS_8, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" ); + TEXT_IO.NEW_LINE; + -- SEGMENT_ADDRESS_8 := RTEMS.NULL_ADDRESS; + + TEXT_IO.PUT( + "TA1 - region_return_segment - return segment to region 1 - " + ); + SPTEST.PUT_ADDRESS_FROM_AREA_1( SEGMENT_ADDRESS_5 ); + RTEMS.REGION.RETURN_SEGMENT( + SPTEST.REGION_ID( 1 ), + SEGMENT_ADDRESS_5, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" ); + TEXT_IO.NEW_LINE; + -- SEGMENT_ADDRESS_5 := RTEMS.NULL_ADDRESS; + + TEXT_IO.PUT_LINE( + "TA1 - region_delete - walks heap if debug enabled" + ); + RTEMS.REGION.DELETE( SPTEST.REGION_ID( 1 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_DELETE OF RN1" ); + + TEXT_IO.PUT_LINE( "*** END OF TEST 25 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end TASK_1; + +end SPTEST; diff --git a/testsuites/ada/sptests/sp25/sptest.ads b/testsuites/ada/sptests/sp25/sptest.ads new file mode 100644 index 0000000000..21c27a38db --- /dev/null +++ b/testsuites/ada/sptests/sp25/sptest.ads @@ -0,0 +1,103 @@ +-- +-- SPTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 25 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; + +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 .. 2 ) of RTEMS.ID; + TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME; + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS regions created +-- by this test. +-- + + REGION_ID : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.ID; + REGION_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 2 ) of RTEMS.NAME; + +-- +-- The following constant defines the priority of most of the +-- RTEMS tasks in this test. This allows one of the tasks to +-- easily set itself to a higher priority than the rest. +-- + + BASE_PRIORITY : constant RTEMS.TASKS.PRIORITY := 140; + +-- +-- These arrays define the memory areas used for the regions in +-- this test. +-- + + AREA_1 : array ( RTEMS.UNSIGNED32 range 0 .. 64000 ) of RTEMS.UNSIGNED8; + for AREA_1'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- PUT_ADDRESS_FROM_AREA_1 +-- +-- DESCRIPTION: +-- +-- This subprogram prints the offset of the address TO_BE_PRINTED +-- from the first byte of AREA_1. +-- +-- NOTE: +-- +-- This subprogram is used because the actual address of AREA_1 +-- varies based upon the size of the executable, the target board, +-- and the target processor. +-- + + procedure PUT_ADDRESS_FROM_AREA_1 ( + TO_BE_PRINTED : in RTEMS.ADDRESS + ); + +-- +-- TASK_1 +-- +-- DESCRIPTION: +-- +-- This RTEMS task tests the Region Manager. +-- + + procedure TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_1); + +end SPTEST; diff --git a/testsuites/ada/sptests/spatcb01/Makefile.am b/testsuites/ada/sptests/spatcb01/Makefile.am new file mode 100644 index 0000000000..0e5dbaf652 --- /dev/null +++ b/testsuites/ada/sptests/spatcb01/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_spatcb01 +ada_spatcb01_SOURCES = spatcb01.adb config.h +ada_spatcb01_SOURCES += ../../support/init.c + +ada_spatcb01$(EXEEXT): spatcb01.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_spatcb01.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/sptests/spatcb01/ada_spatcb01.scn b/testsuites/ada/sptests/spatcb01/ada_spatcb01.scn new file mode 100644 index 0000000000..7738ff8a0e --- /dev/null +++ b/testsuites/ada/sptests/spatcb01/ada_spatcb01.scn @@ -0,0 +1,3 @@ +*** BEGIN OF TEST SPATCB 1 *** +foreign thread +*** END OF TEST SPATCB 1 *** diff --git a/testsuites/ada/sptests/spatcb01/config.h b/testsuites/ada/sptests/spatcb01/config.h new file mode 100644 index 0000000000..405b536c82 --- /dev/null +++ b/testsuites/ada/sptests/spatcb01/config.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2017 embedded brains GmbH + * + * The license and distribution terms for this file may in + * the file LICENSE in this distribution or at + * http://www.rtems.org/license/LICENSE. + */ + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 1 + +#include diff --git a/testsuites/ada/sptests/spatcb01/spatcb01.adb b/testsuites/ada/sptests/spatcb01/spatcb01.adb new file mode 100644 index 0000000000..19aaa8031f --- /dev/null +++ b/testsuites/ada/sptests/spatcb01/spatcb01.adb @@ -0,0 +1,26 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- Ensure that the SYSTEM.TASK_PRIMITIVES.OPERATIONS.SPECIFIC implementation +-- works. +-- +-- Copyright (c) 2017 embedded brains GmbH +-- +-- 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 TEXT_IO; +with System.Task_Primitives.Operations; +with System.Tasking; + +procedure SPATCB01 is + Self_Id : constant System.Tasking.Task_Id := System.Task_Primitives.Operations.Self; +begin + TEXT_IO.PUT_LINE( "*** BEGIN OF TEST SPATCB 1 ***" ); + TEXT_IO.PUT_LINE( Self_Id.Common.Task_Image( 1 .. Self_Id.Common.Task_Image_Len ) ); + TEXT_IO.PUT_LINE( "*** END OF TEST SPATCB 1 ***" ); +end SPATCB01; diff --git a/testsuites/ada/sptests/spname01/Makefile.am b/testsuites/ada/sptests/spname01/Makefile.am new file mode 100644 index 0000000000..fccab37289 --- /dev/null +++ b/testsuites/ada/sptests/spname01/Makefile.am @@ -0,0 +1,18 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +noinst_PROGRAMS = ada_spname01 +ada_spname01_SOURCES = spname01.adb config.h sptest.adb sptest.ads + +ada_spname01$(EXEEXT): spname01.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +init.$(OBJEXT): ../../support/init.c + $(COMPILE.c) -I$(srcdir) -c $< + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_spname01.scn + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/sptests/spname01/ada_spname01.scn b/testsuites/ada/sptests/spname01/ada_spname01.scn new file mode 100644 index 0000000000..825cd14437 --- /dev/null +++ b/testsuites/ada/sptests/spname01/ada_spname01.scn @@ -0,0 +1,3 @@ +*** Ada Task Name TEST *** +TBD +*** END OF Ada Task Name TEST *** diff --git a/testsuites/ada/sptests/spname01/config.h b/testsuites/ada/sptests/spname01/config.h new file mode 100644 index 0000000000..2be186cc2a --- /dev/null +++ b/testsuites/ada/sptests/spname01/config.h @@ -0,0 +1,31 @@ +/* config.h + * + * This include file defines the Configuration Table for this test. + * + * COPYRIGHT (c) 1989-2008. + * 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_APPLICATION + +/* NOTICE: the clock driver is explicitly disabled */ +#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#define CONFIGURE_MAXIMUM_TASKS 1 + +#include + +/* end of include file */ diff --git a/testsuites/ada/sptests/spname01/spname01.adb b/testsuites/ada/sptests/spname01/spname01.adb new file mode 100644 index 0000000000..863e64f24e --- /dev/null +++ b/testsuites/ada/sptests/spname01/spname01.adb @@ -0,0 +1,28 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test Hello of the Sample Test Suite. +-- +-- DEPENDENCIES: +-- +-- +-- +-- COPYRIGHT (c) 1989-2009. +-- 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. +-- + +procedure SPNAME01 is +begin + + loop + delay 120.0; + end loop; + +end SPNAME01; + diff --git a/testsuites/ada/sptests/spname01/sptest.adb b/testsuites/ada/sptests/spname01/sptest.adb new file mode 100644 index 0000000000..5dd78d8e4a --- /dev/null +++ b/testsuites/ada/sptests/spname01/sptest.adb @@ -0,0 +1,62 @@ +-- +-- SPTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of the Ada Task Name test of the RTEMS +-- Ada Single Processor Test Suite. +-- +-- DEPENDENCIES: +-- +-- +-- +-- COPYRIGHT (c) 1989-2009. +-- 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 TEST_SUPPORT; +with TEXT_IO; +with System; use System; -- for Null Pointer comparison + +package body SPTEST is + + task body AdaTask is + Status : RTEMS.Status_Codes; + Pointer : RTEMS.Address; + StringName : String(1 .. 120) := (1 .. 120 => '*' ); + NewName : constant String := "Josiah"; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** Ada Task Name TEST ***" ); + + RTEMS.Object_Get_Name( RTEMS.Self, StringName, Pointer ); + if Pointer = RTEMS.Null_Address then + TEXT_IO.PUT_LINE( "Object_Get_Name_Failed" ); + else + TEXT_IO.PUT_LINE( "My name is (" & StringName & ")" ); + end if; + + TEXT_IO.PUT_LINE( "Setting name to (Josiah)" ); + RTEMS.Object_Set_Name( RTEMS.Self, NewName, Status ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "Object_Set_Name" ); + + RTEMS.Object_Get_Name( RTEMS.Self, StringName, Pointer ); + if Pointer = RTEMS.Null_Address then + TEXT_IO.PUT_LINE( "Object_Get_Name_Failed" ); + else + TEXT_IO.PUT_LINE( "My name is (" & StringName & ")" ); + end if; + + TEXT_IO.PUT_LINE( "*** END OF Ada Task Name TEST ***" ); + + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end AdaTask; + +end SPTEST; diff --git a/testsuites/ada/sptests/spname01/sptest.ads b/testsuites/ada/sptests/spname01/sptest.ads new file mode 100644 index 0000000000..5e4f682221 --- /dev/null +++ b/testsuites/ada/sptests/spname01/sptest.ads @@ -0,0 +1,25 @@ +-- +-- SPTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for the Hello World Test of the RTEMS +-- Sample Test Suite. +-- +-- DEPENDENCIES: +-- +-- +-- +-- COPYRIGHT (c) 1989-2009. +-- 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. +-- + +package SPTEST is + + task AdaTask; + +end SPTEST; diff --git a/testsuites/ada/support/Makefile.am b/testsuites/ada/support/Makefile.am new file mode 100644 index 0000000000..2bd719349f --- /dev/null +++ b/testsuites/ada/support/Makefile.am @@ -0,0 +1,18 @@ +EXTRA_DIST = +EXTRA_DIST += address_io.adb +EXTRA_DIST += address_io.ads +EXTRA_DIST += float_io.ads +EXTRA_DIST += fp.inc +EXTRA_DIST += init.c +EXTRA_DIST += integer.inc +EXTRA_DIST += rtems_calling_overhead.ads +EXTRA_DIST += status_io.ads +EXTRA_DIST += test_support.adb +EXTRA_DIST += test_support.ads +EXTRA_DIST += time_test_support.adb +EXTRA_DIST += time_test_support.ads +EXTRA_DIST += timer_driver.adb +EXTRA_DIST += timer_driver.ads +EXTRA_DIST += unsigned32_io.ads + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/support/address_io.adb b/testsuites/ada/support/address_io.adb new file mode 100644 index 0000000000..f549f57ffe --- /dev/null +++ b/testsuites/ada/support/address_io.adb @@ -0,0 +1,43 @@ +-- +-- Address_IO / Specification +-- +-- DESCRIPTION: +-- +-- This package instantiates the IO routines necessary to +-- perform IO on data of the type System.Address. +-- +-- DEPENDENCIES: +-- +-- +-- +-- COPYRIGHT (c) 1989-2009. +-- 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 System.Storage_Elements; +with Text_IO; + +package body Address_IO is + + procedure Put ( + Item : in System.Address; + Width : in Natural := 8; + Base : in Natural := 16 + ) is + package Integer_IO is new TEXT_IO.Integer_IO( Integer ); + begin + + Integer_IO.Put( + Integer( System.Storage_Elements.To_Integer( Item ) ), + Width, + Base + ); + + end Put; + +end Address_IO; + diff --git a/testsuites/ada/support/address_io.ads b/testsuites/ada/support/address_io.ads new file mode 100644 index 0000000000..8a4fce98d3 --- /dev/null +++ b/testsuites/ada/support/address_io.ads @@ -0,0 +1,32 @@ +-- +-- ADDRESS_IO / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package instantiates the IO routines necessary to +-- perform IO on data of the type System.Address. +-- +-- DEPENDENCIES: +-- +-- +-- +-- COPYRIGHT (c) 1989-1997. +-- 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 System; + +package Address_IO is + + procedure Put ( + Item : in System.Address; + Width : in Natural := 8; + Base : in Natural := 16 + ); + +end Address_IO; + diff --git a/testsuites/ada/support/float_io.ads b/testsuites/ada/support/float_io.ads new file mode 100644 index 0000000000..5e1a90bf92 --- /dev/null +++ b/testsuites/ada/support/float_io.ads @@ -0,0 +1,24 @@ +-- +-- Float_IO / Specification +-- +-- Description: +-- +-- This package instantiates the IO routines necessary to +-- perform IO on data of the type Float. +-- +-- Dependencies: +-- +-- +-- +-- COPYRIGHT (c) 1989-1997. +-- 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 Text_IO; + +package Float_IO is new Text_IO.Float_IO( Float ); + diff --git a/testsuites/ada/support/fp.inc b/testsuites/ada/support/fp.inc new file mode 100644 index 0000000000..eb6f5528a9 --- /dev/null +++ b/testsuites/ada/support/fp.inc @@ -0,0 +1,151 @@ +-- +-- fp.inc +-- +-- Macros to produce a large number of LOCAL floating point variables. This +-- preprocessing is necessary to insure that the variables are +-- scoped properly and to avoid duplicating hundreds of lines +-- of code. +-- +-- +-- DEFICIENCIES: +-- +-- 1. This currently does not address whether or not the CPU +-- actually has hardware floating point. It just does the work. +-- +-- COPYRIGHT (c) 1989-1997. +-- 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. + +-- +-- private definitions for macro use +-- + +-- macro usage EPSILON() +define(`EPSILON',`0.0005') + +-- macro usage FP_CHECK_ONE( value, base, factor ) +define(`FP_CHECK_ONE',` + if ( $1 - ( $2 + $3 ) ) > EPSILON or else ( $1 - ( $2 + $3 ) ) < - EPSILON then + UNSIGNED32_IO.PUT( TASK_INDEX ); + TEXT_IO.PUT( ": $1 wrong -- (" ); + FLOAT_IO.PUT( $1 ); + TEXT_IO.PUT( " not " ); + FLOAT_IO.PUT( $2 + $3 ); + TEXT_IO.PUT_LINE( ")" ); + end if +' +) + +-- macro usage FP_DECLARE +define(`FP_DECLARE', ` + FP01 : FLOAT := 1.0; + FP02 : FLOAT := 2.0; + FP03 : FLOAT := 3.0; + FP04 : FLOAT := 4.0; + FP05 : FLOAT := 5.0; + FP06 : FLOAT := 6.0; + FP07 : FLOAT := 7.0; + FP08 : FLOAT := 8.0; + FP09 : FLOAT := 9.0; + FP10 : FLOAT := 10.0; + FP11 : FLOAT := 11.0; + FP12 : FLOAT := 12.0; + FP13 : FLOAT := 13.0; + FP14 : FLOAT := 14.0; + FP15 : FLOAT := 15.0; + FP16 : FLOAT := 16.0; + FP17 : FLOAT := 17.0; + FP18 : FLOAT := 18.0; + FP19 : FLOAT := 19.0; + FP20 : FLOAT := 20.0; + FP21 : FLOAT := 21.0; + FP22 : FLOAT := 22.0; + FP23 : FLOAT := 23.0; + FP24 : FLOAT := 24.0; + FP25 : FLOAT := 25.0; + FP26 : FLOAT := 26.0; + FP27 : FLOAT := 27.0; + FP28 : FLOAT := 28.0; + FP29 : FLOAT := 29.0; + FP30 : FLOAT := 30.0; + FP31 : FLOAT := 31.0; + FP32 : FLOAT := 32.0 +' +) + + +-- macro usage FP_LOAD( factor ) +define(`FP_LOAD',` + FP01 := FP01 + $1; + FP02 := FP02 + $1; + FP03 := FP03 + $1; + FP04 := FP04 + $1; + FP05 := FP05 + $1; + FP06 := FP06 + $1; + FP07 := FP07 + $1; + FP08 := FP08 + $1; + FP09 := FP09 + $1; + FP10 := FP10 + $1; + FP11 := FP11 + $1; + FP12 := FP12 + $1; + FP13 := FP13 + $1; + FP14 := FP14 + $1; + FP15 := FP15 + $1; + FP16 := FP16 + $1; + FP17 := FP17 + $1; + FP18 := FP18 + $1; + FP19 := FP19 + $1; + FP20 := FP20 + $1; + FP21 := FP21 + $1; + FP22 := FP22 + $1; + FP23 := FP23 + $1; + FP24 := FP24 + $1; + FP25 := FP25 + $1; + FP26 := FP26 + $1; + FP27 := FP27 + $1; + FP28 := FP28 + $1; + FP29 := FP29 + $1; + FP30 := FP30 + $1; + FP31 := FP31 + $1; + FP32 := FP32 + $1 +') + +-- macro usage FP_CHECK( factor ) +define(`FP_CHECK',` + FP_CHECK_ONE( FP01, 1.0, $1 ); + FP_CHECK_ONE( FP02, 2.0, $1 ); + FP_CHECK_ONE( FP03, 3.0, $1 ); + FP_CHECK_ONE( FP04, 4.0, $1 ); + FP_CHECK_ONE( FP05, 5.0, $1 ); + FP_CHECK_ONE( FP06, 6.0, $1 ); + FP_CHECK_ONE( FP07, 7.0, $1 ); + FP_CHECK_ONE( FP08, 8.0, $1 ); + FP_CHECK_ONE( FP09, 9.0, $1 ); + FP_CHECK_ONE( FP10, 10.0, $1 ); + FP_CHECK_ONE( FP11, 11.0, $1 ); + FP_CHECK_ONE( FP12, 12.0, $1 ); + FP_CHECK_ONE( FP13, 13.0, $1 ); + FP_CHECK_ONE( FP14, 14.0, $1 ); + FP_CHECK_ONE( FP15, 15.0, $1 ); + FP_CHECK_ONE( FP16, 16.0, $1 ); + FP_CHECK_ONE( FP17, 17.0, $1 ); + FP_CHECK_ONE( FP18, 18.0, $1 ); + FP_CHECK_ONE( FP19, 19.0, $1 ); + FP_CHECK_ONE( FP20, 20.0, $1 ); + FP_CHECK_ONE( FP21, 21.0, $1 ); + FP_CHECK_ONE( FP22, 22.0, $1 ); + FP_CHECK_ONE( FP23, 23.0, $1 ); + FP_CHECK_ONE( FP24, 24.0, $1 ); + FP_CHECK_ONE( FP25, 25.0, $1 ); + FP_CHECK_ONE( FP26, 26.0, $1 ); + FP_CHECK_ONE( FP27, 27.0, $1 ); + FP_CHECK_ONE( FP28, 28.0, $1 ); + FP_CHECK_ONE( FP29, 29.0, $1 ); + FP_CHECK_ONE( FP30, 30.0, $1 ); + FP_CHECK_ONE( FP31, 31.0, $1 ); + FP_CHECK_ONE( FP32, 32.0, $1 ) +' +) diff --git a/testsuites/ada/support/init.c b/testsuites/ada/support/init.c new file mode 100644 index 0000000000..968b17b3a4 --- /dev/null +++ b/testsuites/ada/support/init.c @@ -0,0 +1,82 @@ +/* + * COPYRIGHT (c) 1989-2015 + * On-Line Applications Research Corporation (OAR). + */ + +#include +#include + +#include + +/* + * This is the entry point automatically generated by GNAT. + */ +extern int gnat_main ( int argc, char **argv, char **envp ); + +static void *POSIX_Init( + void *argument +) +{ + (void) gnat_main ( 0, 0, 0 ); + + exit( 0 ); +} + +/* + * Prototypes for various test support routines. Since these are bound to + * from Ada, there are no external .h files even though they must be public. + */ +uint32_t milliseconds_per_tick(void); +uint32_t ticks_per_second(void); +uint32_t work_space_size(void); +uint32_t is_configured_multiprocessing(void); +uint32_t get_node(void); +rtems_id tcb_to_id(Thread_Control *tcb); + +/* + * By putting this in brackets rather than quotes, we get the search + * path and can get this file from ".." in the mptests. + */ +#define CONFIGURE_INIT +#define CONFIGURE_GNAT_RTEMS +#define CONFIGURE_MEMORY_OVERHEAD (256) + +#include + +rtems_id tcb_to_id( + Thread_Control *tcb +) +{ + return tcb->Object.id; /* Only for sp04 */ +} + +uint32_t milliseconds_per_tick(void) +{ + return CONFIGURE_MICROSECONDS_PER_TICK / 1000; +} + +uint32_t ticks_per_second(void) +{ + return rtems_clock_get_ticks_per_second(); +} + +uint32_t work_space_size(void) +{ + return CONFIGURE_EXECUTIVE_RAM_SIZE; +} + +uint32_t is_configured_multiprocessing(void) +{ +#if defined(RTEMS_MULTIPROCESSING) + return 1; +#else + return 0; +#endif +} + +uint32_t get_node(void) +{ + /* XXX HACK -- use public API */ + return _Objects_Local_node; +} + diff --git a/testsuites/ada/support/integer.inc b/testsuites/ada/support/integer.inc new file mode 100644 index 0000000000..c47f68efd4 --- /dev/null +++ b/testsuites/ada/support/integer.inc @@ -0,0 +1,142 @@ +-- +-- integer.inc +-- +-- Macros to produce a large number of LOCAL integer variables. This +-- preprocessing is necessary to insure that the variables are +-- scoped properly and to avoid duplicating hundreds of lines +-- of code. +-- +-- COPYRIGHT (c) 1989-1997. +-- 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. + +-- +-- private definitions for macro use +-- + +-- macro usage INTEGER_CHECK_ONE( value, base, factor ) +define(`INTEGER_CHECK_ONE',` + if $1 /= ($2 + $3) then + UNSIGNED32_IO.PUT( TASK_INDEX ); + TEXT_IO.PUT( ": $1 wrong -- (" ); + UNSIGNED32_IO.PUT( $1, BASE => 16); + TEXT_IO.PUT( " not " ); + UNSIGNED32_IO.PUT( $2, BASE => 16 ); + TEXT_IO.PUT_LINE( ")" ); + end if +' +) + +-- macro usage INTEGER_DECLARE +define(`INTEGER_DECLARE', ` + INT01 : RTEMS.UNSIGNED32 := 1; + INT02 : RTEMS.UNSIGNED32 := 2; + INT03 : RTEMS.UNSIGNED32 := 3; + INT04 : RTEMS.UNSIGNED32 := 4; + INT05 : RTEMS.UNSIGNED32 := 5; + INT06 : RTEMS.UNSIGNED32 := 6; + INT07 : RTEMS.UNSIGNED32 := 7; + INT08 : RTEMS.UNSIGNED32 := 8; + INT09 : RTEMS.UNSIGNED32 := 9; + INT10 : RTEMS.UNSIGNED32 := 10; + INT11 : RTEMS.UNSIGNED32 := 11; + INT12 : RTEMS.UNSIGNED32 := 12; + INT13 : RTEMS.UNSIGNED32 := 13; + INT14 : RTEMS.UNSIGNED32 := 14; + INT15 : RTEMS.UNSIGNED32 := 15; + INT16 : RTEMS.UNSIGNED32 := 16; + INT17 : RTEMS.UNSIGNED32 := 17; + INT18 : RTEMS.UNSIGNED32 := 18; + INT19 : RTEMS.UNSIGNED32 := 19; + INT20 : RTEMS.UNSIGNED32 := 20; + INT21 : RTEMS.UNSIGNED32 := 21; + INT22 : RTEMS.UNSIGNED32 := 22; + INT23 : RTEMS.UNSIGNED32 := 23; + INT24 : RTEMS.UNSIGNED32 := 24; + INT25 : RTEMS.UNSIGNED32 := 25; + INT26 : RTEMS.UNSIGNED32 := 26; + INT27 : RTEMS.UNSIGNED32 := 27; + INT28 : RTEMS.UNSIGNED32 := 28; + INT29 : RTEMS.UNSIGNED32 := 29; + INT30 : RTEMS.UNSIGNED32 := 30; + INT31 : RTEMS.UNSIGNED32 := 31; + INT32 : RTEMS.UNSIGNED32 := 32 +' +) + + +-- macro usage INTEGER_LOAD( factor ) +define(`INTEGER_LOAD',` + INT01 := INT01 + $1; + INT02 := INT02 + $1; + INT03 := INT03 + $1; + INT04 := INT04 + $1; + INT05 := INT05 + $1; + INT06 := INT06 + $1; + INT07 := INT07 + $1; + INT08 := INT08 + $1; + INT09 := INT09 + $1; + INT10 := INT10 + $1; + INT11 := INT11 + $1; + INT12 := INT12 + $1; + INT13 := INT13 + $1; + INT14 := INT14 + $1; + INT15 := INT15 + $1; + INT16 := INT16 + $1; + INT17 := INT17 + $1; + INT18 := INT18 + $1; + INT19 := INT19 + $1; + INT20 := INT20 + $1; + INT21 := INT21 + $1; + INT22 := INT22 + $1; + INT23 := INT23 + $1; + INT24 := INT24 + $1; + INT25 := INT25 + $1; + INT26 := INT26 + $1; + INT27 := INT27 + $1; + INT28 := INT28 + $1; + INT29 := INT29 + $1; + INT30 := INT30 + $1; + INT31 := INT31 + $1; + INT32 := INT32 + $1 +') + +-- macro usage INTEGER_CHECK( factor ) +define(`INTEGER_CHECK',` + INTEGER_CHECK_ONE( INT01, 1, $1 ); + INTEGER_CHECK_ONE( INT02, 2, $1 ); + INTEGER_CHECK_ONE( INT03, 3, $1 ); + INTEGER_CHECK_ONE( INT04, 4, $1 ); + INTEGER_CHECK_ONE( INT05, 5, $1 ); + INTEGER_CHECK_ONE( INT06, 6, $1 ); + INTEGER_CHECK_ONE( INT07, 7, $1 ); + INTEGER_CHECK_ONE( INT08, 8, $1 ); + INTEGER_CHECK_ONE( INT09, 9, $1 ); + INTEGER_CHECK_ONE( INT10, 10, $1 ); + INTEGER_CHECK_ONE( INT11, 11, $1 ); + INTEGER_CHECK_ONE( INT12, 12, $1 ); + INTEGER_CHECK_ONE( INT13, 13, $1 ); + INTEGER_CHECK_ONE( INT14, 14, $1 ); + INTEGER_CHECK_ONE( INT15, 15, $1 ); + INTEGER_CHECK_ONE( INT16, 16, $1 ); + INTEGER_CHECK_ONE( INT17, 17, $1 ); + INTEGER_CHECK_ONE( INT18, 18, $1 ); + INTEGER_CHECK_ONE( INT19, 19, $1 ); + INTEGER_CHECK_ONE( INT20, 20, $1 ); + INTEGER_CHECK_ONE( INT21, 21, $1 ); + INTEGER_CHECK_ONE( INT22, 22, $1 ); + INTEGER_CHECK_ONE( INT23, 23, $1 ); + INTEGER_CHECK_ONE( INT24, 24, $1 ); + INTEGER_CHECK_ONE( INT25, 25, $1 ); + INTEGER_CHECK_ONE( INT26, 26, $1 ); + INTEGER_CHECK_ONE( INT27, 27, $1 ); + INTEGER_CHECK_ONE( INT28, 28, $1 ); + INTEGER_CHECK_ONE( INT29, 29, $1 ); + INTEGER_CHECK_ONE( INT30, 30, $1 ); + INTEGER_CHECK_ONE( INT31, 31, $1 ); + INTEGER_CHECK_ONE( INT32, 32, $1 ) +' +) diff --git a/testsuites/ada/support/rtems_calling_overhead.ads b/testsuites/ada/support/rtems_calling_overhead.ads new file mode 100644 index 0000000000..5f94e0505a --- /dev/null +++ b/testsuites/ada/support/rtems_calling_overhead.ads @@ -0,0 +1,102 @@ +-- +-- RTEMS_CALLING_OVERHEAD / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package contains the invocation overhead for each +-- of the RTEMS directives on the MC68020 Timing Platform. +-- This time is then subtracted from the execution time +-- of each directive as measured by the Timing Suite. +-- +-- DEPENDENCIES: +-- +-- +-- +-- COPYRIGHT (c) 1989-1997. +-- 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; + +package RTEMS_CALLING_OVERHEAD is + + INITIALIZE_EXECUTIVE : constant RTEMS.UNSIGNED32 := 0; + SHUTDOWN_EXECUTIVE : constant RTEMS.UNSIGNED32 := 0; + TASK_CREATE : constant RTEMS.UNSIGNED32 := 0; + TASK_IDENT : constant RTEMS.UNSIGNED32 := 0; + TASK_START : constant RTEMS.UNSIGNED32 := 0; + TASK_RESTART : constant RTEMS.UNSIGNED32 := 0; + TASK_DELETE : constant RTEMS.UNSIGNED32 := 0; + TASK_SUSPEND : constant RTEMS.UNSIGNED32 := 0; + TASK_RESUME : constant RTEMS.UNSIGNED32 := 0; + TASK_SET_PRIORITY : constant RTEMS.UNSIGNED32 := 0; + TASK_MODE : constant RTEMS.UNSIGNED32 := 0; + TASK_GET_NOTE : constant RTEMS.UNSIGNED32 := 0; + TASK_SET_NOTE : constant RTEMS.UNSIGNED32 := 0; + TASK_WAKE_WHEN : constant RTEMS.UNSIGNED32 := 0; + TASK_WAKE_AFTER : constant RTEMS.UNSIGNED32 := 0; + INTERRUPT_CATCH : constant RTEMS.UNSIGNED32 := 0; + CLOCK_GET : constant RTEMS.UNSIGNED32 := 0; + CLOCK_SET : constant RTEMS.UNSIGNED32 := 0; + CLOCK_TICK : constant RTEMS.UNSIGNED32 := 0; + + TIMER_CREATE : constant RTEMS.UNSIGNED32 := 0; + TIMER_DELETE : constant RTEMS.UNSIGNED32 := 0; + TIMER_IDENT : constant RTEMS.UNSIGNED32 := 0; + TIMER_FIRE_AFTER : constant RTEMS.UNSIGNED32 := 0; + TIMER_FIRE_WHEN : constant RTEMS.UNSIGNED32 := 0; + TIMER_RESET : constant RTEMS.UNSIGNED32 := 0; + TIMER_CANCEL : constant RTEMS.UNSIGNED32 := 0; + SEMAPHORE_CREATE : constant RTEMS.UNSIGNED32 := 0; + SEMAPHORE_DELETE : constant RTEMS.UNSIGNED32 := 0; + SEMAPHORE_IDENT : constant RTEMS.UNSIGNED32 := 0; + SEMAPHORE_OBTAIN : constant RTEMS.UNSIGNED32 := 0; + SEMAPHORE_RELEASE : constant RTEMS.UNSIGNED32 := 0; + MESSAGE_QUEUE_CREATE : constant RTEMS.UNSIGNED32 := 0; + MESSAGE_QUEUE_IDENT : constant RTEMS.UNSIGNED32 := 0; + MESSAGE_QUEUE_DELETE : constant RTEMS.UNSIGNED32 := 0; + MESSAGE_QUEUE_SEND : constant RTEMS.UNSIGNED32 := 0; + MESSAGE_QUEUE_URGENT : constant RTEMS.UNSIGNED32 := 0; + MESSAGE_QUEUE_BROADCAST : constant RTEMS.UNSIGNED32 := 0; + MESSAGE_QUEUE_RECEIVE : constant RTEMS.UNSIGNED32 := 0; + MESSAGE_QUEUE_FLUSH : constant RTEMS.UNSIGNED32 := 0; + + EVENT_SEND : constant RTEMS.UNSIGNED32 := 0; + EVENT_RECEIVE : constant RTEMS.UNSIGNED32 := 0; + SIGNAL_CATCH : constant RTEMS.UNSIGNED32 := 0; + SIGNAL_SEND : constant RTEMS.UNSIGNED32 := 0; + PARTITION_CREATE : constant RTEMS.UNSIGNED32 := 0; + PARTITION_IDENT : constant RTEMS.UNSIGNED32 := 0; + PARTITION_DELETE : constant RTEMS.UNSIGNED32 := 0; + PARTITION_GET_BUFFER : constant RTEMS.UNSIGNED32 := 0; + PARTITION_RETURN_BUFFER : constant RTEMS.UNSIGNED32 := 0; + REGION_CREATE : constant RTEMS.UNSIGNED32 := 0; + REGION_IDENT : constant RTEMS.UNSIGNED32 := 0; + REGION_DELETE : constant RTEMS.UNSIGNED32 := 0; + REGION_GET_SEGMENT : constant RTEMS.UNSIGNED32 := 0; + REGION_RETURN_SEGMENT : constant RTEMS.UNSIGNED32 := 0; + PORT_CREATE : constant RTEMS.UNSIGNED32 := 0; + PORT_IDENT : constant RTEMS.UNSIGNED32 := 0; + PORT_DELETE : constant RTEMS.UNSIGNED32 := 0; + PORT_EXTERNAL_TO_INTERNAL : constant RTEMS.UNSIGNED32 := 0; + PORT_INTERNAL_TO_EXTERNAL : constant RTEMS.UNSIGNED32 := 0; + + IO_INITIALIZE : constant RTEMS.UNSIGNED32 := 0; + IO_OPEN : constant RTEMS.UNSIGNED32 := 0; + IO_CLOSE : constant RTEMS.UNSIGNED32 := 0; + IO_READ : constant RTEMS.UNSIGNED32 := 0; + IO_WRITE : constant RTEMS.UNSIGNED32 := 0; + IO_CONTROL : constant RTEMS.UNSIGNED32 := 0; + FATAL_ERROR_OCCURRED : constant RTEMS.UNSIGNED32 := 0; + RATE_MONOTONIC_CREATE : constant RTEMS.UNSIGNED32 := 0; + RATE_MONOTONIC_IDENT : constant RTEMS.UNSIGNED32 := 0; + RATE_MONOTONIC_DELETE : constant RTEMS.UNSIGNED32 := 0; + RATE_MONOTONIC_CANCEL : constant RTEMS.UNSIGNED32 := 0; + RATE_MONOTONIC_PERIOD : constant RTEMS.UNSIGNED32 := 0; + MULTIPROCESSING_ANNOUNCE : constant RTEMS.UNSIGNED32 := 0; + +end RTEMS_CALLING_OVERHEAD; diff --git a/testsuites/ada/support/status_io.ads b/testsuites/ada/support/status_io.ads new file mode 100644 index 0000000000..301e7a2ba1 --- /dev/null +++ b/testsuites/ada/support/status_io.ads @@ -0,0 +1,25 @@ +-- +-- Status_IO / Specification +-- +-- DESCRIPTION: +-- +-- This package instantiates the IO routines necessary to +-- perform IO on data of the type Status.CODES. +-- +-- DEPENDENCIES: +-- +-- +-- +-- COPYRIGHT (c) 1989-1997. +-- 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 Text_IO; + +package Status_IO is new Text_IO.Enumeration_IO( RTEMS.Status_Codes ); + diff --git a/testsuites/ada/support/test_support.adb b/testsuites/ada/support/test_support.adb new file mode 100644 index 0000000000..bc636cee11 --- /dev/null +++ b/testsuites/ada/support/test_support.adb @@ -0,0 +1,266 @@ +-- +-- Test_Support / Specification +-- +-- DESCRIPTION: +-- +-- This package provides routines which aid the Test Suites +-- and simplify their design and operation. +-- +-- 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 Interfaces; use Interfaces; +with Unsigned32_IO; +with Status_IO; +with Text_IO; +with RTEMS.Fatal; + +package body Test_Support is + +-- +-- Fatal_Directive_Status +-- + + procedure Fatal_Directive_Status ( + Status : in RTEMS.Status_Codes; + Desired : in RTEMS.Status_Codes; + Message : in String + ) is + begin + + if not RTEMS.Are_Statuses_Equal( Status, Desired ) then + + Text_IO.Put( Message ); + Text_IO.Put( " FAILED -- expected " ); + Status_IO.Put( Desired ); + Text_IO.Put( " got " ); + Status_IO.Put( Status ); + Text_IO.New_Line; + + RTEMS.Fatal.Error_Occurred( RTEMS.Status_Codes'Pos( Status ) ); + + end if; + + end Fatal_Directive_Status; + +-- +-- Directive_Failed +-- + + procedure Directive_Failed ( + Status : in RTEMS.Status_Codes; + Message : in String + ) is + begin + + Test_Support.Fatal_Directive_Status( + Status, + RTEMS.Successful, + Message + ); + + end Directive_Failed; + +-- +-- Print_Time +-- + + procedure Print_Time ( + Prefix : in String; + Time_Buffer : in RTEMS.Time_Of_Day; + Suffix : in String + ) is + begin + + Text_IO.Put( Prefix ); + Unsigned32_IO.Put( Time_Buffer.Hour, Width=>2 ); + Text_IO.Put( ":" ); + Unsigned32_IO.Put( Time_Buffer.Minute, Width=>2 ); + Text_IO.Put( ":" ); + Unsigned32_IO.Put( Time_Buffer.Second, Width=>2 ); + Text_IO.Put( " " ); + Unsigned32_IO.Put( Time_Buffer.Month, Width=>2 ); + Text_IO.Put( "/" ); + Unsigned32_IO.Put( Time_Buffer.Day, Width=>2 ); + Text_IO.Put( "/" ); + Unsigned32_IO.Put( Time_Buffer.Year, Width=>2 ); + Text_IO.Put( Suffix ); + + end Print_Time; + +-- +-- Put_Dot +-- + + procedure Put_Dot ( + Buffer : in String + ) is + begin + Text_IO.Put( Buffer ); + Text_IO.FLUSH; + end Put_Dot; + +-- +-- Pause +-- + + procedure Pause is + -- Ignored_String : String( 1 .. 80 ); + -- Ignored_Last : Natural; + + begin + + -- + -- Really should be a "put" followed by a "flush." + -- + Text_IO.Put_Line( " " ); + -- Text_IO.Get_Line( Ignored_String, Ignored_Last ); + + end Pause; + +-- +-- Pause_And_Screen_Number +-- + + procedure Pause_And_Screen_Number ( + SCREEN : in RTEMS.Unsigned32 + ) is + -- Ignored_String : String( 1 .. 80 ); + -- Ignored_Last : Natural; + begin + + -- + -- Really should be a "put" followed by a "flush." + -- + Text_IO.Put( "2 ); + Text_IO.Put_Line( "> " ); + -- Text_IO.Get_Line( Ignored_String, Ignored_Last ); + + end Pause_And_Screen_Number; + +-- +-- Put_Name +-- + + procedure Put_Name ( + Name : in RTEMS.Name; + New_Line : in Boolean + ) is + C1 : Character; + C2 : Character; + C3 : Character; + C4 : Character; + begin + + RTEMS.Name_To_Characters( Name, C1, C2, C3, C4 ); + + Text_IO.Put( C1 ); + Text_IO.Put( C2 ); + Text_IO.Put( C3 ); + Text_IO.Put( C4 ); + + if New_Line then + Text_IO.New_Line; + end if; + + end Put_Name; + +-- +-- Task_Number +-- + + function Task_Number ( + TID : in RTEMS.ID + ) return RTEMS.Unsigned32 is + begin + + -- probably OK + return RTEMS.Get_Index( TID ) - 1; + + end Task_Number; + +-- +-- Do_Nothing +-- + + procedure Do_Nothing is + begin + NULL; + end Do_Nothing; + + +-- +-- Milliseconds_Per_Tick +-- + + function Milliseconds_Per_Tick + return RTEMS.Unsigned32 is + function Milliseconds_Per_Tick_Base return RTEMS.Unsigned32; + pragma Import (C, Milliseconds_Per_Tick_Base, "milliseconds_per_tick"); + begin + return Milliseconds_Per_Tick_Base; + end Milliseconds_Per_Tick; + +-- +-- Milliseconds_Per_Tick +-- + function Ticks_Per_Second + return RTEMS.Interval is + function Ticks_Per_Second_Base return RTEMS.Unsigned32; + pragma Import (C, Ticks_Per_Second_Base, "ticks_per_second"); + begin + return Ticks_Per_Second_Base; + end Ticks_Per_Second; + +-- +-- Return the size of the RTEMS Workspace +-- + + function Work_Space_Size + return RTEMS.Unsigned32 is + function Work_Space_Size_Base return RTEMS.Unsigned32; + pragma Import (C, Work_Space_Size_Base, "work_space_size"); + begin + return Work_Space_Size_Base; + end Work_Space_Size; + +-- +-- Return an indication of whether multiprocessing is configured +-- + + function Is_Configured_Multiprocessing + return Boolean is + function Is_Configured_Multiprocessing_Base return RTEMS.Unsigned32; + pragma Import ( + C, Is_Configured_Multiprocessing_Base, "is_configured_multiprocessing" + ); + begin + if Is_Configured_Multiprocessing_Base = 1 then + return True; + else + return False; + end if; + end Is_Configured_Multiprocessing; + +-- +-- Node is the node number in a multiprocessor configuration +-- + + function Node + return RTEMS.Unsigned32 is + function Get_Node_Base return RTEMS.Unsigned32; + pragma Import (C, Get_Node_Base, "get_node"); + begin + return Get_Node_Base; + end Node; +end Test_Support; diff --git a/testsuites/ada/support/test_support.ads b/testsuites/ada/support/test_support.ads new file mode 100644 index 0000000000..e41bf834ed --- /dev/null +++ b/testsuites/ada/support/test_support.ads @@ -0,0 +1,195 @@ +-- +-- Test_Support / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package provides routines which aid the Test Suites +-- and simplify their design and operation. +-- +-- DEPENDENCIES: +-- +-- +-- +-- COPYRIGHT (c) 1989-2009. +-- 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; + +package Test_Support is + +-- +-- Fatal_Directive_Status +-- +-- DESCRIPTION: +-- +-- This subprogram checks if Status is equal to Desired. If so, it +-- returns immediately. Otherwise, it prints the Message along with +-- the Status and Desired status and invokes the Fatal_Error_Occurred +-- directive. +-- + + procedure Fatal_Directive_Status ( + Status : in RTEMS.Status_Codes; + Desired : in RTEMS.Status_Codes; + Message : in STRING + ); + pragma Inline ( Fatal_Directive_Status ); + +-- Directive_Failed +-- +-- DESCRIPTION: +-- +-- This subprogram checks if Status is equal to Successful. If so, it +-- returns immediately. Otherwise, it prints the Message along with +-- the Status and Desired status and invokes the Fatal_Error_Occurred +-- + + procedure Directive_Failed ( + Status : in RTEMS.Status_Codes; + Message : in STRING + ); + pragma Inline ( Directive_Failed ); + +-- +-- Print_Time +-- +-- DESCRIPTION: +-- +-- This subprogram prints the Prefix string, following by the +-- time of day in Time_Buffer, followed by the Suffix. +-- + + procedure Print_Time ( + Prefix : in STRING; + Time_Buffer : in RTEMS.Time_Of_Day; + Suffix : in STRING + ); + pragma Inline ( Print_Time ); + +-- +-- Put_Dot +-- +-- DESCRIPTION: +-- +-- This subprogram prints a single character without a carriage return. +-- + + procedure Put_Dot ( + Buffer : in STRING + ); + pragma Inline ( Put_Dot ); + +-- +-- Pause +-- +-- DESCRIPTION: +-- +-- This subprogram is used to pause screen output in the Test Suites +-- until the user presses carriage return. +-- + + procedure Pause; + +-- +-- Pause_And_Screen_Number +-- +-- DESCRIPTION: +-- +-- This subprogram is used to pause screen output and print the current +-- number in the Test Suites until the user presses carriage return. +-- + + procedure Pause_And_Screen_Number ( + SCREEN : in RTEMS.Unsigned32 + ); + +-- +-- Put_Name +-- +-- DESCRIPTION: +-- +-- This subprogram prints the RTEMS object Name. If New_Line is TRUE, +-- then a carriage return is printed after the Name. +-- + + procedure Put_Name ( + Name : in RTEMS.Name; + New_Line : in Boolean + ); + +-- +-- Task_Number +-- +-- DESCRIPTION: +-- +-- This function returns the task index which the test should use +-- for TID. +-- + + function Task_Number ( + TID : in RTEMS.ID + ) return RTEMS.Unsigned32; + pragma Inline ( Task_Number ); + +-- +-- Do_Nothing +-- +-- DESCRIPTION: +-- +-- This procedure is called when a test wishes to use a delay +-- loop and insure that the compiler does not optimize it away. +-- + + procedure Do_Nothing; + +-- +-- Ticks_Per_Second is the number of RTEMS clock ticks which +-- occur each second. +-- + + function Ticks_Per_Second + return RTEMS.Interval; + +-- +-- Milliseconds_Per_Tick is the number of milliseconds which +-- occur between each RTEMS clock tick. +-- + + function Milliseconds_Per_Tick + return RTEMS.Unsigned32; + +-- +-- Return the size of the RTEMS Workspace +-- + + function Work_Space_Size + return RTEMS.Unsigned32; + +-- +-- Return an indication of whether multiprocessing is configured +-- + + function Is_Configured_Multiprocessing + return Boolean; + +-- +-- Node is the node number in a multiprocessor configuration +-- + + function Node + return RTEMS.Unsigned32; + +-- +-- Longest time in seconds to run a test +-- + + MAXIMUM_LONG_TEST_DURATION : RTEMS.UNSIGNED32; + +private + +end Test_Support; diff --git a/testsuites/ada/support/time_test_support.adb b/testsuites/ada/support/time_test_support.adb new file mode 100644 index 0000000000..aab0c75dfe --- /dev/null +++ b/testsuites/ada/support/time_test_support.adb @@ -0,0 +1,73 @@ +-- +-- TIME_TEST_SUPPORT / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package provides routines which aid the individual tests in +-- the Timing Test Suite and simplify their design and operation. +-- +-- DEPENDENCIES: +-- +-- +-- +-- COPYRIGHT (c) 1989-2009. +-- 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 INTERFACES; use INTERFACES; +with TEXT_IO; +with UNSIGNED32_IO; + +package body TIME_TEST_SUPPORT is + +--PAGE +-- +-- PUT_TIME +-- + + procedure PUT_TIME ( + MESSAGE : in STRING; + TOTAL_TIME : in RTEMS.UNSIGNED32; + ITERATIONS : in RTEMS.UNSIGNED32; + LOOP_OVERHEAD : in RTEMS.UNSIGNED32; + CALLING_OVERHEAD : in RTEMS.UNSIGNED32 + ) is + PER_ITERATION : RTEMS.UNSIGNED32; + begin + + PER_ITERATION := (TOTAL_TIME - LOOP_OVERHEAD) / ITERATIONS; + PER_ITERATION := PER_ITERATION - CALLING_OVERHEAD; + + if PER_ITERATION = 0 then + + TEXT_IO.PUT( "TOTAL_TIME " ); + UNSIGNED32_IO.PUT( TOTAL_TIME ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT( "ITERATIONS " ); + UNSIGNED32_IO.PUT( ITERATIONS ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT( "LOOP_OVERHEAD " ); + UNSIGNED32_IO.PUT( LOOP_OVERHEAD ); + TEXT_IO.NEW_LINE; + + TEXT_IO.PUT( "CALLING_OVERHEAD " ); + UNSIGNED32_IO.PUT( CALLING_OVERHEAD ); + TEXT_IO.NEW_LINE; + + end if; + + TEXT_IO.PUT( MESSAGE ); + TEXT_IO.PUT( " " ); + UNSIGNED32_IO.PUT( PER_ITERATION ); + TEXT_IO.NEW_LINE; + TEXT_IO.FLUSH; + + end PUT_TIME; + +end TIME_TEST_SUPPORT; diff --git a/testsuites/ada/support/time_test_support.ads b/testsuites/ada/support/time_test_support.ads new file mode 100644 index 0000000000..aeed677ba2 --- /dev/null +++ b/testsuites/ada/support/time_test_support.ads @@ -0,0 +1,51 @@ +-- +-- TIME_TEST_SUPPORT / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package provides routines which aid the individual tests in +-- the Timing Test Suite and simplify their design and operation. +-- +-- DEPENDENCIES: +-- +-- +-- +-- COPYRIGHT (c) 1989-1997. +-- 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; + +package TIME_TEST_SUPPORT is + +-- +-- The following constants define the number of times a directive +-- will be performed in the Timing Suite. +-- + + OPERATION_COUNT : constant RTEMS.UNSIGNED32 := 100; + ITERATION_COUNT : constant RTEMS.UNSIGNED32 := 100; + +-- +-- PUT_TIME +-- +-- DESCRIPTION: +-- +-- This subprogram prints the MESSAGE followed by the length of +-- time which each individual operation took. All times are +-- in microseconds. +-- + + procedure PUT_TIME ( + MESSAGE : in STRING; + TOTAL_TIME : in RTEMS.UNSIGNED32; + ITERATIONS : in RTEMS.UNSIGNED32; + LOOP_OVERHEAD : in RTEMS.UNSIGNED32; + CALLING_OVERHEAD : in RTEMS.UNSIGNED32 + ); + +end TIME_TEST_SUPPORT; diff --git a/testsuites/ada/support/timer_driver.adb b/testsuites/ada/support/timer_driver.adb new file mode 100644 index 0000000000..389499ccc8 --- /dev/null +++ b/testsuites/ada/support/timer_driver.adb @@ -0,0 +1,59 @@ +-- +-- Timer_Driver / Body +-- +-- Description: +-- +-- This package is the body for the Timer Driver. +-- +-- Dependencies: +-- +-- +-- +-- COPYRIGHT (c) 1989-2009. +-- 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 Interfaces; + +package body Timer_Driver is + +--PAGE +-- +-- Empty_function +-- +-- + procedure Empty_Function + is + begin + Null; + end Empty_Function; + +--PAGE +-- +-- Set_Find_Average_Overhead +-- +-- + + procedure Set_Find_Average_Overhead ( + Find_Flag : in Standard.Boolean + ) is + procedure Set_Find_Average_Overhead_base ( + Find_Flag : in Interfaces.Unsigned_8 + ); + pragma Import (C, Set_Find_Average_Overhead_base, + "benchmark_timer_disable_subtracting_average_overhead"); + c: Interfaces.Unsigned_8; + begin + if Find_Flag then + c := 1; + else + c := 0; + end if; + Set_Find_Average_Overhead_base (c); + end Set_Find_Average_Overhead; + +end Timer_Driver; diff --git a/testsuites/ada/support/timer_driver.ads b/testsuites/ada/support/timer_driver.ads new file mode 100644 index 0000000000..00642dfe90 --- /dev/null +++ b/testsuites/ada/support/timer_driver.ads @@ -0,0 +1,77 @@ +-- +-- Timer_Driver / Specification +-- +-- Description: +-- +-- This package is the specification for the Timer Driver. +-- +-- Dependencies: +-- +-- +-- +-- COPYRIGHT (c) 1989-1997. +-- 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; + +package Timer_Driver is + +-- +-- Initialize +-- +-- Description: +-- +-- This subprogram initializes the hardware timer to start it. +-- + + procedure Initialize; + pragma Import (C, Initialize, "benchmark_timer_initialize"); + +-- +-- Read_Timer +-- +-- Description: +-- +-- This subprogram stops the timer, calculates the length of time +-- in microseconds since the timer was started, and returns that +-- value. +-- + + function Read_Timer + return RTEMS.Unsigned32; + pragma Import (C, Read_Timer, "benchmark_timer_read"); + +-- +-- Empty_Function +-- +-- Description: +-- +-- This subprogram is an empty subprogram. It is used to +-- insure that a loop will be included in the final executable +-- so that loop overhead can be subtracted from the directive +-- times reported. +-- + + procedure Empty_Function; + +-- +-- Set_Find_Average_Overhead +-- +-- Description: +-- +-- This subprogram sets the Find_Average_Overhead flag to the +-- the value passed. +-- + + procedure Set_Find_Average_Overhead ( + Find_Flag : in Standard.Boolean + ); + +private + +end Timer_Driver; diff --git a/testsuites/ada/support/unsigned32_io.ads b/testsuites/ada/support/unsigned32_io.ads new file mode 100644 index 0000000000..4d1a7e6e87 --- /dev/null +++ b/testsuites/ada/support/unsigned32_io.ads @@ -0,0 +1,25 @@ +-- +-- Unsigned32_IO / Specification +-- +-- DESCRIPTION: +-- +-- This package instantiates the IO routines necessary to +-- perform IO on data of the type RTEMS.Unsigned32. +-- +-- DEPENDENCIES: +-- +-- +-- +-- COPYRIGHT (c) 1989-1997. +-- 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 Text_IO; + +package Unsigned32_IO is new Text_IO.Modular_IO( RTEMS.Unsigned32 ); + diff --git a/testsuites/ada/tmtests/Makefile.am b/testsuites/ada/tmtests/Makefile.am new file mode 100644 index 0000000000..4cf9517425 --- /dev/null +++ b/testsuites/ada/tmtests/Makefile.am @@ -0,0 +1,33 @@ +_SUBDIRS = +_SUBDIRS += tm01 +_SUBDIRS += tm02 +_SUBDIRS += tm03 +_SUBDIRS += tm04 +_SUBDIRS += tm05 +_SUBDIRS += tm06 +_SUBDIRS += tm07 +_SUBDIRS += tm08 +_SUBDIRS += tm09 +_SUBDIRS += tm10 +_SUBDIRS += tm11 +_SUBDIRS += tm12 +_SUBDIRS += tm13 +_SUBDIRS += tm14 +_SUBDIRS += tm15 +_SUBDIRS += tm16 +_SUBDIRS += tm17 +_SUBDIRS += tm18 +_SUBDIRS += tm19 +_SUBDIRS += tm20 +_SUBDIRS += tm21 +_SUBDIRS += tm22 +_SUBDIRS += tm23 +_SUBDIRS += tm24 +_SUBDIRS += tm25 +_SUBDIRS += tm28 +_SUBDIRS += tm29 +_SUBDIRS += tmck +_SUBDIRS += tmoverhd + +include $(top_srcdir)/../automake/subdirs.am +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/tmtests/tm01/Makefile.am b/testsuites/ada/tmtests/tm01/Makefile.am new file mode 100644 index 0000000000..4fb8798b24 --- /dev/null +++ b/testsuites/ada/tmtests/tm01/Makefile.am @@ -0,0 +1,13 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +noinst_PROGRAMS = ada_tm01 +ada_tm01_SOURCES = tm01.adb config.h tmtest.adb tmtest.ads +ada_tm01_SOURCES += ../../support/init.c + +ada_tm01$(EXEEXT): tm01.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/tmtests/tm01/config.h b/testsuites/ada/tmtests/tm01/config.h new file mode 100644 index 0000000000..7730385b3c --- /dev/null +++ b/testsuites/ada/tmtests/tm01/config.h @@ -0,0 +1,32 @@ +/* config.h + * + * This include file defines the Configuration Table for this test. + * + * COPYRIGHT (c) 1989-1997. + * 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_TMTEST + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER + +#define CONFIGURE_MAXIMUM_TASKS 2 +#define CONFIGURE_MAXIMUM_SEMAPHORES 1 +#define CONFIGURE_TICKS_PER_TIMESLICE 0 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/tmtests/tm01/tm01.adb b/testsuites/ada/tmtests/tm01/tm01.adb new file mode 100644 index 0000000000..47c83a17e0 --- /dev/null +++ b/testsuites/ada/tmtests/tm01/tm01.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test TM01 of the Timing 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 TMTEST; +with TEST_SUPPORT; + +procedure TM01 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, + TMTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end TM01; + diff --git a/testsuites/ada/tmtests/tm01/tmtest.adb b/testsuites/ada/tmtests/tm01/tmtest.adb new file mode 100644 index 0000000000..31e54aa40f --- /dev/null +++ b/testsuites/ada/tmtests/tm01/tmtest.adb @@ -0,0 +1,273 @@ +-- +-- TMTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 1 of the RTEMS +-- Timing 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 INTERFACES; use INTERFACES; +with RTEMS_CALLING_OVERHEAD; +with TEST_SUPPORT; +with TEXT_IO; +with TIME_TEST_SUPPORT; +with TIMER_DRIVER; +with RTEMS.SEMAPHORE; + +package body TMTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TIME TEST 1 ***" ); + + TMTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); + TMTEST.TASK_NAME( 2 ) := RTEMS.BUILD_NAME( 'T', 'A', '2', ' ' ); + TMTEST.TASK_NAME( 3 ) := RTEMS.BUILD_NAME( 'T', 'A', '3', ' ' ); + + RTEMS.TASKS.CREATE( + TMTEST.TASK_NAME( 1 ), + 1, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + TMTEST.TASK_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" ); + + RTEMS.TASKS.START( + TMTEST.TASK_ID( 1 ), + TMTEST.TASK_1'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); + + 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); + SEMAPHORE_OBTAIN_TIME : RTEMS.UNSIGNED32; + SEMAPHORE_RELEASE_TIME : RTEMS.UNSIGNED32; + SEMAPHORE_OBTAIN_NO_WAIT_TIME : RTEMS.UNSIGNED32; + SEMAPHORE_OBTAIN_LOOP_TIME : RTEMS.UNSIGNED32; + SEMAPHORE_RELEASE_LOOP_TIME : RTEMS.UNSIGNED32; + NAME : RTEMS.NAME; + SMID : RTEMS.ID; + STATUS : RTEMS.STATUS_CODES; + begin + + 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; + +-- Time one invocation of SEMAPHORE_CREATE + + TIMER_DRIVER.INITIALIZE; + + RTEMS.SEMAPHORE.CREATE( + NAME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + RTEMS.DEFAULT_ATTRIBUTES, + RTEMS.TASKS.NO_PRIORITY, + SMID, + STATUS + ); + + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "SEMAPHORE_CREATE", + TMTEST.END_TIME, + 1, + 0, + RTEMS_CALLING_OVERHEAD.SEMAPHORE_CREATE + ); + +-- Time one invocation of SEMAPHORE_DELETE + + TIMER_DRIVER.INITIALIZE; + + RTEMS.SEMAPHORE.DELETE( SMID, STATUS ); + + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "SEMAPHORE_DELETE", + TMTEST.END_TIME, + 1, + 0, + RTEMS_CALLING_OVERHEAD.SEMAPHORE_DELETE + ); + +-- Create semaphore for repeated operations. + + RTEMS.SEMAPHORE.CREATE( + NAME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + RTEMS.DEFAULT_ATTRIBUTES, + RTEMS.TASKS.NO_PRIORITY, + SMID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE" ); + +-- Perform repeated SEMAPHORE OBTAIN's and RELEASE's + + for ITERATIONS in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + TIMER_DRIVER.EMPTY_FUNCTION; + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + SEMAPHORE_OBTAIN_LOOP_TIME := SEMAPHORE_OBTAIN_LOOP_TIME + + TMTEST.END_TIME; + SEMAPHORE_RELEASE_LOOP_TIME := SEMAPHORE_RELEASE_LOOP_TIME + + TMTEST.END_TIME; + + -- Semaphore_obtain (available loop) + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + + RTEMS.SEMAPHORE.OBTAIN( + SMID, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + STATUS + ); + + end loop; + + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + SEMAPHORE_OBTAIN_TIME := SEMAPHORE_OBTAIN_TIME + TMTEST.END_TIME; + + -- Semaphore_release + + TIMER_DRIVER.INITIALIZE; + + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + + RTEMS.SEMAPHORE.RELEASE( SMID, STATUS ); + + end loop; + + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + SEMAPHORE_RELEASE_TIME := SEMAPHORE_RELEASE_TIME + + TMTEST.END_TIME; + + -- Semaphore_p (NO_WAIT) + + TIMER_DRIVER.INITIALIZE; + + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + + RTEMS.SEMAPHORE.OBTAIN( + SMID, + RTEMS.NO_WAIT, + RTEMS.NO_TIMEOUT, + STATUS + ); + + end loop; + + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + SEMAPHORE_OBTAIN_NO_WAIT_TIME := + SEMAPHORE_OBTAIN_NO_WAIT_TIME + TMTEST.END_TIME; + + -- Semaphore_v + + TIMER_DRIVER.INITIALIZE; + + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + + RTEMS.SEMAPHORE.RELEASE( SMID, STATUS ); + + end loop; + + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + SEMAPHORE_RELEASE_TIME := SEMAPHORE_RELEASE_TIME + + TMTEST.END_TIME; + + end loop; + + TIME_TEST_SUPPORT.PUT_TIME( + "SEMAPHORE_OBTAIN (semaphore available)", + SEMAPHORE_OBTAIN_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT * + TIME_TEST_SUPPORT.OPERATION_COUNT, + SEMAPHORE_OBTAIN_LOOP_TIME, + RTEMS_CALLING_OVERHEAD.SEMAPHORE_OBTAIN + ); + + TIME_TEST_SUPPORT.PUT_TIME( + "SEMAPHORE_OBTAIN (NO_WAIT)", + SEMAPHORE_OBTAIN_NO_WAIT_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT * + TIME_TEST_SUPPORT.OPERATION_COUNT, + SEMAPHORE_OBTAIN_LOOP_TIME, + RTEMS_CALLING_OVERHEAD.SEMAPHORE_OBTAIN + ); + + TIME_TEST_SUPPORT.PUT_TIME( + "SEMAPHORE_RELEASE (no task waiting)", + SEMAPHORE_RELEASE_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT * + TIME_TEST_SUPPORT.OPERATION_COUNT * 2, + SEMAPHORE_RELEASE_LOOP_TIME * 2, + RTEMS_CALLING_OVERHEAD.SEMAPHORE_RELEASE + ); + + TEXT_IO.PUT_LINE( "*** END OF TIME TEST 1 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end TASK_1; + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm01/tmtest.ads b/testsuites/ada/tmtests/tm01/tmtest.ads new file mode 100644 index 0000000000..6d00d05715 --- /dev/null +++ b/testsuites/ada/tmtests/tm01/tmtest.ads @@ -0,0 +1,67 @@ +-- +-- TMTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 1 of the RTEMS +-- Timing 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; + +package TMTEST is + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS tasks created +-- by this test. +-- + + TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; + TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; + +-- +-- The following variable is set to the execution time returned +-- by the timer. +-- + + END_TIME : RTEMS.UNSIGNED32; + +-- +-- 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 performs the all of the timing operations in this test. +-- + + procedure TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_1); + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm02/Makefile.am b/testsuites/ada/tmtests/tm02/Makefile.am new file mode 100644 index 0000000000..a35c09450d --- /dev/null +++ b/testsuites/ada/tmtests/tm02/Makefile.am @@ -0,0 +1,13 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +noinst_PROGRAMS = ada_tm02 +ada_tm02_SOURCES = tm02.adb config.h tmtest.adb tmtest.ads +ada_tm02_SOURCES += ../../support/init.c + +ada_tm02$(EXEEXT): tm02.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/tmtests/tm02/config.h b/testsuites/ada/tmtests/tm02/config.h new file mode 100644 index 0000000000..b03802dcc5 --- /dev/null +++ b/testsuites/ada/tmtests/tm02/config.h @@ -0,0 +1,33 @@ +/* config.h + * + * This include file defines the Configuration Table for this test. + * + * COPYRIGHT (c) 1989-1997. + * 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_TMTEST + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER + +#define CONFIGURE_MAXIMUM_TASKS 111 +#define CONFIGURE_MAXIMUM_TIMERS 110 +#define CONFIGURE_MAXIMUM_SEMAPHORES 101 +#define CONFIGURE_TICKS_PER_TIMESLICE 0 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/tmtests/tm02/tm02.adb b/testsuites/ada/tmtests/tm02/tm02.adb new file mode 100644 index 0000000000..9476c87878 --- /dev/null +++ b/testsuites/ada/tmtests/tm02/tm02.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test TM02 of the Timing 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 TMTEST; +with TEST_SUPPORT; + +procedure TM02 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, + TMTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end TM02; + diff --git a/testsuites/ada/tmtests/tm02/tmtest.adb b/testsuites/ada/tmtests/tm02/tmtest.adb new file mode 100644 index 0000000000..8fc9df5b18 --- /dev/null +++ b/testsuites/ada/tmtests/tm02/tmtest.adb @@ -0,0 +1,206 @@ +-- +-- TMTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 2 of the RTEMS +-- Timing 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 INTERFACES; use INTERFACES; +with RTEMS_CALLING_OVERHEAD; +with TEST_SUPPORT; +with TEXT_IO; +with TIME_TEST_SUPPORT; +with TIMER_DRIVER; +with RTEMS.SEMAPHORE; + +package body TMTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TIME TEST 2 ***" ); + + TMTEST.TEST_INIT; + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- TEST_INIT +-- + + procedure TEST_INIT is + PRIORITY : RTEMS.TASKS.PRIORITY; + HIGH_ID : RTEMS.ID; + LOW_ID : RTEMS.ID; + TASK_ID : RTEMS.ID; + STATUS : RTEMS.STATUS_CODES; + begin + + PRIORITY := 5; + + RTEMS.TASKS.CREATE( + RTEMS.BUILD_NAME( 'H', 'I', 'G', 'H' ), + PRIORITY, + 1024, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + HIGH_ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF HIGH TASK" ); + + PRIORITY := PRIORITY + 1; + + RTEMS.TASKS.START( + HIGH_ID, + TMTEST.HIGH_TASK'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF HIGH TASK" ); + + for INDEX in 2 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + + RTEMS.TASKS.CREATE( + RTEMS.BUILD_NAME( 'M', 'I', 'D', ' ' ), + PRIORITY, + 1024, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + TASK_ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE MIDDLE" ); + + PRIORITY := PRIORITY + 1; + + RTEMS.TASKS.START( + TASK_ID, + TMTEST.MIDDLE_TASKS'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START MIDDLE" ); + + end loop; + + RTEMS.TASKS.CREATE( + RTEMS.BUILD_NAME( 'L', 'O', 'W', ' ' ), + PRIORITY, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + LOW_ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF LOW TASK" ); + + RTEMS.TASKS.START( LOW_ID, TMTEST.LOW_TASK'ACCESS, 0, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF LOW TASK" ); + + RTEMS.SEMAPHORE.CREATE( + RTEMS.BUILD_NAME( 'S', 'M', '1', ' ' ), + 0, + RTEMS.DEFAULT_ATTRIBUTES, + RTEMS.TASKS.NO_PRIORITY, + TMTEST.SEMAPHORE_ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE OF SM1" ); + + end TEST_INIT; + +-- +-- HIGH_TASK +-- + + procedure HIGH_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TIMER_DRIVER.INITIALIZE; + RTEMS.SEMAPHORE.OBTAIN( + TMTEST.SEMAPHORE_ID, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN" ); + + end HIGH_TASK; + +-- +-- MIDDLE_TASKS +-- + + procedure MIDDLE_TASKS ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.SEMAPHORE.OBTAIN( + TMTEST.SEMAPHORE_ID, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN" ); + + end MIDDLE_TASKS; + +-- +-- LOW_TASK +-- + + procedure LOW_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + begin + + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + TIME_TEST_SUPPORT.PUT_TIME( + "SEMAPHORE_OBTAIN (blocking)", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + 0, + RTEMS_CALLING_OVERHEAD.SEMAPHORE_OBTAIN + ); + + TEXT_IO.PUT_LINE( "*** END OF TIME TEST 2 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end LOW_TASK; + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm02/tmtest.ads b/testsuites/ada/tmtests/tm02/tmtest.ads new file mode 100644 index 0000000000..0857c93313 --- /dev/null +++ b/testsuites/ada/tmtests/tm02/tmtest.ads @@ -0,0 +1,104 @@ +-- +-- TMTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 2 of the RTEMS +-- Timing 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; + +package TMTEST is + +-- +-- The following is the ID of the semaphore used for timing operations. +-- + + SEMAPHORE_ID : RTEMS.ID; + +-- +-- The following variable is set to the execution time returned +-- by the timer. +-- + + END_TIME : RTEMS.UNSIGNED32; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- TEST_INIT +-- +-- DESCRIPTION: +-- +-- This subprogram performs test initialization. +-- + + procedure TEST_INIT; + +-- +-- HIGH_TASK +-- +-- DESCRIPTION: +-- +-- This RTEMS task starts the timer and performs a blocking +-- SEMAPHORE_OBTAIN. +-- + + procedure HIGH_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, HIGH_TASK); + +-- +-- MIDDLE_TASKS +-- +-- DESCRIPTION: +-- +-- These RTEMS task start the timer and performs a blocking +-- SEMAPHORE_OBTAIN. +-- + + procedure MIDDLE_TASKS ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, MIDDLE_TASKS); + +-- +-- LOW_TASK +-- +-- DESCRIPTION: +-- +-- This RTEMS task stops the timer and reports the execution time for +-- a blocking SEMAPHORE_OBTAIN. +-- + + procedure LOW_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, LOW_TASK); + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm03/Makefile.am b/testsuites/ada/tmtests/tm03/Makefile.am new file mode 100644 index 0000000000..81aa66358f --- /dev/null +++ b/testsuites/ada/tmtests/tm03/Makefile.am @@ -0,0 +1,13 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +noinst_PROGRAMS = ada_tm03 +ada_tm03_SOURCES = tm03.adb config.h tmtest.adb tmtest.ads +ada_tm03_SOURCES += ../../support/init.c + +ada_tm03$(EXEEXT): tm03.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/tmtests/tm03/config.h b/testsuites/ada/tmtests/tm03/config.h new file mode 100644 index 0000000000..b03802dcc5 --- /dev/null +++ b/testsuites/ada/tmtests/tm03/config.h @@ -0,0 +1,33 @@ +/* config.h + * + * This include file defines the Configuration Table for this test. + * + * COPYRIGHT (c) 1989-1997. + * 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_TMTEST + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER + +#define CONFIGURE_MAXIMUM_TASKS 111 +#define CONFIGURE_MAXIMUM_TIMERS 110 +#define CONFIGURE_MAXIMUM_SEMAPHORES 101 +#define CONFIGURE_TICKS_PER_TIMESLICE 0 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/tmtests/tm03/tm03.adb b/testsuites/ada/tmtests/tm03/tm03.adb new file mode 100644 index 0000000000..9a95e5e1d0 --- /dev/null +++ b/testsuites/ada/tmtests/tm03/tm03.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test TM03 of the Timing 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 TMTEST; +with TEST_SUPPORT; + +procedure TM03 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, + TMTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end TM03; + diff --git a/testsuites/ada/tmtests/tm03/tmtest.adb b/testsuites/ada/tmtests/tm03/tmtest.adb new file mode 100644 index 0000000000..a6e7606920 --- /dev/null +++ b/testsuites/ada/tmtests/tm03/tmtest.adb @@ -0,0 +1,190 @@ +-- +-- TMTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 3 of the RTEMS +-- Timing 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 INTERFACES; use INTERFACES; +with RTEMS_CALLING_OVERHEAD; +with TEST_SUPPORT; +with TEXT_IO; +with TIME_TEST_SUPPORT; +with TIMER_DRIVER; +with RTEMS.SEMAPHORE; + +package body TMTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + TASK_ID : RTEMS.ID; + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TIME TEST 3 ***" ); + + RTEMS.TASKS.CREATE( + RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ), + 252, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + TASK_ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TEST_INIT" ); + + RTEMS.TASKS.START( TASK_ID, TMTEST.TEST_INIT'ACCESS, 0, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TEST_INIT" ); + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- TEST_INIT +-- + + procedure TEST_INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + PRIORITY : RTEMS.TASKS.PRIORITY; + TASK_ID : RTEMS.ID; + STATUS : RTEMS.STATUS_CODES; + begin + + PRIORITY := 250; + + RTEMS.SEMAPHORE.CREATE( + RTEMS.BUILD_NAME( 'S', 'M', '1', ' ' ), + 0, + RTEMS.DEFAULT_ATTRIBUTES, + RTEMS.TASKS.NO_PRIORITY, + TMTEST.SEMAPHORE_ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE OF SM1" ); + + for INDEX in 2 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + + RTEMS.TASKS.CREATE( + RTEMS.BUILD_NAME( 'M', 'I', 'D', ' ' ), + PRIORITY, + 1024, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + TASK_ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE MIDDLE" ); + + PRIORITY := PRIORITY - 1; + + RTEMS.TASKS.START( TASK_ID, TMTEST.MIDDLE_TASKS'ACCESS, 0, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START MIDDLE" ); + + end loop; + + RTEMS.TASKS.CREATE( + RTEMS.BUILD_NAME( 'H', 'I', 'G', 'H' ), + PRIORITY, + 1024, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + TASK_ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF HIGH TASK" ); + + RTEMS.TASKS.START( TASK_ID, TMTEST.HIGH_TASK'ACCESS, 0, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF HIGH TASK" ); + + TIMER_DRIVER.INITIALIZE; + RTEMS.SEMAPHORE.RELEASE( TMTEST.SEMAPHORE_ID, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE" ); + + end TEST_INIT; + +-- +-- MIDDLE_TASKS +-- + + procedure MIDDLE_TASKS ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.SEMAPHORE.OBTAIN( + TMTEST.SEMAPHORE_ID, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN" ); + + RTEMS.SEMAPHORE.RELEASE( TMTEST.SEMAPHORE_ID, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE" ); + + end MIDDLE_TASKS; + +-- +-- HIGH_TASK +-- + + procedure HIGH_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.SEMAPHORE.OBTAIN( + TMTEST.SEMAPHORE_ID, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + STATUS + ); + + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "LAST CALL DID NOT WORK" ); + + TIME_TEST_SUPPORT.PUT_TIME( + "SEMAPHORE_RELEASE (preemptive)", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + 0, + RTEMS_CALLING_OVERHEAD.SEMAPHORE_RELEASE + ); + + TEXT_IO.PUT_LINE( "*** END OF TIME TEST 3 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end HIGH_TASK; + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm03/tmtest.ads b/testsuites/ada/tmtests/tm03/tmtest.ads new file mode 100644 index 0000000000..4acd5f7a77 --- /dev/null +++ b/testsuites/ada/tmtests/tm03/tmtest.ads @@ -0,0 +1,96 @@ +-- +-- TMTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 3 of the RTEMS +-- Timing 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; + +package TMTEST is + +-- +-- The following is the ID of the semaphore used for timing operations. +-- + + SEMAPHORE_ID : RTEMS.ID; + +-- +-- The following variable is set to the execution time returned +-- by the timer. +-- + + END_TIME : RTEMS.UNSIGNED32; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- TEST_INIT +-- +-- DESCRIPTION: +-- +-- This subprogram performs test initialization. After completion +-- of test initialization, the timer is started and a preemptive +-- SEMAPHORE_RELEASE is performed. +-- + + procedure TEST_INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TEST_INIT); + +-- +-- MIDDLE_TASKS +-- +-- DESCRIPTION: +-- +-- This RTEMS task performs a blocking SEMAPHORE_OBTAIN. Once +-- is obtains the semaphore unit and executes again, it performs +-- a preemptive SEMAPHORE_RELEASE. +-- + + procedure MIDDLE_TASKS ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, MIDDLE_TASKS); + +-- +-- HIGH_TASK +-- +-- DESCRIPTION: +-- +-- This RTEMS task stops the timer and reports the execution +-- timer for a preemptive SEMAPHORE_RELEASE. +-- + + procedure HIGH_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, HIGH_TASK); + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm04/Makefile.am b/testsuites/ada/tmtests/tm04/Makefile.am new file mode 100644 index 0000000000..2aa62a790f --- /dev/null +++ b/testsuites/ada/tmtests/tm04/Makefile.am @@ -0,0 +1,13 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +noinst_PROGRAMS = ada_tm04 +ada_tm04_SOURCES = tm04.adb config.h tmtest.adb tmtest.ads +ada_tm04_SOURCES += ../../support/init.c + +ada_tm04$(EXEEXT): tm04.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/tmtests/tm04/config.h b/testsuites/ada/tmtests/tm04/config.h new file mode 100644 index 0000000000..700438ceae --- /dev/null +++ b/testsuites/ada/tmtests/tm04/config.h @@ -0,0 +1,32 @@ +/* config.h + * + * This include file defines the Configuration Table for this test. + * + * COPYRIGHT (c) 1989-1997. + * 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_TMTEST + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER + +#define CONFIGURE_MAXIMUM_TASKS 111 +#define CONFIGURE_MAXIMUM_SEMAPHORES 1 +#define CONFIGURE_TICKS_PER_TIMESLICE 0 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/tmtests/tm04/tm04.adb b/testsuites/ada/tmtests/tm04/tm04.adb new file mode 100644 index 0000000000..28e75c7db5 --- /dev/null +++ b/testsuites/ada/tmtests/tm04/tm04.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test TM04 of the Timing 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 TMTEST; +with TEST_SUPPORT; + +procedure TM04 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, + TMTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end TM04; + diff --git a/testsuites/ada/tmtests/tm04/tmtest.adb b/testsuites/ada/tmtests/tm04/tmtest.adb new file mode 100644 index 0000000000..7278bf2432 --- /dev/null +++ b/testsuites/ada/tmtests/tm04/tmtest.adb @@ -0,0 +1,494 @@ +-- +-- TMTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 4 of the RTEMS +-- Timing 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 INTERFACES; use INTERFACES; +with RTEMS_CALLING_OVERHEAD; +with TEST_SUPPORT; +with TEXT_IO; +with TIMER_DRIVER; +with RTEMS.SEMAPHORE; + +package body TMTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TIME TEST 4 ***" ); + + TMTEST.TEST_INIT; + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- TEST_INIT +-- + + procedure TEST_INIT + is + STATUS : RTEMS.STATUS_CODES; + begin + + TMTEST.TASK_COUNT := TIME_TEST_SUPPORT.OPERATION_COUNT; + + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + + RTEMS.TASKS.CREATE( + RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ), + 10, + 1024, + RTEMS.NO_PREEMPT, + RTEMS.DEFAULT_ATTRIBUTES, + TMTEST.TASK_ID( INDEX ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); + + RTEMS.TASKS.START( + TMTEST.TASK_ID( INDEX ), + TMTEST.LOW_TASKS'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); + + end loop; + + RTEMS.SEMAPHORE.CREATE( + RTEMS.BUILD_NAME( 'S', 'M', '1', ' ' ), + 0, + RTEMS.DEFAULT_ATTRIBUTES, + RTEMS.TASKS.NO_PRIORITY, + TMTEST.SEMAPHORE_ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE OF SM1" ); + + end TEST_INIT; + +-- +-- HIGHEST_TASK +-- + + procedure HIGHEST_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + OLD_PRIORITY : RTEMS.TASKS.PRIORITY; + STATUS : RTEMS.STATUS_CODES; + begin + + if ARGUMENT = 1 then + + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TASK_RESTART (blocked, preempt)", + TMTEST.END_TIME, + 1, + 0, + RTEMS_CALLING_OVERHEAD.TASK_RESTART + ); + + RTEMS.TASKS.SET_PRIORITY( RTEMS.SELF, 254, OLD_PRIORITY, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" ); + + elsif ARGUMENT = 2 then + + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TASK_RESTART (ready, preempt)", + TMTEST.END_TIME, + 1, + 0, + RTEMS_CALLING_OVERHEAD.TASK_RESTART + ); + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE" ); + + else + + RTEMS.SEMAPHORE.OBTAIN( + TMTEST.SEMAPHORE_ID, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + STATUS + ); + + end if; + + end HIGHEST_TASK; + +-- +-- HIGH_TASK +-- + + procedure HIGH_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + OLD_PRIORITY : RTEMS.TASKS.PRIORITY; + OVERHEAD : RTEMS.UNSIGNED32; + NAME : RTEMS.NAME; + STATUS : RTEMS.STATUS_CODES; + begin + + TIMER_DRIVER.INITIALIZE; + RTEMS.TASKS.RESTART( TMTEST.HIGHEST_ID, 1, STATUS ); + -- preempted by Higher_task + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESTART" ); + + TIMER_DRIVER.INITIALIZE; + RTEMS.TASKS.RESTART( TMTEST.HIGHEST_ID, 2, STATUS ); + -- preempted by Higher_task + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESTART" ); + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + TIMER_DRIVER.EMPTY_FUNCTION; + end loop; + OVERHEAD := TIMER_DRIVER.READ_TIMER; + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.SEMAPHORE.RELEASE( TMTEST.SEMAPHORE_ID, STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_RELEASE" ); + + TIME_TEST_SUPPORT.PUT_TIME( + "SEMAPHORE_RELEASE (readying)", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + RTEMS_CALLING_OVERHEAD.SEMAPHORE_RELEASE + ); + + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.TASKS.DELETE( TMTEST.TASK_ID( INDEX ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE" ); + end loop; + + NAME := RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ); + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.TASKS.CREATE( + NAME, + 10, + 1024, + RTEMS.NO_PREEMPT, + RTEMS.DEFAULT_ATTRIBUTES, + TMTEST.TASK_ID( INDEX ), + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TASK_CREATE", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + RTEMS_CALLING_OVERHEAD.TASK_CREATE + ); + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.TASKS.START( + TMTEST.TASK_ID( INDEX ), + TMTEST.LOW_TASKS'ACCESS, + 0, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TASK_START", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + RTEMS_CALLING_OVERHEAD.TASK_START + ); + + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.TASKS.DELETE( TMTEST.TASK_ID( INDEX ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE LOOP" ); + end loop; + + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.TASKS.CREATE( + NAME, + 250, + 1024, + RTEMS.NO_PREEMPT, + RTEMS.DEFAULT_ATTRIBUTES, + TMTEST.TASK_ID( INDEX ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); + RTEMS.TASKS.START( + TMTEST.TASK_ID( INDEX ), + TMTEST.RESTART_TASK'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); + RTEMS.TASKS.SUSPEND( TMTEST.TASK_ID( INDEX ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND LOOP" ); + end loop; + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.TASKS.RESTART( TMTEST.TASK_ID( INDEX ), 0, STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TASK_RESTART (suspended)", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + RTEMS_CALLING_OVERHEAD.TASK_RESTART + ); + + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.TASKS.SUSPEND( TMTEST.TASK_ID( INDEX ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND LOOP" ); + end loop; + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.TASKS.DELETE( TMTEST.TASK_ID( INDEX ), STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TASK_DELETE (suspended)", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + RTEMS_CALLING_OVERHEAD.TASK_DELETE + ); + + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.TASKS.CREATE( + NAME, + 250, + 1024, + RTEMS.DEFAULT_OPTIONS, + RTEMS.DEFAULT_ATTRIBUTES, + TMTEST.TASK_ID( INDEX ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); + RTEMS.TASKS.START( + TMTEST.TASK_ID( INDEX ), + TMTEST.RESTART_TASK'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); + end loop; + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.TASKS.RESTART( TMTEST.TASK_ID( INDEX ), 1, STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TASK_RESTART (ready)", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + RTEMS_CALLING_OVERHEAD.TASK_RESTART + ); + + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.TASKS.SET_PRIORITY( + TMTEST.TASK_ID( INDEX ), + 5, + OLD_PRIORITY, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY LOOP" ); + end loop; + + -- yield processor -- tasks block + RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.TASKS.RESTART( TMTEST.TASK_ID( INDEX ), 1, STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TASK_RESTART (blocked, no preempt)", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + RTEMS_CALLING_OVERHEAD.TASK_RESTART + ); + + -- yield processor -- tasks block + RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.TASKS.DELETE( TMTEST.TASK_ID( INDEX ), STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TASK_DELETE (blocked)", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + RTEMS_CALLING_OVERHEAD.TASK_DELETE + ); + + TEXT_IO.PUT_LINE( "*** END OF TIME TEST 4 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end HIGH_TASK; + +-- +-- LOW_TASKS +-- + + procedure LOW_TASKS ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + ID : RTEMS.ID; + STATUS : RTEMS.STATUS_CODES; + begin + + TMTEST.TASK_COUNT := TMTEST.TASK_COUNT - 1; + + if TMTEST.TASK_COUNT = 0 then + + RTEMS.TASKS.CREATE( + RTEMS.BUILD_NAME( 'H', 'I', ' ', ' ' ), + 5, + 2048, + RTEMS.DEFAULT_OPTIONS, + RTEMS.DEFAULT_ATTRIBUTES, + ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE HI" ); + + RTEMS.TASKS.START( + ID, + TMTEST.HIGH_TASK'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START HI" ); + + + RTEMS.TASKS.CREATE( + RTEMS.BUILD_NAME( 'H', 'I', 'G', 'H' ), + 3, + 2048, + RTEMS.DEFAULT_OPTIONS, + RTEMS.DEFAULT_ATTRIBUTES, + TMTEST.HIGHEST_ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE HIGH" ); + + RTEMS.TASKS.START( + TMTEST.HIGHEST_ID, + TMTEST.HIGHEST_TASK'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START HIGH" ); + + + end if; + + RTEMS.SEMAPHORE.OBTAIN( + TMTEST.SEMAPHORE_ID, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN" ); + + end LOW_TASKS; + +-- +-- RESTART_TASK +-- + + procedure RESTART_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + STATUS : RTEMS.STATUS_CODES; + begin + + if ARGUMENT = 1 then + RTEMS.SEMAPHORE.OBTAIN( + TMTEST.SEMAPHORE_ID, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + STATUS + ); + end if; + + end RESTART_TASK; + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm04/tmtest.ads b/testsuites/ada/tmtests/tm04/tmtest.ads new file mode 100644 index 0000000000..e1f303ee2f --- /dev/null +++ b/testsuites/ada/tmtests/tm04/tmtest.ads @@ -0,0 +1,163 @@ +-- +-- TMTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 4 of the RTEMS +-- Timing 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 TIME_TEST_SUPPORT; +with RTEMS; +with RTEMS.TASKS; + +package TMTEST is + +-- +-- This array contains the IDs of all RTEMS tasks created by this test. +-- + + TASK_ID : array ( RTEMS.UNSIGNED32 + range 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.ID; + +-- +-- This variable contains the id of the highest priority task +-- in the system. +-- + + HIGHEST_ID : RTEMS.ID; + +-- +-- The following is the ID of the semaphore used for timing operations. +-- + + SEMAPHORE_ID : RTEMS.ID; + +-- +-- The following is used to perform the same operation +-- on a group of tasks. +-- + + TASK_COUNT : RTEMS.UNSIGNED32; + +-- +-- The following variable is set to the execution time returned +-- by the timer. +-- + + END_TIME : RTEMS.UNSIGNED32; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- TEST_INIT +-- +-- DESCRIPTION: +-- +-- This subprogram performs test initialization. +-- + + procedure TEST_INIT; + +-- +-- HIGHEST_TASK +-- +-- DESCRIPTION: +-- +-- This RTEMS task is created by one of the LOW_TASKS. The +-- first time it executes, it performs a blocking SEMAPHORE_OBTAIN +-- which transfers control of the processor to HIGH_TASK. +-- The first time HIGHEST_TASK is restarted, it stops the +-- timer and reports the execution time for a TASK_RESTART +-- for a blocked task which preempts the caller. The second +-- time HIGHEST_TASK is restarted, it stops the timer and reports +-- the execution time for a TASK_RESTART for a ready task which +-- has its original priority restored and preempts the caller. +-- + + procedure HIGHEST_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, HIGHEST_TASK); + +-- +-- HIGH_TASK +-- +-- DESCRIPTION: +-- +-- This RTEMS task is created by one of the LOW_TASKS. This +-- task restarts HIGHEST_TASK twice. HIGHEST_TASK is blocked the +-- first time and preempts this task when restarted. HIGHEST_TASK +-- is ready the second time but has lowered its priority. When +-- restarted for the second time, HIGHEST_TASK will have its +-- original priority restored and preempt this task. +-- Once control of the processor is returned to this task after +-- HIGHEST_TASK deletes itself, the following execution times +-- are measured and reported. +-- +-- + readying SEMAPHORE_RELEASE +-- + TASK_CREATE +-- + TASK_START +-- + TASK_RESTART of a suspended task +-- + TASK_DELETE of a suspended task +-- + TASK_RESTART of a ready task +-- + TASK_RESTART of a blocked task which does not cause a preempt +-- + TASK_DELETE of a blocked task +-- + + procedure HIGH_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, HIGH_TASK); + +-- +-- LOW_TASKS +-- +-- DESCRIPTION: +-- +-- The last of these RTEMS tasks to execute creates HIGH_TASK +-- and HIGHEST_TASK. All of these tasks perform a blocking +-- SEMAPHORE_OBTAIN. +-- + + procedure LOW_TASKS ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, LOW_TASKS); + +-- +-- RESTART_TASK +-- +-- DESCRIPTION: +-- +-- This RTEMS task +-- + + procedure RESTART_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, RESTART_TASK); + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm05/Makefile.am b/testsuites/ada/tmtests/tm05/Makefile.am new file mode 100644 index 0000000000..1d723e1f85 --- /dev/null +++ b/testsuites/ada/tmtests/tm05/Makefile.am @@ -0,0 +1,13 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +noinst_PROGRAMS = ada_tm05 +ada_tm05_SOURCES = tm05.adb config.h tmtest.adb tmtest.ads +ada_tm05_SOURCES += ../../support/init.c + +ada_tm05$(EXEEXT): tm05.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/tmtests/tm05/config.h b/testsuites/ada/tmtests/tm05/config.h new file mode 100644 index 0000000000..b03802dcc5 --- /dev/null +++ b/testsuites/ada/tmtests/tm05/config.h @@ -0,0 +1,33 @@ +/* config.h + * + * This include file defines the Configuration Table for this test. + * + * COPYRIGHT (c) 1989-1997. + * 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_TMTEST + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER + +#define CONFIGURE_MAXIMUM_TASKS 111 +#define CONFIGURE_MAXIMUM_TIMERS 110 +#define CONFIGURE_MAXIMUM_SEMAPHORES 101 +#define CONFIGURE_TICKS_PER_TIMESLICE 0 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/tmtests/tm05/tm05.adb b/testsuites/ada/tmtests/tm05/tm05.adb new file mode 100644 index 0000000000..eaa0741592 --- /dev/null +++ b/testsuites/ada/tmtests/tm05/tm05.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test TM05 of the Timing 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 TMTEST; +with TEST_SUPPORT; + +procedure TM05 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, + TMTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end TM05; + diff --git a/testsuites/ada/tmtests/tm05/tmtest.adb b/testsuites/ada/tmtests/tm05/tmtest.adb new file mode 100644 index 0000000000..c334acd526 --- /dev/null +++ b/testsuites/ada/tmtests/tm05/tmtest.adb @@ -0,0 +1,170 @@ +-- +-- TMTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 5 of the RTEMS +-- Timing 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 INTERFACES; use INTERFACES; +with RTEMS_CALLING_OVERHEAD; +with TEST_SUPPORT; +with TEXT_IO; +with TIMER_DRIVER; + +package body TMTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TIME TEST 5 ***" ); + + TMTEST.TEST_INIT; + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- TEST_INIT +-- + + procedure TEST_INIT + is + TASK_ENTRY : RTEMS.TASKS.ENTRY_POINT; + PRIORITY : RTEMS.TASKS.PRIORITY; + STATUS : RTEMS.STATUS_CODES; + begin + + PRIORITY := 250; + + for INDEX in 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + + RTEMS.TASKS.CREATE( + RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ), + PRIORITY, + 1024, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + TMTEST.TASK_ID( INDEX ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); + + PRIORITY := PRIORITY - 1; + + if INDEX = 0 then + TASK_ENTRY := TMTEST.LOW_TASK'ACCESS; + elsif INDEX = TIME_TEST_SUPPORT.OPERATION_COUNT then + TASK_ENTRY := TMTEST.HIGH_TASK'ACCESS; + else + TASK_ENTRY := TMTEST.MIDDLE_TASKS'ACCESS; + end if; + + RTEMS.TASKS.START( TMTEST.TASK_ID( INDEX ), TASK_ENTRY, 0, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); + + end loop; + + end TEST_INIT; + +-- +-- HIGH_TASK +-- + + procedure HIGH_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TIMER_DRIVER.INITIALIZE; + RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPENT" ); + + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + TIME_TEST_SUPPORT.PUT_TIME( + "TASK_RESUME causing preempt", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + 0, + RTEMS_CALLING_OVERHEAD.TASK_RESUME + ); + + TEXT_IO.PUT_LINE( "*** END OF TIME TEST 5 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end HIGH_TASK; + +-- +-- MIDDLE_TASKS +-- + + procedure MIDDLE_TASKS ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND" ); + + TMTEST.TASK_INDEX := TMTEST.TASK_INDEX + 1; + RTEMS.TASKS.RESUME( TMTEST.TASK_ID( TMTEST.TASK_INDEX ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESUME" ); + + end MIDDLE_TASKS; + +-- +-- LOW_TASK +-- + + procedure LOW_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + TIME_TEST_SUPPORT.PUT_TIME( + "TASK_SUSPEND self", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + 0, + RTEMS_CALLING_OVERHEAD.TASK_SUSPEND + ); + + TMTEST.TASK_INDEX := 1; + TIMER_DRIVER.INITIALIZE; + RTEMS.TASKS.RESUME( TMTEST.TASK_ID( TMTEST.TASK_INDEX ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESUME" ); + + end LOW_TASK; + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm05/tmtest.ads b/testsuites/ada/tmtests/tm05/tmtest.ads new file mode 100644 index 0000000000..f705c936df --- /dev/null +++ b/testsuites/ada/tmtests/tm05/tmtest.ads @@ -0,0 +1,114 @@ +-- +-- TMTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 5 of the RTEMS +-- Timing 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 TIME_TEST_SUPPORT; +with RTEMS; +with RTEMS.TASKS; + +package TMTEST is + +-- +-- This array contains the IDs of all RTEMS tasks created by this test. +-- + + TASK_ID : array ( RTEMS.UNSIGNED32 + range 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.ID; + + TASK_INDEX : RTEMS.UNSIGNED32; + +-- +-- The following variable is set to the execution time returned +-- by the timer. +-- + + END_TIME : RTEMS.UNSIGNED32; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- TEST_INIT +-- +-- DESCRIPTION: +-- +-- This subprogram performs test initialization. +-- + + procedure TEST_INIT; + +-- +-- HIGH_TASK +-- +-- DESCRIPTION: +-- +-- This RTEMS task is the highest priority task in the system. +-- It starts the timer and performs a TASK_SUSPEND on SELF. +-- When this task executes again, it stops the timer and +-- reports the execution time for a preemptive TASK_RESUME. +-- + + procedure HIGH_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, HIGH_TASK); + +-- +-- MIDDLE_TASKS +-- +-- DESCRIPTION: +-- +-- These RTEMS tasks perform a TASK_SUSPEND on SELF. When each +-- task executes again, it performs preemptive TASK_RESUME on +-- a higher priority task. +-- + + procedure MIDDLE_TASKS ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, MIDDLE_TASKS); + +-- +-- LOW_TASK +-- +-- DESCRIPTION: +-- +-- This RTEMS task is the lowest priority task in the system. +-- When this task executes, it stops the timer and reports the +-- execution time for a blocking TASK_SUSPEND. After this, +-- it starts the timer and performs a TASK_RESUME on a +-- higher priority task. +-- + + procedure LOW_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, LOW_TASK); + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm06/Makefile.am b/testsuites/ada/tmtests/tm06/Makefile.am new file mode 100644 index 0000000000..a1e5edfc1c --- /dev/null +++ b/testsuites/ada/tmtests/tm06/Makefile.am @@ -0,0 +1,13 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +noinst_PROGRAMS = ada_tm06 +ada_tm06_SOURCES = tm06.adb config.h tmtest.adb tmtest.ads +ada_tm06_SOURCES += ../../support/init.c + +ada_tm06$(EXEEXT): tm06.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/tmtests/tm06/config.h b/testsuites/ada/tmtests/tm06/config.h new file mode 100644 index 0000000000..b03802dcc5 --- /dev/null +++ b/testsuites/ada/tmtests/tm06/config.h @@ -0,0 +1,33 @@ +/* config.h + * + * This include file defines the Configuration Table for this test. + * + * COPYRIGHT (c) 1989-1997. + * 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_TMTEST + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER + +#define CONFIGURE_MAXIMUM_TASKS 111 +#define CONFIGURE_MAXIMUM_TIMERS 110 +#define CONFIGURE_MAXIMUM_SEMAPHORES 101 +#define CONFIGURE_TICKS_PER_TIMESLICE 0 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/tmtests/tm06/tm06.adb b/testsuites/ada/tmtests/tm06/tm06.adb new file mode 100644 index 0000000000..db064adb4d --- /dev/null +++ b/testsuites/ada/tmtests/tm06/tm06.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test TM06 of the Timing 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 TMTEST; +with TEST_SUPPORT; + +procedure TM06 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, + TMTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end TM06; + diff --git a/testsuites/ada/tmtests/tm06/tmtest.adb b/testsuites/ada/tmtests/tm06/tmtest.adb new file mode 100644 index 0000000000..2f0f8b1a26 --- /dev/null +++ b/testsuites/ada/tmtests/tm06/tmtest.adb @@ -0,0 +1,202 @@ +-- +-- TMTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 6 of the RTEMS +-- Timing 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 INTERFACES; use INTERFACES; +with RTEMS_CALLING_OVERHEAD; +with TEST_SUPPORT; +with TEXT_IO; +with TIMER_DRIVER; + +package body TMTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TIME TEST 6 ***" ); + + TMTEST.TEST_INIT; + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- TEST_INIT +-- + + procedure TEST_INIT + is + ID : RTEMS.ID; + STATUS : RTEMS.STATUS_CODES; + begin + + TMTEST.TASK_RESTARTED := TIME_TEST_SUPPORT.OPERATION_COUNT; + + RTEMS.TASKS.CREATE( + RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ), + 128, + 1024, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); + + RTEMS.TASKS.START( ID, TMTEST.TASK_1'ACCESS, 0, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); + + end TEST_INIT; + +-- +-- TASK_1 +-- + + procedure TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + OVERHEAD : RTEMS.UNSIGNED32; + STATUS : RTEMS.STATUS_CODES; + begin + + if TMTEST.TASK_RESTARTED = TIME_TEST_SUPPORT.OPERATION_COUNT then + TIMER_DRIVER.INITIALIZE; + end if; + + TMTEST.TASK_RESTARTED := TMTEST.TASK_RESTARTED - 1; + + if TMTEST.TASK_RESTARTED /= 0 then + RTEMS.TASKS.RESTART( RTEMS.SELF, 0, STATUS ); + end if; + + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + TIMER_DRIVER.EMPTY_FUNCTION; + end loop; + OVERHEAD := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TASK_RESTART self", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + 0, + RTEMS_CALLING_OVERHEAD.TASK_RESTART + ); + + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + + RTEMS.TASKS.CREATE( + RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ), + 254, + 1024, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + TMTEST.TASK_ID( INDEX ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); + + RTEMS.TASKS.START( + TMTEST.TASK_ID( INDEX ), + TMTEST.NULL_TASK'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); + + end loop; + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.TASKS.SUSPEND( TMTEST.TASK_ID( INDEX ), STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + TIME_TEST_SUPPORT.PUT_TIME( + "TASK_SUSPEND no preempt", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + RTEMS_CALLING_OVERHEAD.TASK_SUSPEND + ); + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.TASKS.RESUME( TMTEST.TASK_ID( INDEX ), STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + TIME_TEST_SUPPORT.PUT_TIME( + "TASK_RESUME no preempt", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + RTEMS_CALLING_OVERHEAD.TASK_RESUME + ); + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.TASKS.DELETE( TMTEST.TASK_ID( INDEX ), STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + TIME_TEST_SUPPORT.PUT_TIME( + "TASK_DELETE others", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + RTEMS_CALLING_OVERHEAD.TASK_DELETE + ); + + TEXT_IO.PUT_LINE( "*** END OF TIME TEST 6 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end TASK_1; + +-- +-- NULL_TASK +-- + + procedure NULL_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + begin + + NULL; + + end NULL_TASK; + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm06/tmtest.ads b/testsuites/ada/tmtests/tm06/tmtest.ads new file mode 100644 index 0000000000..a6eb2b2df8 --- /dev/null +++ b/testsuites/ada/tmtests/tm06/tmtest.ads @@ -0,0 +1,104 @@ +-- +-- TMTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 6 of the RTEMS +-- Timing 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 TIME_TEST_SUPPORT; +with RTEMS; +with RTEMS.TASKS; + +package TMTEST is + +-- +-- This array contains the IDs of all RTEMS tasks created by this test. +-- + + TASK_ID : array ( RTEMS.UNSIGNED32 + range 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.ID; + +-- +-- This variable is used to determine which restart of TASK_1 will start +-- timer and which will stop the timer and report the execution time. +-- + + TASK_RESTARTED : RTEMS.UNSIGNED32; + +-- +-- The following variable is set to the execution time returned +-- by the timer. +-- + + END_TIME : RTEMS.UNSIGNED32; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- TEST_INIT +-- +-- DESCRIPTION: +-- +-- This subprogram performs test initialization. +-- + + procedure TEST_INIT; + +-- +-- TASK_1 +-- +-- DESCRIPTION: +-- +-- This RTEMS task is responsible for measuring and reporting the +-- following directive execution times: +-- +-- + TASK_RESTART of SELF +-- + TASK_SUSPEND of another task with no context switch +-- + TASK_RESUME with no preemption +-- + TASK_DELETE of another task +-- + + procedure TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_1); + +-- +-- NULL_TASK +-- +-- DESCRIPTION: +-- +-- This RTEMS task has no operations. It is used to have +-- tasks to perform directives upon. +-- + + procedure NULL_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, NULL_TASK); + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm07/Makefile.am b/testsuites/ada/tmtests/tm07/Makefile.am new file mode 100644 index 0000000000..446c47dee1 --- /dev/null +++ b/testsuites/ada/tmtests/tm07/Makefile.am @@ -0,0 +1,13 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +noinst_PROGRAMS = ada_tm07 +ada_tm07_SOURCES = tm07.adb config.h tmtest.adb tmtest.ads +ada_tm07_SOURCES += ../../support/init.c + +ada_tm07$(EXEEXT): tm07.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/tmtests/tm07/config.h b/testsuites/ada/tmtests/tm07/config.h new file mode 100644 index 0000000000..b03802dcc5 --- /dev/null +++ b/testsuites/ada/tmtests/tm07/config.h @@ -0,0 +1,33 @@ +/* config.h + * + * This include file defines the Configuration Table for this test. + * + * COPYRIGHT (c) 1989-1997. + * 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_TMTEST + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER + +#define CONFIGURE_MAXIMUM_TASKS 111 +#define CONFIGURE_MAXIMUM_TIMERS 110 +#define CONFIGURE_MAXIMUM_SEMAPHORES 101 +#define CONFIGURE_TICKS_PER_TIMESLICE 0 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/tmtests/tm07/tm07.adb b/testsuites/ada/tmtests/tm07/tm07.adb new file mode 100644 index 0000000000..342406b38f --- /dev/null +++ b/testsuites/ada/tmtests/tm07/tm07.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test TM07 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 TMTEST; +with TEST_SUPPORT; + +procedure TM07 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, + TMTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end TM07; + diff --git a/testsuites/ada/tmtests/tm07/tmtest.adb b/testsuites/ada/tmtests/tm07/tmtest.adb new file mode 100644 index 0000000000..c3a2c62b96 --- /dev/null +++ b/testsuites/ada/tmtests/tm07/tmtest.adb @@ -0,0 +1,170 @@ +-- +-- TMTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 7 of the RTEMS +-- Timing 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 INTERFACES; use INTERFACES; +with RTEMS_CALLING_OVERHEAD; +with TEST_SUPPORT; +with TEXT_IO; +with TIMER_DRIVER; + +package body TMTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TIME TEST 7 ***" ); + + TMTEST.TEST_INIT; + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- TEST_INIT +-- + + procedure TEST_INIT + is + TASK_ENTRY : RTEMS.TASKS.ENTRY_POINT; + PRIORITY : RTEMS.TASKS.PRIORITY; + STATUS : RTEMS.STATUS_CODES; + begin + + PRIORITY := 250; + + for INDEX in 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + + RTEMS.TASKS.CREATE( + RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ), + PRIORITY, + 1024, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + TMTEST.TASK_ID( INDEX ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); + + PRIORITY := PRIORITY - 1; + + if INDEX = 0 then + TASK_ENTRY := TMTEST.LOW_TASK'ACCESS; + elsif INDEX = TIME_TEST_SUPPORT.OPERATION_COUNT then + TASK_ENTRY := TMTEST.HIGH_TASK'ACCESS; + else + TASK_ENTRY := TMTEST.MIDDLE_TASKS'ACCESS; + end if; + + RTEMS.TASKS.START( TMTEST.TASK_ID( INDEX ), TASK_ENTRY, 0, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); + + end loop; + + end TEST_INIT; + +-- +-- HIGH_TASK +-- + + procedure HIGH_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + STATUS : RTEMS.STATUS_CODES; + begin + + if ARGUMENT > 0 then + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + TIME_TEST_SUPPORT.PUT_TIME( + "TASK_RESTART suspended/preempt", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + 0, + RTEMS_CALLING_OVERHEAD.TASK_RESTART + ); + else + RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS ); + end if; + + TEXT_IO.PUT_LINE( "*** END OF TIME TEST 07 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end HIGH_TASK; + +-- +-- MIDDLE_TASKS +-- + + procedure MIDDLE_TASKS ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + STATUS : RTEMS.STATUS_CODES; + begin + + TMTEST.TASK_INDEX := TMTEST.TASK_INDEX + 1; + + if ARGUMENT > 0 then + RTEMS.TASKS.RESTART( + TMTEST.TASK_ID( TMTEST.TASK_INDEX ), + 16#7FFFFFFF#, + STATUS + ); + else + RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS ); + end if; + + + end MIDDLE_TASKS; + +-- +-- LOW_TASK +-- + + procedure LOW_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TMTEST.TASK_INDEX := 1; + TIMER_DRIVER.INITIALIZE; + + RTEMS.TASKS.RESTART( + TMTEST.TASK_ID( TMTEST.TASK_INDEX ), + 16#7FFFFFFF#, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESTART" ); + + end LOW_TASK; + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm07/tmtest.ads b/testsuites/ada/tmtests/tm07/tmtest.ads new file mode 100644 index 0000000000..3abc539505 --- /dev/null +++ b/testsuites/ada/tmtests/tm07/tmtest.ads @@ -0,0 +1,112 @@ +-- +-- TMTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 7 of the RTEMS +-- Timing 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 TIME_TEST_SUPPORT; +with RTEMS; +with RTEMS.TASKS; + +package TMTEST is + +-- +-- This array contains the IDs of all RTEMS tasks created by this test. +-- + + TASK_ID : array ( RTEMS.UNSIGNED32 + range 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.ID; + + TASK_INDEX : RTEMS.UNSIGNED32; + +-- +-- The following variable is set to the execution time returned +-- by the timer. +-- + + END_TIME : RTEMS.UNSIGNED32; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- TEST_INIT +-- +-- DESCRIPTION: +-- +-- This subprogram performs test initialization. +-- + + procedure TEST_INIT; + +-- +-- HIGH_TASK +-- +-- DESCRIPTION: +-- +-- This RTEMS task is the highest priority task in the system. +-- The first time it executes it suspends itself. When restarted +-- it stops the timer and reports the time for a TASK_RESTART +-- of a suspended task which results in a preemption. +-- + + procedure HIGH_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, HIGH_TASK); + +-- +-- MIDDLE_TASKS +-- +-- DESCRIPTION: +-- +-- These RTEMS tasks suspend themselves the first time they execute. +-- When restarted they perform a TASK_RESTART of a suspended +-- higher priority task which results in a preemption. +-- + + procedure MIDDLE_TASKS ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, MIDDLE_TASKS); + +-- +-- LOW_TASK +-- +-- DESCRIPTION: +-- +-- This RTEMS task is the lowest priority task in the system. +-- When it executes it starts the timer and restarts a higher +-- priority task which immediately preempts this task. +-- + + procedure LOW_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, LOW_TASK); + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm08/Makefile.am b/testsuites/ada/tmtests/tm08/Makefile.am new file mode 100644 index 0000000000..1b796066b0 --- /dev/null +++ b/testsuites/ada/tmtests/tm08/Makefile.am @@ -0,0 +1,13 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +noinst_PROGRAMS = ada_tm08 +ada_tm08_SOURCES = tm08.adb config.h tmtest.adb tmtest.ads +ada_tm08_SOURCES += ../../support/init.c + +ada_tm08$(EXEEXT): tm08.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/tmtests/tm08/config.h b/testsuites/ada/tmtests/tm08/config.h new file mode 100644 index 0000000000..b03802dcc5 --- /dev/null +++ b/testsuites/ada/tmtests/tm08/config.h @@ -0,0 +1,33 @@ +/* config.h + * + * This include file defines the Configuration Table for this test. + * + * COPYRIGHT (c) 1989-1997. + * 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_TMTEST + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER + +#define CONFIGURE_MAXIMUM_TASKS 111 +#define CONFIGURE_MAXIMUM_TIMERS 110 +#define CONFIGURE_MAXIMUM_SEMAPHORES 101 +#define CONFIGURE_TICKS_PER_TIMESLICE 0 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/tmtests/tm08/tm08.adb b/testsuites/ada/tmtests/tm08/tm08.adb new file mode 100644 index 0000000000..d927a18d63 --- /dev/null +++ b/testsuites/ada/tmtests/tm08/tm08.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test TM08 of the Timing 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 TMTEST; +with TEST_SUPPORT; + +procedure TM08 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, + TMTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end TM08; + diff --git a/testsuites/ada/tmtests/tm08/tmtest.adb b/testsuites/ada/tmtests/tm08/tmtest.adb new file mode 100644 index 0000000000..c1dbcb3e30 --- /dev/null +++ b/testsuites/ada/tmtests/tm08/tmtest.adb @@ -0,0 +1,299 @@ +-- +-- TMTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 8 of the RTEMS +-- Timing 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 INTERFACES; use INTERFACES; +with RTEMS_CALLING_OVERHEAD; +with TEST_SUPPORT; +with TEXT_IO; +with TIME_TEST_SUPPORT; +with TIMER_DRIVER; +with RTEMS.CLOCK; + +package body TMTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TIME TEST 8 ***" ); + + TMTEST.TEST_INIT; + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- TEST_INIT +-- + + procedure TEST_INIT + is + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.TASKS.CREATE( + 1, + 128, + 1024, + RTEMS.DEFAULT_OPTIONS, + RTEMS.DEFAULT_ATTRIBUTES, + TASK_ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); + + RTEMS.TASKS.START( TASK_ID, TMTEST.TEST_TASK'ACCESS, 0, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); + + RTEMS.TASKS.CREATE( + 1, + 254, + 1024, + RTEMS.DEFAULT_OPTIONS, + RTEMS.DEFAULT_ATTRIBUTES, + TASK_ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); + + RTEMS.TASKS.START( TASK_ID, TMTEST.TEST_TASK1'ACCESS, 0, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); + + end TEST_INIT; + +-- +-- TEST_TASK +-- + + procedure TEST_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + OVERHEAD : RTEMS.UNSIGNED32; + OLD_PRIORITY : RTEMS.TASKS.PRIORITY; + OLD_MODE : RTEMS.MODE; + TIME : RTEMS.TIME_OF_DAY; + STATUS : RTEMS.STATUS_CODES; + begin + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + TIMER_DRIVER.EMPTY_FUNCTION; + end loop; + OVERHEAD := TIMER_DRIVER.READ_TIMER; + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.TASKS.SET_PRIORITY( + TMTEST.TASK_ID, + RTEMS.TASKS.CURRENT_PRIORITY, + OLD_PRIORITY, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + TIME_TEST_SUPPORT.PUT_TIME( + "TASK_SET_PRIORITY current priority", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + RTEMS_CALLING_OVERHEAD.TASK_SET_PRIORITY + ); + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.TASKS.SET_PRIORITY( + TMTEST.TASK_ID, + 253, + OLD_PRIORITY, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + TIME_TEST_SUPPORT.PUT_TIME( + "TASK_SET_PRIORITY no preempt", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + RTEMS_CALLING_OVERHEAD.TASK_SET_PRIORITY + ); + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.TASKS.MODE( + RTEMS.CURRENT_MODE, + RTEMS.CURRENT_MODE, + OLD_MODE, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + TIME_TEST_SUPPORT.PUT_TIME( + "TASK_MODE (current)", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + RTEMS_CALLING_OVERHEAD.TASK_MODE + ); + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.TASKS.MODE( + RTEMS.INTERRUPT_LEVEL( 1 ), + RTEMS.INTERRUPT_MASK, + OLD_MODE, + STATUS + ); + RTEMS.TASKS.MODE( + RTEMS.INTERRUPT_LEVEL( 0 ), + RTEMS.INTERRUPT_MASK, + OLD_MODE, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + TIME_TEST_SUPPORT.PUT_TIME( + "TASK_MODE (no reschedule)", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT * 2, + OVERHEAD, + RTEMS_CALLING_OVERHEAD.TASK_MODE + ); + + TIMER_DRIVER.INITIALIZE; + RTEMS.TASKS.MODE( + RTEMS.NO_ASR, + RTEMS.ASR_MASK, + OLD_MODE, + STATUS + ); + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + TIME_TEST_SUPPORT.PUT_TIME( + "TASK_MODE (reschedule)", + TMTEST.END_TIME, + 1, + 0, + RTEMS_CALLING_OVERHEAD.TASK_MODE + ); + + RTEMS.TASKS.MODE( + RTEMS.NO_PREEMPT, + RTEMS.PREEMPT_MASK, + OLD_MODE, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); + + RTEMS.TASKS.SET_PRIORITY( + TMTEST.TASK_ID, + 1, + OLD_PRIORITY, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" ); + + TIMER_DRIVER.INITIALIZE; + RTEMS.TASKS.MODE( -- preempted by TEST_TASK1 + RTEMS.PREEMPT, + RTEMS.PREEMPT_MASK, + OLD_MODE, + STATUS + ); + + TIME := (1988, 1, 1, 0, 0, 0, 0 ); + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.CLOCK.SET( + TIME, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + TIME_TEST_SUPPORT.PUT_TIME( + "CLOCK_SET", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + RTEMS_CALLING_OVERHEAD.CLOCK_SET + ); + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.CLOCK.GET_TOD( TIME, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_GET_TOD" ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + TIME_TEST_SUPPORT.PUT_TIME( + "CLOCK_GET_TOD", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + RTEMS_CALLING_OVERHEAD.CLOCK_GET + ); + + TEXT_IO.PUT_LINE( "*** END OF TIME TEST 8 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end TEST_TASK; + +-- +-- TEST_TASK1 +-- + + procedure TEST_TASK1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + TIME_TEST_SUPPORT.PUT_TIME( + "TASK_MODE (preemptive) ", + TMTEST.END_TIME, + 1, + 0, + RTEMS_CALLING_OVERHEAD.TASK_MODE + ); + + RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "DOES NOT RETURN" ); + + end TEST_TASK1; + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm08/tmtest.ads b/testsuites/ada/tmtests/tm08/tmtest.ads new file mode 100644 index 0000000000..695235f479 --- /dev/null +++ b/testsuites/ada/tmtests/tm08/tmtest.ads @@ -0,0 +1,96 @@ +-- +-- TMTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 8 of the RTEMS +-- Timing 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; + +package TMTEST is + + TASK_ID : RTEMS.ID; + +-- +-- The following variable is set to the execution time returned +-- by the timer. +-- + + END_TIME : RTEMS.UNSIGNED32; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- TEST_INIT +-- +-- DESCRIPTION: +-- +-- This subprogram performs test initialization. +-- + + procedure TEST_INIT; + +-- +-- TEST_TASK +-- +-- DESCRIPTION: +-- +-- This RTEMS task is responsible for measuring and reporting the +-- following directive execution times: +-- +-- + TASK_SET_PRIORITY to obtain the current priority +-- + TASK_SET_PRIORITY which does not require a context switch +-- + TASK_MODE to obtain the current mode +-- + TASK_MODE which does not require a reschedule +-- + TASK_MODE which does require a reschedule +-- + TASK_MODE which causes a preemption *** TEST_TASK1 executes +-- + CLOCK_SET +-- + + procedure TEST_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TEST_TASK); + +-- +-- TEST_TASK2 +-- +-- DESCRIPTION: +-- +-- This RTEMS task is responsible for measuring and reporting the +-- following directive execution times: +-- +-- + TASK_MODE which results in a preemption +-- + + procedure TEST_TASK1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TEST_TASK1); + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm09/Makefile.am b/testsuites/ada/tmtests/tm09/Makefile.am new file mode 100644 index 0000000000..02a2317d34 --- /dev/null +++ b/testsuites/ada/tmtests/tm09/Makefile.am @@ -0,0 +1,13 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +noinst_PROGRAMS = ada_tm09 +ada_tm09_SOURCES = tm09.adb config.h tmtest.adb tmtest.ads +ada_tm09_SOURCES += ../../support/init.c + +ada_tm09$(EXEEXT): tm09.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/tmtests/tm09/config.h b/testsuites/ada/tmtests/tm09/config.h new file mode 100644 index 0000000000..56b5b2848e --- /dev/null +++ b/testsuites/ada/tmtests/tm09/config.h @@ -0,0 +1,32 @@ +/* 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_TMTEST + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER + +#define CONFIGURE_MAXIMUM_TASKS 2 +#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 +#define CONFIGURE_TICKS_PER_TIMESLICE 0 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/tmtests/tm09/tm09.adb b/testsuites/ada/tmtests/tm09/tm09.adb new file mode 100644 index 0000000000..6fe1971d44 --- /dev/null +++ b/testsuites/ada/tmtests/tm09/tm09.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test TM09 of the Timing 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 TMTEST; +with TEST_SUPPORT; + +procedure TM09 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, + TMTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end TM09; + diff --git a/testsuites/ada/tmtests/tm09/tmtest.adb b/testsuites/ada/tmtests/tm09/tmtest.adb new file mode 100644 index 0000000000..432a7b50a8 --- /dev/null +++ b/testsuites/ada/tmtests/tm09/tmtest.adb @@ -0,0 +1,297 @@ +-- +-- TMTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 9 of the RTEMS +-- Timing 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 INTERFACES; use INTERFACES; +with RTEMS_CALLING_OVERHEAD; +with TEST_SUPPORT; +with TEXT_IO; +with TIME_TEST_SUPPORT; +with TIMER_DRIVER; +with RTEMS.MESSAGE_QUEUE; + +package body TMTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + TASK_ID : RTEMS.ID; + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TIME TEST 9 ***" ); + + RTEMS.TASKS.CREATE( + 1, + 128, + 4096, + RTEMS.DEFAULT_OPTIONS, + RTEMS.DEFAULT_ATTRIBUTES, + TASK_ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); + + RTEMS.TASKS.START( TASK_ID, TMTEST.TEST_TASK'ACCESS, 0, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- TEST_TASK +-- + + procedure TEST_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TIMER_DRIVER.INITIALIZE; + RTEMS.MESSAGE_QUEUE.CREATE( + 1, + TIME_TEST_SUPPORT.OPERATION_COUNT, + 16, + RTEMS.DEFAULT_OPTIONS, + TMTEST.QUEUE_ID, + STATUS + ); + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + TIME_TEST_SUPPORT.PUT_TIME( + "MESSAGE_QUEUE_CREATE", + TMTEST.END_TIME, + 1, + 0, + RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_CREATE + ); + + TMTEST.QUEUE_TEST; + + TIMER_DRIVER.INITIALIZE; + RTEMS.MESSAGE_QUEUE.DELETE( + TMTEST.QUEUE_ID, + STATUS + ); + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_DELETE" ); + TIME_TEST_SUPPORT.PUT_TIME( + "MESSAGE_QUEUE_DELETE", + TMTEST.END_TIME, + 1, + 0, + RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_DELETE + ); + + TEXT_IO.PUT_LINE( "*** END OF TIME TEST 9 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end TEST_TASK; + +-- +-- QUEUE_TEST +-- + + procedure QUEUE_TEST + is + SEND_LOOP_TIME : RTEMS.UNSIGNED32; + URGENT_LOOP_TIME : RTEMS.UNSIGNED32; + RECEIVE_LOOP_TIME : RTEMS.UNSIGNED32; + SEND_TIME : RTEMS.UNSIGNED32; + URGENT_TIME : RTEMS.UNSIGNED32; + RECEIVE_TIME : RTEMS.UNSIGNED32; + EMPTY_FLUSH_TIME : RTEMS.UNSIGNED32; + FLUSH_TIME : RTEMS.UNSIGNED32; + FLUSH_COUNT : RTEMS.UNSIGNED32; + EMPTY_FLUSH_COUNT : RTEMS.UNSIGNED32; + BUFFER : TMTEST.BUFFER; + BUFFER_POINTER : RTEMS.ADDRESS; + MESSAGE_SIZE : RTEMS.UNSIGNED32 := 0; + STATUS : RTEMS.STATUS_CODES; + begin + + 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; + EMPTY_FLUSH_COUNT := 0; + + BUFFER_POINTER := BUFFER'ADDRESS; + + for ITERATIONS in 1 .. TIME_TEST_SUPPORT.ITERATION_COUNT + loop + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + TIMER_DRIVER.EMPTY_FUNCTION; + end loop; + SEND_LOOP_TIME := SEND_LOOP_TIME + TIMER_DRIVER.READ_TIMER; + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + TIMER_DRIVER.EMPTY_FUNCTION; + end loop; + URGENT_LOOP_TIME := URGENT_LOOP_TIME + TIMER_DRIVER.READ_TIMER; + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + TIMER_DRIVER.EMPTY_FUNCTION; + end loop; + RECEIVE_LOOP_TIME := RECEIVE_LOOP_TIME + TIMER_DRIVER.READ_TIMER; + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.MESSAGE_QUEUE.SEND( + TMTEST.QUEUE_ID, + BUFFER_POINTER, + 16, + STATUS + ); + end loop; + SEND_TIME := SEND_TIME + TIMER_DRIVER.READ_TIMER; + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.MESSAGE_QUEUE.RECEIVE( + TMTEST.QUEUE_ID, + BUFFER_POINTER, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + MESSAGE_SIZE, + STATUS + ); + end loop; + RECEIVE_TIME := RECEIVE_TIME + TIMER_DRIVER.READ_TIMER; + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.MESSAGE_QUEUE.URGENT( + TMTEST.QUEUE_ID, + BUFFER_POINTER, + 16, + STATUS + ); + end loop; + URGENT_TIME := URGENT_TIME + TIMER_DRIVER.READ_TIMER; + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.MESSAGE_QUEUE.RECEIVE( + TMTEST.QUEUE_ID, + BUFFER_POINTER, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + MESSAGE_SIZE, + STATUS + ); + end loop; + RECEIVE_TIME := RECEIVE_TIME + TIMER_DRIVER.READ_TIMER; + + TIMER_DRIVER.INITIALIZE; + RTEMS.MESSAGE_QUEUE.FLUSH( + TMTEST.QUEUE_ID, + EMPTY_FLUSH_COUNT, + STATUS + ); + EMPTY_FLUSH_TIME := EMPTY_FLUSH_TIME + TIMER_DRIVER.READ_TIMER; + + -- send one message to flush + RTEMS.MESSAGE_QUEUE.SEND( + TMTEST.QUEUE_ID, + BUFFER_POINTER, + 16, + STATUS + ); + TIMER_DRIVER.INITIALIZE; + RTEMS.MESSAGE_QUEUE.FLUSH( + TMTEST.QUEUE_ID, + FLUSH_COUNT, + STATUS + ); + FLUSH_TIME := FLUSH_TIME + TIMER_DRIVER.READ_TIMER; + + end loop; + + TIME_TEST_SUPPORT.PUT_TIME( + "MESSAGE_QUEUE_SEND (no tasks waiting)", + SEND_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT * + TIME_TEST_SUPPORT.ITERATION_COUNT, + SEND_LOOP_TIME, + RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_SEND + ); + + TIME_TEST_SUPPORT.PUT_TIME( + "MESSAGE_QUEUE_URGENT (no tasks waiting)", + URGENT_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT * + TIME_TEST_SUPPORT.ITERATION_COUNT, + URGENT_LOOP_TIME, + RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_URGENT + ); + + TIME_TEST_SUPPORT.PUT_TIME( + "MESSAGE_QUEUE_RECEIVE (messages available)", + RECEIVE_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT * + TIME_TEST_SUPPORT.ITERATION_COUNT * 2, + RECEIVE_LOOP_TIME * 2, + RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_RECEIVE + ); + + TIME_TEST_SUPPORT.PUT_TIME( + "MESSAGE_QUEUE_FLUSH (empty queue)", + EMPTY_FLUSH_TIME, + TIME_TEST_SUPPORT.ITERATION_COUNT, + 0, + RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_FLUSH + ); + + TIME_TEST_SUPPORT.PUT_TIME( + "MESSAGE_QUEUE_FLUSH (messages flushed)", + FLUSH_TIME, + TIME_TEST_SUPPORT.ITERATION_COUNT, + 0, + RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_FLUSH + ); + + end QUEUE_TEST; + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm09/tmtest.ads b/testsuites/ada/tmtests/tm09/tmtest.ads new file mode 100644 index 0000000000..ca02e74a51 --- /dev/null +++ b/testsuites/ada/tmtests/tm09/tmtest.ads @@ -0,0 +1,99 @@ +-- +-- TMTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 9 of the RTEMS +-- Timing 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; + +package TMTEST is + +-- +-- Buffer Record similar to that used by RTEMS 3.2.1. Using this +-- avoids changes to the test. +-- + + type BUFFER is + record + FIELD1 : RTEMS.UNSIGNED32; -- TEMPORARY UNTIL VARIABLE LENGTH + FIELD2 : RTEMS.UNSIGNED32; + FIELD3 : RTEMS.UNSIGNED32; + FIELD4 : RTEMS.UNSIGNED32; + end record; + +-- +-- The following is the ID of the message queue used for timing operations. +-- + + QUEUE_ID : RTEMS.ID; + +-- +-- The following variable is set to the execution time returned +-- by the timer. +-- + + END_TIME : RTEMS.UNSIGNED32; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- TEST_TASK +-- +-- DESCRIPTION: +-- +-- This RTEMS task is responsible for measuring and reporting the +-- following directive execution times: +-- +-- + MESSAGE_QUEUE_CREATE +-- + MESSAGE_QUEUE_DELETE +-- + + procedure TEST_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TEST_TASK); + +-- +-- QUEUE_TEST +-- +-- DESCRIPTION: +-- +-- This subprogram is responsible for measuring and reporting the +-- following directive execution times: +-- +-- + MESSAGE_QUEUE_SEND with no tasks waiting +-- + MESSAGE_QUEUE_URGENT with no tasks waiting +-- + MESSAGE_QUEUE_RECEIVE with messages available +-- + MESSAGE_QUEUE_FLUSH with an empty message queue +-- + MESSAGE_QUEUE_FLUSH with messages flushed +-- + + procedure QUEUE_TEST; + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm10/Makefile.am b/testsuites/ada/tmtests/tm10/Makefile.am new file mode 100644 index 0000000000..8becdcbfbd --- /dev/null +++ b/testsuites/ada/tmtests/tm10/Makefile.am @@ -0,0 +1,13 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +noinst_PROGRAMS = ada_tm10 +ada_tm10_SOURCES = tm10.adb config.h tmtest.adb tmtest.ads +ada_tm10_SOURCES += ../../support/init.c + +ada_tm10$(EXEEXT): tm10.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/tmtests/tm10/config.h b/testsuites/ada/tmtests/tm10/config.h new file mode 100644 index 0000000000..ee201258aa --- /dev/null +++ b/testsuites/ada/tmtests/tm10/config.h @@ -0,0 +1,32 @@ +/* config.h + * + * This include file defines the Configuration Table for this test. + * + * COPYRIGHT (c) 1989-1997. + * 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_TMTEST + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER + +#define CONFIGURE_MAXIMUM_TASKS 110 +#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 +#define CONFIGURE_TICKS_PER_TIMESLICE 0 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/tmtests/tm10/tm10.adb b/testsuites/ada/tmtests/tm10/tm10.adb new file mode 100644 index 0000000000..4117d7a01a --- /dev/null +++ b/testsuites/ada/tmtests/tm10/tm10.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test TM10 of the Timing 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 TMTEST; +with TEST_SUPPORT; + +procedure TM10 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, + TMTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end TM10; + diff --git a/testsuites/ada/tmtests/tm10/tmtest.adb b/testsuites/ada/tmtests/tm10/tmtest.adb new file mode 100644 index 0000000000..9a92266cf5 --- /dev/null +++ b/testsuites/ada/tmtests/tm10/tmtest.adb @@ -0,0 +1,220 @@ +-- +-- TMTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 10 of the RTEMS +-- Timing 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 INTERFACES; use INTERFACES; +with RTEMS_CALLING_OVERHEAD; +with TEST_SUPPORT; +with TEXT_IO; +with TIME_TEST_SUPPORT; +with TIMER_DRIVER; +with RTEMS.MESSAGE_QUEUE; + +package body TMTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TIME TEST 10 ***" ); + + TMTEST.TEST_INIT; + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- TEST_INIT +-- + + procedure TEST_INIT + is + TASK_ENTRY : RTEMS.TASKS.ENTRY_POINT; + PRIORITY : RTEMS.TASKS.PRIORITY; + OVERHEAD : RTEMS.UNSIGNED32; + TASK_ID : RTEMS.ID; + BUFFER : TMTEST.BUFFER; + BUFFER_POINTER : RTEMS.ADDRESS; + MESSAGE_SIZE : RTEMS.UNSIGNED32 := 0; + STATUS : RTEMS.STATUS_CODES; + begin + + BUFFER_POINTER := BUFFER'ADDRESS; + + PRIORITY := 5; + + for INDEX in 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + + RTEMS.TASKS.CREATE( + RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ), + PRIORITY, + 1024, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + TASK_ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); + + PRIORITY := PRIORITY + 1; + + if INDEX = 0 then + TASK_ENTRY := TMTEST.HIGH_TASK'ACCESS; + elsif INDEX = TIME_TEST_SUPPORT.OPERATION_COUNT then + TASK_ENTRY := TMTEST.LOW_TASK'ACCESS; + else + TASK_ENTRY := TMTEST.MIDDLE_TASKS'ACCESS; + end if; + + RTEMS.TASKS.START( TASK_ID, TASK_ENTRY, 0, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); + + end loop; + + RTEMS.MESSAGE_QUEUE.CREATE( + 1, + TIME_TEST_SUPPORT.OPERATION_COUNT, + 16, + RTEMS.DEFAULT_OPTIONS, + TMTEST.QUEUE_ID, + STATUS + ); + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + TIMER_DRIVER.EMPTY_FUNCTION; + end loop; + OVERHEAD := TIMER_DRIVER.READ_TIMER; + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.MESSAGE_QUEUE.RECEIVE( + TMTEST.QUEUE_ID, + BUFFER_POINTER, + RTEMS.NO_WAIT, + RTEMS.NO_TIMEOUT, + MESSAGE_SIZE, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + TIME_TEST_SUPPORT.PUT_TIME( + "MESSAGE_QUEUE_RECEIVE (NO_WAIT)", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_RECEIVE + ); + + end TEST_INIT; + +-- +-- HIGH_TASK +-- + + procedure HIGH_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + BUFFER : TMTEST.BUFFER; + BUFFER_POINTER : RTEMS.ADDRESS; + MESSAGE_SIZE : RTEMS.UNSIGNED32 := 0; + STATUS : RTEMS.STATUS_CODES; + begin + + BUFFER_POINTER := BUFFER'ADDRESS; + + TIMER_DRIVER.INITIALIZE; + + RTEMS.MESSAGE_QUEUE.RECEIVE( + TMTEST.QUEUE_ID, + BUFFER_POINTER, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + MESSAGE_SIZE, + STATUS + ); + + end HIGH_TASK; + +-- +-- MIDDLE_TASKS +-- + + procedure MIDDLE_TASKS ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + BUFFER : TMTEST.BUFFER; + BUFFER_POINTER : RTEMS.ADDRESS; + MESSAGE_SIZE : RTEMS.UNSIGNED32 := 0; + STATUS : RTEMS.STATUS_CODES; + begin + + BUFFER_POINTER := BUFFER'ADDRESS; + + RTEMS.MESSAGE_QUEUE.RECEIVE( + TMTEST.QUEUE_ID, + BUFFER_POINTER, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + MESSAGE_SIZE, + STATUS + ); + + end MIDDLE_TASKS; + +-- +-- LOW_TASK +-- + + procedure LOW_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + begin + + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + TIME_TEST_SUPPORT.PUT_TIME( + "MESSAGE_QUEUE_RECEIVE (blocking)", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + 0, + RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_RECEIVE + ); + + TEXT_IO.PUT_LINE( "*** END OF TIME TEST 10 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end LOW_TASK; + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm10/tmtest.ads b/testsuites/ada/tmtests/tm10/tmtest.ads new file mode 100644 index 0000000000..224630e1d5 --- /dev/null +++ b/testsuites/ada/tmtests/tm10/tmtest.ads @@ -0,0 +1,118 @@ +-- +-- TMTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 10 of the RTEMS +-- Timing 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; + +package TMTEST is + +-- +-- Buffer Record similar to that used by RTEMS 3.2.1. Using this +-- avoids changes to the test. +-- + + type BUFFER is + record + FIELD1 : RTEMS.UNSIGNED32; -- TEMPORARY UNTIL VARIABLE LENGTH + FIELD2 : RTEMS.UNSIGNED32; + FIELD3 : RTEMS.UNSIGNED32; + FIELD4 : RTEMS.UNSIGNED32; + end record; + +-- +-- The following is the ID of the message queue used for timing operations. +-- + + QUEUE_ID : RTEMS.ID; + +-- +-- The following variable is set to the execution time returned +-- by the timer. +-- + + END_TIME : RTEMS.UNSIGNED32; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- TEST_INIT +-- +-- DESCRIPTION: +-- +-- This subprogram performs test initialization. After initialization +-- has been completed, the NO_WAIT case for MESSAGE_QUEUE_RECEIVE +-- is timed and reported. +-- + + procedure TEST_INIT; + +-- +-- HIGH_TASK +-- +-- DESCRIPTION: +-- +-- This RTEMS task is the highest priority task in the system. +-- It starts the timer and performs a blocking MESSAGE_QUEUE_RECEIVE. +-- + + procedure HIGH_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, HIGH_TASK); + +-- +-- MIDDLE_TASKS +-- +-- DESCRIPTION: +-- +-- These RTEMS tasks perform a blocking MESSAGE_QUEUE_RECEIVE. +-- + + procedure MIDDLE_TASKS ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, MIDDLE_TASKS); + +-- +-- LOW_TASK +-- +-- DESCRIPTION: +-- +-- This RTEMS task stops the timer and reports the execution time +-- of a blocking MESSAGE_QUEUE_RECEIVE. +-- + + procedure LOW_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, LOW_TASK); + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm11/Makefile.am b/testsuites/ada/tmtests/tm11/Makefile.am new file mode 100644 index 0000000000..8779d31500 --- /dev/null +++ b/testsuites/ada/tmtests/tm11/Makefile.am @@ -0,0 +1,13 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +noinst_PROGRAMS = ada_tm11 +ada_tm11_SOURCES = tm11.adb config.h tmtest.adb tmtest.ads +ada_tm11_SOURCES += ../../support/init.c + +ada_tm11$(EXEEXT): tm11.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/tmtests/tm11/config.h b/testsuites/ada/tmtests/tm11/config.h new file mode 100644 index 0000000000..a5064b6e92 --- /dev/null +++ b/testsuites/ada/tmtests/tm11/config.h @@ -0,0 +1,32 @@ +/* config.h + * + * This include file defines the Configuration Table for this test. + * + * COPYRIGHT (c) 1989-1997. + * 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_TMTEST + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER + +#define CONFIGURE_MAXIMUM_TASKS 111 +#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 +#define CONFIGURE_TICKS_PER_TIMESLICE 0 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/tmtests/tm11/tm11.adb b/testsuites/ada/tmtests/tm11/tm11.adb new file mode 100644 index 0000000000..bcc91aa905 --- /dev/null +++ b/testsuites/ada/tmtests/tm11/tm11.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test TM11 of the Timing 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 TMTEST; +with TEST_SUPPORT; + +procedure TM11 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, + TMTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end TM11; + diff --git a/testsuites/ada/tmtests/tm11/tmtest.adb b/testsuites/ada/tmtests/tm11/tmtest.adb new file mode 100644 index 0000000000..610c248d57 --- /dev/null +++ b/testsuites/ada/tmtests/tm11/tmtest.adb @@ -0,0 +1,218 @@ +-- +-- TMTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 11 of the RTEMS +-- Timing 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 INTERFACES; use INTERFACES; +with RTEMS_CALLING_OVERHEAD; +with TEST_SUPPORT; +with TEXT_IO; +with TIME_TEST_SUPPORT; +with TIMER_DRIVER; +with RTEMS.MESSAGE_QUEUE; + +package body TMTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + TASK_ID : RTEMS.ID; + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TIME TEST 11 ***" ); + + RTEMS.TASKS.CREATE( + 1, + 251, + 1024, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + TASK_ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); + + RTEMS.TASKS.START( + TASK_ID, + TMTEST.TEST_INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- TEST_INIT +-- + + procedure TEST_INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + TASK_ENTRY : RTEMS.TASKS.ENTRY_POINT; + PRIORITY : RTEMS.TASKS.PRIORITY; + TASK_ID : RTEMS.ID; + BUFFER : TMTEST.BUFFER; + BUFFER_POINTER : RTEMS.ADDRESS; + STATUS : RTEMS.STATUS_CODES; + begin + + BUFFER_POINTER := BUFFER'ADDRESS; + +-- As each task is started, it preempts this task and performs a blocking +-- MESSAGE_QUEUE_RECEIVE. Upon completion of this loop all created tasks +-- are blocked. + + RTEMS.MESSAGE_QUEUE.CREATE( + RTEMS.BUILD_NAME( 'M', 'Q', '1', ' ' ), + TIME_TEST_SUPPORT.OPERATION_COUNT, + 16, + RTEMS.DEFAULT_OPTIONS, + TMTEST.QUEUE_ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_CREATE" ); + + PRIORITY := 250; + + for INDEX in 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT - 1 + loop + + RTEMS.TASKS.CREATE( + RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ), + PRIORITY, + 1024, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + TASK_ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); + + PRIORITY := PRIORITY - 1; + + if INDEX = TIME_TEST_SUPPORT.OPERATION_COUNT - 1 then + TASK_ENTRY := TMTEST.HIGH_TASK'ACCESS; + else + TASK_ENTRY := TMTEST.MIDDLE_TASKS'ACCESS; + end if; + + RTEMS.TASKS.START( TASK_ID, TASK_ENTRY, 0, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); + + end loop; + + TIMER_DRIVER.INITIALIZE; + RTEMS.MESSAGE_QUEUE.SEND( + TMTEST.QUEUE_ID, + BUFFER_POINTER, + 16, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); + + end TEST_INIT; + +-- +-- HIGH_TASK +-- + + procedure HIGH_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + BUFFER : TMTEST.BUFFER; + BUFFER_POINTER : RTEMS.ADDRESS; + MESSAGE_SIZE : RTEMS.UNSIGNED32 := 0; + STATUS : RTEMS.STATUS_CODES; + begin + + BUFFER_POINTER := BUFFER'ADDRESS; + + RTEMS.MESSAGE_QUEUE.RECEIVE( + TMTEST.QUEUE_ID, + BUFFER_POINTER, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + MESSAGE_SIZE, + STATUS + ); + + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "MESSAGE_QUEUE_SEND (preemptive)", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + 0, + RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_SEND + ); + + TEXT_IO.PUT_LINE( "*** END OF TIME TEST 11 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end HIGH_TASK; + +-- +-- MIDDLE_TASKS +-- + + procedure MIDDLE_TASKS ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + BUFFER : TMTEST.BUFFER; + BUFFER_POINTER : RTEMS.ADDRESS; + MESSAGE_SIZE : RTEMS.UNSIGNED32 := 0; + STATUS : RTEMS.STATUS_CODES; + begin + + BUFFER_POINTER := BUFFER'ADDRESS; + + RTEMS.MESSAGE_QUEUE.RECEIVE( + TMTEST.QUEUE_ID, + BUFFER_POINTER, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + MESSAGE_SIZE, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" ); + + RTEMS.MESSAGE_QUEUE.SEND( + TMTEST.QUEUE_ID, + BUFFER_POINTER, + 16, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); + + end MIDDLE_TASKS; + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm11/tmtest.ads b/testsuites/ada/tmtests/tm11/tmtest.ads new file mode 100644 index 0000000000..6718933b04 --- /dev/null +++ b/testsuites/ada/tmtests/tm11/tmtest.ads @@ -0,0 +1,115 @@ +-- +-- TMTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 11 of the RTEMS +-- Timing 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; + +package TMTEST is + +-- +-- Buffer Record similar to that used by RTEMS 3.2.1. Using this +-- avoids changes to the test. +-- + + type BUFFER is + record + FIELD1 : RTEMS.UNSIGNED32; -- TEMPORARY UNTIL VARIABLE LENGTH + FIELD2 : RTEMS.UNSIGNED32; + FIELD3 : RTEMS.UNSIGNED32; + FIELD4 : RTEMS.UNSIGNED32; + end record; + +-- +-- The following is the ID of the message queue used for timing operations. +-- + + QUEUE_ID : RTEMS.ID; + +-- +-- The following variable is set to the execution time returned +-- by the timer. +-- + + END_TIME : RTEMS.UNSIGNED32; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- TEST_INIT +-- +-- DESCRIPTION: +-- +-- This subprogram performs test initialization. As each application +-- task is created and started, it will preempt this task and +-- perform a blocking MESSAGE_QUEUE_RECEIVE. Once all of the +-- initialization is completed, the timer is started and the first +-- preemptive MESSAGE_QUEUE_SEND is executed. +-- + + procedure TEST_INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TEST_INIT); + +-- +-- HIGH_TASK +-- +-- DESCRIPTION: +-- +-- This RTEMS task is the highest priority task in the system. +-- It performs a blocking blocking MESSAGE_QUEUE_RECEIVE. It is +-- the last test task created and started. Thus it is the last +-- task to be enqueued waiting for a message and the last task +-- to receive the message. Once it receives the message, it +-- stops the timer and reports the execution time for a +-- preemptive MESSAGE_QUEUE_SEND. +-- + + procedure HIGH_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, HIGH_TASK); + +-- +-- MIDDLE_TASKS +-- +-- DESCRIPTION: +-- +-- As each of these RTEMS tasks is created and started, it preempts +-- the initialization task and perform a blocking MESSAGE_QUEUE_RECEIVE. +-- + + procedure MIDDLE_TASKS ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, MIDDLE_TASKS); + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm12/Makefile.am b/testsuites/ada/tmtests/tm12/Makefile.am new file mode 100644 index 0000000000..477ee54495 --- /dev/null +++ b/testsuites/ada/tmtests/tm12/Makefile.am @@ -0,0 +1,13 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +noinst_PROGRAMS = ada_tm12 +ada_tm12_SOURCES = tm12.adb config.h tmtest.adb tmtest.ads +ada_tm12_SOURCES += ../../support/init.c + +ada_tm12$(EXEEXT): tm12.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/tmtests/tm12/config.h b/testsuites/ada/tmtests/tm12/config.h new file mode 100644 index 0000000000..a5064b6e92 --- /dev/null +++ b/testsuites/ada/tmtests/tm12/config.h @@ -0,0 +1,32 @@ +/* config.h + * + * This include file defines the Configuration Table for this test. + * + * COPYRIGHT (c) 1989-1997. + * 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_TMTEST + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER + +#define CONFIGURE_MAXIMUM_TASKS 111 +#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 +#define CONFIGURE_TICKS_PER_TIMESLICE 0 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/tmtests/tm12/tm12.adb b/testsuites/ada/tmtests/tm12/tm12.adb new file mode 100644 index 0000000000..bea5e83b79 --- /dev/null +++ b/testsuites/ada/tmtests/tm12/tm12.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test TM12 of the Timing 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 TMTEST; +with TEST_SUPPORT; + +procedure TM12 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, + TMTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end TM12; + diff --git a/testsuites/ada/tmtests/tm12/tmtest.adb b/testsuites/ada/tmtests/tm12/tmtest.adb new file mode 100644 index 0000000000..a97330f7bf --- /dev/null +++ b/testsuites/ada/tmtests/tm12/tmtest.adb @@ -0,0 +1,204 @@ +-- +-- TMTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 12 of the RTEMS +-- Timing 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 INTERFACES; use INTERFACES; +with RTEMS_CALLING_OVERHEAD; +with TEST_SUPPORT; +with TEXT_IO; +with TIME_TEST_SUPPORT; +with TIMER_DRIVER; +with RTEMS.MESSAGE_QUEUE; + +package body TMTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + TASK_ID : RTEMS.ID; + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TIME TEST 12 ***" ); + + RTEMS.TASKS.CREATE( + 1, + 251, + 1024, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + TASK_ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); + + RTEMS.TASKS.START( + TASK_ID, + TMTEST.TEST_INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- TEST_INIT +-- + + procedure TEST_INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + TASK_ENTRY : RTEMS.TASKS.ENTRY_POINT; + PRIORITY : RTEMS.TASKS.PRIORITY; + TASK_ID : RTEMS.ID; + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.MESSAGE_QUEUE.CREATE( + RTEMS.BUILD_NAME( 'M', 'Q', '1', ' ' ), + TIME_TEST_SUPPORT.OPERATION_COUNT, + 16, + RTEMS.DEFAULT_OPTIONS, + TMTEST.QUEUE_ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_CREATE" ); + + PRIORITY := 250; + + for INDEX in 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT - 1 + loop + + RTEMS.TASKS.CREATE( + RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ), + PRIORITY, + 1024, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + TASK_ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); + + PRIORITY := PRIORITY - 1; + + if INDEX = TIME_TEST_SUPPORT.OPERATION_COUNT - 1 then + TASK_ENTRY := TMTEST.HIGH_TASK'ACCESS; + else + TASK_ENTRY := TMTEST.LOW_TASKS'ACCESS; + end if; + + RTEMS.TASKS.START( TASK_ID, TASK_ENTRY, 0, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); + + end loop; + + end TEST_INIT; + +-- +-- HIGH_TASK +-- + + procedure HIGH_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + BUFFER : TMTEST.BUFFER; + BUFFER_POINTER : RTEMS.ADDRESS; + OVERHEAD : RTEMS.UNSIGNED32; + STATUS : RTEMS.STATUS_CODES; + begin + + BUFFER_POINTER := BUFFER'ADDRESS; + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + TIMER_DRIVER.EMPTY_FUNCTION; + end loop; + OVERHEAD := TIMER_DRIVER.READ_TIMER; + + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + + RTEMS.MESSAGE_QUEUE.SEND( + TMTEST.QUEUE_ID, + BUFFER_POINTER, + 16, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_SEND" ); --XXX + + end loop; + + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "MESSAGE_QUEUE_SEND (readying)", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_SEND + ); + + TEXT_IO.PUT_LINE( "*** END OF TIME TEST 12 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end HIGH_TASK; + +-- +-- LOW_TASK +-- + + procedure LOW_TASKS ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + BUFFER : TMTEST.BUFFER; + BUFFER_POINTER : RTEMS.ADDRESS; + MESSAGE_SIZE : RTEMS.UNSIGNED32 := 0; + STATUS : RTEMS.STATUS_CODES; + begin + + BUFFER_POINTER := BUFFER'ADDRESS; + + RTEMS.MESSAGE_QUEUE.RECEIVE( + TMTEST.QUEUE_ID, + BUFFER_POINTER, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + MESSAGE_SIZE, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" ); --XXX + + end LOW_TASKS; + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm12/tmtest.ads b/testsuites/ada/tmtests/tm12/tmtest.ads new file mode 100644 index 0000000000..15ff276c7c --- /dev/null +++ b/testsuites/ada/tmtests/tm12/tmtest.ads @@ -0,0 +1,106 @@ +-- +-- TMTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 12 of the RTEMS +-- Timing 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; + +package TMTEST is + +-- +-- Buffer Record similar to that used by RTEMS 3.2.1. Using this +-- avoids changes to the test. +-- + + type BUFFER is + record + FIELD1 : RTEMS.UNSIGNED32; -- TEMPORARY UNTIL VARIABLE LENGTH + FIELD2 : RTEMS.UNSIGNED32; + FIELD3 : RTEMS.UNSIGNED32; + FIELD4 : RTEMS.UNSIGNED32; + end record; + +-- +-- The following is the ID of the message queue used for timing operations. +-- + + QUEUE_ID : RTEMS.ID; + +-- +-- The following variable is set to the execution time returned +-- by the timer. +-- + + END_TIME : RTEMS.UNSIGNED32; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- TEST_INIT +-- +-- DESCRIPTION: +-- +-- This subprogram performs test initialization. +-- + + procedure TEST_INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TEST_INIT); + +-- +-- HIGH_TASK +-- +-- DESCRIPTION: +-- +-- This RTEMS task is the lowest priority task in the system. It +-- only executes after all of the LOW_TASKS have blocked. It then +-- times a readying MESSAGE_QUEUE_SEND. +-- + + procedure HIGH_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, HIGH_TASK); + +-- +-- LOW_TASKS +-- +-- DESCRIPTION: +-- +-- These RTEMS tasks perform a blocking MESSAGE_QUEUE_RECEIVE. +-- + + procedure LOW_TASKS ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, LOW_TASKS); + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm13/Makefile.am b/testsuites/ada/tmtests/tm13/Makefile.am new file mode 100644 index 0000000000..9fc59619a0 --- /dev/null +++ b/testsuites/ada/tmtests/tm13/Makefile.am @@ -0,0 +1,13 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +noinst_PROGRAMS = ada_tm13 +ada_tm13_SOURCES = tm13.adb config.h tmtest.adb tmtest.ads +ada_tm13_SOURCES += ../../support/init.c + +ada_tm13$(EXEEXT): tm13.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/tmtests/tm13/config.h b/testsuites/ada/tmtests/tm13/config.h new file mode 100644 index 0000000000..a5064b6e92 --- /dev/null +++ b/testsuites/ada/tmtests/tm13/config.h @@ -0,0 +1,32 @@ +/* config.h + * + * This include file defines the Configuration Table for this test. + * + * COPYRIGHT (c) 1989-1997. + * 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_TMTEST + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER + +#define CONFIGURE_MAXIMUM_TASKS 111 +#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 +#define CONFIGURE_TICKS_PER_TIMESLICE 0 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/tmtests/tm13/tm13.adb b/testsuites/ada/tmtests/tm13/tm13.adb new file mode 100644 index 0000000000..ba2ab58065 --- /dev/null +++ b/testsuites/ada/tmtests/tm13/tm13.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test TM13 of the Timing 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 TMTEST; +with TEST_SUPPORT; + +procedure TM13 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, + TMTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end TM13; + diff --git a/testsuites/ada/tmtests/tm13/tmtest.adb b/testsuites/ada/tmtests/tm13/tmtest.adb new file mode 100644 index 0000000000..aa9a760f82 --- /dev/null +++ b/testsuites/ada/tmtests/tm13/tmtest.adb @@ -0,0 +1,216 @@ +-- +-- TMTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 13 of the RTEMS +-- Timing 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 INTERFACES; use INTERFACES; +with RTEMS_CALLING_OVERHEAD; +with TEST_SUPPORT; +with TEXT_IO; +with TIME_TEST_SUPPORT; +with TIMER_DRIVER; +with RTEMS.MESSAGE_QUEUE; + +package body TMTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + TASK_ID : RTEMS.ID; + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TIME TEST 13 ***" ); + + RTEMS.TASKS.CREATE( + 1, + 251, + 1024, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + TASK_ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); + + RTEMS.TASKS.START( + TASK_ID, + TMTEST.TEST_INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- TEST_INIT +-- + + procedure TEST_INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + TASK_ENTRY : RTEMS.TASKS.ENTRY_POINT; + PRIORITY : RTEMS.TASKS.PRIORITY; + TASK_ID : RTEMS.ID; + BUFFER : TMTEST.BUFFER; + BUFFER_POINTER : RTEMS.ADDRESS; + STATUS : RTEMS.STATUS_CODES; + begin + + BUFFER_POINTER := BUFFER'ADDRESS; + +-- As each task is started, it preempts this task and performs a blocking +-- MESSAGE_QUEUE_RECEIVE. Upon completion of this loop all created tasks +-- are blocked. + + RTEMS.MESSAGE_QUEUE.CREATE( + RTEMS.BUILD_NAME( 'M', 'Q', '1', ' ' ), + TIME_TEST_SUPPORT.OPERATION_COUNT, + 16, + RTEMS.DEFAULT_OPTIONS, + TMTEST.QUEUE_ID, + STATUS + ); + + PRIORITY := 250; + + for INDEX in 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT - 1 + loop + + RTEMS.TASKS.CREATE( + RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ), + PRIORITY, + 1024, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + TASK_ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); + + PRIORITY := PRIORITY - 1; + + if INDEX = TIME_TEST_SUPPORT.OPERATION_COUNT - 1 then + TASK_ENTRY := TMTEST.HIGH_TASK'ACCESS; + else + TASK_ENTRY := TMTEST.MIDDLE_TASKS'ACCESS; + end if; + + RTEMS.TASKS.START( TASK_ID, TASK_ENTRY, 0, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); + + end loop; + + TIMER_DRIVER.INITIALIZE; + RTEMS.MESSAGE_QUEUE.URGENT( + TMTEST.QUEUE_ID, + BUFFER_POINTER, + 16, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_URGENT" ); + + end TEST_INIT; + +-- +-- HIGH_TASK +-- + + procedure HIGH_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + BUFFER : TMTEST.BUFFER; + BUFFER_POINTER : RTEMS.ADDRESS; + MESSAGE_SIZE : RTEMS.UNSIGNED32 := 0; + STATUS : RTEMS.STATUS_CODES; + begin + + BUFFER_POINTER := BUFFER'ADDRESS; + + RTEMS.MESSAGE_QUEUE.RECEIVE( + TMTEST.QUEUE_ID, + BUFFER_POINTER, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + MESSAGE_SIZE, + STATUS + ); + + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + TIME_TEST_SUPPORT.PUT_TIME( + "MESSAGE_QUEUE_URGENT (preemptive)", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + 0, + RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_URGENT + ); + + TEXT_IO.PUT_LINE( "*** END OF TIME TEST 13 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end HIGH_TASK; + +-- +-- MIDDLE_TASKS +-- + + procedure MIDDLE_TASKS ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + BUFFER : TMTEST.BUFFER; + BUFFER_POINTER : RTEMS.ADDRESS; + MESSAGE_SIZE : RTEMS.UNSIGNED32 := 0; + STATUS : RTEMS.STATUS_CODES; + begin + + BUFFER_POINTER := BUFFER'ADDRESS; + + RTEMS.MESSAGE_QUEUE.RECEIVE( + TMTEST.QUEUE_ID, + BUFFER_POINTER, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + MESSAGE_SIZE, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_RECEIVE" ); + + RTEMS.MESSAGE_QUEUE.URGENT( + TMTEST.QUEUE_ID, + BUFFER_POINTER, + 16, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_URGENT" ); + + end MIDDLE_TASKS; + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm13/tmtest.ads b/testsuites/ada/tmtests/tm13/tmtest.ads new file mode 100644 index 0000000000..270bcda7e2 --- /dev/null +++ b/testsuites/ada/tmtests/tm13/tmtest.ads @@ -0,0 +1,115 @@ +-- +-- TMTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 13 of the RTEMS +-- Timing 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; + +package TMTEST is + +-- +-- Buffer Record similar to that used by RTEMS 3.2.1. Using this +-- avoids changes to the test. +-- + + type BUFFER is + record + FIELD1 : RTEMS.UNSIGNED32; -- TEMPORARY UNTIL VARIABLE LENGTH + FIELD2 : RTEMS.UNSIGNED32; + FIELD3 : RTEMS.UNSIGNED32; + FIELD4 : RTEMS.UNSIGNED32; + end record; + +-- +-- The following is the ID of the message queue used for timing operations. +-- + + QUEUE_ID : RTEMS.ID; + +-- +-- The following variable is set to the execution time returned +-- by the timer. +-- + + END_TIME : RTEMS.UNSIGNED32; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- TEST_INIT +-- +-- DESCRIPTION: +-- +-- This subprogram performs test initialization. As each application +-- task is created and started, it will preempt this task and +-- perform a blocking MESSAGE_QUEUE_RECEIVE. Once all of the +-- initialization is completed, the timer is started and the first +-- preemptive MESSAGE_QUEUE_URGENT is executed. +-- + + procedure TEST_INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TEST_INIT); + +-- +-- HIGH_TASK +-- +-- DESCRIPTION: +-- +-- This RTEMS task is the highest priority task in the system. +-- It performs a blocking blocking MESSAGE_QUEUE_RECEIVE. It is +-- the last test task created and started. Thus it is the last +-- task to be enqueued waiting for a message and the last task +-- to receive the message. Once it receives the message, it +-- stops the timer and reports the execution time for a +-- preemptive MESSAGE_QUEUE_URGENT. +-- + + procedure HIGH_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, HIGH_TASK); + +-- +-- MIDDLE_TASKS +-- +-- DESCRIPTION: +-- +-- As each of these RTEMS tasks is created and started, it preempts +-- the initialization task and perform a blocking MESSAGE_QUEUE_RECEIVE. +-- + + procedure MIDDLE_TASKS ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, MIDDLE_TASKS); + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm14/Makefile.am b/testsuites/ada/tmtests/tm14/Makefile.am new file mode 100644 index 0000000000..bc5e7d0377 --- /dev/null +++ b/testsuites/ada/tmtests/tm14/Makefile.am @@ -0,0 +1,13 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +noinst_PROGRAMS = ada_tm14 +ada_tm14_SOURCES = tm14.adb config.h tmtest.adb tmtest.ads +ada_tm14_SOURCES += ../../support/init.c + +ada_tm14$(EXEEXT): tm14.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/tmtests/tm14/config.h b/testsuites/ada/tmtests/tm14/config.h new file mode 100644 index 0000000000..a5064b6e92 --- /dev/null +++ b/testsuites/ada/tmtests/tm14/config.h @@ -0,0 +1,32 @@ +/* config.h + * + * This include file defines the Configuration Table for this test. + * + * COPYRIGHT (c) 1989-1997. + * 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_TMTEST + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER + +#define CONFIGURE_MAXIMUM_TASKS 111 +#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 +#define CONFIGURE_TICKS_PER_TIMESLICE 0 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/tmtests/tm14/tm14.adb b/testsuites/ada/tmtests/tm14/tm14.adb new file mode 100644 index 0000000000..3835813b60 --- /dev/null +++ b/testsuites/ada/tmtests/tm14/tm14.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test TM14 of the Timing 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 TMTEST; +with TEST_SUPPORT; + +procedure TM14 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, + TMTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end TM14; + diff --git a/testsuites/ada/tmtests/tm14/tmtest.adb b/testsuites/ada/tmtests/tm14/tmtest.adb new file mode 100644 index 0000000000..adde5deb77 --- /dev/null +++ b/testsuites/ada/tmtests/tm14/tmtest.adb @@ -0,0 +1,214 @@ +-- +-- TMTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 14 of the RTEMS +-- Timing 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 INTERFACES; use INTERFACES; +with RTEMS_CALLING_OVERHEAD; +with TEST_SUPPORT; +with TEXT_IO; +with TIME_TEST_SUPPORT; +with TIMER_DRIVER; +with RTEMS.MESSAGE_QUEUE; + +package body TMTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + TASK_ID : RTEMS.ID; + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TIME TEST 14 ***" ); + + RTEMS.TASKS.CREATE( + 1, + 251, + 1024, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + TASK_ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); + + RTEMS.TASKS.START( + TASK_ID, + TMTEST.TEST_INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- TEST_INIT +-- + + procedure TEST_INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + TASK_ENTRY : RTEMS.TASKS.ENTRY_POINT; + PRIORITY : RTEMS.TASKS.PRIORITY; + TASK_ID : RTEMS.ID; + BUFFER : TMTEST.BUFFER; + BUFFER_POINTER : RTEMS.ADDRESS; + STATUS : RTEMS.STATUS_CODES; + begin + + BUFFER_POINTER := BUFFER'ADDRESS; + + RTEMS.MESSAGE_QUEUE.CREATE( + RTEMS.BUILD_NAME( 'M', 'Q', '1', ' ' ), + TIME_TEST_SUPPORT.OPERATION_COUNT, + 16, + RTEMS.DEFAULT_OPTIONS, + TMTEST.QUEUE_ID, + STATUS + ); + + PRIORITY := 250; + + for INDEX in 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT - 1 + loop + + RTEMS.TASKS.CREATE( + RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ), + PRIORITY, + 1024, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + TASK_ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); + + PRIORITY := PRIORITY - 1; + + if INDEX = TIME_TEST_SUPPORT.OPERATION_COUNT - 1 then + TASK_ENTRY := TMTEST.HIGH_TASK'ACCESS; + else + TASK_ENTRY := TMTEST.LOW_TASKS'ACCESS; + end if; + + RTEMS.TASKS.START( TASK_ID, TASK_ENTRY, 0, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); + + end loop; + + TIMER_DRIVER.INITIALIZE; + RTEMS.MESSAGE_QUEUE.URGENT( + TMTEST.QUEUE_ID, + BUFFER_POINTER, + 16, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSSAGE_QUEUE_URGENT" ); + + end TEST_INIT; + +-- +-- HIGH_TASK +-- + + procedure HIGH_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + BUFFER : TMTEST.BUFFER; + BUFFER_POINTER : RTEMS.ADDRESS; + OVERHEAD : RTEMS.UNSIGNED32; + STATUS : RTEMS.STATUS_CODES; + begin + + BUFFER_POINTER := BUFFER'ADDRESS; + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + TIMER_DRIVER.EMPTY_FUNCTION; + end loop; + OVERHEAD := TIMER_DRIVER.READ_TIMER; + + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + + RTEMS.MESSAGE_QUEUE.URGENT( + TMTEST.QUEUE_ID, + BUFFER_POINTER, + 16, + STATUS + ); + + end loop; + + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "MESSAGE_QUEUE_URGENT (readying)", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_URGENT + ); + + TEXT_IO.PUT_LINE( "*** END OF TIME TEST 14 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end HIGH_TASK; + +-- +-- LOW_TASKS +-- + + procedure LOW_TASKS ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + BUFFER : TMTEST.BUFFER; + BUFFER_POINTER : RTEMS.ADDRESS; + MESSAGE_SIZE : RTEMS.UNSIGNED32 := 0; + STATUS : RTEMS.STATUS_CODES; + begin + + BUFFER_POINTER := BUFFER'ADDRESS; + + RTEMS.MESSAGE_QUEUE.RECEIVE( + TMTEST.QUEUE_ID, + BUFFER_POINTER, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + MESSAGE_SIZE, + STATUS + ); + + end LOW_TASKS; + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm14/tmtest.ads b/testsuites/ada/tmtests/tm14/tmtest.ads new file mode 100644 index 0000000000..c90b1cadc3 --- /dev/null +++ b/testsuites/ada/tmtests/tm14/tmtest.ads @@ -0,0 +1,106 @@ +-- +-- TMTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 14 of the RTEMS +-- Timing 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; + +package TMTEST is + +-- +-- Buffer Record similar to that used by RTEMS 3.2.1. Using this +-- avoids changes to the test. +-- + + type BUFFER is + record + FIELD1 : RTEMS.UNSIGNED32; -- TEMPORARY UNTIL VARIABLE LENGTH + FIELD2 : RTEMS.UNSIGNED32; + FIELD3 : RTEMS.UNSIGNED32; + FIELD4 : RTEMS.UNSIGNED32; + end record; + +-- +-- The following is the ID of the message queue used for timing operations. +-- + + QUEUE_ID : RTEMS.ID; + +-- +-- The following variable is set to the execution time returned +-- by the timer. +-- + + END_TIME : RTEMS.UNSIGNED32; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- TEST_INIT +-- +-- DESCRIPTION: +-- +-- This subprogram performs test initialization. +-- + + procedure TEST_INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TEST_INIT); + +-- +-- HIGH_TASK +-- +-- DESCRIPTION: +-- +-- This RTEMS task is the lowest priority task in the system. It +-- only executes after all of the LOW_TASKS have blocked. It then +-- times a readying MESSAGE_QUEUE_SEND. +-- + + procedure HIGH_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, HIGH_TASK); + +-- +-- LOW_TASKS +-- +-- DESCRIPTION: +-- +-- These RTEMS tasks perform a blocking MESSAGE_QUEUE_RECEIVE. +-- + + procedure LOW_TASKS ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, LOW_TASKS); + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm15/Makefile.am b/testsuites/ada/tmtests/tm15/Makefile.am new file mode 100644 index 0000000000..e792c9be21 --- /dev/null +++ b/testsuites/ada/tmtests/tm15/Makefile.am @@ -0,0 +1,13 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +noinst_PROGRAMS = ada_tm15 +ada_tm15_SOURCES = tm15.adb config.h tmtest.adb tmtest.ads +ada_tm15_SOURCES += ../../support/init.c + +ada_tm15$(EXEEXT): tm15.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/tmtests/tm15/config.h b/testsuites/ada/tmtests/tm15/config.h new file mode 100644 index 0000000000..a5064b6e92 --- /dev/null +++ b/testsuites/ada/tmtests/tm15/config.h @@ -0,0 +1,32 @@ +/* config.h + * + * This include file defines the Configuration Table for this test. + * + * COPYRIGHT (c) 1989-1997. + * 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_TMTEST + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER + +#define CONFIGURE_MAXIMUM_TASKS 111 +#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 +#define CONFIGURE_TICKS_PER_TIMESLICE 0 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/tmtests/tm15/tm15.adb b/testsuites/ada/tmtests/tm15/tm15.adb new file mode 100644 index 0000000000..31e40968da --- /dev/null +++ b/testsuites/ada/tmtests/tm15/tm15.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test TM15 of the Timing 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 TMTEST; +with TEST_SUPPORT; + +procedure TM15 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, + TMTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end TM15; + diff --git a/testsuites/ada/tmtests/tm15/tmtest.adb b/testsuites/ada/tmtests/tm15/tmtest.adb new file mode 100644 index 0000000000..2a7efedcf9 --- /dev/null +++ b/testsuites/ada/tmtests/tm15/tmtest.adb @@ -0,0 +1,267 @@ +-- +-- TMTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 15 of the RTEMS +-- Timing 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_CALLING_OVERHEAD; +with TEST_SUPPORT; +with TEXT_IO; +with TIMER_DRIVER; +with RTEMS.EVENT; + +package body TMTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TIME TEST 15 ***" ); + + TMTEST.TEST_INIT; + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- TEST_INIT +-- + + procedure TEST_INIT + is + ID : RTEMS.ID; + OVERHEAD : RTEMS.UNSIGNED32; + EVENT_OUT : RTEMS.EVENT_SET; + STATUS : RTEMS.STATUS_CODES; + begin + + TMTEST.TIME_SET := FALSE; + + RTEMS.TASKS.CREATE( + RTEMS.BUILD_NAME( 'L', 'O', 'W', ' ' ), + 10, + 1024, + RTEMS.NO_PREEMPT, + RTEMS.DEFAULT_ATTRIBUTES, + ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOW" ); + + RTEMS.TASKS.START( ID, TMTEST.LOW_TASK'ACCESS, 0, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOW" ); + + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + + RTEMS.TASKS.CREATE( + RTEMS.BUILD_NAME( 'H', 'I', 'G', 'H' ), + 5, + 1024, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + TMTEST.TASK_ID( INDEX ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); + + RTEMS.TASKS.START( + TMTEST.TASK_ID( INDEX ), + TMTEST.HIGH_TASKS'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); + + end loop; + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + TIMER_DRIVER.EMPTY_FUNCTION; + end loop; + OVERHEAD := TIMER_DRIVER.READ_TIMER; + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.EVENT.RECEIVE( + RTEMS.PENDING_EVENTS, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + EVENT_OUT, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "EVENT_RECEIVE (current)", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + RTEMS_CALLING_OVERHEAD.EVENT_RECEIVE + ); + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.EVENT.RECEIVE( + RTEMS.ALL_EVENTS, + RTEMS.NO_WAIT, + RTEMS.NO_TIMEOUT, + EVENT_OUT, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "EVENT_RECEIVE (NO_WAIT)", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + RTEMS_CALLING_OVERHEAD.EVENT_RECEIVE + ); + + end TEST_INIT; + +-- +-- LOW_TASK +-- + + procedure LOW_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + EVENT_OUT : RTEMS.EVENT_SET; + OVERHEAD : RTEMS.UNSIGNED32; + STATUS : RTEMS.STATUS_CODES; + begin + + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "EVENT_RECEIVE (blocking)", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + 0, + RTEMS_CALLING_OVERHEAD.EVENT_RECEIVE + ); + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + TIMER_DRIVER.EMPTY_FUNCTION; + end loop; + OVERHEAD := TIMER_DRIVER.READ_TIMER; + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.EVENT.SEND( RTEMS.SELF, RTEMS.EVENT_16, STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "EVENT_SEND (returns to caller)", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + RTEMS_CALLING_OVERHEAD.EVENT_SEND + ); + + TIMER_DRIVER.INITIALIZE; + RTEMS.EVENT.RECEIVE( + RTEMS.EVENT_16, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + EVENT_OUT, + STATUS + ); + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "EVENT_RECEIVE (available)", + TMTEST.END_TIME, + 1, + 0, + RTEMS_CALLING_OVERHEAD.EVENT_RECEIVE + ); + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.EVENT.SEND( + TMTEST.TASK_ID( INDEX ), + RTEMS.EVENT_16, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "EVENT_SEND (readying)", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + RTEMS_CALLING_OVERHEAD.EVENT_SEND + ); + + TEXT_IO.PUT_LINE( "*** END OF TIME TEST 15 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end LOW_TASK; + +-- +-- HIGH_TASKS +-- + + procedure HIGH_TASKS ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + EVENT_OUT : RTEMS.EVENT_SET; + STATUS : RTEMS.STATUS_CODES; + begin + + if TMTEST.TIME_SET = FALSE then + TMTEST.TIME_SET := TRUE; + TIMER_DRIVER.INITIALIZE; + end if; + + RTEMS.EVENT.RECEIVE( + 16#7FFFFFFF#, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + EVENT_OUT, + STATUS + ); + + end HIGH_TASKS; + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm15/tmtest.ads b/testsuites/ada/tmtests/tm15/tmtest.ads new file mode 100644 index 0000000000..b8ab38d6cd --- /dev/null +++ b/testsuites/ada/tmtests/tm15/tmtest.ads @@ -0,0 +1,109 @@ +-- +-- TMTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 15 of the RTEMS +-- Timing 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 TIME_TEST_SUPPORT; +with RTEMS; +with RTEMS.TASKS; + +package TMTEST is + +-- +-- This array contains the IDs of all RTEMS tasks created by this test. +-- + + TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. + TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.ID; + +-- +-- This variable is set to TRUE if the timer has been initialized +-- and is currently timing an operation. +-- + + TIME_SET : Standard.BOOLEAN; + +-- +-- The following variable is set to the execution time returned +-- by the timer. +-- + + END_TIME : RTEMS.UNSIGNED32; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- TEST_INIT +-- +-- DESCRIPTION: +-- +-- This subprogram performs test initialization. Once initialization +-- has been completed, the following operations are timed and reported: +-- +-- + event_receive of currently PENDING_EVENTS +-- + event_receive NO_WAIT case +-- + + procedure TEST_INIT; + +-- +-- LOW_TASK +-- +-- DESCRIPTION: +-- +-- This RTEMS task stops the timer and reports the execution time +-- of a blocking EVENT_RECEIVE. After this the following +-- operations are timed and the execution time is reported: +-- +-- + EVENT_SEND which does not ready a task +-- + EVENT_RECEIVE with the event condition available +-- + EVENT_SEND which readies a task +-- + + procedure LOW_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, LOW_TASK); + +-- +-- HIGH_TASKS +-- +-- DESCRIPTION: +-- +-- These RTEMS tasks executive a blocking EVENT_RECEIVE after +-- initialization is complete. The first of these tasks to +-- execute starts the timer. +-- + + procedure HIGH_TASKS ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, HIGH_TASKS); + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm16/Makefile.am b/testsuites/ada/tmtests/tm16/Makefile.am new file mode 100644 index 0000000000..95257974f5 --- /dev/null +++ b/testsuites/ada/tmtests/tm16/Makefile.am @@ -0,0 +1,13 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +noinst_PROGRAMS = ada_tm16 +ada_tm16_SOURCES = tm16.adb config.h tmtest.adb tmtest.ads +ada_tm16_SOURCES += ../../support/init.c + +ada_tm16$(EXEEXT): tm16.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/tmtests/tm16/config.h b/testsuites/ada/tmtests/tm16/config.h new file mode 100644 index 0000000000..a5064b6e92 --- /dev/null +++ b/testsuites/ada/tmtests/tm16/config.h @@ -0,0 +1,32 @@ +/* config.h + * + * This include file defines the Configuration Table for this test. + * + * COPYRIGHT (c) 1989-1997. + * 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_TMTEST + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER + +#define CONFIGURE_MAXIMUM_TASKS 111 +#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 +#define CONFIGURE_TICKS_PER_TIMESLICE 0 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/tmtests/tm16/tm16.adb b/testsuites/ada/tmtests/tm16/tm16.adb new file mode 100644 index 0000000000..a6d67d93ce --- /dev/null +++ b/testsuites/ada/tmtests/tm16/tm16.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test TM16 of the Timing 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 TMTEST; +with TEST_SUPPORT; + +procedure TM16 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, + TMTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end TM16; + diff --git a/testsuites/ada/tmtests/tm16/tmtest.adb b/testsuites/ada/tmtests/tm16/tmtest.adb new file mode 100644 index 0000000000..4be7a6bbd6 --- /dev/null +++ b/testsuites/ada/tmtests/tm16/tmtest.adb @@ -0,0 +1,196 @@ +-- +-- TMTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 16 of the RTEMS +-- Timing 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 INTERFACES; use INTERFACES; +with RTEMS_CALLING_OVERHEAD; +with TEST_SUPPORT; +with TEXT_IO; +with TIMER_DRIVER; +with RTEMS.EVENT; + +package body TMTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + ID : RTEMS.ID; + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TIME TEST 16 ***" ); + + RTEMS.TASKS.CREATE( + RTEMS.BUILD_NAME( 'T', 'E', 'S', 'T' ), + 251, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TEST INIT" ); + + RTEMS.TASKS.START( + ID, + TMTEST.TEST_INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TEST INIT" ); + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- TEST_INIT +-- + + procedure TEST_INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + PRIORITY : RTEMS.TASKS.PRIORITY; + TASK_ENTRY : RTEMS.TASKS.ENTRY_POINT; + STATUS : RTEMS.STATUS_CODES; + begin + + PRIORITY := 250; + + for INDEX in 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + + RTEMS.TASKS.CREATE( + RTEMS.BUILD_NAME( 'M', 'I', 'D', ' ' ), + PRIORITY, + 1024, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + TMTEST.TASK_ID( INDEX ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); + + if INDEX = TIME_TEST_SUPPORT.OPERATION_COUNT then + TASK_ENTRY := TMTEST.HIGH_TASK'ACCESS; + else + TASK_ENTRY := TMTEST.MIDDLE_TASKS'ACCESS; + end if; + + RTEMS.TASKS.START( + TMTEST.TASK_ID( INDEX ), + TASK_ENTRY, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); + + PRIORITY := PRIORITY - 1; + + end loop; + + TMTEST.TASK_COUNT := 0; + + TIMER_DRIVER.INITIALIZE; -- starts the timer + + RTEMS.EVENT.SEND( -- preempts task + TMTEST.TASK_ID( TMTEST.TASK_COUNT ), + RTEMS.EVENT_16, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND" ); + + end TEST_INIT; + +-- +-- MIDDLE_TASKS +-- + + procedure MIDDLE_TASKS ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + EVENT_OUT : RTEMS.EVENT_SET; + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.EVENT.RECEIVE( -- task blocks + RTEMS.EVENT_16, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + EVENT_OUT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_RECEIVE" ); + + TMTEST.TASK_COUNT := TMTEST.TASK_COUNT + 1; + + RTEMS.EVENT.SEND( -- preempts task + TMTEST.TASK_ID( TMTEST.TASK_COUNT ), + RTEMS.EVENT_16, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "EVENT_SEND" ); + + end MIDDLE_TASKS; + +-- +-- HIGH_TASK +-- + + procedure HIGH_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + EVENT_OUT : RTEMS.EVENT_SET; + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.EVENT.RECEIVE( -- task blocks + RTEMS.EVENT_16, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + EVENT_OUT, + STATUS + ); + + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "EVENT_SEND (preemptive)", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + 0, + RTEMS_CALLING_OVERHEAD.EVENT_SEND + ); + + TEXT_IO.PUT_LINE( "*** END OF TIME TEST 16 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end HIGH_TASK; + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm16/tmtest.ads b/testsuites/ada/tmtests/tm16/tmtest.ads new file mode 100644 index 0000000000..ab42eb259c --- /dev/null +++ b/testsuites/ada/tmtests/tm16/tmtest.ads @@ -0,0 +1,112 @@ +-- +-- TMTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 16 of the RTEMS +-- Timing 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 TIME_TEST_SUPPORT; + +package TMTEST is + +-- +-- This array contains the IDs of all RTEMS tasks created by this test. +-- + + TASK_ID : array ( RTEMS.UNSIGNED32 + range 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.ID; + +-- +-- This variable is used to index through the TASK_ID array +-- so that events can be send to the next task. +-- + + TASK_COUNT : RTEMS.UNSIGNED32; + +-- +-- The following variable is set to the execution time returned +-- by the timer. +-- + + END_TIME : RTEMS.UNSIGNED32; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- TEST_INIT +-- +-- DESCRIPTION: +-- +-- This subprogram performs test initialization. Once initialization +-- has been completed, this task sets the TASK_COUNT to 0 and +-- starts the timer before performing a preemptive EVENT_SEND. +-- + + procedure TEST_INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TEST_INIT); + +-- +-- HIGH_TASK +-- +-- DESCRIPTION: +-- +-- This RTEMS task is highest priority task in the system. +-- Its first action is to perform a blocking EVENT_RECEIVE. +-- It is the last task to have its event set sent to it. Thus it +-- is the last task to be awakened by a preemptive EVENT_SEND. +-- After it preempts the last MIDDLE_TASKS, it stops the timer +-- and reports the execution time of preemptive EVENT_SEND. +-- + + procedure HIGH_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, HIGH_TASK); + +-- +-- MIDDLE_TASKS +-- +-- DESCRIPTION: +-- +-- These RTEMS tasks perform a blocking EVENT_RECEIVE. When +-- readied, each task will increment the TASK_COUNT and +-- perform a preemptive EVENT_SEND. TASK_COUNT is used to +-- index the TASK_ID array in such a way that incrementing +-- TASK_COUNT makes it index the ID of the next task to +-- send events to. +-- + + procedure MIDDLE_TASKS ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, MIDDLE_TASKS); + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm17/Makefile.am b/testsuites/ada/tmtests/tm17/Makefile.am new file mode 100644 index 0000000000..d8715ded65 --- /dev/null +++ b/testsuites/ada/tmtests/tm17/Makefile.am @@ -0,0 +1,13 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +noinst_PROGRAMS = ada_tm17 +ada_tm17_SOURCES = tm17.adb config.h tmtest.adb tmtest.ads +ada_tm17_SOURCES += ../../support/init.c + +ada_tm17$(EXEEXT): tm17.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/tmtests/tm17/config.h b/testsuites/ada/tmtests/tm17/config.h new file mode 100644 index 0000000000..a5064b6e92 --- /dev/null +++ b/testsuites/ada/tmtests/tm17/config.h @@ -0,0 +1,32 @@ +/* config.h + * + * This include file defines the Configuration Table for this test. + * + * COPYRIGHT (c) 1989-1997. + * 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_TMTEST + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER + +#define CONFIGURE_MAXIMUM_TASKS 111 +#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 +#define CONFIGURE_TICKS_PER_TIMESLICE 0 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/tmtests/tm17/tm17.adb b/testsuites/ada/tmtests/tm17/tm17.adb new file mode 100644 index 0000000000..efc2766479 --- /dev/null +++ b/testsuites/ada/tmtests/tm17/tm17.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test TM17 of the Timing 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 TMTEST; +with TEST_SUPPORT; + +procedure TM17 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, + TMTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end TM17; + diff --git a/testsuites/ada/tmtests/tm17/tmtest.adb b/testsuites/ada/tmtests/tm17/tmtest.adb new file mode 100644 index 0000000000..5e645581d4 --- /dev/null +++ b/testsuites/ada/tmtests/tm17/tmtest.adb @@ -0,0 +1,155 @@ +-- +-- TMTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 17 of the RTEMS +-- Timing 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 INTERFACES; use INTERFACES; +with RTEMS_CALLING_OVERHEAD; +with TEST_SUPPORT; +with TEXT_IO; +with TIMER_DRIVER; + +package body TMTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + TASK_ENTRY : RTEMS.TASKS.ENTRY_POINT; + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TIME TEST 17 ***" ); + + TMTEST.TASK_PRIORITY := 254; + + for INDEX in 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + + RTEMS.TASKS.CREATE( + RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ), + TMTEST.TASK_PRIORITY, + 1024, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + TMTEST.TASK_ID( INDEX ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); + + if INDEX = TIME_TEST_SUPPORT.OPERATION_COUNT then + TASK_ENTRY := TMTEST.LAST_TASK'ACCESS; + elsif INDEX = 0 then + TASK_ENTRY := TMTEST.FIRST_TASK'ACCESS; + else + TASK_ENTRY := TMTEST.MIDDLE_TASKS'ACCESS; + end if; + + RTEMS.TASKS.START( TMTEST.TASK_ID( INDEX ), TASK_ENTRY, 0, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); + + end loop; + + TMTEST.TASK_COUNT := 1; + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- FIRST_TASK +-- + + procedure FIRST_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + PREVIOUS_PRIORITY : RTEMS.TASKS.PRIORITY; + STATUS : RTEMS.STATUS_CODES; + begin + + TIMER_DRIVER.INITIALIZE; + + TMTEST.TASK_PRIORITY := TMTEST.TASK_PRIORITY - 1; + TMTEST.TASK_COUNT := TMTEST.TASK_COUNT + 1; + + RTEMS.TASKS.SET_PRIORITY( + TMTEST.TASK_ID( TMTEST.TASK_COUNT ), + TMTEST.TASK_PRIORITY, + PREVIOUS_PRIORITY, + STATUS + ); + + end FIRST_TASK; + +-- +-- MIDDLE_TASKS +-- + + procedure MIDDLE_TASKS ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + PREVIOUS_PRIORITY : RTEMS.TASKS.PRIORITY; + STATUS : RTEMS.STATUS_CODES; + begin + + TMTEST.TASK_PRIORITY := TMTEST.TASK_PRIORITY - 1; + TMTEST.TASK_COUNT := TMTEST.TASK_COUNT + 1; + + RTEMS.TASKS.SET_PRIORITY( + TMTEST.TASK_ID( TMTEST.TASK_COUNT ), + TMTEST.TASK_PRIORITY, + PREVIOUS_PRIORITY, + STATUS + ); + + end MIDDLE_TASKS; + +-- +-- LAST_TASK +-- + + procedure LAST_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + begin + + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TASK_SET_PRIORITY (preemptive)", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + 0, + RTEMS_CALLING_OVERHEAD.TASK_SET_PRIORITY + ); + + TEXT_IO.PUT_LINE( "*** END OF TIME TEST 17 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end LAST_TASK; + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm17/tmtest.ads b/testsuites/ada/tmtests/tm17/tmtest.ads new file mode 100644 index 0000000000..b2c9369e26 --- /dev/null +++ b/testsuites/ada/tmtests/tm17/tmtest.ads @@ -0,0 +1,110 @@ +-- +-- TMTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 17 of the RTEMS +-- Timing 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 TIME_TEST_SUPPORT; + +package TMTEST is + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS tasks created +-- by this test. +-- + + TASK_ID : array ( RTEMS.UNSIGNED32 + range 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.ID; + TASK_NAME : array ( RTEMS.UNSIGNED32 + range 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.NAME; + +-- +-- These variables are used to index the TASK_ID array and change +-- the priority of each successive task such that the TASK_SET_PRIORITY +-- results in a preemption. +-- + + TASK_COUNT : RTEMS.UNSIGNED32; + TASK_PRIORITY : RTEMS.TASKS.PRIORITY; + +-- +-- The following variable is set to the execution time returned +-- by the timer. +-- + + END_TIME : RTEMS.UNSIGNED32; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- FIRST_TASK +-- +-- DESCRIPTION: +-- +-- This RTEMS task is the first task to execute in the system. It +-- starts the timer and updates the TASK_COUNT and TASK_PRIORITY +-- variables so that a preemptive TASK_SET_PRIORITY can be performed. +-- + + procedure FIRST_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, FIRST_TASK); + +-- +-- MIDDLE_TASK +-- +-- DESCRIPTION: +-- +-- These RTEMS tasks update the TASK_COUNT and TASK_PRIORITY variables +-- so that a preemptive TASK_SET_PRIORITY can be performed. +-- + + procedure MIDDLE_TASKS ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, MIDDLE_TASKS); + +-- +-- LAST_TASK +-- +-- DESCRIPTION: +-- +-- This RTEMS task is the last task to execute in the system. It +-- stops the timer and reports the execution time of a preemptive +-- TASK_SET_PRIORITY. +-- + + procedure LAST_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, LAST_TASK); + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm18/Makefile.am b/testsuites/ada/tmtests/tm18/Makefile.am new file mode 100644 index 0000000000..62820c5a4d --- /dev/null +++ b/testsuites/ada/tmtests/tm18/Makefile.am @@ -0,0 +1,13 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +noinst_PROGRAMS = ada_tm18 +ada_tm18_SOURCES = tm18.adb config.h tmtest.adb tmtest.ads +ada_tm18_SOURCES += ../../support/init.c + +ada_tm18$(EXEEXT): tm18.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/tmtests/tm18/config.h b/testsuites/ada/tmtests/tm18/config.h new file mode 100644 index 0000000000..a5064b6e92 --- /dev/null +++ b/testsuites/ada/tmtests/tm18/config.h @@ -0,0 +1,32 @@ +/* config.h + * + * This include file defines the Configuration Table for this test. + * + * COPYRIGHT (c) 1989-1997. + * 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_TMTEST + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER + +#define CONFIGURE_MAXIMUM_TASKS 111 +#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 +#define CONFIGURE_TICKS_PER_TIMESLICE 0 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/tmtests/tm18/tm18.adb b/testsuites/ada/tmtests/tm18/tm18.adb new file mode 100644 index 0000000000..856b6f1127 --- /dev/null +++ b/testsuites/ada/tmtests/tm18/tm18.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test TM18 of the Timing 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 TMTEST; +with TEST_SUPPORT; + +procedure TM18 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, + TMTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end TM18; + diff --git a/testsuites/ada/tmtests/tm18/tmtest.adb b/testsuites/ada/tmtests/tm18/tmtest.adb new file mode 100644 index 0000000000..e86b24cd4a --- /dev/null +++ b/testsuites/ada/tmtests/tm18/tmtest.adb @@ -0,0 +1,151 @@ +-- +-- TMTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 18 of the RTEMS +-- Timing 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 INTERFACES; use INTERFACES; +with RTEMS_CALLING_OVERHEAD; +with TEST_SUPPORT; +with TEXT_IO; +with TIME_TEST_SUPPORT; +with TIMER_DRIVER; + +package body TMTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TIME TEST 18 ***" ); + + TMTEST.TEST_INIT; + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- TEST_INIT +-- + + procedure TEST_INIT + is + ID : RTEMS.ID; + TASK_ENTRY : RTEMS.TASKS.ENTRY_POINT; + STATUS : RTEMS.STATUS_CODES; + begin + + for INDEX in 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + + RTEMS.TASKS.CREATE( + RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ), + 128, + 1024, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); + + + if INDEX = TIME_TEST_SUPPORT.OPERATION_COUNT then + TASK_ENTRY := TMTEST.LAST_TASK'ACCESS; + elsif INDEX = 0 then + TASK_ENTRY := TMTEST.FIRST_TASK'ACCESS; + else + TASK_ENTRY := TMTEST.MIDDLE_TASKS'ACCESS; + end if; + + RTEMS.TASKS.START( ID, TASK_ENTRY, 0, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); + + end loop; + + end TEST_INIT; + +-- +-- FIRST_TASK +-- + + procedure FIRST_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TIMER_DRIVER.INITIALIZE; + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE" ); + + end FIRST_TASK; + +-- +-- MIDDLE_TASKS +-- + + procedure MIDDLE_TASKS ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE" ); + + end MIDDLE_TASKS; + +-- +-- LAST_TASK +-- + + procedure LAST_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + begin + + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TASK_DELETE (self)", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + 0, + RTEMS_CALLING_OVERHEAD.TASK_DELETE + ); + + TEXT_IO.PUT_LINE( "*** END OF TIME TEST 18 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end LAST_TASK; + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm18/tmtest.ads b/testsuites/ada/tmtests/tm18/tmtest.ads new file mode 100644 index 0000000000..0b919d44a4 --- /dev/null +++ b/testsuites/ada/tmtests/tm18/tmtest.ads @@ -0,0 +1,97 @@ +-- +-- TMTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 18 of the RTEMS +-- Timing 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; + +package TMTEST is + +-- +-- The following variable is set to the execution time returned +-- by the timer. +-- + + END_TIME : RTEMS.UNSIGNED32; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- TEST_INIT +-- +-- DESCRIPTION: +-- +-- This subprogram performs test initialization. +-- + + procedure TEST_INIT; + +-- +-- FIRST_TASK +-- +-- DESCRIPTION: +-- +-- This RTEMS task is the first task to execute. It starts the +-- timer and performs a TASK_DELETE on itself. +-- + + procedure FIRST_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, FIRST_TASK); + +-- +-- MIDDLE_TASKS +-- +-- DESCRIPTION: +-- +-- These RTEMS tasks perform a TASK_DELETE on themselves. +-- + + procedure MIDDLE_TASKS ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + + pragma Convention (C, MIDDLE_TASKS); +-- +-- LAST_TASK +-- +-- DESCRIPTION: +-- +-- This RTEMS task is the last task to execute. It stops the +-- timer and reports the execution time of a TASK_DELETE SELF. +-- + + procedure LAST_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, LAST_TASK); + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm19/Makefile.am b/testsuites/ada/tmtests/tm19/Makefile.am new file mode 100644 index 0000000000..c21692b9f5 --- /dev/null +++ b/testsuites/ada/tmtests/tm19/Makefile.am @@ -0,0 +1,13 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +noinst_PROGRAMS = ada_tm19 +ada_tm19_SOURCES = tm19.adb config.h tmtest.adb tmtest.ads +ada_tm19_SOURCES += ../../support/init.c + +ada_tm19$(EXEEXT): tm19.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/tmtests/tm19/config.h b/testsuites/ada/tmtests/tm19/config.h new file mode 100644 index 0000000000..a5064b6e92 --- /dev/null +++ b/testsuites/ada/tmtests/tm19/config.h @@ -0,0 +1,32 @@ +/* config.h + * + * This include file defines the Configuration Table for this test. + * + * COPYRIGHT (c) 1989-1997. + * 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_TMTEST + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER + +#define CONFIGURE_MAXIMUM_TASKS 111 +#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 +#define CONFIGURE_TICKS_PER_TIMESLICE 0 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/tmtests/tm19/tm19.adb b/testsuites/ada/tmtests/tm19/tm19.adb new file mode 100644 index 0000000000..0b232d833a --- /dev/null +++ b/testsuites/ada/tmtests/tm19/tm19.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test TM19 of the Timing 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 TMTEST; +with TEST_SUPPORT; + +procedure TM19 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, + TMTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end TM19; + diff --git a/testsuites/ada/tmtests/tm19/tmtest.adb b/testsuites/ada/tmtests/tm19/tmtest.adb new file mode 100644 index 0000000000..288a6a799d --- /dev/null +++ b/testsuites/ada/tmtests/tm19/tmtest.adb @@ -0,0 +1,287 @@ +-- +-- TMTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 19 of the RTEMS +-- Timing 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_CALLING_OVERHEAD; +with TEST_SUPPORT; +with TEXT_IO; +with TIME_TEST_SUPPORT; +with TIMER_DRIVER; +with RTEMS.SIGNAL; + +package body TMTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TIME TEST 19 ***" ); + + RTEMS.TASKS.CREATE( + RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ), + 128, + 1024, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + TMTEST.TASK_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TASK1" ); + + RTEMS.TASKS.START( + TMTEST.TASK_ID( 1 ), + TMTEST.TASK_1'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TASK1" ); + + RTEMS.TASKS.CREATE( + RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ), + 127, + 1024, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + TMTEST.TASK_ID( 2 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TASK2" ); + + RTEMS.TASKS.START( + TMTEST.TASK_ID( 2 ), + TMTEST.TASK_2'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TASK2" ); + + RTEMS.TASKS.CREATE( + RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ), + 126, + 1024, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + TMTEST.TASK_ID( 3 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TASK3" ); + + RTEMS.TASKS.START( + TMTEST.TASK_ID( 3 ), + TMTEST.TASK_3'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TASK3" ); + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- PROCESS_ASR_FOR_PASS_1 +-- + + procedure PROCESS_ASR_FOR_PASS_1 ( + SIGNALS : in RTEMS.SIGNAL_SET + ) is + pragma Unreferenced(SIGNALS); + begin + + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "SIGNAL_SEND (self)", + TMTEST.END_TIME, + 1, + 0, + RTEMS_CALLING_OVERHEAD.SIGNAL_SEND + ); + + TEXT_IO.PUT_LINE( "SIGNAL_ENTER (preemptive) na" ); + + TIMER_DRIVER.INITIALIZE; + + end PROCESS_ASR_FOR_PASS_1; + +-- +-- PROCESS_ASR_FOR_PASS_2 +-- + + procedure PROCESS_ASR_FOR_PASS_2 ( + SIGNALS : in RTEMS.SIGNAL_SET + ) is + pragma Unreferenced(SIGNALS); + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.PUT_LINE( "SIGNAL_ENTER (preemptive) na" ); + + RTEMS.TASKS.RESUME( TMTEST.TASK_ID( 3 ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_RESUME" ); + + TIMER_DRIVER.INITIALIZE; + + end PROCESS_ASR_FOR_PASS_2; + +-- +-- TASK_1 +-- + + procedure TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TIMER_DRIVER.INITIALIZE; + RTEMS.SIGNAL.CATCH( + TMTEST.PROCESS_ASR_FOR_PASS_1'ACCESS, + RTEMS.DEFAULT_MODES, + STATUS + ); + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SIGNAL_CATCH" ); + + TIME_TEST_SUPPORT.PUT_TIME( + "SIGNAL_CATCH", + TMTEST.END_TIME, + 1, + 0, + RTEMS_CALLING_OVERHEAD.SIGNAL_CATCH + ); + + TIMER_DRIVER.INITIALIZE; + RTEMS.SIGNAL.SEND( TMTEST.TASK_ID( 2 ), RTEMS.SIGNAL_1, STATUS ); + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SIGNAL_SEND" ); + + TIME_TEST_SUPPORT.PUT_TIME( + "SIGNAL_SEND (non-preemptive)", + TMTEST.END_TIME, + 1, + 0, + RTEMS_CALLING_OVERHEAD.SIGNAL_SEND + ); + + TIMER_DRIVER.INITIALIZE; + RTEMS.SIGNAL.SEND( RTEMS.SELF, RTEMS.SIGNAL_1, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SIGNAL_SEND" ); + + -- end time is done in ASR + + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "SIGNAL_RETURN (non-preemptive)", + TMTEST.END_TIME, + 1, + 0, + 0 + ); + + RTEMS.SIGNAL.CATCH( + TMTEST.PROCESS_ASR_FOR_PASS_2'ACCESS, + RTEMS.NO_PREEMPT, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SIGNAL_CATCH" ); + + TIMER_DRIVER.INITIALIZE; + RTEMS.SIGNAL.SEND( RTEMS.SELF, RTEMS.SIGNAL_1, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SIGNAL_SEND" ); + + end TASK_1; + +-- +-- PROCESS_ASR_FOR_TASK_2 +-- + + procedure PROCESS_ASR_FOR_TASK_2 ( + SIGNALS : in RTEMS.SIGNAL_SET + ) is + begin + + NULL; + + end PROCESS_ASR_FOR_TASK_2; + +-- +-- TASK_2 +-- + + procedure TASK_2 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.SIGNAL.CATCH( + TMTEST.PROCESS_ASR_FOR_TASK_2'ACCESS, + RTEMS.DEFAULT_MODES, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SIGNAL_CATCH" ); + + RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND" ); + + end TASK_2; + +-- +-- TASK_3 +-- + + procedure TASK_3 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND" ); + + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "SIGNAL_RETURN (preemptive)", + TMTEST.END_TIME, + 1, + 0, + 0 + ); + + TEXT_IO.PUT_LINE( "*** END OF TIME TEST 19 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end TASK_3; + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm19/tmtest.ads b/testsuites/ada/tmtests/tm19/tmtest.ads new file mode 100644 index 0000000000..7776b41b35 --- /dev/null +++ b/testsuites/ada/tmtests/tm19/tmtest.ads @@ -0,0 +1,147 @@ +-- +-- TMTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 19 of the RTEMS +-- Timing 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; + +package TMTEST is + +-- +-- This array contains the IDs of all RTEMS tasks created by this test. +-- + + TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; + +-- +-- The following variable is set to the execution time returned +-- by the timer. +-- + + END_TIME : RTEMS.UNSIGNED32; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- PROCESS_ASR_FOR_PASS_1 +-- +-- DESCRIPTION: +-- +-- This subprogram is the ASR used to measure and report the +-- execution time of a SIGNAL_SEND to SELF. Before it exits +-- it starts the timer so that the execution time required to +-- exit from an ASR back to the same task can be measured. +-- + + procedure PROCESS_ASR_FOR_PASS_1 ( + SIGNALS : in RTEMS.SIGNAL_SET + ); + pragma Convention (C, PROCESS_ASR_FOR_PASS_1); + +-- +-- PROCESS_ASR_FOR_PASS_2 +-- +-- DESCRIPTION: +-- +-- This subprogram is the ASR which sets up for a preemptive +-- return from an ASR. Before it exits it starts the timer +-- so that the execution time required to exit from an ASR +-- and transfer control to the another task can be measured. +-- + + procedure PROCESS_ASR_FOR_PASS_2 ( + SIGNALS : in RTEMS.SIGNAL_SET + ); + pragma Convention (C, PROCESS_ASR_FOR_PASS_2); + +-- +-- TASK_1 +-- +-- DESCRIPTION: +-- +-- This RTEMS task is responsible for measuring and reporting +-- the following execution times: +-- +-- + SIGNAL_CATCH +-- + non-preemptive SIGNAL_SEND +-- + non-preemptive return from an ASR +-- + + procedure TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_1); + +-- +-- PROCESS_ASR_FOR_TASK_2 +-- +-- DESCRIPTION: +-- +-- This subprogram is the ASR for TASK_2. It performs no actions. +-- + + procedure PROCESS_ASR_FOR_TASK_2 ( + SIGNALS : in RTEMS.SIGNAL_SET + ); + pragma Convention (C, PROCESS_ASR_FOR_TASK_2); + +-- +-- TASK_2 +-- +-- DESCRIPTION: +-- +-- This RTEMS task is used as the recipient of a SIGNAL_SEND. +-- After establishing an ASR, it suspends itself to insure +-- that it does not execute again. +-- + + procedure TASK_2 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_2); + +-- +-- TASK_3 +-- +-- DESCRIPTION: +-- +-- This RTEMS task is used as the recipient of a preemptive +-- SIGNAL_SEND. This task suspends itself and is resumed by +-- an ASR for TASK_1. Once the task executes, it stops the +-- timer and reports the execution time for a preemptive +-- return from an ASR. +-- + + procedure TASK_3 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_3); + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm20/Makefile.am b/testsuites/ada/tmtests/tm20/Makefile.am new file mode 100644 index 0000000000..d4ca51dca4 --- /dev/null +++ b/testsuites/ada/tmtests/tm20/Makefile.am @@ -0,0 +1,13 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +noinst_PROGRAMS = ada_tm20 +ada_tm20_SOURCES = tm20.adb config.h tmtest.adb tmtest.ads +ada_tm20_SOURCES += ../../support/init.c + +ada_tm20$(EXEEXT): tm20.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/tmtests/tm20/config.h b/testsuites/ada/tmtests/tm20/config.h new file mode 100644 index 0000000000..30b26944d9 --- /dev/null +++ b/testsuites/ada/tmtests/tm20/config.h @@ -0,0 +1,33 @@ +/* config.h + * + * This include file defines the Configuration Table for this test. + * + * COPYRIGHT (c) 1989-1997. + * 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_TMTEST + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER + +#define CONFIGURE_MAXIMUM_PARTITIONS 1 +#define CONFIGURE_MAXIMUM_REGIONS 1 +#define CONFIGURE_MAXIMUM_TASKS 3 +#define CONFIGURE_TICKS_PER_TIMESLICE 0 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/tmtests/tm20/tm20.adb b/testsuites/ada/tmtests/tm20/tm20.adb new file mode 100644 index 0000000000..47ef899495 --- /dev/null +++ b/testsuites/ada/tmtests/tm20/tm20.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test TM20 of the Timing 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 TMTEST; +with TEST_SUPPORT; + +procedure TM20 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, + TMTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end TM20; + diff --git a/testsuites/ada/tmtests/tm20/tmtest.adb b/testsuites/ada/tmtests/tm20/tmtest.adb new file mode 100644 index 0000000000..4a997f3ff4 --- /dev/null +++ b/testsuites/ada/tmtests/tm20/tmtest.adb @@ -0,0 +1,455 @@ +-- +-- TMTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 20 of the RTEMS +-- Timing 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 INTERFACES; use INTERFACES; +with RTEMS_CALLING_OVERHEAD; +with TEST_SUPPORT; +with TEXT_IO; +with TIMER_DRIVER; +with RTEMS.PARTITION; +with RTEMS.REGION; + +package body TMTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TIME TEST 20 ***" ); + + RTEMS.TASKS.CREATE( + RTEMS.BUILD_NAME( 'T', 'I', 'M', '1' ), + 128, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + TMTEST.TASK_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TASK1" ); + + RTEMS.TASKS.START( + TMTEST.TASK_ID( 1 ), + TMTEST.TASK_1'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TASK1" ); + + RTEMS.TASKS.CREATE( + RTEMS.BUILD_NAME( 'T', 'I', 'M', '2' ), + 129, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + TMTEST.TASK_ID( 2 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TASK2" ); + + RTEMS.TASKS.START( + TMTEST.TASK_ID( 2 ), + TMTEST.TASK_2'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TASK2" ); + + 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); + BUFFER_COUNT : RTEMS.UNSIGNED32; + PREVIOUS_MODE : RTEMS.MODE; + PREVIOUS_PRIORITY : RTEMS.TASKS.PRIORITY; + STATUS : RTEMS.STATUS_CODES; + begin + + TMTEST.PARTITION_NAME := RTEMS.BUILD_NAME( 'P', 'A', 'R', 'T' ); + + TIMER_DRIVER.INITIALIZE; + + RTEMS.PARTITION.CREATE( + TMTEST.PARTITION_NAME, + TMTEST.PARTITION_AREA'ADDRESS, + 2048, + 128, + RTEMS.DEFAULT_ATTRIBUTES, + TMTEST.PARTITION_ID, + STATUS + ); + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "PARTITION_CREATE", + TMTEST.END_TIME, + 1, + 0, + RTEMS_CALLING_OVERHEAD.PARTITION_CREATE + ); + + TMTEST.REGION_NAME := RTEMS.BUILD_NAME( 'R', 'E', 'G', 'N' ); + + TIMER_DRIVER.INITIALIZE; + + RTEMS.REGION.CREATE( + TMTEST.REGION_NAME, + TMTEST.REGION_AREA'ADDRESS, + 2048, + 16, + RTEMS.DEFAULT_ATTRIBUTES, + TMTEST.REGION_ID, + STATUS + ); + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "REGION_CREATE", + TMTEST.END_TIME, + 1, + 0, + RTEMS_CALLING_OVERHEAD.REGION_CREATE + ); + + TIMER_DRIVER.INITIALIZE; + RTEMS.PARTITION.GET_BUFFER( + TMTEST.PARTITION_ID, + TMTEST.BUFFER_ADDRESS_1, + STATUS + ); + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "PARTITION_GET_BUFFER (available)", + TMTEST.END_TIME, + 1, + 0, + RTEMS_CALLING_OVERHEAD.PARTITION_GET_BUFFER + ); + + BUFFER_COUNT := 0; + loop + + RTEMS.PARTITION.GET_BUFFER( + TMTEST.PARTITION_ID, + TMTEST.BUFFER_ADDRESSES( BUFFER_COUNT ), + STATUS + ); + + exit when RTEMS.ARE_STATUSES_EQUAL( STATUS, RTEMS.UNSATISFIED ); + + BUFFER_COUNT := BUFFER_COUNT + 1; + + end loop; + + TIMER_DRIVER.INITIALIZE; + RTEMS.PARTITION.GET_BUFFER( + TMTEST.PARTITION_ID, + TMTEST.BUFFER_ADDRESS_2, + STATUS + ); + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "PARTITION_GET_BUFFER (not available)", + TMTEST.END_TIME, + 1, + 0, + RTEMS_CALLING_OVERHEAD.PARTITION_GET_BUFFER + ); + + TIMER_DRIVER.INITIALIZE; + RTEMS.PARTITION.RETURN_BUFFER( + TMTEST.PARTITION_ID, + TMTEST.BUFFER_ADDRESS_1, + STATUS + ); + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "PARTITION_RETURN_BUFFER", + TMTEST.END_TIME, + 1, + 0, + RTEMS_CALLING_OVERHEAD.PARTITION_RETURN_BUFFER + ); + + for INDEX in 0 .. BUFFER_COUNT - 1 + loop + + RTEMS.PARTITION.RETURN_BUFFER( + TMTEST.PARTITION_ID, + TMTEST.BUFFER_ADDRESSES( INDEX ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_RETURN_BUFFER" ); + + end loop; + + TIMER_DRIVER.INITIALIZE; + RTEMS.PARTITION.DELETE( TMTEST.PARTITION_ID, STATUS ); + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "PARTITION_DELETE", + TMTEST.END_TIME, + 1, + 0, + RTEMS_CALLING_OVERHEAD.PARTITION_DELETE + ); + + RTEMS.REGION.GET_SEGMENT( + TMTEST.REGION_ID, + 400, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + TMTEST.BUFFER_ADDRESS_2, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); + + TIMER_DRIVER.INITIALIZE; + RTEMS.REGION.GET_SEGMENT( + TMTEST.REGION_ID, + 400, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + TMTEST.BUFFER_ADDRESS_3, + STATUS + ); + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "REGION_GET_SEGMENT (available)", + TMTEST.END_TIME, + 1, + 0, + RTEMS_CALLING_OVERHEAD.REGION_GET_SEGMENT + ); + + TIMER_DRIVER.INITIALIZE; + RTEMS.REGION.GET_SEGMENT( + TMTEST.REGION_ID, + 1998, + RTEMS.NO_WAIT, + RTEMS.NO_TIMEOUT, + TMTEST.BUFFER_ADDRESS_4, + STATUS + ); + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "REGION_GET_SEGMENT (NO_WAIT)", + TMTEST.END_TIME, + 1, + 0, + RTEMS_CALLING_OVERHEAD.REGION_GET_SEGMENT + ); + + RTEMS.REGION.RETURN_SEGMENT( + TMTEST.REGION_ID, + TMTEST.BUFFER_ADDRESS_3, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" ); + + TIMER_DRIVER.INITIALIZE; + RTEMS.REGION.RETURN_SEGMENT( + TMTEST.REGION_ID, + TMTEST.BUFFER_ADDRESS_2, + STATUS + ); + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "REGION_RETURN_SEGMENT (no tasks waiting)", + TMTEST.END_TIME, + 1, + 0, + RTEMS_CALLING_OVERHEAD.REGION_RETURN_SEGMENT + ); + + RTEMS.REGION.GET_SEGMENT( + TMTEST.REGION_ID, + 400, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + TMTEST.BUFFER_ADDRESS_1, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); + + TIMER_DRIVER.INITIALIZE; + RTEMS.REGION.GET_SEGMENT( + TMTEST.REGION_ID, + 1998, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + TMTEST.BUFFER_ADDRESS_2, + STATUS + ); + + -- execute TASK_2 + + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "REGION_RETURN_SEGMENT (preempt)", + TMTEST.END_TIME, + 1, + 0, + RTEMS_CALLING_OVERHEAD.REGION_RETURN_SEGMENT + ); + + RTEMS.REGION.RETURN_SEGMENT( + TMTEST.REGION_ID, + TMTEST.BUFFER_ADDRESS_2, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" ); + + RTEMS.TASKS.MODE( + RTEMS.NO_PREEMPT, + RTEMS.PREEMPT_MASK, + PREVIOUS_MODE, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_MODE" ); + + RTEMS.TASKS.SET_PRIORITY( RTEMS.SELF, 254, PREVIOUS_PRIORITY, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SET_PRIORITY" ); + + RTEMS.REGION.GET_SEGMENT( + TMTEST.REGION_ID, + 400, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + TMTEST.BUFFER_ADDRESS_1, + STATUS + ); + + RTEMS.REGION.GET_SEGMENT( + TMTEST.REGION_ID, + 1998, + RTEMS.DEFAULT_OPTIONS, + RTEMS.NO_TIMEOUT, + TMTEST.BUFFER_ADDRESS_2, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_GET_SEGMENT" ); + + -- execute TASK_2 + + RTEMS.REGION.RETURN_SEGMENT( + TMTEST.REGION_ID, + TMTEST.BUFFER_ADDRESS_2, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" ); + + TIMER_DRIVER.INITIALIZE; + RTEMS.REGION.DELETE( TMTEST.REGION_ID, STATUS ); + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_DELETE" ); + + TIME_TEST_SUPPORT.PUT_TIME( + "REGION_DELETE", + TMTEST.END_TIME, + 1, + 0, + RTEMS_CALLING_OVERHEAD.REGION_DELETE + ); + + TEXT_IO.PUT_LINE( "*** END OF TIME TEST 20 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end TASK_1; + +-- +-- TASK_2 +-- + + procedure TASK_2 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "REGION_GET_SEGMENT (blocking)", + TMTEST.END_TIME, + 1, + 0, + RTEMS_CALLING_OVERHEAD.REGION_GET_SEGMENT + ); + + TIMER_DRIVER.INITIALIZE; + RTEMS.REGION.RETURN_SEGMENT( + TMTEST.REGION_ID, + TMTEST.BUFFER_ADDRESS_1, + STATUS + ); + + -- preempt back to TASK_1 + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" ); + + TIMER_DRIVER.INITIALIZE; + RTEMS.REGION.RETURN_SEGMENT( + TMTEST.REGION_ID, + TMTEST.BUFFER_ADDRESS_1, + STATUS + ); + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_RETURN_SEGMENT" ); + + TIME_TEST_SUPPORT.PUT_TIME( + "REGION_RETURN_SEGMENT (ready -- return)", + TMTEST.END_TIME, + 1, + 0, + RTEMS_CALLING_OVERHEAD.REGION_RETURN_SEGMENT + ); + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end TASK_2; + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm20/tmtest.ads b/testsuites/ada/tmtests/tm20/tmtest.ads new file mode 100644 index 0000000000..8afc25ac2c --- /dev/null +++ b/testsuites/ada/tmtests/tm20/tmtest.ads @@ -0,0 +1,151 @@ +-- +-- TMTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 20 of the RTEMS +-- Timing 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 TIME_TEST_SUPPORT; +with RTEMS; +with RTEMS.TASKS; + +package TMTEST is + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS tasks created +-- by this test. +-- + + TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; + TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; + +-- +-- These following are the ID and NAME of the RTEMS partition created +-- by this test. +-- + + PARTITION_ID : RTEMS.ID; + PARTITION_NAME : RTEMS.NAME; + +-- +-- These following are the ID and NAME of the RTEMS region created +-- by this test. +-- + + REGION_ID : RTEMS.ID; + REGION_NAME : RTEMS.NAME; + +-- +-- The following area defines a memory area to be used as the +-- memory space for a partition. +-- + + PARTITION_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 2047 ) + of RTEMS.UNSIGNED8; + for PARTITION_AREA'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT; + +-- +-- The following area defines a memory area to be used as the +-- memory space for a region. +-- + + REGION_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 2047 ) + of RTEMS.UNSIGNED8; + + for REGION_AREA'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT; + +-- +-- The following are the buffers allocated from the region. +-- + + BUFFER_ADDRESS_1 : RTEMS.ADDRESS; + BUFFER_ADDRESS_2 : RTEMS.ADDRESS; + BUFFER_ADDRESS_3 : RTEMS.ADDRESS; + BUFFER_ADDRESS_4 : RTEMS.ADDRESS; + + BUFFER_ADDRESSES : array ( RTEMS.UNSIGNED32 + range 0 .. TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.ADDRESS; + +-- +-- The following variable is set to the execution time returned +-- by the timer. +-- + + END_TIME : RTEMS.UNSIGNED32; + +-- +-- 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 is responsible for measuring and reporting +-- the following execution times: +-- +-- + PARTITION_CREATE +-- + REGION_CREATE +-- + PARTITION_GET_BUFFER with a buffer available +-- + PARTITION_GET_BUFFER with no buffers available +-- + PARTITION_RETURN_BUFFER +-- + PARTITION_DELETE +-- + REGION_GET_SEGMENT with a segment available +-- + REGION_GET_SEGMENT with the NO_WAIT option +-- + REGION_RETURN_SEGMENT with no tasks waiting for memory +-- + REGION_RETURN_SEGMENT preemptive +-- + REGION_DELETE +-- + IO_INITIALIZE +-- + IO_OPEN +-- + IO_CLOSE +-- + IO_READ +-- + IO_WRITE +-- + IO_CONTROL +-- + + procedure TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_1); + +-- +-- TASK_2 +-- +-- DESCRIPTION: +-- +-- This RTEMS task is responsible for measuring and reporting +-- the following execution times: +-- +-- + blocking REGION_GET_SEGMENT +-- + REGION_RETURN_SEGMENT which readies a task +-- + + procedure TASK_2 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_2); + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm21/Makefile.am b/testsuites/ada/tmtests/tm21/Makefile.am new file mode 100644 index 0000000000..37f4c6b9b5 --- /dev/null +++ b/testsuites/ada/tmtests/tm21/Makefile.am @@ -0,0 +1,13 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +noinst_PROGRAMS = ada_tm21 +ada_tm21_SOURCES = tm21.adb config.h tmtest.adb tmtest.ads +ada_tm21_SOURCES += ../../support/init.c + +ada_tm21$(EXEEXT): tm21.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/tmtests/tm21/config.h b/testsuites/ada/tmtests/tm21/config.h new file mode 100644 index 0000000000..d4b8bc5054 --- /dev/null +++ b/testsuites/ada/tmtests/tm21/config.h @@ -0,0 +1,38 @@ +/* config.h + * + * This include file defines the Configuration Table for this test. + * + * COPYRIGHT (c) 1989-1997. + * 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_TMTEST + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER + +#define CONFIGURE_MAXIMUM_TASKS 102 +#define CONFIGURE_MAXIMUM_TIMERS 100 +#define CONFIGURE_MAXIMUM_SEMAPHORES 100 +#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 100 +#define CONFIGURE_MAXIMUM_PARTITIONS 100 +#define CONFIGURE_MAXIMUM_REGIONS 100 +#define CONFIGURE_MAXIMUM_PORTS 100 +#define CONFIGURE_MAXIMUM_PERIODS 100 +#define CONFIGURE_TICKS_PER_TIMESLICE 0 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/tmtests/tm21/tm21.adb b/testsuites/ada/tmtests/tm21/tm21.adb new file mode 100644 index 0000000000..45381ece6c --- /dev/null +++ b/testsuites/ada/tmtests/tm21/tm21.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test TM21 of the Timing 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 TMTEST; +with TEST_SUPPORT; + +procedure TM21 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, + TMTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end TM21; + diff --git a/testsuites/ada/tmtests/tm21/tmtest.adb b/testsuites/ada/tmtests/tm21/tmtest.adb new file mode 100644 index 0000000000..245376953d --- /dev/null +++ b/testsuites/ada/tmtests/tm21/tmtest.adb @@ -0,0 +1,304 @@ +-- +-- TMTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 21 of the RTEMS +-- Timing 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_CALLING_OVERHEAD; +with TEST_SUPPORT; +with TEXT_IO; +with TIME_TEST_SUPPORT; +with TIMER_DRIVER; +with RTEMS.MESSAGE_QUEUE; +with RTEMS.PARTITION; +with RTEMS.PORT; +with RTEMS.RATE_MONOTONIC; +with RTEMS.REGION; +with RTEMS.SEMAPHORE; +with RTEMS.TIMER; + +package body TMTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + ID : RTEMS.ID; + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TIME TEST 21 ***" ); + + RTEMS.TASKS.CREATE( + RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ), + 250, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE TASK_1" ); + + RTEMS.TASKS.START( ID, TMTEST.TASK_1'ACCESS, 0, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START TASK1" ); + + 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); + ID : RTEMS.ID; + OVERHEAD : RTEMS.UNSIGNED32; + STATUS : RTEMS.STATUS_CODES; + begin + + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + + RTEMS.TASKS.CREATE( + INDEX, + 254, + 1024, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); + + RTEMS.MESSAGE_QUEUE.CREATE( + INDEX, + TIME_TEST_SUPPORT.OPERATION_COUNT, + 16, + RTEMS.DEFAULT_ATTRIBUTES, + ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_CREATE" ); + + RTEMS.SEMAPHORE.CREATE( + INDEX, + TIME_TEST_SUPPORT.OPERATION_COUNT, + RTEMS.DEFAULT_ATTRIBUTES, + RTEMS.TASKS.NO_PRIORITY, + ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE" ); + + RTEMS.REGION.CREATE( + INDEX, + TMTEST.REGION_AREA'ADDRESS, + 2048, + 16, + RTEMS.DEFAULT_ATTRIBUTES, + ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "REGION_CREATE" ); + + RTEMS.PARTITION.CREATE( + INDEX, + TMTEST.PARTITION_AREA'ADDRESS, + 2048, + 128, + RTEMS.DEFAULT_ATTRIBUTES, + ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PARTITION_CREATE" ); + + RTEMS.PORT.CREATE( + INDEX, + TMTEST.INTERNAL_PORT_AREA'ADDRESS, + TMTEST.EXTERNAL_PORT_AREA'ADDRESS, + 16#FF#, + ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "PORT_CREATE" ); + + RTEMS.TIMER.CREATE( INDEX, ID, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE" ); + + RTEMS.RATE_MONOTONIC.CREATE( INDEX, ID, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "RATE_MONOTONIC_CREATE" ); + + end loop; + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + TIMER_DRIVER.EMPTY_FUNCTION; + end loop; + OVERHEAD := TIMER_DRIVER.READ_TIMER; + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.TASKS.IDENT( INDEX, RTEMS.SEARCH_ALL_NODES, ID, STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TASK_IDENT", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + RTEMS_CALLING_OVERHEAD.TASK_IDENT + ); + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.MESSAGE_QUEUE.IDENT( + INDEX, + RTEMS.SEARCH_ALL_NODES, + ID, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "MESSAGE_QUEUE_IDENT", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_IDENT + ); + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.SEMAPHORE.IDENT( + INDEX, + RTEMS.SEARCH_ALL_NODES, + ID, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "SEMAPHORE_IDENT", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + RTEMS_CALLING_OVERHEAD.SEMAPHORE_IDENT + ); + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.PARTITION.IDENT( + INDEX, + RTEMS.SEARCH_ALL_NODES, + ID, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "PARTITION_IDENT", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + RTEMS_CALLING_OVERHEAD.PARTITION_IDENT + ); + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.REGION.IDENT( INDEX, ID, STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "REGION_IDENT", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + RTEMS_CALLING_OVERHEAD.REGION_IDENT + ); + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.PORT.IDENT( INDEX, ID, STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "PORT_IDENT", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + RTEMS_CALLING_OVERHEAD.PORT_IDENT + ); + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.TIMER.IDENT( INDEX, ID, STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TIMER_IDENT", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + RTEMS_CALLING_OVERHEAD.TIMER_IDENT + ); + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.RATE_MONOTONIC.IDENT( INDEX, ID, STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "RATE_MONOTONIC_IDENT", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + RTEMS_CALLING_OVERHEAD.RATE_MONOTONIC_IDENT + ); + + TEXT_IO.PUT_LINE( "*** END OF TIME TEST 21 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end TASK_1; + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm21/tmtest.ads b/testsuites/ada/tmtests/tm21/tmtest.ads new file mode 100644 index 0000000000..538ffad4d0 --- /dev/null +++ b/testsuites/ada/tmtests/tm21/tmtest.ads @@ -0,0 +1,121 @@ +-- +-- TMTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 21 of the RTEMS +-- Timing 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 TMTEST is + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS tasks created +-- by this test. +-- + + TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; + TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; + +-- +-- The following variable is set to the execution time returned +-- by the timer. +-- + + END_TIME : RTEMS.UNSIGNED32; + +-- +-- 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 as the +-- memory space for a partition. +-- + + PARTITION_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 2047 ) + of RTEMS.UNSIGNED8; + for PARTITION_AREA'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT; + +-- +-- These following are the ID and NAME of the RTEMS region created +-- by this test. +-- + + REGION_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 2047 ) + of RTEMS.UNSIGNED8; + for REGION_AREA'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT; + +-- +-- 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 is responsible for measuring and reporting the +-- following directive execution times: +-- +-- + TASK_IDENT +-- + MESSAGE_QUEUE_IDENT +-- + SEMAPHORE_IDENT +-- + PARTITION_IDENT +-- + REGION_IDENT +-- + PORT_IDENT +-- + TIMER_IDENT +-- + RATE_MONOTONIC_IDENT +-- + + procedure TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_1); + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm22/Makefile.am b/testsuites/ada/tmtests/tm22/Makefile.am new file mode 100644 index 0000000000..a477b99cd7 --- /dev/null +++ b/testsuites/ada/tmtests/tm22/Makefile.am @@ -0,0 +1,13 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +noinst_PROGRAMS = ada_tm22 +ada_tm22_SOURCES = tm22.adb config.h tmtest.adb tmtest.ads +ada_tm22_SOURCES += ../../support/init.c + +ada_tm22$(EXEEXT): tm22.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/tmtests/tm22/config.h b/testsuites/ada/tmtests/tm22/config.h new file mode 100644 index 0000000000..c1585c7ef4 --- /dev/null +++ b/testsuites/ada/tmtests/tm22/config.h @@ -0,0 +1,32 @@ +/* config.h + * + * This include file defines the Configuration Table for this test. + * + * COPYRIGHT (c) 1989-1997. + * 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_TMTEST + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER + +#define CONFIGURE_MAXIMUM_TASKS 103 +#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 +#define CONFIGURE_TICKS_PER_TIMESLICE 0 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/tmtests/tm22/tm22.adb b/testsuites/ada/tmtests/tm22/tm22.adb new file mode 100644 index 0000000000..ce755dd517 --- /dev/null +++ b/testsuites/ada/tmtests/tm22/tm22.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test TM22 of the Timing 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 TMTEST; +with TEST_SUPPORT; + +procedure TM22 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, + TMTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end TM22; + diff --git a/testsuites/ada/tmtests/tm22/tmtest.adb b/testsuites/ada/tmtests/tm22/tmtest.adb new file mode 100644 index 0000000000..ea1afc84c9 --- /dev/null +++ b/testsuites/ada/tmtests/tm22/tmtest.adb @@ -0,0 +1,252 @@ +-- +-- TMTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 22 of the RTEMS +-- Timing 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_CALLING_OVERHEAD; +with TEST_SUPPORT; +with TEXT_IO; +with TIME_TEST_SUPPORT; +with TIMER_DRIVER; +with RTEMS.MESSAGE_QUEUE; + +package body TMTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + ID : RTEMS.ID; + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TIME TEST 22 ***" ); + + RTEMS.MESSAGE_QUEUE.CREATE( + RTEMS.BUILD_NAME( 'M', 'Q', '1', ' ' ), + 100, + 16, + RTEMS.DEFAULT_ATTRIBUTES, + TMTEST.MESSAGE_QUEUE_ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "MESSAGE_QUEUE_CREATE" ); + + RTEMS.TASKS.CREATE( + RTEMS.BUILD_NAME( 'L', 'O', 'W', ' ' ), + 10, + 2048, + RTEMS.NO_PREEMPT, + RTEMS.DEFAULT_ATTRIBUTES, + ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOW" ); + + RTEMS.TASKS.START( ID, TMTEST.LOW_TASK'ACCESS, 0, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOW" ); + + RTEMS.TASKS.CREATE( + RTEMS.BUILD_NAME( 'P', 'R', 'M', 'T' ), + 11, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE PREEMPT" ); + + RTEMS.TASKS.START( ID, TMTEST.PREEMPT_TASK'ACCESS, 0, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START PREEMPT" ); + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- HIGH_TASK +-- + + procedure HIGH_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + BUFFER : TMTEST.BUFFER; + BUFFER_POINTER : RTEMS.ADDRESS; + COUNT : RTEMS.UNSIGNED32; + STATUS : RTEMS.STATUS_CODES; + begin + + BUFFER_POINTER := BUFFER'ADDRESS; + + TIMER_DRIVER.INITIALIZE; + RTEMS.MESSAGE_QUEUE.BROADCAST( + TMTEST.MESSAGE_QUEUE_ID, + BUFFER_POINTER, + 16, + COUNT, + STATUS + ); + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "MESSAGE_QUEUE_BROADCAST (readying)", + TMTEST.END_TIME, + 1, + 0, + RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_BROADCAST + ); + + RTEMS.TASKS.SUSPEND( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_SUSPEND" ); + + end HIGH_TASK; + +-- +-- LOW_TASK +-- + + procedure LOW_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + ID : RTEMS.ID; + BUFFER : TMTEST.BUFFER; + BUFFER_POINTER : RTEMS.ADDRESS; + OVERHEAD : RTEMS.UNSIGNED32; + COUNT : RTEMS.UNSIGNED32; + MESSAGE_SIZE : RTEMS.UNSIGNED32 := 0; + STATUS : RTEMS.STATUS_CODES; + begin + + BUFFER_POINTER := BUFFER'ADDRESS; + + RTEMS.TASKS.CREATE( + RTEMS.BUILD_NAME( 'H', 'I', 'G', 'H' ), + 5, + 2048, + RTEMS.NO_PREEMPT, + RTEMS.DEFAULT_ATTRIBUTES, + ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE HIGH" ); + + RTEMS.TASKS.START( ID, TMTEST.HIGH_TASK'ACCESS, 0, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START HIGH" ); + + RTEMS.MESSAGE_QUEUE.RECEIVE( + TMTEST.MESSAGE_QUEUE_ID, + BUFFER_POINTER, + RTEMS.DEFAULT_MODES, + RTEMS.NO_TIMEOUT, + MESSAGE_SIZE, + STATUS + ); + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + TIMER_DRIVER.EMPTY_FUNCTION; + end loop; + OVERHEAD := TIMER_DRIVER.READ_TIMER; + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.MESSAGE_QUEUE.BROADCAST( + TMTEST.MESSAGE_QUEUE_ID, + BUFFER_POINTER, + 16, + COUNT, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "MESSAGE_QUEUE_BROADCAST (no waiting tasks)", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_BROADCAST + ); + + RTEMS.MESSAGE_QUEUE.RECEIVE( + TMTEST.MESSAGE_QUEUE_ID, + BUFFER_POINTER, + RTEMS.DEFAULT_MODES, + RTEMS.NO_TIMEOUT, + MESSAGE_SIZE, + STATUS + ); + + -- should go to PREEMPT_TASK here + + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "MESSAGE_QUEUE_BROADCAST (preempt)", + TMTEST.END_TIME, + 1, + 0, + RTEMS_CALLING_OVERHEAD.MESSAGE_QUEUE_BROADCAST + ); + + TEXT_IO.PUT_LINE( "*** END OF TIME TEST 22 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end LOW_TASK; + +-- +-- LOW_TASK +-- + + procedure PREEMPT_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + BUFFER : TMTEST.BUFFER; + BUFFER_POINTER : RTEMS.ADDRESS; + COUNT : RTEMS.UNSIGNED32; + STATUS : RTEMS.STATUS_CODES; + begin + + BUFFER_POINTER := BUFFER'ADDRESS; + + TIMER_DRIVER.INITIALIZE; + RTEMS.MESSAGE_QUEUE.BROADCAST( + TMTEST.MESSAGE_QUEUE_ID, + BUFFER_POINTER, + 16, + COUNT, + STATUS + ); + + -- should be preempted by LOW_TASK + + end PREEMPT_TASK; + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm22/tmtest.ads b/testsuites/ada/tmtests/tm22/tmtest.ads new file mode 100644 index 0000000000..f5dce6c3a0 --- /dev/null +++ b/testsuites/ada/tmtests/tm22/tmtest.ads @@ -0,0 +1,120 @@ +-- +-- TMTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 22 of the RTEMS +-- Timing 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; + +package TMTEST is + +-- +-- Buffer Record similar to that used by RTEMS 3.2.1. Using this +-- avoids changes to the test. +-- + + type BUFFER is + record + FIELD1 : RTEMS.UNSIGNED32; -- TEMPORARY UNTIL VARIABLE LENGTH + FIELD2 : RTEMS.UNSIGNED32; + FIELD3 : RTEMS.UNSIGNED32; + FIELD4 : RTEMS.UNSIGNED32; + end record; + +-- +-- The following is the ID of the message queue used for timing operations. +-- + + MESSAGE_QUEUE_ID : RTEMS.ID; + +-- +-- The following variable is set to the execution time returned +-- by the timer. +-- + + END_TIME : RTEMS.UNSIGNED32; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- HIGH_TASK +-- +-- DESCRIPTION: +-- +-- This RTEMS task is created by LOW_TASK and executes after +-- LOW_TASK has performed a blocking MESSAGE_QUEUE_RECEIVE. +-- This task then executes and performs a readying +-- MESSAGE_QUEUE_BROADCAST and reports its execution time. +-- Finally, the task suspends itself so LOW_TASK can continue +-- execution. +-- + + procedure HIGH_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, HIGH_TASK); + +-- +-- LOW_TASK +-- +-- DESCRIPTION: +-- +-- This RTEMS task performs a blocking MESSAGE_QUEUE_RECEIVE +-- so that when HIGH_TASK performs a MESSAGE_QUEUE_BROADCAST, +-- there will be a task to be readied. Following this, the +-- execution time for a MESSAGE_QUEUE_BROADCAST to a message +-- queue with no waiting tasks is measured and reported. +-- Then this task performs another blocking MESSAGE_QUEUE_RECEIVE +-- so that when PREEMPT_TASK performs a MESSAGE_QUEUE_BROADCAST, +-- PREEMPT_TASK will be preempted by this task. After control +-- of the processor is transferred back to this task by the +-- preemption, the timer is stopped and the execution time of +-- a preemptive MESSAGE_QUEUE_BROADCAST is reported. +-- + + procedure LOW_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, LOW_TASK); + +-- +-- PREEMPT_TASK +-- +-- DESCRIPTION: +-- +-- This RTEMS task starts the timer and performs a preemptive +-- MESSAGE_QUEUE_BROADCAST. +-- + + procedure PREEMPT_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, PREEMPT_TASK); + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm23/Makefile.am b/testsuites/ada/tmtests/tm23/Makefile.am new file mode 100644 index 0000000000..6ee7aa44b9 --- /dev/null +++ b/testsuites/ada/tmtests/tm23/Makefile.am @@ -0,0 +1,13 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +noinst_PROGRAMS = ada_tm23 +ada_tm23_SOURCES = tm23.adb config.h tmtest.adb tmtest.ads +ada_tm23_SOURCES += ../../support/init.c + +ada_tm23$(EXEEXT): tm23.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/tmtests/tm23/config.h b/testsuites/ada/tmtests/tm23/config.h new file mode 100644 index 0000000000..15e3e1ccf6 --- /dev/null +++ b/testsuites/ada/tmtests/tm23/config.h @@ -0,0 +1,32 @@ +/* config.h + * + * This include file defines the Configuration Table for this test. + * + * COPYRIGHT (c) 1989-1997. + * 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_TMTEST + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER + +#define CONFIGURE_MAXIMUM_TASKS 111 +#define CONFIGURE_MAXIMUM_TIMERS 110 +#define CONFIGURE_TICKS_PER_TIMESLICE 0 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/tmtests/tm23/tm23.adb b/testsuites/ada/tmtests/tm23/tm23.adb new file mode 100644 index 0000000000..5e345c958a --- /dev/null +++ b/testsuites/ada/tmtests/tm23/tm23.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test TM23 of the Timing 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 TMTEST; +with TEST_SUPPORT; + +procedure TM23 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, + TMTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end TM23; + diff --git a/testsuites/ada/tmtests/tm23/tmtest.adb b/testsuites/ada/tmtests/tm23/tmtest.adb new file mode 100644 index 0000000000..4b5a26f777 --- /dev/null +++ b/testsuites/ada/tmtests/tm23/tmtest.adb @@ -0,0 +1,388 @@ +-- +-- TMTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 23 of the RTEMS +-- Timing 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 INTERFACES; use INTERFACES; +with RTEMS_CALLING_OVERHEAD; +with TEST_SUPPORT; +with TEXT_IO; +with TIMER_DRIVER; +with RTEMS.CLOCK; +with RTEMS.TIMER; + +package body TMTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + TASK_PRIORITY : RTEMS.TASKS.PRIORITY; + ID : RTEMS.ID; + TASK_ENTRY : RTEMS.TASKS.ENTRY_POINT; + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TIME TEST 23 ***" ); + + TASK_PRIORITY := 5; + + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + + RTEMS.TASKS.CREATE( + RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ), + TASK_PRIORITY, + 1024, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); + + if INDEX = 1 then + TASK_ENTRY := TMTEST.HIGH_TASK'ACCESS; + elsif INDEX = TIME_TEST_SUPPORT.OPERATION_COUNT then + TASK_ENTRY := TMTEST.LOW_TASK'ACCESS; + else + TASK_ENTRY := TMTEST.MIDDLE_TASKS'ACCESS; + end if; + + RTEMS.TASKS.START( ID, TASK_ENTRY, 0, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); + + TASK_PRIORITY := TASK_PRIORITY + 1; + + end loop; + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- NULL_DELAY +-- + + procedure NULL_DELAY ( + IGNORED_ID : in RTEMS.ID; + IGNORED_ADDRESS : in RTEMS.ADDRESS + ) is + begin + + NULL; + + end NULL_DELAY; + +-- +-- HIGH_TASK +-- + + procedure HIGH_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + OVERHEAD : RTEMS.UNSIGNED32; + STATUS : RTEMS.STATUS_CODES; + begin + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + TIMER_DRIVER.EMPTY_FUNCTION; + end loop; + OVERHEAD := TIMER_DRIVER.READ_TIMER; + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.TIMER.CREATE( + INDEX, + TMTEST.TIMER_ID( INDEX ), + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TIMER_CREATE", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + 0, + RTEMS_CALLING_OVERHEAD.TIMER_CREATE + ); + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.TIMER.FIRE_AFTER( + TMTEST.TIMER_ID( INDEX ), + 500, + TMTEST.NULL_DELAY'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TIMER_FIRE_AFTER (inactive)", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + RTEMS_CALLING_OVERHEAD.TIMER_FIRE_AFTER + ); + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.TIMER.FIRE_AFTER( + TMTEST.TIMER_ID( INDEX ), + 500, + TMTEST.NULL_DELAY'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TIMER_FIRE_AFTER (active)", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + 0, + RTEMS_CALLING_OVERHEAD.TIMER_FIRE_AFTER + ); + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.TIMER.CANCEL( TMTEST.TIMER_ID( INDEX ), STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TIMER_CANCEL (active)", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + 0, + RTEMS_CALLING_OVERHEAD.TIMER_CANCEL + ); + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.TIMER.CANCEL( TMTEST.TIMER_ID( INDEX ), STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TIMER_CANCEL (inactive)", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + 0, + RTEMS_CALLING_OVERHEAD.TIMER_CANCEL + ); + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.TIMER.RESET( TMTEST.TIMER_ID( INDEX ), STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TIMER_RESET (inactive)", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + 0, + RTEMS_CALLING_OVERHEAD.TIMER_RESET + ); + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.TIMER.RESET( TMTEST.TIMER_ID( INDEX ), STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TIMER_RESET (active)", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + 0, + RTEMS_CALLING_OVERHEAD.TIMER_RESET + ); + + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.TIMER.CANCEL( TMTEST.TIMER_ID( INDEX ), STATUS ); + end loop; + + TMTEST.TIME_OF_DAY := ( 1988, 12, 31, 9, 0, 0, 0 ); + + RTEMS.CLOCK.SET( TMTEST.TIME_OF_DAY, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "CLOCK_SET" ); + + TMTEST.TIME_OF_DAY.YEAR := 1989; + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.TIMER.FIRE_WHEN( + TMTEST.TIMER_ID( INDEX ), + TMTEST.TIME_OF_DAY, + TMTEST.NULL_DELAY'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TIMER_FIRE_WHEN (inactive)", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + 0, + RTEMS_CALLING_OVERHEAD.TIMER_FIRE_WHEN + ); + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.TIMER.FIRE_WHEN( + TMTEST.TIMER_ID( INDEX ), + TMTEST.TIME_OF_DAY, + TMTEST.NULL_DELAY'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TIMER_FIRE_WHEN (active)", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + 0, + RTEMS_CALLING_OVERHEAD.TIMER_FIRE_WHEN + ); + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.TIMER.DELETE( TMTEST.TIMER_ID( INDEX ), STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TIMER_DELETE (active)", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + 0, + RTEMS_CALLING_OVERHEAD.TIMER_DELETE + ); + + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.TIMER.CREATE( INDEX, TMTEST.TIMER_ID( INDEX ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CREATE" ); + + RTEMS.TIMER.FIRE_AFTER( + TMTEST.TIMER_ID( INDEX ), + 500, + TMTEST.NULL_DELAY'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_FIRE_AFTER" ); + + RTEMS.TIMER.CANCEL( TMTEST.TIMER_ID( INDEX ), STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TIMER_CANCEL" ); + + end loop; + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.TIMER.DELETE( TMTEST.TIMER_ID( INDEX ), STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TIMER_DELETE (inactive)", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + 0, + RTEMS_CALLING_OVERHEAD.TIMER_DELETE + ); + + TIMER_DRIVER.INITIALIZE; + RTEMS.TASKS.WAKE_WHEN( TMTEST.TIME_OF_DAY, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_WHEN" ); + + end HIGH_TASK; + +-- +-- MIDDLE_TASKS +-- + + procedure MIDDLE_TASKS ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.TASKS.WAKE_WHEN( TMTEST.TIME_OF_DAY, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_WHEN" ); + + end MIDDLE_TASKS; + +-- +-- LOW_TASK +-- + + procedure LOW_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + begin + + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TASK_WAKE_WHEN", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + 0, + RTEMS_CALLING_OVERHEAD.TASK_WAKE_WHEN + ); + + TEXT_IO.PUT_LINE( "*** END OF TIME TEST 23 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end LOW_TASK; + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm23/tmtest.ads b/testsuites/ada/tmtests/tm23/tmtest.ads new file mode 100644 index 0000000000..6e567007ca --- /dev/null +++ b/testsuites/ada/tmtests/tm23/tmtest.ads @@ -0,0 +1,132 @@ +-- +-- TMTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 23 of the RTEMS +-- Timing 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 TIME_TEST_SUPPORT; +with RTEMS; +with RTEMS.TASKS; + +package TMTEST is + +-- +-- This array contains the IDs of all RTEMS timers created by this test. +-- + + TIMER_ID : array ( RTEMS.UNSIGNED32 + range 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.ID; + +-- +-- This data item contains a time of day used by all of the +-- "WHEN" directives timed in this test. +-- + + TIME_OF_DAY : RTEMS.TIME_OF_DAY; + +-- +-- The following variable is set to the execution time returned +-- by the timer. +-- + + END_TIME : RTEMS.UNSIGNED32; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- NULL_DELAY +-- +-- DESCRIPTION: +-- +-- This subprogram is a timer service routine. It performs +-- no actions. +-- + + procedure NULL_DELAY ( + IGNORED_ID : in RTEMS.ID; + IGNORED_ADDRESS : in RTEMS.ADDRESS + ); + pragma Convention (C, NULL_DELAY); + +-- +-- HIGH_TASK +-- +-- DESCRIPTION: +-- +-- This RTEMS task is responsible for measuring and reporting +-- the following directive execution times: +-- +-- + TIMER_CREATE +-- + TIMER_FIRE_AFTER with an inactive timer +-- + TIMER_FIRE_AFTER with an active timer +-- + TIMER_CANCEL of an active timer +-- + TIMER_CANCEL of an inactive timer +-- + TIMER_RESET of an active timer +-- + TIMER_RESET of an inactive timer +-- + TIMER_FIRE_WHEN of an inactive timer +-- + TIMER_FIRE_WHEN of an active timer +-- + TIMER_DELETE of an active timer +-- + TIMER_DELETE of an inactive timer +-- +-- After measuring and reporting the above times, this task starts +-- the timer and executes the TASK_WAKE_WHEN directive. +-- + + procedure HIGH_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, HIGH_TASK); + +-- +-- MIDDLE_TASKS +-- +-- DESCRIPTION: +-- +-- These RTEMS tasks executes the TASK_WAKE_WHEN directive. +-- + + procedure MIDDLE_TASKS ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, MIDDLE_TASKS); + +-- +-- LOW_TASK +-- +-- DESCRIPTION: +-- +-- This RTEMS task stops the timer and reports the execution time for +-- the TASK_WAKE_WHEN directive. +-- + + procedure LOW_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, LOW_TASK); + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm24/Makefile.am b/testsuites/ada/tmtests/tm24/Makefile.am new file mode 100644 index 0000000000..9c7ec2e996 --- /dev/null +++ b/testsuites/ada/tmtests/tm24/Makefile.am @@ -0,0 +1,13 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +noinst_PROGRAMS = ada_tm24 +ada_tm24_SOURCES = tm24.adb config.h tmtest.adb tmtest.ads +ada_tm24_SOURCES += ../../support/init.c + +ada_tm24$(EXEEXT): tm24.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/tmtests/tm24/config.h b/testsuites/ada/tmtests/tm24/config.h new file mode 100644 index 0000000000..85640d92a9 --- /dev/null +++ b/testsuites/ada/tmtests/tm24/config.h @@ -0,0 +1,31 @@ +/* config.h + * + * This include file defines the Configuration Table for this test. + * + * COPYRIGHT (c) 1989-1997. + * 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_TMTEST + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER + +#define CONFIGURE_MAXIMUM_TASKS 111 +#define CONFIGURE_TICKS_PER_TIMESLICE 0 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/tmtests/tm24/tm24.adb b/testsuites/ada/tmtests/tm24/tm24.adb new file mode 100644 index 0000000000..a5ca5d4f7f --- /dev/null +++ b/testsuites/ada/tmtests/tm24/tm24.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test TM24 of the Timing 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 TMTEST; +with TEST_SUPPORT; + +procedure TM24 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, + TMTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end TM24; + diff --git a/testsuites/ada/tmtests/tm24/tmtest.adb b/testsuites/ada/tmtests/tm24/tmtest.adb new file mode 100644 index 0000000000..2bcd220516 --- /dev/null +++ b/testsuites/ada/tmtests/tm24/tmtest.adb @@ -0,0 +1,161 @@ +-- +-- TMTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 24 of the RTEMS +-- Timing 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 INTERFACES; use INTERFACES; +with RTEMS_CALLING_OVERHEAD; +with TEST_SUPPORT; +with TEXT_IO; +with TIME_TEST_SUPPORT; +with TIMER_DRIVER; + +package body TMTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + ID : RTEMS.ID; + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TIME TEST 24 ***" ); + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + TIMER_DRIVER.EMPTY_FUNCTION; + end loop; + TMTEST.OVERHEAD := TIMER_DRIVER.READ_TIMER; + + RTEMS.TASKS.CREATE( + RTEMS.BUILD_NAME( 'H', 'I', 'G', 'H' ), + 10, + 1024, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE HIGH" ); + + RTEMS.TASKS.START( ID, TMTEST.HIGH_TASK'ACCESS, 0, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START HIGH" ); + + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + + RTEMS.TASKS.CREATE( + RTEMS.BUILD_NAME( 'R', 'E', 'S', 'T' ), + 128, + 1024, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); + + RTEMS.TASKS.START( ID, TMTEST.TASKS'ACCESS, 0, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); + + end loop; + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- HIGH_TASK +-- + + procedure HIGH_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TASK_WAKE_AFTER (no context switch)", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + TMTEST.OVERHEAD, + RTEMS_CALLING_OVERHEAD.TASK_WAKE_AFTER + ); + + TMTEST.TASK_COUNT := 0; + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end HIGH_TASK; + +-- +-- TASKS +-- + + procedure TASKS ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TMTEST.TASK_COUNT := TMTEST.TASK_COUNT + 1; + + if TMTEST.TASK_COUNT = 1 then + + TIMER_DRIVER.INITIALIZE; + + elsif TMTEST.TASK_COUNT = TIME_TEST_SUPPORT.OPERATION_COUNT then + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TASK_WAKE_AFTER (context switch)", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + TMTEST.OVERHEAD, + RTEMS_CALLING_OVERHEAD.TASK_WAKE_AFTER + ); + + TEXT_IO.PUT_LINE( "*** END OF TIME TEST 24 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end if; + + RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + end TASKS; + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm24/tmtest.ads b/testsuites/ada/tmtests/tm24/tmtest.ads new file mode 100644 index 0000000000..fb6203d5c1 --- /dev/null +++ b/testsuites/ada/tmtests/tm24/tmtest.ads @@ -0,0 +1,99 @@ +-- +-- TMTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 24 of the RTEMS +-- Timing 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; + +package TMTEST is + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS tasks created +-- by this test. +-- + + TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; + TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; + +-- +-- This variable is used to determine which task should +-- start the timer and which task should stop the timer +-- and report the execution time. +-- + + TASK_COUNT : RTEMS.UNSIGNED32; + +-- +-- This variable contains the execution time required of the +-- loop used to execute the directive. +-- + + OVERHEAD : RTEMS.UNSIGNED32; + +-- +-- The following variable is set to the execution time returned +-- by the timer. +-- + + END_TIME : RTEMS.UNSIGNED32; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- HIGH_TASK +-- +-- DESCRIPTION: +-- +-- This RTEMS task is responsible for measuring and reporting the +-- execution time for an invocation of TASK_WAKE_AFTER which +-- attempts to yield but does not result in a context switch. +-- + + procedure HIGH_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, HIGH_TASK); + +-- +-- TASKS +-- +-- DESCRIPTION: +-- +-- These RTEMS tasks are responsible for measuring and reporting the +-- execution time for an invocation of TASK_WAKE_AFTER which +-- attempts to yield but does result in a context switch. +-- + + procedure TASKS ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASKS); + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm25/Makefile.am b/testsuites/ada/tmtests/tm25/Makefile.am new file mode 100644 index 0000000000..db67df9aff --- /dev/null +++ b/testsuites/ada/tmtests/tm25/Makefile.am @@ -0,0 +1,13 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +noinst_PROGRAMS = ada_tm25 +ada_tm25_SOURCES = tm25.adb config.h tmtest.adb tmtest.ads +ada_tm25_SOURCES += ../../support/init.c + +ada_tm25$(EXEEXT): tm25.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/tmtests/tm25/config.h b/testsuites/ada/tmtests/tm25/config.h new file mode 100644 index 0000000000..700438ceae --- /dev/null +++ b/testsuites/ada/tmtests/tm25/config.h @@ -0,0 +1,32 @@ +/* config.h + * + * This include file defines the Configuration Table for this test. + * + * COPYRIGHT (c) 1989-1997. + * 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_TMTEST + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER + +#define CONFIGURE_MAXIMUM_TASKS 111 +#define CONFIGURE_MAXIMUM_SEMAPHORES 1 +#define CONFIGURE_TICKS_PER_TIMESLICE 0 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/tmtests/tm25/tm25.adb b/testsuites/ada/tmtests/tm25/tm25.adb new file mode 100644 index 0000000000..44bda5893f --- /dev/null +++ b/testsuites/ada/tmtests/tm25/tm25.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test TM25 of the Timing 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 TMTEST; +with TEST_SUPPORT; + +procedure TM25 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, + TMTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end TM25; + diff --git a/testsuites/ada/tmtests/tm25/tmtest.adb b/testsuites/ada/tmtests/tm25/tmtest.adb new file mode 100644 index 0000000000..8710052bfb --- /dev/null +++ b/testsuites/ada/tmtests/tm25/tmtest.adb @@ -0,0 +1,155 @@ +-- +-- TMTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 25 of the RTEMS +-- Timing 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_CALLING_OVERHEAD; +with TEST_SUPPORT; +with TEXT_IO; +with TIME_TEST_SUPPORT; +with TIMER_DRIVER; +with RTEMS.CLOCK; +with RTEMS.SEMAPHORE; + +package body TMTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + TASK_ID : RTEMS.ID; + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TIME TEST 25 ***" ); + + RTEMS.SEMAPHORE.CREATE( + RTEMS.BUILD_NAME( 'S', 'M', '1', ' ' ), + 0, + RTEMS.DEFAULT_ATTRIBUTES, + RTEMS.TASKS.NO_PRIORITY, + TMTEST.SEMAPHORE_ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_CREATE OF SM1" ); + + RTEMS.TASKS.CREATE( + RTEMS.BUILD_NAME( 'L', 'O', 'W', ' ' ), + 254, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + TASK_ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOW" ); + + RTEMS.TASKS.START( + TASK_ID, + TMTEST.LOW_TASK'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOW" ); + + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + + RTEMS.TASKS.CREATE( + RTEMS.BUILD_NAME( 'T', 'I', 'M', 'E' ), + 128, + 1024, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + TASK_ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); + + RTEMS.TASKS.START( + TASK_ID, + TMTEST.HIGH_TASKS'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); + + end loop; + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- HIGH_TASKS +-- + + procedure HIGH_TASKS ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.SEMAPHORE.OBTAIN( + TMTEST.SEMAPHORE_ID, + RTEMS.DEFAULT_OPTIONS, + RTEMS.INTERVAL'LAST, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "SEMAPHORE_OBTAIN" ); + + end HIGH_TASKS; + +-- +-- LOW_TASK +-- + + procedure LOW_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.CLOCK.TICK( STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "CLOCK_TICK", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + 0, + RTEMS_CALLING_OVERHEAD.CLOCK_TICK + ); + + TEXT_IO.PUT_LINE( "*** END OF TIME TEST 25 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end LOW_TASK; + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm25/tmtest.ads b/testsuites/ada/tmtests/tm25/tmtest.ads new file mode 100644 index 0000000000..45a671af81 --- /dev/null +++ b/testsuites/ada/tmtests/tm25/tmtest.ads @@ -0,0 +1,80 @@ +-- +-- TMTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 25 of the RTEMS +-- Timing 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; + +package TMTEST is + +-- +-- The following is the ID of the semaphore used for timing operations. +-- + + SEMAPHORE_ID : RTEMS.ID; + +-- +-- The following variable is set to the execution time returned +-- by the timer. +-- + + END_TIME : RTEMS.UNSIGNED32; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- HIGH_TASKS +-- +-- DESCRIPTION: +-- +-- These RTEMS tasks perform a blocking SEMAPHORE_OBTAIN which +-- has an optional timeout. +-- + + procedure HIGH_TASKS ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, HIGH_TASKS); + +-- +-- LOW_TASK +-- +-- DESCRIPTION: +-- +-- This RTEMS task is responsible for measuring and reporting +-- the execution time for the CLOCK_TICK directive. +-- + + procedure LOW_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, LOW_TASK); + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm28/Makefile.am b/testsuites/ada/tmtests/tm28/Makefile.am new file mode 100644 index 0000000000..eca1e00d55 --- /dev/null +++ b/testsuites/ada/tmtests/tm28/Makefile.am @@ -0,0 +1,13 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +noinst_PROGRAMS = ada_tm28 +ada_tm28_SOURCES = tm28.adb config.h tmtest.adb tmtest.ads +ada_tm28_SOURCES += ../../support/init.c + +ada_tm28$(EXEEXT): tm28.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/tmtests/tm28/config.h b/testsuites/ada/tmtests/tm28/config.h new file mode 100644 index 0000000000..2f73cd5acb --- /dev/null +++ b/testsuites/ada/tmtests/tm28/config.h @@ -0,0 +1,32 @@ +/* config.h + * + * This include file defines the Configuration Table for this test. + * + * COPYRIGHT (c) 1989-1997. + * 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_TMTEST + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER + +#define CONFIGURE_MAXIMUM_TASKS 2 +#define CONFIGURE_MAXIMUM_PORTS 1 +#define CONFIGURE_TICKS_PER_TIMESLICE 0 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/tmtests/tm28/tm28.adb b/testsuites/ada/tmtests/tm28/tm28.adb new file mode 100644 index 0000000000..93d0f3cf02 --- /dev/null +++ b/testsuites/ada/tmtests/tm28/tm28.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test TM28 of the Timing 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 TMTEST; +with TEST_SUPPORT; + +procedure TM28 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, + TMTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end TM28; + diff --git a/testsuites/ada/tmtests/tm28/tmtest.adb b/testsuites/ada/tmtests/tm28/tmtest.adb new file mode 100644 index 0000000000..189090e39f --- /dev/null +++ b/testsuites/ada/tmtests/tm28/tmtest.adb @@ -0,0 +1,171 @@ +-- +-- TMTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 28 of the RTEMS +-- Timing 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_CALLING_OVERHEAD; +with TEST_SUPPORT; +with TEXT_IO; +with TIMER_DRIVER; +with RTEMS.PORT; + +package body TMTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TIME TEST 28 ***" ); + + RTEMS.TASKS.CREATE( + RTEMS.BUILD_NAME( 'T', 'E', 'S', 'T' ), + 128, + 1024, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + TMTEST.TASK_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE" ); + + RTEMS.TASKS.START( + TMTEST.TASK_ID( 1 ), + TMTEST.TEST_TASK'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START" ); + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- TEST_TASK +-- + + procedure TEST_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + NAME : RTEMS.NAME; + OVERHEAD : RTEMS.UNSIGNED32; + CONVERTED : RTEMS.ADDRESS; + STATUS : RTEMS.STATUS_CODES; + begin + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + TIMER_DRIVER.EMPTY_FUNCTION; + end loop; + OVERHEAD := TIMER_DRIVER.READ_TIMER; + + NAME := RTEMS.BUILD_NAME( 'P', 'O', 'R', 'T' ); + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.PORT.CREATE( + NAME, + TMTEST.INTERNAL_PORT_AREA'ADDRESS, + TMTEST.EXTERNAL_PORT_AREA'ADDRESS, + 16#FF#, + TMTEST.PORT_ID( INDEX ), + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "PORT_CREATE", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + RTEMS_CALLING_OVERHEAD.PORT_CREATE + ); + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.PORT.EXTERNAL_TO_INTERNAL( + TMTEST.PORT_ID( 1 ), + TMTEST.EXTERNAL_PORT_AREA( 16#F# )'ADDRESS, + CONVERTED, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "PORT_EXTERNAL_TO_INTERNAL", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + RTEMS_CALLING_OVERHEAD.PORT_EXTERNAL_TO_INTERNAL + ); + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.PORT.INTERNAL_TO_EXTERNAL( + TMTEST.PORT_ID( 1 ), + TMTEST.INTERNAL_PORT_AREA( 16#F# )'ADDRESS, + CONVERTED, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "PORT_INTERNAL_TO_EXTERNAL", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + RTEMS_CALLING_OVERHEAD.PORT_INTERNAL_TO_EXTERNAL + ); + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + RTEMS.PORT.DELETE( TMTEST.PORT_ID( INDEX ), STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "PORT_DELETE", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + RTEMS_CALLING_OVERHEAD.PORT_DELETE + ); + + TEXT_IO.PUT_LINE( "*** END OF TIME TEST 28 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end TEST_TASK; + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm28/tmtest.ads b/testsuites/ada/tmtests/tm28/tmtest.ads new file mode 100644 index 0000000000..39ceeb0ad2 --- /dev/null +++ b/testsuites/ada/tmtests/tm28/tmtest.ads @@ -0,0 +1,105 @@ +-- +-- TMTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 28 of the RTEMS +-- Timing 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 SYSTEM; +with TIME_TEST_SUPPORT; +with RTEMS; +with RTEMS.TASKS; +with System.Storage_Elements; + +package TMTEST is + +-- +-- This array contains the IDs of all RTEMS tasks created by this test. +-- + + TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; + +-- +-- This array contains the IDs of all RTEMS ports created by this test. +-- + + PORT_ID : array ( RTEMS.UNSIGNED32 + range 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT ) of RTEMS.ID; + +-- +-- 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 variable is set to the execution time returned +-- by the timer. +-- + + END_TIME : RTEMS.UNSIGNED32; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- TEST_TASK +-- +-- DESCRIPTION: +-- +-- This RTEMS task is responsible for measuring and reporting the +-- following directive execution times: +-- +-- + PORT_CREATE +-- + PORT_EXTERNAL_TO_INTERNAL +-- + PORT_INTERNAL_TO_EXTERNAL +-- + PORT_DELETE +-- + + procedure TEST_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TEST_TASK); + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm29/Makefile.am b/testsuites/ada/tmtests/tm29/Makefile.am new file mode 100644 index 0000000000..d34b097da4 --- /dev/null +++ b/testsuites/ada/tmtests/tm29/Makefile.am @@ -0,0 +1,13 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +noinst_PROGRAMS = ada_tm29 +ada_tm29_SOURCES = tm29.adb config.h tmtest.adb tmtest.ads +ada_tm29_SOURCES += ../../support/init.c + +ada_tm29$(EXEEXT): tm29.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/tmtests/tm29/config.h b/testsuites/ada/tmtests/tm29/config.h new file mode 100644 index 0000000000..e9165e59c8 --- /dev/null +++ b/testsuites/ada/tmtests/tm29/config.h @@ -0,0 +1,32 @@ +/* config.h + * + * This include file defines the Configuration Table for this test. + * + * COPYRIGHT (c) 1989-1997. + * 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_TMTEST + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER + +#define CONFIGURE_MAXIMUM_TASKS 111 +#define CONFIGURE_MAXIMUM_PERIODS 111 +#define CONFIGURE_TICKS_PER_TIMESLICE 0 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/tmtests/tm29/tm29.adb b/testsuites/ada/tmtests/tm29/tm29.adb new file mode 100644 index 0000000000..4853fbf2c7 --- /dev/null +++ b/testsuites/ada/tmtests/tm29/tm29.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test TM29 of the Timing 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 TMTEST; +with TEST_SUPPORT; + +procedure TM29 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, + TMTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end TM29; + diff --git a/testsuites/ada/tmtests/tm29/tmtest.adb b/testsuites/ada/tmtests/tm29/tmtest.adb new file mode 100644 index 0000000000..0a6a31b713 --- /dev/null +++ b/testsuites/ada/tmtests/tm29/tmtest.adb @@ -0,0 +1,236 @@ +-- +-- TMTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Test 29 of the RTEMS +-- Timing 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 INTERFACES; use INTERFACES; +with RTEMS_CALLING_OVERHEAD; +with TEST_SUPPORT; +with TEXT_IO; +with TIME_TEST_SUPPORT; +with TIMER_DRIVER; +with RTEMS.RATE_MONOTONIC; + +package body TMTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + ID : RTEMS.ID; + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TIME TEST 29 ***" ); + + TMTEST.PERIOD_NAME := RTEMS.BUILD_NAME( 'P', 'R', 'D', ' ' ); + + TIMER_DRIVER.INITIALIZE; + RTEMS.RATE_MONOTONIC.CREATE( TMTEST.PERIOD_NAME, ID, STATUS ); + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "RATE_MONOTONIC_CREATE", + TMTEST.END_TIME, + 1, + 0, + RTEMS_CALLING_OVERHEAD.RATE_MONOTONIC_CREATE + ); + + TIMER_DRIVER.INITIALIZE; + RTEMS.RATE_MONOTONIC.PERIOD( ID, 10, STATUS ); + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "RATE_MONOTONIC_PERIOD" ); + + TIME_TEST_SUPPORT.PUT_TIME( + "RATE_MONOTONIC_PERIOD (initial)", + TMTEST.END_TIME, + 1, + 0, + RTEMS_CALLING_OVERHEAD.RATE_MONOTONIC_PERIOD + ); + + TIMER_DRIVER.INITIALIZE; + RTEMS.RATE_MONOTONIC.PERIOD( ID, RTEMS.RATE_MONOTONIC_PERIOD_STATUS, STATUS ); + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "RATE_MONOTONIC_PERIOD" ); + + TIME_TEST_SUPPORT.PUT_TIME( + "RATE_MONOTONIC_PERIOD (STATUS)", + TMTEST.END_TIME, + 1, + 0, + RTEMS_CALLING_OVERHEAD.RATE_MONOTONIC_PERIOD + ); + + TIMER_DRIVER.INITIALIZE; + RTEMS.RATE_MONOTONIC.CANCEL( ID, STATUS ); + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "RATE_MONOTONIC_CANCEL" ); + + TIME_TEST_SUPPORT.PUT_TIME( + "RATE_MONOTONIC_CANCEL", + TMTEST.END_TIME, + 1, + 0, + RTEMS_CALLING_OVERHEAD.RATE_MONOTONIC_CANCEL + ); + + TIMER_DRIVER.INITIALIZE; + RTEMS.RATE_MONOTONIC.DELETE( ID, STATUS ); + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "RATE_MONOTONIC_DELETE (cancelled)", + TMTEST.END_TIME, + 1, + 0, + RTEMS_CALLING_OVERHEAD.RATE_MONOTONIC_DELETE + ); + + RTEMS.RATE_MONOTONIC.CREATE( TMTEST.PERIOD_NAME, ID, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "RATE_MONOTONIC_CREATE" ); + + RTEMS.RATE_MONOTONIC.PERIOD( ID, 10, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "RATE_MONOTONIC_PERIOD" ); + + TIMER_DRIVER.INITIALIZE; + RTEMS.RATE_MONOTONIC.DELETE( ID, STATUS ); + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "RATE_MONOTONIC_DELETE (active)", + TMTEST.END_TIME, + 1, + 0, + RTEMS_CALLING_OVERHEAD.RATE_MONOTONIC_DELETE + ); + + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + + RTEMS.TASKS.CREATE( + RTEMS.BUILD_NAME( 'T', 'E', 'S', 'T' ), + 128, + 1024, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); + + RTEMS.TASKS.START( ID, TMTEST.TASKS'ACCESS, 0, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); + + end loop; + + RTEMS.TASKS.CREATE( + RTEMS.BUILD_NAME( 'L', 'O', 'W', ' ' ), + 200, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + ID, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE LOOP" ); + + RTEMS.TASKS.START( ID, TMTEST.LOW_TASK'ACCESS, 0, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START LOOP" ); + + TMTEST.TASK_COUNT := 0; + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +-- +-- TASKS +-- + + procedure TASKS ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + ID : RTEMS.NAME; + STATUS : RTEMS.STATUS_CODES; + begin + + RTEMS.RATE_MONOTONIC.CREATE( TMTEST.PERIOD_NAME, ID, STATUS ); + RTEMS.RATE_MONOTONIC.PERIOD( ID, 10, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "RATE_MONOTONIC_PERIOD" ); + + -- Give up the processor to allow all tasks to actually + -- create and start their period timer before the benchmark + -- timer driver is initialized. + + RTEMS.TASKS.WAKE_AFTER( RTEMS.YIELD_PROCESSOR, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_WAKE_AFTER" ); + + TMTEST.TASK_COUNT := TMTEST.TASK_COUNT + 1; + + if TMTEST.TASK_COUNT = 1 then + TIMER_DRIVER.INITIALIZE; + end if; + + RTEMS.RATE_MONOTONIC.PERIOD( ID, 100, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "RATE_MONOTONIC_PERIOD" ); + + end TASKS; + +-- +-- LOW_TASK +-- + + procedure LOW_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + OVERHEAD : RTEMS.UNSIGNED32; + begin + + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + TIMER_DRIVER.EMPTY_FUNCTION; + end loop; + OVERHEAD := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "RATE_MONOTONIC_PERIOD (blocking)", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + RTEMS_CALLING_OVERHEAD.RATE_MONOTONIC_PERIOD + ); + + TEXT_IO.PUT_LINE( "*** END OF TIME TEST 29 ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end LOW_TASK; + +end TMTEST; diff --git a/testsuites/ada/tmtests/tm29/tmtest.ads b/testsuites/ada/tmtests/tm29/tmtest.ads new file mode 100644 index 0000000000..8661fc28b6 --- /dev/null +++ b/testsuites/ada/tmtests/tm29/tmtest.ads @@ -0,0 +1,96 @@ +-- +-- TMTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Test 29 of the RTEMS +-- Timing 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; + +package TMTEST is + +-- +-- The following is the name used for all periods created by this test. +-- + + PERIOD_NAME : RTEMS.NAME; + +-- +-- The following is used to allow all tasks to create and start +-- their period timers before the timer is started for timing +-- the blocking case of RATE_MONOTONIC_PERIOD. +-- + + TASK_COUNT : RTEMS.UNSIGNED32; + +-- +-- The following variable is set to the execution time returned +-- by the timer. +-- + + END_TIME : RTEMS.UNSIGNED32; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. It also measures and +-- reports the following directive execution times: +-- +-- + RATE_MONOTONIC_CREATE +-- + RATE_MONOTONIC_PERIOD the initial time +-- + RATE_MONOTONIC_PERIOD for a period's status +-- + RATE_MONOTONIC_CANCEL +-- + RATE_MONOTONIC_DELETE of a cancelled period +-- + RATE_MONOTONIC_DELETE of an active period +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- TASKS +-- +-- DESCRIPTION: +-- +-- The first of these RTEMS tasks starts the timer. All of these +-- tasks execute a blocking RATE_MONOTONIC_PERIOD. +-- + + procedure TASKS ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASKS); + +-- +-- LOW_TASK +-- +-- DESCRIPTION: +-- +-- This RTEMS task stops the timer and reports the execution +-- time for a blocking RATE_MONOTONIC_PERIOD. +-- + + procedure LOW_TASK ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, LOW_TASK); + +end TMTEST; diff --git a/testsuites/ada/tmtests/tmck/Makefile.am b/testsuites/ada/tmtests/tmck/Makefile.am new file mode 100644 index 0000000000..a2fa2956e0 --- /dev/null +++ b/testsuites/ada/tmtests/tmck/Makefile.am @@ -0,0 +1,13 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +noinst_PROGRAMS = ada_tmck +ada_tmck_SOURCES = tmck.adb config.h tmtest.adb tmtest.ads +ada_tmck_SOURCES += ../../support/init.c + +ada_tmck$(EXEEXT): tmck.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/tmtests/tmck/config.h b/testsuites/ada/tmtests/tmck/config.h new file mode 100644 index 0000000000..7730385b3c --- /dev/null +++ b/testsuites/ada/tmtests/tmck/config.h @@ -0,0 +1,32 @@ +/* config.h + * + * This include file defines the Configuration Table for this test. + * + * COPYRIGHT (c) 1989-1997. + * 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_TMTEST + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER + +#define CONFIGURE_MAXIMUM_TASKS 2 +#define CONFIGURE_MAXIMUM_SEMAPHORES 1 +#define CONFIGURE_TICKS_PER_TIMESLICE 0 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/tmtests/tmck/tmck.adb b/testsuites/ada/tmtests/tmck/tmck.adb new file mode 100644 index 0000000000..c35d786517 --- /dev/null +++ b/testsuites/ada/tmtests/tmck/tmck.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test TMCK of the Timing 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 TMTEST; +with TEST_SUPPORT; + +procedure TMCK 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, + TMTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end TMCK; + diff --git a/testsuites/ada/tmtests/tmck/tmtest.adb b/testsuites/ada/tmtests/tmck/tmtest.adb new file mode 100644 index 0000000000..8da1ff220a --- /dev/null +++ b/testsuites/ada/tmtests/tmck/tmtest.adb @@ -0,0 +1,214 @@ +-- +-- TMTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Timer Check Test of the RTEMS +-- Timing 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 TIMER_DRIVER; +with INTERFACES; use INTERFACES; +with TEST_SUPPORT; +with TEXT_IO; +with TIME_TEST_SUPPORT; +with UNSIGNED32_IO; + +package body TMTEST is + +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TIME TEST CHECK ***" ); + + TIMER_DRIVER.SET_FIND_AVERAGE_OVERHEAD( TRUE ); + + TMTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); + + RTEMS.TASKS.CREATE( + TMTEST.TASK_NAME( 1 ), + 1, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + TMTEST.TASK_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" ); + + RTEMS.TASKS.START( + TMTEST.TASK_ID( 1 ), + TMTEST.TASK_1'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); + + 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); + begin + + TMTEST.CHECK_READ_TIMER; + +TEST_SUPPORT.PAUSE; + + TIMER_DRIVER.INITIALIZE; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + TIME_TEST_SUPPORT.PUT_TIME( + "NULL timer stopped at", + TMTEST.END_TIME, + 1, + 0, + 0 + ); + + TIMER_DRIVER.INITIALIZE; + for INDEX in 0 .. 1000 + loop + TIMER_DRIVER.EMPTY_FUNCTION; + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + TIME_TEST_SUPPORT.PUT_TIME( + "LOOP (1000) timer stopped at", + TMTEST.END_TIME, + 1, + 0, + 0 + ); + + TIMER_DRIVER.INITIALIZE; + for INDEX in 0 .. 10000 + loop + TIMER_DRIVER.EMPTY_FUNCTION; + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + TIME_TEST_SUPPORT.PUT_TIME( + "LOOP (10000) timer stopped at", + TMTEST.END_TIME, + 1, + 0, + 0 + ); + + TIMER_DRIVER.INITIALIZE; + for INDEX in 0 .. 50000 + loop + TIMER_DRIVER.EMPTY_FUNCTION; + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + TIME_TEST_SUPPORT.PUT_TIME( + "LOOP (50000) timer stopped at", + TMTEST.END_TIME, + 1, + 0, + 0 + ); + + TIMER_DRIVER.INITIALIZE; + for INDEX in 0 .. 100000 + loop + TIMER_DRIVER.EMPTY_FUNCTION; + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + TIME_TEST_SUPPORT.PUT_TIME( + "LOOP (100000) timer stopped at", + TMTEST.END_TIME, + 1, + 0, + 0 + ); + + TEXT_IO.PUT_LINE( "*** END OF TIME TEST CHECK ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end TASK_1; + +-- +-- CHECK_READ_TIMER +-- + + procedure CHECK_READ_TIMER + is + TIME : RTEMS.UNSIGNED32; + begin + + for INDEX in TMTEST.DISTRIBUTION'FIRST .. TMTEST.DISTRIBUTION'LAST + loop + TMTEST.DISTRIBUTION( INDEX ) := 0; + end loop; + + for INDEX in 1 .. TMTEST.OPERATION_COUNT + loop + + loop + TIMER_DRIVER.INITIALIZE; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + exit when + TMTEST.END_TIME <= RTEMS.UNSIGNED32( TMTEST.DISTRIBUTION'LAST ); + + TEXT_IO.PUT( "TOO LONG (" ); + UNSIGNED32_IO.PUT( TMTEST.END_TIME ); + TEXT_IO.PUT_LINE( ")!!!" ); + end loop; + + TMTEST.DISTRIBUTION( TMTEST.END_TIME ) := + TMTEST.DISTRIBUTION( TMTEST.END_TIME ) + 1; + + end loop; + + TEXT_IO.PUT_LINE( + "Units may not be in microseconds for this test!!!" + ); + + TIME := 0; + + for INDEX in TMTEST.DISTRIBUTION'FIRST .. TMTEST.DISTRIBUTION'LAST + loop + if TMTEST.DISTRIBUTION( INDEX ) /= 0 then + TIME := TIME + (TMTEST.DISTRIBUTION( INDEX ) * INDEX); + UNSIGNED32_IO.PUT( INDEX ); + TEXT_IO.PUT( " " ); + UNSIGNED32_IO.PUT( TMTEST.DISTRIBUTION( INDEX ) ); + TEXT_IO.NEW_LINE; + end if; + end loop; + + TEXT_IO.PUT( "Total time = " ); + UNSIGNED32_IO.PUT( TIME ); + TEXT_IO.NEW_LINE; + + end CHECK_READ_TIMER; + +end TMTEST; diff --git a/testsuites/ada/tmtests/tmck/tmtest.ads b/testsuites/ada/tmtests/tmck/tmtest.ads new file mode 100644 index 0000000000..6eef577910 --- /dev/null +++ b/testsuites/ada/tmtests/tmck/tmtest.ads @@ -0,0 +1,96 @@ +-- +-- TMTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Timer Check Test of the RTEMS +-- Timing 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; + +package TMTEST is + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS tasks created +-- by this test. +-- + + TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; + TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; + +-- +-- The following variable is set to the execution time returned +-- by the timer. +-- + + END_TIME : RTEMS.UNSIGNED32; + +-- +-- The following defines the number of iterations of each timed +-- operation to perform. +-- + + OPERATION_COUNT : constant RTEMS.UNSIGNED32 := 100000; + +-- +-- The following array is used to determine how many times +-- each time between 0 and 1000 microseconds was returned +-- when simply starting and stopping the timer. + + DISTRIBUTION : array ( RTEMS.UNSIGNED32 range 0 .. 10000 ) of RTEMS.UNSIGNED32; + +-- +-- 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 invokes CHECK_READ_TIMER before demonstrating +-- that increasing the order of magnitude of the number of loop +-- iterations performed has a corresponding impact on the time +-- reported by the timer driver. +-- + + procedure TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_1); + +-- +-- CHECK_READ_TIMER +-- +-- DESCRIPTION: +-- +-- This subprogram is used to determine the overhead associated +-- with starting and stopping the timer. It is also useful +-- for determining if unexpected times will be reported. +-- + + procedure CHECK_READ_TIMER; + +end TMTEST; diff --git a/testsuites/ada/tmtests/tmoverhd/Makefile.am b/testsuites/ada/tmtests/tmoverhd/Makefile.am new file mode 100644 index 0000000000..8bc56dd537 --- /dev/null +++ b/testsuites/ada/tmtests/tmoverhd/Makefile.am @@ -0,0 +1,14 @@ +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../automake/compile.am + +include $(top_srcdir)/ada.am + +noinst_PROGRAMS = ada_tmoverhd +ada_tmoverhd_SOURCES = tmoverhd.adb config.h tmtest.adb tmtest.ads \ + dummy_rtems.adb dummy_rtems.ads +ada_tmoverhd_SOURCES += ../../support/init.c + +ada_tmoverhd$(EXEEXT): tmoverhd.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +include $(top_srcdir)/../automake/local.am diff --git a/testsuites/ada/tmtests/tmoverhd/README b/testsuites/ada/tmtests/tmoverhd/README new file mode 100644 index 0000000000..4e66647830 --- /dev/null +++ b/testsuites/ada/tmtests/tmoverhd/README @@ -0,0 +1,5 @@ +This test is of marginal usefulness in testing the bindings. It +shows how much overhead is required to call the Ada binding +routine but does not give any indication of how much overhead the +binding itself adds. This information can be inferred by subtracting +the C times from Ada times on the same target processor. diff --git a/testsuites/ada/tmtests/tmoverhd/config.h b/testsuites/ada/tmtests/tmoverhd/config.h new file mode 100644 index 0000000000..7730385b3c --- /dev/null +++ b/testsuites/ada/tmtests/tmoverhd/config.h @@ -0,0 +1,32 @@ +/* config.h + * + * This include file defines the Configuration Table for this test. + * + * COPYRIGHT (c) 1989-1997. + * 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_TMTEST + +#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER +#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER + +#define CONFIGURE_MAXIMUM_TASKS 2 +#define CONFIGURE_MAXIMUM_SEMAPHORES 1 +#define CONFIGURE_TICKS_PER_TIMESLICE 0 + +#define CONFIGURE_POSIX_INIT_THREAD_TABLE + +#define CONFIGURE_MAXIMUM_POSIX_THREADS 10 +#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 + +#include + +/* end of include file */ diff --git a/testsuites/ada/tmtests/tmoverhd/dummy_rtems.adb b/testsuites/ada/tmtests/tmoverhd/dummy_rtems.adb new file mode 100644 index 0000000000..62986dc465 --- /dev/null +++ b/testsuites/ada/tmtests/tmoverhd/dummy_rtems.adb @@ -0,0 +1,891 @@ +-- +-- DUMMY_RTEMS / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package contains implementation of stub routines +-- which are used to time the invocation overhead incurred +-- with an Ada application program invokes each RTEMS directive. +-- +-- DEPENDENCIES: +-- +-- +-- +-- COPYRIGHT (c) 1989-2009. +-- 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. +-- + +package body DUMMY_RTEMS is + +-- Task Manager + + procedure TASK_CREATE ( + NAME : in RTEMS.NAME; + INITIAL_PRIORITY : in RTEMS.TASKS.PRIORITY; + STACK_SIZE : in RTEMS.UNSIGNED32; + INITIAL_MODES : in RTEMS.MODE; + ATTRIBUTE_SET : in RTEMS.ATTRIBUTE; + ID : out RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(NAME); + pragma Unreferenced(INITIAL_PRIORITY); + pragma Unreferenced(STACK_SIZE); + pragma Unreferenced(INITIAL_MODES); + pragma Unreferenced(ATTRIBUTE_SET); + begin + + ID := 0; + RESULT := RTEMS.SUCCESSFUL; + + end TASK_CREATE; + + procedure TASK_IDENT ( + NAME : in RTEMS.NAME; + NODE : in RTEMS.UNSIGNED32; + ID : out RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(NAME); + pragma Unreferenced(NODE); + begin + + ID := 0; + RESULT := RTEMS.SUCCESSFUL; + + end TASK_IDENT; + + procedure TASK_START ( + ID : in RTEMS.ID; + ENTRY_POINT : in RTEMS.TASKS.ENTRY_POINT; + ARGUMENT : in RTEMS.UNSIGNED32; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(ID); + pragma Unreferenced(ENTRY_POINT); + pragma Unreferenced(ARGUMENT); + begin + + RESULT := RTEMS.SUCCESSFUL; + + end TASK_START; + + procedure TASK_RESTART ( + ID : in RTEMS.ID; + ARGUMENT : in RTEMS.UNSIGNED32; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(ID); + pragma Unreferenced(ARGUMENT); + begin + + RESULT := RTEMS.SUCCESSFUL; + + end TASK_RESTART; + + procedure TASK_DELETE ( + ID : in RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(ID); + begin + + RESULT := RTEMS.SUCCESSFUL; + + end TASK_DELETE; + + procedure TASK_SUSPEND ( + ID : in RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(ID); + begin + + RESULT := RTEMS.SUCCESSFUL; + + end TASK_SUSPEND; + + procedure TASK_RESUME ( + ID : in RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(ID); + begin + + RESULT := RTEMS.SUCCESSFUL; + + end TASK_RESUME; + + procedure TASK_SET_PRIORITY ( + ID : in RTEMS.ID; + NEW_PRIORITY : in RTEMS.TASKS.PRIORITY; + OLD_PRIORITY : out RTEMS.TASKS.PRIORITY; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(ID); + pragma Unreferenced(NEW_PRIORITY); + begin + + OLD_PRIORITY := 0; + RESULT := RTEMS.SUCCESSFUL; + + end TASK_SET_PRIORITY; + + procedure TASK_MODE ( + MODE_SET : in RTEMS.MODE; + MASK : in RTEMS.MODE; + PREVIOUS_MODE_SET : out RTEMS.MODE; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(MODE_SET); + pragma Unreferenced(MASK); + begin + + PREVIOUS_MODE_SET := 0; + RESULT := RTEMS.SUCCESSFUL; + + end TASK_MODE; + + procedure TASK_WAKE_WHEN ( + TIME_BUFFER : in RTEMS.TIME_OF_DAY; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(TIME_BUFFER); + begin + + RESULT := RTEMS.SUCCESSFUL; + + end TASK_WAKE_WHEN; + + procedure TASK_WAKE_AFTER ( + TICKS : in RTEMS.INTERVAL; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(TICKS); + begin + + RESULT := RTEMS.SUCCESSFUL; + + end TASK_WAKE_AFTER; + +-- Interrupt Manager + +-- procedure INTERRUPT_CATCH ( +-- NEW_ISR_HANDLER : in RTEMS.ADDRESS; +-- VECTOR : in RTEMS.VECTOR_NUMBER; +-- OLD_ISR_HANDLER : out RTEMS.ADDRESS; +-- RESULT : out RTEMS.STATUS_CODES +-- ) is +-- begin +-- +-- OLD_ISR_HANDLER := RTEMS.Null_Address; +-- RESULT := RTEMS.SUCCESSFUL; +-- +-- end INTERRUPT_CATCH; + +-- Clock Manager + + procedure CLOCK_GET_TOD ( + TIME_BUFFER : out RTEMS.TIME_OF_DAY; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(TIME_BUFFER); + begin + + RESULT := RTEMS.SUCCESSFUL; + + end CLOCK_GET_TOD; + + procedure CLOCK_SET ( + TIME_BUFFER : in RTEMS.TIME_OF_DAY; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(TIME_BUFFER); + begin + + RESULT := RTEMS.SUCCESSFUL; + + end CLOCK_SET; + + procedure CLOCK_TICK ( + RESULT : out RTEMS.STATUS_CODES + ) is + begin + + RESULT := RTEMS.SUCCESSFUL; + + end CLOCK_TICK; + +-- Timer Manager + + procedure TIMER_CREATE ( + NAME : in RTEMS.NAME; + ID : out RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(NAME); + begin + + ID := 0; + RESULT := RTEMS.SUCCESSFUL; + + end TIMER_CREATE; + + procedure TIMER_DELETE ( + ID : in RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(ID); + begin + + RESULT := RTEMS.SUCCESSFUL; + + end TIMER_DELETE; + + procedure TIMER_IDENT ( + NAME : in RTEMS.NAME; + ID : out RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(NAME); + begin + + ID := 0; + RESULT := RTEMS.SUCCESSFUL; + + end TIMER_IDENT; + + procedure TIMER_FIRE_AFTER ( + ID : in RTEMS.ID; + TICKS : in RTEMS.INTERVAL; + ROUTINE : in RTEMS.TIMER.SERVICE_ROUTINE; + USER_DATA : in RTEMS.ADDRESS; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(ID); + pragma Unreferenced(TICKS); + pragma Unreferenced(ROUTINE); + pragma Unreferenced(USER_DATA); + begin + + RESULT := RTEMS.SUCCESSFUL; + + end TIMER_FIRE_AFTER; + + procedure TIMER_FIRE_WHEN ( + ID : in RTEMS.ID; + WALL_TIME : in RTEMS.TIME_OF_DAY; + ROUTINE : in RTEMS.TIMER.SERVICE_ROUTINE; + USER_DATA : in RTEMS.ADDRESS; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(ID); + pragma Unreferenced(WALL_TIME); + pragma Unreferenced(ROUTINE); + pragma Unreferenced(USER_DATA); + begin + + RESULT := RTEMS.SUCCESSFUL; + + end TIMER_FIRE_WHEN; + + procedure TIMER_RESET ( + ID : in RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(ID); + begin + + RESULT := RTEMS.SUCCESSFUL; + + end TIMER_RESET; + + procedure TIMER_CANCEL ( + ID : in RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(ID); + begin + + RESULT := RTEMS.SUCCESSFUL; + + end TIMER_CANCEL; + +-- Semaphore Manager + + procedure SEMAPHORE_CREATE ( + NAME : in RTEMS.NAME; + COUNT : in RTEMS.UNSIGNED32; + ATTRIBUTE_SET : in RTEMS.ATTRIBUTE; + PRIORITY_CEILING : in RTEMS.TASKS.PRIORITY; + ID : out RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(NAME); + pragma Unreferenced(COUNT); + pragma Unreferenced(ATTRIBUTE_SET); + pragma Unreferenced(PRIORITY_CEILING); + begin + + ID := 0; + RESULT := RTEMS.SUCCESSFUL; + + end SEMAPHORE_CREATE; + + procedure SEMAPHORE_DELETE ( + ID : in RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(ID); + begin + + RESULT := RTEMS.SUCCESSFUL; + + end SEMAPHORE_DELETE; + + procedure SEMAPHORE_IDENT ( + NAME : in RTEMS.NAME; + NODE : in RTEMS.UNSIGNED32; + ID : out RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(NAME); + pragma Unreferenced(NODE); + begin + + ID := 0; + RESULT := RTEMS.SUCCESSFUL; + + end SEMAPHORE_IDENT; + + procedure SEMAPHORE_OBTAIN ( + ID : in RTEMS.ID; + OPTION_SET : in RTEMS.OPTION; + TIMEOUT : in RTEMS.INTERVAL; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(ID); + pragma Unreferenced(OPTION_SET); + pragma Unreferenced(TIMEOUT); + begin + + RESULT := RTEMS.SUCCESSFUL; + + end SEMAPHORE_OBTAIN; + + procedure SEMAPHORE_RELEASE ( + ID : in RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(ID); + begin + + RESULT := RTEMS.SUCCESSFUL; + + end SEMAPHORE_RELEASE; + +-- Message Queue Manager + + procedure MESSAGE_QUEUE_CREATE ( + Name : in RTEMS.Name; + Count : in RTEMS.Unsigned32; + Max_Message_Size : in RTEMS.Unsigned32; + Attribute_Set : in RTEMS.Attribute; + ID : out RTEMS.ID; + Result : out RTEMS.Status_Codes + ) is + pragma Unreferenced(Name); + pragma Unreferenced(Count); + pragma Unreferenced(Max_Message_Size); + pragma Unreferenced(Attribute_Set); + begin + + ID := 0; + RESULT := RTEMS.SUCCESSFUL; + + end MESSAGE_QUEUE_CREATE; + + procedure MESSAGE_QUEUE_IDENT ( + NAME : in RTEMS.NAME; + NODE : in RTEMS.UNSIGNED32; + ID : out RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(NAME); + pragma Unreferenced(NODE); + begin + + ID := 0; + RESULT := RTEMS.SUCCESSFUL; + + end MESSAGE_QUEUE_IDENT; + + procedure MESSAGE_QUEUE_DELETE ( + ID : in RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(ID); + begin + + RESULT := RTEMS.SUCCESSFUL; + + end MESSAGE_QUEUE_DELETE; + + procedure MESSAGE_QUEUE_SEND ( + ID : in RTEMS.ID; + BUFFER : in RTEMS.ADDRESS; + Size : in RTEMS.Unsigned32; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(ID); + pragma Unreferenced(BUFFER); + pragma Unreferenced(Size); + begin + + RESULT := RTEMS.SUCCESSFUL; + + end MESSAGE_QUEUE_SEND; + + procedure MESSAGE_QUEUE_URGENT ( + ID : in RTEMS.ID; + BUFFER : in RTEMS.ADDRESS; + Size : in RTEMS.Unsigned32; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(ID); + pragma Unreferenced(BUFFER); + pragma Unreferenced(Size); + begin + + RESULT := RTEMS.SUCCESSFUL; + + end MESSAGE_QUEUE_URGENT; + + procedure MESSAGE_QUEUE_BROADCAST ( + ID : in RTEMS.ID; + BUFFER : in RTEMS.ADDRESS; + Size : in RTEMS.Unsigned32; + COUNT : out RTEMS.UNSIGNED32; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(ID); + pragma Unreferenced(BUFFER); + pragma Unreferenced(Size); + begin + + COUNT := 0; + RESULT := RTEMS.SUCCESSFUL; + + end MESSAGE_QUEUE_BROADCAST; + + procedure MESSAGE_QUEUE_RECEIVE ( + ID : in RTEMS.ID; + BUFFER : in RTEMS.ADDRESS; + OPTION_SET : in RTEMS.OPTION; + TIMEOUT : in RTEMS.INTERVAL; + Size : out RTEMS.Unsigned32; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(ID); + pragma Unreferenced(BUFFER); + pragma Unreferenced(OPTION_SET); + pragma Unreferenced(TIMEOUT); + begin + + Size := 0; + RESULT := RTEMS.SUCCESSFUL; + + end MESSAGE_QUEUE_RECEIVE; + + procedure MESSAGE_QUEUE_FLUSH ( + ID : in RTEMS.ID; + COUNT : out RTEMS.UNSIGNED32; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(ID); + begin + + COUNT := 0; + RESULT := RTEMS.SUCCESSFUL; + + end MESSAGE_QUEUE_FLUSH; + +-- Event Manager + + procedure EVENT_SEND ( + ID : in RTEMS.ID; + EVENT_IN : in RTEMS.EVENT_SET; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(ID); + pragma Unreferenced(EVENT_IN); + begin + + RESULT := RTEMS.SUCCESSFUL; + + end EVENT_SEND; + + procedure EVENT_RECEIVE ( + EVENT_IN : in RTEMS.EVENT_SET; + OPTION_SET : in RTEMS.OPTION; + TICKS : in RTEMS.INTERVAL; + EVENT_OUT : out RTEMS.EVENT_SET; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(EVENT_IN); + pragma Unreferenced(OPTION_SET); + pragma Unreferenced(TICKS); + begin + + EVENT_OUT := 0; + RESULT := RTEMS.SUCCESSFUL; + + end EVENT_RECEIVE; + +-- Signal Manager + + procedure SIGNAL_CATCH ( + ASR_HANDLER : in RTEMS.ASR_HANDLER; + MODE_SET : in RTEMS.MODE; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(ASR_HANDLER); + pragma Unreferenced(MODE_SET); + begin + + RESULT := RTEMS.SUCCESSFUL; + + end SIGNAL_CATCH; + + procedure SIGNAL_SEND ( + ID : in RTEMS.ID; + SIGNAL_SET : in RTEMS.SIGNAL_SET; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(ID); + pragma Unreferenced(SIGNAL_SET); + begin + + RESULT := RTEMS.SUCCESSFUL; + + end SIGNAL_SEND; + +-- Partition Manager + + procedure PARTITION_CREATE ( + NAME : in RTEMS.NAME; + STARTING_ADDRESS : in RTEMS.ADDRESS; + LENGTH : in RTEMS.UNSIGNED32; + BUFFER_SIZE : in RTEMS.UNSIGNED32; + ATTRIBUTE_SET : in RTEMS.ATTRIBUTE; + ID : out RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(NAME); + pragma Unreferenced(STARTING_ADDRESS); + pragma Unreferenced(LENGTH); + pragma Unreferenced(BUFFER_SIZE); + pragma Unreferenced(ATTRIBUTE_SET); + begin + + ID := 0; + RESULT := RTEMS.SUCCESSFUL; + + end PARTITION_CREATE; + + procedure PARTITION_IDENT ( + NAME : in RTEMS.NAME; + NODE : in RTEMS.UNSIGNED32; + ID : out RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(NAME); + pragma Unreferenced(NODE); + begin + + ID := 0; + RESULT := RTEMS.SUCCESSFUL; + + end PARTITION_IDENT; + + procedure PARTITION_DELETE ( + ID : in RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(ID); + begin + + RESULT := RTEMS.SUCCESSFUL; + + end PARTITION_DELETE; + + procedure PARTITION_GET_BUFFER ( + ID : in RTEMS.ID; + BUFFER : out RTEMS.ADDRESS; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(ID); + begin + + BUFFER := RTEMS.Null_Address; + RESULT := RTEMS.SUCCESSFUL; + + end PARTITION_GET_BUFFER; + + procedure PARTITION_RETURN_BUFFER ( + ID : in RTEMS.ID; + BUFFER : in RTEMS.ADDRESS; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(ID); + pragma Unreferenced(BUFFER); + begin + + RESULT := RTEMS.SUCCESSFUL; + + end PARTITION_RETURN_BUFFER; + +-- Region Manager + + procedure REGION_CREATE ( + NAME : in RTEMS.NAME; + STARTING_ADDRESS : in RTEMS.ADDRESS; + LENGTH : in RTEMS.UNSIGNED32; + PAGE_SIZE : in RTEMS.UNSIGNED32; + ATTRIBUTE_SET : in RTEMS.ATTRIBUTE; + ID : out RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(NAME); + pragma Unreferenced(STARTING_ADDRESS); + pragma Unreferenced(LENGTH); + pragma Unreferenced(PAGE_SIZE); + pragma Unreferenced(ATTRIBUTE_SET); + begin + + ID := 0; + RESULT := RTEMS.SUCCESSFUL; + + end REGION_CREATE; + + procedure REGION_IDENT ( + NAME : in RTEMS.NAME; + ID : out RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(NAME); + begin + + ID := 0; + RESULT := RTEMS.SUCCESSFUL; + + end REGION_IDENT; + + procedure REGION_DELETE ( + ID : in RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(ID); + begin + + RESULT := RTEMS.SUCCESSFUL; + + end REGION_DELETE; + + procedure REGION_GET_SEGMENT ( + ID : in RTEMS.ID; + SIZE : in RTEMS.UNSIGNED32; + OPTION_SET : in RTEMS.OPTION; + TIMEOUT : in RTEMS.INTERVAL; + SEGMENT : out RTEMS.ADDRESS; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(ID); + pragma Unreferenced(SIZE); + pragma Unreferenced(OPTION_SET); + pragma Unreferenced(TIMEOUT); + begin + + SEGMENT := RTEMS.Null_Address; + RESULT := RTEMS.SUCCESSFUL; + + end REGION_GET_SEGMENT; + + procedure REGION_RETURN_SEGMENT ( + ID : in RTEMS.ID; + SEGMENT : in RTEMS.ADDRESS; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(ID); + pragma Unreferenced(SEGMENT); + begin + + RESULT := RTEMS.SUCCESSFUL; + + end REGION_RETURN_SEGMENT; + +-- Dual Ported Memory Manager + + procedure PORT_CREATE ( + NAME : in RTEMS.NAME; + INTERNAL_START : in RTEMS.ADDRESS; + EXTERNAL_START : in RTEMS.ADDRESS; + LENGTH : in RTEMS.UNSIGNED32; + ID : out RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(NAME); + pragma Unreferenced(INTERNAL_START); + pragma Unreferenced(EXTERNAL_START); + pragma Unreferenced(LENGTH); + begin + + ID := 0; + RESULT := RTEMS.SUCCESSFUL; + + end PORT_CREATE; + + procedure PORT_IDENT ( + NAME : in RTEMS.NAME; + ID : out RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(NAME); + begin + + ID := 0; + RESULT := RTEMS.SUCCESSFUL; + + end PORT_IDENT; + + procedure PORT_DELETE ( + ID : in RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(ID); + begin + + RESULT := RTEMS.SUCCESSFUL; + + end PORT_DELETE; + + procedure PORT_EXTERNAL_TO_INTERNAL ( + ID : in RTEMS.ID; + EXTERNAL : in RTEMS.ADDRESS; + INTERNAL : out RTEMS.ADDRESS; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(ID); + pragma Unreferenced(EXTERNAL); + begin + + INTERNAL := RTEMS.Null_Address; + RESULT := RTEMS.SUCCESSFUL; + + end PORT_EXTERNAL_TO_INTERNAL; + + procedure PORT_INTERNAL_TO_EXTERNAL ( + ID : in RTEMS.ID; + INTERNAL : in RTEMS.ADDRESS; + EXTERNAL : out RTEMS.ADDRESS; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(ID); + pragma Unreferenced(INTERNAL); + begin + + EXTERNAL := RTEMS.Null_Address; + RESULT := RTEMS.SUCCESSFUL; + + end PORT_INTERNAL_TO_EXTERNAL; + +-- Fatal Error Manager + + procedure FATAL_ERROR_OCCURRED ( + THE_ERROR : in RTEMS.UNSIGNED32 + ) is + pragma Unreferenced(THE_ERROR); + begin + + NULL; + + end FATAL_ERROR_OCCURRED; + +-- Rate Monotonic Manager + + procedure RATE_MONOTONIC_CREATE ( + NAME : in RTEMS.NAME; + ID : out RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(NAME); + begin + + ID := 0; + RESULT := RTEMS.SUCCESSFUL; + + end RATE_MONOTONIC_CREATE; + + procedure RATE_MONOTONIC_IDENT ( + NAME : in RTEMS.NAME; + ID : out RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(NAME); + begin + + ID := 0; + RESULT := RTEMS.SUCCESSFUL; + + end RATE_MONOTONIC_IDENT; + + procedure RATE_MONOTONIC_DELETE ( + ID : in RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(ID); + begin + + RESULT := RTEMS.SUCCESSFUL; + + end RATE_MONOTONIC_DELETE; + + procedure RATE_MONOTONIC_CANCEL ( + ID : in RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(ID); + begin + + RESULT := RTEMS.SUCCESSFUL; + + end RATE_MONOTONIC_CANCEL; + + procedure RATE_MONOTONIC_PERIOD ( + ID : in RTEMS.ID; + LENGTH : in RTEMS.INTERVAL; + RESULT : out RTEMS.STATUS_CODES + ) is + pragma Unreferenced(ID); + pragma Unreferenced(LENGTH); + begin + + RESULT := RTEMS.SUCCESSFUL; + + end RATE_MONOTONIC_PERIOD; + +-- Multiprocessing Manager + + procedure MULTIPROCESSING_ANNOUNCE + is + begin + + NULL; + + end MULTIPROCESSING_ANNOUNCE; + +end DUMMY_RTEMS; diff --git a/testsuites/ada/tmtests/tmoverhd/dummy_rtems.ads b/testsuites/ada/tmtests/tmoverhd/dummy_rtems.ads new file mode 100644 index 0000000000..ea4f129893 --- /dev/null +++ b/testsuites/ada/tmtests/tmoverhd/dummy_rtems.ads @@ -0,0 +1,445 @@ +-- +-- DUMMY_RTEMS / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package contains specifications for stub routines +-- which are used to time the invocation overhead incurred +-- with an Ada application program invokes each RTEMS directive. +-- +-- DEPENDENCIES: +-- +-- +-- +-- 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. +-- + +with RTEMS; +with RTEMS.CLOCK; +with RTEMS.TASKS; +with RTEMS.TIMER; + +package DUMMY_RTEMS is + +-- Task Manager + + procedure TASK_CREATE ( + NAME : in RTEMS.NAME; + INITIAL_PRIORITY : in RTEMS.TASKS.PRIORITY; + STACK_SIZE : in RTEMS.UNSIGNED32; + INITIAL_MODES : in RTEMS.MODE; + ATTRIBUTE_SET : in RTEMS.ATTRIBUTE; + ID : out RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure TASK_IDENT ( + NAME : in RTEMS.NAME; + NODE : in RTEMS.UNSIGNED32; + ID : out RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure TASK_START ( + ID : in RTEMS.ID; + ENTRY_POINT : in RTEMS.TASKS.ENTRY_POINT; + ARGUMENT : in RTEMS.UNSIGNED32; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure TASK_RESTART ( + ID : in RTEMS.ID; + ARGUMENT : in RTEMS.UNSIGNED32; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure TASK_DELETE ( + ID : in RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure TASK_SUSPEND ( + ID : in RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure TASK_RESUME ( + ID : in RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure TASK_SET_PRIORITY ( + ID : in RTEMS.ID; + NEW_PRIORITY : in RTEMS.TASKS.PRIORITY; + OLD_PRIORITY : out RTEMS.TASKS.PRIORITY; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure TASK_MODE ( + MODE_SET : in RTEMS.MODE; + MASK : in RTEMS.MODE; + PREVIOUS_MODE_SET : out RTEMS.MODE; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure TASK_WAKE_WHEN ( + TIME_BUFFER : in RTEMS.TIME_OF_DAY; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure TASK_WAKE_AFTER ( + TICKS : in RTEMS.INTERVAL; + RESULT : out RTEMS.STATUS_CODES + ); + +-- Interrupt Manager + +-- procedure INTERRUPT_CATCH ( +-- NEW_ISR_HANDLER : in RTEMS.ADDRESS; +-- VECTOR : in RTEMS.VECTOR_NUMBER; +-- OLD_ISR_HANDLER : out RTEMS.ADDRESS; +-- RESULT : out RTEMS.STATUS_CODES +-- ); + +-- Clock Manager + + procedure CLOCK_GET_TOD ( + TIME_BUFFER : out RTEMS.TIME_OF_DAY; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure CLOCK_SET ( + TIME_BUFFER : in RTEMS.TIME_OF_DAY; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure CLOCK_TICK ( + RESULT : out RTEMS.STATUS_CODES + ); + +-- Timer Manager + + procedure TIMER_CREATE ( + NAME : in RTEMS.NAME; + ID : out RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure TIMER_DELETE ( + ID : in RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure TIMER_IDENT ( + NAME : in RTEMS.NAME; + ID : out RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure TIMER_FIRE_AFTER ( + ID : in RTEMS.ID; + TICKS : in RTEMS.INTERVAL; + ROUTINE : in RTEMS.TIMER.SERVICE_ROUTINE; + USER_DATA : in RTEMS.ADDRESS; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure TIMER_FIRE_WHEN ( + ID : in RTEMS.ID; + WALL_TIME : in RTEMS.TIME_OF_DAY; + ROUTINE : in RTEMS.TIMER.SERVICE_ROUTINE; + USER_DATA : in RTEMS.ADDRESS; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure TIMER_RESET ( + ID : in RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure TIMER_CANCEL ( + ID : in RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ); + +-- Semaphore Manager + + procedure SEMAPHORE_CREATE ( + NAME : in RTEMS.NAME; + COUNT : in RTEMS.UNSIGNED32; + ATTRIBUTE_SET : in RTEMS.ATTRIBUTE; + PRIORITY_CEILING : in RTEMS.TASKS.PRIORITY; + ID : out RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure SEMAPHORE_DELETE ( + ID : in RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure SEMAPHORE_IDENT ( + NAME : in RTEMS.NAME; + NODE : in RTEMS.UNSIGNED32; + ID : out RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure SEMAPHORE_OBTAIN ( + ID : in RTEMS.ID; + OPTION_SET : in RTEMS.OPTION; + TIMEOUT : in RTEMS.INTERVAL; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure SEMAPHORE_RELEASE ( + ID : in RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ); + +-- Message Queue Manager + + procedure MESSAGE_QUEUE_CREATE ( + Name : in RTEMS.Name; + Count : in RTEMS.Unsigned32; + Max_Message_Size : in RTEMS.Unsigned32; + Attribute_Set : in RTEMS.Attribute; + ID : out RTEMS.ID; + Result : out RTEMS.Status_Codes + ); + + procedure MESSAGE_QUEUE_IDENT ( + NAME : in RTEMS.NAME; + NODE : in RTEMS.UNSIGNED32; + ID : out RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure MESSAGE_QUEUE_DELETE ( + ID : in RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure MESSAGE_QUEUE_SEND ( + ID : in RTEMS.ID; + BUFFER : in RTEMS.ADDRESS; + SIZE : in RTEMS.UNSIGNED32; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure MESSAGE_QUEUE_URGENT ( + ID : in RTEMS.ID; + BUFFER : in RTEMS.ADDRESS; + SIZE : in RTEMS.UNSIGNED32; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure MESSAGE_QUEUE_BROADCAST ( + ID : in RTEMS.ID; + BUFFER : in RTEMS.ADDRESS; + SIZE : in RTEMS.UNSIGNED32; + COUNT : out RTEMS.UNSIGNED32; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure MESSAGE_QUEUE_RECEIVE ( + ID : in RTEMS.ID; + BUFFER : in RTEMS.ADDRESS; + OPTION_SET : in RTEMS.OPTION; + TIMEOUT : in RTEMS.INTERVAL; + SIZE : out RTEMS.UNSIGNED32; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure MESSAGE_QUEUE_FLUSH ( + ID : in RTEMS.ID; + COUNT : out RTEMS.UNSIGNED32; + RESULT : out RTEMS.STATUS_CODES + ); + +-- Event Manager + + procedure EVENT_SEND ( + ID : in RTEMS.ID; + EVENT_IN : in RTEMS.EVENT_SET; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure EVENT_RECEIVE ( + EVENT_IN : in RTEMS.EVENT_SET; + OPTION_SET : in RTEMS.OPTION; + TICKS : in RTEMS.INTERVAL; + EVENT_OUT : out RTEMS.EVENT_SET; + RESULT : out RTEMS.STATUS_CODES + ); + +-- Signal Manager + + procedure SIGNAL_CATCH ( + ASR_HANDLER : in RTEMS.ASR_HANDLER; + MODE_SET : in RTEMS.MODE; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure SIGNAL_SEND ( + ID : in RTEMS.ID; + SIGNAL_SET : in RTEMS.SIGNAL_SET; + RESULT : out RTEMS.STATUS_CODES + ); + +-- Partition Manager + + procedure PARTITION_CREATE ( + NAME : in RTEMS.NAME; + STARTING_ADDRESS : in RTEMS.ADDRESS; + LENGTH : in RTEMS.UNSIGNED32; + BUFFER_SIZE : in RTEMS.UNSIGNED32; + ATTRIBUTE_SET : in RTEMS.ATTRIBUTE; + ID : out RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure PARTITION_IDENT ( + NAME : in RTEMS.NAME; + NODE : in RTEMS.UNSIGNED32; + ID : out RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure PARTITION_DELETE ( + ID : in RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure PARTITION_GET_BUFFER ( + ID : in RTEMS.ID; + BUFFER : out RTEMS.ADDRESS; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure PARTITION_RETURN_BUFFER ( + ID : in RTEMS.ID; + BUFFER : in RTEMS.ADDRESS; + RESULT : out RTEMS.STATUS_CODES + ); + +-- Region Manager + + procedure REGION_CREATE ( + NAME : in RTEMS.NAME; + STARTING_ADDRESS : in RTEMS.ADDRESS; + LENGTH : in RTEMS.UNSIGNED32; + PAGE_SIZE : in RTEMS.UNSIGNED32; + ATTRIBUTE_SET : in RTEMS.ATTRIBUTE; + ID : out RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure REGION_IDENT ( + NAME : in RTEMS.NAME; + ID : out RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure REGION_DELETE ( + ID : in RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure REGION_GET_SEGMENT ( + ID : in RTEMS.ID; + SIZE : in RTEMS.UNSIGNED32; + OPTION_SET : in RTEMS.OPTION; + TIMEOUT : in RTEMS.INTERVAL; + SEGMENT : out RTEMS.ADDRESS; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure REGION_RETURN_SEGMENT ( + ID : in RTEMS.ID; + SEGMENT : in RTEMS.ADDRESS; + RESULT : out RTEMS.STATUS_CODES + ); + +-- Dual Ported Memory Manager + + procedure PORT_CREATE ( + NAME : in RTEMS.NAME; + INTERNAL_START : in RTEMS.ADDRESS; + EXTERNAL_START : in RTEMS.ADDRESS; + LENGTH : in RTEMS.UNSIGNED32; + ID : out RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure PORT_IDENT ( + NAME : in RTEMS.NAME; + ID : out RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure PORT_DELETE ( + ID : in RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure PORT_EXTERNAL_TO_INTERNAL ( + ID : in RTEMS.ID; + EXTERNAL : in RTEMS.ADDRESS; + INTERNAL : out RTEMS.ADDRESS; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure PORT_INTERNAL_TO_EXTERNAL ( + ID : in RTEMS.ID; + INTERNAL : in RTEMS.ADDRESS; + EXTERNAL : out RTEMS.ADDRESS; + RESULT : out RTEMS.STATUS_CODES + ); + +-- Fatal Error Manager + + procedure FATAL_ERROR_OCCURRED ( + THE_ERROR : in RTEMS.UNSIGNED32 + ); + +-- Rate Monotonic Manager + + procedure RATE_MONOTONIC_CREATE ( + NAME : in RTEMS.NAME; + ID : out RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure RATE_MONOTONIC_IDENT ( + NAME : in RTEMS.NAME; + ID : out RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure RATE_MONOTONIC_DELETE ( + ID : in RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure RATE_MONOTONIC_CANCEL ( + ID : in RTEMS.ID; + RESULT : out RTEMS.STATUS_CODES + ); + + procedure RATE_MONOTONIC_PERIOD ( + ID : in RTEMS.ID; + LENGTH : in RTEMS.INTERVAL; + RESULT : out RTEMS.STATUS_CODES + ); + +-- Multiprocessing Manager + + procedure MULTIPROCESSING_ANNOUNCE; + +end DUMMY_RTEMS; diff --git a/testsuites/ada/tmtests/tmoverhd/tmoverhd.adb b/testsuites/ada/tmtests/tmoverhd/tmoverhd.adb new file mode 100644 index 0000000000..bfe6de4f88 --- /dev/null +++ b/testsuites/ada/tmtests/tmoverhd/tmoverhd.adb @@ -0,0 +1,55 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test TMOVERHD of the Timing Test Suite. +-- +-- DEPENDENCIES: +-- +-- +-- +-- COPYRIGHT (c) 1989-1997. +-- 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 TMTEST; +with TEST_SUPPORT; + +procedure TMOVERHD 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, + TMTEST.INIT'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF INIT" ); + + loop + delay 120.0; + end loop; + +end TMOVERHD; + diff --git a/testsuites/ada/tmtests/tmoverhd/tmtest.adb b/testsuites/ada/tmtests/tmoverhd/tmtest.adb new file mode 100644 index 0000000000..58c5ad09c6 --- /dev/null +++ b/testsuites/ada/tmtests/tmoverhd/tmtest.adb @@ -0,0 +1,1363 @@ +-- +-- TMTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of Calling Overhead Test of the RTEMS +-- Timing Test Suite. +-- +-- DEPENDENCIES: +-- +-- +-- +-- COPYRIGHT (c) 1989-2009. +-- 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 DUMMY_RTEMS; +with TEST_SUPPORT; +with TEXT_IO; +with TIME_TEST_SUPPORT; +with TIMER_DRIVER; + +package body TMTEST is + +--PAGE +-- +-- INIT +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + STATUS : RTEMS.STATUS_CODES; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** TIME TEST OVERHEAD ***" ); + + TIMER_DRIVER.SET_FIND_AVERAGE_OVERHEAD( TRUE ); + + TMTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME( 'T', 'A', '1', ' ' ); + + RTEMS.TASKS.CREATE( + TMTEST.TASK_NAME( 1 ), + 254, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + TMTEST.TASK_ID( 1 ), + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" ); + + RTEMS.TASKS.START( + TMTEST.TASK_ID( 1 ), + TMTEST.TASK_1'ACCESS, + 0, + STATUS + ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" ); + + RTEMS.TASKS.DELETE( RTEMS.SELF, STATUS ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" ); + + end INIT; + +--PAGE +-- +-- TIMER_HANDLER +-- + + procedure TIMER_HANDLER ( + IGNORED_ID : in RTEMS.ID; + IGNORED_ADDRESS : in RTEMS.ADDRESS + ) is + begin + + NULL; + + end TIMER_HANDLER; + +--PAGE +-- +-- ISR_HANDLER +-- + +-- procedure ISR_HANDLER ( +-- VECTOR : in RTEMS.VECTOR_NUMBER +-- ) is +-- begin +-- +-- NULL; +-- +-- end ISR_HANDLER; + +--PAGE +-- +-- ASR_HANDLER +-- + + procedure ASR_HANDLER ( + SIGNALS : in RTEMS.SIGNAL_SET + ) is + begin + + NULL; + + end ASR_HANDLER; + +--PAGE +-- +-- TASK_1 +-- + + procedure TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ) is + pragma Unreferenced(ARGUMENT); + NAME : RTEMS.NAME; + OVERHEAD : RTEMS.UNSIGNED32; + ID : RTEMS.ID; + IN_PRIORITY : RTEMS.TASKS.PRIORITY; + OUT_PRIORITY : RTEMS.TASKS.PRIORITY; + IN_MODE : RTEMS.MODE; + MASK : RTEMS.MODE; + OUT_MODE : RTEMS.MODE; + TIME : RTEMS.TIME_OF_DAY; + TIMEOUT : RTEMS.INTERVAL; + SIGNALS : RTEMS.SIGNAL_SET; + ADDRESS_1 : RTEMS.ADDRESS; + EVENTS : RTEMS.SIGNAL_SET; + BUFFER : TMTEST.BUFFER; + BUFFER_POINTER : RTEMS.ADDRESS; + MESSAGE_SIZE : RTEMS.UNSIGNED32; + COUNT : RTEMS.UNSIGNED32; + ERROR : RTEMS.UNSIGNED32; + STATUS : RTEMS.STATUS_CODES; + begin + + NAME := RTEMS.BUILD_NAME( 'N', 'A', 'M', 'E' ); + + BUFFER_POINTER := BUFFER'ADDRESS; + OVERHEAD := 0; + IN_PRIORITY := 0; + IN_MODE := 0; + MASK := 0; + SIGNALS := 0; + EVENTS := 0; + ERROR := 0; + +-- TASK_CREATE + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.TASK_CREATE( + NAME, + IN_PRIORITY, + 2048, + RTEMS.DEFAULT_MODES, + RTEMS.DEFAULT_ATTRIBUTES, + ID, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TASK_CREATE", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- TASK_IDENT + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.TASK_IDENT( + NAME, + RTEMS.SEARCH_ALL_NODES, + ID, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TASK_IDENT", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- TASK_START + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.TASK_START( ID, TMTEST.TASK_1'ACCESS, 0, STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TASK_START", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- TASK_RESTART + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.TASK_RESTART( ID, 0, STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TASK_RESTART", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- TASK_DELETE + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.TASK_DELETE( ID, STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TASK_DELETE", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- TASK_SUSPEND + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.TASK_SUSPEND( ID, STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TASK_SUSPEND", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- TASK_RESUME + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.TASK_RESUME( ID, STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TASK_RESUME", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- TASK_SET_PRIORITY + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.TASK_SET_PRIORITY( + ID, + IN_PRIORITY, + OUT_PRIORITY, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TASK_SET_PRIORITY", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- TASK_MODE + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.TASK_MODE( + IN_MODE, + MASK, + OUT_MODE, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TASK_MODE", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- TASK_WAKE_WHEN + + TIME.YEAR := 2000; + TIME.MONTH := 12; + TIME.DAY := 25; + TIME.HOUR := 6; + TIME.MINUTE := 1; + TIME.SECOND := 2; + TIME.TICKS := 0; + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.TASK_WAKE_WHEN( TIME, STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TASK_WAKE_WHEN", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- TASK_WAKE_AFTER + + TIMEOUT := 1; + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.TASK_WAKE_AFTER( TIMEOUT, STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TASK_WAKE_AFTER", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- INTERRUPT_CATCH + +-- TIMER_DRIVER.INITIALIZE; +-- for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT +-- loop +-- DUMMY_RTEMS.INTERRUPT_CATCH( +-- TMTEST.ISR_HANDLER'ADDRESS, +-- RTEMS.VECTOR_NUMBER'FIRST, +-- ADDRESS_1, +-- STATUS +-- ); +-- end loop; +-- TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; +-- +-- TIME_TEST_SUPPORT.PUT_TIME( +-- "INTERRUPT_CATCH", +-- TMTEST.END_TIME, +-- TIME_TEST_SUPPORT.OPERATION_COUNT, +-- OVERHEAD, +-- 0 +-- ); + +-- CLOCK_GET_TOD + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.CLOCK_GET_TOD( TIME, STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "CLOCK_GET", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- CLOCK_SET + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.CLOCK_SET( TIME, STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "CLOCK_SET", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- CLOCK_TICK + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.CLOCK_TICK( STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "CLOCK_TICK", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +TEST_SUPPORT.PAUSE; + +-- TIMER_CREATE + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.TIMER_CREATE( NAME, ID, STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TIMER_CREATE", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- TIMER_DELETE + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.TIMER_DELETE( ID, STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TIMER_DELETE", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- TIMER_IDENT + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.TIMER_IDENT( + NAME, + ID, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TIMER_IDENT", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- TIMER_FIRE_AFTER + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.TIMER_FIRE_AFTER( + ID, + TIMEOUT, + TMTEST.TIMER_HANDLER'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TIMER_FIRE_AFTER", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- TIMER_FIRE_WHEN + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.TIMER_FIRE_WHEN( + ID, + TIME, + TMTEST.TIMER_HANDLER'ACCESS, + RTEMS.NULL_ADDRESS, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TIMER_FIRE_WHEN", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- TIMER_RESET + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.TIMER_RESET( ID, STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TIMER_RESET", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- TIMER_CANCEL + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.TIMER_CANCEL( ID, STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "TIMER_CANCEL", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- SEMAPHORE_CREATE + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.SEMAPHORE_CREATE( + NAME, + 128, + RTEMS.DEFAULT_ATTRIBUTES, + RTEMS.TASKS.NO_PRIORITY, + ID, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "SEMAPHORE_CREATE", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- SEMAPHORE_DELETE + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.SEMAPHORE_DELETE( ID, STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "SEMAPHORE_DELETE", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- SEMAPHORE_IDENT + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.SEMAPHORE_IDENT( + NAME, + RTEMS.SEARCH_ALL_NODES, + ID, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "SEMAPHORE_IDENT", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- SEMAPHORE_OBTAIN + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.SEMAPHORE_OBTAIN( + ID, + RTEMS.DEFAULT_OPTIONS, + TIMEOUT, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "SEMAPHORE_OBTAIN", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- SEMAPHORE_RELEASE + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.SEMAPHORE_RELEASE( ID, STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "SEMAPHORE_RELEASE", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- MESSAGE_QUEUE_CREATE + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.MESSAGE_QUEUE_CREATE( + NAME, + 128, + 16, + RTEMS.DEFAULT_ATTRIBUTES, + ID, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "MESSAGE_QUEUE_CREATE", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- MESSAGE_QUEUE_IDENT + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.MESSAGE_QUEUE_IDENT( + NAME, + RTEMS.SEARCH_ALL_NODES, + ID, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "MESSAGE_QUEUE_IDENT", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- MESSAGE_QUEUE_DELETE + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.MESSAGE_QUEUE_DELETE( ID, STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "MESSAGE_QUEUE_DELETE", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- MESSAGE_QUEUE_SEND + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.MESSAGE_QUEUE_SEND( ID, BUFFER_POINTER, 16, STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "MESSAGE_QUEUE_SEND", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- MESSAGE_QUEUE_URGENT + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.MESSAGE_QUEUE_URGENT( ID, BUFFER_POINTER, 16, STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "MESSAGE_QUEUE_URGENT", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- MESSAGE_QUEUE_BROADCAST + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.MESSAGE_QUEUE_BROADCAST( + ID, + BUFFER_POINTER, + 16, + COUNT, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "MESSAGE_QUEUE_BROADCAST", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- MESSAGE_QUEUE_RECEIVE + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.MESSAGE_QUEUE_RECEIVE( + ID, + BUFFER_POINTER, + RTEMS.DEFAULT_OPTIONS, + TIMEOUT, + MESSAGE_SIZE, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "MESSAGE_QUEUE_RECEIVE", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- MESSAGE_QUEUE_FLUSH + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.MESSAGE_QUEUE_FLUSH( ID, COUNT, STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "MESSAGE_QUEUE_FLUSH", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +TEST_SUPPORT.PAUSE; + +-- EVENT_SEND + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.EVENT_SEND( ID, EVENTS, STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "EVENT_SEND", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- EVENT_RECEIVE + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.EVENT_RECEIVE( + RTEMS.EVENT_16, + EVENTS, + RTEMS.DEFAULT_OPTIONS, + TIMEOUT, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "EVENT_RECEIVE", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- SIGNAL_CATCH + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.SIGNAL_CATCH( + TMTEST.ASR_HANDLER'ACCESS, + RTEMS.DEFAULT_MODES, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "SIGNAL_CATCH", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- SIGNAL_SEND + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.SIGNAL_SEND( ID, SIGNALS, STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "SIGNAL_SEND", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- PARTITION_CREATE + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.PARTITION_CREATE( + NAME, + TMTEST.MEMORY_AREA'ADDRESS, + 2048, + 128, + RTEMS.DEFAULT_ATTRIBUTES, + ID, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "PARTITION_CREATE", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- PARTITION_IDENT + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.PARTITION_IDENT( + NAME, + RTEMS.SEARCH_ALL_NODES, + ID, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "PARTITION_IDENT", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- PARTITION_DELETE + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.PARTITION_DELETE( ID, STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "PARTITION_DELETE", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- PARTITION_GET_BUFFER + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.PARTITION_GET_BUFFER( ID, ADDRESS_1, STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "PARTITION_GET_BUFFER", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- PARTITION_RETURN_BUFFER + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.PARTITION_RETURN_BUFFER( ID, ADDRESS_1, STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "PARTITION_RETURN_BUFFER", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- REGION_CREATE + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.REGION_CREATE( + NAME, + TMTEST.MEMORY_AREA'ADDRESS, + 2048, + 128, + RTEMS.DEFAULT_ATTRIBUTES, + ID, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "REGION_CREATE", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- REGION_IDENT + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.REGION_IDENT( + NAME, + ID, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "REGION_IDENT", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- REGION_DELETE + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.REGION_DELETE( ID, STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "REGION_DELETE", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- REGION_GET_SEGMENT + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.REGION_GET_SEGMENT( + ID, + 243, + RTEMS.DEFAULT_OPTIONS, + TIMEOUT, + ADDRESS_1, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "REGION_GET_SEGMENT", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- REGION_RETURN_SEGMENT + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.REGION_RETURN_SEGMENT( ID, ADDRESS_1, STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "REGION_RETURN_SEGMENT", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- PORT_CREATE + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.PORT_CREATE( + NAME, + TMTEST.INTERNAL_PORT_AREA'ADDRESS, + TMTEST.EXTERNAL_PORT_AREA'ADDRESS, + TMTEST.INTERNAL_PORT_AREA'LENGTH, + ID, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "PORT_CREATE", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- PORT_IDENT + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.PORT_IDENT( NAME, ID, STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "PORT_IDENT", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- PORT_DELETE + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.PORT_DELETE( ID, STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "PORT_DELETE", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- PORT_EXTERNAL_TO_INTERNAL + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.PORT_EXTERNAL_TO_INTERNAL( + ID, + TMTEST.EXTERNAL_PORT_AREA( 7 )'ADDRESS, + ADDRESS_1, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "PORT_EXTERNAL_TO_INTERNAL", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- PORT_INTERNAL_TO_EXTERNAL + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.PORT_INTERNAL_TO_EXTERNAL( + ID, + TMTEST.INTERNAL_PORT_AREA( 7 )'ADDRESS, + ADDRESS_1, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "PORT_INTERNAL_TO_EXTERNAL", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +TEST_SUPPORT.PAUSE; + +-- FATAL_ERROR_OCCURRED + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.FATAL_ERROR_OCCURRED( ERROR ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "FATAL_ERROR_OCCURRED", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- RATE_MONOTONIC_CREATE + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.RATE_MONOTONIC_CREATE( NAME, ID, STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "RATE_MONOTONIC_CREATE", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- RATE_MONOTONIC_IDENT + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.RATE_MONOTONIC_IDENT( + NAME, + ID, + STATUS + ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "RATE_MONOTONIC_IDENT", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- RATE_MONOTONIC_DELETE + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.RATE_MONOTONIC_DELETE( ID, STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "RATE_MONOTONIC_DELETE", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- RATE_MONOTONIC_CANCEL + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.RATE_MONOTONIC_CANCEL( ID, STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "RATE_MONOTONIC_CANCEL", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- RATE_MONOTONIC_PERIOD + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.RATE_MONOTONIC_PERIOD( ID, TIMEOUT, STATUS ); + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "RATE_MONOTONIC_PERIOD", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + +-- MULTIPROCESSING_ANNOUNCE + + TIMER_DRIVER.INITIALIZE; + for INDEX in 1 .. TIME_TEST_SUPPORT.OPERATION_COUNT + loop + DUMMY_RTEMS.MULTIPROCESSING_ANNOUNCE; + end loop; + TMTEST.END_TIME := TIMER_DRIVER.READ_TIMER; + + TIME_TEST_SUPPORT.PUT_TIME( + "MULTIPROCESSING_ANNOUNCE", + TMTEST.END_TIME, + TIME_TEST_SUPPORT.OPERATION_COUNT, + OVERHEAD, + 0 + ); + + TEXT_IO.PUT_LINE( "*** END OF TIME TEST OVERHEAD ***" ); + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end TASK_1; + +end TMTEST; diff --git a/testsuites/ada/tmtests/tmoverhd/tmtest.ads b/testsuites/ada/tmtests/tmoverhd/tmtest.ads new file mode 100644 index 0000000000..48944077de --- /dev/null +++ b/testsuites/ada/tmtests/tmoverhd/tmtest.ads @@ -0,0 +1,156 @@ +-- +-- TMTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for Calling Overhead Test of the RTEMS +-- Timing Test Suite. +-- +-- DEPENDENCIES: +-- +-- +-- +-- COPYRIGHT (c) 1989-2009. +-- 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 TMTEST is + +-- +-- Buffer Record similar to that used by RTEMS 3.2.1. Using this +-- avoids changes to the test. +-- + + type BUFFER is + record + FIELD1 : RTEMS.UNSIGNED32; -- TEMPORARY UNTIL VARIABLE LENGTH + FIELD2 : RTEMS.UNSIGNED32; + FIELD3 : RTEMS.UNSIGNED32; + FIELD4 : RTEMS.UNSIGNED32; + end record; + +-- +-- These arrays contain the IDs and NAMEs of all RTEMS tasks created +-- by this test. +-- + + TASK_ID : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.ID; + TASK_NAME : array ( RTEMS.UNSIGNED32 range 1 .. 3 ) of RTEMS.NAME; + +-- +-- The following variable is set to the execution time returned +-- by the timer. +-- + + END_TIME : RTEMS.UNSIGNED32; + +-- +-- 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 as the +-- memory space for a partition and later for a region. +-- + + MEMORY_AREA : array ( RTEMS.UNSIGNED32 range 0 .. 255 ) of RTEMS.UNSIGNED8; + for MEMORY_AREA'ALIGNMENT use RTEMS.STRUCTURE_ALIGNMENT; + +-- +-- INIT +-- +-- DESCRIPTION: +-- +-- This RTEMS task initializes the application. +-- + + procedure INIT ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, INIT); + +-- +-- TIMER_HANDLER +-- +-- DESCRIPTION: +-- +-- This subprogram is a timer service routine. +-- + + procedure TIMER_HANDLER ( + IGNORED_ID : in RTEMS.ID; + IGNORED_ADDRESS : in RTEMS.ADDRESS + ); + pragma Convention (C, TIMER_HANDLER); + +-- +-- ISR_HANDLER +-- +-- DESCRIPTION: +-- +-- This subprogram is an interrupt service routine. +-- + +-- procedure ISR_HANDLER ( +-- VECTOR : in RTEMS.VECTOR_NUMBER +-- ); + +-- +-- ASR_HANDLER +-- +-- DESCRIPTION: +-- +-- This subprogram is an asynchronous signal routine. +-- + + procedure ASR_HANDLER ( + SIGNALS : in RTEMS.SIGNAL_SET + ); + pragma Convention (C, ASR_HANDLER); + +-- +-- TASK_1 +-- +-- DESCRIPTION: +-- +-- This RTEMS task is responsible for measuring and +-- reporting the calling overhead for all RTEMS +-- directives. +-- + + procedure TASK_1 ( + ARGUMENT : in RTEMS.TASKS.ARGUMENT + ); + pragma Convention (C, TASK_1); + +end TMTEST; diff --git a/testsuites/configure.ac b/testsuites/configure.ac index ab8aab8ea7..ae01a97079 100644 --- a/testsuites/configure.ac +++ b/testsuites/configure.ac @@ -22,6 +22,14 @@ RTEMS_PROG_CXX_FOR_TARGET RTEMS_CANONICALIZE_TOOLS AM_PROG_CC_C_O +AC_ARG_ENABLE([ada], +[AS_HELP_STRING(--enable-ada,enable Ada support)], +[case "${enable_ada}" in + yes) ;; + no) ;; + *) AC_MSG_ERROR(bad value ${enable_ada} for --enable-ada) ;; +esac],[enable_ada=no]) + RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP) RTEMS_CHECK_CPUOPTS([RTEMS_POSIX_API]) @@ -44,6 +52,9 @@ if test "$enable_tests" = "yes"; then if test "$rtems_cv_RTEMS_SMP" = "yes"; then AC_CONFIG_SUBDIRS(smptests) fi + if test "$enable_ada" = "yes"; then + AC_CONFIG_SUBDIRS(ada) + fi # Now do performance tests AC_CONFIG_SUBDIRS(tmtests psxtmtests benchmarks rhealstone) fi -- cgit v1.2.3