summaryrefslogtreecommitdiffstats
path: root/testsuites
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1995-05-11 17:39:37 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1995-05-11 17:39:37 +0000
commitac7d5ef06a6d6e8d84abbd1f0b82162725f98326 (patch)
tree9304cf759a73f2a1c6fd3191948f00e870af3787 /testsuites
downloadrtems-ac7d5ef06a6d6e8d84abbd1f0b82162725f98326.tar.bz2
Initial revision
Diffstat (limited to 'testsuites')
-rw-r--r--testsuites/README39
-rw-r--r--testsuites/libtests/README10
-rw-r--r--testsuites/libtests/stackchk/blow.c47
-rw-r--r--testsuites/libtests/stackchk/init.c89
-rw-r--r--testsuites/libtests/stackchk/stackchk.scn9
-rw-r--r--testsuites/libtests/stackchk/task1.c44
-rw-r--r--testsuites/mptests/README10
-rw-r--r--testsuites/mptests/mp01/init.c99
-rw-r--r--testsuites/mptests/mp01/node1/mp01.doc53
-rw-r--r--testsuites/mptests/mp01/node1/mp01.scn15
-rw-r--r--testsuites/mptests/mp01/node2/mp01.doc13
-rw-r--r--testsuites/mptests/mp01/node2/mp01.scn15
-rw-r--r--testsuites/mptests/mp01/system.h30
-rw-r--r--testsuites/mptests/mp01/task1.c84
-rw-r--r--testsuites/mptests/mp02/init.c63
-rw-r--r--testsuites/mptests/mp02/node1/mp02.doc47
-rw-r--r--testsuites/mptests/mp02/node1/mp02.scn14
-rw-r--r--testsuites/mptests/mp02/node2/mp02.doc13
-rw-r--r--testsuites/mptests/mp02/node2/mp02.scn14
-rw-r--r--testsuites/mptests/mp02/system.h30
-rw-r--r--testsuites/mptests/mp02/task1.c118
-rw-r--r--testsuites/mptests/mp03/delay.c31
-rw-r--r--testsuites/mptests/mp03/init.c68
-rw-r--r--testsuites/mptests/mp03/node1/mp03.doc45
-rw-r--r--testsuites/mptests/mp03/node1/mp03.scn24
-rw-r--r--testsuites/mptests/mp03/node2/mp03.doc13
-rw-r--r--testsuites/mptests/mp03/node2/mp03.scn24
-rw-r--r--testsuites/mptests/mp03/system.h30
-rw-r--r--testsuites/mptests/mp03/task1.c155
-rw-r--r--testsuites/mptests/mp04/init.c63
-rw-r--r--testsuites/mptests/mp04/node1/mp04.doc41
-rw-r--r--testsuites/mptests/mp04/node1/mp04.scn8
-rw-r--r--testsuites/mptests/mp04/node2/mp04.doc13
-rw-r--r--testsuites/mptests/mp04/node2/mp04.scn8
-rw-r--r--testsuites/mptests/mp04/system.h30
-rw-r--r--testsuites/mptests/mp04/task1.c83
-rw-r--r--testsuites/mptests/mp05/asr.c37
-rw-r--r--testsuites/mptests/mp05/init.c68
-rw-r--r--testsuites/mptests/mp05/node1/mp05.doc45
-rw-r--r--testsuites/mptests/mp05/node1/mp05.scn11
-rw-r--r--testsuites/mptests/mp05/node2/mp05.doc13
-rw-r--r--testsuites/mptests/mp05/node2/mp05.scn10
-rw-r--r--testsuites/mptests/mp05/system.h30
-rw-r--r--testsuites/mptests/mp05/task1.c106
-rw-r--r--testsuites/mptests/mp06/init.c68
-rw-r--r--testsuites/mptests/mp06/node1/mp06.doc45
-rw-r--r--testsuites/mptests/mp06/node1/mp06.scn11
-rw-r--r--testsuites/mptests/mp06/node2/mp06.doc13
-rw-r--r--testsuites/mptests/mp06/node2/mp06.scn12
-rw-r--r--testsuites/mptests/mp06/system.h31
-rw-r--r--testsuites/mptests/mp06/task1.c176
-rw-r--r--testsuites/mptests/mp07/init.c68
-rw-r--r--testsuites/mptests/mp07/node1/mp07.doc46
-rw-r--r--testsuites/mptests/mp07/node1/mp07.scn10
-rw-r--r--testsuites/mptests/mp07/node2/mp07.doc13
-rw-r--r--testsuites/mptests/mp07/node2/mp07.scn9
-rw-r--r--testsuites/mptests/mp07/system.h28
-rw-r--r--testsuites/mptests/mp07/task1.c95
-rw-r--r--testsuites/mptests/mp08/init.c76
-rw-r--r--testsuites/mptests/mp08/node1/mp08.doc52
-rw-r--r--testsuites/mptests/mp08/node1/mp08.scn11
-rw-r--r--testsuites/mptests/mp08/node2/mp08.doc13
-rw-r--r--testsuites/mptests/mp08/node2/mp08.scn12
-rw-r--r--testsuites/mptests/mp08/system.h30
-rw-r--r--testsuites/mptests/mp08/task1.c89
-rw-r--r--testsuites/mptests/mp09/init.c76
-rw-r--r--testsuites/mptests/mp09/node1/mp09.doc50
-rw-r--r--testsuites/mptests/mp09/node1/mp09.scn21
-rw-r--r--testsuites/mptests/mp09/node2/mp09.doc13
-rw-r--r--testsuites/mptests/mp09/node2/mp09.scn27
-rw-r--r--testsuites/mptests/mp09/recvmsg.c45
-rw-r--r--testsuites/mptests/mp09/sendmsg.c59
-rw-r--r--testsuites/mptests/mp09/system.h30
-rw-r--r--testsuites/mptests/mp09/task1.c107
-rw-r--r--testsuites/mptests/mp10/init.c144
-rw-r--r--testsuites/mptests/mp10/node1/mp10.doc46
-rw-r--r--testsuites/mptests/mp10/node1/mp10.scn4
-rw-r--r--testsuites/mptests/mp10/node2/mp10.doc13
-rw-r--r--testsuites/mptests/mp10/node2/mp10.scn19
-rw-r--r--testsuites/mptests/mp10/system.h30
-rw-r--r--testsuites/mptests/mp10/task1.c50
-rw-r--r--testsuites/mptests/mp10/task2.c47
-rw-r--r--testsuites/mptests/mp10/task3.c50
-rw-r--r--testsuites/mptests/mp11/init.c106
-rw-r--r--testsuites/mptests/mp11/node1/mp11.doc42
-rw-r--r--testsuites/mptests/mp11/node1/mp11.scn10
-rw-r--r--testsuites/mptests/mp11/node2/mp11.doc13
-rw-r--r--testsuites/mptests/mp11/node2/mp11.scn2
-rw-r--r--testsuites/mptests/mp11/system.h30
-rw-r--r--testsuites/mptests/mp12/init.c116
-rw-r--r--testsuites/mptests/mp12/node1/mp12.doc52
-rw-r--r--testsuites/mptests/mp12/node1/mp12.scn6
-rw-r--r--testsuites/mptests/mp12/node2/mp12.doc13
-rw-r--r--testsuites/mptests/mp12/node2/mp12.scn10
-rw-r--r--testsuites/mptests/mp12/system.h30
-rw-r--r--testsuites/mptests/mp13/init.c116
-rw-r--r--testsuites/mptests/mp13/node1/mp13.doc48
-rw-r--r--testsuites/mptests/mp13/node1/mp13.scn14
-rw-r--r--testsuites/mptests/mp13/node2/mp13.doc13
-rw-r--r--testsuites/mptests/mp13/node2/mp13.scn16
-rw-r--r--testsuites/mptests/mp13/system.h30
-rw-r--r--testsuites/mptests/mp13/task1.c70
-rw-r--r--testsuites/mptests/mp13/task2.c106
-rw-r--r--testsuites/mptests/mp14/delay.c34
-rw-r--r--testsuites/mptests/mp14/evtask1.c86
-rw-r--r--testsuites/mptests/mp14/evtmtask.c65
-rw-r--r--testsuites/mptests/mp14/exit.c33
-rw-r--r--testsuites/mptests/mp14/init.c194
-rw-r--r--testsuites/mptests/mp14/msgtask1.c102
-rw-r--r--testsuites/mptests/mp14/node1/mp14.doc50
-rw-r--r--testsuites/mptests/mp14/node1/mp14.scn38
-rw-r--r--testsuites/mptests/mp14/node2/mp14.doc13
-rw-r--r--testsuites/mptests/mp14/node2/mp14.scn35
-rw-r--r--testsuites/mptests/mp14/pttask1.c65
-rw-r--r--testsuites/mptests/mp14/smtask1.c70
-rw-r--r--testsuites/mptests/mp14/system.h31
-rw-r--r--testsuites/samples/README71
-rw-r--r--testsuites/samples/base_mp/apptask.c38
-rw-r--r--testsuites/samples/base_mp/init.c46
-rw-r--r--testsuites/samples/base_mp/node1/base_mp.doc13
-rw-r--r--testsuites/samples/base_mp/node1/base_mp.scn5
-rw-r--r--testsuites/samples/base_mp/node2/base_mp.doc13
-rw-r--r--testsuites/samples/base_mp/node2/base_mp.scn5
-rw-r--r--testsuites/samples/base_mp/system.h31
-rw-r--r--testsuites/samples/base_sp/apptask.c39
-rw-r--r--testsuites/samples/base_sp/base_sp.doc13
-rw-r--r--testsuites/samples/base_sp/base_sp.scn5
-rw-r--r--testsuites/samples/base_sp/init.c51
-rw-r--r--testsuites/samples/base_sp/system.h30
-rw-r--r--testsuites/samples/cdtest/cdtest.scn31
-rw-r--r--testsuites/samples/cdtest/init.c30
-rw-r--r--testsuites/samples/cdtest/main.cc146
-rw-r--r--testsuites/samples/cdtest/system.h30
-rw-r--r--testsuites/samples/hello/hello.doc13
-rw-r--r--testsuites/samples/hello/hello.scn3
-rw-r--r--testsuites/samples/hello/init.c41
-rw-r--r--testsuites/samples/hello/system.h30
-rw-r--r--testsuites/samples/paranoia/init.c43
-rw-r--r--testsuites/samples/paranoia/paranoia.c2300
-rw-r--r--testsuites/samples/paranoia/paranoia.doc13
-rw-r--r--testsuites/samples/paranoia/system.h30
-rw-r--r--testsuites/samples/ticker/init.c58
-rw-r--r--testsuites/samples/ticker/system.h30
-rw-r--r--testsuites/samples/ticker/tasks.c44
-rw-r--r--testsuites/samples/ticker/ticker.doc13
-rw-r--r--testsuites/samples/ticker/ticker.scn16
-rw-r--r--testsuites/sptests/README9
-rw-r--r--testsuites/sptests/sp01/init.c89
-rw-r--r--testsuites/sptests/sp01/sp01.doc43
-rw-r--r--testsuites/sptests/sp01/sp01.scn18
-rw-r--r--testsuites/sptests/sp01/system.h30
-rw-r--r--testsuites/sptests/sp01/task1.c50
-rw-r--r--testsuites/sptests/sp02/init.c155
-rw-r--r--testsuites/sptests/sp02/preempt.c32
-rw-r--r--testsuites/sptests/sp02/sp02.doc37
-rw-r--r--testsuites/sptests/sp02/sp02.scn15
-rw-r--r--testsuites/sptests/sp02/system.h31
-rw-r--r--testsuites/sptests/sp02/task1.c66
-rw-r--r--testsuites/sptests/sp02/task2.c34
-rw-r--r--testsuites/sptests/sp02/task3.c37
-rw-r--r--testsuites/sptests/sp03/init.c70
-rw-r--r--testsuites/sptests/sp03/sp03.doc24
-rw-r--r--testsuites/sptests/sp03/sp03.scn26
-rw-r--r--testsuites/sptests/sp03/system.h30
-rw-r--r--testsuites/sptests/sp03/task1.c59
-rw-r--r--testsuites/sptests/sp03/task2.c46
-rw-r--r--testsuites/sptests/sp04/init.c113
-rw-r--r--testsuites/sptests/sp04/sp04.doc38
-rw-r--r--testsuites/sptests/sp04/sp04.scn24
-rw-r--r--testsuites/sptests/sp04/system.h30
-rw-r--r--testsuites/sptests/sp04/task1.c104
-rw-r--r--testsuites/sptests/sp04/task2.c29
-rw-r--r--testsuites/sptests/sp04/task3.c29
-rw-r--r--testsuites/sptests/sp04/tswitch.c59
-rw-r--r--testsuites/sptests/sp05/init.c84
-rw-r--r--testsuites/sptests/sp05/sp05.doc26
-rw-r--r--testsuites/sptests/sp05/sp05.scn47
-rw-r--r--testsuites/sptests/sp05/system.h30
-rw-r--r--testsuites/sptests/sp05/task1.c78
-rw-r--r--testsuites/sptests/sp05/task2.c39
-rw-r--r--testsuites/sptests/sp05/task3.c39
-rw-r--r--testsuites/sptests/sp06/init.c90
-rw-r--r--testsuites/sptests/sp06/sp06.doc26
-rw-r--r--testsuites/sptests/sp06/sp06.scn40
-rw-r--r--testsuites/sptests/sp06/system.h30
-rw-r--r--testsuites/sptests/sp06/task1.c61
-rw-r--r--testsuites/sptests/sp06/task2.c40
-rw-r--r--testsuites/sptests/sp06/task3.c32
-rw-r--r--testsuites/sptests/sp07/init.c131
-rw-r--r--testsuites/sptests/sp07/sp07.doc37
-rw-r--r--testsuites/sptests/sp07/sp07.scn33
-rw-r--r--testsuites/sptests/sp07/system.h35
-rw-r--r--testsuites/sptests/sp07/task1.c85
-rw-r--r--testsuites/sptests/sp07/task2.c78
-rw-r--r--testsuites/sptests/sp07/task3.c34
-rw-r--r--testsuites/sptests/sp07/task4.c30
-rw-r--r--testsuites/sptests/sp07/taskexit.c33
-rw-r--r--testsuites/sptests/sp07/tcreate.c34
-rw-r--r--testsuites/sptests/sp07/tdelete.c37
-rw-r--r--testsuites/sptests/sp07/trestart.c34
-rw-r--r--testsuites/sptests/sp07/tstart.c34
-rw-r--r--testsuites/sptests/sp08/init.c56
-rw-r--r--testsuites/sptests/sp08/sp08.doc26
-rw-r--r--testsuites/sptests/sp08/sp08.scn22
-rw-r--r--testsuites/sptests/sp08/system.h33
-rw-r--r--testsuites/sptests/sp08/task1.c256
-rw-r--r--testsuites/sptests/sp09/delay.c28
-rw-r--r--testsuites/sptests/sp09/init.c123
-rw-r--r--testsuites/sptests/sp09/isr.c27
-rw-r--r--testsuites/sptests/sp09/screen01.c168
-rw-r--r--testsuites/sptests/sp09/screen02.c192
-rw-r--r--testsuites/sptests/sp09/screen03.c204
-rw-r--r--testsuites/sptests/sp09/screen04.c85
-rw-r--r--testsuites/sptests/sp09/screen05.c148
-rw-r--r--testsuites/sptests/sp09/screen06.c125
-rw-r--r--testsuites/sptests/sp09/screen07.c184
-rw-r--r--testsuites/sptests/sp09/screen08.c121
-rw-r--r--testsuites/sptests/sp09/screen09.c140
-rw-r--r--testsuites/sptests/sp09/screen10.c164
-rw-r--r--testsuites/sptests/sp09/screen11.c250
-rw-r--r--testsuites/sptests/sp09/screen12.c327
-rw-r--r--testsuites/sptests/sp09/screen13.c115
-rw-r--r--testsuites/sptests/sp09/screen14.c162
-rw-r--r--testsuites/sptests/sp09/sp09.doc36
-rw-r--r--testsuites/sptests/sp09/sp09.scn249
-rw-r--r--testsuites/sptests/sp09/system.h30
-rw-r--r--testsuites/sptests/sp09/task1.c74
-rw-r--r--testsuites/sptests/sp09/task2.c48
-rw-r--r--testsuites/sptests/sp09/task3.c51
-rw-r--r--testsuites/sptests/sp09/task4.c50
-rw-r--r--testsuites/sptests/sp11/init.c95
-rw-r--r--testsuites/sptests/sp11/sp11.doc26
-rw-r--r--testsuites/sptests/sp11/sp11.scn74
-rw-r--r--testsuites/sptests/sp11/system.h30
-rw-r--r--testsuites/sptests/sp11/task1.c410
-rw-r--r--testsuites/sptests/sp11/task2.c126
-rw-r--r--testsuites/sptests/sp11/timer.c97
-rw-r--r--testsuites/sptests/sp12/init.c176
-rw-r--r--testsuites/sptests/sp12/pridrv.c131
-rw-r--r--testsuites/sptests/sp12/pritask.c91
-rw-r--r--testsuites/sptests/sp12/sp12.doc27
-rw-r--r--testsuites/sptests/sp12/sp12.scn78
-rw-r--r--testsuites/sptests/sp12/system.h30
-rw-r--r--testsuites/sptests/sp12/task1.c153
-rw-r--r--testsuites/sptests/sp12/task2.c65
-rw-r--r--testsuites/sptests/sp12/task3.c50
-rw-r--r--testsuites/sptests/sp12/task4.c37
-rw-r--r--testsuites/sptests/sp12/task5.c55
-rw-r--r--testsuites/sptests/sp13/fillbuff.c31
-rw-r--r--testsuites/sptests/sp13/init.c112
-rw-r--r--testsuites/sptests/sp13/putbuff.c31
-rw-r--r--testsuites/sptests/sp13/sp13.doc25
-rw-r--r--testsuites/sptests/sp13/sp13.scn66
-rw-r--r--testsuites/sptests/sp13/system.h30
-rw-r--r--testsuites/sptests/sp13/task1.c213
-rw-r--r--testsuites/sptests/sp13/task2.c132
-rw-r--r--testsuites/sptests/sp13/task3.c74
-rw-r--r--testsuites/sptests/sp14/asr.c47
-rw-r--r--testsuites/sptests/sp14/init.c75
-rw-r--r--testsuites/sptests/sp14/sp14.doc24
-rw-r--r--testsuites/sptests/sp14/sp14.scn33
-rw-r--r--testsuites/sptests/sp14/system.h30
-rw-r--r--testsuites/sptests/sp14/task1.c116
-rw-r--r--testsuites/sptests/sp14/task2.c48
-rw-r--r--testsuites/sptests/sp15/init.c81
-rw-r--r--testsuites/sptests/sp15/sp15.doc24
-rw-r--r--testsuites/sptests/sp15/sp15.scn16
-rw-r--r--testsuites/sptests/sp15/system.h30
-rw-r--r--testsuites/sptests/sp15/task1.c129
-rw-r--r--testsuites/sptests/sp16/init.c131
-rw-r--r--testsuites/sptests/sp16/sp16.doc24
-rw-r--r--testsuites/sptests/sp16/sp16.scn58
-rw-r--r--testsuites/sptests/sp16/system.h32
-rw-r--r--testsuites/sptests/sp16/task1.c282
-rw-r--r--testsuites/sptests/sp16/task2.c86
-rw-r--r--testsuites/sptests/sp16/task3.c57
-rw-r--r--testsuites/sptests/sp16/task4.c60
-rw-r--r--testsuites/sptests/sp16/task5.c73
-rw-r--r--testsuites/sptests/sp17/asr.c32
-rw-r--r--testsuites/sptests/sp17/init.c72
-rw-r--r--testsuites/sptests/sp17/sp17.doc35
-rw-r--r--testsuites/sptests/sp17/sp17.scn8
-rw-r--r--testsuites/sptests/sp17/system.h30
-rw-r--r--testsuites/sptests/sp17/task1.c48
-rw-r--r--testsuites/sptests/sp17/task2.c45
-rw-r--r--testsuites/sptests/sp19/first.c66
-rw-r--r--testsuites/sptests/sp19/fptask.c98
-rw-r--r--testsuites/sptests/sp19/fptest.h165
-rw-r--r--testsuites/sptests/sp19/init.c153
-rw-r--r--testsuites/sptests/sp19/inttest.h149
-rw-r--r--testsuites/sptests/sp19/sp19.doc23
-rw-r--r--testsuites/sptests/sp19/sp19.scn55
-rw-r--r--testsuites/sptests/sp19/system.h30
-rw-r--r--testsuites/sptests/sp19/task1.c59
-rw-r--r--testsuites/sptests/sp20/getall.c43
-rw-r--r--testsuites/sptests/sp20/init.c71
-rw-r--r--testsuites/sptests/sp20/sp20.doc24
-rw-r--r--testsuites/sptests/sp20/sp20.scn27
-rw-r--r--testsuites/sptests/sp20/system.h34
-rw-r--r--testsuites/sptests/sp20/task1.c116
-rw-r--r--testsuites/sptests/sp21/init.c56
-rw-r--r--testsuites/sptests/sp21/sp21.doc28
-rw-r--r--testsuites/sptests/sp21/sp21.scn19
-rw-r--r--testsuites/sptests/sp21/system.h30
-rw-r--r--testsuites/sptests/sp21/task1.c106
-rw-r--r--testsuites/sptests/sp22/delay.c32
-rw-r--r--testsuites/sptests/sp22/init.c69
-rw-r--r--testsuites/sptests/sp22/prtime.c32
-rw-r--r--testsuites/sptests/sp22/sp22.doc20
-rw-r--r--testsuites/sptests/sp22/sp22.scn29
-rw-r--r--testsuites/sptests/sp22/system.h30
-rw-r--r--testsuites/sptests/sp22/task1.c164
-rw-r--r--testsuites/sptests/sp23/init.c72
-rw-r--r--testsuites/sptests/sp23/sp23.doc26
-rw-r--r--testsuites/sptests/sp23/sp23.scn9
-rw-r--r--testsuites/sptests/sp23/system.h30
-rw-r--r--testsuites/sptests/sp23/task1.c96
-rw-r--r--testsuites/sptests/sp24/init.c79
-rw-r--r--testsuites/sptests/sp24/resume.c34
-rw-r--r--testsuites/sptests/sp24/sp24.doc51
-rw-r--r--testsuites/sptests/sp24/sp24.scn16
-rw-r--r--testsuites/sptests/sp24/system.h30
-rw-r--r--testsuites/sptests/sp24/task1.c58
-rw-r--r--testsuites/sptests/sp25/init.c69
-rw-r--r--testsuites/sptests/sp25/sp25.doc32
-rw-r--r--testsuites/sptests/sp25/sp25.scn29
-rw-r--r--testsuites/sptests/sp25/system.h32
-rw-r--r--testsuites/sptests/sp25/task1.c241
-rw-r--r--testsuites/sptests/spfatal/fatal.c134
-rw-r--r--testsuites/sptests/spfatal/init.c54
-rw-r--r--testsuites/sptests/spfatal/puterr.c68
-rw-r--r--testsuites/sptests/spfatal/spfatal.doc28
-rw-r--r--testsuites/sptests/spfatal/spfatal.scn8
-rw-r--r--testsuites/sptests/spfatal/system.h30
-rw-r--r--testsuites/sptests/spfatal/task1.c29
-rw-r--r--testsuites/sptests/spsize/getint.c32
-rw-r--r--testsuites/sptests/spsize/init.c58
-rw-r--r--testsuites/sptests/spsize/size.c601
-rw-r--r--testsuites/support/include/tmacros.h116
-rw-r--r--testsuites/tmtests/README21
-rw-r--r--testsuites/tmtests/include/timesys.h30
-rw-r--r--testsuites/tmtests/tm01/system.h23
-rw-r--r--testsuites/tmtests/tm01/task1.c187
-rw-r--r--testsuites/tmtests/tm01/tm01.doc13
-rw-r--r--testsuites/tmtests/tm02/system.h23
-rw-r--r--testsuites/tmtests/tm02/task1.c156
-rw-r--r--testsuites/tmtests/tm02/tm02.doc13
-rw-r--r--testsuites/tmtests/tm03/system.h23
-rw-r--r--testsuites/tmtests/tm03/task1.c149
-rw-r--r--testsuites/tmtests/tm03/tm03.doc13
-rw-r--r--testsuites/tmtests/tm04/system.h23
-rw-r--r--testsuites/tmtests/tm04/task1.c387
-rw-r--r--testsuites/tmtests/tm04/tm04.doc13
-rw-r--r--testsuites/tmtests/tm05/system.h23
-rw-r--r--testsuites/tmtests/tm05/task1.c132
-rw-r--r--testsuites/tmtests/tm05/tm05.doc13
-rw-r--r--testsuites/tmtests/tm06/system.h23
-rw-r--r--testsuites/tmtests/tm06/task1.c162
-rw-r--r--testsuites/tmtests/tm06/tm06.doc13
-rw-r--r--testsuites/tmtests/tm07/system.h23
-rw-r--r--testsuites/tmtests/tm07/task1.c120
-rw-r--r--testsuites/tmtests/tm07/tm07.doc13
-rw-r--r--testsuites/tmtests/tm08/system.h23
-rw-r--r--testsuites/tmtests/tm08/task1.c255
-rw-r--r--testsuites/tmtests/tm08/tm08.doc13
-rw-r--r--testsuites/tmtests/tm09/system.h23
-rw-r--r--testsuites/tmtests/tm09/task1.c221
-rw-r--r--testsuites/tmtests/tm09/tm09.doc13
-rw-r--r--testsuites/tmtests/tm10/system.h23
-rw-r--r--testsuites/tmtests/tm10/task1.c156
-rw-r--r--testsuites/tmtests/tm10/tm10.doc13
-rw-r--r--testsuites/tmtests/tm11/system.h23
-rw-r--r--testsuites/tmtests/tm11/task1.c148
-rw-r--r--testsuites/tmtests/tm11/tm11.doc13
-rw-r--r--testsuites/tmtests/tm12/system.h23
-rw-r--r--testsuites/tmtests/tm12/task1.c142
-rw-r--r--testsuites/tmtests/tm12/tm12.doc13
-rw-r--r--testsuites/tmtests/tm13/system.h23
-rw-r--r--testsuites/tmtests/tm13/task1.c147
-rw-r--r--testsuites/tmtests/tm13/tm13.doc13
-rw-r--r--testsuites/tmtests/tm14/system.h23
-rw-r--r--testsuites/tmtests/tm14/task1.c142
-rw-r--r--testsuites/tmtests/tm14/tm14.doc13
-rw-r--r--testsuites/tmtests/tm15/system.h23
-rw-r--r--testsuites/tmtests/tm15/task1.c222
-rw-r--r--testsuites/tmtests/tm15/tm15.doc13
-rw-r--r--testsuites/tmtests/tm16/system.h23
-rw-r--r--testsuites/tmtests/tm16/task1.c148
-rw-r--r--testsuites/tmtests/tm16/tm16.doc13
-rw-r--r--testsuites/tmtests/tm17/system.h23
-rw-r--r--testsuites/tmtests/tm17/task1.c127
-rw-r--r--testsuites/tmtests/tm17/tm17.doc13
-rw-r--r--testsuites/tmtests/tm18/system.h23
-rw-r--r--testsuites/tmtests/tm18/task1.c112
-rw-r--r--testsuites/tmtests/tm18/tm18.doc13
-rw-r--r--testsuites/tmtests/tm19/system.h23
-rw-r--r--testsuites/tmtests/tm19/task1.c212
-rw-r--r--testsuites/tmtests/tm19/tm19.doc13
-rw-r--r--testsuites/tmtests/tm20/system.h23
-rw-r--r--testsuites/tmtests/tm20/task1.c467
-rw-r--r--testsuites/tmtests/tm20/tm20.doc13
-rw-r--r--testsuites/tmtests/tm21/system.h23
-rw-r--r--testsuites/tmtests/tm21/task1.c234
-rw-r--r--testsuites/tmtests/tm21/tm21.doc13
-rw-r--r--testsuites/tmtests/tm22/system.h23
-rw-r--r--testsuites/tmtests/tm22/task1.c193
-rw-r--r--testsuites/tmtests/tm22/tm22.doc13
-rw-r--r--testsuites/tmtests/tm23/system.h23
-rw-r--r--testsuites/tmtests/tm23/task1.c302
-rw-r--r--testsuites/tmtests/tm23/tm23.doc13
-rw-r--r--testsuites/tmtests/tm24/system.h23
-rw-r--r--testsuites/tmtests/tm24/task1.c124
-rw-r--r--testsuites/tmtests/tm24/tm24.doc13
-rw-r--r--testsuites/tmtests/tm25/system.h23
-rw-r--r--testsuites/tmtests/tm25/task1.c108
-rw-r--r--testsuites/tmtests/tm25/tm25.doc13
-rw-r--r--testsuites/tmtests/tm26/fptest.h165
-rw-r--r--testsuites/tmtests/tm26/system.h23
-rw-r--r--testsuites/tmtests/tm26/task1.c470
-rw-r--r--testsuites/tmtests/tm26/tm26.doc13
-rw-r--r--testsuites/tmtests/tm27/system.h23
-rw-r--r--testsuites/tmtests/tm27/task1.c237
-rw-r--r--testsuites/tmtests/tm27/tm27.doc13
-rw-r--r--testsuites/tmtests/tm28/system.h23
-rw-r--r--testsuites/tmtests/tm28/task1.c134
-rw-r--r--testsuites/tmtests/tm28/tm28.doc13
-rw-r--r--testsuites/tmtests/tm29/system.h23
-rw-r--r--testsuites/tmtests/tm29/task1.c207
-rw-r--r--testsuites/tmtests/tm29/tm29.doc13
-rw-r--r--testsuites/tmtests/tmck/system.h23
-rw-r--r--testsuites/tmtests/tmck/task1.c180
-rw-r--r--testsuites/tmtests/tmck/tmck.doc20
-rw-r--r--testsuites/tmtests/tmoverhd/dumrtems.h255
-rw-r--r--testsuites/tmtests/tmoverhd/empty.c41
-rw-r--r--testsuites/tmtests/tmoverhd/system.h23
-rw-r--r--testsuites/tmtests/tmoverhd/testtask.c1279
-rw-r--r--testsuites/tmtests/tmoverhd/tmoverhd.doc13
437 files changed, 31435 insertions, 0 deletions
diff --git a/testsuites/README b/testsuites/README
new file mode 100644
index 0000000000..0b0e339b97
--- /dev/null
+++ b/testsuites/README
@@ -0,0 +1,39 @@
+#
+# $Id$
+#
+
+This is the directory under which the RTEMS
+test programs provided with the release are located. The
+following is a description of the contents of each file and
+subdirectory directly in this directory:
+
+NOTE: Other than the 'samples' directory these tests are intended
+ only to exercise RTEMS features and are *not* good examples
+ of programming for RTEMS.
+
+ samples
+
+ This directory contains a set of simple sample applications
+ which can be used either to test a board support package
+ or as the starting point for a custom application.
+
+ mptest
+
+ This directory contains the RTEMS Multiprocessor Test Suite.
+ The tests in this directory provide near complete (98%+) test
+ coverage of the multiprocessor specific code in RTEMS.
+
+ sptest
+
+ This directory contains the RTEMS Single Processor Test Suite.
+ The tests in this directory provide near complete (98%+) test
+ coverage of the non-multiprocessor code in RTEMS.
+
+ tmtest
+
+ This directory contains the RTEMS Timing Test Suite.
+ The tests in this directory are used to measure the execution
+ time of RTEMS directive and some critical internal functions.
+ The results of these test are reported in the Fact Sheets
+ and Supplental Manuals.
+
diff --git a/testsuites/libtests/README b/testsuites/libtests/README
new file mode 100644
index 0000000000..bc4b217832
--- /dev/null
+++ b/testsuites/libtests/README
@@ -0,0 +1,10 @@
+#
+# $Id$
+#
+
+This directory contains tests for some of the items in
+the lib directories. The intent is to be able to
+verify the basic functionality of a library. For example,
+it is important to know that the stack checker successfully
+detects tasks which both stay within and exceed their
+stack limits.
diff --git a/testsuites/libtests/stackchk/blow.c b/testsuites/libtests/stackchk/blow.c
new file mode 100644
index 0000000000..9ad93d849c
--- /dev/null
+++ b/testsuites/libtests/stackchk/blow.c
@@ -0,0 +1,47 @@
+/* task1.c
+ *
+ * This set of three tasks do some simple task switching for about
+ * 15 seconds and then call a routine to "blow the stack".
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include <rtems/system.h>
+#include <rtems/heap.h>
+#include <rtems/thread.h>
+
+void b() {}
+
+void blow_stack( void )
+{
+ volatile unsigned32 *low, *high;
+
+b();
+ /*
+ * Destroy the first and last 16 bytes of our stack... Hope it
+ * does not cause problems :)
+ */
+
+ low = _Thread_Executing->Start.Initial_stack.area + HEAP_OVERHEAD;
+ high = _Thread_Executing->Start.Initial_stack.area +
+ _Thread_Executing->Start.Initial_stack.size - 16;
+
+ low[0] = 0x11111111;
+ low[1] = 0x22222222;
+ low[2] = 0x33333333;
+ low[3] = 0x44444444;
+
+ high[0] = 0x55555555;
+ high[1] = 0x66666666;
+ high[2] = 0x77777777;
+ high[3] = 0x88888888;
+
+}
diff --git a/testsuites/libtests/stackchk/init.c b/testsuites/libtests/stackchk/init.c
new file mode 100644
index 0000000000..dc0d94931e
--- /dev/null
+++ b/testsuites/libtests/stackchk/init.c
@@ -0,0 +1,89 @@
+/* Init
+ *
+ * This routine is the initialization task for this test program.
+ * It is a user initialization task and has the responsibility for creating
+ * and starting the tasks that make up the test. If the time of day
+ * clock is required for the test, it should also be set to a known
+ * value by this function.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "app.h"
+#undef EXTERN
+#define EXTERN
+#include "conftbl.h"
+#include "gvar.h"
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ rtems_time_of_day time;
+ rtems_status_code status;
+
+ puts( "\n\n*** TEST STACK CHECKER ***" );
+
+ build_time( &time, 12, 31, 1988, 9, 0, 0, 0 );
+ status = rtems_clock_set( &time );
+ directive_failed( status, "rtems_clock_set" );
+
+ Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' );
+ Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' );
+ Task_name[ 3 ] = rtems_build_name( 'T', 'A', '3', ' ' );
+
+ status = rtems_task_create(
+ Task_name[ 1 ],
+ 1,
+ TASK_STACK_SIZE,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 1 ]
+ );
+ directive_failed( status, "rtems_task_create of TA1" );
+
+ status = rtems_task_create(
+ Task_name[ 2 ],
+ 1,
+ TASK_STACK_SIZE,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 2 ]
+ );
+ directive_failed( status, "rtems_task_create of TA2" );
+
+ status = rtems_task_create(
+ Task_name[ 3 ],
+ 1,
+ TASK_STACK_SIZE,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 3 ]
+ );
+ directive_failed( status, "rtems_task_create of TA3" );
+
+ status = rtems_task_start( Task_id[ 1 ], Task_1_through_3, 0 );
+ directive_failed( status, "rtems_task_start of TA1" );
+
+ status = rtems_task_start( Task_id[ 2 ], Task_1_through_3, 0 );
+ directive_failed( status, "rtems_task_start of TA2" );
+
+ status = rtems_task_start( Task_id[ 3 ], Task_1_through_3, 0 );
+ directive_failed( status, "rtems_task_start of TA3" );
+
+ status = rtems_task_delete( RTEMS_SELF );
+ directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
+}
diff --git a/testsuites/libtests/stackchk/stackchk.scn b/testsuites/libtests/stackchk/stackchk.scn
new file mode 100644
index 0000000000..84a5c5e342
--- /dev/null
+++ b/testsuites/libtests/stackchk/stackchk.scn
@@ -0,0 +1,9 @@
+*** TEST STACK CHECKER ***
+TA1 - rtems_clock_get - 09:00:00 12/31/1988
+TA2 - rtems_clock_get - 09:00:00 12/31/1988
+TA3 - rtems_clock_get - 09:00:00 12/31/1988
+TA1 - rtems_clock_get - 09:00:05 12/31/1988
+TA1 - rtems_clock_get - 09:00:10 12/31/1988
+TA2 - rtems_clock_get - 09:00:10 12/31/1988
+TA1 - rtems_clock_get - 09:00:15 12/31/1988
+---> error indictation
diff --git a/testsuites/libtests/stackchk/task1.c b/testsuites/libtests/stackchk/task1.c
new file mode 100644
index 0000000000..d683619c7e
--- /dev/null
+++ b/testsuites/libtests/stackchk/task1.c
@@ -0,0 +1,44 @@
+/* task1.c
+ *
+ * This set of three tasks do some simple task switching for about
+ * 15 seconds and then call a routine to "blow the stack".
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "app.h"
+
+rtems_task Task_1_through_3(
+ rtems_task_argument argument
+)
+{
+ rtems_id tid;
+ rtems_time_of_day time;
+ rtems_status_code status;
+
+ status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
+ directive_failed( status, "rtems_task_ident" );
+
+ while( FOREVER ) {
+ status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
+ directive_failed( status, "rtems_clock_get" );
+
+ if ( time.second >= 15 && tid == Task_id[ 1 ] ) {
+ blow_stack();
+ }
+
+ put_name( Task_name[ task_number( tid ) ], FALSE );
+ print_time( " - rtems_clock_get - ", &time, "\n" );
+
+ status = rtems_task_wake_after( task_number( tid ) * 5 * TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after" );
+ }
+}
diff --git a/testsuites/mptests/README b/testsuites/mptests/README
new file mode 100644
index 0000000000..68cb459b55
--- /dev/null
+++ b/testsuites/mptests/README
@@ -0,0 +1,10 @@
+#
+# $Id$
+#
+
+This directory contains the RTEMS Multiprocessor Test Suite.
+The tests in this directory provide near complete (98%+) test
+coverage of the multiprocessor specific code in RTEMS.
+
+These tests are designed to test RTEMS in a two node configuration.
+
diff --git a/testsuites/mptests/mp01/init.c b/testsuites/mptests/mp01/init.c
new file mode 100644
index 0000000000..2af49c8a6b
--- /dev/null
+++ b/testsuites/mptests/mp01/init.c
@@ -0,0 +1,99 @@
+/* Init
+ *
+ * This routine is the initialization task for this test program.
+ * It is a user initialization task and has the responsibility for creating
+ * and starting the tasks that make up the test. If the time of day
+ * clock is required for the test, it should also be set to a known
+ * value by this function.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+#undef EXTERN
+#define EXTERN
+#include "conftbl.h"
+#include "gvar.h"
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+ rtems_time_of_day time;
+ char c;
+
+ printf(
+ "\n\n*** TEST 1 -- NODE %d ***\n",
+ Multiprocessing_configuration.node
+ );
+
+ if ( Multiprocessing_configuration.node != 1 ) c = 'S';
+ else c = 'M';
+
+ Task_name[ 1 ] = rtems_build_name( c, 'A', '1', ' ' );
+ Task_name[ 2 ] = rtems_build_name( c, 'A', '2', ' ' );
+ Task_name[ 3 ] = rtems_build_name( c, 'A', '3', ' ' );
+
+ build_time( &time, 12, 31, 1988, 9, 0, 0, 0 );
+ status = rtems_clock_set( &time );
+ directive_failed( status, "rtems_clock_set" );
+
+ puts( "Creating task 1 (Global)" );
+ status = rtems_task_create(
+ Task_name[ 1 ],
+ 1,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_GLOBAL,
+ &Task_id[ 1 ]
+ );
+ directive_failed( status, "rtems_task_create of Task 1" );
+
+ puts( "Creating task 2 (Global)" );
+ status = rtems_task_create(
+ Task_name[ 2 ],
+ 1,
+ 2048,
+ RTEMS_TIMESLICE,
+ RTEMS_GLOBAL,
+ &Task_id[ 2 ]
+ );
+ directive_failed( status, "rtems_task_create of Task 2" );
+
+ puts( "Creating task 3 (Local)" );
+ status = rtems_task_create(
+ Task_name[ 3 ],
+ 1,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 3 ]
+ );
+ directive_failed( status, "rtems_task_create of Task 3" );
+
+ status = rtems_task_start( Task_id[ 1 ], Test_task, 0 );
+ directive_failed( status, "rtems_task_start of Task 1" );
+
+ status = rtems_task_start( Task_id[ 2 ], Test_task, 0 );
+ directive_failed( status, "rtems_task_start of Task 2" );
+
+ status = rtems_task_start( Task_id[ 3 ], Test_task, 0 );
+ directive_failed( status, "rtems_task_start of Task 3" );
+
+ status = rtems_task_delete( RTEMS_SELF );
+ directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
+}
diff --git a/testsuites/mptests/mp01/node1/mp01.doc b/testsuites/mptests/mp01/node1/mp01.doc
new file mode 100644
index 0000000000..83e06e2357
--- /dev/null
+++ b/testsuites/mptests/mp01/node1/mp01.doc
@@ -0,0 +1,53 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: test50
+
+directives:
+ ex_init, ex_start, t_create, t_start, tm_tick, i_return, t_ident,
+ tm_set, tm_get, tm_wkafter, t_delete
+
+concepts:
+
+ a. Verifies system can create and start both the executive's system
+ initialization and idle task.
+
+ b. Verifies executive can swap between three application tasks at the
+ same priority and the executive's internal idle task.
+
+ c. Verifies can print strings to the CRT on port 2 of the mvme136 board
+ using Print and Println in the board support package.
+
+ d. Verifies interrupt handler can handler a task switch from an interrupt
+ as specified with the i_return directive.
+
+ e. Verifies executive initialization performed correctly.
+
+ f. Verifies the executive trap handler except for the halt function.
+
+ g. Verifies that a task can get the task identification number of itself.
+
+ h. Verifies that a task can get the task identification number
+ of a global task on the local processor.
+
+ i. Verifies that a task can delete itself or a global task on
+ the local processor.
+
+ j. Verifies Shared Memory Locked Queue driver for initialization,
+ getting a packet, broadcasting a packet, and returning a packet.
+
+ k. Can be used to verify that global packet type P_SYSVERIFY,
+ P_OBJCREATE (task), and P_OBJDELETE (task) are sent and
+ correctly processed by a remote node.
diff --git a/testsuites/mptests/mp01/node1/mp01.scn b/testsuites/mptests/mp01/node1/mp01.scn
new file mode 100644
index 0000000000..d399f79b2a
--- /dev/null
+++ b/testsuites/mptests/mp01/node1/mp01.scn
@@ -0,0 +1,15 @@
+*** TEST 1 -- NODE 1 ***
+Creating task 1 (Global)
+Creating task 2 (Global)
+Creating task 3 (Local)
+MA1 - rtems_clock_get - 09:00:00 12/31/1988
+MA2 - rtems_clock_get - 09:00:00 12/31/1988
+MA3 - rtems_clock_get - 09:00:00 12/31/1988
+MA1 - rtems_clock_get - 09:00:05 12/31/1988
+MA1 - deleting self
+MA2 - rtems_clock_get - 09:00:10 12/31/1988
+MA2 - waiting to be deleted by MA3
+MA3 - rtems_clock_get - 09:00:15 12/31/1988
+MA3 - getting TID of MA2
+MA3 - deleting MA2
+*** END OF TEST 1 ***
diff --git a/testsuites/mptests/mp01/node2/mp01.doc b/testsuites/mptests/mp01/node2/mp01.doc
new file mode 100644
index 0000000000..0de40191c6
--- /dev/null
+++ b/testsuites/mptests/mp01/node2/mp01.doc
@@ -0,0 +1,13 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+
diff --git a/testsuites/mptests/mp01/node2/mp01.scn b/testsuites/mptests/mp01/node2/mp01.scn
new file mode 100644
index 0000000000..c9831ff9db
--- /dev/null
+++ b/testsuites/mptests/mp01/node2/mp01.scn
@@ -0,0 +1,15 @@
+*** TEST 1 -- NODE 2 ***
+Creating task 1 (Global)
+Creating task 2 (Global)
+Creating task 3 (Local)
+SA1 - rtems_clock_get - 09:00:00 12/31/1988
+SA2 - rtems_clock_get - 09:00:00 12/31/1988
+SA3 - rtems_clock_get - 09:00:00 12/31/1988
+SA1 - rtems_clock_get - 09:00:05 12/31/1988
+SA1 - deleting self
+SA2 - rtems_clock_get - 09:00:10 12/31/1988
+SA2 - waiting to be deleted by SA3
+SA3 - rtems_clock_get - 09:00:15 12/31/1988
+SA3 - getting TID of SA2
+SA3 - deleting SA2
+*** END OF TEST 1 ***
diff --git a/testsuites/mptests/mp01/system.h b/testsuites/mptests/mp01/system.h
new file mode 100644
index 0000000000..aa2c6d17e4
--- /dev/null
+++ b/testsuites/mptests/mp01/system.h
@@ -0,0 +1,30 @@
+/* system.h
+ *
+ * This include file contains information that is included in every
+ * function in the test set.
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include "tmacros.h"
+
+/* Miscellaneous */
+
+#define EXTERN extern /* external definition */
+
+/* macros */
+
+/* structures */
+
+#include "gvar.h"
+
+/* end of include file */
diff --git a/testsuites/mptests/mp01/task1.c b/testsuites/mptests/mp01/task1.c
new file mode 100644
index 0000000000..a2c3ec3a1d
--- /dev/null
+++ b/testsuites/mptests/mp01/task1.c
@@ -0,0 +1,84 @@
+/* Test_task
+ *
+ * This task is used for three test tasks. It obtains its task id and
+ * based upon that id, performs certain actions.
+ *
+ * Task_1 delays 5 seconds and deletes itself.
+ * Task_2 delays 10 seconds and then loops until
+ * deleted by the third task.
+ * Task 3 delays 15 seconds, then deletes task 2 and itself.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_task Test_task(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+ rtems_id tid;
+ rtems_time_of_day time;
+
+ status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
+ directive_failed( status, "rtems_task_ident" );
+
+ status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
+ directive_failed( status, "rtems_clock_get" );
+
+ put_name( Task_name[ task_number( tid ) ], FALSE );
+ print_time( " - rtems_clock_get - ", &time, "\n" );
+
+ status = rtems_task_wake_after( task_number( tid ) * 5 * TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after" );
+
+ status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
+ directive_failed( status, "rtems_clock_get" );
+ put_name( Task_name[ task_number( tid ) ], FALSE );
+ print_time( " - rtems_clock_get - ", &time, "\n" );
+
+ if ( task_number(tid) == 1 ) { /* TASK 1 */
+ put_name( Task_name[ 1 ], FALSE );
+ printf( " - deleting self\n" );
+ status = rtems_task_delete( RTEMS_SELF );
+ directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
+ }
+ else if ( task_number(tid) == 2 ) { /* TASK 2 */
+ put_name( Task_name[ 2 ], FALSE );
+ printf( " - waiting to be deleted by " );
+ put_name( Task_name[ 3 ], TRUE );
+ while ( FOREVER );
+ }
+ else { /* TASK 3 */
+ put_name( Task_name[ 3 ], FALSE );
+ printf( " - getting TID of " );
+ put_name( Task_name[ 2 ], TRUE );
+ do {
+ status = rtems_task_ident( Task_name[ 2 ], RTEMS_SEARCH_ALL_NODES, &tid );
+ } while ( status != RTEMS_SUCCESSFUL );
+ directive_failed( status, "rtems_task_ident" );
+
+ put_name( Task_name[ 3 ], FALSE );
+ printf( " - deleting " );
+ put_name( Task_name[ 2 ], TRUE );
+ status = rtems_task_delete( tid );
+ directive_failed( status, "rtems_task_delete of Task 2" );
+
+ puts( "*** END OF TEST 1 ***" );
+ exit(0);
+ }
+}
diff --git a/testsuites/mptests/mp02/init.c b/testsuites/mptests/mp02/init.c
new file mode 100644
index 0000000000..75d8565785
--- /dev/null
+++ b/testsuites/mptests/mp02/init.c
@@ -0,0 +1,63 @@
+/* Init
+ *
+ * This routine is the initialization task for this test program.
+ * It is a user initialization task and has the responsibility for creating
+ * and starting the tasks that make up the test. If the time of day
+ * clock is required for the test, it should also be set to a known
+ * value by this function.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+#undef EXTERN
+#define EXTERN
+#include "conftbl.h"
+#include "gvar.h"
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+
+ printf(
+ "\n\n*** TEST 2 -- NODE %d ***\n",
+ Multiprocessing_configuration.node
+ );
+
+ Task_name[ 1 ] = rtems_build_name( '1', '1', '1', ' ' );
+ Task_name[ 2 ] = rtems_build_name( '2', '2', '2', ' ' );
+
+ puts( "Creating Test_task (Global)" );
+ status = rtems_task_create(
+ Task_name[Multiprocessing_configuration.node],
+ 1,
+ 2048,
+ RTEMS_NO_PREEMPT,
+ RTEMS_GLOBAL,
+ &Task_id[ 1 ]
+ );
+ directive_failed( status, "rtems_task_create" );
+
+ puts( "Starting Test_task (Global)" );
+ status = rtems_task_start( Task_id[ 1 ], Test_task, 0 );
+ directive_failed( status, "rtems_task_start" );
+
+ puts( "Deleting initialization task" );
+ status = rtems_task_delete( RTEMS_SELF );
+ directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
+}
diff --git a/testsuites/mptests/mp02/node1/mp02.doc b/testsuites/mptests/mp02/node1/mp02.doc
new file mode 100644
index 0000000000..e74807f7f1
--- /dev/null
+++ b/testsuites/mptests/mp02/node1/mp02.doc
@@ -0,0 +1,47 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: test51
+
+directives:
+ ex_init, ex_start, t_create, t_start, tm_tick, i_return, t_ident,
+ tm_set, tm_get, tm_wkafter, t_delete, t_restart, t_getreg, t_setreg
+
+concepts:
+
+ a. Verifies system can create and start both the executive's system
+ initialization and idle task.
+
+ b. Verifies can print strings to the CRT on port 2 of the mvme136 board
+ using Print and Println in the board support package.
+
+ c. Verifies interrupt handler can handler a task switch from an interrupt
+ as specified with the i_return directive.
+
+ d. Verifies executive initialization performed correctly.
+
+ e. Verifies that a task can get the task identification number of itself.
+
+ f. Verifies that a task can get the task identification number
+ of another task.
+
+ g. Verifies that a task can delete itself or another task.
+
+ h. Verifies that errors are returned in the following situations:
+ 1) when attempting to delete a remote task.
+ 2) when attempting to start a remote task.
+ 3) when attempting to restart a remote task.
+
+ i. Verifies that a remote task's registers can be set and read.
diff --git a/testsuites/mptests/mp02/node1/mp02.scn b/testsuites/mptests/mp02/node1/mp02.scn
new file mode 100644
index 0000000000..72fdefe69d
--- /dev/null
+++ b/testsuites/mptests/mp02/node1/mp02.scn
@@ -0,0 +1,14 @@
+*** TEST 2 -- NODE 1 ***
+Creating Test_task (Global)
+Starting Test_task (Global)
+Deleting initialization task
+Remote task's name is : 222
+Getting TID of remote task (all nodes)
+Getting TID of remote task (1 node)
+rtems_task_delete of remote task returned the correct error
+rtems_task_start of remote task returned the correct error
+rtems_task_restart of remote task returned the correct error
+Setting notepad 1 of the remote task to 1
+Getting a notepad of the remote task
+Remote notepad set and read correctly
+*** END OF TEST 2 ***
diff --git a/testsuites/mptests/mp02/node2/mp02.doc b/testsuites/mptests/mp02/node2/mp02.doc
new file mode 100644
index 0000000000..0de40191c6
--- /dev/null
+++ b/testsuites/mptests/mp02/node2/mp02.doc
@@ -0,0 +1,13 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+
diff --git a/testsuites/mptests/mp02/node2/mp02.scn b/testsuites/mptests/mp02/node2/mp02.scn
new file mode 100644
index 0000000000..233a910999
--- /dev/null
+++ b/testsuites/mptests/mp02/node2/mp02.scn
@@ -0,0 +1,14 @@
+*** TEST 2 -- NODE 2 ***
+Creating Test_task (Global)
+Starting Test_task (Global)
+Deleting initialization task
+Remote task's name is : 111
+Getting TID of remote task (all nodes)
+Getting TID of remote task (1 node)
+rtems_task_delete of remote task returned the correct error
+rtems_task_start of remote task returned the correct error
+rtems_task_restart of remote task returned the correct error
+Setting notepad 2 of the remote task to 2
+Getting a notepad of the remote task
+Remote notepad set and read correctly
+*** END OF TEST 2 ***
diff --git a/testsuites/mptests/mp02/system.h b/testsuites/mptests/mp02/system.h
new file mode 100644
index 0000000000..aa2c6d17e4
--- /dev/null
+++ b/testsuites/mptests/mp02/system.h
@@ -0,0 +1,30 @@
+/* system.h
+ *
+ * This include file contains information that is included in every
+ * function in the test set.
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include "tmacros.h"
+
+/* Miscellaneous */
+
+#define EXTERN extern /* external definition */
+
+/* macros */
+
+/* structures */
+
+#include "gvar.h"
+
+/* end of include file */
diff --git a/testsuites/mptests/mp02/task1.c b/testsuites/mptests/mp02/task1.c
new file mode 100644
index 0000000000..44764486b0
--- /dev/null
+++ b/testsuites/mptests/mp02/task1.c
@@ -0,0 +1,118 @@
+/* Test_task
+ *
+ * This task tests the rtems_task_set_note directive on a remote task and that
+ * errors are returned when attempting to delete, start, or restart
+ * a remote task.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+extern rtems_multiprocessing_table Multiprocessing_configuration;
+
+rtems_task Test_task(
+ rtems_task_argument argument
+)
+{
+ rtems_id tid;
+ rtems_status_code status;
+ rtems_unsigned32 remote_node;
+ rtems_id remote_tid;
+ rtems_id test_tid;
+ rtems_unsigned32 note;
+
+ status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
+
+ remote_node = (Multiprocessing_configuration.node == 1) ? 2 : 1;
+ printf( "Remote task's name is : " );
+ put_name( Task_name[ remote_node ], TRUE );
+
+ puts( "Getting TID of remote task (all nodes)" );
+ do {
+ status = rtems_task_ident(
+ Task_name[ remote_node ],
+ RTEMS_SEARCH_ALL_NODES,
+ &remote_tid
+ );
+ } while ( status != RTEMS_SUCCESSFUL );
+
+ directive_failed( status, "rtems_task_ident" );
+
+ puts( "Getting TID of remote task (1 node)" );
+ status = rtems_task_ident( Task_name[ remote_node ], remote_node, &test_tid );
+ directive_failed( status, "rtems_task_ident" );
+
+ if ( test_tid != remote_tid ) {
+ puts( "rtems_task_ident tid's do not match!!" );
+ rtems_fatal_error_occurred( status );
+ }
+
+ status = rtems_task_delete( remote_tid );
+ fatal_directive_status(
+ status,
+ RTEMS_ILLEGAL_ON_REMOTE_OBJECT,
+ "rtems_task_delete of remote task"
+ );
+ puts( "rtems_task_delete of remote task returned the correct error" );
+
+ status = rtems_task_start( remote_tid, Test_task, 0 );
+ fatal_directive_status(
+ status,
+ RTEMS_ILLEGAL_ON_REMOTE_OBJECT,
+ "rtems_task_start of remote task"
+ );
+ puts( "rtems_task_start of remote task returned the correct error" );
+
+ status = rtems_task_restart( remote_tid, 0 );
+ fatal_directive_status(
+ status,
+ RTEMS_ILLEGAL_ON_REMOTE_OBJECT,
+ "rtems_task_restart of remote task"
+ );
+ puts( "rtems_task_restart of remote task returned the correct error" );
+
+ printf(
+ "Setting notepad %d of the remote task to %d\n",
+ rtems_get_node(tid),
+ rtems_get_node(tid)
+ );
+ status = rtems_task_set_note(
+ remote_tid,
+ rtems_get_node(tid),
+ rtems_get_node(tid)
+ );
+ directive_failed( status, "rtems_task_set_note" );
+
+ puts( "Getting a notepad of the remote task" );
+ status = rtems_task_get_note( remote_tid, rtems_get_node(tid), &note );
+ directive_failed( status, "rtems_task_get_note" );
+
+ if ( note == rtems_get_node(tid) )
+ puts( "Remote notepad set and read correctly" );
+ else
+ printf(
+ "FAILURE!! Remote notepad was not set and read correctly (%d, %d)\n",
+ note,
+ rtems_get_node( tid )
+ );
+
+ status = rtems_task_wake_after( TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after" );
+
+ puts( "*** END OF TEST 2 ***" );
+ exit( 0 );
+}
diff --git a/testsuites/mptests/mp03/delay.c b/testsuites/mptests/mp03/delay.c
new file mode 100644
index 0000000000..6a6bb5f25e
--- /dev/null
+++ b/testsuites/mptests/mp03/delay.c
@@ -0,0 +1,31 @@
+/* Delayed_send_event
+ *
+ * This routine is a timer service routine which sends an event to task 1.
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_timer_service_routine Delayed_send_event(
+ rtems_id ignored_id,
+ void *ignored_address
+)
+{
+ rtems_status_code status;
+
+ status = rtems_event_send( Task_id[ 1 ], RTEMS_EVENT_16 );
+ directive_failed( status, "rtems_event_send" );
+}
diff --git a/testsuites/mptests/mp03/init.c b/testsuites/mptests/mp03/init.c
new file mode 100644
index 0000000000..a1f210dad1
--- /dev/null
+++ b/testsuites/mptests/mp03/init.c
@@ -0,0 +1,68 @@
+/* Init
+ *
+ * This routine is the initialization task for this test program.
+ * It is a user initialization task and has the responsibility for creating
+ * and starting the tasks that make up the test. If the time of day
+ * clock is required for the test, it should also be set to a known
+ * value by this function.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+#undef EXTERN
+#define EXTERN
+#include "conftbl.h"
+#include "gvar.h"
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+
+ printf(
+ "\n\n*** TEST 3 -- NODE %d ***\n",
+ Multiprocessing_configuration.node
+ );
+
+ Task_name[ 1 ] = rtems_build_name( '1', '1', '1', ' ' );
+ Task_name[ 2 ] = rtems_build_name( '2', '2', '2', ' ' );
+
+ puts( "Creating Test_task (Global)" );
+ status = rtems_task_create(
+ Task_name[ Multiprocessing_configuration.node ],
+ 1,
+ 2048,
+ RTEMS_NO_PREEMPT,
+ RTEMS_GLOBAL,
+ &Task_id[ 1 ]
+ );
+ directive_failed( status, "rtems_task_create" );
+
+ puts( "Starting Test_task (Global)" );
+ status = rtems_task_start( Task_id[ 1 ], Test_task, 0 );
+ directive_failed( status, "rtems_task_start" );
+
+ Timer_name[ 1 ] = rtems_build_name( 'T', 'M', '1', ' ' );
+
+ status = rtems_timer_create( Timer_name[ 1 ], &Timer_id[ 1 ] );
+ directive_failed( status, "rtems_timer_create" );
+
+ puts( "Deleting initialization task" );
+ status = rtems_task_delete( RTEMS_SELF );
+ directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
+}
diff --git a/testsuites/mptests/mp03/node1/mp03.doc b/testsuites/mptests/mp03/node1/mp03.doc
new file mode 100644
index 0000000000..348afef85f
--- /dev/null
+++ b/testsuites/mptests/mp03/node1/mp03.doc
@@ -0,0 +1,45 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: test52
+
+directives:
+ ex_init, ex_start, t_create, t_start, tm_tick, i_return, t_ident,
+ tm_wkafter, t_suspend, t_resume
+
+concepts:
+
+ a. Verifies system can create and start both the executive's system
+ initialization and idle task.
+
+ b. Verifies executive can swap between three application tasks at the
+ same priority and the executive's internal idle task.
+
+ c. Verifies can print strings to the CRT on port 2 of the mvme136 board
+ using Print and Println in the board support package.
+
+ d. Verifies interrupt handler can handler a task switch from an interrupt
+ as specified with the i_return directive.
+
+ e. Verifies executive initialization performed correctly.
+
+ f. Verifies the executive trap handler except for the halt function.
+
+ g. Verifies that a task can get the task identification number of itself.
+
+ h. Verifies that a task can get the task identification number
+ of another task (on another node).
+
+ i. Verifies that a task can suspend and resume a remote task.
diff --git a/testsuites/mptests/mp03/node1/mp03.scn b/testsuites/mptests/mp03/node1/mp03.scn
new file mode 100644
index 0000000000..129e5bccba
--- /dev/null
+++ b/testsuites/mptests/mp03/node1/mp03.scn
@@ -0,0 +1,24 @@
+*** 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
+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?????
+*** END OF TEST 3 ***
diff --git a/testsuites/mptests/mp03/node2/mp03.doc b/testsuites/mptests/mp03/node2/mp03.doc
new file mode 100644
index 0000000000..0de40191c6
--- /dev/null
+++ b/testsuites/mptests/mp03/node2/mp03.doc
@@ -0,0 +1,13 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+
diff --git a/testsuites/mptests/mp03/node2/mp03.scn b/testsuites/mptests/mp03/node2/mp03.scn
new file mode 100644
index 0000000000..d77c09e9f7
--- /dev/null
+++ b/testsuites/mptests/mp03/node2/mp03.scn
@@ -0,0 +1,24 @@
+*** 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
+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 - 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/mptests/mp03/system.h b/testsuites/mptests/mp03/system.h
new file mode 100644
index 0000000000..aa2c6d17e4
--- /dev/null
+++ b/testsuites/mptests/mp03/system.h
@@ -0,0 +1,30 @@
+/* system.h
+ *
+ * This include file contains information that is included in every
+ * function in the test set.
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include "tmacros.h"
+
+/* Miscellaneous */
+
+#define EXTERN extern /* external definition */
+
+/* macros */
+
+/* structures */
+
+#include "gvar.h"
+
+/* end of include file */
diff --git a/testsuites/mptests/mp03/task1.c b/testsuites/mptests/mp03/task1.c
new file mode 100644
index 0000000000..c1f0f777fd
--- /dev/null
+++ b/testsuites/mptests/mp03/task1.c
@@ -0,0 +1,155 @@
+/* Test_task
+ *
+ * This task suspends and resumes a remote task.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+/*PAGE
+ *
+ * Test_Task_Support
+ *
+ */
+
+void Test_Task_Support(
+ rtems_unsigned32 node
+)
+{
+ rtems_event_set events;
+ rtems_status_code status;
+
+ if ( Multiprocessing_configuration.node == node ) {
+
+ for ( ; ; ) {
+
+ status = rtems_event_receive(
+ RTEMS_EVENT_16,
+ RTEMS_NO_WAIT,
+ RTEMS_NO_TIMEOUT,
+ &events
+ );
+
+ if ( status == RTEMS_SUCCESSFUL )
+ break;
+
+ fatal_directive_status(status, RTEMS_UNSATISFIED, "rtems_event_receive");
+
+ status = rtems_task_wake_after( 2 * TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after" );
+
+ put_name( Task_name[ node ], FALSE );
+ puts( " - Suspending remote task" );
+
+ status = rtems_task_suspend( remote_tid );
+ directive_failed( status, "rtems_task_suspend" );
+
+ status = rtems_task_wake_after( 2 * TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after" );
+
+ put_name( Task_name[ node ], FALSE );
+ puts( " - Resuming remote task" );
+
+ status = rtems_task_resume( remote_tid ) ;
+ directive_failed( status, "rtems_task_resume" );
+
+ }
+
+ } else {
+
+ for ( ; ; ) {
+ status = rtems_event_receive(
+ RTEMS_EVENT_16,
+ RTEMS_NO_WAIT,
+ RTEMS_NO_TIMEOUT,
+ &events
+ );
+
+ if ( status == RTEMS_SUCCESSFUL )
+ break;
+
+ fatal_directive_status(status, RTEMS_UNSATISFIED, "rtems_event_receive");
+
+ put_name( Task_name[ remote_node ], FALSE );
+ puts( " - have I been suspended???" );
+
+ status = rtems_task_wake_after( TICKS_PER_SECOND / 2 );
+ directive_failed( status, "rtems_task_wake_after" );
+ }
+
+ }
+
+}
+
+/*PAGE
+ *
+ * Test_task
+ */
+
+rtems_task Test_task(
+ rtems_task_argument argument
+)
+{
+ rtems_id tid;
+ rtems_status_code status;
+
+ status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
+ directive_failed( status, "rtems_task_ident" );
+
+ puts( "Getting TID of remote task" );
+ remote_node = (Multiprocessing_configuration.node == 1) ? 2 : 1;
+ printf( "Remote task's name is : " );
+ put_name( Task_name[ remote_node ], TRUE );
+
+ do {
+ status = rtems_task_ident(
+ Task_name[ remote_node ],
+ RTEMS_SEARCH_ALL_NODES,
+ &remote_tid
+ );
+ } while ( status != RTEMS_SUCCESSFUL );
+
+ directive_failed( status, "rtems_task_ident" );
+
+ status = rtems_timer_fire_after(
+ Timer_id[ 1 ],
+ 5 * TICKS_PER_SECOND,
+ Delayed_send_event,
+ NULL
+ );
+ directive_failed( status, "rtems_timer_fire_after" );
+
+ Test_Task_Support( 1 );
+
+ status = rtems_timer_fire_after(
+ Timer_id[ 1 ],
+ 5 * TICKS_PER_SECOND,
+ Delayed_send_event,
+ NULL
+ );
+ directive_failed( status, "rtems_timer_fire_after" );
+
+ if ( Multiprocessing_configuration.node == 1 ) {
+ status = rtems_task_wake_after( 2 * TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after" );
+ }
+
+ Test_Task_Support( 2 );
+
+ puts( "*** END OF TEST 3 ***" );
+ exit( 0 );
+}
diff --git a/testsuites/mptests/mp04/init.c b/testsuites/mptests/mp04/init.c
new file mode 100644
index 0000000000..106176c6ca
--- /dev/null
+++ b/testsuites/mptests/mp04/init.c
@@ -0,0 +1,63 @@
+/* Init
+ *
+ * This routine is the initialization task for this test program.
+ * It is a user initialization task and has the responsibility for creating
+ * and starting the tasks that make up the test. If the time of day
+ * clock is required for the test, it should also be set to a known
+ * value by this function.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+#undef EXTERN
+#define EXTERN
+#include "conftbl.h"
+#include "gvar.h"
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+
+ printf(
+ "\n\n*** TEST 4 -- NODE %d ***\n",
+ Multiprocessing_configuration.node
+ );
+
+ Task_name[ 1 ] = rtems_build_name( '1', '1', '1', ' ' );
+ Task_name[ 2 ] = rtems_build_name( '2', '2', '2', ' ' );
+
+ puts( "Creating Test_task (Global)" );
+ status = rtems_task_create(
+ Task_name[ Multiprocessing_configuration.node ],
+ Multiprocessing_configuration.node,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_GLOBAL,
+ &Task_id[ 1 ]
+ );
+ directive_failed( status, "rtems_task_create" );
+
+ puts( "Starting Test_task (Global)" );
+ status = rtems_task_start( Task_id[ 1 ], Test_task, 0 );
+ directive_failed( status, "rtems_task_start" );
+
+ puts( "Deleting initialization task" );
+ status = rtems_task_delete( RTEMS_SELF );
+ directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
+}
diff --git a/testsuites/mptests/mp04/node1/mp04.doc b/testsuites/mptests/mp04/node1/mp04.doc
new file mode 100644
index 0000000000..39a76d48a0
--- /dev/null
+++ b/testsuites/mptests/mp04/node1/mp04.doc
@@ -0,0 +1,41 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: test53
+
+directives:
+ ex_init, ex_start, t_create, t_start, i_return, t_ident, tm_get,
+ tm_wkafter, tm_setpri
+
+concepts:
+
+ a. Verifies system can create and start both the executive's system
+ initialization and idle task.
+
+ b. Verifies that the system can get the id of a remote task.
+
+ c. Verifies that the system can change the priority of a remote
+ task.
+
+ d. Verifies interrupt handler can handler a task switch from an interrupt
+ as specified with the i_return directive.
+
+ e. Verifies executive initialization performed correctly.
+
+ f. Verifies the executive trap handler except for the halt function.
+
+ g. Verifies that a task can get the task identification number of itself.
+
+ h. Verifies that a task can delete itself or another task.
diff --git a/testsuites/mptests/mp04/node1/mp04.scn b/testsuites/mptests/mp04/node1/mp04.scn
new file mode 100644
index 0000000000..e9518f3ac2
--- /dev/null
+++ b/testsuites/mptests/mp04/node1/mp04.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/mptests/mp04/node2/mp04.doc b/testsuites/mptests/mp04/node2/mp04.doc
new file mode 100644
index 0000000000..0de40191c6
--- /dev/null
+++ b/testsuites/mptests/mp04/node2/mp04.doc
@@ -0,0 +1,13 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+
diff --git a/testsuites/mptests/mp04/node2/mp04.scn b/testsuites/mptests/mp04/node2/mp04.scn
new file mode 100644
index 0000000000..8ccfcfef79
--- /dev/null
+++ b/testsuites/mptests/mp04/node2/mp04.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/mptests/mp04/system.h b/testsuites/mptests/mp04/system.h
new file mode 100644
index 0000000000..aa2c6d17e4
--- /dev/null
+++ b/testsuites/mptests/mp04/system.h
@@ -0,0 +1,30 @@
+/* system.h
+ *
+ * This include file contains information that is included in every
+ * function in the test set.
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include "tmacros.h"
+
+/* Miscellaneous */
+
+#define EXTERN extern /* external definition */
+
+/* macros */
+
+/* structures */
+
+#include "gvar.h"
+
+/* end of include file */
diff --git a/testsuites/mptests/mp04/task1.c b/testsuites/mptests/mp04/task1.c
new file mode 100644
index 0000000000..7e7e0ca849
--- /dev/null
+++ b/testsuites/mptests/mp04/task1.c
@@ -0,0 +1,83 @@
+/* Test_task
+ *
+ * This task tests the rtems_task_set_priority directive on a remote task.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+extern rtems_multiprocessing_table Multiprocessing_configuration;
+
+rtems_task Test_task(
+ rtems_task_argument argument
+)
+{
+ rtems_id tid;
+ rtems_status_code status;
+ rtems_unsigned32 remote_node;
+ rtems_id remote_tid;
+ rtems_task_priority previous_priority;
+ rtems_task_priority previous_priority_1;
+
+ status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
+ directive_failed( status, "rtems_task_ident" );
+
+ puts( "Getting TID of remote task" );
+ remote_node = (Multiprocessing_configuration.node == 1) ? 2 : 1;
+ puts_nocr( "Remote task's name is : " );
+ put_name( Task_name[ remote_node ], TRUE );
+
+ do {
+ status = rtems_task_ident(
+ Task_name[ remote_node ],
+ RTEMS_SEARCH_ALL_NODES,
+ &remote_tid
+ );
+ } while ( status != RTEMS_SUCCESSFUL );
+
+ directive_failed( status, "rtems_task_ident" );
+
+ status = rtems_task_set_priority(
+ remote_tid,
+ Multiprocessing_configuration.node,
+ &previous_priority
+ );
+ directive_failed( status, "rtems_task_set_priority" );
+
+ if ( previous_priority != remote_node ) {
+ printf(
+ "Remote priority (0x%x) does not match remote node (0x%x)!!!\n",
+ previous_priority,
+ remote_node
+ );
+ exit( 0xf0000 );
+ }
+
+ do {
+ status = rtems_task_set_priority(
+ RTEMS_SELF,
+ RTEMS_CURRENT_PRIORITY,
+ &previous_priority_1
+ );
+ directive_failed( status, "rtems_task_set_priority" );
+ } while ( previous_priority_1 != remote_node );
+
+ puts( "Local task priority has been set" );
+
+ puts( "*** END OF TEST 4 ***" );
+ exit( 0 );
+}
diff --git a/testsuites/mptests/mp05/asr.c b/testsuites/mptests/mp05/asr.c
new file mode 100644
index 0000000000..9f98e42692
--- /dev/null
+++ b/testsuites/mptests/mp05/asr.c
@@ -0,0 +1,37 @@
+/* Process_asr
+ *
+ * This routine performs the processing for task 1's RTEMS_ASR. It is called
+ * by an assembly routine which saves the necessary registers.
+ *
+ * Input parameters:
+ * signal - signal set
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_asr Process_asr(
+ rtems_signal_set signal
+)
+{
+ if ( signal != expected_signal ) {
+ printf(
+ "ERROR: I was expecting signal 0x%.8x got 0x%.8x\n",
+ expected_signal,
+ signal
+ );
+ rtems_fatal_error_occurred( 0xf0000 );
+ }
+ signal_caught = 1;
+}
diff --git a/testsuites/mptests/mp05/init.c b/testsuites/mptests/mp05/init.c
new file mode 100644
index 0000000000..5db791d8f2
--- /dev/null
+++ b/testsuites/mptests/mp05/init.c
@@ -0,0 +1,68 @@
+/* Init
+ *
+ * This routine is the initialization task for this test program.
+ * It is a user initialization task and has the responsibility for creating
+ * and starting the tasks that make up the test. If the time of day
+ * clock is required for the test, it should also be set to a known
+ * value by this function.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+#undef EXTERN
+#define EXTERN
+#include "conftbl.h"
+#include "gvar.h"
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+
+ printf(
+ "\n\n*** TEST 5 -- NODE %d ***\n",
+ Multiprocessing_configuration.node
+ );
+
+ Task_name[ 1 ] = rtems_build_name( '1', '1', '1', ' ' );
+ Task_name[ 2 ] = rtems_build_name( '2', '2', '2', ' ' );
+
+ puts( "Creating Test_task (Global)" );
+ status = rtems_task_create(
+ Task_name[Multiprocessing_configuration.node],
+ 1,
+ 1024,
+ RTEMS_TIMESLICE,
+ RTEMS_GLOBAL,
+ &Task_id[ 1 ]
+ );
+ directive_failed( status, "rtems_task_create" );
+
+ puts( "Starting Test_task (Global)" );
+ status = rtems_task_start( Task_id[ 1 ], Test_task, 0 );
+ directive_failed( status, "rtems_task_start" );
+
+ Timer_name[ 1 ] = rtems_build_name( 'T', 'M', '1', ' ' );
+
+ status = rtems_timer_create( Timer_name[ 1 ], &Timer_id[ 1 ] );
+ directive_failed( status, "rtems_timer_create" );
+
+ puts( "Deleting initialization task" );
+ status = rtems_task_delete( RTEMS_SELF );
+ directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
+}
diff --git a/testsuites/mptests/mp05/node1/mp05.doc b/testsuites/mptests/mp05/node1/mp05.doc
new file mode 100644
index 0000000000..6b9ccd556d
--- /dev/null
+++ b/testsuites/mptests/mp05/node1/mp05.doc
@@ -0,0 +1,45 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: test54
+
+directives:
+ ex_init, ex_start, t_create, t_start, tm_tick, i_return, t_ident,
+ tm_wkafter, as_catch, as_return
+
+concepts:
+
+ a. Verifies system can create and start both the executive's system
+ initialization and idle task.
+
+ b. Verifies executive can swap between three application tasks at the
+ same priority and the executive's internal idle task.
+
+ c. Verifies can print strings to the CRT on port 2 of the mvme136 board
+ using Print and Println in the board support package.
+
+ d. Verifies interrupt handler can handler a task switch from an interrupt
+ as specified with the i_return directive.
+
+ e. Verifies executive initialization performed correctly.
+
+ f. Verifies the executive trap handler except for the halt function.
+
+ g. Verifies that a task can get the task identification number of itself.
+
+ h. Verifies that a task can get the task identification number
+ of another task.
+
+ i. Verifies that a signal can be sent to a remote task.
diff --git a/testsuites/mptests/mp05/node1/mp05.scn b/testsuites/mptests/mp05/node1/mp05.scn
new file mode 100644
index 0000000000..472740ba18
--- /dev/null
+++ b/testsuites/mptests/mp05/node1/mp05.scn
@@ -0,0 +1,11 @@
+*** TEST 5 -- NODE 1 ***
+Creating Test_task (Global)
+Starting Test_task (Global)
+Deleting initialization task
+rtems_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/mptests/mp05/node2/mp05.doc b/testsuites/mptests/mp05/node2/mp05.doc
new file mode 100644
index 0000000000..0de40191c6
--- /dev/null
+++ b/testsuites/mptests/mp05/node2/mp05.doc
@@ -0,0 +1,13 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+
diff --git a/testsuites/mptests/mp05/node2/mp05.scn b/testsuites/mptests/mp05/node2/mp05.scn
new file mode 100644
index 0000000000..0c4b412f65
--- /dev/null
+++ b/testsuites/mptests/mp05/node2/mp05.scn
@@ -0,0 +1,10 @@
+*** TEST 5 -- NODE 2 ***
+Creating Test_task (Global)
+Starting Test_task (Global)
+Deleting initialization task
+rtems_signal_catch: initializing signal catcher
+Remote task's name is : 111
+Getting TID of remote task
+....................................................
+....................................................
+*** END OF TEST 5 ***
diff --git a/testsuites/mptests/mp05/system.h b/testsuites/mptests/mp05/system.h
new file mode 100644
index 0000000000..aa2c6d17e4
--- /dev/null
+++ b/testsuites/mptests/mp05/system.h
@@ -0,0 +1,30 @@
+/* system.h
+ *
+ * This include file contains information that is included in every
+ * function in the test set.
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include "tmacros.h"
+
+/* Miscellaneous */
+
+#define EXTERN extern /* external definition */
+
+/* macros */
+
+/* structures */
+
+#include "gvar.h"
+
+/* end of include file */
diff --git a/testsuites/mptests/mp05/task1.c b/testsuites/mptests/mp05/task1.c
new file mode 100644
index 0000000000..6934663850
--- /dev/null
+++ b/testsuites/mptests/mp05/task1.c
@@ -0,0 +1,106 @@
+/* Test_task
+ *
+ * This task initializes the signal catcher, sends the first signal
+ * if running on the first node, and loops while waiting for signals.
+ *
+ * NOTE: The signal catcher is not reentrant and hence RTEMS_NO_ASR must
+ * be a part of its execution mode.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+#define SIGNALS_PER_DOT 15
+
+rtems_timer_service_routine Stop_Test_TSR(
+ rtems_id ignored_id,
+ void *ignored_address
+)
+{
+ Stop_Test = TRUE;
+}
+
+rtems_task Test_task(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+
+ Stop_Test = FALSE;
+
+ signal_caught = 0;
+ signal_count = 0;
+
+ puts( "rtems_signal_catch: initializing signal catcher" );
+ status = rtems_signal_catch( Process_asr, RTEMS_NO_ASR|RTEMS_NO_PREEMPT );
+ directive_failed( status, "rtems_signal_catch" );
+
+ if (Multiprocessing_configuration.node == 1) {
+ remote_node = 2;
+ remote_signal = RTEMS_SIGNAL_18;
+ expected_signal = RTEMS_SIGNAL_17;
+ }
+ else {
+ remote_node = 1;
+ remote_signal = RTEMS_SIGNAL_17;
+ expected_signal = RTEMS_SIGNAL_18;
+ }
+ puts_nocr( "Remote task's name is : " );
+ put_name( Task_name[ remote_node ], TRUE );
+
+ puts( "Getting TID of remote task" );
+ do {
+ status = rtems_task_ident(
+ Task_name[ remote_node ],
+ RTEMS_SEARCH_ALL_NODES,
+ &remote_tid
+ );
+ } while ( status != RTEMS_SUCCESSFUL );
+ directive_failed( status, "rtems_task_ident" );
+
+ status = rtems_timer_fire_after(
+ Timer_id[ 1 ],
+ 3 * TICKS_PER_SECOND,
+ Stop_Test_TSR,
+ NULL
+ );
+ directive_failed( status, "rtems_timer_fire_after" );
+
+ if ( Multiprocessing_configuration.node == 1 ) {
+ puts( "Sending signal to remote task" );
+ do {
+ status = rtems_signal_send( remote_tid, remote_signal );
+ if ( status == RTEMS_NOT_DEFINED )
+ continue;
+ } while ( status != RTEMS_SUCCESSFUL );
+ directive_failed( status, "rtems_signal_send" );
+ }
+
+ while ( Stop_Test == FALSE ) {
+ if ( signal_caught ) {
+ signal_caught = 0;
+ if ( ++signal_count >= SIGNALS_PER_DOT ) {
+ signal_count = 0;
+ put_dot( '.' );
+ }
+ status = rtems_signal_send( remote_tid, remote_signal );
+ directive_failed( status, "rtems_signal_send" );
+ }
+ }
+ puts( "\n*** END OF TEST 5 ***" );
+ exit( 0 );
+}
diff --git a/testsuites/mptests/mp06/init.c b/testsuites/mptests/mp06/init.c
new file mode 100644
index 0000000000..ab41308954
--- /dev/null
+++ b/testsuites/mptests/mp06/init.c
@@ -0,0 +1,68 @@
+/* Init
+ *
+ * This routine is the initialization task for this test program.
+ * It is a user initialization task and has the responsibility for creating
+ * and starting the tasks that make up the test. If the time of day
+ * clock is required for the test, it should also be set to a known
+ * value by this function.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+#undef EXTERN
+#define EXTERN
+#include "conftbl.h"
+#include "gvar.h"
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+
+ printf(
+ "\n\n*** TEST 6 -- NODE %d ***\n",
+ Multiprocessing_configuration.node
+ );
+
+ Task_name[ 1 ] = rtems_build_name( '1', '1', '1', ' ' );
+ Task_name[ 2 ] = rtems_build_name( '2', '2', '2', ' ' );
+
+ puts( "Creating Test_task (Global)" );
+ status = rtems_task_create(
+ Task_name[Multiprocessing_configuration.node],
+ 1,
+ 1024,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_GLOBAL,
+ &Task_id[ 1 ]
+ );
+ directive_failed( status, "rtems_task_create" );
+
+ puts( "Starting Test_task (Global)" );
+ status = rtems_task_start( Task_id[ 1 ], Test_task, 0 );
+ directive_failed( status, "rtems_task_start" );
+
+ Timer_name[ 1 ] = rtems_build_name( 'T', 'M', '1', ' ' );
+
+ status = rtems_timer_create( Timer_name[ 1 ], &Timer_id[ 1 ] );
+ directive_failed( status, "rtems_timer_create" );
+
+ puts( "Deleting initialization task" );
+ status = rtems_task_delete( RTEMS_SELF );
+ directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
+}
diff --git a/testsuites/mptests/mp06/node1/mp06.doc b/testsuites/mptests/mp06/node1/mp06.doc
new file mode 100644
index 0000000000..879c15d705
--- /dev/null
+++ b/testsuites/mptests/mp06/node1/mp06.doc
@@ -0,0 +1,45 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: test55
+
+directives:
+ ex_init, ex_start, t_create, t_start, tm_tick, i_return, t_ident,
+ ev_send, ev_receive
+
+concepts:
+
+ a. Verifies system can create and start both the executive's system
+ initialization and idle task.
+
+ b. Verifies executive can swap between three application tasks at the
+ same priority and the executive's internal idle task.
+
+ c. Verifies can print strings to the CRT on port 2 of the mvme136 board
+ using Print and Println in the board support package.
+
+ d. Verifies interrupt handler can handler a task switch from an interrupt
+ as specified with the i_return directive.
+
+ e. Verifies executive initialization performed correctly.
+
+ f. Verifies the executive trap handler except for the halt function.
+
+ g. Verifies that a task can get the task identification number of itself.
+
+ h. Verifies that a task can get the task identification number
+ of another task.
+
+ i. Verifies that events can be sent to a remote task.
diff --git a/testsuites/mptests/mp06/node1/mp06.scn b/testsuites/mptests/mp06/node1/mp06.scn
new file mode 100644
index 0000000000..592777e5d7
--- /dev/null
+++ b/testsuites/mptests/mp06/node1/mp06.scn
@@ -0,0 +1,11 @@
+*** 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/mptests/mp06/node2/mp06.doc b/testsuites/mptests/mp06/node2/mp06.doc
new file mode 100644
index 0000000000..0de40191c6
--- /dev/null
+++ b/testsuites/mptests/mp06/node2/mp06.doc
@@ -0,0 +1,13 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+
diff --git a/testsuites/mptests/mp06/node2/mp06.scn b/testsuites/mptests/mp06/node2/mp06.scn
new file mode 100644
index 0000000000..9cb653c2f3
--- /dev/null
+++ b/testsuites/mptests/mp06/node2/mp06.scn
@@ -0,0 +1,12 @@
+*** 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
+....................................................
+....................................................
+rtems_event_receive - correctly returned RTEMS_TIMEOUT
+*** END OF TEST 6 ***
+
diff --git a/testsuites/mptests/mp06/system.h b/testsuites/mptests/mp06/system.h
new file mode 100644
index 0000000000..60f2b1a0a2
--- /dev/null
+++ b/testsuites/mptests/mp06/system.h
@@ -0,0 +1,31 @@
+/* system.h
+ *
+ * This include file contains information that is included in every
+ * function in the test set.
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include "tmacros.h"
+
+
+/* Miscellaneous */
+
+#define EXTERN extern /* external definition */
+
+/* macros */
+
+/* structures */
+
+#include "gvar.h"
+
+/* end of include file */
diff --git a/testsuites/mptests/mp06/task1.c b/testsuites/mptests/mp06/task1.c
new file mode 100644
index 0000000000..5b63a9ff76
--- /dev/null
+++ b/testsuites/mptests/mp06/task1.c
@@ -0,0 +1,176 @@
+/* Test_task
+ *
+ * This task tests global event operations. If running on node one, it
+ * continuously sends events. If running on node two, it continuously
+ * receives events.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+#define DOT_COUNT 25
+
+/*PAGE
+ *
+ * Stop_Test_TSR
+ */
+
+rtems_timer_service_routine Stop_Test_TSR(
+ rtems_id ignored_id,
+ void *ignored_address
+)
+{
+ Stop_Test = TRUE;
+}
+
+/*PAGE
+ *
+ * Event_set_table
+ */
+
+rtems_event_set Event_set_table[] = {
+ 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,
+ RTEMS_EVENT_31
+};
+
+/*PAGE
+ *
+ * Test_task
+ */
+
+rtems_task Test_task(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+ rtems_unsigned32 count;
+ rtems_unsigned32 remote_node;
+ rtems_id remote_tid;
+ rtems_event_set event_out;
+ rtems_event_set event_for_this_iteration;
+
+ Stop_Test = FALSE;
+
+ remote_node = (Multiprocessing_configuration.node == 1) ? 2 : 1;
+ puts_nocr( "Remote task's name is : " );
+ put_name( Task_name[ remote_node ], TRUE );
+
+ puts( "Getting TID of remote task" );
+ do {
+ status = rtems_task_ident(
+ Task_name[ remote_node ],
+ RTEMS_SEARCH_ALL_NODES,
+ &remote_tid
+ );
+ } while ( status != RTEMS_SUCCESSFUL );
+ directive_failed( status, "rtems_task_ident FAILED!!" );
+
+ if ( Multiprocessing_configuration.node == 1 )
+ puts( "Sending events to remote task" );
+ else
+ puts( "Receiving events from remote task" );
+
+ status = rtems_timer_fire_after(
+ Timer_id[ 1 ],
+ 5 * TICKS_PER_SECOND,
+ Stop_Test_TSR,
+ NULL
+ );
+ directive_failed( status, "rtems_timer_fire_after" );
+
+ count = 0;
+
+ for ( ; ; ) {
+ if ( Stop_Test == TRUE )
+ break;
+
+ event_for_this_iteration = Event_set_table[ count % 32 ];
+
+ if ( Multiprocessing_configuration.node == 1 ) {
+ status = rtems_event_send( remote_tid, event_for_this_iteration );
+ directive_failed( status, "rtems_event_send" );
+
+ status = rtems_task_wake_after( 1 );
+ directive_failed( status, "rtems_task_wake_after" );
+ } else {
+ status = rtems_event_receive(
+ event_for_this_iteration,
+ RTEMS_DEFAULT_OPTIONS,
+ 1 * TICKS_PER_SECOND,
+ &event_out
+ );
+ if ( rtems_are_statuses_equal( status, RTEMS_TIMEOUT ) ) {
+ if ( Multiprocessing_configuration.node == 2 )
+ puts( "\nCorrect behavior if the other node exitted." );
+ else
+ puts( "\nERROR... node 1 died" );
+ break;
+ } else
+ directive_failed( status, "rtems_event_receive" );
+ }
+
+ if ( (count % DOT_COUNT) == 0 )
+ put_dot('.');
+
+ count++;
+ }
+
+ putchar( '\n' );
+
+ if ( Multiprocessing_configuration.node == 2 ) {
+ status = rtems_event_receive(
+ RTEMS_EVENT_16,
+ RTEMS_DEFAULT_OPTIONS,
+ 1 * TICKS_PER_SECOND,
+ &event_out
+ );
+ fatal_directive_status( status, RTEMS_TIMEOUT, "rtems_event_receive" );
+ puts( "rtems_event_receive - correctly returned RTEMS_TIMEOUT" );
+ }
+ puts( "*** END OF TEST 6 ***" );
+ exit( 0 );
+}
diff --git a/testsuites/mptests/mp07/init.c b/testsuites/mptests/mp07/init.c
new file mode 100644
index 0000000000..665c3f0b72
--- /dev/null
+++ b/testsuites/mptests/mp07/init.c
@@ -0,0 +1,68 @@
+/* Init
+ *
+ * This routine is the initialization task for this test program.
+ * It is a user initialization task and has the responsibility for creating
+ * and starting the tasks that make up the test. If the time of day
+ * clock is required for the test, it should also be set to a known
+ * value by this function.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+#undef EXTERN
+#define EXTERN
+#include "conftbl.h"
+#include "gvar.h"
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+
+ printf(
+ "\n\n*** TEST 7 -- NODE %d ***\n",
+ Multiprocessing_configuration.node
+ );
+
+ Task_name[ 1 ] = rtems_build_name( '1', '1', '1', ' ' );
+ Task_name[ 2 ] = rtems_build_name( '2', '2', '2', ' ' );
+
+ puts( "Creating Test_task (Global)" );
+ status = rtems_task_create(
+ Task_name[Multiprocessing_configuration.node],
+ 1,
+ 2048,
+ RTEMS_TIMESLICE,
+ RTEMS_GLOBAL,
+ &Task_id[ 1 ]
+ );
+ directive_failed( status, "rtems_task_create" );
+
+ puts( "Starting Test_task (Global)" );
+ status = rtems_task_start( Task_id[ 1 ], Test_task, 0 );
+ directive_failed( status, "rtems_task_start" );
+
+ Timer_name[ 1 ] = rtems_build_name( 'T', 'M', '1', ' ' );
+
+ status = rtems_timer_create( Timer_name[ 1 ], &Timer_id[ 1 ] );
+ directive_failed( status, "rtems_timer_create" );
+
+ puts( "Deleting initialization task" );
+ status = rtems_task_delete( RTEMS_SELF );
+ directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
+}
diff --git a/testsuites/mptests/mp07/node1/mp07.doc b/testsuites/mptests/mp07/node1/mp07.doc
new file mode 100644
index 0000000000..ca09867ab6
--- /dev/null
+++ b/testsuites/mptests/mp07/node1/mp07.doc
@@ -0,0 +1,46 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: test56
+
+directives:
+ ex_init, ex_start, t_create, t_start, tm_tick, i_return, t_ident,
+ ev_send, ev_receive
+
+concepts:
+
+ a. Verifies system can create and start both the executive's system
+ initialization and idle task.
+
+ b. Verifies executive can swap between three application tasks at the
+ same priority and the executive's internal idle task.
+
+ c. Verifies can print strings to the CRT on port 2 of the mvme136 board
+ using Print and Println in the board support package.
+
+ d. Verifies interrupt handler can handler a task switch from an interrupt
+ as specified with the i_return directive.
+
+ e. Verifies executive initialization performed correctly.
+
+ f. Verifies the executive trap handler except for the halt function.
+
+ g. Verifies that a task can get the task identification number of itself.
+
+ h. Verifies that a task can get the task identification number
+ of another task.
+
+ i. Verifies that two tasks on different processors can alternate
+ sending each other events.
diff --git a/testsuites/mptests/mp07/node1/mp07.scn b/testsuites/mptests/mp07/node1/mp07.scn
new file mode 100644
index 0000000000..d348f48612
--- /dev/null
+++ b/testsuites/mptests/mp07/node1/mp07.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/mptests/mp07/node2/mp07.doc b/testsuites/mptests/mp07/node2/mp07.doc
new file mode 100644
index 0000000000..0de40191c6
--- /dev/null
+++ b/testsuites/mptests/mp07/node2/mp07.doc
@@ -0,0 +1,13 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+
diff --git a/testsuites/mptests/mp07/node2/mp07.scn b/testsuites/mptests/mp07/node2/mp07.scn
new file mode 100644
index 0000000000..9e361d713c
--- /dev/null
+++ b/testsuites/mptests/mp07/node2/mp07.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/mptests/mp07/system.h b/testsuites/mptests/mp07/system.h
new file mode 100644
index 0000000000..34ec37a967
--- /dev/null
+++ b/testsuites/mptests/mp07/system.h
@@ -0,0 +1,28 @@
+/* system.h
+ *
+ * This include file contains information that is included in every
+ * function in the test set.
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include "tmacros.h"
+
+#define EXTERN extern /* external definition */
+
+/* macros */
+
+/* structures */
+
+#include "gvar.h"
+
+/* end of include file */
diff --git a/testsuites/mptests/mp07/task1.c b/testsuites/mptests/mp07/task1.c
new file mode 100644
index 0000000000..70fc8c73c5
--- /dev/null
+++ b/testsuites/mptests/mp07/task1.c
@@ -0,0 +1,95 @@
+/* Test_task
+ *
+ * This task continuously sends an event to its counterpart on the
+ * other node, and then waits for it to send an event. The copy
+ * running on node one send the first event.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+#define DOT_COUNT 100
+
+rtems_timer_service_routine Stop_Test_TSR(
+ rtems_id ignored_id,
+ void *ignored_address
+)
+{
+ Stop_Test = TRUE;
+}
+
+rtems_task Test_task(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+ rtems_unsigned32 count;
+ rtems_unsigned32 remote_node;
+ rtems_id remote_tid;
+ rtems_event_set event_out;
+
+ Stop_Test = FALSE;
+
+ remote_node = (Multiprocessing_configuration.node == 1) ? 2 : 1;
+ puts_nocr( "Remote task's name is : " );
+ put_name( Task_name[ remote_node ], TRUE );
+
+ puts( "Getting TID of remote task" );
+ do {
+ status = rtems_task_ident(
+ Task_name[ remote_node ],
+ RTEMS_SEARCH_ALL_NODES,
+ &remote_tid
+ );
+ } while ( !rtems_is_status_successful( status ) );
+
+ if ( Multiprocessing_configuration.node == 1 ) {
+ puts( "Sending first event to remote task" );
+ status = rtems_event_send( remote_tid, RTEMS_EVENT_16 );
+ directive_failed( status, "rtems_event_send" );
+ }
+
+ status = rtems_timer_fire_after(
+ Timer_id[ 1 ],
+ 5 * TICKS_PER_SECOND,
+ Stop_Test_TSR,
+ NULL
+ );
+ directive_failed( status, "rtems_timer_fire_after" );
+
+ while ( Stop_Test == FALSE ) {
+ for ( count=DOT_COUNT ; count ; count-- ) {
+ status = rtems_event_receive(
+ RTEMS_EVENT_16,
+ RTEMS_DEFAULT_OPTIONS,
+ RTEMS_NO_TIMEOUT,
+ &event_out
+ );
+ if ( status == RTEMS_TIMEOUT ) {
+ puts( "\nTA1 - RTEMS_TIMEOUT .. probably OK if the other node exits" );
+ break;
+ } else
+ directive_failed( status, "rtems_event_receive" );
+
+ status = rtems_event_send( remote_tid, RTEMS_EVENT_16 );
+ directive_failed( status, "rtems_event_send" );
+ }
+ put_dot('.');
+ }
+ puts( "\n*** END OF TEST 7 ***" );
+ exit( 0 );
+}
diff --git a/testsuites/mptests/mp08/init.c b/testsuites/mptests/mp08/init.c
new file mode 100644
index 0000000000..2a669d2b9a
--- /dev/null
+++ b/testsuites/mptests/mp08/init.c
@@ -0,0 +1,76 @@
+/* Init
+ *
+ * This routine is the initialization task for this test program.
+ * It is a user initialization task and has the responsibility for creating
+ * and starting the tasks that make up the test. If the time of day
+ * clock is required for the test, it should also be set to a known
+ * value by this function.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+#undef EXTERN
+#define EXTERN
+#include "conftbl.h"
+#include "gvar.h"
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+
+ printf(
+ "\n\n*** TEST 8 -- NODE %d ***\n",
+ Multiprocessing_configuration.node
+ );
+
+ Task_name[ 1 ] = rtems_build_name( '1', '1', '1', ' ' );
+ Task_name[ 2 ] = rtems_build_name( '2', '2', '2', ' ' );
+
+ Semaphore_name[ 1 ] = rtems_build_name( 'S', 'E', 'M', '\0' );
+
+ if ( Multiprocessing_configuration.node == 1 ) {
+ puts( "Creating Sempahore (Global)" );
+ status = rtems_semaphore_create(
+ Semaphore_name[ 1 ],
+ 1,
+ RTEMS_GLOBAL,
+ &Semaphore_id[ 1 ]
+ );
+ directive_failed( status, "rtems_semaphore_create" );
+ }
+
+ puts( "Creating Test_task (Global)" );
+ status = rtems_task_create(
+ Task_name[ Multiprocessing_configuration.node ],
+ 1,
+ 2048,
+ RTEMS_TIMESLICE,
+ RTEMS_GLOBAL,
+ &Task_id[ 1 ]
+ );
+ directive_failed( status, "rtems_task_create" );
+
+ puts( "Starting Test_task (Global)" );
+ status = rtems_task_start( Task_id[ 1 ], Test_task, 0 );
+ directive_failed( status, "rtems_task_start" );
+
+ puts( "Deleting initialization task" );
+ status = rtems_task_delete( RTEMS_SELF );
+ directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
+}
diff --git a/testsuites/mptests/mp08/node1/mp08.doc b/testsuites/mptests/mp08/node1/mp08.doc
new file mode 100644
index 0000000000..3ec09a3335
--- /dev/null
+++ b/testsuites/mptests/mp08/node1/mp08.doc
@@ -0,0 +1,52 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: test57
+
+GLOBAL SEMAPHORE TEST
+
+directives:
+ ex_init, ex_start, t_create, t_start, tm_tick, i_return, t_ident,
+ sm_create, sm_ident, sm_p, sm_v, sm_delete
+
+concepts:
+
+ a. Verifies system can create and start both the executive's system
+ initialization and idle task.
+
+ b. Verifies executive can swap between three application tasks at the
+ same priority and the executive's internal idle task.
+
+ c. Verifies can print strings to the CRT on port 2 of the mvme136 board
+ using Print and Println in the board support package.
+
+ d. Verifies interrupt handler can handler a task switch from an interrupt
+ as specified with the i_return directive.
+
+ e. Verifies executive initialization performed correctly.
+
+ f. Verifies the executive trap handler except for the halt function.
+
+ g. Verifies that a task can get the identification number of
+ a global sempahore.
+
+ h. Verifies that two tasks on different processors can
+ alternate accessing a semaphore.
+
+ i. Verifies operation of sm_delete on global semaphores
+ for both normal and error case.
+
+ j. Verifies Rpc and Process_pkt for packet types Q_SMP, Q_SMV,
+ P_OBJCREATE (semaphore), P_OBJDELETE (semaphore), P_SMDEL_TQ.
+
diff --git a/testsuites/mptests/mp08/node1/mp08.scn b/testsuites/mptests/mp08/node1/mp08.scn
new file mode 100644
index 0000000000..cde263420c
--- /dev/null
+++ b/testsuites/mptests/mp08/node1/mp08.scn
@@ -0,0 +1,11 @@
+*** 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/mptests/mp08/node2/mp08.doc b/testsuites/mptests/mp08/node2/mp08.doc
new file mode 100644
index 0000000000..0de40191c6
--- /dev/null
+++ b/testsuites/mptests/mp08/node2/mp08.doc
@@ -0,0 +1,13 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+
diff --git a/testsuites/mptests/mp08/node2/mp08.scn b/testsuites/mptests/mp08/node2/mp08.scn
new file mode 100644
index 0000000000..5a613f45e5
--- /dev/null
+++ b/testsuites/mptests/mp08/node2/mp08.scn
@@ -0,0 +1,12 @@
+*** TEST 8 -- NODE 2 ***
+Creating Test_task (Global)
+Starting Test_task (Global)
+Deleting initialization task
+Getting SMID of semaphore
+rtems_semaphore_delete correctly returned RTEMS_ILLEGAL_ON_REMOTE_OBJECT
+pvpvpvpvpvp.......
+(continued) pvp
+
+Global semaphore deleted
+*** END OF TEST 8 ***
+
diff --git a/testsuites/mptests/mp08/system.h b/testsuites/mptests/mp08/system.h
new file mode 100644
index 0000000000..aa2c6d17e4
--- /dev/null
+++ b/testsuites/mptests/mp08/system.h
@@ -0,0 +1,30 @@
+/* system.h
+ *
+ * This include file contains information that is included in every
+ * function in the test set.
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include "tmacros.h"
+
+/* Miscellaneous */
+
+#define EXTERN extern /* external definition */
+
+/* macros */
+
+/* structures */
+
+#include "gvar.h"
+
+/* end of include file */
diff --git a/testsuites/mptests/mp08/task1.c b/testsuites/mptests/mp08/task1.c
new file mode 100644
index 0000000000..dbd1526795
--- /dev/null
+++ b/testsuites/mptests/mp08/task1.c
@@ -0,0 +1,89 @@
+/* Test_task
+ *
+ * This task tests global semaphore operations. It verifies that
+ * global semaphore errors are correctly returned.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_task Test_task(
+ rtems_task_argument argument
+)
+{
+ rtems_unsigned32 count;
+ rtems_status_code status;
+
+ puts( "Getting SMID of semaphore" );
+
+ do {
+ status = rtems_semaphore_ident(
+ Semaphore_name[ 1 ],
+ RTEMS_SEARCH_ALL_NODES,
+ &Semaphore_id[ 1 ]
+ );
+ } while ( !rtems_is_status_successful( status ) );
+
+ if ( Multiprocessing_configuration.node == 2 ) {
+ status = rtems_semaphore_delete( Semaphore_id[ 1 ] );
+ fatal_directive_status(
+ status,
+ RTEMS_ILLEGAL_ON_REMOTE_OBJECT,
+ "rtems_semaphore_delete did not return RTEMS_ILLEGAL_ON_REMOTE_OBJECT"
+ );
+ puts(
+ "rtems_semaphore_delete correctly returned RTEMS_ILLEGAL_ON_REMOTE_OBJECT"
+ );
+ }
+
+ count = 0; /* number of times node 1 releases semaphore */
+ while ( FOREVER ) {
+ put_dot( 'p' );
+ status = rtems_semaphore_obtain(
+ Semaphore_id[ 1 ],
+ RTEMS_DEFAULT_OPTIONS,
+ RTEMS_NO_TIMEOUT
+ );
+ if ( status != RTEMS_SUCCESSFUL ) {
+ fatal_directive_status(
+ status,
+ RTEMS_OBJECT_WAS_DELETED,
+ "rtems_semaphore_obtain"
+ );
+ puts( "\nGlobal semaphore deleted" );
+ puts( "*** END OF TEST 8 ***" );
+ exit( 0 );
+ }
+
+ if ( Multiprocessing_configuration.node == 1 && ++count == 1000 ) {
+ status = rtems_task_wake_after( TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after" );
+
+ puts( "\nDeleting global semaphore" );
+ status = rtems_semaphore_delete( Semaphore_id[ 1 ] );
+ directive_failed( status, "rtems_semaphore_delete" );
+
+ puts( "*** END OF TEST 8 ***" );
+ exit( 0 );
+ }
+ else {
+ put_dot( 'v' );
+ status = rtems_semaphore_release( Semaphore_id[ 1 ] );
+ directive_failed( status, "rtems_semaphore_release FAILED!!" );
+ }
+ }
+}
diff --git a/testsuites/mptests/mp09/init.c b/testsuites/mptests/mp09/init.c
new file mode 100644
index 0000000000..bd19547cef
--- /dev/null
+++ b/testsuites/mptests/mp09/init.c
@@ -0,0 +1,76 @@
+/* Init
+ *
+ * This routine is the initialization task for this test program.
+ * It is a user initialization task and has the responsibility for creating
+ * and starting the tasks that make up the test. If the time of day
+ * clock is required for the test, it should also be set to a known
+ * value by this function.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+#undef EXTERN
+#define EXTERN
+#include "conftbl.h"
+#include "gvar.h"
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+
+ printf(
+ "\n\n*** TEST 9 -- NODE %d ***\n",
+ Multiprocessing_configuration.node
+ );
+
+ Task_name[ 1 ] = rtems_build_name( '1', '1', '1', ' ' );
+ Task_name[ 2 ] = rtems_build_name( '2', '2', '2', ' ' );
+
+ Queue_name[ 1 ] = rtems_build_name( 'M', 'S', 'G', ' ' );
+
+ if ( Multiprocessing_configuration.node == 1 ) {
+ puts( "Creating Message Queue (Global)" );
+ status = rtems_message_queue_create(
+ Queue_name[ 1 ],
+ 3,
+ RTEMS_GLOBAL|RTEMS_LIMIT,
+ &Queue_id[ 1 ]
+ );
+ directive_failed( status, "rtems_message_queue_create" );
+ }
+
+ puts( "Creating Test_task (local)" );
+ status = rtems_task_create(
+ Task_name[Multiprocessing_configuration.node],
+ 1,
+ 1024,
+ RTEMS_TIMESLICE,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 1 ]
+ );
+ directive_failed( status, "rtems_task_create" );
+
+ puts( "Starting Test_task (local)" );
+ status = rtems_task_start( Task_id[ 1 ], Test_task, 0 );
+ directive_failed( status, "rtems_task_start" );
+
+ puts( "Deleting initialization task" );
+ status = rtems_task_delete( RTEMS_SELF );
+ directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
+}
diff --git a/testsuites/mptests/mp09/node1/mp09.doc b/testsuites/mptests/mp09/node1/mp09.doc
new file mode 100644
index 0000000000..15e05aae58
--- /dev/null
+++ b/testsuites/mptests/mp09/node1/mp09.doc
@@ -0,0 +1,50 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: test58
+
+GLOBAL MESSAGE QUEUE TEST
+
+directives:
+ ex_init, ex_start, t_create, t_start, tm_tick, i_return,
+ tm_wkafter, q_create, q_send, q_broadcast, q_urgent, q_receive,
+ q_delete
+
+concepts:
+
+ a. Verifies system can create and start both the executive's system
+ initialization and idle task.
+
+ b. Verifies executive can swap between three application tasks at the
+ same priority and the executive's internal idle task.
+
+ c. Verifies can print strings to the CRT on port 2 of the mvme136 board
+ using Print and Println in the board support package.
+
+ d. Verifies interrupt handler can handler a task switch from an interrupt
+ as specified with the i_return directive.
+
+ e. Verifies executive initialization performed correctly.
+
+ f. Verifies the executive trap handler except for the halt function.
+
+ g. Verifies that a task can get the task identification number of itself.
+
+ h. Verifies that a task can delete itself.
+
+ i. Verifies Rpc and Process_pkt for message queue related packets.
+
+ j. Verifies normal and error paths for global message queue handling.
+
+NOTE: The SLAVE must be started first for this test to successfully run.
diff --git a/testsuites/mptests/mp09/node1/mp09.scn b/testsuites/mptests/mp09/node1/mp09.scn
new file mode 100644
index 0000000000..2b612e4746
--- /dev/null
+++ b/testsuites/mptests/mp09/node1/mp09.scn
@@ -0,0 +1,21 @@
+*** 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
+rtems_message_queue_send: 123456789012345
+Delaying for a second
+rtems_message_queue_urgent: abcdefghijklmno
+Delaying for a second
+rtems_message_queue_broadcast: ABCDEFGHIJKLMNO
+Delaying for a second
+Delaying for 5 seconds
+Deleting Message queue
+*** END OF TEST 9 ***
diff --git a/testsuites/mptests/mp09/node2/mp09.doc b/testsuites/mptests/mp09/node2/mp09.doc
new file mode 100644
index 0000000000..0de40191c6
--- /dev/null
+++ b/testsuites/mptests/mp09/node2/mp09.doc
@@ -0,0 +1,13 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+
diff --git a/testsuites/mptests/mp09/node2/mp09.scn b/testsuites/mptests/mp09/node2/mp09.scn
new file mode 100644
index 0000000000..96708f7fe0
--- /dev/null
+++ b/testsuites/mptests/mp09/node2/mp09.scn
@@ -0,0 +1,27 @@
+*** TEST 9 -- NODE 2 ***
+Creating Test_task (local)
+Starting Test_task (local)
+Deleting initialization task
+Getting QID of message queue
+rtems_message_queue_delete correctly returned RTEMS_ILLEGAL_ON_REMOTE_OBJECT
+rtems_message_queue_send: 123456789012345
+Delaying for a second
+rtems_message_queue_urgent: abcdefghijklmno
+Delaying for a second
+rtems_message_queue_broadcast: ABCDEFGHIJKLMNO
+Delaying for a second
+Receiving message ...
+Received : 123456789012345
+Receiving message ...
+Received : abcdefghijklmno
+Receiving message ...
+Received : ABCDEFGHIJKLMNO
+Flushing remote empty queue
+00 messages were flushed on the remote queue
+Send messages to be flushed from remote queue
+Flushing remote queue
+01 messages were flushed on the remote queue
+Waiting for message queue to be deleted
+
+Global message queue deleted
+*** END OF TEST 9 ***
diff --git a/testsuites/mptests/mp09/recvmsg.c b/testsuites/mptests/mp09/recvmsg.c
new file mode 100644
index 0000000000..c3c1a8ef8b
--- /dev/null
+++ b/testsuites/mptests/mp09/recvmsg.c
@@ -0,0 +1,45 @@
+/* Receive_messages
+ *
+ * This routine receives and prints three messages.
+ * an error condition.
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+void Receive_messages()
+{
+ rtems_status_code status;
+ rtems_unsigned32 index;
+ char receive_buffer[16];
+
+ for ( index=1 ; index <=3 ; index++ ) {
+ puts( "Receiving message ..." );
+ status = rtems_message_queue_receive(
+ Queue_id[ 1 ],
+ (long (*)[4])receive_buffer,
+ RTEMS_DEFAULT_OPTIONS,
+ RTEMS_NO_TIMEOUT
+ );
+ directive_failed( status, "rtems_message_queue_receive" );
+ puts_nocr( "Received : ");
+ puts( receive_buffer );
+ }
+
+ puts( "Receiver delaying for a second" );
+ status = rtems_task_wake_after( TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after" );
+}
diff --git a/testsuites/mptests/mp09/sendmsg.c b/testsuites/mptests/mp09/sendmsg.c
new file mode 100644
index 0000000000..d800eb47cf
--- /dev/null
+++ b/testsuites/mptests/mp09/sendmsg.c
@@ -0,0 +1,59 @@
+/* Send_messages
+ *
+ * This routine sends a series of three messages.
+ * an error condition.
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+void Send_messages()
+{
+ rtems_status_code status;
+ rtems_unsigned32 broadcast_count;
+
+ puts_nocr( "rtems_message_queue_send: " );
+ puts( buffer1 );
+
+ status = rtems_message_queue_send( Queue_id[ 1 ], (long (*)[4])buffer1 );
+ directive_failed( status, "rtems_message_queue_send" );
+
+ puts( "Delaying for a second" );
+ status = rtems_task_wake_after( TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after" );
+
+ puts_nocr( "rtems_message_queue_urgent: " );
+ puts( buffer2 );
+ status = rtems_message_queue_urgent( Queue_id[ 1 ], (long (*)[4])buffer2 );
+ directive_failed( status, "rtems_message_queue_urgent" );
+
+ puts( "Delaying for a second" );
+ status = rtems_task_wake_after( TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after" );
+
+ puts_nocr( "rtems_message_queue_broadcast: " );
+ puts( buffer3 );
+ status = rtems_message_queue_broadcast(
+ Queue_id[ 1 ],
+ (long (*)[4])buffer3,
+ &broadcast_count
+ );
+ directive_failed( status, "rtems_message_queue_broadcast" );
+
+ puts( "Delaying for a second" );
+ status = rtems_task_wake_after( TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after" );
+}
diff --git a/testsuites/mptests/mp09/system.h b/testsuites/mptests/mp09/system.h
new file mode 100644
index 0000000000..aa2c6d17e4
--- /dev/null
+++ b/testsuites/mptests/mp09/system.h
@@ -0,0 +1,30 @@
+/* system.h
+ *
+ * This include file contains information that is included in every
+ * function in the test set.
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include "tmacros.h"
+
+/* Miscellaneous */
+
+#define EXTERN extern /* external definition */
+
+/* macros */
+
+/* structures */
+
+#include "gvar.h"
+
+/* end of include file */
diff --git a/testsuites/mptests/mp09/task1.c b/testsuites/mptests/mp09/task1.c
new file mode 100644
index 0000000000..ece05592dd
--- /dev/null
+++ b/testsuites/mptests/mp09/task1.c
@@ -0,0 +1,107 @@
+/* Test_task
+ *
+ * This task tests global message queue operations. It also generates
+ * an error condition.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+char buffer1[16] = "123456789012345";
+char buffer2[16] = "abcdefghijklmno";
+char buffer3[16] = "ABCDEFGHIJKLMNO";
+char buffer4[16] = "PQRSTUVWXYZ(){}";
+
+rtems_task Test_task(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+ rtems_unsigned32 count;
+ char receive_buffer[16];
+
+ status = rtems_task_wake_after( TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after" );
+
+ puts( "Getting QID of message queue" );
+
+ do {
+ status = rtems_message_queue_ident(
+ Queue_name[ 1 ],
+ RTEMS_SEARCH_ALL_NODES,
+ &Queue_id[ 1 ]
+ );
+ } while ( !rtems_is_status_successful( status ) );
+
+ if ( Multiprocessing_configuration.node == 2 ) {
+ status = rtems_message_queue_delete( Queue_id[ 1 ] );
+ fatal_directive_status(
+ status,
+ RTEMS_ILLEGAL_ON_REMOTE_OBJECT,
+ "rtems_message_queue_delete"
+ );
+ puts(
+ "rtems_message_queue_delete correctly returned RTEMS_ILLEGAL_ON_REMOTE_OBJECT"
+ );
+
+ Send_messages();
+ Receive_messages();
+
+ puts( "Flushing remote empty queue" );
+ status = rtems_message_queue_flush( Queue_id[ 1 ], &count );
+ directive_failed( status, "rtems_message_queue_flush" );
+ printf( "%02d messages were flushed on the remote queue\n", count );
+
+ puts( "Send messages to be flushed from remote queue" );
+ status = rtems_message_queue_send( Queue_id[ 1 ], (long (*)[4])buffer1 );
+ directive_failed( status, "rtems_message_queue_send" );
+
+ puts( "Flushing remote queue" );
+ status = rtems_message_queue_flush( Queue_id[ 1 ], &count );
+ directive_failed( status, "rtems_message_queue_flush" );
+ printf( "%02d messages were flushed on the remote queue\n", count );
+
+ puts( "Waiting for message queue to be deleted" );
+ status = rtems_message_queue_receive(
+ Queue_id[ 1 ],
+ (long (*)[4])receive_buffer,
+ RTEMS_DEFAULT_OPTIONS,
+ RTEMS_NO_TIMEOUT
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_OBJECT_WAS_DELETED,
+ "rtems_message_queue_receive"
+ );
+ puts( "\nGlobal message queue deleted" );
+ }
+ else { /* node == 1 */
+ Receive_messages();
+ Send_messages();
+
+ puts( "Delaying for 5 seconds" );
+ status = rtems_task_wake_after( 5*TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after" );
+
+ puts( "Deleting Message queue" );
+ status = rtems_message_queue_delete( Queue_id[ 1 ] );
+ directive_failed( status, "rtems_message_queue_delete" );
+ }
+
+ puts( "*** END OF TEST 9 ***" );
+ exit( 0 );
+}
diff --git a/testsuites/mptests/mp10/init.c b/testsuites/mptests/mp10/init.c
new file mode 100644
index 0000000000..7acf5ca411
--- /dev/null
+++ b/testsuites/mptests/mp10/init.c
@@ -0,0 +1,144 @@
+/* Init
+ *
+ * This routine is the initialization routine for this test program.
+ * Other than creating all objects needed by this test, if this routine
+ * is running on node one, it acquires a global semaphore to
+ * force all other tasks to pend. If running on node two, this task
+ * sleeps for a while, and then deletes two local tasks which are
+ * waiting on a remote message queue or a semaphore.
+ * This routine is the initialization task for this test program.
+ * It is a user initialization task and has the responsibility for creating
+ * and starting the tasks that make up the test. If the time of day
+ * clock is required for the test, it should also be set to a known
+ * value by this function.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+#undef EXTERN
+#define EXTERN
+#include "conftbl.h"
+#include "gvar.h"
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+
+ printf(
+ "\n\n*** TEST 10 -- NODE %d ***\n",
+ Multiprocessing_configuration.node
+ );
+
+ Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' );
+ Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' );
+ Task_name[ 3 ] = rtems_build_name( 'S', 'A', '3', ' ' );
+
+ Queue_name[ 1 ] = rtems_build_name( 'M', 'S', 'G', ' ' );
+
+ Semaphore_name[ 1 ] = rtems_build_name( 'S', 'E', 'M', ' ' );
+
+ if ( Multiprocessing_configuration.node == 1 ) {
+ puts( "Creating Message Queue (Global)" );
+ status = rtems_message_queue_create(
+ Queue_name[ 1 ],
+ 3,
+ RTEMS_GLOBAL|RTEMS_LIMIT,
+ &Queue_id[ 1 ]
+ );
+ directive_failed( status, "rtems_message_queue_create" );
+
+ puts( "Creating Semaphore (Global)" );
+ status = rtems_semaphore_create(
+ Semaphore_name[ 1 ],
+ 0,
+ RTEMS_GLOBAL | RTEMS_PRIORITY,
+ &Semaphore_id[ 1 ]
+ );
+ directive_failed( status, "rtems_semaphore_create" );
+
+ status = rtems_task_wake_after( 10 * TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after" );
+
+ } else {
+
+ puts( "Creating Test_task 1 (local)" );
+ status = rtems_task_create(
+ Task_name[ 1 ],
+ 1,
+ 1024,
+ RTEMS_TIMESLICE,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 1 ]
+ );
+ directive_failed( status, "rtems_task_create" );
+
+ puts( "Starting Test_task 1 (local)" );
+ status = rtems_task_start( Task_id[ 1 ], Test_task1, 0 );
+ directive_failed( status, "rtems_task_start" );
+
+ puts( "Creating Test_task 2 (local)" );
+ status = rtems_task_create(
+ Task_name[ 2 ],
+ 1,
+ 1024,
+ RTEMS_TIMESLICE,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 2 ]
+ );
+ directive_failed( status, "rtems_task_create" );
+
+ puts( "Starting Test_task 2 (local)" );
+ status = rtems_task_start( Task_id[ 2 ], Test_task2, 0 );
+ directive_failed( status, "rtems_task_start" );
+
+ puts( "Creating Test_task 3 (local)" );
+ status = rtems_task_create(
+ Task_name[ 3 ],
+ 1,
+ 1024,
+ RTEMS_TIMESLICE,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 3 ]
+ );
+ directive_failed( status, "rtems_task_create" );
+
+ puts( "Starting Test_task 3 (local)" );
+ status = rtems_task_start( Task_id[ 3 ], Test_task2, 0 );
+ directive_failed( status, "rtems_task_start" );
+
+ puts( "Sleeping for 1 seconds ..." );
+ status = rtems_task_wake_after( TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after" );
+
+ puts( "Deleting Test_task2" );
+ status = rtems_task_delete( Task_id[ 2 ] );
+ directive_failed( status, "rtems_task_delete of Task 2" );
+
+ puts( "Deleting Test_task1" );
+ status = rtems_task_delete( Task_id[ 1 ] );
+ directive_failed( status, "rtems_task_delete of Task 1" );
+
+ puts( "Restarting Test_task3" );
+ status = rtems_task_restart( Task_id[ 3 ], 1 );
+ directive_failed( status, "rtems_task_restart of Task 3" );
+
+ }
+ puts( "*** END OF TEST 10 ***" );
+ exit( 0 );
+}
diff --git a/testsuites/mptests/mp10/node1/mp10.doc b/testsuites/mptests/mp10/node1/mp10.doc
new file mode 100644
index 0000000000..d75b176f8d
--- /dev/null
+++ b/testsuites/mptests/mp10/node1/mp10.doc
@@ -0,0 +1,46 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: test59
+
+GLOBAL SEMAPHORE TEST
+
+directives:
+ ex_init, ex_start, t_create, t_start, tm_tick, i_return, t_ident,
+ tm_set, tm_get, tm_wkafter
+
+concepts:
+
+ a. Verifies system can create and start both the executive's system
+ initialization and idle task.
+
+ b. Verifies executive can swap between three application tasks at the
+ same priority and the executive's internal idle task.
+
+ c. Verifies can print strings to the CRT on port 2 of the mvme136 board
+ using Print and Println in the board support package.
+
+ d. Verifies interrupt handler can handler a task switch from an interrupt
+ as specified with the i_return directive.
+
+ e. Verifies executive initialization performed correctly.
+
+ f. Verifies the executive trap handler except for the halt function.
+
+ g. Verifies that a task can get the task identification number of itself.
+
+ h. Verifies that a task can get the task identification number
+ of another task.
+
+ i. Verifies that a task can delete itself or another task.
diff --git a/testsuites/mptests/mp10/node1/mp10.scn b/testsuites/mptests/mp10/node1/mp10.scn
new file mode 100644
index 0000000000..deeafc0a9a
--- /dev/null
+++ b/testsuites/mptests/mp10/node1/mp10.scn
@@ -0,0 +1,4 @@
+*** TEST 10 -- NODE 1 ***
+Creating Message Queue (Global)
+Creating Semaphore (Global)
+*** END OF TEST 10 ***
diff --git a/testsuites/mptests/mp10/node2/mp10.doc b/testsuites/mptests/mp10/node2/mp10.doc
new file mode 100644
index 0000000000..0de40191c6
--- /dev/null
+++ b/testsuites/mptests/mp10/node2/mp10.doc
@@ -0,0 +1,13 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+
diff --git a/testsuites/mptests/mp10/node2/mp10.scn b/testsuites/mptests/mp10/node2/mp10.scn
new file mode 100644
index 0000000000..25c07e6202
--- /dev/null
+++ b/testsuites/mptests/mp10/node2/mp10.scn
@@ -0,0 +1,19 @@
+*** 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 seconds ...
+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_task2
+Deleting Test_task1
+Restarting Test_task3
+*** END OF TEST 10 ***
+
diff --git a/testsuites/mptests/mp10/system.h b/testsuites/mptests/mp10/system.h
new file mode 100644
index 0000000000..aa2c6d17e4
--- /dev/null
+++ b/testsuites/mptests/mp10/system.h
@@ -0,0 +1,30 @@
+/* system.h
+ *
+ * This include file contains information that is included in every
+ * function in the test set.
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include "tmacros.h"
+
+/* Miscellaneous */
+
+#define EXTERN extern /* external definition */
+
+/* macros */
+
+/* structures */
+
+#include "gvar.h"
+
+/* end of include file */
diff --git a/testsuites/mptests/mp10/task1.c b/testsuites/mptests/mp10/task1.c
new file mode 100644
index 0000000000..ff6f4bd69a
--- /dev/null
+++ b/testsuites/mptests/mp10/task1.c
@@ -0,0 +1,50 @@
+/* Test_task1
+ *
+ * This task attempts to receive a message from a global message queue.
+ * It should never actually receive the message.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_task Test_task1(
+ rtems_task_argument argument
+)
+{
+ char receive_buffer[16];
+ rtems_status_code status;
+
+ puts( "Getting QID of message queue" );
+
+ do {
+ status = rtems_message_queue_ident(
+ Queue_name[ 1 ],
+ RTEMS_SEARCH_ALL_NODES,
+ &Queue_id[ 1 ]
+ );
+ } while ( !rtems_is_status_successful( status ) );
+
+ puts( "Attempting to receive message ..." );
+ status = rtems_message_queue_receive(
+ Queue_id[ 1 ],
+ (long (*)[4])receive_buffer,
+ RTEMS_DEFAULT_OPTIONS,
+ RTEMS_NO_TIMEOUT
+ );
+ directive_failed( status, "rtems_message_queue_receive" );
+
+}
diff --git a/testsuites/mptests/mp10/task2.c b/testsuites/mptests/mp10/task2.c
new file mode 100644
index 0000000000..560f3946cf
--- /dev/null
+++ b/testsuites/mptests/mp10/task2.c
@@ -0,0 +1,47 @@
+/* Test_task2
+ *
+ * This task attempts to receive control of a global semaphore.
+ * It should never receive control of the semaphore.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_task Test_task2(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+
+ puts( "Getting SMID of semaphore" );
+
+ do {
+ status = rtems_semaphore_ident(
+ Semaphore_name[ 1 ],
+ RTEMS_SEARCH_ALL_NODES,
+ &Semaphore_id[ 1 ]
+ );
+ } while ( !rtems_is_status_successful( status ) );
+
+ puts( "Attempting to acquire semaphore ..." );
+ status = rtems_semaphore_obtain(
+ Semaphore_id[ 1 ],
+ RTEMS_DEFAULT_OPTIONS,
+ RTEMS_NO_TIMEOUT
+ );
+ directive_failed( status, "rtems_semaphore_obtain" );
+}
diff --git a/testsuites/mptests/mp10/task3.c b/testsuites/mptests/mp10/task3.c
new file mode 100644
index 0000000000..905183268e
--- /dev/null
+++ b/testsuites/mptests/mp10/task3.c
@@ -0,0 +1,50 @@
+/* Test_task3
+ *
+ * This task attempts to receive control of a global semaphore.
+ * It should never receive control of the semaphore.
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_task Test_task3( restart )
+rtems_task_argument restart;
+{
+ rtems_status_code status;
+
+ if ( restart == 1 ) {
+ status = rtems_task_delete( RTEMS_SELF );
+ directive_failed( status, "rtems_task_delete" );
+ }
+
+ puts( "Getting SMID of semaphore" );
+
+ do {
+ status = rtems_semaphore_ident(
+ Semaphore_name[ 1 ],
+ RTEMS_SEARCH_ALL_NODES,
+ &Semaphore_id[ 1 ]
+ );
+ } while ( !rtems_is_status_successful( status ) );
+
+ puts( "Attempting to acquire semaphore ..." );
+ status = rtems_semaphore_obtain(
+ Semaphore_id[ 1 ],
+ RTEMS_DEFAULT_OPTIONS,
+ RTEMS_NO_TIMEOUT
+ );
+ directive_failed( status, "rtems_semaphore_obtain" );
+}
diff --git a/testsuites/mptests/mp11/init.c b/testsuites/mptests/mp11/init.c
new file mode 100644
index 0000000000..7adc391319
--- /dev/null
+++ b/testsuites/mptests/mp11/init.c
@@ -0,0 +1,106 @@
+/* Init
+ *
+ * This routine is the initialization and test routine for
+ * this test program. It attempts to create more global
+ * objects than are configured (zero should be configured).
+ * This routine is the initialization task for this test program.
+ * It is a user initialization task and has the responsibility for creating
+ * and starting the tasks that make up the test. If the time of day
+ * clock is required for the test, it should also be set to a known
+ * value by this function.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+#undef EXTERN
+#define EXTERN
+#include "conftbl.h"
+#include "gvar.h"
+
+rtems_unsigned8 my_partition[0x30000];
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ rtems_id junk_id;
+ rtems_status_code status;
+
+ printf(
+ "\n\n*** TEST 11 -- NODE %d ***\n",
+ Multiprocessing_configuration.node
+ );
+
+ Task_name[ 1 ] = rtems_build_name( '1', '1', '1', ' ' );
+ Task_name[ 2 ] = rtems_build_name( '2', '2', '2', ' ' );
+
+ Queue_name[ 1 ] = rtems_build_name( 'M', 'S', 'G', ' ' );
+
+ Semaphore_name[ 1 ] = rtems_build_name( 'S', 'E', 'M', ' ' );
+
+ if ( Multiprocessing_configuration.node == 1 ) {
+ puts( "Attempting to create Test_task (Global)" );
+ status = rtems_task_create(
+ Task_name[ 1 ],
+ 1,
+ 1024,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_GLOBAL,
+ &junk_id
+ );
+ fatal_directive_status( status, RTEMS_TOO_MANY, "rtems_task_create" );
+ puts( "rtems_task_create correctly returned RTEMS_TOO_MANY" );
+
+ puts( "Attempting to create Message Queue (Global)" );
+ status = rtems_message_queue_create(
+ Queue_name[ 1 ],
+ 3,
+ RTEMS_GLOBAL|RTEMS_LIMIT,
+ &junk_id
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_TOO_MANY,
+ "rtems_message_queue_create"
+ );
+ puts( "rtems_message_queue_create correctly returned RTEMS_TOO_MANY" );
+
+ puts( "Attempting to create Semaphore (Global)" );
+ status = rtems_semaphore_create(
+ Semaphore_name[ 1 ],
+ 1,
+ RTEMS_GLOBAL,
+ &junk_id
+ );
+ fatal_directive_status( status, RTEMS_TOO_MANY, "rtems_semaphore_create" );
+ puts( "rtems_semaphore_create correctly returned RTEMS_TOO_MANY" );
+
+ puts( "Attempting to create Partition (Global)" );
+ status = rtems_partition_create(
+ 1,
+ (rtems_unsigned8 *) my_partition,
+ 128,
+ 64,
+ RTEMS_GLOBAL,
+ &junk_id
+ );
+ fatal_directive_status( status, RTEMS_TOO_MANY, "rtems_partition_create" );
+ puts( "rtems_partition_create correctly returned RTEMS_TOO_MANY" );
+ }
+ puts( "*** END OF TEST 11 ***" );
+ exit( 0 );
+}
diff --git a/testsuites/mptests/mp11/node1/mp11.doc b/testsuites/mptests/mp11/node1/mp11.doc
new file mode 100644
index 0000000000..05113ec6b6
--- /dev/null
+++ b/testsuites/mptests/mp11/node1/mp11.doc
@@ -0,0 +1,42 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: test60
+
+TOO MANY GLOBAL OBJECTS ERROR TEST
+
+directives:
+ ex_init, ex_start, t_create, t_start, tm_tick, i_return,
+ t_create, q_create, sm_create, pt_create
+
+concepts:
+
+ a. Verifies system can create and start both the executive's system
+ initialization and idle task.
+
+ b. Verifies executive can swap between three application tasks at the
+ same priority and the executive's internal idle task.
+
+ c. Verifies can print strings to the CRT on port 2 of the mvme136 board
+ using Print and Println in the board support package.
+
+ d. Verifies interrupt handler can handler a task switch from an interrupt
+ as specified with the i_return directive.
+
+ e. Verifies executive initialization performed correctly.
+
+ f. Verifies the executive trap handler except for the halt function.
+
+ g. Verifies that all object create directives correctly return
+ E_TOOMANYGOBJECTS.
diff --git a/testsuites/mptests/mp11/node1/mp11.scn b/testsuites/mptests/mp11/node1/mp11.scn
new file mode 100644
index 0000000000..fb26583852
--- /dev/null
+++ b/testsuites/mptests/mp11/node1/mp11.scn
@@ -0,0 +1,10 @@
+*** TEST 11 -- NODE 1 ***
+Attempting to create Test_task (Global)
+rtems_task_create correctly returned RTEMS_TOO_MANY
+Attempting to create Message Queue (Global)
+rtems_message_queue_create correctly returned RTEMS_TOO_MANY
+Attempting to create Semaphore (Global)
+rtems_semaphore_create correctly returned RTEMS_TOO_MANY
+Attempting to create Partition (Global)
+rtems_partition_create correctly returned RTEMS_TOO_MANY
+*** END OF TEST 11 ***
diff --git a/testsuites/mptests/mp11/node2/mp11.doc b/testsuites/mptests/mp11/node2/mp11.doc
new file mode 100644
index 0000000000..0de40191c6
--- /dev/null
+++ b/testsuites/mptests/mp11/node2/mp11.doc
@@ -0,0 +1,13 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+
diff --git a/testsuites/mptests/mp11/node2/mp11.scn b/testsuites/mptests/mp11/node2/mp11.scn
new file mode 100644
index 0000000000..49bd8a3219
--- /dev/null
+++ b/testsuites/mptests/mp11/node2/mp11.scn
@@ -0,0 +1,2 @@
+*** TEST 11 -- NODE 2 ***
+*** END OF TEST 11 ***
diff --git a/testsuites/mptests/mp11/system.h b/testsuites/mptests/mp11/system.h
new file mode 100644
index 0000000000..aa2c6d17e4
--- /dev/null
+++ b/testsuites/mptests/mp11/system.h
@@ -0,0 +1,30 @@
+/* system.h
+ *
+ * This include file contains information that is included in every
+ * function in the test set.
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include "tmacros.h"
+
+/* Miscellaneous */
+
+#define EXTERN extern /* external definition */
+
+/* macros */
+
+/* structures */
+
+#include "gvar.h"
+
+/* end of include file */
diff --git a/testsuites/mptests/mp12/init.c b/testsuites/mptests/mp12/init.c
new file mode 100644
index 0000000000..8ef9552174
--- /dev/null
+++ b/testsuites/mptests/mp12/init.c
@@ -0,0 +1,116 @@
+/* Init
+ *
+ * This routine is the initialization routine and test code for
+ * global partitions. It creates a global partition, obtains and
+ * releases a buffer, and deletes the partition. The partition
+ * is created on node one, and an attempt is made to delete it
+ * by node two.
+ * This routine is the initialization task for this test program.
+ * It is a user initialization task and has the responsibility for creating
+ * and starting the tasks that make up the test. If the time of day
+ * clock is required for the test, it should also be set to a known
+ * value by this function.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+#undef EXTERN
+#define EXTERN
+#include "conftbl.h"
+#include "gvar.h"
+
+rtems_unsigned8 Partition_area[ 1024 ];
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+ void *bufaddr;
+
+ printf(
+ "\n\n*** TEST 12 -- NODE %d ***\n",
+ Multiprocessing_configuration.node
+ );
+
+ Task_name[ 1 ] = rtems_build_name( '1', '1', '1', ' ' );
+ Task_name[ 2 ] = rtems_build_name( '2', '2', '2', ' ' );
+
+ Partition_name[ 1 ] = rtems_build_name( 'P', 'A', 'R', ' ' );
+
+ puts( "Got to initialization task" );
+
+ if ( Multiprocessing_configuration.node == 2 ) {
+ status = rtems_task_wake_after( 1 * TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after" );
+
+ puts( "Getting ID of remote Partition (Global)" );
+
+ do {
+ status = rtems_partition_ident(
+ Partition_name[ 1 ],
+ RTEMS_SEARCH_ALL_NODES,
+ &Partition_id[ 1 ]
+ );
+ } while ( !rtems_is_status_successful( status ) );
+
+ puts( "Attempting to delete remote Partition (Global)" );
+ status = rtems_partition_delete( Partition_id[ 1 ] );
+ fatal_directive_status(
+ status,
+ RTEMS_ILLEGAL_ON_REMOTE_OBJECT,
+ "rtems_partition_delete"
+ );
+ puts(
+ "rtems_partition_delete correctly returned RTEMS_ILLEGAL_ON_REMOTE_OBJECT"
+ );
+
+ puts( "Obtaining a buffer from the global partition" );
+ status = rtems_partition_get_buffer( Partition_id[ 1 ], &bufaddr );
+ directive_failed( status, "rtems_partition_get_buffer" );
+ printf( "Address returned was : 0x%p\n", bufaddr );
+
+ puts( "Releasing a buffer to the global partition" );
+ status = rtems_partition_return_buffer( Partition_id[ 1 ], bufaddr );
+ directive_failed( status, "rtems_partition_return_buffer" );
+
+ status = rtems_task_wake_after( 2 * TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after" );
+ }
+ else {
+ puts( "Creating Partition (Global)" );
+ status = rtems_partition_create(
+ Partition_name[ 1 ],
+ Partition_area,
+ 128,
+ 64,
+ RTEMS_GLOBAL,
+ &Partition_id[ 1 ]
+ );
+ directive_failed( status, "rtems_partition_create" );
+
+ puts( "Sleeping for two seconds" );
+ status = rtems_task_wake_after( 2 * TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after" );
+
+ puts( "Deleting Partition (Global)" );
+ status = rtems_partition_delete( Partition_id[ 1 ] );
+ directive_failed( status, "rtems_partition_delete" );
+ }
+ puts( "*** END OF TEST 12 ***" );
+ exit( 0 );
+}
diff --git a/testsuites/mptests/mp12/node1/mp12.doc b/testsuites/mptests/mp12/node1/mp12.doc
new file mode 100644
index 0000000000..2bb7bc4518
--- /dev/null
+++ b/testsuites/mptests/mp12/node1/mp12.doc
@@ -0,0 +1,52 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: test61
+
+GLOBAL PARTITION TEST
+
+directives:
+ ex_init, ex_start, t_create, t_start, tm_tick, i_return, tm_wkafter,
+ pt_create, pt_delete, pt_getbuf, pt_retbuf
+
+concepts:
+
+ a. Verifies system can create and start both the executive's system
+ initialization and idle task.
+
+ b. Verifies executive can swap between three application tasks at the
+ same priority and the executive's internal idle task.
+
+ c. Verifies can print strings to the CRT on port 2 of the mvme136 board
+ using Print and Println in the board support package.
+
+ d. Verifies interrupt handler can handler a task switch from an interrupt
+ as specified with the i_return directive.
+
+ e. Verifies executive initialization performed correctly.
+
+ f. Verifies the executive trap handler except for the halt function.
+
+ g. Verifies the Shared Memory Locked Queue Driver.
+
+ h. Verifies _Rpc() and _Process_pkt() for the following packet types:
+ P_OBJCREATE (partitions),
+ P_OBJDELETE (partitions),
+ P_PTGETBUF, and
+ P_PTRETBUF.
+
+ i. Verifies normal and error paths (other than E_TOOMANYGOBJECTS)
+ for global partitions.
+
+ j. Verifies that a task can delete itself.
diff --git a/testsuites/mptests/mp12/node1/mp12.scn b/testsuites/mptests/mp12/node1/mp12.scn
new file mode 100644
index 0000000000..605a2c11db
--- /dev/null
+++ b/testsuites/mptests/mp12/node1/mp12.scn
@@ -0,0 +1,6 @@
+*** TEST 12 -- NODE 1 ***
+Got to initialization task
+Creating Partition (Global)
+Sleeping for two seconds
+Deleting Partition (Global)
+*** END OF TEST 12 ***
diff --git a/testsuites/mptests/mp12/node2/mp12.doc b/testsuites/mptests/mp12/node2/mp12.doc
new file mode 100644
index 0000000000..0de40191c6
--- /dev/null
+++ b/testsuites/mptests/mp12/node2/mp12.doc
@@ -0,0 +1,13 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+
diff --git a/testsuites/mptests/mp12/node2/mp12.scn b/testsuites/mptests/mp12/node2/mp12.scn
new file mode 100644
index 0000000000..ad65e9cb32
--- /dev/null
+++ b/testsuites/mptests/mp12/node2/mp12.scn
@@ -0,0 +1,10 @@
+*** TEST 12 -- NODE 2 ***
+Got to initialization task
+Getting ID of remote Partition (Global)
+Attempting to delete remote Partition (Global)
+rtems_partition_delete correctly returned RTEMS_ILLEGAL_ON_REMOTE_OBJECT
+Obtaining a buffer from the global partition
+>>>>>>> address returned will differ
+Address returned was : 0x200f0000
+Releasing a buffer to the global partition
+*** END OF TEST 12 ***
diff --git a/testsuites/mptests/mp12/system.h b/testsuites/mptests/mp12/system.h
new file mode 100644
index 0000000000..aa2c6d17e4
--- /dev/null
+++ b/testsuites/mptests/mp12/system.h
@@ -0,0 +1,30 @@
+/* system.h
+ *
+ * This include file contains information that is included in every
+ * function in the test set.
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include "tmacros.h"
+
+/* Miscellaneous */
+
+#define EXTERN extern /* external definition */
+
+/* macros */
+
+/* structures */
+
+#include "gvar.h"
+
+/* end of include file */
diff --git a/testsuites/mptests/mp13/init.c b/testsuites/mptests/mp13/init.c
new file mode 100644
index 0000000000..0ec132e9ed
--- /dev/null
+++ b/testsuites/mptests/mp13/init.c
@@ -0,0 +1,116 @@
+/* Init
+ *
+ * This routine is the initialization task for this test program.
+ * It is a user initialization task and has the responsibility for creating
+ * and starting the tasks that make up the test. If the time of day
+ * clock is required for the test, it should also be set to a known
+ * value by this function.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+#undef EXTERN
+#define EXTERN
+#include "conftbl.h"
+#include "gvar.h"
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+
+ printf(
+ "\n\n*** TEST 13 -- NODE %d ***\n",
+ Multiprocessing_configuration.node
+ );
+
+ Task_name[ 1 ] = rtems_build_name( '1', '1', '1', ' ' );
+ Task_name[ 2 ] = rtems_build_name( '2', '2', '2', ' ' );
+
+ Queue_name[ 1 ] = rtems_build_name( 'M', 'S', 'G', ' ' );
+
+ Semaphore_name[ 1 ] = rtems_build_name( 'S', 'E', 'M', ' ' );
+
+ if ( Multiprocessing_configuration.node == 1 ) {
+ puts( "Creating Message Queue (Global)" );
+ status = rtems_message_queue_create(
+ Queue_name[ 1 ],
+ 3,
+ RTEMS_GLOBAL|RTEMS_LIMIT,
+ &Queue_id[ 1 ]
+ );
+ directive_failed( status, "rtems_message_queue_create" );
+
+ puts( "Creating Semaphore (Global)" );
+ status = rtems_semaphore_create(
+ Semaphore_name[ 1 ],
+ 1,
+ RTEMS_GLOBAL | RTEMS_PRIORITY,
+ &Semaphore_id[ 1 ]
+ );
+ directive_failed( status, "rtems_semaphore_create" );
+
+ status = rtems_semaphore_obtain(
+ Semaphore_id[ 1 ],
+ RTEMS_DEFAULT_OPTIONS,
+ RTEMS_NO_TIMEOUT
+ );
+ directive_failed( status, "rtems_semaphore_obtain" );
+ }
+
+ puts( "Creating Test_task 1 (local)" );
+ status = rtems_task_create(
+ Task_name[ 1 ],
+ 1,
+ 1024,
+ RTEMS_TIMESLICE,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 1 ]
+ );
+ directive_failed( status, "rtems_task_create" );
+
+ puts( "Starting Test_task 1 (local)" );
+ status = rtems_task_start( Task_id[ 1 ], Test_task1, 0 );
+ directive_failed( status, "rtems_task_start" );
+
+ puts( "Creating Test_task 2 (local)" );
+ status = rtems_task_create(
+ Task_name[ 2 ],
+ 1,
+ 1024,
+ RTEMS_TIMESLICE,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 2 ]
+ );
+ directive_failed( status, "rtems_task_create" );
+
+ puts( "Starting Test_task 2 (local)" );
+ status = rtems_task_start( Task_id[ 2 ], Test_task2, 0 );
+ directive_failed( status, "rtems_task_start" );
+
+ if ( Multiprocessing_configuration.node == 1 ) {
+ status = rtems_task_wake_after( 5 * TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after" );
+
+ puts( "*** END OF TEST 13 ***" );
+ exit( 0 );
+ }
+ puts( "Deleting initialization task" );
+ status = rtems_task_delete( RTEMS_SELF );
+ directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
+}
diff --git a/testsuites/mptests/mp13/node1/mp13.doc b/testsuites/mptests/mp13/node1/mp13.doc
new file mode 100644
index 0000000000..abf558b443
--- /dev/null
+++ b/testsuites/mptests/mp13/node1/mp13.doc
@@ -0,0 +1,48 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: test62
+
+GLOBAL SEMAPHORE TEST
+
+directives:
+ ex_init, ex_start, t_create, t_start, tm_tick, i_return, tm_wkafter,
+ sm_create, q_create, sm_p, q_receive
+
+concepts:
+
+ a. Verifies system can create and start both the executive's system
+ initialization and idle task.
+
+ b. Verifies executive can swap between three application tasks at the
+ same priority and the executive's internal idle task.
+
+ c. Verifies can print strings to the CRT on port 2 of the mvme136 board
+ using Print and Println in the board support package.
+
+ d. Verifies interrupt handler can handler a task switch from an interrupt
+ as specified with the i_return directive.
+
+ e. Verifies executive initialization performed correctly.
+
+ f. Verifies the executive trap handler except for the halt function.
+
+ g. Verifies the Shared Memory Locked Queue Driver.
+
+ h. Verifies that E_MESSAGETIMEOUT is when waiting on a
+ remote message queue.
+
+ i. Verifies that E_SEMTIMEOUT is when waiting on a remote semaphore.
+
+ j. Verifies that a task can delete itself.
diff --git a/testsuites/mptests/mp13/node1/mp13.scn b/testsuites/mptests/mp13/node1/mp13.scn
new file mode 100644
index 0000000000..d3bd11f65e
--- /dev/null
+++ b/testsuites/mptests/mp13/node1/mp13.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/mptests/mp13/node2/mp13.doc b/testsuites/mptests/mp13/node2/mp13.doc
new file mode 100644
index 0000000000..0de40191c6
--- /dev/null
+++ b/testsuites/mptests/mp13/node2/mp13.doc
@@ -0,0 +1,13 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+
diff --git a/testsuites/mptests/mp13/node2/mp13.scn b/testsuites/mptests/mp13/node2/mp13.scn
new file mode 100644
index 0000000000..e9df202a94
--- /dev/null
+++ b/testsuites/mptests/mp13/node2/mp13.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 ...
+Receiving message ...
+Releasing semaphore ...
+Getting semaphore ...
+rtems_message_queue_receive correctly returned RTEMS_TIMEOUT
+Deleting self
+rtems_semaphore_obtain correctly returned RTEMS_TIMEOUT
+*** END OF TEST 13 ***
diff --git a/testsuites/mptests/mp13/system.h b/testsuites/mptests/mp13/system.h
new file mode 100644
index 0000000000..aa2c6d17e4
--- /dev/null
+++ b/testsuites/mptests/mp13/system.h
@@ -0,0 +1,30 @@
+/* system.h
+ *
+ * This include file contains information that is included in every
+ * function in the test set.
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include "tmacros.h"
+
+/* Miscellaneous */
+
+#define EXTERN extern /* external definition */
+
+/* macros */
+
+/* structures */
+
+#include "gvar.h"
+
+/* end of include file */
diff --git a/testsuites/mptests/mp13/task1.c b/testsuites/mptests/mp13/task1.c
new file mode 100644
index 0000000000..180d0fd101
--- /dev/null
+++ b/testsuites/mptests/mp13/task1.c
@@ -0,0 +1,70 @@
+/* Test_task1
+ *
+ * This task attempts to receive a message from a global message queue.
+ * If running on the node on which the queue resides, the wait is
+ * forever, otherwise it times out on a remote message queue.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_task Test_task1(
+ rtems_task_argument argument
+)
+{
+ char receive_buffer[16];
+ rtems_status_code status;
+
+ puts( "Getting QID of message queue" );
+
+ do {
+ status = rtems_message_queue_ident(
+ Queue_name[ 1 ],
+ RTEMS_SEARCH_ALL_NODES,
+ &Queue_id[ 1 ]
+ );
+ } while ( !rtems_is_status_successful( status ) );
+
+ if ( Multiprocessing_configuration.node == 1 ) {
+ puts( "Receiving message ..." );
+ status = rtems_message_queue_receive(
+ Queue_id[ 1 ],
+ (long (*)[4])receive_buffer,
+ RTEMS_DEFAULT_OPTIONS,
+ RTEMS_NO_TIMEOUT
+ );
+ puts( "How did I get back from here????" );
+ directive_failed( status, "rtems_message_queue_receive" );
+ }
+
+ status = rtems_task_wake_after( TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after" );
+
+ puts( "Receiving message ..." );
+ status = rtems_message_queue_receive(
+ Queue_id[ 1 ],
+ (long (*)[4])receive_buffer,
+ RTEMS_DEFAULT_OPTIONS,
+ 2 * TICKS_PER_SECOND
+ );
+ fatal_directive_status(status, RTEMS_TIMEOUT, "rtems_message_queue_receive");
+ puts( "rtems_message_queue_receive correctly returned RTEMS_TIMEOUT" );
+
+ puts( "Deleting self" );
+ status = rtems_task_delete( RTEMS_SELF );
+ directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
+}
diff --git a/testsuites/mptests/mp13/task2.c b/testsuites/mptests/mp13/task2.c
new file mode 100644
index 0000000000..a43b64d3cf
--- /dev/null
+++ b/testsuites/mptests/mp13/task2.c
@@ -0,0 +1,106 @@
+/* Test_task2
+ *
+ * This task attempts to receive control of a global semaphore.
+ * If running on the node on which the semaphore resides, the wait is
+ * forever, otherwise it times out on a remote semaphore.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_task Test_task2(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+
+ puts( "Getting SMID of semaphore" );
+ do {
+ status = rtems_semaphore_ident(
+ Semaphore_name[ 1 ],
+ RTEMS_SEARCH_ALL_NODES,
+ &Semaphore_id[ 1 ]
+ );
+ } while ( !rtems_is_status_successful( status ) );
+
+ directive_failed( status, "rtems_semaphore_ident" );
+
+ if ( Multiprocessing_configuration.node == 1 ) {
+ status = rtems_task_wake_after( TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after" );
+
+ puts( "Releasing semaphore ..." );
+ status = rtems_semaphore_release( Semaphore_id[ 1 ] );
+ directive_failed( status, "rtems_semaphore_release" );
+
+ status = rtems_task_wake_after( TICKS_PER_SECOND / 2 );
+ directive_failed( status, "rtems_task_wake_after" );
+
+ puts( "Getting semaphore ..." );
+ status = rtems_semaphore_obtain(
+ Semaphore_id[ 1 ],
+ RTEMS_DEFAULT_OPTIONS,
+ RTEMS_NO_TIMEOUT
+ );
+ directive_failed( status, "rtems_semaphore_obtain" );
+
+ puts( "Getting semaphore ..." );
+ status = rtems_semaphore_obtain(
+ Semaphore_id[ 1 ],
+ RTEMS_DEFAULT_OPTIONS,
+ RTEMS_NO_TIMEOUT
+ );
+ puts( "How did I get back from here????" );
+ directive_failed( status, "rtems_semaphore_obtain" );
+ }
+
+/*
+ status = rtems_task_wake_after( TICKS_PER_SECOND / 2 );
+ directive_failed( status, "rtems_task_wake_after" );
+*/
+
+ puts( "Getting semaphore ..." );
+ status = rtems_semaphore_obtain(
+ Semaphore_id[ 1 ],
+ RTEMS_DEFAULT_OPTIONS,
+ RTEMS_NO_TIMEOUT
+ );
+ directive_failed( status, "rtems_semaphore_obtain" );
+
+ puts( "Releasing semaphore ..." );
+ status = rtems_semaphore_release( Semaphore_id[ 1 ] );
+ directive_failed( status, "rtems_semaphore_release" );
+
+ status = rtems_task_wake_after( TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after" );
+
+ puts( "Getting semaphore ..." );
+ status = rtems_semaphore_obtain(
+ Semaphore_id[ 1 ],
+ RTEMS_DEFAULT_OPTIONS,
+ 2 * TICKS_PER_SECOND
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_TIMEOUT,
+ "rtems_semaphore_obtain"
+ );
+ puts( "rtems_semaphore_obtain correctly returned RTEMS_TIMEOUT" );
+
+ puts( "*** END OF TEST 13 ***" );
+ exit( 0 );
+}
diff --git a/testsuites/mptests/mp14/delay.c b/testsuites/mptests/mp14/delay.c
new file mode 100644
index 0000000000..7062c4ad21
--- /dev/null
+++ b/testsuites/mptests/mp14/delay.c
@@ -0,0 +1,34 @@
+/* Delayed_send_event
+ *
+ * This routine is a timer service routine which sends an event to a task.
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_timer_service_routine Delayed_send_event(
+ rtems_id timer_id,
+ void *ignored
+)
+{
+ rtems_status_code status;
+
+ status = rtems_event_send(
+ Task_id[ rtems_get_index( timer_id ) ],
+ RTEMS_EVENT_16
+ );
+ directive_failed( status, "rtems_event_send" );
+}
diff --git a/testsuites/mptests/mp14/evtask1.c b/testsuites/mptests/mp14/evtask1.c
new file mode 100644
index 0000000000..6f8175e4d4
--- /dev/null
+++ b/testsuites/mptests/mp14/evtask1.c
@@ -0,0 +1,86 @@
+/* Test_task
+ *
+ * This task either continuously sends events to a remote task, or
+ * continuously receives events sent by a remote task. This decision
+ * is based upon the local node number.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+extern rtems_multiprocessing_table Multiprocessing_configuration;
+
+rtems_task Test_task(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+ rtems_unsigned32 count;
+ rtems_unsigned32 remote_node;
+ rtems_id remote_tid;
+ rtems_event_set event_out;
+
+ remote_node = ((Multiprocessing_configuration.node == 1) ? 2 : 1);
+
+ puts( "About to go to sleep!" );
+ status = rtems_task_wake_after( TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after" );
+ puts( "Waking up!" );
+
+ puts_nocr( "Remote task's name is : " );
+ put_name( Task_name[ remote_node ], TRUE );
+
+ puts( "Getting TID of remote task" );
+ while ( FOREVER ) {
+ status = rtems_task_ident(
+ Task_name[ remote_node ],
+ RTEMS_SEARCH_ALL_NODES,
+ &remote_tid
+ );
+
+ if ( status == RTEMS_SUCCESSFUL )
+ break;
+ puts( "rtems_task_ident" );
+ }
+
+ if ( Multiprocessing_configuration.node == 1 ) {
+ puts( "Sending events to remote task" );
+ while ( Stop_Test == FALSE ) {
+ for ( count=EVENT_TASK_DOT_COUNT; Stop_Test == FALSE && count; count-- ) {
+ status = rtems_event_send( remote_tid, RTEMS_EVENT_16 );
+ directive_failed( status, "rtems_event_send" );
+ }
+ put_dot( 'e' );
+ }
+ }
+
+ puts( "Receiving events from remote task" );
+ while ( Stop_Test == FALSE ) {
+ for ( count=EVENT_TASK_DOT_COUNT ; Stop_Test == FALSE && count ; count-- ) {
+ status = rtems_event_receive(
+ RTEMS_EVENT_16,
+ RTEMS_DEFAULT_OPTIONS,
+ RTEMS_NO_TIMEOUT,
+ &event_out
+ );
+ directive_failed( status, "rtems_event_receive" );
+ }
+ put_dot( 'e' );
+ }
+
+ Exit_test();
+}
diff --git a/testsuites/mptests/mp14/evtmtask.c b/testsuites/mptests/mp14/evtmtask.c
new file mode 100644
index 0000000000..c540eb98fb
--- /dev/null
+++ b/testsuites/mptests/mp14/evtmtask.c
@@ -0,0 +1,65 @@
+/* Delayed_events_task
+ *
+ * This task continuously sends itself events at one tick
+ * intervals.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_task Delayed_events_task(
+ rtems_task_argument argument
+)
+{
+ rtems_unsigned32 count;
+ rtems_unsigned32 previous_mode;
+ rtems_status_code status;
+ rtems_event_set events;
+
+ status = rtems_task_mode(
+ RTEMS_PREEMPT | RTEMS_TIMESLICE,
+ RTEMS_PREEMPT_MASK | RTEMS_TIMESLICE_MASK,
+ &previous_mode
+ );
+ directive_failed( status, "rtems_task_mode" );
+
+ status = rtems_timer_create( Timer_name[ 1 ], &Timer_id[ 1 ] );
+ directive_failed( status, "rtems_timer_create" );
+
+ while ( Stop_Test == FALSE ) {
+ for ( count=DELAYED_EVENT_DOT_COUNT; Stop_Test == FALSE && count; count-- ){
+ status = rtems_timer_fire_after(
+ Timer_id[ 1 ],
+ 1,
+ Delayed_send_event,
+ NULL
+ );
+ directive_failed( status, "rtems_timer_reset" );
+
+ status = rtems_event_receive(
+ RTEMS_EVENT_16,
+ RTEMS_DEFAULT_OPTIONS,
+ RTEMS_NO_TIMEOUT,
+ &events
+ );
+ directive_failed( status, "rtems_event_receive" );
+ }
+ put_dot('.');
+ }
+
+ Exit_test();
+}
diff --git a/testsuites/mptests/mp14/exit.c b/testsuites/mptests/mp14/exit.c
new file mode 100644
index 0000000000..65fc0df49f
--- /dev/null
+++ b/testsuites/mptests/mp14/exit.c
@@ -0,0 +1,33 @@
+/* Exit_test
+ *
+ * This routine safely stops the test and prints some information
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+void Exit_test( void )
+{
+ rtems_status_code status;
+ rtems_mode old_mode;
+
+ status = rtems_task_mode( RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &old_mode );
+ directive_failed( status, "rtems_task_mode" );
+
+ MPCI_Print_statistics();
+
+ rtems_shutdown_executive( 0 );
+}
diff --git a/testsuites/mptests/mp14/init.c b/testsuites/mptests/mp14/init.c
new file mode 100644
index 0000000000..ab403ad395
--- /dev/null
+++ b/testsuites/mptests/mp14/init.c
@@ -0,0 +1,194 @@
+/* Init
+ *
+ * This routine is the initialization task for this test program.
+ * It is a user initialization task and has the responsibility for creating
+ * and starting the tasks that make up the test. If the time of day
+ * clock is required for the test, it should also be set to a known
+ * value by this function.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+#undef EXTERN
+#define EXTERN
+#include "conftbl.h"
+#include "gvar.h"
+
+#include "bsp.h"
+
+rtems_unsigned8 my_partition[0x30000] CPU_STRUCTURE_ALIGNMENT;
+
+rtems_timer_service_routine Stop_Test_TSR(
+ rtems_id ignored_id,
+ void *ignored_address
+)
+{
+ Stop_Test = TRUE;
+}
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+ rtems_task_priority previous_priority;
+
+ printf(
+ "\n\n*** TEST 14 -- NODE %d ***\n",
+ Multiprocessing_configuration.node
+ );
+
+ Stop_Test = FALSE;
+
+ status = rtems_timer_create(
+ rtems_build_name('S', 'T', 'O', 'P'),
+ &timer_id
+ );
+ directive_failed( status, "rtems_timer_create" );
+
+ status = rtems_timer_fire_after(
+ timer_id,
+ MAX_LONG_TEST_DURATION * TICKS_PER_SECOND,
+ Stop_Test_TSR,
+ NULL
+ );
+ directive_failed( status, "rtems_timer_fire_after" );
+
+ Task_name[ 1 ] = rtems_build_name( '1', '1', '1', ' ' );
+ Task_name[ 2 ] = rtems_build_name( '2', '2', '2', ' ' );
+
+ Queue_task_name[ 1 ] = rtems_build_name( 'M', 'T', '1', ' ' );
+ Queue_task_name[ 2 ] = rtems_build_name( 'M', 'T', '2', ' ' );
+
+ Partition_task_name[ 1 ] = rtems_build_name( 'P', 'T', '1', ' ' );
+ Partition_task_name[ 2 ] = rtems_build_name( 'P', 'T', '2', ' ' );
+
+ Semaphore_task_name[ 1 ] = rtems_build_name( 'S', 'M', '1', ' ' );
+ Semaphore_task_name[ 2 ] = rtems_build_name( 'S', 'M', '2', ' ' );
+
+ Semaphore_name[ 1 ] = rtems_build_name( 'S', 'E', 'M', ' ' );
+
+ Queue_name[ 1 ] = rtems_build_name( 'M', 'S', 'G', ' ' );
+
+ Partition_name[ 1 ] = rtems_build_name( 'P', 'A', 'R', ' ' );
+
+ Timer_name[ 1 ] = rtems_build_name( 'T', 'M', 'R', ' ' );
+
+ if ( Multiprocessing_configuration.node == 1 ) {
+ puts( "Creating Semaphore (Global)" );
+ status = rtems_semaphore_create(
+ Semaphore_name[ 1 ],
+ 1,
+ RTEMS_GLOBAL,
+ &Semaphore_id[ 1 ]
+ );
+ directive_failed( status, "rtems_semaphore_create" );
+
+ puts( "Creating Message Queue (Global)" );
+ status = rtems_message_queue_create(
+ Queue_name[ 1 ],
+ 1,
+ RTEMS_GLOBAL,
+ &Queue_id[ 1 ]
+ );
+ directive_failed( status, "rtems_message_queue_create" );
+
+ puts( "Creating Partition (Global)" );
+ status = rtems_partition_create(
+ Partition_name[ 1 ],
+ (void *)my_partition,
+ 0x8000,
+ 0x3800,
+ RTEMS_GLOBAL,
+ &Partition_id[ 1 ]
+ );
+ directive_failed( status, "rtems_partition_create" );
+ }
+
+ puts( "Creating Event task (Global)" );
+ status = rtems_task_create(
+ Task_name[ Multiprocessing_configuration.node ],
+ 2,
+ 2048,
+ RTEMS_TIMESLICE,
+ RTEMS_GLOBAL,
+ &Event_task_id[ 1 ]
+ );
+ directive_failed( status, "rtems_task_create" );
+
+ puts( "Starting Event task (Global)" );
+ status = rtems_task_start( Event_task_id[ 1 ], Test_task, 0 );
+ directive_failed( status, "rtems_task_start" );
+
+ puts( "Creating Semaphore task (Global)" );
+ status = rtems_task_create(
+ Semaphore_task_name[ Multiprocessing_configuration.node ],
+ 2,
+ 2048,
+ RTEMS_TIMESLICE,
+ RTEMS_GLOBAL,
+ &Semaphore_task_id[ 1 ]
+ );
+ directive_failed( status, "rtems_task_create" );
+
+ puts( "Starting Semaphore task (Global)" );
+ status = rtems_task_start( Semaphore_task_id[ 1 ], Semaphore_task, 0 );
+ directive_failed( status, "rtems_task_start" );
+
+ puts( "Creating Message Queue task (Global)" );
+ status = rtems_task_create(
+ Queue_task_name[ Multiprocessing_configuration.node ],
+ 2,
+ 2048,
+ RTEMS_TIMESLICE,
+ RTEMS_GLOBAL,
+ &Queue_task_id[ 1 ]
+ );
+ directive_failed( status, "rtems_task_create" );
+
+ /* argument is index into Buffers */
+ puts( "Starting Message Queue task (Global)" );
+ status = rtems_task_start( Queue_task_id[ 1 ], Message_queue_task, 1 );
+ directive_failed( status, "rtems_task_start" );
+
+ puts( "Creating Partition task (Global)" );
+ status = rtems_task_create(
+ Partition_task_name[ Multiprocessing_configuration.node ],
+ 2,
+ 2048,
+ RTEMS_TIMESLICE,
+ RTEMS_GLOBAL,
+ &Partition_task_id[ 1 ]
+ );
+ directive_failed( status, "rtems_task_create" );
+
+ puts( "Starting Partition task (Global)" );
+ status = rtems_task_start( Partition_task_id[ 1 ], Partition_task, 0 );
+ directive_failed( status, "rtems_task_start" );
+
+ status = rtems_task_set_priority( RTEMS_SELF, 2, &previous_priority );
+ directive_failed( status, "rtems_task_set_priority" );
+
+ status = rtems_task_ident(
+ RTEMS_SELF,
+ RTEMS_SEARCH_ALL_NODES,
+ &Task_id[ 1 ]
+ );
+ directive_failed( status, "rtems_task_ident" );
+
+ Delayed_events_task( 1 );
+}
diff --git a/testsuites/mptests/mp14/msgtask1.c b/testsuites/mptests/mp14/msgtask1.c
new file mode 100644
index 0000000000..2a9f6e235b
--- /dev/null
+++ b/testsuites/mptests/mp14/msgtask1.c
@@ -0,0 +1,102 @@
+/* Message_queue_task
+ *
+ * This task continuously sends messages to and receives messages from
+ * a global message queue. The message buffer is viewed as an array
+ * of two sixty-four bit counts which are incremented when a message is
+ * received.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_task Message_queue_task(
+ rtems_task_argument index
+)
+{
+ rtems_status_code status;
+ rtems_unsigned32 count;
+ rtems_unsigned32 yield_count;
+ rtems_unsigned32 *buffer_count;
+ rtems_unsigned32 *overflow_count;
+
+ Msg_buffer[ index ][0] = 0;
+ Msg_buffer[ index ][1] = 0;
+ Msg_buffer[ index ][2] = 0;
+ Msg_buffer[ index ][3] = 0;
+
+ puts( "Getting ID of msg queue" );
+ while ( FOREVER ) {
+ status = rtems_message_queue_ident(
+ Queue_name[ 1 ],
+ RTEMS_SEARCH_ALL_NODES,
+ &Queue_id[ 1 ]
+ );
+ if ( status == RTEMS_SUCCESSFUL )
+ break;
+ puts( "rtems_message_queue_ident FAILED!!" );
+ }
+
+ if ( Multiprocessing_configuration.node == 1 ) {
+ status = rtems_message_queue_send(
+ Queue_id[ 1 ],
+ (long (*)[4])Msg_buffer[ index ]
+ );
+ directive_failed( status, "rtems_message_queue_send" );
+ overflow_count = &Msg_buffer[ index ][0];
+ buffer_count = &Msg_buffer[ index ][1];
+ } else {
+ overflow_count = &Msg_buffer[ index ][2];
+ buffer_count = &Msg_buffer[ index ][3];
+ }
+
+ while ( Stop_Test == FALSE ) {
+ yield_count = 100;
+
+ for ( count=MESSAGE_DOT_COUNT ; Stop_Test == FALSE && count ; count-- ) {
+ status = rtems_message_queue_receive(
+ Queue_id[ 1 ],
+ (long (*)[4])Msg_buffer[ index ],
+ RTEMS_DEFAULT_OPTIONS,
+ RTEMS_NO_TIMEOUT
+ );
+ directive_failed( status, "rtems_message_queue_receive" );
+
+ if ( *buffer_count == (rtems_unsigned32)0xffffffff ) {
+ *buffer_count = 0;
+ *overflow_count += 1;
+ } else
+ *buffer_count += 1;
+
+ status = rtems_message_queue_send(
+ Queue_id[ 1 ],
+ (long (*)[4])Msg_buffer[ index ]
+ );
+ directive_failed( status, "rtems_message_queue_send" );
+
+ if (Stop_Test == FALSE)
+ if ( Multiprocessing_configuration.node == 1 && --yield_count == 0 ) {
+ status = rtems_task_wake_after( RTEMS_YIELD_PROCESSOR );
+ directive_failed( status, "rtems_task_wake_after" );
+
+ yield_count = 100;
+ }
+ }
+ put_dot( 'm' );
+ }
+
+ Exit_test();
+}
diff --git a/testsuites/mptests/mp14/node1/mp14.doc b/testsuites/mptests/mp14/node1/mp14.doc
new file mode 100644
index 0000000000..5ac3f7e47a
--- /dev/null
+++ b/testsuites/mptests/mp14/node1/mp14.doc
@@ -0,0 +1,50 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: test63
+
+INTERRUPT SATURATION TEST
+
+directives:
+ ex_init, ex_start, t_create, t_start, t_ident, tm_tick,
+ tm_evwhen, tm_wkafter, i_return, ev_send, ev_receive
+
+concepts:
+
+ a. Verifies system can create and start both the executive's system
+ initialization and idle task.
+
+ b. Verifies executive can swap between three application tasks at the
+ same priority and the executive's internal idle task.
+
+ c. Verifies printing of strings to the CRT on port 2 of the mvme136 board
+ using Print and Println in the board support package.
+
+ d. Verifies printing of strings to the CRT on port 2 of the mvme136 board
+ using Write and Writeln and the TTY driver.
+
+ e. Verifies interrupt handler can handler a task switch from an interrupt
+ as specified with the i_return directive.
+
+ f. Verifies executive initialization performed correctly.
+
+ g. Verifies the executive trap handler except for the halt function.
+
+ h. Verifies that a task can get the task identification number of itself.
+
+ i. Verifies that a task can get the task identification number
+ of another task.
+
+ j. Verifies that events can be sent to a remote task.
diff --git a/testsuites/mptests/mp14/node1/mp14.scn b/testsuites/mptests/mp14/node1/mp14.scn
new file mode 100644
index 0000000000..98202bc439
--- /dev/null
+++ b/testsuites/mptests/mp14/node1/mp14.scn
@@ -0,0 +1,38 @@
+*** 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
+<stream of following characters>
+
+. - indicates 100 iterations of
+ tm_evafter of 1 tick and rtems_event_receive.
+
+e - indicates that 100
+ events have been sent to the remote task.
+
+m - indicates 100 iterations of
+ rtems_message_queue_send and rtems_message_queue_receive.
+
+p - indicates 100 iterations of
+ rtems_partition_get_buffer and rtems_partition_return_buffer.
+
+s - indicates 100 iterations of
+ rtems_semaphore_obtain and rtems_semaphore_release.
+
+NOTE: The messages could be interspersed.
diff --git a/testsuites/mptests/mp14/node2/mp14.doc b/testsuites/mptests/mp14/node2/mp14.doc
new file mode 100644
index 0000000000..0de40191c6
--- /dev/null
+++ b/testsuites/mptests/mp14/node2/mp14.doc
@@ -0,0 +1,13 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+
diff --git a/testsuites/mptests/mp14/node2/mp14.scn b/testsuites/mptests/mp14/node2/mp14.scn
new file mode 100644
index 0000000000..cd82f3c81b
--- /dev/null
+++ b/testsuites/mptests/mp14/node2/mp14.scn
@@ -0,0 +1,35 @@
+*** 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
+<stream of following characters>
+
+. - indicates 100 iterations of
+ tm_evafter of 1 tick and rtems_event_receive.
+
+e - indicates that 100
+ events have been sent to the remote task.
+
+m - indicates 100 iterations of
+ rtems_message_queue_send and rtems_message_queue_receive.
+
+p - indicates 100 iterations of
+ rtems_partition_get_buffer and rtems_partition_return_buffer.
+
+s - indicates 100 iterations of
+ rtems_semaphore_obtain and rtems_semaphore_release.
+
+NOTE: The messages could be interspersed.
diff --git a/testsuites/mptests/mp14/pttask1.c b/testsuites/mptests/mp14/pttask1.c
new file mode 100644
index 0000000000..f6af1b0969
--- /dev/null
+++ b/testsuites/mptests/mp14/pttask1.c
@@ -0,0 +1,65 @@
+/* Partition_task
+ *
+ * This task continuously gets a buffer from and returns that buffer
+ * to a global partition.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+extern rtems_multiprocessing_table Multiprocessing_configuration;
+
+rtems_task Partition_task(
+ rtems_task_argument argument
+)
+{
+ rtems_unsigned32 count;
+ rtems_status_code status;
+ void *buffer;
+
+ puts( "Getting ID of partition" );
+ while ( FOREVER ) {
+ status = rtems_partition_ident(
+ Partition_name[ 1 ],
+ RTEMS_SEARCH_ALL_NODES,
+ &Partition_id[ 1 ]
+ );
+
+ if ( status == RTEMS_SUCCESSFUL )
+ break;
+
+ puts( "rtems_partition_ident FAILED!!" );
+ }
+
+ while ( Stop_Test == FALSE ) {
+ for ( count=PARTITION_DOT_COUNT ; Stop_Test == FALSE && count ; count-- ) {
+ status = rtems_partition_get_buffer( Partition_id[ 1 ], &buffer );
+ directive_failed( status, "rtems_partition_get_buffer" );
+
+ status = rtems_partition_return_buffer( Partition_id[ 1 ], buffer );
+ directive_failed( status, "rtems_partition_return_buffer" );
+
+ if ( Multiprocessing_configuration.node == 1 ) {
+ status = rtems_task_wake_after( RTEMS_YIELD_PROCESSOR );
+ directive_failed( status, "rtems_task_wake_after" );
+ }
+ }
+ put_dot( 'p' );
+ }
+
+ Exit_test();
+}
diff --git a/testsuites/mptests/mp14/smtask1.c b/testsuites/mptests/mp14/smtask1.c
new file mode 100644
index 0000000000..c4d71c0101
--- /dev/null
+++ b/testsuites/mptests/mp14/smtask1.c
@@ -0,0 +1,70 @@
+/* Sm_test_task
+ *
+ * This task continuously obtains and releases a global semaphore.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+extern rtems_multiprocessing_table Multiprocessing_configuration;
+
+rtems_task Semaphore_task(
+ rtems_task_argument argument
+)
+{
+ rtems_unsigned32 count;
+ rtems_status_code status;
+ rtems_unsigned32 yield_count;
+
+ puts( "Getting SMID of semaphore" );
+ while ( FOREVER ) {
+ status = rtems_semaphore_ident(
+ Semaphore_name[ 1 ],
+ RTEMS_SEARCH_ALL_NODES,
+ &Semaphore_id[ 1 ]
+ );
+ if ( status == RTEMS_SUCCESSFUL )
+ break;
+ puts( "rtems_semaphore_ident FAILED!!" );
+ }
+
+ while ( Stop_Test == FALSE ) {
+ yield_count = 100;
+
+ for ( count=SEMAPHORE_DOT_COUNT ; Stop_Test == FALSE && count ; count-- ) {
+ status = rtems_semaphore_obtain(
+ Semaphore_id[ 1 ],
+ RTEMS_DEFAULT_OPTIONS,
+ RTEMS_NO_TIMEOUT
+ );
+ directive_failed( status, "rtems_semaphore_obtain" );
+
+ status = rtems_semaphore_release( Semaphore_id[ 1 ] );
+ directive_failed( status, "rtems_semaphore_release" );
+
+ if ( Multiprocessing_configuration.node == 1 && --yield_count == 0 ) {
+ status = rtems_task_wake_after( RTEMS_YIELD_PROCESSOR );
+ directive_failed( status, "rtems_task_wake_after" );
+
+ yield_count = 100;
+ }
+ }
+ put_dot( 's' );
+ }
+
+ Exit_test();
+}
diff --git a/testsuites/mptests/mp14/system.h b/testsuites/mptests/mp14/system.h
new file mode 100644
index 0000000000..f2393df080
--- /dev/null
+++ b/testsuites/mptests/mp14/system.h
@@ -0,0 +1,31 @@
+/* system.h
+ *
+ * This include file contains information that is included in every
+ * function in the test set.
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include "tmacros.h"
+#include "mpci.h"
+
+/* Miscellaneous */
+
+#define EXTERN extern /* external definition */
+
+/* macros */
+
+/* structures */
+
+#include "gvar.h"
+
+/* end of include file */
diff --git a/testsuites/samples/README b/testsuites/samples/README
new file mode 100644
index 0000000000..77a734193f
--- /dev/null
+++ b/testsuites/samples/README
@@ -0,0 +1,71 @@
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+This directory contains the RTEMS Sample Application Suite.
+The tests in this directory perform two functions:
+
+ + provide simple examples of applications which can be
+ used as a starting point for your application.
+
+ + help test a new board support package
+
+The hello and ticker applications are useful when first bringing up
+a new board support package. The base_mp test is useful when
+performing initial checkout on a new MPCI layer.
+
+The following describes each of the sample applications:
+
+ base_mp
+
+ This is a very simple two node multiprocessor application. It consists
+ of a single initialization task on each node which print out
+ their respective node numbers and task IDs. This test can be
+ used as a simple test of a new MPCI layer because it minimizes
+ the number of packets sent by RTEMS.
+
+ This is intended as a starting point for custom developed multiprocessor
+ applications.
+
+ base_sp
+
+ This is a simple single processor application which consists of
+ an initialization task which creates another task.
+
+ This is intended as a starting point for custom developed single
+ processor applications.
+
+ cdtest
+
+ A very simple C++ application which demonstrates that it is
+ possible to use C++ contructors and destructors in an RTEMS
+ application. Also does a perfunctory iostream test.
+
+ hello
+
+ This is the RTEMS version of the classic hello world program.
+ It consists of single initialization task which prints out
+ a few messages.
+
+ This test does not include a Clock Tick device driver and can
+ be used to test the startup code of the board support package
+ as well as console output.
+
+ paranoia
+
+ A public domain test of the floating point and math library
+ capabilities of a toolset. It reports discrepancies between
+ actual and expected results. It is a large test.
+
+ ticker
+
+ This is a simple test of the user's Clock Tick device driver.
+ This test has an initialization task create three application
+ tasks which sleep and periodically wake up and print the time.
+
diff --git a/testsuites/samples/base_mp/apptask.c b/testsuites/samples/base_mp/apptask.c
new file mode 100644
index 0000000000..04f081ad5c
--- /dev/null
+++ b/testsuites/samples/base_mp/apptask.c
@@ -0,0 +1,38 @@
+/* Application_task
+ *
+ * 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.
+ *
+ * Input parameters:
+ * node - processor's node number
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+#include "libcsupport.h"
+
+rtems_task Application_task(
+ rtems_task_argument node
+)
+{
+ rtems_id tid;
+ rtems_status_code status;
+
+ status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
+ printf( "This task was invoked with the node argument (%d)\n", node );
+ printf( "This task has the id of 0x%x\n", tid );
+ printf( "*** END OF SAMPLE MULTIPROCESSOR APPLICATION ***\n" );
+ exit( 0 );
+}
diff --git a/testsuites/samples/base_mp/init.c b/testsuites/samples/base_mp/init.c
new file mode 100644
index 0000000000..a844d9032b
--- /dev/null
+++ b/testsuites/samples/base_mp/init.c
@@ -0,0 +1,46 @@
+/* Init
+ *
+ * This routine is the initialization task for this test program.
+ * It is called from init_exec and has the responsibility for creating
+ * and starting the tasks that make up the test. If the time of day
+ * clock is required for the application, the current time might be
+ * set by this task.
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+#undef EXTERN
+#define EXTERN
+#include "shm.h"
+#include "conftbl.h"
+#include "gvar.h"
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ rtems_name task_name;
+ rtems_id tid;
+ rtems_status_code status;
+
+ printf( "\n\n*** SAMPLE MULTIPROCESSOR APPLICATION ***\n" );
+ printf( "Creating and starting an application task\n" );
+ task_name = rtems_build_name( 'T', 'A', '1', ' ' );
+ status = rtems_task_create( task_name, 1, 1024,
+ RTEMS_INTERRUPT_LEVEL(0), RTEMS_DEFAULT_ATTRIBUTES, &tid );
+ status = rtems_task_start( tid, Application_task, Mp_conf_addr.node );
+ status = rtems_task_delete( RTEMS_SELF );
+}
diff --git a/testsuites/samples/base_mp/node1/base_mp.doc b/testsuites/samples/base_mp/node1/base_mp.doc
new file mode 100644
index 0000000000..0de40191c6
--- /dev/null
+++ b/testsuites/samples/base_mp/node1/base_mp.doc
@@ -0,0 +1,13 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+
diff --git a/testsuites/samples/base_mp/node1/base_mp.scn b/testsuites/samples/base_mp/node1/base_mp.scn
new file mode 100644
index 0000000000..a2d2f359be
--- /dev/null
+++ b/testsuites/samples/base_mp/node1/base_mp.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/samples/base_mp/node2/base_mp.doc b/testsuites/samples/base_mp/node2/base_mp.doc
new file mode 100644
index 0000000000..0de40191c6
--- /dev/null
+++ b/testsuites/samples/base_mp/node2/base_mp.doc
@@ -0,0 +1,13 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+
diff --git a/testsuites/samples/base_mp/node2/base_mp.scn b/testsuites/samples/base_mp/node2/base_mp.scn
new file mode 100644
index 0000000000..95bc96a808
--- /dev/null
+++ b/testsuites/samples/base_mp/node2/base_mp.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/samples/base_mp/system.h b/testsuites/samples/base_mp/system.h
new file mode 100644
index 0000000000..47347fe30a
--- /dev/null
+++ b/testsuites/samples/base_mp/system.h
@@ -0,0 +1,31 @@
+/* system.h
+ *
+ * This include file contains information that is included in every
+ * function in the test set.
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include "stdio.h"
+#include "libcsupport.h"
+
+/* Miscellaneous */
+
+#define EXTERN extern /* external definition */
+
+/* macros */
+
+/* structures */
+
+#include "gvar.h"
+
+/* end of include file */
diff --git a/testsuites/samples/base_sp/apptask.c b/testsuites/samples/base_sp/apptask.c
new file mode 100644
index 0000000000..c238d356a6
--- /dev/null
+++ b/testsuites/samples/base_sp/apptask.c
@@ -0,0 +1,39 @@
+/* Application_task
+ *
+ * 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.
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+#include "libcsupport.h"
+
+rtems_task Application_task(
+ rtems_task_argument argument
+)
+{
+ rtems_id tid;
+ rtems_status_code status;
+
+ status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
+
+ printf( "Application task was invoked with argument (%d) "
+ "and has id of 0x%x\n", argument, tid );
+
+ printf( "*** END OF SAMPLE SINGLE PROCESSOR APPLICATION ***\n" );
+ exit( 0 );
+}
diff --git a/testsuites/samples/base_sp/base_sp.doc b/testsuites/samples/base_sp/base_sp.doc
new file mode 100644
index 0000000000..0de40191c6
--- /dev/null
+++ b/testsuites/samples/base_sp/base_sp.doc
@@ -0,0 +1,13 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+
diff --git a/testsuites/samples/base_sp/base_sp.scn b/testsuites/samples/base_sp/base_sp.scn
new file mode 100644
index 0000000000..117ddaecb8
--- /dev/null
+++ b/testsuites/samples/base_sp/base_sp.scn
@@ -0,0 +1,5 @@
+*** SAMPLE SINGLE PROCESSOR APPLICATION ***
+Creating and starting an application task
+Application task was invoked with argument (0) and has id of 0x10002
+*** END OF SAMPLE SINGLE PROCESSOR APPLICATION ***
+
diff --git a/testsuites/samples/base_sp/init.c b/testsuites/samples/base_sp/init.c
new file mode 100644
index 0000000000..8c5a533074
--- /dev/null
+++ b/testsuites/samples/base_sp/init.c
@@ -0,0 +1,51 @@
+/* Init
+ *
+ * This routine is the initialization task for this test program.
+ * It is called from init_exec and has the responsibility for creating
+ * and starting the tasks that make up the test. If the time of day
+ * clock is required for the application, the current time might be
+ * set by this task.
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+#undef EXTERN
+#define EXTERN
+#include "conftbl.h"
+#include "gvar.h"
+
+#define ARGUMENT 0
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ rtems_name task_name;
+ rtems_id tid;
+ rtems_status_code status;
+
+ printf( "\n\n*** SAMPLE SINGLE PROCESSOR APPLICATION ***\n" );
+ printf( "Creating and starting an application task\n" );
+
+ task_name = rtems_build_name( 'T', 'A', '1', ' ' );
+
+ status = rtems_task_create( task_name, 1, 1024,
+ RTEMS_INTERRUPT_LEVEL(0), RTEMS_DEFAULT_ATTRIBUTES, &tid );
+
+ status = rtems_task_start( tid, Application_task, ARGUMENT );
+
+ status = rtems_task_delete( RTEMS_SELF );
+}
diff --git a/testsuites/samples/base_sp/system.h b/testsuites/samples/base_sp/system.h
new file mode 100644
index 0000000000..88e60beb9a
--- /dev/null
+++ b/testsuites/samples/base_sp/system.h
@@ -0,0 +1,30 @@
+/* system.h
+ *
+ * This include file contains information that is included in every
+ * function in the test set.
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include "stdio.h"
+
+/* Miscellaneous */
+
+#define EXTERN extern /* external definition */
+
+/* macros */
+
+/* structures */
+
+#include "gvar.h"
+
+/* end of include file */
diff --git a/testsuites/samples/cdtest/cdtest.scn b/testsuites/samples/cdtest/cdtest.scn
new file mode 100644
index 0000000000..a832a72372
--- /dev/null
+++ b/testsuites/samples/cdtest/cdtest.scn
@@ -0,0 +1,31 @@
+Hey I'm in base class constructor number 1 for 0x400010cc.
+Hey I'm in base class constructor number 2 for 0x400010d4.
+Hey I'm in derived class constructor number 3 for 0x400010d4.
+
+
+*** CONSTRUCTOR/DESTRUCTOR TEST ***
+Hey I'm in base class constructor number 4 for 0x4009ee08.
+Hey I'm in base class constructor number 5 for 0x4009ee10.
+Hey I'm in base class constructor number 6 for 0x4009ee18.
+Hey I'm in base class constructor number 7 for 0x4009ee20.
+Hey I'm in derived class constructor number 8 for 0x4009ee20.
+Testing a C++ I/O stream
+Hey I'm in derived class destructor number 8 for 0x4009ee20.
+Derived class - Instantiation order 8
+Hey I'm in base class destructor number 7 for 0x4009ee20.
+Instantiation order 8
+Hey I'm in base class destructor number 6 for 0x4009ee18.
+Instantiation order 6
+Hey I'm in base class destructor number 5 for 0x4009ee10.
+Instantiation order 5
+Hey I'm in base class destructor number 4 for 0x4009ee08.
+Instantiation order 5
+*** END OF CONSTRUCTOR/DESTRUCTOR TEST ***
+
+
+Hey I'm in derived class destructor number 3 for 0x400010d4.
+Derived class - Instantiation order 3
+Hey I'm in base class destructor number 2 for 0x400010d4.
+Instantiation order 3
+Hey I'm in base class destructor number 1 for 0x400010cc.
+Instantiation order 1
diff --git a/testsuites/samples/cdtest/init.c b/testsuites/samples/cdtest/init.c
new file mode 100644
index 0000000000..c233918d61
--- /dev/null
+++ b/testsuites/samples/cdtest/init.c
@@ -0,0 +1,30 @@
+/* Init
+ *
+ * This routine is the initialization task for this test program.
+ * It is called from init_exec and has the responsibility for creating
+ * and starting the tasks that make up the test. If the time of day
+ * clock is required for the test, it should also be set to a known
+ * value by this function.
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+#undef EXTERN
+#define EXTERN
+#include "conftbl.h"
+#include "gvar.h"
+#include <stdio.h>
+#include "libcsupport.h"
diff --git a/testsuites/samples/cdtest/main.cc b/testsuites/samples/cdtest/main.cc
new file mode 100644
index 0000000000..1a12431701
--- /dev/null
+++ b/testsuites/samples/cdtest/main.cc
@@ -0,0 +1,146 @@
+/* main
+ *
+ * This routine is the initialization task for this test program.
+ * It is called from init_exec and has the responsibility for creating
+ * and starting the tasks that make up the test. If the time of day
+ * clock is required for the test, it should also be set to a known
+ * value by this function.
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1994 by Division Incorporated
+ *
+ * Based in part on OAR works.
+ * To anyone who acknowledges that this file is provided "AS IS"
+ * without any express or implied warranty:
+ * permission to use, copy, modify, and distribute this file
+ * for any purpose is hereby granted without fee, provided that
+ * the above copyright notice and this notice appears in all
+ * copies, and that the name of Division Incorporated not be
+ * used in advertising or publicity pertaining to distribution
+ * of the software without specific, written prior permission.
+ * Division Incorporated makes no representations about the
+ * suitability of this software for any purpose.
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include <stdio.h>
+#include <libcsupport.h>
+#include <iostream.h>
+
+extern "C" {
+extern rtems_task main_task(rtems_task_argument);
+}
+
+static int num_inst = 0;
+
+class A {
+public:
+ A(void)
+ {
+ num_inst++;
+ printf(
+ "Hey I'm in base class constructor number %d for %p.\n",
+ num_inst,
+ this
+ );
+
+ /*
+ * Make sure we use some space
+ */
+
+ string = new char[50];
+ sprintf(string, "Instantiation order %d", num_inst);
+ };
+
+ virtual ~A()
+ {
+ printf(
+ "Hey I'm in base class destructor number %d for %p.\n",
+ num_inst,
+ this
+ );
+ print();
+ num_inst--;
+ };
+
+ virtual void print() { printf("%s\n", string); };
+
+protected:
+ char *string;
+};
+
+class B : public A {
+public:
+ B(void)
+ {
+ num_inst++;
+ printf(
+ "Hey I'm in derived class constructor number %d for %p.\n",
+ num_inst,
+ this
+ );
+
+ /*
+ * Make sure we use some space
+ */
+
+ string = new char[50];
+ sprintf(string, "Instantiation order %d", num_inst);
+ };
+
+ ~B()
+ {
+ printf(
+ "Hey I'm in derived class destructor number %d for %p.\n",
+ num_inst,
+ this
+ );
+ print();
+ num_inst--;
+ };
+
+ void print() { printf("Derived class - %s\n", string); }
+};
+
+
+A foo;
+B foobar;
+
+void
+cdtest(void)
+{
+ A bar, blech, blah;
+ B bleak;
+
+ cout << "Testing a C++ I/O stream" << endl;
+
+ bar = blech;
+}
+
+//
+// main equivalent
+// It can not be called 'main' since the bsp owns that name
+// in many implementations in order to get global constructors
+// run.
+//
+// Ref: c/src/lib/libbsp/hppa1_1/simhppa/startup/bspstart.c
+//
+
+
+rtems_task main_task(
+ rtems_task_argument ignored
+)
+{
+ printf( "\n\n*** CONSTRUCTOR/DESTRUCTOR TEST ***\n" );
+
+ cdtest();
+
+ printf( "*** END OF CONSTRUCTOR/DESTRUCTOR TEST ***\n\n\n" );
+
+ exit(0);
+}
diff --git a/testsuites/samples/cdtest/system.h b/testsuites/samples/cdtest/system.h
new file mode 100644
index 0000000000..88e60beb9a
--- /dev/null
+++ b/testsuites/samples/cdtest/system.h
@@ -0,0 +1,30 @@
+/* system.h
+ *
+ * This include file contains information that is included in every
+ * function in the test set.
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include "stdio.h"
+
+/* Miscellaneous */
+
+#define EXTERN extern /* external definition */
+
+/* macros */
+
+/* structures */
+
+#include "gvar.h"
+
+/* end of include file */
diff --git a/testsuites/samples/hello/hello.doc b/testsuites/samples/hello/hello.doc
new file mode 100644
index 0000000000..0de40191c6
--- /dev/null
+++ b/testsuites/samples/hello/hello.doc
@@ -0,0 +1,13 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+
diff --git a/testsuites/samples/hello/hello.scn b/testsuites/samples/hello/hello.scn
new file mode 100644
index 0000000000..d9e92d81d5
--- /dev/null
+++ b/testsuites/samples/hello/hello.scn
@@ -0,0 +1,3 @@
+*** HELLO WORLD TEST ***
+Hello World
+*** END OF HELLO WORLD TEST ***
diff --git a/testsuites/samples/hello/init.c b/testsuites/samples/hello/init.c
new file mode 100644
index 0000000000..f85562c238
--- /dev/null
+++ b/testsuites/samples/hello/init.c
@@ -0,0 +1,41 @@
+/* Init
+ *
+ * This routine is the initialization task for this test program.
+ * It is called from init_exec and has the responsibility for creating
+ * and starting the tasks that make up the test. If the time of day
+ * clock is required for the test, it should also be set to a known
+ * value by this function.
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+#undef EXTERN
+#define EXTERN
+#include "conftbl.h"
+#include "gvar.h"
+#include <stdio.h>
+#include "libcsupport.h"
+
+
+rtems_task Init(
+ rtems_task_argument ignored
+)
+{
+ printf( "\n\n*** HELLO WORLD TEST ***\n" );
+ printf( "Hello World\n" );
+ printf( "*** END OF HELLO WORLD TEST ***\n" );
+ exit( 0 );
+}
diff --git a/testsuites/samples/hello/system.h b/testsuites/samples/hello/system.h
new file mode 100644
index 0000000000..88e60beb9a
--- /dev/null
+++ b/testsuites/samples/hello/system.h
@@ -0,0 +1,30 @@
+/* system.h
+ *
+ * This include file contains information that is included in every
+ * function in the test set.
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include "stdio.h"
+
+/* Miscellaneous */
+
+#define EXTERN extern /* external definition */
+
+/* macros */
+
+/* structures */
+
+#include "gvar.h"
+
+/* end of include file */
diff --git a/testsuites/samples/paranoia/init.c b/testsuites/samples/paranoia/init.c
new file mode 100644
index 0000000000..4e9c9cde09
--- /dev/null
+++ b/testsuites/samples/paranoia/init.c
@@ -0,0 +1,43 @@
+/* Init
+ *
+ * This routine is the initialization task for this test program.
+ * It is called from init_exec and has the responsibility for creating
+ * and starting the tasks that make up the test. If the time of day
+ * clock is required for the test, it should also be set to a known
+ * value by this function.
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+#undef EXTERN
+#define EXTERN
+#include "conftbl.h"
+#include "gvar.h"
+#include "libcsupport.h"
+
+extern int paranoia(int, char **);
+
+char *args[2] = { "paranoia", 0 };
+
+rtems_task Init(
+ rtems_task_argument ignored
+)
+{
+ printf( "\n\n*** PARANOIA TEST ***\n" );
+ paranoia(1, args);
+ printf( "*** END OF PARANOIA TEST ***\n" );
+ exit( 0 );
+}
diff --git a/testsuites/samples/paranoia/paranoia.c b/testsuites/samples/paranoia/paranoia.c
new file mode 100644
index 0000000000..64ebdc7e5e
--- /dev/null
+++ b/testsuites/samples/paranoia/paranoia.c
@@ -0,0 +1,2300 @@
+/*
+ * RTEMS RCS Id: $Id$
+ *
+ * A C version of Kahan's Floating Point Test "Paranoia"
+ *
+ * Thos Sumner, UCSF, Feb. 1985
+ * David Gay, BTL, Jan. 1986
+ *
+ * This is a rewrite from the Pascal version by
+ *
+ * B. A. Wichmann, 18 Jan. 1985
+ *
+ * (and does NOT exhibit good C programming style).
+ *
+ * Sun May 16 18:21:51 MDT 1993 Jeffrey Wheat (cassidy@cygnus.com)
+ * Removed KR_headers defines, removed ANSI prototyping
+ * Cleaned up and reformated code. Added special CYGNUS
+ * "verbose" mode type messages (-DCYGNUS).
+ * Note: This code is VERY NASTY.
+ *
+ * Adjusted to use Standard C headers 19 Jan. 1992 (dmg);
+ * compile with -DKR_headers or insert
+ * #define KR_headers
+ * at the beginning if you have an old-style C compiler.
+ *
+ * (C) Apr 19 1983 in BASIC version by:
+ * Professor W. M. Kahan,
+ * 567 Evans Hall
+ * Electrical Engineering & Computer Science Dept.
+ * University of California
+ * Berkeley, California 94720
+ * USA
+ *
+ * converted to Pascal by:
+ * B. A. Wichmann
+ * National Physical Laboratory
+ * Teddington Middx
+ * TW11 OLW
+ * UK
+ *
+ * converted to C by:
+ *
+ * David M. Gay and Thos Sumner
+ * AT&T Bell Labs Computer Center, Rm. U-76
+ * 600 Mountain Avenue University of California
+ * Murray Hill, NJ 07974 San Francisco, CA 94143
+ * USA USA
+ *
+ * with simultaneous corrections to the Pascal source (reflected
+ * in the Pascal source available over netlib).
+ * [A couple of bug fixes from dgh = sun!dhough incorporated 31 July 1986.]
+ *
+ * Reports of results on various systems from all the versions
+ * of Paranoia are being collected by Richard Karpinski at the
+ * same address as Thos Sumner. This includes sample outputs,
+ * bug reports, and criticisms.
+ *
+ * You may copy this program freely if you acknowledge its source.
+ * Comments on the Pascal version to NPL, please.
+ *
+ *
+ * The C version catches signals from floating-point exceptions.
+ * If signal(SIGFPE,...) is unavailable in your environment, you may
+ * #define NOSIGNAL to comment out the invocations of signal.
+ *
+ * This source file is too big for some C compilers, but may be split
+ * into pieces. Comments containing "SPLIT" suggest convenient places
+ * for this splitting. At the end of these comments is an "ed script"
+ * (for the UNIX(tm) editor ed) that will do this splitting.
+ *
+ * By #defining SINGLE_PRECISION when you compile this source, you may
+ * obtain a single-precision C version of Paranoia.
+ *
+ * The following is from the introductory commentary from Wichmann's work:
+ *
+ * The BASIC program of Kahan is written in Microsoft BASIC using many
+ * facilities which have no exact analogy in Pascal. The Pascal
+ * version below cannot therefore be exactly the same. Rather than be
+ * a minimal transcription of the BASIC program, the Pascal coding
+ * follows the conventional style of block-structured languages. Hence
+ * the Pascal version could be useful in producing versions in other
+ * structured languages.
+ *
+ * Rather than use identifiers of minimal length (which therefore have
+ * little mnemonic significance), the Pascal version uses meaningful
+ * identifiers as follows [Note: A few changes have been made for C]:
+ *
+ *
+ * BASIC C BASIC C BASIC C
+ *
+ * A J S StickyBit
+ * A1 AInverse J0 NoErrors T
+ * B Radix [Failure] T0 Underflow
+ * B1 BInverse J1 NoErrors T2 ThirtyTwo
+ * B2 RadixD2 [SeriousDefect] T5 OneAndHalf
+ * B9 BMinusU2 J2 NoErrors T7 TwentySeven
+ * C [Defect] T8 TwoForty
+ * C1 CInverse J3 NoErrors U OneUlp
+ * D [Flaw] U0 UnderflowThreshold
+ * D4 FourD K PageNo U1
+ * E0 L Milestone U2
+ * E1 M V
+ * E2 Exp2 N V0
+ * E3 N1 V8
+ * E5 MinSqEr O Zero V9
+ * E6 SqEr O1 One W
+ * E7 MaxSqEr O2 Two X
+ * E8 O3 Three X1
+ * E9 O4 Four X8
+ * F1 MinusOne O5 Five X9 Random1
+ * F2 Half O8 Eight Y
+ * F3 Third O9 Nine Y1
+ * F6 P Precision Y2
+ * F9 Q Y9 Random2
+ * G1 GMult Q8 Z
+ * G2 GDiv Q9 Z0 PseudoZero
+ * G3 GAddSub R Z1
+ * H R1 RMult Z2
+ * H1 HInverse R2 RDiv Z9
+ * I R3 RAddSub
+ * IO NoTrials R4 RSqrt
+ * I3 IEEE R9 Random9
+ *
+ * SqRWrng
+ *
+ * All the variables in BASIC are true variables and in consequence,
+ * the program is more difficult to follow since the "constants" must
+ * be determined (the glossary is very helpful). The Pascal version
+ * uses Real constants, but checks are added to ensure that the values
+ * are correctly converted by the compiler.
+ *
+ * The major textual change to the Pascal version apart from the
+ * identifiersis that named procedures are used, inserting parameters
+ * wherehelpful. New procedures are also introduced. The
+ * correspondence is as follows:
+ *
+ *
+ * BASIC Pascal
+ * lines
+ *
+ * 90- 140 Pause
+ * 170- 250 Instructions
+ * 380- 460 Heading
+ * 480- 670 Characteristics
+ * 690- 870 History
+ * 2940-2950 Random
+ * 3710-3740 NewD
+ * 4040-4080 DoesYequalX
+ * 4090-4110 PrintIfNPositive
+ * 4640-4850 TestPartialUnderflow
+ *
+*/
+
+#include <stdio.h>
+#include <string.h>
+
+/*
+ * To compile this on host using only libm from newlib (and using host libc)
+ * do:
+ * gcc -g -DNEED_REENT -DCYGNUS paranoia.c .../newlib-1.6/newlib/libm.a
+ */
+
+#ifdef NEED_REENT
+#include "reent.h"
+struct _reent libm_reent = _REENT_INIT(libm_reent);
+struct _reent *_impure_ptr = &libm_reent;
+#endif
+
+#ifndef NOSIGNAL
+#include <signal.h>
+#include <setjmp.h>
+#else /* NOSIGNAL */
+#define longjmp(e,v)
+#define setjmp(e) 0
+#define jmp_buf int
+#endif /* NOSIGNAL */
+
+#ifdef SINGLE_PRECISION
+#define FLOAT float
+#define FABS(x) (float)fabs((double)(x))
+#define FLOOR(x) (float)floor((double)(x))
+#define LOG(x) (float)log((double)(x))
+#define POW(x,y) (float)pow((double)(x),(double)(y))
+#define SQRT(x) (float)sqrt((double)(x))
+#else /* !SINGLE_PRECISION */
+#define FLOAT double
+#define FABS(x) fabs(x)
+#define FLOOR(x) floor(x)
+#define LOG(x) log(x)
+#define POW(x,y) pow(x,y)
+#define SQRT(x) sqrt(x)
+#endif /* SINGLE_PRECISION */
+
+jmp_buf ovfl_buf;
+extern double fabs (), floor (), log (), pow (), sqrt ();
+extern void exit ();
+typedef void (*Sig_type) ();
+FLOAT Sign (), Random ();
+extern void BadCond ();
+extern void SqXMinX ();
+extern void TstCond ();
+extern void notify ();
+extern int read ();
+extern void Characteristics ();
+extern void Heading ();
+extern void History ();
+extern void Instructions ();
+extern void IsYeqX ();
+extern void NewD ();
+extern void Pause ();
+extern void PrintIfNPositive ();
+extern void SR3750 ();
+extern void SR3980 ();
+extern void TstPtUf ();
+
+Sig_type sigsave;
+
+#define KEYBOARD 0
+
+FLOAT Radix, BInvrse, RadixD2, BMinusU2;
+
+/*Small floating point constants.*/
+FLOAT Zero = 0.0;
+FLOAT Half = 0.5;
+FLOAT One = 1.0;
+FLOAT Two = 2.0;
+FLOAT Three = 3.0;
+FLOAT Four = 4.0;
+FLOAT Five = 5.0;
+FLOAT Eight = 8.0;
+FLOAT Nine = 9.0;
+FLOAT TwentySeven = 27.0;
+FLOAT ThirtyTwo = 32.0;
+FLOAT TwoForty = 240.0;
+FLOAT MinusOne = -1.0;
+FLOAT OneAndHalf = 1.5;
+
+/*Integer constants*/
+int NoTrials = 20; /*Number of tests for commutativity. */
+#define False 0
+#define True 1
+
+/*
+ * Definitions for declared types
+ * Guard == (Yes, No);
+ * Rounding == (Chopped, Rounded, Other);
+ * Message == packed array [1..40] of char;
+ * Class == (Flaw, Defect, Serious, Failure);
+ */
+#define Yes 1
+#define No 0
+#define Chopped 2
+#define Rounded 1
+#define Other 0
+#define Flaw 3
+#define Defect 2
+#define Serious 1
+#define Failure 0
+typedef int Guard, Rounding, Class;
+typedef char Message;
+
+/* Declarations of Variables */
+int Indx;
+char ch[8];
+FLOAT AInvrse, A1;
+FLOAT C, CInvrse;
+FLOAT D, FourD;
+FLOAT E0, E1, Exp2, E3, MinSqEr;
+FLOAT SqEr, MaxSqEr, E9;
+FLOAT Third;
+FLOAT F6, F9;
+FLOAT H, HInvrse;
+int I;
+FLOAT StickyBit, J;
+FLOAT MyZero;
+FLOAT Precision;
+FLOAT Q, Q9;
+FLOAT R, Random9;
+FLOAT T, Underflow, S;
+FLOAT OneUlp, UfThold, U1, U2;
+FLOAT V, V0, V9;
+FLOAT W;
+FLOAT X, X1, X2, X8, Random1;
+FLOAT Y, Y1, Y2, Random2;
+FLOAT Z, PseudoZero, Z1, Z2, Z9;
+int ErrCnt[4];
+int fpecount;
+int Milestone;
+int PageNo;
+int M, N, N1;
+Guard GMult, GDiv, GAddSub;
+Rounding RMult, RDiv, RAddSub, RSqrt;
+int Break, Done, NotMonot, Monot, Anomaly, IEEE, SqRWrng, UfNGrad;
+
+/* Computed constants.
+ * U1 gap below 1.0, i.e, 1.0 - U1 is next number below 1.0
+ * U2 gap above 1.0, i.e, 1.0 + U2 is next number above 1.0
+ */
+
+int batchmode; /* global batchmode test */
+
+/* program name and version variables and macro */
+char *temp;
+char *program_name;
+char *program_vers;
+
+#ifndef VERSION
+#define VERSION "1.1 [cygnus]"
+#endif /* VERSION */
+
+#define basename(cp) ((temp=(char *)strrchr((cp), '/')) ? temp+1 : (cp))
+
+#ifndef BATCHMODE
+# ifdef CYGNUS
+# define BATCHMODE
+# endif
+#endif
+
+/* floating point exception receiver */
+void
+_sigfpe (x)
+int x;
+{
+ fpecount++;
+ printf ("\n* * * FLOATING-POINT ERROR %d * * *\n", x);
+ fflush (stdout);
+ if (sigsave) {
+#ifndef NOSIGNAL
+ signal (SIGFPE, sigsave);
+#endif /* NOSIGNAL */
+ sigsave = 0;
+ longjmp (ovfl_buf, 1);
+ }
+ exit (1);
+}
+
+#ifdef NOMAIN
+#define main paranoia
+#endif
+
+int
+main (argc, argv)
+int argc;
+char **argv;
+{
+ /* First two assignments use integer right-hand sides. */
+ Zero = 0;
+ One = 1;
+ Two = One + One;
+ Three = Two + One;
+ Four = Three + One;
+ Five = Four + One;
+ Eight = Four + Four;
+ Nine = Three * Three;
+ TwentySeven = Nine * Three;
+ ThirtyTwo = Four * Eight;
+ TwoForty = Four * Five * Three * Four;
+ MinusOne = -One;
+ Half = One / Two;
+ OneAndHalf = One + Half;
+ ErrCnt[Failure] = 0;
+ ErrCnt[Serious] = 0;
+ ErrCnt[Defect] = 0;
+ ErrCnt[Flaw] = 0;
+ PageNo = 1;
+
+#ifdef BATCHMODE
+ batchmode = 1; /* run test in batchmode? */
+#else /* !BATCHMODE */
+ batchmode = 0; /* run test interactively */
+#endif /* BATCHMODE */
+
+ program_name = basename (argv[0]);
+ program_vers = VERSION;
+
+ printf ("%s version %s\n", program_name, program_vers);
+
+ /*=============================================*/
+ Milestone = 0;
+ /*=============================================*/
+#ifndef NOSIGNAL
+ signal (SIGFPE, _sigfpe);
+#endif
+
+ if (!batchmode) {
+ Instructions ();
+ Pause ();
+ Heading ();
+ Instructions ();
+ Pause ();
+ Heading ();
+ Pause ();
+ Characteristics ();
+ Pause ();
+ History ();
+ Pause ();
+ }
+
+ /*=============================================*/
+ Milestone = 7;
+ /*=============================================*/
+ printf ("Program is now RUNNING tests on small integers:\n");
+ TstCond (Failure, (Zero + Zero == Zero) && (One - One == Zero)
+ && (One > Zero) && (One + One == Two),
+ "0+0 != 0, 1-1 != 0, 1 <= 0, or 1+1 != 2");
+ Z = -Zero;
+ if (Z != 0.0) {
+ ErrCnt[Failure] = ErrCnt[Failure] + 1;
+ printf ("Comparison alleges that -0.0 is Non-zero!\n");
+ U1 = 0.001;
+ Radix = 1;
+ TstPtUf ();
+ }
+ TstCond (Failure, (Three == Two + One) && (Four == Three + One)
+ && (Four + Two * (-Two) == Zero)
+ && (Four - Three - One == Zero),
+ "3 != 2+1, 4 != 3+1, 4+2*(-2) != 0, or 4-3-1 != 0");
+ TstCond (Failure, (MinusOne == (0 - One))
+ && (MinusOne + One == Zero) && (One + MinusOne == Zero)
+ && (MinusOne + FABS (One) == Zero)
+ && (MinusOne + MinusOne * MinusOne == Zero),
+ "-1+1 != 0, (-1)+abs(1) != 0, or -1+(-1)*(-1) != 0");
+ TstCond (Failure, Half + MinusOne + Half == Zero,
+ "1/2 + (-1) + 1/2 != 0");
+ /*=============================================*/
+ Milestone = 10;
+ /*=============================================*/
+ TstCond (Failure, (Nine == Three * Three)
+ && (TwentySeven == Nine * Three) && (Eight == Four + Four)
+ && (ThirtyTwo == Eight * Four)
+ && (ThirtyTwo - TwentySeven - Four - One == Zero),
+ "9 != 3*3, 27 != 9*3, 32 != 8*4, or 32-27-4-1 != 0");
+ TstCond (Failure, (Five == Four + One) &&
+ (TwoForty == Four * Five * Three * Four)
+ && (TwoForty / Three - Four * Four * Five == Zero)
+ && (TwoForty / Four - Five * Three * Four == Zero)
+ && (TwoForty / Five - Four * Three * Four == Zero),
+ "5 != 4+1, 240/3 != 80, 240/4 != 60, or 240/5 != 48");
+ if (ErrCnt[Failure] == 0) {
+ printf ("-1, 0, 1/2, 1, 2, 3, 4, 5, 9, 27, 32 & 240 are O.K.\n");
+ printf ("\n");
+ }
+ printf ("Searching for Radix and Precision.\n");
+ W = One;
+ do {
+ W = W + W;
+ Y = W + One;
+ Z = Y - W;
+ Y = Z - One;
+ }
+ while (MinusOne + FABS (Y) < Zero);
+ /*.. now W is just big enough that |((W+1)-W)-1| >= 1 ...*/
+ Precision = Zero;
+ Y = One;
+ do {
+ Radix = W + Y;
+ Y = Y + Y;
+ Radix = Radix - W;
+ }
+ while (Radix == Zero);
+ if (Radix < Two)
+ Radix = One;
+ printf ("Radix = %f .\n", Radix);
+ if (Radix != 1) {
+ W = One;
+ do {
+ Precision = Precision + One;
+ W = W * Radix;
+ Y = W + One;
+ }
+ while ((Y - W) == One);
+ }
+ /*... now W == Radix^Precision is barely too big to satisfy (W+1)-W == 1
+ ...*/
+ U1 = One / W;
+ U2 = Radix * U1;
+ printf ("Closest relative separation found is U1 = %.7e .\n\n", U1);
+ printf ("Recalculating radix and precision\n ");
+
+ /*save old values*/
+ E0 = Radix;
+ E1 = U1;
+ E9 = U2;
+ E3 = Precision;
+
+ X = Four / Three;
+ Third = X - One;
+ F6 = Half - Third;
+ X = F6 + F6;
+ X = FABS (X - Third);
+ if (X < U2)
+ X = U2;
+
+ /*... now X = (unknown no.) ulps of 1+...*/
+ do {
+ U2 = X;
+ Y = Half * U2 + ThirtyTwo * U2 * U2;
+ Y = One + Y;
+ X = Y - One;
+ }
+ while (!((U2 <= X) || (X <= Zero)));
+
+ /*... now U2 == 1 ulp of 1 + ... */
+ X = Two / Three;
+ F6 = X - Half;
+ Third = F6 + F6;
+ X = Third - Half;
+ X = FABS (X + F6);
+ if (X < U1)
+ X = U1;
+
+ /*... now X == (unknown no.) ulps of 1 -... */
+ do {
+ U1 = X;
+ Y = Half * U1 + ThirtyTwo * U1 * U1;
+ Y = Half - Y;
+ X = Half + Y;
+ Y = Half - X;
+ X = Half + Y;
+ }
+ while (!((U1 <= X) || (X <= Zero)));
+ /*... now U1 == 1 ulp of 1 - ... */
+ if (U1 == E1)
+ printf ("confirms closest relative separation U1 .\n");
+ else
+ printf ("gets better closest relative separation U1 = %.7e .\n", U1);
+ W = One / U1;
+ F9 = (Half - U1) + Half;
+ Radix = FLOOR (0.01 + U2 / U1);
+ if (Radix == E0)
+ printf ("Radix confirmed.\n");
+ else
+ printf ("MYSTERY: recalculated Radix = %.7e .\n", Radix);
+ TstCond (Defect, Radix <= Eight + Eight,
+ "Radix is too big: roundoff problems");
+ TstCond (Flaw, (Radix == Two) || (Radix == 10)
+ || (Radix == One), "Radix is not as good as 2 or 10");
+ /*=============================================*/
+ Milestone = 20;
+ /*=============================================*/
+ TstCond (Failure, F9 - Half < Half,
+ "(1-U1)-1/2 < 1/2 is FALSE, prog. fails?");
+ X = F9;
+ I = 1;
+ Y = X - Half;
+ Z = Y - Half;
+ TstCond (Failure, (X != One)
+ || (Z == Zero), "Comparison is fuzzy,X=1 but X-1/2-1/2 != 0");
+ X = One + U2;
+ I = 0;
+ /*=============================================*/
+ Milestone = 25;
+ /*=============================================*/
+ /*... BMinusU2 = nextafter(Radix, 0) */
+ BMinusU2 = Radix - One;
+ BMinusU2 = (BMinusU2 - U2) + One;
+ /* Purify Integers */
+ if (Radix != One) {
+ X = -TwoForty * LOG (U1) / LOG (Radix);
+ Y = FLOOR (Half + X);
+ if (FABS (X - Y) * Four < One)
+ X = Y;
+ Precision = X / TwoForty;
+ Y = FLOOR (Half + Precision);
+ if (FABS (Precision - Y) * TwoForty < Half)
+ Precision = Y;
+ }
+ if ((Precision != FLOOR (Precision)) || (Radix == One)) {
+ printf ("Precision cannot be characterized by an Integer number\n");
+ printf ("of significant digits but, by itself, this is a minor flaw.\n");
+ }
+ if (Radix == One)
+ printf ("logarithmic encoding has precision characterized solely by U1.\n");
+ else
+ printf ("The number of significant digits of the Radix is %f .\n",
+ Precision);
+ TstCond (Serious, U2 * Nine * Nine * TwoForty < One,
+ "Precision worse than 5 decimal figures ");
+ /*=============================================*/
+ Milestone = 30;
+ /*=============================================*/
+ /* Test for extra-precise subepressions */
+ X = FABS (((Four / Three - One) - One / Four) * Three - One / Four);
+ do {
+ Z2 = X;
+ X = (One + (Half * Z2 + ThirtyTwo * Z2 * Z2)) - One;
+ }
+ while (!((Z2 <= X) || (X <= Zero)));
+ X = Y = Z = FABS ((Three / Four - Two / Three) * Three - One / Four);
+ do {
+ Z1 = Z;
+ Z = (One / Two - ((One / Two - (Half * Z1 + ThirtyTwo * Z1 * Z1))
+ + One / Two)) + One / Two;
+ }
+ while (!((Z1 <= Z) || (Z <= Zero)));
+ do {
+ do {
+ Y1 = Y;
+ Y = (Half - ((Half - (Half * Y1 + ThirtyTwo * Y1 * Y1)) + Half
+ )) + Half;
+ }
+ while (!((Y1 <= Y) || (Y <= Zero)));
+ X1 = X;
+ X = ((Half * X1 + ThirtyTwo * X1 * X1) - F9) + F9;
+ }
+ while (!((X1 <= X) || (X <= Zero)));
+ if ((X1 != Y1) || (X1 != Z1)) {
+ BadCond (Serious, "Disagreements among the values X1, Y1, Z1,\n");
+ printf ("respectively %.7e, %.7e, %.7e,\n", X1, Y1, Z1);
+ printf ("are symptoms of inconsistencies introduced\n");
+ printf ("by extra-precise evaluation of arithmetic subexpressions.\n");
+ notify ("Possibly some part of this");
+ if ((X1 == U1) || (Y1 == U1) || (Z1 == U1))
+ printf (
+ "That feature is not tested further by this program.\n");
+ } else {
+ if ((Z1 != U1) || (Z2 != U2)) {
+ if ((Z1 >= U1) || (Z2 >= U2)) {
+ BadCond (Failure, "");
+ notify ("Precision");
+ printf ("\tU1 = %.7e, Z1 - U1 = %.7e\n", U1, Z1 - U1);
+ printf ("\tU2 = %.7e, Z2 - U2 = %.7e\n", U2, Z2 - U2);
+ } else {
+ if ((Z1 <= Zero) || (Z2 <= Zero)) {
+ printf ("Because of unusual Radix = %f", Radix);
+ printf (", or exact rational arithmetic a result\n");
+ printf ("Z1 = %.7e, or Z2 = %.7e ", Z1, Z2);
+ notify ("of an\nextra-precision");
+ }
+ if (Z1 != Z2 || Z1 > Zero) {
+ X = Z1 / U1;
+ Y = Z2 / U2;
+ if (Y > X)
+ X = Y;
+ Q = -LOG (X);
+ printf ("Some subexpressions appear to be calculated extra\n");
+ printf ("precisely with about %g extra B-digits, i.e.\n",
+ (Q / LOG (Radix)));
+ printf ("roughly %g extra significant decimals.\n",
+ Q / LOG (10.));
+ }
+ printf ("That feature is not tested further by this program.\n");
+ }
+ }
+ }
+ Pause ();
+ /*=============================================*/
+ Milestone = 35;
+ /*=============================================*/
+ if (Radix >= Two) {
+ X = W / (Radix * Radix);
+ Y = X + One;
+ Z = Y - X;
+ T = Z + U2;
+ X = T - Z;
+ TstCond (Failure, X == U2,
+ "Subtraction is not normalized X=Y,X+Z != Y+Z!");
+ if (X == U2)
+ printf (
+ "Subtraction appears to be normalized, as it should be.");
+ }
+ printf ("\nChecking for guard digit in *, /, and -.\n");
+ Y = F9 * One;
+ Z = One * F9;
+ X = F9 - Half;
+ Y = (Y - Half) - X;
+ Z = (Z - Half) - X;
+ X = One + U2;
+ T = X * Radix;
+ R = Radix * X;
+ X = T - Radix;
+ X = X - Radix * U2;
+ T = R - Radix;
+ T = T - Radix * U2;
+ X = X * (Radix - One);
+ T = T * (Radix - One);
+ if ((X == Zero) && (Y == Zero) && (Z == Zero) && (T == Zero))
+ GMult = Yes;
+ else {
+ GMult = No;
+ TstCond (Serious, False,
+ "* lacks a Guard Digit, so 1*X != X");
+ }
+ Z = Radix * U2;
+ X = One + Z;
+ Y = FABS ((X + Z) - X * X) - U2;
+ X = One - U2;
+ Z = FABS ((X - U2) - X * X) - U1;
+ TstCond (Failure, (Y <= Zero)
+ && (Z <= Zero), "* gets too many final digits wrong.\n");
+ Y = One - U2;
+ X = One + U2;
+ Z = One / Y;
+ Y = Z - X;
+ X = One / Three;
+ Z = Three / Nine;
+ X = X - Z;
+ T = Nine / TwentySeven;
+ Z = Z - T;
+ TstCond (Defect, X == Zero && Y == Zero && Z == Zero,
+ "Division lacks a Guard Digit, so error can exceed 1 ulp\n\
+or 1/3 and 3/9 and 9/27 may disagree");
+ Y = F9 / One;
+ X = F9 - Half;
+ Y = (Y - Half) - X;
+ X = One + U2;
+ T = X / One;
+ X = T - X;
+ if ((X == Zero) && (Y == Zero) && (Z == Zero))
+ GDiv = Yes;
+ else {
+ GDiv = No;
+ TstCond (Serious, False,
+ "Division lacks a Guard Digit, so X/1 != X");
+ }
+ X = One / (One + U2);
+ Y = X - Half - Half;
+ TstCond (Serious, Y < Zero,
+ "Computed value of 1/1.000..1 >= 1");
+ X = One - U2;
+ Y = One + Radix * U2;
+ Z = X * Radix;
+ T = Y * Radix;
+ R = Z / Radix;
+ StickyBit = T / Radix;
+ X = R - X;
+ Y = StickyBit - Y;
+ TstCond (Failure, X == Zero && Y == Zero,
+ "* and/or / gets too many last digits wrong");
+ Y = One - U1;
+ X = One - F9;
+ Y = One - Y;
+ T = Radix - U2;
+ Z = Radix - BMinusU2;
+ T = Radix - T;
+ if ((X == U1) && (Y == U1) && (Z == U2) && (T == U2))
+ GAddSub = Yes;
+ else {
+ GAddSub = No;
+ TstCond (Serious, False,
+ "- lacks Guard Digit, so cancellation is obscured");
+ }
+ if (F9 != One && F9 - One >= Zero) {
+ BadCond (Serious, "comparison alleges (1-U1) < 1 although\n");
+ printf (" subtraction yields (1-U1) - 1 = 0 , thereby vitiating\n");
+ printf (" such precautions against division by zero as\n");
+ printf (" ... if (X == 1.0) {.....} else {.../(X-1.0)...}\n");
+ }
+ if (GMult == Yes && GDiv == Yes && GAddSub == Yes)
+ printf (
+ " *, /, and - appear to have guard digits, as they should.\n");
+ /*=============================================*/
+ Milestone = 40;
+ /*=============================================*/
+ Pause ();
+ printf ("Checking rounding on multiply, divide and add/subtract.\n");
+ RMult = Other;
+ RDiv = Other;
+ RAddSub = Other;
+ RadixD2 = Radix / Two;
+ A1 = Two;
+ Done = False;
+ do {
+ AInvrse = Radix;
+ do {
+ X = AInvrse;
+ AInvrse = AInvrse / A1;
+ }
+ while (!(FLOOR (AInvrse) != AInvrse));
+ Done = (X == One) || (A1 > Three);
+ if (!Done)
+ A1 = Nine + One;
+ }
+ while (!(Done));
+ if (X == One)
+ A1 = Radix;
+ AInvrse = One / A1;
+ X = A1;
+ Y = AInvrse;
+ Done = False;
+ do {
+ Z = X * Y - Half;
+ TstCond (Failure, Z == Half,
+ "X * (1/X) differs from 1");
+ Done = X == Radix;
+ X = Radix;
+ Y = One / X;
+ }
+ while (!(Done));
+ Y2 = One + U2;
+ Y1 = One - U2;
+ X = OneAndHalf - U2;
+ Y = OneAndHalf + U2;
+ Z = (X - U2) * Y2;
+ T = Y * Y1;
+ Z = Z - X;
+ T = T - X;
+ X = X * Y2;
+ Y = (Y + U2) * Y1;
+ X = X - OneAndHalf;
+ Y = Y - OneAndHalf;
+ if ((X == Zero) && (Y == Zero) && (Z == Zero) && (T <= Zero)) {
+ X = (OneAndHalf + U2) * Y2;
+ Y = OneAndHalf - U2 - U2;
+ Z = OneAndHalf + U2 + U2;
+ T = (OneAndHalf - U2) * Y1;
+ X = X - (Z + U2);
+ StickyBit = Y * Y1;
+ S = Z * Y2;
+ T = T - Y;
+ Y = (U2 - Y) + StickyBit;
+ Z = S - (Z + U2 + U2);
+ StickyBit = (Y2 + U2) * Y1;
+ Y1 = Y2 * Y1;
+ StickyBit = StickyBit - Y2;
+ Y1 = Y1 - Half;
+ if ((X == Zero) && (Y == Zero) && (Z == Zero) && (T == Zero)
+ && (StickyBit == Zero) && (Y1 == Half)) {
+ RMult = Rounded;
+ printf ("Multiplication appears to round correctly.\n");
+ } else if ((X + U2 == Zero) && (Y < Zero) && (Z + U2 == Zero)
+ && (T < Zero) && (StickyBit + U2 == Zero)
+ && (Y1 < Half)) {
+ RMult = Chopped;
+ printf ("Multiplication appears to chop.\n");
+ } else
+ printf ("* is neither chopped nor correctly rounded.\n");
+ if ((RMult == Rounded) && (GMult == No))
+ notify ("Multiplication");
+ } else
+ printf ("* is neither chopped nor correctly rounded.\n");
+ /*=============================================*/
+ Milestone = 45;
+ /*=============================================*/
+ Y2 = One + U2;
+ Y1 = One - U2;
+ Z = OneAndHalf + U2 + U2;
+ X = Z / Y2;
+ T = OneAndHalf - U2 - U2;
+ Y = (T - U2) / Y1;
+ Z = (Z + U2) / Y2;
+ X = X - OneAndHalf;
+ Y = Y - T;
+ T = T / Y1;
+ Z = Z - (OneAndHalf + U2);
+ T = (U2 - OneAndHalf) + T;
+ if (!((X > Zero) || (Y > Zero) || (Z > Zero) || (T > Zero))) {
+ X = OneAndHalf / Y2;
+ Y = OneAndHalf - U2;
+ Z = OneAndHalf + U2;
+ X = X - Y;
+ T = OneAndHalf / Y1;
+ Y = Y / Y1;
+ T = T - (Z + U2);
+ Y = Y - Z;
+ Z = Z / Y2;
+ Y1 = (Y2 + U2) / Y2;
+ Z = Z - OneAndHalf;
+ Y2 = Y1 - Y2;
+ Y1 = (F9 - U1) / F9;
+ if ((X == Zero) && (Y == Zero) && (Z == Zero) && (T == Zero)
+ && (Y2 == Zero) && (Y2 == Zero)
+ && (Y1 - Half == F9 - Half)) {
+ RDiv = Rounded;
+ printf ("Division appears to round correctly.\n");
+ if (GDiv == No)
+ notify ("Division");
+ } else if ((X < Zero) && (Y < Zero) && (Z < Zero) && (T < Zero)
+ && (Y2 < Zero) && (Y1 - Half < F9 - Half)) {
+ RDiv = Chopped;
+ printf ("Division appears to chop.\n");
+ }
+ }
+ if (RDiv == Other)
+ printf ("/ is neither chopped nor correctly rounded.\n");
+ BInvrse = One / Radix;
+ TstCond (Failure, (BInvrse * Radix - Half == Half),
+ "Radix * ( 1 / Radix ) differs from 1");
+ /*=============================================*/
+ Milestone = 50;
+ /*=============================================*/
+ TstCond (Failure, ((F9 + U1) - Half == Half)
+ && ((BMinusU2 + U2) - One == Radix - One),
+ "Incomplete carry-propagation in Addition");
+ X = One - U1 * U1;
+ Y = One + U2 * (One - U2);
+ Z = F9 - Half;
+ X = (X - Half) - Z;
+ Y = Y - One;
+ if ((X == Zero) && (Y == Zero)) {
+ RAddSub = Chopped;
+ printf ("Add/Subtract appears to be chopped.\n");
+ }
+ if (GAddSub == Yes) {
+ X = (Half + U2) * U2;
+ Y = (Half - U2) * U2;
+ X = One + X;
+ Y = One + Y;
+ X = (One + U2) - X;
+ Y = One - Y;
+ if ((X == Zero) && (Y == Zero)) {
+ X = (Half + U2) * U1;
+ Y = (Half - U2) * U1;
+ X = One - X;
+ Y = One - Y;
+ X = F9 - X;
+ Y = One - Y;
+ if ((X == Zero) && (Y == Zero)) {
+ RAddSub = Rounded;
+ printf ("Addition/Subtraction appears to round correctly.\n");
+ if (GAddSub == No)
+ notify ("Add/Subtract");
+ } else
+ printf ("Addition/Subtraction neither rounds nor chops.\n");
+ } else
+ printf ("Addition/Subtraction neither rounds nor chops.\n");
+ } else
+ printf ("Addition/Subtraction neither rounds nor chops.\n");
+ S = One;
+ X = One + Half * (One + Half);
+ Y = (One + U2) * Half;
+ Z = X - Y;
+ T = Y - X;
+ StickyBit = Z + T;
+ if (StickyBit != Zero) {
+ S = Zero;
+ BadCond (Flaw, "(X - Y) + (Y - X) is non zero!\n");
+ }
+ StickyBit = Zero;
+ if ((GMult == Yes) && (GDiv == Yes) && (GAddSub == Yes)
+ && (RMult == Rounded) && (RDiv == Rounded)
+ && (RAddSub == Rounded) && (FLOOR (RadixD2) == RadixD2)) {
+ printf ("Checking for sticky bit.\n");
+ X = (Half + U1) * U2;
+ Y = Half * U2;
+ Z = One + Y;
+ T = One + X;
+ if ((Z - One <= Zero) && (T - One >= U2)) {
+ Z = T + Y;
+ Y = Z - X;
+ if ((Z - T >= U2) && (Y - T == Zero)) {
+ X = (Half + U1) * U1;
+ Y = Half * U1;
+ Z = One - Y;
+ T = One - X;
+ if ((Z - One == Zero) && (T - F9 == Zero)) {
+ Z = (Half - U1) * U1;
+ T = F9 - Z;
+ Q = F9 - Y;
+ if ((T - F9 == Zero) && (F9 - U1 - Q == Zero)) {
+ Z = (One + U2) * OneAndHalf;
+ T = (OneAndHalf + U2) - Z + U2;
+ X = One + Half / Radix;
+ Y = One + Radix * U2;
+ Z = X * Y;
+ if (T == Zero && X + Radix * U2 - Z == Zero) {
+ if (Radix != Two) {
+ X = Two + U2;
+ Y = X / Two;
+ if ((Y - One == Zero))
+ StickyBit = S;
+ } else
+ StickyBit = S;
+ }
+ }
+ }
+ }
+ }
+ }
+ if (StickyBit == One)
+ printf ("Sticky bit apparently used correctly.\n");
+ else
+ printf ("Sticky bit used incorrectly or not at all.\n");
+ TstCond (Flaw, !(GMult == No || GDiv == No || GAddSub == No ||
+ RMult == Other || RDiv == Other || RAddSub == Other),
+ "lack(s) of guard digits or failure(s) to correctly round or chop\n\
+(noted above) count as one flaw in the final tally below");
+ /*=============================================*/
+ Milestone = 60;
+ /*=============================================*/
+ printf ("\n");
+ printf ("Does Multiplication commute? ");
+ printf ("Testing on %d random pairs.\n", NoTrials);
+ Random9 = SQRT (3.0);
+ Random1 = Third;
+ I = 1;
+ do {
+ X = Random ();
+ Y = Random ();
+ Z9 = Y * X;
+ Z = X * Y;
+ Z9 = Z - Z9;
+ I = I + 1;
+ }
+ while (!((I > NoTrials) || (Z9 != Zero)));
+ if (I == NoTrials) {
+ Random1 = One + Half / Three;
+ Random2 = (U2 + U1) + One;
+ Z = Random1 * Random2;
+ Y = Random2 * Random1;
+ Z9 = (One + Half / Three) * ((U2 + U1) + One) - (One + Half /
+ Three) * ((U2 + U1) + One);
+ }
+ if (!((I == NoTrials) || (Z9 == Zero)))
+ BadCond (Defect, "X * Y == Y * X trial fails.\n");
+ else
+ printf (" No failures found in %d integer pairs.\n", NoTrials);
+ /*=============================================*/
+ Milestone = 70;
+ /*=============================================*/
+ printf ("\nRunning test of square root(x).\n");
+ TstCond (Failure, (Zero == SQRT (Zero))
+ && (-Zero == SQRT (-Zero))
+ && (One == SQRT (One)), "Square root of 0.0, -0.0 or 1.0 wrong");
+ MinSqEr = Zero;
+ MaxSqEr = Zero;
+ J = Zero;
+ X = Radix;
+ OneUlp = U2;
+ SqXMinX (Serious);
+ X = BInvrse;
+ OneUlp = BInvrse * U1;
+ SqXMinX (Serious);
+ X = U1;
+ OneUlp = U1 * U1;
+ SqXMinX (Serious);
+ if (J != Zero)
+ Pause ();
+ printf ("Testing if sqrt(X * X) == X for %d Integers X.\n", NoTrials);
+ J = Zero;
+ X = Two;
+ Y = Radix;
+ if ((Radix != One))
+ do {
+ X = Y;
+ Y = Radix * Y;
+ }
+ while (!((Y - X >= NoTrials)));
+ OneUlp = X * U2;
+ I = 1;
+ while (I <= NoTrials) {
+ X = X + One;
+ SqXMinX (Defect);
+ if (J > Zero)
+ break;
+ I = I + 1;
+ }
+ printf ("Test for sqrt monotonicity.\n");
+ I = -1;
+ X = BMinusU2;
+ Y = Radix;
+ Z = Radix + Radix * U2;
+ NotMonot = False;
+ Monot = False;
+ while (!(NotMonot || Monot)) {
+ I = I + 1;
+ X = SQRT (X);
+ Q = SQRT (Y);
+ Z = SQRT (Z);
+ if ((X > Q) || (Q > Z))
+ NotMonot = True;
+ else {
+ Q = FLOOR (Q + Half);
+ if ((I > 0) || (Radix == Q * Q))
+ Monot = True;
+ else if (I > 0) {
+ if (I > 1)
+ Monot = True;
+ else {
+ Y = Y * BInvrse;
+ X = Y - U1;
+ Z = Y + U1;
+ }
+ } else {
+ Y = Q;
+ X = Y - U2;
+ Z = Y + U2;
+ }
+ }
+ }
+ if (Monot)
+ printf ("sqrt has passed a test for Monotonicity.\n");
+ else {
+ BadCond (Defect, "");
+ printf ("sqrt(X) is non-monotonic for X near %.7e .\n", Y);
+ }
+ /*=============================================*/
+ Milestone = 80;
+ /*=============================================*/
+ MinSqEr = MinSqEr + Half;
+ MaxSqEr = MaxSqEr - Half;
+ Y = (SQRT (One + U2) - One) / U2;
+ SqEr = (Y - One) + U2 / Eight;
+ if (SqEr > MaxSqEr)
+ MaxSqEr = SqEr;
+ SqEr = Y + U2 / Eight;
+ if (SqEr < MinSqEr)
+ MinSqEr = SqEr;
+ Y = ((SQRT (F9) - U2) - (One - U2)) / U1;
+ SqEr = Y + U1 / Eight;
+ if (SqEr > MaxSqEr)
+ MaxSqEr = SqEr;
+ SqEr = (Y + One) + U1 / Eight;
+ if (SqEr < MinSqEr)
+ MinSqEr = SqEr;
+ OneUlp = U2;
+ X = OneUlp;
+ for (Indx = 1; Indx <= 3; ++Indx) {
+ Y = SQRT ((X + U1 + X) + F9);
+ Y = ((Y - U2) - ((One - U2) + X)) / OneUlp;
+ Z = ((U1 - X) + F9) * Half * X * X / OneUlp;
+ SqEr = (Y + Half) + Z;
+ if (SqEr < MinSqEr)
+ MinSqEr = SqEr;
+ SqEr = (Y - Half) + Z;
+ if (SqEr > MaxSqEr)
+ MaxSqEr = SqEr;
+ if (((Indx == 1) || (Indx == 3)))
+ X = OneUlp * Sign (X) * FLOOR (Eight / (Nine * SQRT (OneUlp)));
+ else {
+ OneUlp = U1;
+ X = -OneUlp;
+ }
+ }
+ /*=============================================*/
+ Milestone = 85;
+ /*=============================================*/
+ SqRWrng = False;
+ Anomaly = False;
+ RSqrt = Other; /* ~dgh */
+ if (Radix != One) {
+ printf ("Testing whether sqrt is rounded or chopped.\n");
+ D = FLOOR (Half + POW (Radix, One + Precision - FLOOR (Precision)));
+ /* ... == Radix^(1 + fract) if (Precision == Integer + fract. */
+ X = D / Radix;
+ Y = D / A1;
+ if ((X != FLOOR (X)) || (Y != FLOOR (Y))) {
+ Anomaly = True;
+ } else {
+ X = Zero;
+ Z2 = X;
+ Y = One;
+ Y2 = Y;
+ Z1 = Radix - One;
+ FourD = Four * D;
+ do {
+ if (Y2 > Z2) {
+ Q = Radix;
+ Y1 = Y;
+ do {
+ X1 = FABS (Q + FLOOR (Half - Q / Y1) * Y1);
+ Q = Y1;
+ Y1 = X1;
+ }
+ while (!(X1 <= Zero));
+ if (Q <= One) {
+ Z2 = Y2;
+ Z = Y;
+ }
+ }
+ Y = Y + Two;
+ X = X + Eight;
+ Y2 = Y2 + X;
+ if (Y2 >= FourD)
+ Y2 = Y2 - FourD;
+ }
+ while (!(Y >= D));
+ X8 = FourD - Z2;
+ Q = (X8 + Z * Z) / FourD;
+ X8 = X8 / Eight;
+ if (Q != FLOOR (Q))
+ Anomaly = True;
+ else {
+ Break = False;
+ do {
+ X = Z1 * Z;
+ X = X - FLOOR (X / Radix) * Radix;
+ if (X == One)
+ Break = True;
+ else
+ Z1 = Z1 - One;
+ }
+ while (!(Break || (Z1 <= Zero)));
+ if ((Z1 <= Zero) && (!Break))
+ Anomaly = True;
+ else {
+ if (Z1 > RadixD2)
+ Z1 = Z1 - Radix;
+ do {
+ NewD ();
+ }
+ while (!(U2 * D >= F9));
+ if (D * Radix - D != W - D)
+ Anomaly = True;
+ else {
+ Z2 = D;
+ I = 0;
+ Y = D + (One + Z) * Half;
+ X = D + Z + Q;
+ SR3750 ();
+ Y = D + (One - Z) * Half + D;
+ X = D - Z + D;
+ X = X + Q + X;
+ SR3750 ();
+ NewD ();
+ if (D - Z2 != W - Z2)
+ Anomaly = True;
+ else {
+ Y = (D - Z2) + (Z2 + (One - Z) * Half);
+ X = (D - Z2) + (Z2 - Z + Q);
+ SR3750 ();
+ Y = (One + Z) * Half;
+ X = Q;
+ SR3750 ();
+ if (I == 0)
+ Anomaly = True;
+ }
+ }
+ }
+ }
+ }
+ if ((I == 0) || Anomaly) {
+ BadCond (Failure, "Anomalous arithmetic with Integer < ");
+ printf ("Radix^Precision = %.7e\n", W);
+ printf (" fails test whether sqrt rounds or chops.\n");
+ SqRWrng = True;
+ }
+ }
+ if (!Anomaly) {
+ if (!((MinSqEr < Zero) || (MaxSqEr > Zero))) {
+ RSqrt = Rounded;
+ printf ("Square root appears to be correctly rounded.\n");
+ } else {
+ if ((MaxSqEr + U2 > U2 - Half) || (MinSqEr > Half)
+ || (MinSqEr + Radix < Half))
+ SqRWrng = True;
+ else {
+ RSqrt = Chopped;
+ printf ("Square root appears to be chopped.\n");
+ }
+ }
+ }
+ if (SqRWrng) {
+ printf ("Square root is neither chopped nor correctly rounded.\n");
+ printf ("Observed errors run from %.7e ", MinSqEr - Half);
+ printf ("to %.7e ulps.\n", Half + MaxSqEr);
+ TstCond (Serious, MaxSqEr - MinSqEr < Radix * Radix,
+ "sqrt gets too many last digits wrong");
+ }
+ /*=============================================*/
+ Milestone = 90;
+ /*=============================================*/
+ Pause ();
+ printf ("Testing powers Z^i for small Integers Z and i.\n");
+ N = 0;
+ /* ... test powers of zero. */
+ I = 0;
+ Z = -Zero;
+ M = 3;
+ Break = False;
+ do {
+ X = One;
+ SR3980 ();
+ if (I <= 10) {
+ I = 1023;
+ SR3980 ();
+ }
+ if (Z == MinusOne)
+ Break = True;
+ else {
+ Z = MinusOne;
+ /* .. if(-1)^N is invalid, replace MinusOne by One. */
+ I = -4;
+ }
+ }
+ while (!Break);
+ PrintIfNPositive ();
+ N1 = N;
+ N = 0;
+ Z = A1;
+ M = (int) FLOOR (Two * LOG (W) / LOG (A1));
+ Break = False;
+ do {
+ X = Z;
+ I = 1;
+ SR3980 ();
+ if (Z == AInvrse)
+ Break = True;
+ else
+ Z = AInvrse;
+ }
+ while (!(Break));
+ /*=============================================*/
+ Milestone = 100;
+ /*=============================================*/
+ /* Powers of Radix have been tested, */
+ /* next try a few primes */
+ M = NoTrials;
+ Z = Three;
+ do {
+ X = Z;
+ I = 1;
+ SR3980 ();
+ do {
+ Z = Z + Two;
+ }
+ while (Three * FLOOR (Z / Three) == Z);
+ }
+ while (Z < Eight * Three);
+ if (N > 0) {
+ printf ("Errors like this may invalidate financial calculations\n");
+ printf ("\tinvolving interest rates.\n");
+ }
+ PrintIfNPositive ();
+ N += N1;
+ if (N == 0)
+ printf ("... no discrepancies found.\n");
+ if (N > 0)
+ Pause ();
+ else
+ printf ("\n");
+ /*=============================================*/
+ Milestone = 110;
+ /*=============================================*/
+ printf ("Seeking Underflow thresholds UfThold and E0.\n");
+ D = U1;
+ if (Precision != FLOOR (Precision)) {
+ D = BInvrse;
+ X = Precision;
+ do {
+ D = D * BInvrse;
+ X = X - One;
+ }
+ while (X > Zero);
+ }
+ Y = One;
+ Z = D;
+ /* ... D is power of 1/Radix < 1. */
+ do {
+ C = Y;
+ Y = Z;
+ Z = Y * Y;
+ }
+ while ((Y > Z) && (Z + Z > Z));
+ Y = C;
+ Z = Y * D;
+ do {
+ C = Y;
+ Y = Z;
+ Z = Y * D;
+ }
+ while ((Y > Z) && (Z + Z > Z));
+ if (Radix < Two)
+ HInvrse = Two;
+ else
+ HInvrse = Radix;
+ H = One / HInvrse;
+ /* ... 1/HInvrse == H == Min(1/Radix, 1/2) */
+ CInvrse = One / C;
+ E0 = C;
+ Z = E0 * H;
+ /* ...1/Radix^(BIG Integer) << 1 << CInvrse == 1/C */
+ do {
+ Y = E0;
+ E0 = Z;
+ Z = E0 * H;
+ }
+ while ((E0 > Z) && (Z + Z > Z));
+ UfThold = E0;
+ E1 = Zero;
+ Q = Zero;
+ E9 = U2;
+ S = One + E9;
+ D = C * S;
+ if (D <= C) {
+ E9 = Radix * U2;
+ S = One + E9;
+ D = C * S;
+ if (D <= C) {
+ BadCond (Failure, "multiplication gets too many last digits wrong.\n");
+ Underflow = E0;
+ Y1 = Zero;
+ PseudoZero = Z;
+ Pause ();
+ }
+ } else {
+ Underflow = D;
+ PseudoZero = Underflow * H;
+ UfThold = Zero;
+ do {
+ Y1 = Underflow;
+ Underflow = PseudoZero;
+ if (E1 + E1 <= E1) {
+ Y2 = Underflow * HInvrse;
+ E1 = FABS (Y1 - Y2);
+ Q = Y1;
+ if ((UfThold == Zero) && (Y1 != Y2))
+ UfThold = Y1;
+ }
+ PseudoZero = PseudoZero * H;
+ }
+ while ((Underflow > PseudoZero)
+ && (PseudoZero + PseudoZero > PseudoZero));
+ }
+ /* Comment line 4530 .. 4560 */
+ if (PseudoZero != Zero) {
+ printf ("\n");
+ Z = PseudoZero;
+ /* ... Test PseudoZero for "phoney- zero" violates */
+ /* ... PseudoZero < Underflow or PseudoZero < PseudoZero + PseudoZero
+ ... */
+ if (PseudoZero <= Zero) {
+ BadCond (Failure, "Positive expressions can underflow to an\n");
+ printf ("allegedly negative value\n");
+ printf ("PseudoZero that prints out as: %g .\n", PseudoZero);
+ X = -PseudoZero;
+ if (X <= Zero) {
+ printf ("But -PseudoZero, which should be\n");
+ printf ("positive, isn't; it prints out as %g .\n", X);
+ }
+ } else {
+ BadCond (Flaw, "Underflow can stick at an allegedly positive\n");
+ printf ("value PseudoZero that prints out as %g .\n", PseudoZero);
+ }
+ TstPtUf ();
+ }
+ /*=============================================*/
+ Milestone = 120;
+ /*=============================================*/
+ if (CInvrse * Y > CInvrse * Y1) {
+ S = H * S;
+ E0 = Underflow;
+ }
+ if (!((E1 == Zero) || (E1 == E0))) {
+ BadCond (Defect, "");
+ if (E1 < E0) {
+ printf ("Products underflow at a higher");
+ printf (" threshold than differences.\n");
+ if (PseudoZero == Zero)
+ E0 = E1;
+ } else {
+ printf ("Difference underflows at a higher");
+ printf (" threshold than products.\n");
+ }
+ }
+ printf ("Smallest strictly positive number found is E0 = %g .\n", E0);
+ Z = E0;
+ TstPtUf ();
+ Underflow = E0;
+ if (N == 1)
+ Underflow = Y;
+ I = 4;
+ if (E1 == Zero)
+ I = 3;
+ if (UfThold == Zero)
+ I = I - 2;
+ UfNGrad = True;
+ switch (I) {
+ case 1:
+ UfThold = Underflow;
+ if ((CInvrse * Q) != ((CInvrse * Y) * S)) {
+ UfThold = Y;
+ BadCond (Failure, "Either accuracy deteriorates as numbers\n");
+ printf ("approach a threshold = %.17e\n", UfThold);;
+ printf (" coming down from %.17e\n", C);
+ printf (" or else multiplication gets too many last digits wrong.\n");
+ }
+ Pause ();
+ break;
+
+ case 2:
+ BadCond (Failure, "Underflow confuses Comparison, which alleges that\n");
+ printf ("Q == Y while denying that |Q - Y| == 0; these values\n");
+ printf ("print out as Q = %.17e, Y = %.17e .\n", Q, Y2);
+ printf ("|Q - Y| = %.17e .\n", FABS (Q - Y2));
+ UfThold = Q;
+ break;
+
+ case 3:
+ X = X;
+ break;
+
+ case 4:
+ if ((Q == UfThold) && (E1 == E0)
+ && (FABS (UfThold - E1 / E9) <= E1)) {
+ UfNGrad = False;
+ printf ("Underflow is gradual; it incurs Absolute Error =\n");
+ printf ("(roundoff in UfThold) < E0.\n");
+ Y = E0 * CInvrse;
+ Y = Y * (OneAndHalf + U2);
+ X = CInvrse * (One + U2);
+ Y = Y / X;
+ IEEE = (Y == E0);
+ }
+ }
+ if (UfNGrad) {
+ printf ("\n");
+ sigsave = _sigfpe;
+ if (setjmp (ovfl_buf)) {
+ printf ("Underflow / UfThold failed!\n");
+ R = H + H;
+ } else
+ R = SQRT (Underflow / UfThold);
+ sigsave = 0;
+ if (R <= H) {
+ Z = R * UfThold;
+ X = Z * (One + R * H * (One + H));
+ } else {
+ Z = UfThold;
+ X = Z * (One + H * H * (One + H));
+ }
+ if (!((X == Z) || (X - Z != Zero))) {
+ BadCond (Flaw, "");
+ printf ("X = %.17e\n\tis not equal to Z = %.17e .\n", X, Z);
+ Z9 = X - Z;
+ printf ("yet X - Z yields %.17e .\n", Z9);
+ printf (" Should this NOT signal Underflow, ");
+ printf ("this is a SERIOUS DEFECT\nthat causes ");
+ printf ("confusion when innocent statements like\n");;
+ printf (" if (X == Z) ... else");
+ printf (" ... (f(X) - f(Z)) / (X - Z) ...\n");
+ printf ("encounter Division by Zero although actually\n");
+ sigsave = _sigfpe;
+ if (setjmp (ovfl_buf))
+ printf ("X / Z fails!\n");
+ else
+ printf ("X / Z = 1 + %g .\n", (X / Z - Half) - Half);
+ sigsave = 0;
+ }
+ }
+ printf ("The Underflow threshold is %.17e, %s\n", UfThold,
+ " below which");
+ printf ("calculation may suffer larger Relative error than ");
+ printf ("merely roundoff.\n");
+ Y2 = U1 * U1;
+ Y = Y2 * Y2;
+ Y2 = Y * U1;
+ if (Y2 <= UfThold) {
+ if (Y > E0) {
+ BadCond (Defect, "");
+ I = 5;
+ } else {
+ BadCond (Serious, "");
+ I = 4;
+ }
+ printf ("Range is too narrow; U1^%d Underflows.\n", I);
+ }
+ /*=============================================*/
+ Milestone = 130;
+ /*=============================================*/
+ Y = -FLOOR (Half - TwoForty * LOG (UfThold) / LOG (HInvrse)) / TwoForty;
+ Y2 = Y + Y;
+ printf ("Since underflow occurs below the threshold\n");
+ printf ("UfThold = (%.17e) ^ (%.17e)\nonly underflow ", HInvrse, Y);
+ printf ("should afflict the expression\n\t(%.17e) ^ (%.17e);\n",
+ HInvrse, Y2);
+ printf ("actually calculating yields:");
+ if (setjmp (ovfl_buf)) {
+ sigsave = 0;
+ BadCond (Serious, "trap on underflow.\n");
+ } else {
+ sigsave = _sigfpe;
+ V9 = POW (HInvrse, Y2);
+ sigsave = 0;
+ printf (" %.17e .\n", V9);
+ if (!((V9 >= Zero) && (V9 <= (Radix + Radix + E9) * UfThold))) {
+ BadCond (Serious, "this is not between 0 and underflow\n");
+ printf (" threshold = %.17e .\n", UfThold);
+ } else if (!(V9 > UfThold * (One + E9)))
+ printf ("This computed value is O.K.\n");
+ else {
+ BadCond (Defect, "this is not between 0 and underflow\n");
+ printf (" threshold = %.17e .\n", UfThold);
+ }
+ }
+ /*=============================================*/
+ Milestone = 140;
+ /*=============================================*/
+ printf ("\n");
+ /* ...calculate Exp2 == exp(2) == 7.389056099... */
+ X = Zero;
+ I = 2;
+ Y = Two * Three;
+ Q = Zero;
+ N = 0;
+ do {
+ Z = X;
+ I = I + 1;
+ Y = Y / (I + I);
+ R = Y + Q;
+ X = Z + R;
+ Q = (Z - X) + R;
+ }
+ while (X > Z);
+ Z = (OneAndHalf + One / Eight) + X / (OneAndHalf * ThirtyTwo);
+ X = Z * Z;
+ Exp2 = X * X;
+ X = F9;
+ Y = X - U1;
+ printf ("Testing X^((X + 1) / (X - 1)) vs. exp(2) = %.17e as X -> 1.\n",
+ Exp2);
+ for (I = 1;;) {
+ Z = X - BInvrse;
+ Z = (X + One) / (Z - (One - BInvrse));
+ Q = POW (X, Z) - Exp2;
+ if (FABS (Q) > TwoForty * U2) {
+ N = 1;
+ V9 = (X - BInvrse) - (One - BInvrse);
+ BadCond (Defect, "Calculated");
+ printf (" %.17e for\n", POW (X, Z));
+ printf ("\t(1 + (%.17e) ^ (%.17e);\n", V9, Z);
+ printf ("\tdiffers from correct value by %.17e .\n", Q);
+ printf ("\tThis much error may spoil financial\n");
+ printf ("\tcalculations involving tiny interest rates.\n");
+ break;
+ } else {
+ Z = (Y - X) * Two + Y;
+ X = Y;
+ Y = Z;
+ Z = One + (X - F9) * (X - F9);
+ if (Z > One && I < NoTrials)
+ I++;
+ else {
+ if (X > One) {
+ if (N == 0)
+ printf ("Accuracy seems adequate.\n");
+ break;
+ } else {
+ X = One + U2;
+ Y = U2 + U2;
+ Y += X;
+ I = 1;
+ }
+ }
+ }
+ }
+ /*=============================================*/
+ Milestone = 150;
+ /*=============================================*/
+ printf ("Testing powers Z^Q at four nearly extreme values.\n");
+ N = 0;
+ Z = A1;
+ Q = FLOOR (Half - LOG (C) / LOG (A1));
+ Break = False;
+ do {
+ X = CInvrse;
+ Y = POW (Z, Q);
+ IsYeqX ();
+ Q = -Q;
+ X = C;
+ Y = POW (Z, Q);
+ IsYeqX ();
+ if (Z < One)
+ Break = True;
+ else
+ Z = AInvrse;
+ }
+ while (!(Break));
+ PrintIfNPositive ();
+ if (N == 0)
+ printf (" ... no discrepancies found.\n");
+ printf ("\n");
+
+ /*=============================================*/
+ Milestone = 160;
+ /*=============================================*/
+ Pause ();
+ printf ("Searching for Overflow threshold:\n");
+ printf ("This may generate an error.\n");
+ Y = -CInvrse;
+ V9 = HInvrse * Y;
+ sigsave = _sigfpe;
+ if (setjmp (ovfl_buf)) {
+ I = 0;
+ V9 = Y;
+ goto overflow;
+ }
+ do {
+ V = Y;
+ Y = V9;
+ V9 = HInvrse * Y;
+ }
+ while (V9 < Y);
+ I = 1;
+ overflow:
+ sigsave = 0;
+ Z = V9;
+ printf ("Can `Z = -Y' overflow?\n");
+ printf ("Trying it on Y = %.17e .\n", Y);
+ V9 = -Y;
+ V0 = V9;
+ if (V - Y == V + V0)
+ printf ("Seems O.K.\n");
+ else {
+ printf ("finds a ");
+ BadCond (Flaw, "-(-Y) differs from Y.\n");
+ }
+ if (Z != Y) {
+ BadCond (Serious, "");
+ printf ("overflow past %.17e\n\tshrinks to %.17e .\n", Y, Z);
+ }
+ if (I) {
+ Y = V * (HInvrse * U2 - HInvrse);
+ Z = Y + ((One - HInvrse) * U2) * V;
+ if (Z < V0)
+ Y = Z;
+ if (Y < V0)
+ V = Y;
+ if (V0 - V < V0)
+ V = V0;
+ } else {
+ V = Y * (HInvrse * U2 - HInvrse);
+ V = V + ((One - HInvrse) * U2) * Y;
+ }
+ printf ("Overflow threshold is V = %.17e .\n", V);
+ if (I)
+ printf ("Overflow saturates at V0 = %.17e .\n", V0);
+ else
+ printf ("There is no saturation value because \
+the system traps on overflow.\n");
+ V9 = V * One;
+ printf ("No Overflow should be signaled for V * 1 = %.17e\n", V9);
+ V9 = V / One;
+ printf (" nor for V / 1 = %.17e .\n", V9);
+ printf ("Any overflow signal separating this * from the one\n");
+ printf ("above is a DEFECT.\n");
+ /*=============================================*/
+ Milestone = 170;
+ /*=============================================*/
+ if (!(-V < V && -V0 < V0 && -UfThold < V && UfThold < V)) {
+ BadCond (Failure, "Comparisons involving ");
+ printf ("+-%g, +-%g\nand +-%g are confused by Overflow.",
+ V, V0, UfThold);
+ }
+ /*=============================================*/
+ Milestone = 175;
+ /*=============================================*/
+ printf ("\n");
+ for (Indx = 1; Indx <= 3; ++Indx) {
+ switch (Indx) {
+ case 1:
+ Z = UfThold;
+ break;
+ case 2:
+ Z = E0;
+ break;
+ case 3:
+ Z = PseudoZero;
+ break;
+ }
+ if (Z != Zero) {
+ V9 = SQRT (Z);
+ Y = V9 * V9;
+ if (Y / (One - Radix * E9) < Z
+ || Y > (One + Radix * E9) * Z) { /* dgh: + E9 --> * E9 */
+ if (V9 > U1)
+ BadCond (Serious, "");
+ else
+ BadCond (Defect, "");
+ printf ("Comparison alleges that what prints as Z = %.17e\n", Z);
+ printf (" is too far from sqrt(Z) ^ 2 = %.17e .\n", Y);
+ }
+ }
+ }
+ /*=============================================*/
+ Milestone = 180;
+ /*=============================================*/
+ for (Indx = 1; Indx <= 2; ++Indx) {
+ if (Indx == 1)
+ Z = V;
+ else
+ Z = V0;
+ V9 = SQRT (Z);
+ X = (One - Radix * E9) * V9;
+ V9 = V9 * X;
+ if (((V9 < (One - Two * Radix * E9) * Z) || (V9 > Z))) {
+ Y = V9;
+ if (X < W)
+ BadCond (Serious, "");
+ else
+ BadCond (Defect, "");
+ printf ("Comparison alleges that Z = %17e\n", Z);
+ printf (" is too far from sqrt(Z) ^ 2 (%.17e) .\n", Y);
+ }
+ }
+ /*=============================================*/
+ Milestone = 190;
+ /*=============================================*/
+ Pause ();
+ X = UfThold * V;
+ Y = Radix * Radix;
+ if (X * Y < One || X > Y) {
+ if (X * Y < U1 || X > Y / U1)
+ BadCond (Defect, "Badly");
+ else
+ BadCond (Flaw, "");
+
+ printf (" unbalanced range; UfThold * V = %.17e\n\t%s\n",
+ X, "is too far from 1.\n");
+ }
+ /*=============================================*/
+ Milestone = 200;
+ /*=============================================*/
+ for (Indx = 1; Indx <= 5; ++Indx) {
+ X = F9;
+ switch (Indx) {
+ case 2:
+ X = One + U2;
+ break;
+ case 3:
+ X = V;
+ break;
+ case 4:
+ X = UfThold;
+ break;
+ case 5:
+ X = Radix;
+ }
+ Y = X;
+ sigsave = _sigfpe;
+ if (setjmp (ovfl_buf))
+ printf (" X / X traps when X = %g\n", X);
+ else {
+ V9 = (Y / X - Half) - Half;
+ if (V9 == Zero)
+ continue;
+ if (V9 == -U1 && Indx < 5)
+ BadCond (Flaw, "");
+ else
+ BadCond (Serious, "");
+ printf (" X / X differs from 1 when X = %.17e\n", X);
+ printf (" instead, X / X - 1/2 - 1/2 = %.17e .\n", V9);
+ }
+ sigsave = 0;
+ }
+ /*=============================================*/
+ Milestone = 210;
+ /*=============================================*/
+ MyZero = Zero;
+ printf ("\n");
+ printf ("What message and/or values does Division by Zero produce?\n");
+#ifndef BATCHMODE
+ printf ("This can interupt your program. You can ");
+ printf ("skip this part if you wish.\n");
+ printf ("Do you wish to compute 1 / 0? ");
+ fflush (stdout);
+ read (KEYBOARD, ch, 8);
+ if ((ch[0] == 'Y') || (ch[0] == 'y')) {
+#endif /* !BATCHMODE */
+ sigsave = _sigfpe;
+ printf (" Trying to compute 1 / 0 produces ...");
+ if (!setjmp (ovfl_buf))
+ printf (" %.7e .\n", One / MyZero);
+ sigsave = 0;
+#ifndef BATCHMODE
+ } else
+ printf ("O.K.\n");
+ printf ("\nDo you wish to compute 0 / 0? ");
+ fflush (stdout);
+ read (KEYBOARD, ch, 80);
+ if ((ch[0] == 'Y') || (ch[0] == 'y')) {
+#endif /* !BATCHMODE */
+ sigsave = _sigfpe;
+ printf ("\n Trying to compute 0 / 0 produces ...");
+ if (!setjmp (ovfl_buf))
+ printf (" %.7e .\n", Zero / MyZero);
+ sigsave = 0;
+#ifndef BATCHMODE
+ } else
+ printf ("O.K.\n");
+#endif /* !BATCHMODE */
+ /*=============================================*/
+ Milestone = 220;
+ /*=============================================*/
+
+ Pause ();
+ printf ("\n");
+ {
+ static char *msg[] =
+ {
+ "FAILUREs encountered =",
+ "SERIOUS DEFECTs discovered =",
+ "DEFECTs discovered =",
+ "FLAWs discovered ="};
+ int i;
+ for (i = 0; i < 4; i++)
+ if (ErrCnt[i])
+ printf ("The number of %-29s %d.\n",
+ msg[i], ErrCnt[i]);
+ }
+
+ printf ("\n");
+ if ((ErrCnt[Failure] + ErrCnt[Serious] + ErrCnt[Defect]
+ + ErrCnt[Flaw]) > 0) {
+ if ((ErrCnt[Failure] + ErrCnt[Serious] + ErrCnt[
+ Defect] == 0) && (ErrCnt[Flaw] > 0)) {
+ printf ("The arithmetic diagnosed seems ");
+ printf ("Satisfactory though flawed.\n");
+ }
+ if ((ErrCnt[Failure] + ErrCnt[Serious] == 0)
+ && (ErrCnt[Defect] > 0)) {
+ printf ("The arithmetic diagnosed may be Acceptable\n");
+ printf ("despite inconvenient Defects.\n");
+ }
+ if ((ErrCnt[Failure] + ErrCnt[Serious]) > 0) {
+ printf ("The arithmetic diagnosed has ");
+ printf ("unacceptable Serious Defects.\n");
+ }
+ if (ErrCnt[Failure] > 0) {
+ printf ("Potentially fatal FAILURE may have spoiled this");
+ printf (" program's subsequent diagnoses.\n");
+ }
+ } else {
+
+ printf ("No failures, defects nor flaws have been discovered.\n");
+ if (!((RMult == Rounded) && (RDiv == Rounded)
+ && (RAddSub == Rounded) && (RSqrt == Rounded)))
+ printf ("The arithmetic diagnosed seems Satisfactory.\n");
+ else {
+ if (StickyBit >= One &&
+ (Radix - Two) * (Radix - Nine - One) == Zero) {
+ printf ("Rounding appears to conform to ");
+ printf ("the proposed IEEE standard P");
+ if ((Radix == Two) &&
+ ((Precision - Four * Three * Two) *
+ (Precision - TwentySeven -
+ TwentySeven + One) == Zero))
+ printf ("754");
+ else
+ printf ("854");
+ if (IEEE)
+ printf (".\n");
+ else {
+ printf (",\nexcept for possibly Double Rounding");
+ printf (" during Gradual Underflow.\n");
+ }
+ }
+ printf ("The arithmetic diagnosed appears to be Excellent!\n");
+ }
+ }
+
+ if (fpecount)
+ printf ("\nA total of %d floating point exceptions were registered.\n",
+ fpecount);
+ printf ("END OF TEST.\n");
+ return 0;
+}
+
+FLOAT
+Sign (X)
+ FLOAT X;
+{
+ return X >= 0. ? 1.0 : -1.0;
+}
+
+void
+Pause ()
+{
+#ifndef BATCHMODE
+ char ch[8];
+
+ printf ("\nTo continue, press RETURN");
+ fflush (stdout);
+ read (KEYBOARD, ch, 8);
+#endif /* !BATCHMODE */
+#ifndef CYGNUS
+ printf ("\nDiagnosis resumes after milestone Number %d", Milestone);
+ printf (" Page: %d\n\n", PageNo);
+ ++Milestone;
+ ++PageNo;
+#endif /* !CYGNUS */
+}
+
+void
+TstCond (K, Valid, T)
+ int K, Valid;
+ char *T;
+{
+#ifdef CYGNUS
+ printf ("TEST: %s\n", T);
+#endif /* CYGNUS */
+ if (!Valid) {
+ BadCond (K, T);
+ printf (".\n");
+ }
+#ifdef CYGNUS
+ printf ("PASS: %s\n", T);
+#endif /* CYGNUS */
+}
+
+void
+BadCond (K, T)
+ int K;
+ char *T;
+{
+ static char *msg[] =
+ {"FAILURE", "SERIOUS DEFECT", "DEFECT", "FLAW"};
+
+ ErrCnt[K] = ErrCnt[K] + 1;
+#ifndef CYGNUS
+ printf ("%s: %s", msg[K], T);
+#else
+ printf ("ERROR: Severity: %s: %s", msg[K], T);
+#endif /* CYGNUS */
+}
+
+/*
+ * Random computes
+ * X = (Random1 + Random9)^5
+ * Random1 = X - FLOOR(X) + 0.000005 * X;
+ * and returns the new value of Random1
+*/
+FLOAT
+Random ()
+{
+ FLOAT X, Y;
+
+ X = Random1 + Random9;
+ Y = X * X;
+ Y = Y * Y;
+ X = X * Y;
+ Y = X - FLOOR (X);
+ Random1 = Y + X * 0.000005;
+ return (Random1);
+}
+
+void
+SqXMinX (ErrKind)
+ int ErrKind;
+{
+ FLOAT XA, XB;
+
+ XB = X * BInvrse;
+ XA = X - XB;
+ SqEr = ((SQRT (X * X) - XB) - XA) / OneUlp;
+ if (SqEr != Zero) {
+ if (SqEr < MinSqEr)
+ MinSqEr = SqEr;
+ if (SqEr > MaxSqEr)
+ MaxSqEr = SqEr;
+ J = J + 1.0;
+ BadCond (ErrKind, "\n");
+ printf ("sqrt( %.17e) - %.17e = %.17e\n", X * X, X, OneUlp * SqEr);
+ printf ("\tinstead of correct value 0 .\n");
+ }
+}
+
+void
+NewD ()
+{
+ X = Z1 * Q;
+ X = FLOOR (Half - X / Radix) * Radix + X;
+ Q = (Q - X * Z) / Radix + X * X * (D / Radix);
+ Z = Z - Two * X * D;
+ if (Z <= Zero) {
+ Z = -Z;
+ Z1 = -Z1;
+ }
+ D = Radix * D;
+}
+
+void
+SR3750 ()
+{
+ if (!((X - Radix < Z2 - Radix) || (X - Z2 > W - Z2))) {
+ I = I + 1;
+ X2 = SQRT (X * D);
+ Y2 = (X2 - Z2) - (Y - Z2);
+ X2 = X8 / (Y - Half);
+ X2 = X2 - Half * X2 * X2;
+ SqEr = (Y2 + Half) + (Half - X2);
+ if (SqEr < MinSqEr)
+ MinSqEr = SqEr;
+ SqEr = Y2 - X2;
+ if (SqEr > MaxSqEr)
+ MaxSqEr = SqEr;
+ }
+}
+
+void
+IsYeqX ()
+{
+ if (Y != X) {
+ if (N <= 0) {
+ if (Z == Zero && Q <= Zero)
+ printf ("WARNING: computing\n");
+ else
+ BadCond (Defect, "computing\n");
+ printf ("\t(%.17e) ^ (%.17e)\n", Z, Q);
+ printf ("\tyielded %.17e;\n", Y);
+ printf ("\twhich compared unequal to correct %.17e ;\n",
+ X);
+ printf ("\t\tthey differ by %.17e .\n", Y - X);
+ }
+ N = N + 1; /* ... count discrepancies. */
+ }
+}
+
+void
+SR3980 ()
+{
+ do {
+ Q = (FLOAT) I;
+ Y = POW (Z, Q);
+ IsYeqX ();
+ if (++I > M)
+ break;
+ X = Z * X;
+ }
+ while (X < W);
+}
+
+void
+PrintIfNPositive ()
+{
+ if (N > 0)
+ printf ("Similar discrepancies have occurred %d times.\n", N);
+}
+
+void
+TstPtUf ()
+{
+ N = 0;
+ if (Z != Zero) {
+ printf ("Since comparison denies Z = 0, evaluating ");
+ printf ("(Z + Z) / Z should be safe.\n");
+ sigsave = _sigfpe;
+ if (setjmp (ovfl_buf))
+ goto very_serious;
+ Q9 = (Z + Z) / Z;
+ printf ("What the machine gets for (Z + Z) / Z is %.17e .\n",
+ Q9);
+ if (FABS (Q9 - Two) < Radix * U2) {
+ printf ("This is O.K., provided Over/Underflow");
+ printf (" has NOT just been signaled.\n");
+ } else {
+ if ((Q9 < One) || (Q9 > Two)) {
+ very_serious:
+ N = 1;
+ ErrCnt[Serious] = ErrCnt[Serious] + 1;
+ printf ("This is a VERY SERIOUS DEFECT!\n");
+ } else {
+ N = 1;
+ ErrCnt[Defect] = ErrCnt[Defect] + 1;
+ printf ("This is a DEFECT!\n");
+ }
+ }
+ sigsave = 0;
+ V9 = Z * One;
+ Random1 = V9;
+ V9 = One * Z;
+ Random2 = V9;
+ V9 = Z / One;
+ if ((Z == Random1) && (Z == Random2) && (Z == V9)) {
+ if (N > 0)
+ Pause ();
+ } else {
+ N = 1;
+ BadCond (Defect, "What prints as Z = ");
+ printf ("%.17e\n\tcompares different from ", Z);
+ if (Z != Random1)
+ printf ("Z * 1 = %.17e ", Random1);
+ if (!((Z == Random2)
+ || (Random2 == Random1)))
+ printf ("1 * Z == %g\n", Random2);
+ if (!(Z == V9))
+ printf ("Z / 1 = %.17e\n", V9);
+ if (Random2 != Random1) {
+ ErrCnt[Defect] = ErrCnt[Defect] + 1;
+ BadCond (Defect, "Multiplication does not commute!\n");
+ printf ("\tComparison alleges that 1 * Z = %.17e\n",
+ Random2);
+ printf ("\tdiffers from Z * 1 = %.17e\n", Random1);
+ }
+ Pause ();
+ }
+ }
+}
+
+void
+notify (s)
+ char *s;
+{
+ printf ("%s test appears to be inconsistent...\n", s);
+ printf (" PLEASE NOTIFY KARPINKSI!\n");
+}
+
+void
+msglist (s)
+ char **s;
+{
+ while (*s)
+ printf ("%s\n", *s++);
+}
+
+void
+Instructions ()
+{
+ static char *instr[] =
+ {
+ "Lest this program stop prematurely, i.e. before displaying\n",
+ " `END OF TEST',\n",
+ "try to persuade the computer NOT to terminate execution when an",
+ "error like Over/Underflow or Division by Zero occurs, but rather",
+ "to persevere with a surrogate value after, perhaps, displaying some",
+ "warning. If persuasion avails naught, don't despair but run this",
+ "program anyway to see how many milestones it passes, and then",
+ "amend it to make further progress.\n",
+ "Answer questions with Y, y, N or n (unless otherwise indicated).\n",
+ 0};
+
+ msglist (instr);
+}
+
+void
+Heading ()
+{
+ static char *head[] =
+ {
+ "Users are invited to help debug and augment this program so it will",
+ "cope with unanticipated and newly uncovered arithmetic pathologies.\n",
+ "Please send suggestions and interesting results to",
+ "\tRichard Karpinski",
+ "\tComputer Center U-76",
+ "\tUniversity of California",
+ "\tSan Francisco, CA 94143-0704, USA\n",
+ "In doing so, please include the following information:",
+#ifdef SINGLE_PRECISION
+ "\tPrecision:\tsingle;",
+#else /* !SINGLE_PRECISION */
+ "\tPrecision:\tdouble;",
+#endif /* SINGLE_PRECISION */
+ "\tVersion:\t10 February 1989;",
+ "\tComputer:\n",
+ "\tCompiler:\n",
+ "\tOptimization level:\n",
+ "\tOther relevant compiler options:",
+ 0};
+
+ msglist (head);
+}
+
+void
+Characteristics ()
+{
+ static char *chars[] =
+ {
+ "Running this program should reveal these characteristics:",
+ " Radix = 1, 2, 4, 8, 10, 16, 100, 256 ...",
+ " Precision = number of significant digits carried.",
+ " U2 = Radix/Radix^Precision = One Ulp",
+ "\t(OneUlpnit in the Last Place) of 1.000xxx .",
+ " U1 = 1/Radix^Precision = One Ulp of numbers a little less than 1.0 .",
+ " Adequacy of guard digits for Mult., Div. and Subt.",
+ " Whether arithmetic is chopped, correctly rounded, or something else",
+ "\tfor Mult., Div., Add/Subt. and Sqrt.",
+ " Whether a Sticky Bit used correctly for rounding.",
+ " UnderflowThreshold = an underflow threshold.",
+ " E0 and PseudoZero tell whether underflow is abrupt, gradual, or fuzzy.",
+ " V = an overflow threshold, roughly.",
+ " V0 tells, roughly, whether Infinity is represented.",
+ " Comparisions are checked for consistency with subtraction",
+ "\tand for contamination with pseudo-zeros.",
+ " Sqrt is tested. Y^X is not tested.",
+ " Extra-precise subexpressions are revealed but NOT YET tested.",
+ " Decimal-Binary conversion is NOT YET tested for accuracy.",
+ 0};
+
+ msglist (chars);
+}
+
+void
+History ()
+{ /* History */
+ /* Converted from Brian Wichmann's Pascal version to C by Thos Sumner,
+ with further massaging by David M. Gay. */
+
+ static char *hist[] =
+ {
+ "The program attempts to discriminate among",
+ " FLAWs, like lack of a sticky bit,",
+ " Serious DEFECTs, like lack of a guard digit, and",
+ " FAILUREs, like 2+2 == 5 .",
+ "Failures may confound subsequent diagnoses.\n",
+ "The diagnostic capabilities of this program go beyond an earlier",
+ "program called `MACHAR', which can be found at the end of the",
+ "book `Software Manual for the Elementary Functions' (1980) by",
+ "W. J. Cody and W. Waite. Although both programs try to discover",
+ "the Radix, Precision and range (over/underflow thresholds)",
+ "of the arithmetic, this program tries to cope with a wider variety",
+ "of pathologies, and to say how well the arithmetic is implemented.",
+ "\nThe program is based upon a conventional radix representation for",
+ "floating-point numbers, but also allows logarithmic encoding",
+ "as used by certain early WANG machines.\n",
+ "BASIC version of this program (C) 1983 by Prof. W. M. Kahan;",
+ "see source comments for more history.",
+ 0};
+
+ msglist (hist);
+}
diff --git a/testsuites/samples/paranoia/paranoia.doc b/testsuites/samples/paranoia/paranoia.doc
new file mode 100644
index 0000000000..0de40191c6
--- /dev/null
+++ b/testsuites/samples/paranoia/paranoia.doc
@@ -0,0 +1,13 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+
diff --git a/testsuites/samples/paranoia/system.h b/testsuites/samples/paranoia/system.h
new file mode 100644
index 0000000000..88e60beb9a
--- /dev/null
+++ b/testsuites/samples/paranoia/system.h
@@ -0,0 +1,30 @@
+/* system.h
+ *
+ * This include file contains information that is included in every
+ * function in the test set.
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include "stdio.h"
+
+/* Miscellaneous */
+
+#define EXTERN extern /* external definition */
+
+/* macros */
+
+/* structures */
+
+#include "gvar.h"
+
+/* end of include file */
diff --git a/testsuites/samples/ticker/init.c b/testsuites/samples/ticker/init.c
new file mode 100644
index 0000000000..3caa16ecd7
--- /dev/null
+++ b/testsuites/samples/ticker/init.c
@@ -0,0 +1,58 @@
+/* Init
+ *
+ * This routine is the initialization task for this test program.
+ * It is called from init_exec and has the responsibility for creating
+ * and starting the tasks that make up the test. If the time of day
+ * clock is required for the test, it should also be set to a known
+ * value by this function.
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+#undef EXTERN
+#define EXTERN
+#include "conftbl.h"
+#include "gvar.h"
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+ rtems_time_of_day time;
+
+ puts( "\n\n*** CLOCK TICK TEST ***" );
+
+ build_time( &time, 12, 31, 1988, 9, 0, 0, 0 );
+ status = rtems_clock_set( &time );
+
+ Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' );
+ Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' );
+ Task_name[ 3 ] = rtems_build_name( 'T', 'A', '3', ' ' );
+
+ status = rtems_task_create( Task_name[ 1 ], 1, 1024, RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ 1 ] );
+ status = rtems_task_create( Task_name[ 2 ], 1, 1024, RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ 2 ] );
+ status = rtems_task_create( Task_name[ 3 ], 1, 1024, RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ 3 ] );
+
+ status = rtems_task_start( Task_id[ 1 ], Test_task, 1 );
+ status = rtems_task_start( Task_id[ 2 ], Test_task, 2 );
+ status = rtems_task_start( Task_id[ 3 ], Test_task, 3 );
+
+ status = rtems_task_delete( RTEMS_SELF );
+}
diff --git a/testsuites/samples/ticker/system.h b/testsuites/samples/ticker/system.h
new file mode 100644
index 0000000000..aa2c6d17e4
--- /dev/null
+++ b/testsuites/samples/ticker/system.h
@@ -0,0 +1,30 @@
+/* system.h
+ *
+ * This include file contains information that is included in every
+ * function in the test set.
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include "tmacros.h"
+
+/* Miscellaneous */
+
+#define EXTERN extern /* external definition */
+
+/* macros */
+
+/* structures */
+
+#include "gvar.h"
+
+/* end of include file */
diff --git a/testsuites/samples/ticker/tasks.c b/testsuites/samples/ticker/tasks.c
new file mode 100644
index 0000000000..ec7c6baa2e
--- /dev/null
+++ b/testsuites/samples/ticker/tasks.c
@@ -0,0 +1,44 @@
+/* Test_task
+ *
+ * This routine serves as a test task. It verifies the basic task
+ * switching capabilities of the executive.
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_task Test_task(
+ rtems_task_argument unused
+)
+{
+ rtems_id tid;
+ rtems_time_of_day time;
+ rtems_unsigned32 task_index;
+ rtems_status_code status;
+
+ status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
+ task_index = task_number( tid );
+ while( FOREVER ) {
+ status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
+ if ( time.second >= 35 ) {
+ puts( "*** END OF CLOCK TICK TEST ***" );
+ exit( 0 );
+ }
+ put_name( Task_name[ task_index ], FALSE );
+ print_time( " - rtems_clock_get - ", &time, "\n" );
+ status = rtems_task_wake_after( task_index * 5 * TICKS_PER_SECOND );
+ }
+}
diff --git a/testsuites/samples/ticker/ticker.doc b/testsuites/samples/ticker/ticker.doc
new file mode 100644
index 0000000000..0de40191c6
--- /dev/null
+++ b/testsuites/samples/ticker/ticker.doc
@@ -0,0 +1,13 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+
diff --git a/testsuites/samples/ticker/ticker.scn b/testsuites/samples/ticker/ticker.scn
new file mode 100644
index 0000000000..35952e6170
--- /dev/null
+++ b/testsuites/samples/ticker/ticker.scn
@@ -0,0 +1,16 @@
+*** CLOCK TICK TEST ***
+TA1 - tm_get - 09:00:00 12/31/1988
+TA2 - tm_get - 09:00:00 12/31/1988
+TA3 - tm_get - 09:00:00 12/31/1988
+TA1 - tm_get - 09:00:05 12/31/1988
+TA1 - tm_get - 09:00:10 12/31/1988
+TA2 - tm_get - 09:00:10 12/31/1988
+TA1 - tm_get - 09:00:15 12/31/1988
+TA3 - tm_get - 09:00:15 12/31/1988
+TA1 - tm_get - 09:00:20 12/31/1988
+TA2 - tm_get - 09:00:20 12/31/1988
+TA1 - tm_get - 09:00:25 12/31/1988
+TA1 - tm_get - 09:00:30 12/31/1988
+TA2 - tm_get - 09:00:30 12/31/1988
+TA3 - tm_get - 09:00:30 12/31/1988
+*** END OF CLOCK TICK TEST ***
diff --git a/testsuites/sptests/README b/testsuites/sptests/README
new file mode 100644
index 0000000000..2843063c31
--- /dev/null
+++ b/testsuites/sptests/README
@@ -0,0 +1,9 @@
+#
+# $Id$
+#
+
+This directory contains the RTEMS Single Processor Test Suite.
+The tests in this directory provide near complete (98%+) test
+coverage of the non-multiprocessor code in RTEMS.
+
+
diff --git a/testsuites/sptests/sp01/init.c b/testsuites/sptests/sp01/init.c
new file mode 100644
index 0000000000..82ffd0015c
--- /dev/null
+++ b/testsuites/sptests/sp01/init.c
@@ -0,0 +1,89 @@
+/* Init
+ *
+ * This routine is the initialization task for this test program.
+ * It is a user initialization task and has the responsibility for creating
+ * and starting the tasks that make up the test. If the time of day
+ * clock is required for the test, it should also be set to a known
+ * value by this function.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+#undef EXTERN
+#define EXTERN
+#include "conftbl.h"
+#include "gvar.h"
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ rtems_time_of_day time;
+ rtems_status_code status;
+
+ puts( "\n\n*** TEST 1 ***" );
+
+ build_time( &time, 12, 31, 1988, 9, 0, 0, 0 );
+ status = rtems_clock_set( &time );
+ directive_failed( status, "rtems_clock_set" );
+
+ Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' );
+ Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' );
+ Task_name[ 3 ] = rtems_build_name( 'T', 'A', '3', ' ' );
+
+ status = rtems_task_create(
+ Task_name[ 1 ],
+ 1,
+ 2 * 1024,
+ RTEMS_INTERRUPT_LEVEL(31),
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 1 ]
+ );
+ directive_failed( status, "rtems_task_create of TA1" );
+
+ status = rtems_task_create(
+ Task_name[ 2 ],
+ 1,
+ 2 * 1024,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 2 ]
+ );
+ directive_failed( status, "rtems_task_create of TA2" );
+
+ status = rtems_task_create(
+ Task_name[ 3 ],
+ 1,
+ 2 * 1024,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 3 ]
+ );
+ directive_failed( status, "rtems_task_create of TA3" );
+
+ status = rtems_task_start( Task_id[ 1 ], Task_1_through_3, 0 );
+ directive_failed( status, "rtems_task_start of TA1" );
+
+ status = rtems_task_start( Task_id[ 2 ], Task_1_through_3, 0 );
+ directive_failed( status, "rtems_task_start of TA2" );
+
+ status = rtems_task_start( Task_id[ 3 ], Task_1_through_3, 0 );
+ directive_failed( status, "rtems_task_start of TA3" );
+
+ status = rtems_task_delete( RTEMS_SELF );
+ directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
+}
diff --git a/testsuites/sptests/sp01/sp01.doc b/testsuites/sptests/sp01/sp01.doc
new file mode 100644
index 0000000000..79b1aaaa87
--- /dev/null
+++ b/testsuites/sptests/sp01/sp01.doc
@@ -0,0 +1,43 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: test1
+
+directives:
+ ex_init, ex_start, t_create, t_start, tm_tick, i_return, t_ident,
+ tm_set, tm_get, tm_wkafter
+
+concepts:
+
+ a. Verifies system can create and start both the executive's system
+ initialization and idle task.
+
+ b. Verifies executive can swap between three application tasks at the
+ same priority and the executive's internal idle task.
+
+ c. Verifies can print strings to the CRT on port 2 of the mvme136 board
+ using Print and Println in the board support package.
+
+ d. Verifies interrupt handler can handle a task switch from an interrupt
+ as specified with the i_return directive.
+
+ e. Verifies executive initialization performed correctly.
+
+ f. Verifies the executive trap handler except for the halt function.
+
+ g. Verifies that a task can get the task identification number of itself.
+
+output:
+ "TA1" is printed once every 5 seconds. "TA2" is printed once
+ every 10 seconds. "TA3" is printed once every 15 seconds.
diff --git a/testsuites/sptests/sp01/sp01.scn b/testsuites/sptests/sp01/sp01.scn
new file mode 100644
index 0000000000..d4fcc4561b
--- /dev/null
+++ b/testsuites/sptests/sp01/sp01.scn
@@ -0,0 +1,18 @@
+*** TEST 1 ***
+TA1 - rtems_clock_get - 09:00:00 12/31/1988
+TA2 - rtems_clock_get - 09:00:00 12/31/1988
+TA3 - rtems_clock_get - 09:00:00 12/31/1988
+TA1 - rtems_clock_get - 09:00:05 12/31/1988
+TA2 - rtems_clock_get - 09:00:10 12/31/1988
+TA1 - rtems_clock_get - 09:00:10 12/31/1988
+TA3 - rtems_clock_get - 09:00:15 12/31/1988
+TA1 - rtems_clock_get - 09:00:15 12/31/1988
+TA2 - rtems_clock_get - 09:00:20 12/31/1988
+TA1 - rtems_clock_get - 09:00:20 12/31/1988
+TA1 - rtems_clock_get - 09:00:25 12/31/1988
+TA3 - rtems_clock_get - 09:00:30 12/31/1988
+TA1 - rtems_clock_get - 09:00:30 12/31/1988
+TA2 - rtems_clock_get - 09:00:30 12/31/1988
+*** END OF TEST 1 ***
+
+NOTE: The order of the prints at each time interval is irrelevant.
diff --git a/testsuites/sptests/sp01/system.h b/testsuites/sptests/sp01/system.h
new file mode 100644
index 0000000000..aa2c6d17e4
--- /dev/null
+++ b/testsuites/sptests/sp01/system.h
@@ -0,0 +1,30 @@
+/* system.h
+ *
+ * This include file contains information that is included in every
+ * function in the test set.
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include "tmacros.h"
+
+/* Miscellaneous */
+
+#define EXTERN extern /* external definition */
+
+/* macros */
+
+/* structures */
+
+#include "gvar.h"
+
+/* end of include file */
diff --git a/testsuites/sptests/sp01/task1.c b/testsuites/sptests/sp01/task1.c
new file mode 100644
index 0000000000..b45d3abce6
--- /dev/null
+++ b/testsuites/sptests/sp01/task1.c
@@ -0,0 +1,50 @@
+/* Task_1_through_3
+ *
+ * This routine serves as a test task. It verifies the basic task
+ * switching capabilities of the executive.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_task Task_1_through_3(
+ rtems_task_argument argument
+)
+{
+ rtems_id tid;
+ rtems_time_of_day time;
+ rtems_status_code status;
+
+ status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid );
+ directive_failed( status, "rtems_task_ident" );
+
+ while( FOREVER ) {
+ status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
+ directive_failed( status, "rtems_clock_get" );
+
+ if ( time.second >= 35 ) {
+ puts( "*** END OF TEST 1 ***" );
+ exit( 0 );
+ }
+
+ put_name( Task_name[ task_number( tid ) ], FALSE );
+ print_time( " - rtems_clock_get - ", &time, "\n" );
+
+ status = rtems_task_wake_after( task_number( tid ) * 5 * TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after" );
+ }
+}
diff --git a/testsuites/sptests/sp02/init.c b/testsuites/sptests/sp02/init.c
new file mode 100644
index 0000000000..b3ada92914
--- /dev/null
+++ b/testsuites/sptests/sp02/init.c
@@ -0,0 +1,155 @@
+/* Init
+ *
+ * This routine is the initialization task for this test program.
+ * It is a user initialization task and has the responsibility for creating
+ * and starting the tasks that make up the test. If the time of day
+ * clock is required for the test, it should also be set to a known
+ * value by this function.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+#undef EXTERN
+#define EXTERN
+#include "conftbl.h"
+#include "gvar.h"
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+
+ puts( "\n\n*** TEST 2 ***" );
+
+ Preempt_task_name = rtems_build_name( 'P', 'R', 'M', 'T' );
+
+ status = rtems_task_create(
+ Preempt_task_name,
+ 1,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Preempt_task_id
+ );
+ directive_failed( status, "rtems_task_create of RTEMS_PREEMPT" );
+
+ status = rtems_task_start( Preempt_task_id, Preempt_task, 0 );
+ directive_failed( status, "rtems_task_start of RTEMS_PREEMPT" );
+
+ puts( "INIT - rtems_task_wake_after - yielding processor" );
+ status = rtems_task_wake_after( RTEMS_YIELD_PROCESSOR );
+ directive_failed( status, "rtems_task_wake_after" );
+
+ Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' );
+ Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' );
+ Task_name[ 3 ] = rtems_build_name( 'T', 'A', '3', ' ' );
+
+ status = rtems_task_create(
+ Task_name[ 1 ],
+ 3,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 1 ]
+ );
+ directive_failed( status, "rtems_task_create of TA1" );
+
+ status = rtems_task_create(
+ Task_name[ 2 ],
+ 3,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 2 ]
+ );
+ directive_failed( status, "rtems_task_create of TA2" );
+
+ status = rtems_task_create(
+ Task_name[ 3 ],
+ 3,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 3 ]
+ );
+ directive_failed( status, "rtems_task_create of TA3" );
+
+ status = rtems_task_start( Task_id[ 1 ], Task_1, 0 );
+ directive_failed( status, "rtems_task_start of TA1" );
+
+ status = rtems_task_start( Task_id[ 2 ], Task_2, 0 );
+ directive_failed( status, "rtems_task_start of TA2" );
+
+ status = rtems_task_start( Task_id[ 3 ], Task_3, 0 );
+ directive_failed( status, "rtems_task_start of TA3" );
+
+ puts( "INIT - suspending TA2 while middle task on a ready chain" );
+ status = rtems_task_suspend( Task_id[ 2 ] );
+ directive_failed( status, "rtems_task_suspend of TA2" );
+
+ status = rtems_task_delete( Task_id[ 1 ] );
+ directive_failed( status, "rtems_task_delete of TA1" );
+
+ status = rtems_task_delete( Task_id[ 2 ] );
+ directive_failed( status, "rtems_task_delete of TA2" );
+
+ status = rtems_task_delete( Task_id[ 3 ] );
+ directive_failed( status, "rtems_task_delete of TA3" );
+
+ status = rtems_task_create(
+ Task_name[ 1 ],
+ 1,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 1 ]
+ );
+ directive_failed( status, "rtems_task_create of TA1" );
+
+ status = rtems_task_create(
+ Task_name[ 2 ],
+ 3,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 2 ]
+ );
+ directive_failed( status, "rtems_task_create of TA2" );
+
+ status = rtems_task_create(
+ Task_name[ 3 ],
+ 3,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 3 ]
+ );
+ directive_failed( status, "rtems_task_create of TA3" );
+
+ status = rtems_task_start( Task_id[ 1 ], Task_1, 0 );
+ directive_failed( status, "rtems_task_start of TA1" );
+
+ status = rtems_task_start( Task_id[ 2 ], Task_2, 0 );
+ directive_failed( status, "rtems_task_start of TA2" );
+
+ status = rtems_task_start( Task_id[ 3 ], Task_3, 0 );
+ directive_failed( status, "rtems_task_start of TA3" );
+
+ status = rtems_task_delete( RTEMS_SELF );
+ directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
+}
diff --git a/testsuites/sptests/sp02/preempt.c b/testsuites/sptests/sp02/preempt.c
new file mode 100644
index 0000000000..7e93f7af57
--- /dev/null
+++ b/testsuites/sptests/sp02/preempt.c
@@ -0,0 +1,32 @@
+/* Preempt_task
+ *
+ * This routine serves as a test task. It verifies the task manager.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_task Preempt_task(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+
+ puts( "PREEMPT - rtems_task_delete - deleting self" );
+ status = rtems_task_delete( RTEMS_SELF );
+ directive_failed( status, "rtems_task_delete of RTEMS_PREEMPT" );
+}
diff --git a/testsuites/sptests/sp02/sp02.doc b/testsuites/sptests/sp02/sp02.doc
new file mode 100644
index 0000000000..00f2e0e7b3
--- /dev/null
+++ b/testsuites/sptests/sp02/sp02.doc
@@ -0,0 +1,37 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: test2
+
+directives:
+ ex_init, ex_start, t_create, t_start, tm_tick, i_return, t_ident,
+ t_delete, tm_wkafter, t_setpri, t_suspend
+
+concepts:
+
+ a. Verifies that a task can delete another task and also delete itself.
+
+ b. Verifies that memory is freed back to the heap correctly.
+
+ c. Verifies that TCBs are freed back to the inactive chain correctly.
+
+ d. Verifies that a task can get the task identification number of
+ another task.
+
+ e. Verifies the _Set_state routine where the task is not READY.
+
+ f. Verifies the break statement in the _Block_activate routine.
+
+ g. Verifies the while loop in the _Prev_tcb routine.
diff --git a/testsuites/sptests/sp02/sp02.scn b/testsuites/sptests/sp02/sp02.scn
new file mode 100644
index 0000000000..57a4627284
--- /dev/null
+++ b/testsuites/sptests/sp02/sp02.scn
@@ -0,0 +1,15 @@
+*** TEST 2 ***
+INIT - rtems_task_wake_after - yielding processor
+PREEMPT - rtems_task_delete - deleting self
+INIT - suspending TA2 while middle task on a ready chain
+TA1 - rtems_task_wake_after - sleep 1 second
+TA2 - rtems_task_wake_after - sleep 1 minute
+TA3 - rtems_task_wake_after - sleep 5 seconds
+TA1 - rtems_task_ident - tid of TA2 (0x00010007)
+TA1 - rtems_task_ident - tid of TA3 (0x00010008)
+TA1 - rtems_task_set_priority - set TA3's priority to 2
+TA1 - rtems_task_suspend - suspend TA2
+TA1 - rtems_task_delete - delete TA2
+TA1 - rtems_task_wake_after - sleep for 5 seconds
+TA3 - rtems_task_delete - delete self
+*** END OF TEST 2 ***
diff --git a/testsuites/sptests/sp02/system.h b/testsuites/sptests/sp02/system.h
new file mode 100644
index 0000000000..c9d89a1e8b
--- /dev/null
+++ b/testsuites/sptests/sp02/system.h
@@ -0,0 +1,31 @@
+/* system.h
+ *
+ * This include file contains information that is included in every
+ * function in the test set.
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include "tmacros.h"
+
+/* Miscellaneous */
+
+#define EXTERN extern /* external definition */
+
+/* macros */
+
+
+/* structures */
+
+#include "gvar.h"
+
+/* end of include file */
diff --git a/testsuites/sptests/sp02/task1.c b/testsuites/sptests/sp02/task1.c
new file mode 100644
index 0000000000..0f6152dbb2
--- /dev/null
+++ b/testsuites/sptests/sp02/task1.c
@@ -0,0 +1,66 @@
+/* Task_1
+ *
+ * This routine serves as a test task. It verifies the task manager.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_task Task_1(
+ rtems_task_argument argument
+)
+{
+ rtems_id tid2;
+ rtems_id tid3;
+ rtems_status_code status;
+ rtems_unsigned32 previous_priority;
+
+ puts( "TA1 - rtems_task_wake_after - sleep 1 second" );
+ status = rtems_task_wake_after( 1*TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after" );
+
+ status = rtems_task_ident( Task_name[ 2 ], RTEMS_SEARCH_ALL_NODES, &tid2 );
+ directive_failed( status, "rtems_task_ident of TA2" );
+
+ printf( "TA1 - rtems_task_ident - tid of TA2 (0x%.8x)\n", tid2 );
+
+ status = rtems_task_ident( Task_name[ 3 ], RTEMS_SEARCH_ALL_NODES, &tid3 );
+ directive_failed( status, "rtems_task_ident of TA3" );
+
+ printf( "TA1 - rtems_task_ident - tid of TA3 (0x%.8x)\n", tid3 );
+
+ status = rtems_task_set_priority( tid3, 2, &previous_priority );
+ directive_failed( status, "rtems_task_set_priority" );
+
+ puts( "TA1 - rtems_task_set_priority - set TA3's priority to 2" );
+
+
+ puts( "TA1 - rtems_task_suspend - suspend TA2" );
+ status = rtems_task_suspend( tid2 );
+ directive_failed( status, "rtems_task_suspend of TA2" );
+
+ puts( "TA1 - rtems_task_delete - delete TA2" );
+ status = rtems_task_delete( tid2 );
+ directive_failed( status, "rtems_task_delete of TA2" );
+
+ puts( "TA1 - rtems_task_wake_after - sleep for 5 seconds" );
+ status = rtems_task_wake_after( 5*TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after" );
+
+ puts( "*** END OF TEST 2 ***" );
+ exit( 0 );
+}
diff --git a/testsuites/sptests/sp02/task2.c b/testsuites/sptests/sp02/task2.c
new file mode 100644
index 0000000000..f39cc5b9fc
--- /dev/null
+++ b/testsuites/sptests/sp02/task2.c
@@ -0,0 +1,34 @@
+/* Task_2
+ *
+ * This routine serves as a test task. It sleeps for 1 minute but
+ * does not expect to wake up. Task 1 should suspend then delete it
+ * so that it appears to never wake up.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_task Task_2(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+
+ puts( "TA2 - rtems_task_wake_after - sleep 1 minute" );
+ status = rtems_task_wake_after( 60*TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after in TA2" );
+}
diff --git a/testsuites/sptests/sp02/task3.c b/testsuites/sptests/sp02/task3.c
new file mode 100644
index 0000000000..89bda38b7c
--- /dev/null
+++ b/testsuites/sptests/sp02/task3.c
@@ -0,0 +1,37 @@
+/* Task_3
+ *
+ * This routine serves as a test task. It simply sleeps for 5 seconds
+ * and then deletes itself.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_task Task_3(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+
+ puts( "TA3 - rtems_task_wake_after - sleep 5 seconds" );
+ status = rtems_task_wake_after( 5*TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after in TA3" );
+
+ puts( "TA3 - rtems_task_delete - delete self" );
+ status = rtems_task_delete( RTEMS_SELF );
+ directive_failed( status, "rtems_task_delete of TA3" );
+}
diff --git a/testsuites/sptests/sp03/init.c b/testsuites/sptests/sp03/init.c
new file mode 100644
index 0000000000..962d434284
--- /dev/null
+++ b/testsuites/sptests/sp03/init.c
@@ -0,0 +1,70 @@
+/* Init
+ *
+ * This routine is the initialization task for this test program.
+ * It is a user initialization task and has the responsibility for creating
+ * and starting the tasks that make up the test. If the time of day
+ * clock is required for the test, it should also be set to a known
+ * value by this function.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+#undef EXTERN
+#define EXTERN
+#include "conftbl.h"
+#include "gvar.h"
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+
+ puts( "\n\n*** TEST 3 ***" );
+
+ Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' );
+ Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' );
+
+ status = rtems_task_create(
+ Task_name[ 1 ],
+ 1,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 1 ]
+ );
+ directive_failed( status, "rtems_task_create of TA1" );
+
+ status = rtems_task_create(
+ Task_name[ 2 ],
+ 1,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 2 ]
+ );
+ directive_failed( status, "rtems_task_create of TA2" );
+
+ status = rtems_task_start( Task_id[ 1 ], Task_1, 0 );
+ directive_failed( status, "rtems_task_start of TA1" );
+
+ status = rtems_task_start( Task_id[ 2 ], Task_2, 0 );
+ directive_failed( status, "rtems_task_start of TA2" );
+
+ status = rtems_task_delete( RTEMS_SELF );
+ directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
+}
diff --git a/testsuites/sptests/sp03/sp03.doc b/testsuites/sptests/sp03/sp03.doc
new file mode 100644
index 0000000000..96d6d41d94
--- /dev/null
+++ b/testsuites/sptests/sp03/sp03.doc
@@ -0,0 +1,24 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: test3
+
+directives:
+ ex_init, ex_start, t_create, t_start, tm_tick, i_return, tm_wkafter,
+ tm_wkwhen, tm_set, tm_get
+
+concepts:
+
+ a. Verifies conversion routines - _Utd_to_etd and _Etd_to_utd
diff --git a/testsuites/sptests/sp03/sp03.scn b/testsuites/sptests/sp03/sp03.scn
new file mode 100644
index 0000000000..496982e86f
--- /dev/null
+++ b/testsuites/sptests/sp03/sp03.scn
@@ -0,0 +1,26 @@
+*** TEST 3 ***
+TA1 sets clock: 09:15:00 12/31/1988
+TA1 going to sleep: 09:15:00 12/31/1988
+TA2 09:15:01 12/31/1988
+TA2 09:15:02 12/31/1988
+TA2 09:15:03 12/31/1988
+TA2 09:15:04 12/31/1988
+TA1 awakened: 09:15:05 12/31/1988
+TA1 going to sleep: 09:15:05 12/31/1988
+TA2 09:15:05 12/31/1988
+TA2 09:15:06 12/31/1988
+TA2 09:15:07 12/31/1988
+TA2 09:15:08 12/31/1988
+TA2 09:15:09 12/31/1988
+TA1 awakened: 09:15:10 12/31/1988
+TA1 going to sleep: 09:15:10 12/31/1988
+TA2 09:15:10 12/31/1988
+TA2 09:15:11 12/31/1988
+TA2 09:15:12 12/31/1988
+TA2 09:15:13 12/31/1988
+TA2 09:15:14 12/31/1988
+TA1 awakened: 09:15:15 12/31/1988
+TA1 going to sleep: 09:15:15 12/31/1988
+TA2 09:15:15 12/31/1988
+TA2 09:15:16 12/31/1988
+*** END OF TEST 3 ***
diff --git a/testsuites/sptests/sp03/system.h b/testsuites/sptests/sp03/system.h
new file mode 100644
index 0000000000..aa2c6d17e4
--- /dev/null
+++ b/testsuites/sptests/sp03/system.h
@@ -0,0 +1,30 @@
+/* system.h
+ *
+ * This include file contains information that is included in every
+ * function in the test set.
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include "tmacros.h"
+
+/* Miscellaneous */
+
+#define EXTERN extern /* external definition */
+
+/* macros */
+
+/* structures */
+
+#include "gvar.h"
+
+/* end of include file */
diff --git a/testsuites/sptests/sp03/task1.c b/testsuites/sptests/sp03/task1.c
new file mode 100644
index 0000000000..e59fad45cf
--- /dev/null
+++ b/testsuites/sptests/sp03/task1.c
@@ -0,0 +1,59 @@
+/* Task_1
+ *
+ * This routine serves as a test task. It verifies the capability to
+ * set and read the executives calender and clock.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_task Task_1(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+ rtems_time_of_day time;
+
+ build_time( &time, 12, 31, 1988, 9, 15, 0, 0 );
+
+ status = rtems_clock_set( &time );
+ directive_failed( status, "rtems_clock_set" );
+
+ put_name( Task_name[ 1 ], FALSE );
+ print_time( " sets clock: ", &time, "\n" );
+
+ while( FOREVER ) {
+ status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
+ directive_failed( status, "rtems_clock_get" );
+
+ put_name( Task_name[ 1 ], FALSE );
+ print_time( " going to sleep: ", &time, "\n" );
+
+ time.second += 5;
+ time.minute += ( time.second / 60 );
+ time.second %= 60;
+ time.hour += ( time.minute / 60 );
+ time.minute %= 60;
+ time.hour %= 24;
+
+ status = rtems_task_wake_when( &time );
+ directive_failed( status, "rtems_task_wake_when" );
+
+ put_name( Task_name[ 1 ], FALSE );
+ print_time( " awakened: ", &time, "\n" );
+ }
+}
diff --git a/testsuites/sptests/sp03/task2.c b/testsuites/sptests/sp03/task2.c
new file mode 100644
index 0000000000..8838c1db67
--- /dev/null
+++ b/testsuites/sptests/sp03/task2.c
@@ -0,0 +1,46 @@
+/* Task_2
+ *
+ * This routine serves as a test task. It repeatedly gets the system time
+ * and date, converts it to printable form, and print it.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_task Task_2(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+ rtems_time_of_day time;
+
+ while( FOREVER ) {
+ status = rtems_task_wake_after( 1*TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after" );
+
+ status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
+ directive_failed( status, "rtems_clock_get" );
+
+ if ( time.second >= 17 ) {
+ puts( "*** END OF TEST 3 *** " );
+ exit( 0 );
+ }
+
+ put_name( Task_name[ 2 ], FALSE );
+ print_time( " ", &time, "\n" );
+ }
+}
diff --git a/testsuites/sptests/sp04/init.c b/testsuites/sptests/sp04/init.c
new file mode 100644
index 0000000000..b9fd541103
--- /dev/null
+++ b/testsuites/sptests/sp04/init.c
@@ -0,0 +1,113 @@
+/* Init
+ *
+ * This routine is the initialization task for this test program.
+ * It is a user initialization task and has the responsibility for creating
+ * and starting the tasks that make up the test. If the time of day
+ * clock is required for the test, it should also be set to a known
+ * value by this function.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+#undef EXTERN
+#define EXTERN
+#include "conftbl.h"
+#include "gvar.h"
+
+rtems_extensions_table Extensions = {
+ NULL, /* task create user extension */
+ NULL, /* task start user extension */
+ NULL, /* task restart user extension */
+ NULL, /* task delete user extension */
+ Task_switch, /* task switch user extension */
+ NULL, /* task begin user extension */
+ NULL, /* task exitted user extension */
+ NULL /* fatal error user extension */
+};
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+ rtems_time_of_day time;
+
+ puts( "\n\n*** TEST 4 ***" );
+ build_time( &time, 12, 31, 1988, 9, 15, 0, 0 );
+
+ status = rtems_clock_set( &time );
+ directive_failed( status, "rtems_clock_set" );
+
+ Extension_name[ 1 ] = rtems_build_name( 'E', 'X', 'T', ' ' );
+
+ status = rtems_extension_create(
+ Extension_name[ 1 ],
+ &Extensions,
+ &Extension_id[ 1 ]
+ );
+ directive_failed( status, "rtems_extension_create" );
+
+ Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' );
+ Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' );
+ Task_name[ 3 ] = rtems_build_name( 'T', 'A', '3', ' ' );
+
+ Run_count[ 1 ] = 0;
+ Run_count[ 2 ] = 0;
+ Run_count[ 3 ] = 0;
+
+ status = rtems_task_create(
+ Task_name[ 1 ],
+ 1,
+ 2048,
+ RTEMS_TIMESLICE,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 1 ]
+ );
+ directive_failed( status, "rtems_task_create of TA1" );
+
+ status = rtems_task_create(
+ Task_name[ 2 ],
+ 1,
+ 2048,
+ RTEMS_TIMESLICE,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 2 ]
+ );
+ directive_failed( status, "rtems_task_create of TA2" );
+
+ status = rtems_task_create(
+ Task_name[ 3 ],
+ 1,
+ 2048,
+ RTEMS_TIMESLICE,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 3 ]
+ );
+ directive_failed( status, "rtems_task_create of TA3" );
+
+ status = rtems_task_start( Task_id[ 1 ], Task_1, 0 );
+ directive_failed( status, "rtems_task_start of TA1" );
+
+ status = rtems_task_start( Task_id[ 2 ], Task_2, 0 );
+ directive_failed( status, "rtems_task_start of TA2" );
+
+ status = rtems_task_start( Task_id[ 3 ], Task_3, 0 );
+ directive_failed( status, "rtems_task_start of TA3" );
+
+ status = rtems_task_delete( RTEMS_SELF );
+ directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
+}
diff --git a/testsuites/sptests/sp04/sp04.doc b/testsuites/sptests/sp04/sp04.doc
new file mode 100644
index 0000000000..6f6355abfa
--- /dev/null
+++ b/testsuites/sptests/sp04/sp04.doc
@@ -0,0 +1,38 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: test4
+
+directives:
+ ex_init, ex_start, t_create, t_start, tm_tick, i_return,
+ tm_set, tm_get, ev_receive, t_mode
+
+concepts:
+
+ a. Verifies timeslicing ( all tasks are in timeslice mode ).
+
+ b. Verifies the tswitch user extension.
+
+ c. Verifies the no preemption mode.
+
+ d. Verifies time-slice gets reset even if only one task ready.
+
+output:
+ The task name and the current time are printed out each time that a new
+ task is being dispatched. The configured timeslice is 100 ticks
+ ( 1 second ); therefore, a task name and the time are printed once
+ every second. After each task runs 3 times, task 1 changes its mode to
+ no preempt and runs for about 6 seconds and then changes its mode back to
+ preempt mode.
diff --git a/testsuites/sptests/sp04/sp04.scn b/testsuites/sptests/sp04/sp04.scn
new file mode 100644
index 0000000000..f104c0c482
--- /dev/null
+++ b/testsuites/sptests/sp04/sp04.scn
@@ -0,0 +1,24 @@
+*** TEST 4 ***
+TA1 - 09:15:00 12/31/1988
+TA1 - rtems_task_suspend - on Task 2
+TA1 - rtems_task_suspend - on Task 3
+TA1 - killing time
+TA1 - rtems_task_resume - on Task 2
+TA1 - rtems_task_resume - on Task 3
+TA2 - 09:15:03 12/31/1988
+TA3 - 09:15:04 12/31/1988
+TA1 - 09:15:05 12/31/1988
+TA2 - 09:15:06 12/31/1988
+TA3 - 09:15:07 12/31/1988
+TA1 - 09:15:08 12/31/1988
+TA1 - rtems_task_mode - change mode to NO RTEMS_PREEMPT
+TA1 - 09:15:09 12/31/1988
+TA1 - 09:15:10 12/31/1988
+TA1 - 09:15:11 12/31/1988
+TA1 - 09:15:12 12/31/1988
+TA1 - 09:15:13 12/31/1988
+TA1 - 09:15:14 12/31/1988
+TA1 - rtems_task_mode - change mode to RTEMS_PREEMPT
+TA2 - 09:15:15 12/31/1988
+TA3 - 09:15:16 12/31/1988
+*** END OF TEST 4 ***
diff --git a/testsuites/sptests/sp04/system.h b/testsuites/sptests/sp04/system.h
new file mode 100644
index 0000000000..aa2c6d17e4
--- /dev/null
+++ b/testsuites/sptests/sp04/system.h
@@ -0,0 +1,30 @@
+/* system.h
+ *
+ * This include file contains information that is included in every
+ * function in the test set.
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include "tmacros.h"
+
+/* Miscellaneous */
+
+#define EXTERN extern /* external definition */
+
+/* macros */
+
+/* structures */
+
+#include "gvar.h"
+
+/* end of include file */
diff --git a/testsuites/sptests/sp04/task1.c b/testsuites/sptests/sp04/task1.c
new file mode 100644
index 0000000000..8d0a620ec3
--- /dev/null
+++ b/testsuites/sptests/sp04/task1.c
@@ -0,0 +1,104 @@
+/* Task_1
+ *
+ * This test serves as a test task. It verifies timeslicing activities
+ * and tswitch extension processing.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+#include "clockdrv.h"
+
+rtems_task Task_1(
+ rtems_task_argument argument
+)
+{
+ rtems_unsigned32 seconds;
+ rtems_unsigned32 old_seconds;
+ rtems_mode previous_mode;
+ rtems_time_of_day time;
+ rtems_status_code status;
+ rtems_unsigned32 start;
+ rtems_unsigned32 end;
+
+ puts( "TA1 - rtems_task_suspend - on Task 2" );
+ status = rtems_task_suspend( Task_id[ 2 ] );
+ directive_failed( status, "rtems_task_suspend of TA2" );
+
+ puts( "TA1 - rtems_task_suspend - on Task 3" );
+ status = rtems_task_suspend( Task_id[ 3 ] );
+ directive_failed( status, "rtems_task_suspend of TA3" );
+
+ status = rtems_clock_get( RTEMS_CLOCK_GET_SECONDS_SINCE_EPOCH, &start );
+ directive_failed( status, "rtems_clock_get" );
+
+ puts( "TA1 - killing time" );
+
+ for ( ; ; ) {
+ status = rtems_clock_get( RTEMS_CLOCK_GET_SECONDS_SINCE_EPOCH, &end );
+ directive_failed( status, "rtems_clock_get" );
+
+ if ( end > (start + 2) )
+ break;
+ }
+
+ puts( "TA1 - rtems_task_resume - on Task 2" );
+ status = rtems_task_resume( Task_id[ 2 ] );
+ directive_failed( status, "rtems_task_resume of TA2" );
+
+ puts( "TA1 - rtems_task_resume - on Task 3" );
+ status = rtems_task_resume( Task_id[ 3 ] );
+ directive_failed( status, "rtems_task_resume of TA3" );
+
+ while ( FOREVER ) {
+ if ( Run_count[ 1 ] == 3 ) {
+ puts( "TA1 - rtems_task_mode - change mode to NO RTEMS_PREEMPT" );
+
+ status = rtems_task_mode(
+ RTEMS_NO_PREEMPT,
+ RTEMS_PREEMPT_MASK,
+ &previous_mode
+ );
+ directive_failed( status, "rtems_task_mode" );
+
+ status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
+ directive_failed( status, "rtems_clock_get" );
+
+ old_seconds = time.second;
+
+ for ( seconds = 0 ; seconds < 6 ; ) {
+ status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
+ directive_failed( status, "rtems_clock_get" );
+
+ if ( time.second != old_seconds ) {
+ old_seconds = time.second;
+ seconds++;
+ print_time( "TA1 - ", &time, "\n" );
+ }
+ }
+
+ puts( "TA1 - rtems_task_mode - change mode to RTEMS_PREEMPT" );
+ status = rtems_task_mode(
+ RTEMS_PREEMPT,
+ RTEMS_PREEMPT_MASK,
+ &previous_mode
+ );
+ directive_failed( status, "rtems_task_mode" );
+
+ while ( FOREVER );
+ }
+ }
+}
diff --git a/testsuites/sptests/sp04/task2.c b/testsuites/sptests/sp04/task2.c
new file mode 100644
index 0000000000..7574e7dc9f
--- /dev/null
+++ b/testsuites/sptests/sp04/task2.c
@@ -0,0 +1,29 @@
+/* Task_2
+ *
+ * This routine serves as a test task. It is just a CPU bound task
+ * requiring timesliced operation.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_task Task_2(
+ rtems_task_argument argument
+)
+{
+ while( FOREVER );
+}
diff --git a/testsuites/sptests/sp04/task3.c b/testsuites/sptests/sp04/task3.c
new file mode 100644
index 0000000000..a0e7482944
--- /dev/null
+++ b/testsuites/sptests/sp04/task3.c
@@ -0,0 +1,29 @@
+/* Task_3
+ *
+ * This routine serves as a test task. It is just a CPU bound task
+ * requiring timesliced operation.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_task Task_3(
+ rtems_task_argument argument
+)
+{
+ while( FOREVER );
+}
diff --git a/testsuites/sptests/sp04/tswitch.c b/testsuites/sptests/sp04/tswitch.c
new file mode 100644
index 0000000000..3f0c2047bc
--- /dev/null
+++ b/testsuites/sptests/sp04/tswitch.c
@@ -0,0 +1,59 @@
+/* Task_switch
+ *
+ * This routine is the tswitch user extension. It determines which
+ * task is being switched to and displays a message indicating the
+ * time and date that it gained control.
+ *
+ * Input parameters:
+ * unused - pointer to currently running TCB
+ * heir - pointer to heir TCB
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_extension Task_switch(
+ rtems_tcb *unused,
+ rtems_tcb *heir
+)
+{
+ rtems_unsigned32 index;
+ rtems_time_of_day time;
+ rtems_status_code status;
+
+ index = task_number( heir->Object.id );
+
+ switch( index ) {
+ case 1:
+ case 2:
+ case 3:
+ Run_count[ index ] += 1;
+
+ status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
+ directive_failed( status, "rtems_clock_get" );
+
+ put_name( Task_name[ index ], FALSE );
+ print_time( " - ", &time, "\n" );
+
+ if ( time.second >= 16 ) {
+ puts( "*** END OF TEST 4 ***" );
+ exit( 0 );
+ }
+ break;
+
+ case 0:
+ default:
+ break;
+ }
+}
diff --git a/testsuites/sptests/sp05/init.c b/testsuites/sptests/sp05/init.c
new file mode 100644
index 0000000000..2f6b8a6eac
--- /dev/null
+++ b/testsuites/sptests/sp05/init.c
@@ -0,0 +1,84 @@
+/* Init
+ *
+ * This routine is the initialization task for this test program.
+ * It is a user initialization task and has the responsibility for creating
+ * and starting the tasks that make up the test. If the time of day
+ * clock is required for the test, it should also be set to a known
+ * value by this function.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+#undef EXTERN
+#define EXTERN
+#include "conftbl.h"
+#include "gvar.h"
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+
+ puts( "\n\n*** TEST 5 ***" );
+
+ Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' );
+ Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' );
+ Task_name[ 3 ] = rtems_build_name( 'T', 'A', '3', ' ' );
+
+ status = rtems_task_create(
+ Task_name[ 1 ],
+ 1,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 1 ]
+ );
+ directive_failed( status, "rtems_task_create of TA1" );
+
+ status = rtems_task_create(
+ Task_name[ 2 ],
+ 1,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 2 ]
+ );
+ directive_failed( status, "rtems_task_create of TA2" );
+
+ status = rtems_task_create(
+ Task_name[ 3 ],
+ 1,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 3 ]
+ );
+ directive_failed( status, "rtems_task_create of TA3" );
+
+ status = rtems_task_start( Task_id[ 1 ], Task_1, 0 );
+ directive_failed( status, "rtems_task_start of TA1" );
+
+ status = rtems_task_start( Task_id[ 2 ], Task_2, 0 );
+ directive_failed( status, "rtems_task_start of TA2" );
+
+ status = rtems_task_start( Task_id[ 3 ], Task_3, 0 );
+ directive_failed( status, "rtems_task_start of TA3" );
+
+ status = rtems_task_delete( RTEMS_SELF );
+ directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
+}
diff --git a/testsuites/sptests/sp05/sp05.doc b/testsuites/sptests/sp05/sp05.doc
new file mode 100644
index 0000000000..583381a37e
--- /dev/null
+++ b/testsuites/sptests/sp05/sp05.doc
@@ -0,0 +1,26 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: test5
+
+directives:
+ ex_init, ex_start, t_create, t_start, tm_tick, i_return, t_ident
+ tm_wkafter, t_suspend, t_resume
+
+concepts:
+
+ a. Verifies that a task can be suspended and resumed.
+
+ b. Verifies that a task can suspend itself.
diff --git a/testsuites/sptests/sp05/sp05.scn b/testsuites/sptests/sp05/sp05.scn
new file mode 100644
index 0000000000..40afb2d4b2
--- /dev/null
+++ b/testsuites/sptests/sp05/sp05.scn
@@ -0,0 +1,47 @@
+*** TEST 5 ***
+TA1 - rtems_task_wake_after - sleep 5 seconds
+TA2 - rtems_task_suspend - suspend self
+TA3 - rtems_task_suspend - suspend self
+TA1 - rtems_task_suspend - suspend TA3
+TA1 - rtems_task_resume - resume TA2
+TA1 - rtems_task_wake_after - sleep 5 seconds
+TA2 - rtems_task_wake_after - sleep 1 second
+TA2 - rtems_task_wake_after - sleep 1 second
+TA2 - rtems_task_wake_after - sleep 1 second
+TA2 - rtems_task_wake_after - sleep 1 second
+TA2 - rtems_task_wake_after - sleep 1 second
+TA1 - rtems_task_suspend - suspend TA2
+TA1 - rtems_task_resume - resume TA3
+TA1 - rtems_task_wake_after - sleep 5 seconds
+TA3 - rtems_task_wake_after - sleep 1 second
+TA3 - rtems_task_wake_after - sleep 1 second
+TA3 - rtems_task_wake_after - sleep 1 second
+TA3 - rtems_task_wake_after - sleep 1 second
+TA3 - rtems_task_wake_after - sleep 1 second
+TA1 - rtems_task_suspend - suspend TA3
+TA1 - rtems_task_resume - resume TA2
+TA1 - rtems_task_wake_after - sleep 5 seconds
+TA2 - rtems_task_wake_after - sleep 1 second
+TA2 - rtems_task_wake_after - sleep 1 second
+TA2 - rtems_task_wake_after - sleep 1 second
+TA2 - rtems_task_wake_after - sleep 1 second
+TA2 - rtems_task_wake_after - sleep 1 second
+TA1 - rtems_task_suspend - suspend TA2
+TA1 - rtems_task_resume - resume TA3
+TA1 - rtems_task_wake_after - sleep 5 seconds
+TA3 - rtems_task_wake_after - sleep 1 second
+TA3 - rtems_task_wake_after - sleep 1 second
+TA3 - rtems_task_wake_after - sleep 1 second
+TA3 - rtems_task_wake_after - sleep 1 second
+TA3 - rtems_task_wake_after - sleep 1 second
+TA1 - rtems_task_suspend - suspend TA3
+TA1 - rtems_task_resume - resume TA2
+TA1 - rtems_task_wake_after - sleep 5 seconds
+TA2 - rtems_task_wake_after - sleep 1 second
+TA2 - rtems_task_wake_after - sleep 1 second
+TA2 - rtems_task_wake_after - sleep 1 second
+TA2 - rtems_task_wake_after - sleep 1 second
+TA2 - rtems_task_wake_after - sleep 1 second
+TA1 - rtems_task_suspend - suspend TA2
+TA1 - rtems_task_resume - resume TA3
+*** END OF TEST 5 ***
diff --git a/testsuites/sptests/sp05/system.h b/testsuites/sptests/sp05/system.h
new file mode 100644
index 0000000000..aa2c6d17e4
--- /dev/null
+++ b/testsuites/sptests/sp05/system.h
@@ -0,0 +1,30 @@
+/* system.h
+ *
+ * This include file contains information that is included in every
+ * function in the test set.
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include "tmacros.h"
+
+/* Miscellaneous */
+
+#define EXTERN extern /* external definition */
+
+/* macros */
+
+/* structures */
+
+#include "gvar.h"
+
+/* end of include file */
diff --git a/testsuites/sptests/sp05/task1.c b/testsuites/sptests/sp05/task1.c
new file mode 100644
index 0000000000..9b99586fc8
--- /dev/null
+++ b/testsuites/sptests/sp05/task1.c
@@ -0,0 +1,78 @@
+/* Task_1
+ *
+ * This routine serves as a test task. It verifies that tasks can
+ * be suspended and resumed.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * NOTE: The rtems_task_suspend() directives fail on the first iteration.
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_task Task_1(
+ rtems_task_argument argument
+)
+{
+ rtems_id tid2;
+ rtems_id tid3;
+ rtems_unsigned32 pass;
+ rtems_status_code status;
+
+ status = rtems_task_ident( Task_name[ 2 ], 1, &tid2 );
+ directive_failed( status, "rtems_task_ident of TA2" );
+
+ status = rtems_task_ident( Task_name[ 3 ], 1, &tid3 );
+ directive_failed( status, "rtems_task_ident of TA3" );
+
+ for ( pass=1 ; pass <= 3 ; pass++ ) {
+
+ puts( "TA1 - rtems_task_wake_after - sleep 5 seconds" );
+ status = rtems_task_wake_after( 5*TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after of TA1" );
+
+ puts( "TA1 - rtems_task_suspend - suspend TA3" );
+ status = rtems_task_suspend( tid3 );
+ if ( pass == 1 ) {
+ fatal_directive_status(
+ status,
+ RTEMS_ALREADY_SUSPENDED,
+ "rtems_task_suspend of TA3"
+ );
+ } else {
+ directive_failed( status, "rtems_task_suspend of TA3" );
+ }
+
+ puts( "TA1 - rtems_task_resume - resume TA2" );
+ status = rtems_task_resume( tid2 );
+ directive_failed( status, "rtems_task_resume of TA2" );
+
+ puts( "TA1 - rtems_task_wake_after - sleep 5 seconds" );
+ status = rtems_task_wake_after( 5*TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after" );
+
+ puts( "TA1 - rtems_task_suspend - suspend TA2" );
+ status = rtems_task_suspend( tid2 );
+ directive_failed( status, "rtems_task_suspend of TA2" );
+
+ puts( "TA1 - rtems_task_resume - resume TA3" );
+ status = rtems_task_resume( tid3 );
+ directive_failed( status, "rtems_task_resume" );
+ }
+
+ puts( "*** END OF TEST 5 ***" );
+ exit( 0 );
+}
diff --git a/testsuites/sptests/sp05/task2.c b/testsuites/sptests/sp05/task2.c
new file mode 100644
index 0000000000..3878d8106d
--- /dev/null
+++ b/testsuites/sptests/sp05/task2.c
@@ -0,0 +1,39 @@
+/* Task_2
+ *
+ * This routine serves as a test task. Makes sure a task can suspend
+ * itself.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_task Task_2(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+
+ puts( "TA2 - rtems_task_suspend - suspend self" );
+ status = rtems_task_suspend( RTEMS_SELF );
+ directive_failed( status, "rtems_task_suspend of TA2" );
+
+ while( FOREVER ) {
+ puts( "TA2 - rtems_task_wake_after - sleep 1 second" );
+ status = rtems_task_wake_after( 1*TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after of TA2" );
+ }
+}
diff --git a/testsuites/sptests/sp05/task3.c b/testsuites/sptests/sp05/task3.c
new file mode 100644
index 0000000000..c03c6de75b
--- /dev/null
+++ b/testsuites/sptests/sp05/task3.c
@@ -0,0 +1,39 @@
+/* Task_3
+ *
+ * This routine serves as a test task. Makes sure a task can suspend
+ * itself.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_task Task_3(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+
+ puts( "TA3 - rtems_task_suspend - suspend self" );
+ status = rtems_task_suspend( RTEMS_SELF );
+ directive_failed( status, "rtems_task_suspend of TA3" );
+
+ while( FOREVER ) {
+ puts( "TA3 - rtems_task_wake_after - sleep 1 second" );
+ status = rtems_task_wake_after( 1*TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after of TA3" );
+ }
+}
diff --git a/testsuites/sptests/sp06/init.c b/testsuites/sptests/sp06/init.c
new file mode 100644
index 0000000000..08bab06594
--- /dev/null
+++ b/testsuites/sptests/sp06/init.c
@@ -0,0 +1,90 @@
+/* Init
+ *
+ * This routine is the initialization task for this test program.
+ * It is a user initialization task and has the responsibility for creating
+ * and starting the tasks that make up the test. If the time of day
+ * clock is required for the test, it should also be set to a known
+ * value by this function.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+#undef EXTERN
+#define EXTERN
+#include "conftbl.h"
+#include "gvar.h"
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+ rtems_task_priority previous_priority;
+
+ puts( "\n\n*** TEST 6 ***" );
+
+ Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' );
+ Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' );
+ Task_name[ 3 ] = rtems_build_name( 'T', 'A', '3', ' ' );
+
+ Argument = 0;
+ Restart_argument = 1;
+
+ status = rtems_task_create(
+ Task_name[ 1 ],
+ 1,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 1 ]
+ );
+ directive_failed( status, "rtems_task_create of TA1" );
+
+ status = rtems_task_create(
+ Task_name[ 2 ],
+ 1,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 2 ]
+ );
+ directive_failed( status, "rtems_task_create of TA2" );
+
+ status = rtems_task_create(
+ Task_name[ 3 ],
+ 10,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 3 ]
+ );
+ directive_failed( status, "rtems_task_create of TA3" );
+
+ status = rtems_task_start( Task_id[ 1 ], Task_1, 0 );
+ directive_failed( status, "rtems_task_start of TA1" );
+
+ status = rtems_task_start( Task_id[ 2 ], Task_2, Argument );
+ directive_failed( status, "rtems_task_start of TA2" );
+
+ status = rtems_task_start( Task_id[ 3 ], Task_3, Argument );
+ directive_failed( status, "rtems_task_start of TA3" );
+
+ status = rtems_task_set_priority( Task_id[ 3 ], 5, &previous_priority );
+
+ status = rtems_task_delete( RTEMS_SELF );
+ directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
+}
diff --git a/testsuites/sptests/sp06/sp06.doc b/testsuites/sptests/sp06/sp06.doc
new file mode 100644
index 0000000000..e8b96f1f6b
--- /dev/null
+++ b/testsuites/sptests/sp06/sp06.doc
@@ -0,0 +1,26 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: test6
+
+directives:
+ ex_init, ex_start, t_create, t_start, tm_tick, i_return,
+ tm_wkafter, t_restart
+
+concepts:
+
+ a. Verifies that a task can restart a task other than itself.
+
+ b. Verifies that a task can restart itself.
diff --git a/testsuites/sptests/sp06/sp06.scn b/testsuites/sptests/sp06/sp06.scn
new file mode 100644
index 0000000000..64f6489dc8
--- /dev/null
+++ b/testsuites/sptests/sp06/sp06.scn
@@ -0,0 +1,40 @@
+*** TEST 6 ***
+TA1 - is beginning to run
+TA1 - restarting TA3
+TA2 - is beginning to run
+TA2 - rtems_task_wake_after - sleep 1/2 second
+TA2 - rtems_task_wake_after - sleep 1/2 second
+TA1 - rtems_task_restart - restarting TA2
+TA2 - is beginning to run
+TA2 - rtems_task_wake_after - sleep 1/2 second
+TA2 - rtems_task_wake_after - sleep 1/2 second
+TA1 - rtems_task_restart - restarting self
+TA1 - is beginning to run
+TA2 - rtems_task_wake_after - sleep 1/2 second
+TA2 - rtems_task_wake_after - sleep 1/2 second
+TA1 - rtems_task_restart - restarting TA2
+TA2 - is beginning to run
+TA2 - rtems_task_wake_after - sleep 1/2 second
+TA2 - rtems_task_wake_after - sleep 1/2 second
+TA1 - rtems_task_restart - restarting self
+TA1 - is beginning to run
+TA2 - rtems_task_wake_after - sleep 1/2 second
+TA2 - rtems_task_wake_after - sleep 1/2 second
+TA1 - rtems_task_restart - restarting TA2
+TA2 - is beginning to run
+TA2 - rtems_task_wake_after - sleep 1/2 second
+TA2 - rtems_task_wake_after - sleep 1/2 second
+TA1 - rtems_task_restart - restarting self
+TA1 - is beginning to run
+TA2 - rtems_task_wake_after - sleep 1/2 second
+TA2 - rtems_task_wake_after - sleep 1/2 second
+TA1 - rtems_task_restart - restarting TA2
+TA2 - is beginning to run
+TA2 - rtems_task_wake_after - sleep 1/2 second
+TA2 - rtems_task_wake_after - sleep 1/2 second
+TA1 - rtems_task_restart - restarting self
+TA1 - is beginning to run
+*** END OF TEST 6 ***
+
+NOTE: The prints from TA2 may not be as regular as indicated in the screen.
+ The important point is that TA2 is running and gets restarted.
diff --git a/testsuites/sptests/sp06/system.h b/testsuites/sptests/sp06/system.h
new file mode 100644
index 0000000000..aa2c6d17e4
--- /dev/null
+++ b/testsuites/sptests/sp06/system.h
@@ -0,0 +1,30 @@
+/* system.h
+ *
+ * This include file contains information that is included in every
+ * function in the test set.
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include "tmacros.h"
+
+/* Miscellaneous */
+
+#define EXTERN extern /* external definition */
+
+/* macros */
+
+/* structures */
+
+#include "gvar.h"
+
+/* end of include file */
diff --git a/testsuites/sptests/sp06/task1.c b/testsuites/sptests/sp06/task1.c
new file mode 100644
index 0000000000..6d0f67f395
--- /dev/null
+++ b/testsuites/sptests/sp06/task1.c
@@ -0,0 +1,61 @@
+/* Task_1
+ *
+ * This task serves as a test task. Verifies that a task can restart
+ * both itself and other tasks.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_task Task_1( argument )
+rtems_unsigned32 argument;
+{
+ rtems_unsigned32 pass;
+ rtems_status_code status;
+
+ puts( "TA1 - is beginning to run" );
+
+ pass = argument + 1;
+
+ if ( pass == 5 ) {
+ puts( "*** END OF TEST 6 ***" );
+ exit( 0 );
+ }
+
+ if ( pass == 1 ) {
+ puts( "TA1 - restarting TA3" );
+ status = rtems_task_restart( Task_id[ 3 ], Restart_argument );
+ directive_failed( status, "rtems_task_restart of TA3" );
+
+ status = rtems_task_wake_after( 2 * TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after" );
+ }
+
+ status = rtems_task_wake_after( TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after" );
+
+ puts( "TA1 - rtems_task_restart - restarting TA2" );
+ status = rtems_task_restart( Task_id[ 2 ], Restart_argument );
+ directive_failed( status, "rtems_task_restart TA2" );
+
+ status = rtems_task_wake_after( 1*TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after" );
+
+ puts( "TA1 - rtems_task_restart - restarting self" );
+ status = rtems_task_restart( Task_id[ 1 ], pass );
+ directive_failed( status, "rtems_task_restart of RTEMS_SELF" );
+}
diff --git a/testsuites/sptests/sp06/task2.c b/testsuites/sptests/sp06/task2.c
new file mode 100644
index 0000000000..0c9e10bc07
--- /dev/null
+++ b/testsuites/sptests/sp06/task2.c
@@ -0,0 +1,40 @@
+/* Task_2
+ *
+ * This routine serves as a test task. It simply runs forever so
+ * another task can restart it.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_task Task_2( argument )
+rtems_task_argument argument;
+{
+ rtems_status_code status;
+
+ puts( "TA2 - is beginning to run" );
+ if ( argument == Argument ) {
+ status = rtems_task_wake_after( 2 * TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after" );
+ }
+
+ while( FOREVER ) {
+ puts( "TA2 - rtems_task_wake_after - sleep 1/2 second" );
+ status = rtems_task_wake_after( TICKS_PER_SECOND / 2 );
+ directive_failed( status, "rtems_task_wake_after" );
+ }
+}
diff --git a/testsuites/sptests/sp06/task3.c b/testsuites/sptests/sp06/task3.c
new file mode 100644
index 0000000000..379ef8de92
--- /dev/null
+++ b/testsuites/sptests/sp06/task3.c
@@ -0,0 +1,32 @@
+/* Task_3
+ *
+ * This routine serves as a test task. It is started, has its priority
+ * changed, and when it runs it deletes itself.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_task Task_3(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+
+ status = rtems_task_delete( RTEMS_SELF );
+ directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
+}
diff --git a/testsuites/sptests/sp07/init.c b/testsuites/sptests/sp07/init.c
new file mode 100644
index 0000000000..f5d00eae8e
--- /dev/null
+++ b/testsuites/sptests/sp07/init.c
@@ -0,0 +1,131 @@
+/* Init
+ *
+ * This routine is the initialization task for this test program.
+ * It is a user initialization task and has the responsibility for creating
+ * and starting the tasks that make up the test. If the time of day
+ * clock is required for the test, it should also be set to a known
+ * value by this function.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+#undef EXTERN
+#define EXTERN
+#include "conftbl.h"
+#include "gvar.h"
+
+rtems_extensions_table Extensions = {
+ Task_create_extension, /* task create user extension */
+ Task_start_extension, /* task start user extension */
+ Task_restart_extension, /* task restart user extension */
+ Task_delete_extension, /* task delete user extension */
+ NULL, /* task switch user extension */
+ NULL, /* begin user extension */
+ Task_exit_extension, /* task exitted user extension */
+ NULL /* fatal error extension */
+};
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+
+ puts( "\n\n*** TEST 7 ***" );
+
+ Extension_name[ 1 ] = rtems_build_name( 'E', 'X', 'T', ' ' );
+
+ status = rtems_extension_create(
+ Extension_name[ 1 ],
+ &Extensions,
+ &Extension_id[ 1 ]
+ );
+ directive_failed( status, "rtems_extension_create" );
+
+ Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' );
+ Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' );
+ Task_name[ 3 ] = rtems_build_name( 'T', 'A', '3', ' ' );
+ Task_name[ 4 ] = rtems_build_name( 'T', 'A', '4', ' ' );
+
+ status = rtems_task_create(
+ Task_name[ 1 ],
+ 4,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 1 ]
+ );
+ directive_failed( status, "rtems_task_create of TA1" );
+
+ status = rtems_task_create(
+ Task_name[ 2 ],
+ 4,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 2 ]
+ );
+ directive_failed( status, "rtems_task_create of TA2" );
+
+ status = rtems_task_create(
+ Task_name[ 3 ],
+ 250,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 3 ]
+ );
+ directive_failed( status, "rtems_task_create of TA3" );
+
+ status = rtems_task_create(
+ Task_name[ 4 ],
+ 254,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 4 ]
+ );
+ directive_failed( status, "rtems_task_create of TA4" );
+
+ status = rtems_task_start( Task_id[ 1 ], Task_1, 0 );
+ directive_failed( status, "rtems_task_start of TA1" );
+
+ status = rtems_task_start( Task_id[ 2 ], Task_2, 0 );
+ directive_failed( status, "rtems_task_start of TA2" );
+
+ status = rtems_task_start( Task_id[ 3 ], Task_3, 0 );
+ directive_failed( status, "rtems_task_start of TA3" );
+
+ status = rtems_task_start( Task_id[ 4 ], Task_4, 0 );
+ directive_failed( status, "rtems_task_start of TA4" );
+
+ status = rtems_task_restart( Task_id[ 3 ], 0 );
+ directive_failed( status, "rtems_task_restart of TA3" );
+
+ status = rtems_task_set_note( Task_id[ 1 ], RTEMS_NOTEPAD_8, 4 );
+ directive_failed( status, "task_set_node of TA1" );
+ printf( "INIT - rtems_task_set_note - set TA1's RTEMS_NOTEPAD_8 " );
+ puts ( "to TA1's priority: 04" );
+
+ status = rtems_task_set_note( Task_id[ 2 ], RTEMS_NOTEPAD_8, 4 );
+ directive_failed( status, "task_set_node of TA2" );
+ printf( "INIT - rtems_task_set_note - set TA2's RTEMS_NOTEPAD_8 " );
+ puts ( "to TA2's priority: 04");
+
+ status = rtems_task_delete( RTEMS_SELF );
+ directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
+}
diff --git a/testsuites/sptests/sp07/sp07.doc b/testsuites/sptests/sp07/sp07.doc
new file mode 100644
index 0000000000..47411194c6
--- /dev/null
+++ b/testsuites/sptests/sp07/sp07.doc
@@ -0,0 +1,37 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: test7
+
+directives:
+ ex_init, ex_start, t_create, t_start, tm_tick, i_return,
+ t_delete, t_setreg, t_getreg, t_setpri, t_suspend
+
+concepts:
+
+ a. Verifies that tasks can communicate with each other via the
+ t_setreg and t_getreg directives.
+
+ b. Verifies that the highest priority task is dispatched to execute.
+
+ c. Verifies setting the priority of both a ready and a blocked task.
+
+ d. Verifies the deletion of ready and blocked tasks.
+
+ e. Verifies the tcreate user extension.
+
+ f. Verifies the tstart user extension.
+
+ g. Verifies the tdelete user extension.
diff --git a/testsuites/sptests/sp07/sp07.scn b/testsuites/sptests/sp07/sp07.scn
new file mode 100644
index 0000000000..1f6de2d93d
--- /dev/null
+++ b/testsuites/sptests/sp07/sp07.scn
@@ -0,0 +1,33 @@
+*** TEST 7 ***
+TASK_CREATE - TA1 - created.
+TASK_CREATE - TA2 - created.
+TASK_CREATE - TA3 - created.
+TASK_CREATE - TA4 - created.
+TASK_START - TA1 - started.
+TASK_START - TA2 - started.
+TASK_START - TA3 - started.
+TASK_START - TA4 - started.
+TASK_RESTART - TA3 - restarted.
+INIT - rtems_task_set_note - set TA1's RTEMS_NOTEPAD_8 to TA1's priority: 04
+INIT - rtems_task_set_note - set TA2's RTEMS_NOTEPAD_8 to TA2's priority: 04
+<pause>
+TA1 - rtems_task_set_priority - get initial priority of self: 04
+TA1 - rtems_task_get_note - get RTEMS_NOTEPAD_8 - current priority: 04
+TA1 - rtems_task_set_note - set TA2's RTEMS_NOTEPAD_8: 03
+TA1 - rtems_task_set_priority - set TA2's priority: 03
+TA2 - rtems_task_get_note - get RTEMS_NOTEPAD_8 - current priority: 03
+TA2 - rtems_task_set_note - set TA1's RTEMS_NOTEPAD_8: 02
+TA2 - rtems_task_set_priority - set TA1's priority: 02
+TA1 - rtems_task_get_note - get RTEMS_NOTEPAD_8 - current priority: 02
+TA1 - rtems_task_set_note - set TA2's RTEMS_NOTEPAD_8: 01
+TA1 - rtems_task_set_priority - set TA2's priority: 01
+TA2 - rtems_task_get_note - get RTEMS_NOTEPAD_8 - current priority: 01
+TA2 - rtems_task_suspend - suspend TA1
+TA2 - rtems_task_set_priority - set priority of TA1 ( blocked )
+TASK_DELETE - TA2 deleting TA1
+TASK_DELETE - TA2 deleting TA3
+TASK_DELETE - TA2 deleting TA2
+TA4 - exitting task
+RTEMS_TASK_EXITTED - extension invoked for TA4
+*** END OF TEST 7 ***
+TASK_DELETE - TA4 deleting TA4 <---- may not appear
diff --git a/testsuites/sptests/sp07/system.h b/testsuites/sptests/sp07/system.h
new file mode 100644
index 0000000000..01a3e7f765
--- /dev/null
+++ b/testsuites/sptests/sp07/system.h
@@ -0,0 +1,35 @@
+/* system.h
+ *
+ * This include file contains information that is included in every
+ * function in the test set.
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include "tmacros.h"
+
+/* constants */
+
+#define SI_NAME 0x53595349 /* name - "SYSI" */
+#define I_NAME 0x49444c45 /* name - "IDLE" */
+
+/* Miscellaneous */
+
+#define EXTERN extern /* external definition */
+
+/* macros */
+
+/* structures */
+
+#include "gvar.h"
+
+/* end of include file */
diff --git a/testsuites/sptests/sp07/task1.c b/testsuites/sptests/sp07/task1.c
new file mode 100644
index 0000000000..62fa35cee9
--- /dev/null
+++ b/testsuites/sptests/sp07/task1.c
@@ -0,0 +1,85 @@
+/* Task_1
+ *
+ * This routine serves as a test task. It verifies intertask communication
+ * using task notepads and verifies the the user extensions (tcreate, etc).
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_task Task_1(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+ rtems_task_priority the_priority;
+ rtems_task_priority previous_priority;
+
+ pause();
+
+ status = rtems_task_set_priority(
+ RTEMS_SELF,
+ RTEMS_CURRENT_PRIORITY,
+ &the_priority
+ );
+ directive_failed( status, "rtems_task_set_priority" );
+ printf(
+ "TA1 - rtems_task_set_priority - get initial priority of self: %02d\n",
+ the_priority
+ );
+
+ while( FOREVER ) {
+ status = rtems_task_get_note( RTEMS_SELF, RTEMS_NOTEPAD_8, &the_priority );
+ directive_failed( status, "rtems_task_get_note" );
+ printf(
+"TA1 - rtems_task_get_note - get RTEMS_NOTEPAD_8 - current priority: %02d\n",
+ the_priority
+ );
+
+ if ( --the_priority == 0 ) {
+ puts( "TA1 - rtems_task_suspend - suspend TA2" );
+ status = rtems_task_suspend( Task_id[ 2 ] );
+ directive_failed( status, "rtems_task_suspend" );
+
+ puts( "TA1 - rtems_task_set_priority - set priority of TA2 ( blocked )" );
+ status = rtems_task_set_priority( Task_id[ 2 ], 5, &previous_priority );
+ directive_failed( status, "rtems_task_set_priority" );
+
+ status = rtems_task_delete( Task_id[ 2 ] );
+ directive_failed( status, "rtems_task_delete of TA2" );
+
+ status = rtems_task_delete( RTEMS_SELF );
+ directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
+ }
+
+ printf( "TA1 - rtems_task_set_note - set TA2's RTEMS_NOTEPAD_8: %02d\n",
+ the_priority
+ );
+ status = rtems_task_set_note( Task_id[ 2 ], RTEMS_NOTEPAD_8, the_priority );
+ directive_failed( status, "rtems_task_set_note" );
+
+ printf( "TA1 - rtems_task_set_priority - set TA2's priority: %02d\n",
+ the_priority
+ );
+ status = rtems_task_set_priority(
+ Task_id[ 2 ],
+ the_priority,
+ &previous_priority
+ );
+ directive_failed( status, "rtems_task_set_priority" );
+ }
+}
diff --git a/testsuites/sptests/sp07/task2.c b/testsuites/sptests/sp07/task2.c
new file mode 100644
index 0000000000..622bdd8e3d
--- /dev/null
+++ b/testsuites/sptests/sp07/task2.c
@@ -0,0 +1,78 @@
+/* Task_2
+ *
+ * This routine serves as a test task. Plays with priorities to verify
+ * that the highest priority task is always executed.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_task Task_2(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+ rtems_task_priority the_priority;
+ rtems_task_priority previous_priority;
+
+ while( FOREVER ) {
+
+ status = rtems_task_get_note( RTEMS_SELF, RTEMS_NOTEPAD_8, &the_priority );
+ directive_failed( status, "rtems_task_get_note" );
+ printf(
+"TA2 - rtems_task_get_note - get RTEMS_NOTEPAD_8 - current priority: %02d\n",
+ the_priority
+ );
+
+ if ( --the_priority == 0 ) {
+ puts( "TA2 - rtems_task_suspend - suspend TA1" );
+ status = rtems_task_suspend( Task_id[ 1 ] );
+ directive_failed( status, "rtems_task_suspend" );
+
+ puts( "TA2 - rtems_task_set_priority - set priority of TA1 ( blocked )" );
+ status = rtems_task_set_priority( Task_id[ 1 ], 5, &previous_priority );
+ directive_failed( status, "rtems_task_set_priority" );
+
+ status = rtems_task_delete( Task_id[ 1 ] ); /* TA1 is blocked */
+ directive_failed( status, "rtems_task_delete of TA1" );
+
+ status = rtems_task_delete( Task_id[ 3 ] ); /* TA3 is ready */
+ directive_failed( status, "rtems_task_delete of TA3" );
+
+ status = rtems_task_delete( RTEMS_SELF );
+ directive_failed( status, "rtems_task_delete of SELD" );
+
+ } else {
+
+ printf( "TA2 - rtems_task_set_note - set TA1's RTEMS_NOTEPAD_8: %02d\n",
+ the_priority
+ );
+ status = rtems_task_set_note(Task_id[ 1 ], RTEMS_NOTEPAD_8, the_priority);
+ directive_failed( status, "rtems_task_set_note" );
+
+ printf( "TA2 - rtems_task_set_priority - set TA1's priority: %02d\n",
+ the_priority
+ );
+ status = rtems_task_set_priority(
+ Task_id[ 1 ],
+ the_priority,
+ &previous_priority
+ );
+ directive_failed( status, "rtems_task_set_priority" );
+ }
+ }
+}
diff --git a/testsuites/sptests/sp07/task3.c b/testsuites/sptests/sp07/task3.c
new file mode 100644
index 0000000000..dce44b283b
--- /dev/null
+++ b/testsuites/sptests/sp07/task3.c
@@ -0,0 +1,34 @@
+/* Task_3
+ *
+ * This routine serves as a low priority test task that should never
+ * execute.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_task Task_3(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+
+ while( FOREVER ) {
+ status = rtems_task_wake_after( RTEMS_YIELD_PROCESSOR );
+ directive_failed( status, "rtems_task_wake_after" );
+ }
+}
diff --git a/testsuites/sptests/sp07/task4.c b/testsuites/sptests/sp07/task4.c
new file mode 100644
index 0000000000..cc9de6d4c3
--- /dev/null
+++ b/testsuites/sptests/sp07/task4.c
@@ -0,0 +1,30 @@
+/* Task_4
+ *
+ * This routine serves as a low priority test task that should exit
+ * a soon as it runs to test the taskexitted user extension.
+ * execute.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_task Task_4(
+ rtems_task_argument argument
+)
+{
+ puts( "TA4 - exitting task" );
+}
diff --git a/testsuites/sptests/sp07/taskexit.c b/testsuites/sptests/sp07/taskexit.c
new file mode 100644
index 0000000000..ad52d1f3a7
--- /dev/null
+++ b/testsuites/sptests/sp07/taskexit.c
@@ -0,0 +1,33 @@
+/* Task_exit_extension
+ *
+ * This routine is the task exitted user extension.
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_extension Task_exit_extension(
+ rtems_tcb *running_task
+)
+{
+ if ( task_number( running_task->Object.id ) > 0 ) {
+ puts_nocr( "RTEMS_TASK_EXITTED - extension invoked for " );
+ put_name( Task_name[ task_number( running_task->Object.id ) ], TRUE );
+ }
+
+ puts("*** END OF TEST 7 ***" );
+ exit( 0 );
+}
diff --git a/testsuites/sptests/sp07/tcreate.c b/testsuites/sptests/sp07/tcreate.c
new file mode 100644
index 0000000000..7b066630f0
--- /dev/null
+++ b/testsuites/sptests/sp07/tcreate.c
@@ -0,0 +1,34 @@
+/* Task_create_extension
+ *
+ * This routine is the tcreate user extension.
+ *
+ * Input parameters:
+ * unused - pointer to currently running TCB
+ * created_task - pointer to new TCB being created
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_extension Task_create_extension(
+ rtems_tcb *unused,
+ rtems_tcb *created_task
+)
+{
+ if ( task_number( created_task->Object.id ) > 0 ) {
+ puts_nocr( "TASK_CREATE - " );
+ put_name( Task_name[ task_number( created_task->Object.id ) ], FALSE );
+ puts( " - created." );
+ }
+}
diff --git a/testsuites/sptests/sp07/tdelete.c b/testsuites/sptests/sp07/tdelete.c
new file mode 100644
index 0000000000..9d7c5749c1
--- /dev/null
+++ b/testsuites/sptests/sp07/tdelete.c
@@ -0,0 +1,37 @@
+/* Task_delete_extension
+ *
+ * This routine is the delete user extension.
+ *
+ * Input parameters:
+ * running_task - pointer to running TCB
+ * deleted_task - pointer to TCB deleted
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_extension Task_delete_extension(
+ rtems_tcb *running_task,
+ rtems_tcb *deleted_task
+)
+{
+ if ( task_number( running_task->Object.id ) > 0 ) {
+ puts_nocr( "TASK_DELETE - " );
+ put_name( Task_name[ task_number( running_task->Object.id ) ], FALSE );
+ }
+ if ( task_number( deleted_task->Object.id ) > 0 ) {
+ puts_nocr( " deleting " );
+ put_name( Task_name[ task_number( deleted_task->Object.id ) ], TRUE );
+ }
+}
diff --git a/testsuites/sptests/sp07/trestart.c b/testsuites/sptests/sp07/trestart.c
new file mode 100644
index 0000000000..6cefb485a6
--- /dev/null
+++ b/testsuites/sptests/sp07/trestart.c
@@ -0,0 +1,34 @@
+/* Task_restart_extension
+ *
+ * This routine is the trestart user extension.
+ *
+ * Input parameters:
+ * unused - pointer to currently running TCB
+ * restarted_task - pointer to new TCB being started
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+void Task_restart_extension(
+ rtems_tcb *unused,
+ rtems_tcb *restarted_task
+)
+{
+ if ( task_number( restarted_task->Object.id ) > 0 ) {
+ puts_nocr( "TASK_RESTART - " );
+ put_name( Task_name[ task_number( restarted_task->Object.id ) ], FALSE );
+ puts( " - restarted." );
+ }
+}
diff --git a/testsuites/sptests/sp07/tstart.c b/testsuites/sptests/sp07/tstart.c
new file mode 100644
index 0000000000..1b1fc795b7
--- /dev/null
+++ b/testsuites/sptests/sp07/tstart.c
@@ -0,0 +1,34 @@
+/* Task_start_extension
+ *
+ * This routine is the tstart user extension.
+ *
+ * Input parameters:
+ * unused - pointer to currently running TCB
+ * started_task - pointer to new TCB being started
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_extension Task_start_extension(
+ rtems_tcb *unused,
+ rtems_tcb *started_task
+)
+{
+ if ( task_number( started_task->Object.id ) > 0 ) {
+ puts_nocr( "TASK_START - " );
+ put_name( Task_name[ task_number( started_task->Object.id ) ], FALSE );
+ puts( " - started." );
+ }
+}
diff --git a/testsuites/sptests/sp08/init.c b/testsuites/sptests/sp08/init.c
new file mode 100644
index 0000000000..e3020035ce
--- /dev/null
+++ b/testsuites/sptests/sp08/init.c
@@ -0,0 +1,56 @@
+/* Init
+ *
+ * This routine is the initialization task for this test program.
+ * It is a user initialization task and has the responsibility for creating
+ * and starting the tasks that make up the test. If the time of day
+ * clock is required for the test, it should also be set to a known
+ * value by this function.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+#undef EXTERN
+#define EXTERN
+#include "conftbl.h"
+#include "gvar.h"
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+
+ puts( "\n\n*** TEST 8 ***" );
+
+ Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' );
+
+ status = rtems_task_create(
+ Task_name[ 1 ],
+ 1,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 1 ]
+ );
+ directive_failed( status, "rtems_task_create of TA1" );
+
+ status = rtems_task_start( Task_id[ 1 ], Task_1, 0 );
+ directive_failed( status, "rtems_task_start of TA1" );
+
+ status = rtems_task_delete( RTEMS_SELF );
+ directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
+}
diff --git a/testsuites/sptests/sp08/sp08.doc b/testsuites/sptests/sp08/sp08.doc
new file mode 100644
index 0000000000..2b152779d7
--- /dev/null
+++ b/testsuites/sptests/sp08/sp08.doc
@@ -0,0 +1,26 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: test8
+
+directives:
+ ex_init, ex_start, t_create, t_start, tm_tick, i_return,
+ t_mode
+
+concepts:
+
+ a. Verifies every mode change possible.
+
+ b. Verifies the fatal error handler.
diff --git a/testsuites/sptests/sp08/sp08.scn b/testsuites/sptests/sp08/sp08.scn
new file mode 100644
index 0000000000..d85ccc384f
--- /dev/null
+++ b/testsuites/sptests/sp08/sp08.scn
@@ -0,0 +1,22 @@
+*** TEST 8 ***
+TA1 - rtems_task_mode - RTEMS_ASR - previous mode: 00000000
+TA1 - rtems_task_mode - RTEMS_NO_ASR - previous mode: 00000000
+TA1 - rtems_task_mode - RTEMS_NO_ASR - previous mode: 00000400
+TA1 - rtems_task_mode - RTEMS_ASR - previous mode: 00000400
+TA1 - rtems_task_mode - RTEMS_NO_TIMESLICE - previous mode: 00000000
+TA1 - rtems_task_mode - RTEMS_TIMESLICE - previous mode: 00000000
+TA1 - rtems_task_mode - RTEMS_TIMESLICE - previous mode: 00000200
+TA1 - rtems_task_mode - RTEMS_NO_TIMESLICE - previous mode: 00000200
+TA1 - rtems_task_mode - RTEMS_PREEMPT - previous mode: 00000000
+TA1 - rtems_task_mode - RTEMS_NO_PREEMPT - previous mode: 00000000
+TA1 - rtems_task_mode - RTEMS_NO_PREEMPT - previous mode: 00000100
+TA1 - rtems_task_mode - RTEMS_PREEMPT - previous mode: 00000100
+TA1 - rtems_task_mode - RTEMS_INTERRUPT_LEVEL( 3 ) - previous mode: 00000000
+TA1 - rtems_task_mode - RTEMS_INTERRUPT_LEVEL( 5 ) - previous mode: 00000003
+TA1 - rtems_task_mode - set all modes - previous mode: 00000005
+TA1 - rtems_task_mode - set all modes - previous mode: 00000703
+TA1 - rtems_task_mode - clear all modes - previous mode: 00000703
+TA1 - rtems_task_mode - get current mode - previous mode: 00000000
+*** END OF TEST 8 ***
+
+NOTE: The interrupt level lines will be different on CPUs with few levels.
diff --git a/testsuites/sptests/sp08/system.h b/testsuites/sptests/sp08/system.h
new file mode 100644
index 0000000000..dec5151b46
--- /dev/null
+++ b/testsuites/sptests/sp08/system.h
@@ -0,0 +1,33 @@
+/* system.h
+ *
+ * This include file contains information that is included in every
+ * function in the test set.
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include "tmacros.h"
+
+/* Miscellaneous */
+
+#define EXTERN extern /* external definition */
+
+/* macros */
+
+#define put_mode( _comment, _output_mode ) \
+ printf( "%s %08x\n", _comment, _output_mode );
+
+/* structures */
+
+#include "gvar.h"
+
+/* end of include file */
diff --git a/testsuites/sptests/sp08/task1.c b/testsuites/sptests/sp08/task1.c
new file mode 100644
index 0000000000..eddcb11191
--- /dev/null
+++ b/testsuites/sptests/sp08/task1.c
@@ -0,0 +1,256 @@
+/* Task_1
+ *
+ * This routine serves as a test task. It verifies all combinations of
+ * task mode changes.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_task Task_1(
+ rtems_task_argument argument
+)
+{
+ rtems_mode previous_mode;
+ rtems_status_code status;
+
+/* BEGINNING OF RTEMS_ASR */
+
+ status = rtems_task_mode( RTEMS_ASR, RTEMS_ASR_MASK, &previous_mode );
+ directive_failed( status, "rtems_task_mode" );
+ put_mode(
+ "TA1 - rtems_task_mode - RTEMS_ASR - previous mode: ",
+ previous_mode
+ );
+
+ status = rtems_task_mode(
+ RTEMS_NO_ASR,
+ RTEMS_ASR_MASK,
+ &previous_mode
+ );
+ directive_failed( status, "rtems_task_mode" );
+ put_mode(
+ "TA1 - rtems_task_mode - RTEMS_NO_ASR - previous mode: ",
+ previous_mode
+ );
+
+ status = rtems_task_mode(
+ RTEMS_NO_ASR,
+ RTEMS_ASR_MASK,
+ &previous_mode
+ );
+ directive_failed( status, "rtems_task_mode" );
+ put_mode(
+ "TA1 - rtems_task_mode - RTEMS_NO_ASR - previous mode: ",
+ previous_mode
+ );
+
+ status = rtems_task_mode(
+ RTEMS_ASR,
+ RTEMS_ASR_MASK,
+ &previous_mode
+ );
+ directive_failed( status, "rtems_task_mode" );
+ put_mode(
+ "TA1 - rtems_task_mode - RTEMS_ASR - previous mode: ",
+ previous_mode
+ );
+
+/* END OF RTEMS_ASR */
+
+/* BEGINNING OF RTEMS_TIMESLICE */
+
+ status = rtems_task_mode(
+ RTEMS_NO_TIMESLICE,
+ RTEMS_TIMESLICE_MASK,
+ &previous_mode
+ );
+ directive_failed( status, "rtems_task_mode" );
+ put_mode(
+ "TA1 - rtems_task_mode - RTEMS_NO_TIMESLICE - previous mode: ",
+ previous_mode
+ );
+
+ status = rtems_task_mode(
+ RTEMS_TIMESLICE,
+ RTEMS_TIMESLICE_MASK,
+ &previous_mode
+ );
+ directive_failed( status, "rtems_task_mode" );
+ put_mode(
+ "TA1 - rtems_task_mode - RTEMS_TIMESLICE - previous mode: ",
+ previous_mode
+ );
+
+ status = rtems_task_mode(
+ RTEMS_TIMESLICE,
+ RTEMS_TIMESLICE_MASK,
+ &previous_mode
+ );
+ directive_failed( status, "rtems_task_mode" );
+ put_mode(
+ "TA1 - rtems_task_mode - RTEMS_TIMESLICE - previous mode: ",
+ previous_mode
+ );
+
+ status = rtems_task_mode(
+ RTEMS_NO_TIMESLICE,
+ RTEMS_TIMESLICE_MASK,
+ &previous_mode
+ );
+ directive_failed( status, "rtems_task_mode" );
+ put_mode(
+ "TA1 - rtems_task_mode - RTEMS_NO_TIMESLICE - previous mode: ",
+ previous_mode
+ );
+
+/* END OF RTEMS_TIMESLICE */
+
+/* BEGINNING OF RTEMS_PREEMPT */
+
+ status = rtems_task_mode(
+ RTEMS_PREEMPT,
+ RTEMS_PREEMPT_MASK,
+ &previous_mode
+ );
+ directive_failed( status, "rtems_task_mode" );
+ put_mode(
+ "TA1 - rtems_task_mode - RTEMS_PREEMPT - previous mode: ",
+ previous_mode
+ );
+
+ status = rtems_task_mode(
+ RTEMS_NO_PREEMPT,
+ RTEMS_PREEMPT_MASK,
+ &previous_mode
+ );
+ directive_failed( status, "rtems_task_mode" );
+ put_mode(
+ "TA1 - rtems_task_mode - RTEMS_NO_PREEMPT - previous mode: ",
+ previous_mode
+ );
+
+ status = rtems_task_mode(
+ RTEMS_NO_PREEMPT,
+ RTEMS_PREEMPT_MASK,
+ &previous_mode
+ );
+ directive_failed( status, "rtems_task_mode" );
+ put_mode(
+ "TA1 - rtems_task_mode - RTEMS_NO_PREEMPT - previous mode: ",
+ previous_mode
+ );
+
+ status = rtems_task_mode(
+ RTEMS_PREEMPT,
+ RTEMS_PREEMPT_MASK,
+ &previous_mode
+ );
+ directive_failed( status, "rtems_task_mode" );
+ put_mode(
+ "TA1 - rtems_task_mode - RTEMS_PREEMPT - previous mode: ",
+ previous_mode
+ );
+
+/* END OF RTEMS_PREEMPT */
+
+/* BEGINNING OF RTEMS_INTERRUPT_LEVEL */
+
+ status = rtems_task_mode(
+ RTEMS_INTERRUPT_LEVEL(3),
+ RTEMS_INTERRUPT_MASK,
+ &previous_mode
+ );
+ directive_failed( status, "rtems_task_mode" );
+ put_mode(
+ "TA1 - rtems_task_mode - RTEMS_INTERRUPT_LEVEL( 3 ) - previous mode: ",
+ previous_mode
+ );
+
+ status = rtems_task_mode(
+ RTEMS_INTERRUPT_LEVEL(5),
+ RTEMS_INTERRUPT_MASK,
+ &previous_mode
+ );
+ directive_failed( status, "rtems_task_mode" );
+ put_mode(
+ "TA1 - rtems_task_mode - RTEMS_INTERRUPT_LEVEL( 5 ) - previous mode: ",
+ previous_mode
+ );
+
+/* END OF RTEMS_INTERRUPT_LEVEL */
+
+/* BEGINNING OF COMBINATIONS */
+
+ status = rtems_task_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
+ );
+ directive_failed( status, "rtems_task_mode" );
+ put_mode(
+ "TA1 - rtems_task_mode - set all modes - previous mode: ",
+ previous_mode
+ );
+
+ status = rtems_task_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
+ );
+ directive_failed( status, "rtems_task_mode" );
+ put_mode(
+ "TA1 - rtems_task_mode - set all modes - previous mode: ",
+ previous_mode
+ );
+
+ status = rtems_task_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
+ );
+ directive_failed( status, "rtems_task_mode" );
+ put_mode(
+ "TA1 - rtems_task_mode - clear all modes - previous mode: ",
+ previous_mode
+ );
+
+/* END OF COMBINATIONS */
+
+/* BEGINNING OF CURRENT MODE */
+
+ status = rtems_task_mode(
+ RTEMS_CURRENT_MODE,
+ RTEMS_CURRENT_MODE,
+ &previous_mode
+ );
+ directive_failed( status, "rtems_task_mode" );
+ put_mode(
+ "TA1 - rtems_task_mode - get current mode - previous mode: ",
+ previous_mode
+ );
+
+/* END OF CURRENT MODE */
+
+ puts( "*** END OF TEST 8 ***" );
+ exit( 0 );
+}
diff --git a/testsuites/sptests/sp09/delay.c b/testsuites/sptests/sp09/delay.c
new file mode 100644
index 0000000000..dd78610be8
--- /dev/null
+++ b/testsuites/sptests/sp09/delay.c
@@ -0,0 +1,28 @@
+/* Delayed_routine
+ *
+ * This routine is used as the timer routine for Timer Manager tests.
+ *
+ * Input parameters:
+ * ignored - this parameter is ignored
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_timer_service_routine Delayed_routine(
+ rtems_id ignored_id,
+ void *ignored_address
+)
+{
+}
diff --git a/testsuites/sptests/sp09/init.c b/testsuites/sptests/sp09/init.c
new file mode 100644
index 0000000000..3ca4b62404
--- /dev/null
+++ b/testsuites/sptests/sp09/init.c
@@ -0,0 +1,123 @@
+/* Init
+ *
+ * This routine is the initialization task for this test program.
+ * It is a user initialization task and has the responsibility for creating
+ * and starting the tasks that make up the test. If the time of day
+ * clock is required for the test, it should also be set to a known
+ * value by this function.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+#undef EXTERN
+#define EXTERN
+#include "conftbl.h"
+#include "gvar.h"
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+
+ puts( "\n\n*** TEST 9 ***" );
+
+ Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' );
+ Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' );
+ Task_name[ 3 ] = rtems_build_name( 'T', 'A', '3', ' ' );
+ Task_name[ 4 ] = rtems_build_name( 'T', 'A', '4', ' ' );
+ Task_name[ 5 ] = rtems_build_name( 'T', 'A', '5', ' ' );
+ Task_name[ 6 ] = rtems_build_name( 'T', 'A', '6', ' ' );
+ Task_name[ 7 ] = rtems_build_name( 'T', 'A', '7', ' ' );
+ Task_name[ 8 ] = rtems_build_name( 'T', 'A', '8', ' ' );
+ Task_name[ 9 ] = rtems_build_name( 'T', 'A', '9', ' ' );
+ Task_name[ 10 ] = rtems_build_name( 'T', 'A', 'A', ' ' );
+
+ Timer_name[ 1 ] = rtems_build_name( 'T', 'M', '1', ' ' );
+
+ Semaphore_name[ 1 ] = rtems_build_name( 'S', 'M', '1', ' ' );
+ Semaphore_name[ 2 ] = rtems_build_name( 'S', 'M', '2', ' ' );
+ Semaphore_name[ 3 ] = rtems_build_name( 'S', 'M', '3', ' ' );
+
+ Queue_name[ 1 ] = rtems_build_name( 'M', 'Q', '1', ' ' );
+ Queue_name[ 2 ] = rtems_build_name( 'M', 'Q', '2', ' ' );
+
+ Partition_name[ 1 ] = rtems_build_name( 'P', 'T', '1', ' ' );
+
+ Region_name[ 1 ] = rtems_build_name( 'R', 'N', '1', ' ' );
+
+ Port_name[ 1 ] = rtems_build_name( 'D', 'P', '1', ' ' );
+
+ Period_name[ 1 ] = rtems_build_name( 'T', 'M', '1', ' ' );
+
+#if 0
+ status = rtems_task_create(
+ Task_name[1],
+ 4,
+ 10,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 1 ]
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_SIZE,
+ "rtems_task_create with illegal stack size"
+ );
+ puts( "INIT - rtems_task_create - RTEMS_INVALID_SIZE" );
+#endif
+ puts( "INIT - rtems_task_create - RTEMS_INVALID_SIZE -- NOT CHECKED" );
+
+ status = rtems_task_create(
+ Task_name[1],
+ 0,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 1 ]
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_PRIORITY,
+ "rtems_task_create with illegal priority"
+ );
+ puts( "INIT - rtems_task_create - RTEMS_INVALID_PRIORITY" );
+
+ status = rtems_task_create(
+ Task_name[ 1 ],
+ 4,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 1 ]
+ );
+ directive_failed( status, "rtems_task_create of TA1" );
+
+ status = rtems_task_restart( Task_id[ 1 ], 0 );
+ fatal_directive_status(
+ status,
+ RTEMS_INCORRECT_STATE,
+ "rtems_task_restart of DORMANT task"
+ );
+ puts( "INIT - rtems_task_restart - RTEMS_INCORRECT_STATE" );
+
+ status = rtems_task_start( Task_id[ 1 ], Task_1, 0 );
+ directive_failed( status, "rtems_task_start of TA1" );
+
+ status = rtems_task_delete( RTEMS_SELF );
+ directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
+}
diff --git a/testsuites/sptests/sp09/isr.c b/testsuites/sptests/sp09/isr.c
new file mode 100644
index 0000000000..292e9c0225
--- /dev/null
+++ b/testsuites/sptests/sp09/isr.c
@@ -0,0 +1,27 @@
+/* Service_routine
+ *
+ * This routine is used as the timer routine for Interrupt Manager tests.
+ *
+ * Input parameters:
+ * ignored - this parameter is ignored
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_isr Service_routine(
+ rtems_vector_number ignored
+)
+{
+}
diff --git a/testsuites/sptests/sp09/screen01.c b/testsuites/sptests/sp09/screen01.c
new file mode 100644
index 0000000000..39012f5051
--- /dev/null
+++ b/testsuites/sptests/sp09/screen01.c
@@ -0,0 +1,168 @@
+/* Screen1
+ *
+ * This routine generates error screen 1 for test 9.
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+void Screen1()
+{
+ rtems_unsigned32 notepad_value;
+ rtems_id self_id;
+ rtems_task_priority previous_priority;
+ rtems_status_code status;
+
+ status = rtems_task_delete( 100 );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_task_delete with illegal id"
+ );
+ puts( "TA1 - rtems_task_delete - RTEMS_INVALID_ID" );
+
+ status = rtems_task_get_note( RTEMS_SELF, 100, &notepad_value );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_NUMBER,
+ "rtems_task_get_note with illegal notepad"
+ );
+ puts( "TA1 - rtems_task_get_note - RTEMS_INVALID_NUMBER" );
+
+ status = rtems_task_get_note( 100, RTEMS_NOTEPAD_LAST, &notepad_value );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_task_get_note with illegal id"
+ );
+ puts( "TA1 - rtems_task_get_note - RTEMS_INVALID_ID" );
+
+ status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &self_id );
+ directive_failed( status, "rtems_task_ident of self" );
+
+ if ( self_id != Task_id[ 1 ] ) {
+ puts( "ERROR - rtems_task_ident - incorrect ID returned!" );
+ }
+ puts( "TA1 - rtems_task_ident - current task RTEMS_SUCCESSFUL" );
+
+ status = rtems_task_ident( 100, RTEMS_SEARCH_ALL_NODES, &Junk_id );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_NAME,
+ "rtems_task_ident with illegal name (local)"
+ );
+ puts( "TA1 - rtems_task_ident - global RTEMS_INVALID_NAME" );
+
+ status = rtems_task_ident( 100, 1, &Junk_id );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_NAME,
+ "rtems_task_ident with illegal name (global)"
+ );
+ puts( "TA1 - rtems_task_ident - local RTEMS_INVALID_NAME" );
+
+ status = rtems_task_ident( 100, 2, &Junk_id );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_NODE,
+ "rtems_task_ident with illegal node"
+ );
+ puts( "TA1 - rtems_task_ident - RTEMS_INVALID_NODE" );
+
+ status = rtems_task_restart( 100, 0 );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_task_restart with illegal id"
+ );
+ puts( "TA1 - rtems_task_restart - RTEMS_INVALID_ID" );
+
+ status = rtems_task_resume( 100 );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_task_resume with illegal id"
+ );
+ puts( "TA1 - rtems_task_resume - RTEMS_INVALID_ID" );
+
+ status = rtems_task_resume( RTEMS_SELF );
+ fatal_directive_status(
+ status,
+ RTEMS_INCORRECT_STATE,
+ "rtems_task_resume of ready task"
+ );
+ puts( "TA1 - rtems_task_resume - RTEMS_INCORRECT_STATE" );
+
+ status = rtems_task_set_priority( RTEMS_SELF, 512, &previous_priority );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_PRIORITY,
+ "rtems_task_set_priority with illegal priority"
+ );
+ puts( "TA1 - rtems_task_set_priority - RTEMS_INVALID_PRIORITY" );
+
+ status = rtems_task_set_priority( 100, 8, &previous_priority );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_task_set_priority with illegal id"
+ );
+ puts( "TA1 - rtems_task_set_priority - RTEMS_INVALID_ID" );
+
+ status = rtems_task_set_note(
+ RTEMS_SELF,
+ RTEMS_NOTEPAD_LAST+10,
+ notepad_value
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_NUMBER,
+ "rtems_task_set_note with illegal notepad"
+ );
+ puts( "TA1 - rtems_task_set_note - RTEMS_INVALID_NUMBER" );
+
+ status = rtems_task_set_note( 100, RTEMS_NOTEPAD_LAST, notepad_value );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_task_set_note with illegal id"
+ );
+ puts( "TA1 - rtems_task_set_note - RTEMS_INVALID_ID" );
+
+ status = rtems_task_start( 100, Task_1, 0 );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_task_start with illegal id"
+ );
+ puts( "TA1 - rtems_task_start - RTEMS_INVALID_ID" );
+
+ status = rtems_task_start( 0, Task_1, 0 );
+ fatal_directive_status(
+ status,
+ RTEMS_INCORRECT_STATE,
+ "rtems_task_start of ready task"
+ );
+ puts( "TA1 - rtems_task_start - RTEMS_INCORRECT_STATE" );
+
+ status = rtems_task_suspend( 100 );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_task_suspend with illegal id"
+ );
+ puts( "TA1 - rtems_task_suspend - RTEMS_INVALID_ID" );
+}
diff --git a/testsuites/sptests/sp09/screen02.c b/testsuites/sptests/sp09/screen02.c
new file mode 100644
index 0000000000..02eb5e4498
--- /dev/null
+++ b/testsuites/sptests/sp09/screen02.c
@@ -0,0 +1,192 @@
+/* Screen2
+ *
+ * This routine generates error screen 2 for test 9.
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+void Screen2()
+{
+ rtems_time_of_day time;
+ rtems_status_code status;
+
+/* errors before clock is set */
+
+ status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
+ if ( status == RTEMS_SUCCESSFUL ) {
+ puts(
+ "TA1 - rtems_clock_get - RTEMS_NOT_DEFINED -- DID BSP SET THE TIME OF DAY?"
+ );
+ } else {
+ fatal_directive_status(
+ status,
+ RTEMS_NOT_DEFINED,
+ "rtems_clock_get before clock is set"
+ );
+ puts( "TA1 - rtems_clock_get - RTEMS_NOT_DEFINED" );
+ }
+
+ status = rtems_task_wake_when( &time );
+ if ( status == RTEMS_SUCCESSFUL ) {
+ puts(
+"TA1 - rtems_task_wake_when - RTEMS_NOT_DEFINED -- DID BSP SET THE TIME OF DAY?"
+ );
+ } else {
+ fatal_directive_status(
+ status,
+ RTEMS_NOT_DEFINED,
+ "rtems_task_wake_when before clock is set"
+ );
+ puts( "TA1 - rtems_task_wake_when - RTEMS_NOT_DEFINED" );
+ }
+
+ status = rtems_timer_fire_when( 0, &time, Delayed_routine, NULL );
+ if ( status == RTEMS_SUCCESSFUL ) {
+ puts(
+ "TA1 - timer_wake_when - RTEMS_NOT_DEFINED -- DID BSP SET THE TIME OF DAY?"
+ );
+ } else {
+ fatal_directive_status(
+ status,
+ RTEMS_NOT_DEFINED,
+ "task_fire_when before clock is set"
+ );
+ puts( "TA1 - rtems_timer_fire_when - RTEMS_NOT_DEFINED" );
+ }
+
+ build_time( &time, 2, 5, 1987, 8, 30, 45, 0 );
+ print_time( "TA1 - rtems_clock_set - ", &time, "" );
+ status = rtems_clock_set( &time );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_CLOCK,
+ "rtems_clock_set with invalid year"
+ );
+ puts( " - RTEMS_INVALID_CLOCK" );
+
+ build_time( &time, 15, 5, 1988, 8, 30, 45, 0 );
+ print_time( "TA1 - rtems_clock_set - ", &time, "" );
+ status = rtems_clock_set( &time );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_CLOCK,
+ "rtems_clock_set with invalid month"
+ );
+ puts( " - RTEMS_INVALID_CLOCK" );
+
+ build_time( &time, 2, 32, 1988, 8, 30, 45, 0 );
+ print_time( "TA1 - rtems_clock_set - ", &time, "" );
+ status = rtems_clock_set( &time );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_CLOCK,
+ "rtems_clock_set with invalid day"
+ );
+ puts( " - RTEMS_INVALID_CLOCK" );
+
+ build_time( &time, 2, 5, 1988, 25, 30, 45, 0 );
+ print_time( "TA1 - rtems_clock_set - ", &time, "" );
+ status = rtems_clock_set( &time );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_CLOCK,
+ "rtems_clock_set with invalid hour"
+ );
+ puts( " - RTEMS_INVALID_CLOCK" );
+
+ build_time( &time, 2, 5, 1988, 8, 61, 45, 0 );
+ print_time( "TA1 - rtems_clock_set - ", &time, "" );
+ status = rtems_clock_set( &time );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_CLOCK,
+ "rtems_clock_set with invalid minute"
+ );
+ puts( " - RTEMS_INVALID_CLOCK" );
+
+ build_time( &time, 2, 5, 1988, 8, 30, 61, 0 );
+ print_time( "TA1 - rtems_clock_set - ", &time, "" );
+ status = rtems_clock_set( &time );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_CLOCK,
+ "rtems_clock_set with invalid second"
+ );
+ puts( " - RTEMS_INVALID_CLOCK" );
+
+ build_time( &time, 2, 5, 1988, 8, 30, 45, TICKS_PER_SECOND + 1 );
+ print_time( "TA1 - rtems_clock_set - ", &time, "" );
+ status = rtems_clock_set( &time );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_CLOCK,
+ "rtems_clock_set with invalid ticks per second"
+ );
+ puts( " - RTEMS_INVALID_CLOCK" );
+
+ build_time( &time, 2, 5, 1988, 8, 30, 45, 0 );
+ print_time( "TA1 - rtems_clock_set - ", &time, "" );
+ status = rtems_clock_set( &time );
+ directive_failed( status, "rtems_clock_set successful" );
+ puts( " - RTEMS_SUCCESSFUL" );
+
+/* rtems_task_wake_when */
+
+ build_time( &time, 2, 5, 1988, 8, 30, 48, TICKS_PER_SECOND + 1 );
+ time.second += 3;
+ puts( "TA1 - rtems_task_wake_when - TICKINVALID - sleep about 3 seconds" );
+
+ status = rtems_task_wake_when( &time );
+ directive_failed(
+ status,
+ "rtems_task_wake_when with invalid ticks per second"
+ );
+ puts( "TA1 - rtems_task_wake_when - TICKINVALID - woke up RTEMS_SUCCESSFUL" );
+
+ build_time( &time, 2, 5, 1961, 8, 30, 48, 0 );
+ print_time( "TA1 - rtems_task_wake_when - ", &time, "" );
+ status = rtems_task_wake_when( &time );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_CLOCK,
+ "rtems_task_wake_when with invalid year"
+ );
+ puts( " - RTEMS_INVALID_CLOCK" );
+
+ build_time( &time, 2, 5, 1988, 25, 30, 48, 0 );
+ print_time( "TA1 - rtems_task_wake_when - ", &time, "" );
+ status = rtems_task_wake_when( &time );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_CLOCK,
+ "rtems_task_wake_when with invalid hour"
+ );
+ puts( " - RTEMS_INVALID_CLOCK" );
+
+ rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
+ print_time( "TA1 - current time - ", &time, "\n" );
+
+ time.month = 1;
+ print_time( "TA1 - rtems_task_wake_when - ", &time, "" );
+ status = rtems_task_wake_when( &time );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_CLOCK,
+ "rtems_task_wake_when before current time"
+ );
+ puts( " - RTEMS_INVALID_CLOCK" );
+}
diff --git a/testsuites/sptests/sp09/screen03.c b/testsuites/sptests/sp09/screen03.c
new file mode 100644
index 0000000000..7f431c45df
--- /dev/null
+++ b/testsuites/sptests/sp09/screen03.c
@@ -0,0 +1,204 @@
+/* Screen3
+ *
+ * This routine generates error screen 3 for test 9.
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+extern rtems_configuration_table BSP_Configuration;
+
+void Screen3()
+{
+ rtems_name task_name;
+ rtems_status_code status;
+
+ task_name = 1;
+ status = rtems_task_create(
+ 0,
+ 1,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Junk_id
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_NAME,
+ "rtems_task_create with illegal name"
+ );
+ puts( "TA1 - rtems_task_create - RTEMS_INVALID_NAME" );
+
+ status = rtems_task_create(
+ task_name,
+ 1,
+ BSP_Configuration.work_space_size,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Junk_id
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_UNSATISFIED,
+ "rtems_task_create with a stack size larger than the workspace"
+ );
+ puts( "TA1 - rtems_task_create - stack size - RTEMS_UNSATISFIED" );
+
+ status = rtems_task_create(
+ Task_name[ 2 ],
+ 4,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 2 ]
+ );
+ directive_failed( status, "rtems_task_create of TA2" );
+ puts( "TA1 - rtems_task_create - TA2 created - RTEMS_SUCCESSFUL" );
+
+ status = rtems_task_suspend( Task_id[ 2 ] );
+ directive_failed( status, "rtems_task_suspend of TA2" );
+ puts( "TA1 - rtems_task_suspend - suspend TA2 - RTEMS_SUCCESSFUL" );
+
+ status = rtems_task_suspend( Task_id[ 2 ] );
+ fatal_directive_status(
+ status,
+ RTEMS_ALREADY_SUSPENDED,
+ "rtems_task_suspend of suspended TA2"
+ );
+ puts( "TA1 - rtems_task_suspend - suspend TA2 - RTEMS_ALREADY_SUSPENDED" );
+
+ status = rtems_task_resume( Task_id[ 2 ] );
+ directive_failed( status, "rtems_task_resume of TA2" );
+ puts( "TA1 - rtems_task_resume - TA2 resumed - RTEMS_SUCCESSFUL" );
+
+ status = rtems_task_create(
+ Task_name[ 3 ],
+ 4,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 3 ]
+ );
+ directive_failed( status, "rtems_task_create of TA3" );
+ puts( "TA1 - rtems_task_create - TA3 created - RTEMS_SUCCESSFUL" );
+
+ status = rtems_task_create(
+ Task_name[ 4 ],
+ 4,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 4 ]
+ );
+ directive_failed( status, "rtems_task_create of TA4" );
+ puts( "TA1 - rtems_task_create - 4 created - RTEMS_SUCCESSFUL" );
+
+ status = rtems_task_create(
+ Task_name[ 5 ],
+ 4,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 5 ]
+ );
+ directive_failed( status, "rtems_task_create of TA5" );
+ puts( "TA1 - rtems_task_create - 5 created - RTEMS_SUCCESSFUL" );
+
+ status = rtems_task_create(
+ Task_name[ 6 ],
+ 4,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 6 ]
+ );
+ directive_failed( status, "rtems_task_create of TA6" );
+ puts( "TA1 - rtems_task_create - 6 created - RTEMS_SUCCESSFUL" );
+
+ status = rtems_task_create(
+ Task_name[ 7 ],
+ 4,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 7 ]
+ );
+ directive_failed( status, "rtems_task_create of TA7" );
+ puts( "TA1 - rtems_task_create - 7 created - RTEMS_SUCCESSFUL" );
+
+ status = rtems_task_create(
+ Task_name[ 8 ],
+ 4,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 8 ]
+ );
+ directive_failed( status, "rtems_task_create of TA8" );
+ puts( "TA1 - rtems_task_create - 8 created - RTEMS_SUCCESSFUL" );
+
+ status = rtems_task_create(
+ Task_name[ 9 ],
+ 4,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 9 ]
+ );
+ directive_failed( status, "rtems_task_create of TA9" );
+ puts( "TA1 - rtems_task_create - 9 created - RTEMS_SUCCESSFUL" );
+
+ status = rtems_task_create(
+ Task_name[ 10 ],
+ 4,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 10 ]
+ );
+ directive_failed( status, "rtems_task_create of TA10" );
+ puts( "TA1 - rtems_task_create - 10 created - RTEMS_SUCCESSFUL" );
+
+ status = rtems_task_create(
+ task_name,
+ 4,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Junk_id
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_TOO_MANY,
+ "rtems_task_create for too many tasks"
+ );
+ puts( "TA1 - rtems_task_create - 11 - RTEMS_TOO_MANY" );
+
+ status = rtems_task_create(
+ task_name,
+ 4,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_GLOBAL,
+ &Junk_id
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_MP_NOT_CONFIGURED,
+ "rtems_task_create of global task in a single cpu system"
+ );
+ puts( "TA1 - rtems_task_create - RTEMS_MP_NOT_CONFIGURED" );
+}
diff --git a/testsuites/sptests/sp09/screen04.c b/testsuites/sptests/sp09/screen04.c
new file mode 100644
index 0000000000..6e3866cb05
--- /dev/null
+++ b/testsuites/sptests/sp09/screen04.c
@@ -0,0 +1,85 @@
+/* Screen4
+ *
+ * This routine generates error screen 4 for test 9.
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+void Screen4()
+{
+ rtems_event_set event_out;
+ rtems_time_of_day time;
+ rtems_status_code status;
+
+ status = rtems_event_receive(
+ RTEMS_EVENT_16,
+ RTEMS_NO_WAIT,
+ RTEMS_NO_TIMEOUT,
+ &event_out
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_UNSATISFIED,
+ "rtems_event_receive unsatisfied (ALL)"
+ );
+ puts( "TA1 - rtems_event_receive - RTEMS_UNSATISFIED ( all conditions )" );
+
+ status = rtems_event_receive(
+ RTEMS_EVENT_16,
+ RTEMS_EVENT_ANY | RTEMS_NO_WAIT,
+ RTEMS_NO_TIMEOUT,
+ &event_out
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_UNSATISFIED,
+ "rtems_event_receive unsatisfied (ANY)"
+ );
+ puts( "TA1 - rtems_event_receive - RTEMS_UNSATISFIED ( any condition )" );
+
+ puts( "TA1 - rtems_event_receive - timeout in 3 seconds" );
+ status = rtems_event_receive(
+ RTEMS_EVENT_16,
+ RTEMS_DEFAULT_OPTIONS,
+ 3 * TICKS_PER_SECOND,
+ &event_out
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_TIMEOUT,
+ "rtems_event_receive"
+ );
+ puts( "TA1 - rtems_event_receive - woke up with RTEMS_TIMEOUT" );
+
+ status = rtems_event_send( 100, RTEMS_EVENT_16 );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_event_send with illegal id"
+ );
+ puts( "TA1 - rtems_event_send - RTEMS_INVALID_ID" );
+
+ puts( "TA1 - rtems_task_wake_after - sleep 1 second - RTEMS_SUCCESSFUL" );
+ status = rtems_task_wake_after( TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after" );
+
+ build_time( &time, 2, 5, 1988, 8, 30, 45, 0 );
+ print_time( "TA1 - rtems_clock_set - ", &time, "" );
+ status = rtems_clock_set( &time );
+ directive_failed( status, "rtems_clock_set" );
+ puts( " - RTEMS_SUCCESSFUL" );
+}
diff --git a/testsuites/sptests/sp09/screen05.c b/testsuites/sptests/sp09/screen05.c
new file mode 100644
index 0000000000..9b091a407a
--- /dev/null
+++ b/testsuites/sptests/sp09/screen05.c
@@ -0,0 +1,148 @@
+/* Screen5
+ *
+ * This routine generates error screen 5 for test 9.
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+void Screen5()
+{
+ rtems_status_code status;
+
+ status = rtems_semaphore_create( 0, 1, RTEMS_DEFAULT_ATTRIBUTES, &Junk_id );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_NAME,
+ "rtems_semaphore_create with illegal name"
+ );
+ puts( "TA1 - rtems_semaphore_create - RTEMS_INVALID_NAME" );
+
+ status = rtems_semaphore_create(
+ Semaphore_name[ 1 ],
+ 1,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Semaphore_id[ 1 ]
+ );
+ directive_failed( status, "rtems_semaphore_create" );
+ puts( "TA1 - rtems_semaphore_create - 1 - RTEMS_SUCCESSFUL" );
+
+ status = rtems_semaphore_create(
+ Semaphore_name[ 2 ],
+ 1,
+ RTEMS_BINARY_SEMAPHORE,
+ &Semaphore_id[ 2 ]
+ );
+ directive_failed( status, "rtems_semaphore_create" );
+ puts( "TA1 - rtems_semaphore_create - 2 - RTEMS_SUCCESSFUL" );
+
+ status = rtems_semaphore_create(
+ Semaphore_name[ 3 ],
+ 1,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Junk_id
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_TOO_MANY,
+ "rtems_semaphore_create of too many"
+ );
+ puts( "TA1 - rtems_semaphore_create - 3 - RTEMS_TOO_MANY" );
+
+ status = rtems_semaphore_create(
+ Semaphore_name[ 1 ],
+ 1,
+ RTEMS_INHERIT_PRIORITY | RTEMS_BINARY_SEMAPHORE | RTEMS_FIFO,
+ &Junk_id
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_NOT_DEFINED,
+ "rtems_semaphore_create of RTEMS_FIFO RTEMS_INHERIT_PRIORITY"
+ );
+ puts( "TA1 - rtems_semaphore_create - RTEMS_NOT_DEFINED" );
+
+ status = rtems_semaphore_create(
+ Semaphore_name[ 1 ],
+ 1,
+ RTEMS_INHERIT_PRIORITY | RTEMS_COUNTING_SEMAPHORE | RTEMS_PRIORITY,
+ &Junk_id
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_NOT_DEFINED,
+ "rtems_semaphore_create of RTEMS_COUNTING_SEMAPHORE RTEMS_INHERIT_PRIORITY"
+ );
+ puts( "TA1 - rtems_semaphore_create - RTEMS_NOT_DEFINED" );
+
+ status = rtems_semaphore_create(
+ Semaphore_name[ 1 ],
+ 2,
+ RTEMS_BINARY_SEMAPHORE,
+ &Junk_id
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_NUMBER,
+ "rtems_semaphore_create of binary semaphore with count > 1"
+ );
+ puts( "TA1 - rtems_semaphore_create - RTEMS_INVALID_NUMBER" );
+
+ status = rtems_semaphore_create(
+ Semaphore_name[ 3 ],
+ 1,
+ RTEMS_GLOBAL,
+ &Junk_id
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_MP_NOT_CONFIGURED,
+ "rtems_semaphore_create of mp not configured"
+ );
+ puts( "TA1 - rtems_semaphore_create - RTEMS_MP_NOT_CONFIGURED" );
+
+ status = rtems_semaphore_delete( 100 );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_semaphore_delete with illegal id"
+ );
+ puts( "TA1 - rtems_semaphore_delete - unknown RTEMS_INVALID_ID" );
+
+ status = rtems_semaphore_delete( 0x010100 );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_semaphore_delete with local illegal id"
+ );
+ puts( "TA1 - rtems_semaphore_delete - local RTEMS_INVALID_ID" );
+
+ status = rtems_semaphore_ident( 100, RTEMS_SEARCH_ALL_NODES, &Junk_id );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_NAME,
+ "rtems_semaphore_ident will illegal name (local)"
+ );
+ puts( "TA1 - rtems_semaphore_ident - global RTEMS_INVALID_NAME" );
+
+ status = rtems_semaphore_ident( 100, 1, &Junk_id );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_NAME,
+ "rtems_semaphore_ident will illegal name (global)"
+ );
+ puts( "TA1 - rtems_semaphore_ident - local RTEMS_INVALID_NAME" );
+}
diff --git a/testsuites/sptests/sp09/screen06.c b/testsuites/sptests/sp09/screen06.c
new file mode 100644
index 0000000000..40ad75d606
--- /dev/null
+++ b/testsuites/sptests/sp09/screen06.c
@@ -0,0 +1,125 @@
+/* Screen6
+ *
+ * This routine generates error screen 6 for test 9.
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+void Screen6()
+{
+ rtems_status_code status;
+
+ status = rtems_semaphore_obtain(
+ 100,
+ RTEMS_DEFAULT_OPTIONS,
+ RTEMS_NO_TIMEOUT
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_semaphore_obtain with illegal id"
+ );
+ puts( "TA1 - rtems_semaphore_obtain - RTEMS_INVALID_ID" );
+
+ status = rtems_semaphore_obtain(
+ Semaphore_id[ 1 ],
+ RTEMS_DEFAULT_OPTIONS,
+ RTEMS_NO_TIMEOUT
+ );
+ directive_failed( status, "rtems_semaphore_obtain successful" );
+ puts( "TA1 - rtems_semaphore_obtain - got sem 1 - RTEMS_SUCCESSFUL" );
+
+ status = rtems_semaphore_obtain(
+ Semaphore_id[ 1 ],
+ RTEMS_NO_WAIT,
+ RTEMS_NO_TIMEOUT
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_UNSATISFIED,
+ "rtems_semaphore_obtain not available"
+ );
+ puts( "TA1 - rtems_semaphore_obtain - RTEMS_UNSATISFIED" );
+
+ puts( "TA1 - rtems_semaphore_obtain - timeout in 3 seconds" );
+ status = rtems_semaphore_obtain(
+ Semaphore_id[ 1 ],
+ RTEMS_DEFAULT_OPTIONS,
+ 3 * TICKS_PER_SECOND
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_TIMEOUT,
+ "rtems_semaphore_obtain timeout"
+ );
+ puts( "TA1 - rtems_semaphore_obtain - woke up with RTEMS_TIMEOUT" );
+
+ status = rtems_semaphore_release( Semaphore_id[ 2 ] );
+ fatal_directive_status(
+ status,
+ RTEMS_NOT_OWNER_OF_RESOURCE,
+ "rtems_semaphore_release and not owner"
+ );
+ puts( "TA1 - rtems_semaphore_release - RTEMS_NOT_OWNER_OF_RESOURCE" );
+
+ status = rtems_semaphore_release( 100 );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_semaphore_release with illegal id"
+ );
+ puts( "TA1 - rtems_semaphore_release - RTEMS_INVALID_ID" );
+
+ puts( "TA1 - rtems_task_start - start TA2 - RTEMS_SUCCESSFUL" );
+ status = rtems_task_start( Task_id[ 2 ], Task_2, 0 );
+ directive_failed( status, "rtems_task_start of TA2" );
+
+ puts( "TA1 - rtems_task_wake_after - yield processor - RTEMS_SUCCESSFUL" );
+ status = rtems_task_wake_after( RTEMS_YIELD_PROCESSOR );
+ directive_failed( status, "rtems_task_wake_after (yield)" );
+
+ puts( "TA1 - rtems_semaphore_delete - delete sem 1 - RTEMS_SUCCESSFUL" );
+ status = rtems_semaphore_delete( Semaphore_id[ 1 ] );
+ directive_failed( status, "rtems_semaphore_delete of SM1" );
+
+ puts( "TA1 - rtems_semaphore_obtain - binary semaphore" );
+ status = rtems_semaphore_obtain(
+ Semaphore_id[ 2 ],
+ RTEMS_DEFAULT_OPTIONS,
+ RTEMS_NO_TIMEOUT
+ );
+ directive_failed( status, "rtems_semaphore_obtain");
+
+ puts( "TA1 - rtems_semaphore_delete - delete sem 2 - RTEMS_RESOURCE_IN_USE" );
+ status = rtems_semaphore_delete( Semaphore_id[ 2 ] );
+ fatal_directive_status(
+ status,
+ RTEMS_RESOURCE_IN_USE,
+ "rtems_semaphore_delete of SM2"
+ );
+
+ puts( "TA1 - rtems_task_wake_after - yield processor - RTEMS_SUCCESSFUL" );
+ status = rtems_task_wake_after( RTEMS_YIELD_PROCESSOR );
+ directive_failed( status, "rtems_task_wake_after (yield)" );
+
+ status = rtems_task_delete( Task_id[ 2 ] );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_task_delete after the task has been deleted"
+ );
+}
diff --git a/testsuites/sptests/sp09/screen07.c b/testsuites/sptests/sp09/screen07.c
new file mode 100644
index 0000000000..fd808f833d
--- /dev/null
+++ b/testsuites/sptests/sp09/screen07.c
@@ -0,0 +1,184 @@
+/* Screen7
+ *
+ * This routine generates error screen 7 for test 9.
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+void Screen7()
+{
+ long buffer[ 4 ];
+ rtems_unsigned32 count;
+ rtems_status_code status;
+
+ status = rtems_message_queue_broadcast( 100, (long (*)[4]) buffer, &count );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_message_queue_broadcast with illegal id"
+ );
+ puts( "TA1 - rtems_message_queue_broadcast - RTEMS_INVALID_ID" );
+
+ status = rtems_message_queue_create(
+ 0,
+ 3,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Junk_id
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_NAME,
+ "rtems_message_queue_create with illegal name"
+ );
+
+ puts( "TA1 - rtems_message_queue_create - Q 1 - RTEMS_INVALID_NAME" );
+ status = rtems_message_queue_create(
+ Queue_name[ 1 ],
+ 1,
+ RTEMS_GLOBAL,
+ &Junk_id
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_MP_NOT_CONFIGURED,
+ "rtems_message_queue_create of mp not configured"
+ );
+ puts( "TA1 - rtems_message_queue_create - Q 1 - RTEMS_MP_NOT_CONFIGURED" );
+
+ status = rtems_message_queue_create(
+ Queue_name[ 1 ],
+ 2,
+ RTEMS_LIMIT,
+ &Queue_id[ 1 ]
+ );
+ directive_failed( status, "rtems_message_queue_create successful" );
+ puts(
+ "TA1 - rtems_message_queue_create - Q 1 - RTEMS_LIMIT - RTEMS_SUCCESSFUL"
+ );
+
+ status = rtems_message_queue_create(
+ Queue_name[ 2 ],
+ 1,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Junk_id
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_TOO_MANY,
+ "rtems_message_queue_create of too many"
+ );
+ puts( "TA1 - rtems_message_queue_create - Q 2 - RTEMS_TOO_MANY" );
+
+ status = rtems_message_queue_delete( 100 );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_message_queue_create with illegal id"
+ );
+ puts( "TA1 - rtems_message_queue_delete - unknown RTEMS_INVALID_ID" );
+
+ status = rtems_message_queue_delete( 0x10100 );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_message_queue_delete with local illegal id"
+ );
+ puts( "TA1 - rtems_message_queue_delete - local RTEMS_INVALID_ID" );
+
+ status = rtems_message_queue_ident( 100, RTEMS_SEARCH_ALL_NODES, &Junk_id );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_NAME,
+ "rtems_message_queue_ident with illegal name"
+ );
+ puts( "TA1 - rtems_message_queue_ident - RTEMS_INVALID_NAME" );
+
+ status = rtems_message_queue_flush( 100, &count );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_message_queue_flush with illegal id"
+ );
+ puts( "TA1 - rtems_message_queue_flush - RTEMS_INVALID_ID" );
+
+ status = rtems_message_queue_receive(
+ 100,
+ (long (*)[4]) buffer,
+ RTEMS_DEFAULT_OPTIONS,
+ 0
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_message_queue_receive wit illegal id"
+ );
+ puts( "TA1 - rtems_message_queue_receive - RTEMS_INVALID_ID" );
+
+ status = rtems_message_queue_receive(
+ Queue_id[ 1 ],
+ (long (*)[4]) buffer,
+ RTEMS_NO_WAIT,
+ RTEMS_NO_TIMEOUT
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_UNSATISFIED,
+ "rtems_message_queue_receive unsatisfied"
+ );
+ puts( "TA1 - rtems_message_queue_receive - Q 1 - RTEMS_UNSATISFIED" );
+
+ puts( "TA1 - rtems_message_queue_receive - Q 1 - timeout in 3 seconds" );
+ status = rtems_message_queue_receive(
+ Queue_id[ 1 ],
+ (long (*)[4]) buffer,
+ RTEMS_DEFAULT_OPTIONS,
+ 3 * TICKS_PER_SECOND
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_TIMEOUT,
+ "rtems_message_queue_receive 3 second timeout"
+ );
+
+ puts(
+ "TA1 - rtems_message_queue_receive - Q 1 - woke up with RTEMS_TIMEOUT"
+ );
+
+ status = rtems_message_queue_send( 100, (long (*)[4]) buffer );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_message_queue_send with illegal id"
+ );
+ puts( "TA1 - rtems_message_queue_send - RTEMS_INVALID_ID" );
+
+ status = rtems_message_queue_send( Queue_id[ 1 ], (long (*)[4]) buffer );
+ directive_failed( status, "rtems_message_queue_send" );
+ puts( "TA1 - rtems_message_queue_send - BUFFER 1 TO Q 1 - RTEMS_SUCCESSFUL" );
+
+ status = rtems_message_queue_send( Queue_id[ 1 ], (long (*)[4]) buffer );
+ directive_failed( status, "rtems_message_queue_send" );
+ puts( "TA1 - rtems_message_queue_send - BUFFER 2 TO Q 1 - RTEMS_SUCCESSFUL" );
+
+ status = rtems_message_queue_send( Queue_id[ 1 ], (long (*)[4]) buffer );
+ fatal_directive_status(
+ status,
+ RTEMS_TOO_MANY,
+ "rtems_message_queue_send too many to a limited queue"
+ );
+ puts( "TA1 - rtems_message_queue_send - BUFFER 3 TO Q 1 - RTEMS_TOO_MANY" );
+}
diff --git a/testsuites/sptests/sp09/screen08.c b/testsuites/sptests/sp09/screen08.c
new file mode 100644
index 0000000000..18c9b8d2d8
--- /dev/null
+++ b/testsuites/sptests/sp09/screen08.c
@@ -0,0 +1,121 @@
+/* Screen8
+ *
+ * This routine generates error screen 8 for test 9.
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+void Screen8()
+{
+ long buffer[ 4 ];
+ rtems_status_code status;
+
+ status = rtems_message_queue_delete( Queue_id[ 1 ] );
+ directive_failed( status, "rtems_message_queue_delete successful" );
+ puts( "TA1 - rtems_message_queue_delete - Q 1 - RTEMS_SUCCESSFUL" );
+
+ status = rtems_message_queue_create(
+ Queue_name[ 1 ],
+ 2,
+ RTEMS_LIMIT,
+ &Queue_id[ 1 ]
+ );
+ directive_failed( status, "rtems_message_queue_create successful" );
+ puts(
+ "TA1 - rtems_message_queue_create - Q 1 - RTEMS_LIMIT - RTEMS_SUCCESSFUL"
+ );
+
+ status = rtems_message_queue_send( Queue_id[ 1 ], (long (*)[4])buffer );
+ directive_failed( status, "rtems_message_queue_send successful" );
+ puts( "TA1 - rtems_message_queue_send - BUFFER 1 TO Q 1 - RTEMS_SUCCESSFUL" );
+
+ status = rtems_message_queue_send( Queue_id[ 1 ], (long (*)[4])buffer );
+ directive_failed( status, "rtems_message_queue_send successful" );
+ puts( "TA1 - rtems_message_queue_send - BUFFER 2 TO Q 1 - RTEMS_SUCCESSFUL" );
+
+ status = rtems_message_queue_send( Queue_id[ 1 ], (long (*)[4])buffer );
+ fatal_directive_status(
+ status,
+ RTEMS_TOO_MANY,
+ "rtems_message_queue_send too many to limited queue"
+ );
+ puts( "TA1 - rtems_message_queue_send - BUFFER 3 TO Q 1 - RTEMS_TOO_MANY" );
+
+ status = rtems_message_queue_delete( Queue_id[ 1 ] );
+ directive_failed( status, "rtems_message_queue_delete successful" );
+ puts( "TA1 - rtems_message_queue_delete - Q 1 - RTEMS_SUCCESSFUL" );
+
+ status = rtems_message_queue_create(
+ Queue_name[ 1 ],
+ 3,
+ RTEMS_LIMIT,
+ &Queue_id[ 1 ]
+ );
+ directive_failed( status, "rtems_message_queue_create successful" );
+ puts(
+ "TA1 - rtems_message_queue_create - Q 1 - RTEMS_LIMIT - RTEMS_SUCCESSFUL"
+ );
+
+ status = rtems_message_queue_send( Queue_id[ 1 ], (long (*)[4])buffer );
+ directive_failed( status, "rtems_message_queue_send successful" );
+ puts( "TA1 - rtems_message_queue_send - BUFFER 1 TO Q 1 - RTEMS_SUCCESSFUL" );
+
+ status = rtems_message_queue_send( Queue_id[ 1 ], (long (*)[4])buffer );
+ directive_failed( status, "rtems_message_queue_send successful" );
+ puts( "TA1 - rtems_message_queue_send - BUFFER 2 TO Q 1 - RTEMS_SUCCESSFUL" );
+
+ status = rtems_message_queue_send( Queue_id[ 1 ], (long (*)[4])buffer );
+ fatal_directive_status(
+ status,
+ RTEMS_UNSATISFIED,
+ "rtems_message_queue_send too many to limited queue"
+ );
+ puts(
+ "TA1 - rtems_message_queue_send - BUFFER 3 TO Q 1 - RTEMS_UNSATISFIED"
+ );
+
+ status = rtems_message_queue_delete( Queue_id[ 1 ] );
+ directive_failed( status, "rtems_message_queue_delete successful" );
+ puts( "TA1 - rtems_message_queue_delete - Q 1 - RTEMS_SUCCESSFUL" );
+
+ status = rtems_message_queue_create(
+ Queue_name[ 1 ],
+ 3,
+ RTEMS_LIMIT,
+ &Queue_id[ 1 ]
+ );
+ directive_failed( status, "rtems_message_queue_create successful" );
+ puts(
+ "TA1 - rtems_message_queue_create - Q 1 - RTEMS_LIMIT - RTEMS_SUCCESSFUL"
+ );
+
+ puts( "TA1 - rtems_task_start - start TA3 - RTEMS_SUCCESSFUL" );
+ status = rtems_task_start( Task_id[ 3 ], Task_3, 0 );
+ directive_failed( status, "rtems_task_start of TA3" );
+
+ puts( "TA1 - rtems_task_wake_after - yield processor - RTEMS_SUCCESSFUL" );
+ status = rtems_task_wake_after( RTEMS_YIELD_PROCESSOR );
+ directive_failed( status, "rtems_task_wake_after (yield)" );
+
+ puts( "TA1 - rtems_message_queue_delete - delete Q 1 - RTEMS_SUCCESSFUL" );
+ status = rtems_message_queue_delete( Queue_id[ 1 ] );
+ directive_failed( status, "rtems_message_queue_delete successful" );
+
+ puts( "TA1 - rtems_task_wake_after - yield processor - RTEMS_SUCCESSFUL" );
+ status = rtems_task_wake_after( RTEMS_YIELD_PROCESSOR );
+ directive_failed( status, "rtems_task_wake_after (yield)" );
+}
diff --git a/testsuites/sptests/sp09/screen09.c b/testsuites/sptests/sp09/screen09.c
new file mode 100644
index 0000000000..5c6eece679
--- /dev/null
+++ b/testsuites/sptests/sp09/screen09.c
@@ -0,0 +1,140 @@
+/* Screen9
+ *
+ * This routine generates error screen 9 for test 9.
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+void Screen9()
+{
+ void *converted;
+ rtems_status_code status;
+ rtems_isr_entry old_service_routine;
+
+ status = rtems_interrupt_catch( Service_routine, 500, &old_service_routine );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_NUMBER,
+ "rtems_interrupt_catch with invalid vector"
+ );
+ puts( "TA1 - rtems_interrupt_catch - RTEMS_INVALID_NUMBER" );
+
+ status = rtems_interrupt_catch( NULL, 3, &old_service_routine );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ADDRESS,
+ "rtems_interrupt_catch with invalid handler"
+ );
+ puts( "TA1 - rtems_interrupt_catch - RTEMS_INVALID_ADDRESS" );
+
+ status = rtems_signal_send( 100, RTEMS_SIGNAL_1 );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_signal_send with illegal id"
+ );
+ puts( "TA1 - rtems_signal_send - RTEMS_INVALID_ID" );
+
+ status = rtems_signal_send( RTEMS_SELF, RTEMS_SIGNAL_16 );
+ fatal_directive_status(
+ status,
+ RTEMS_NOT_DEFINED,
+ "rtems_signal_send with no handler"
+ );
+ puts( "TA1 - rtems_signal_send - RTEMS_NOT_DEFINED" );
+
+ status = rtems_port_create(
+ 0,
+ Internal_port_area,
+ External_port_area,
+ sizeof( Internal_port_area ),
+ &Junk_id
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_NAME,
+ "rtems_port_create with illegal name"
+ );
+ puts( "TA1 - rtems_port_create - RTEMS_INVALID_NAME" );
+
+ status = rtems_port_create(
+ Port_name[ 1 ],
+ &((char *)Internal_port_area)[ 1 ],
+ External_port_area,
+ sizeof( Internal_port_area ),
+ &Junk_id
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ADDRESS,
+ "rtems_port_create with illegal address"
+ );
+ puts( "TA1 - rtems_port_create - RTEMS_INVALID_ADDRESS" );
+
+ status = rtems_port_create(
+ Port_name[ 1 ],
+ Internal_port_area,
+ External_port_area,
+ sizeof( Internal_port_area ),
+ &Junk_id
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_TOO_MANY,
+ "rtems_port_create of too many"
+ );
+ puts( "TA1 - rtems_port_create - RTEMS_TOO_MANY" );
+
+ status = rtems_port_delete( 0 );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_port_delete with illegal id"
+ );
+ puts( "TA1 - rtems_port_delete - RTEMS_INVALID_ID" );
+
+ status = rtems_port_ident( 0, &Junk_id );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_NAME,
+ "rtems_port_ident with illegal name"
+ );
+ puts( "TA1 - rtems_port_ident - RTEMS_INVALID_NAME" );
+
+ status = rtems_port_external_to_internal(
+ 100,
+ Internal_port_area,
+ &converted
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_port_external_to_internal with illegal id"
+ );
+ puts( "TA1 - rtems_port_external_to_internal - RTEMS_INVALID_ID" );
+ status = rtems_port_internal_to_external(
+ 100,
+ Internal_port_area,
+ &converted
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_port_internal_to_external with illegal id"
+ );
+ puts( "TA1 - rtems_port_internal_to_external - RTEMS_INVALID_ID" );
+}
diff --git a/testsuites/sptests/sp09/screen10.c b/testsuites/sptests/sp09/screen10.c
new file mode 100644
index 0000000000..53a5a8d6dc
--- /dev/null
+++ b/testsuites/sptests/sp09/screen10.c
@@ -0,0 +1,164 @@
+/* Screen10
+ *
+ * This routine generates error screen 10 for test 9.
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+void Screen10()
+{
+ rtems_status_code status;
+
+ status = rtems_rate_monotonic_create( 0, &Junk_id );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_NAME,
+ "rtems_rate_monotonic_create with illegal name"
+ );
+ puts( "TA1 - rtems_rate_monotonic_create - RTEMS_INVALID_NAME" );
+
+ status = rtems_rate_monotonic_create( Period_name[ 1 ], &Period_id[ 1 ] );
+ directive_failed( status, "rtems_rate_monotonic_create successful" );
+ puts( "TA1 - rtems_rate_monotonic_create - RTEMS_SUCCESSFUL" );
+
+ status = rtems_rate_monotonic_create( Period_name[ 1 ], &Junk_id );
+ fatal_directive_status(
+ status,
+ RTEMS_TOO_MANY,
+ "rtems_rate_monotonic_create of too many"
+ );
+ puts( "TA1 - rtems_rate_monotonic_create - RTEMS_TOO_MANY" );
+
+ status = rtems_rate_monotonic_ident( 0, &Junk_id );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_NAME,
+ "rtems_rate_monotonic_ident with illegal name"
+ );
+ puts( "TA1 - rtems_rate_monotonic_ident - RTEMS_INVALID_NAME" );
+
+ status = rtems_rate_monotonic_period( 100, 5 );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_rate_monotonic_period with illegal id"
+ );
+ puts( "TA1 - rtems_rate_monotonic_period - unknown RTEMS_INVALID_ID" );
+
+ status = rtems_rate_monotonic_period( 0x10100, 5 );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_rate_monotonic_period with illegal id"
+ );
+ puts( "TA1 - rtems_rate_monotonic_period - local RTEMS_INVALID_ID" );
+
+ status = rtems_rate_monotonic_period( Period_id[ 1 ], RTEMS_PERIOD_STATUS );
+ fatal_directive_status(
+ status,
+ RTEMS_NOT_DEFINED,
+ "rtems_rate_monotonic_period status not defined"
+ );
+ puts(
+ "TA1 - rtems_rate_monotonic_period(RTEMS_PERIOD_STATUS) - RTEMS_NOT_DEFINED"
+ );
+
+ status = rtems_rate_monotonic_period( Period_id[ 1 ], 100 );
+ directive_failed( status, "rtems_rate_monotonic_period successful" );
+ puts( "TA1 - rtems_rate_monotonic_period - 100 ticks - RTEMS_SUCCESSFUL" );
+
+ status = rtems_rate_monotonic_period( Period_id[ 1 ], RTEMS_PERIOD_STATUS );
+ directive_failed( status, "rtems_rate_monotonic_period status" );
+ puts(
+ "TA1 - rtems_rate_monotonic_period(RTEMS_PERIOD_STATUS) - RTEMS_SUCCESSFUL"
+ );
+
+ while ( FOREVER ) {
+
+ status = rtems_rate_monotonic_period(Period_id[ 1 ], RTEMS_PERIOD_STATUS);
+
+ if ( status == RTEMS_TIMEOUT ) break;
+
+ directive_failed(
+ status,
+ "rtems_rate_monotonic_period waiting for timeout"
+ );
+ }
+ puts(
+ "TA1 - rtems_rate_monotonic_period(RTEMS_PERIOD_STATUS) - RTEMS_TIMEOUT"
+ );
+
+ status = rtems_rate_monotonic_cancel( 100 );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_rate_monotonic_cancel with illegal id"
+ );
+ puts( "TA1 - rtems_rate_monotonic_cancel - unknown RTEMS_INVALID_ID" );
+
+ status = rtems_rate_monotonic_cancel( 0x10100 );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_rate_monotonic_cancel will illegal id"
+ );
+ puts( "TA1 - rtems_rate_monotonic_cancel - local RTEMS_INVALID_ID" );
+
+ status = rtems_rate_monotonic_cancel( Period_id[ 1 ] );
+ directive_failed( status, "rtems_rate_monotonic_cancel" );
+ puts( "TA1 - rtems_rate_monotonic_cancel - RTEMS_SUCCESSFUL" );
+
+ status = rtems_rate_monotonic_period( Period_id[ 1 ], 5 );
+ directive_failed( status, "rtems_rate_monotonic_period restart" );
+
+ status = rtems_task_wake_after( 1 * TICKS_PER_SECOND );
+ directive_failed( status, "rtems_task_wake_after" );
+
+ status = rtems_rate_monotonic_period( Period_id[ 1 ], 5 );
+ fatal_directive_status(
+ status,
+ RTEMS_TIMEOUT,
+ "rtems_rate_monotonic_period"
+ );
+ puts( "TA1 - rtems_rate_monotonic_period - 5 ticks - RTEMS_TIMEOUT" );
+
+ status = rtems_task_start( Task_id[ 4 ], Task_4, 0 );
+ directive_failed( status, "rtems_task_start of TA4" );
+
+ puts( "TA1 - yielding to TA4" );
+ status = rtems_task_wake_after( RTEMS_YIELD_PROCESSOR );
+
+ status = rtems_rate_monotonic_delete( 100 );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_rate_monotonic_delete with illegal id"
+ );
+ puts( "TA1 - rtems_rate_monotonic_delete - unknown RTEMS_INVALID_ID" );
+
+ status = rtems_rate_monotonic_delete( 0x10100 );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_rate_monotonic_delete with illegal id"
+ );
+ puts( "TA1 - rtems_rate_monotonic_delete - local RTEMS_INVALID_ID" );
+
+ status = rtems_rate_monotonic_delete( Period_id[ 1 ] );
+ directive_failed( status, "rtems_rate_monotonic_delete" );
+ puts( "TA1 - rtems_rate_monotonic_delete - RTEMS_SUCCESSFUL" );
+}
diff --git a/testsuites/sptests/sp09/screen11.c b/testsuites/sptests/sp09/screen11.c
new file mode 100644
index 0000000000..8c13cd2490
--- /dev/null
+++ b/testsuites/sptests/sp09/screen11.c
@@ -0,0 +1,250 @@
+/* Screen11
+ *
+ * This routine generates error screen 11 for test 9.
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+void Screen11()
+{
+ void *buffer_address_1;
+ void *buffer_address_2;
+ void *buffer_address_3;
+ rtems_status_code status;
+
+ status = rtems_partition_create(
+ 0,
+ Partition_good_area,
+ 128,
+ 40,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Junk_id
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_NAME,
+ "rtems_partition_create with illegal name"
+ );
+ puts( "TA1 - rtems_partition_create - RTEMS_INVALID_NAME" );
+
+ status = rtems_partition_create(
+ Partition_name[ 1 ],
+ Partition_good_area,
+ 0,
+ 80,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Junk_id
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_SIZE,
+ "rtems_partition_create with illegal length"
+ );
+ puts( "TA1 - rtems_partition_create - length - RTEMS_INVALID_SIZE" );
+
+ status = rtems_partition_create(
+ Partition_name[ 1 ],
+ Partition_good_area,
+ 128,
+ 0,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Junk_id
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_SIZE,
+ "rtems_partition_create with illegal buffer size"
+ );
+ puts( "TA1 - rtems_partition_create - buffer size - RTEMS_INVALID_SIZE" );
+
+ status = rtems_partition_create(
+ Partition_name[ 1 ],
+ Partition_good_area,
+ 128,
+ 256,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Junk_id
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_SIZE,
+ "rtems_partition_create with buffer_size > length"
+ );
+ puts(
+ "TA1 - rtems_partition_create - length < buffer size - RTEMS_INVALID_SIZE"
+ );
+
+ status = rtems_partition_create(
+ Partition_name[ 1 ],
+ Partition_good_area,
+ 128,
+ 64,
+ RTEMS_GLOBAL,
+ &Junk_id
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_MP_NOT_CONFIGURED,
+ "rtems_partition_create of global"
+ );
+ puts( "TA1 - rtems_partition_create - RTEMS_MP_NOT_CONFIGURED" );
+
+ status = rtems_partition_create(
+ Partition_name[ 1 ],
+ Partition_bad_area,
+ 128,
+ 64,
+ RTEMS_GLOBAL,
+ &Junk_id
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ADDRESS,
+ "rtems_partition_create with bad address"
+ );
+ puts( "TA1 - rtems_partition_create - RTEMS_INVALID_ADDRESS" );
+
+ status = rtems_partition_create(
+ Partition_name[ 1 ],
+ Partition_good_area,
+ 128,
+ 34,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Junk_id
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_SIZE,
+ "rtems_partition_create with unaligned buffer_size"
+ );
+ puts( "TA1 - rtems_partition_create - RTEMS_INVALID_SIZE" );
+
+ status = rtems_partition_delete( 100 );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_partition_delete with illegal id"
+ );
+ puts( "TA1 - rtems_partition_delete - unknown RTEMS_INVALID_ID" );
+
+ status = rtems_partition_delete( 0x10100 );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_partition_delete with illegal id"
+ );
+ puts( "TA1 - rtems_partition_delete - local RTEMS_INVALID_ID" );
+
+ status = rtems_partition_get_buffer( 100, &buffer_address_1 );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_partition_get_buffer with illegal id"
+ );
+ puts( "TA1 - rtems_partition_get_buffer - RTEMS_INVALID_ID" );
+
+ status = rtems_partition_ident( 0, RTEMS_SEARCH_ALL_NODES, &Junk_id );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_NAME,
+ "rtems_partition_ident with illegal name"
+ );
+ puts( "TA1 - rtems_partition_ident - RTEMS_INVALID_NAME" );
+
+ status = rtems_partition_return_buffer( 100, buffer_address_1 );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_partition_return_buffer with illegal id"
+ );
+ puts( "TA1 - rtems_partition_return_buffer - RTEMS_INVALID_ID" );
+
+ status = rtems_partition_create(
+ Partition_name[ 1 ],
+ Partition_good_area,
+ 128,
+ 64,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Partition_id[ 1 ]
+ );
+ directive_failed( status, "rtems_partition_create" );
+ puts( "TA1 - rtems_partition_create - RTEMS_SUCCESSFUL" );
+
+ status = rtems_partition_create(
+ Partition_name[ 1 ],
+ Partition_good_area,
+ 128,
+ 32,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Junk_id
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_TOO_MANY,
+ "rtems_partition_create of too many"
+ );
+ puts( "TA1 - rtems_partition_create - RTEMS_TOO_MANY" );
+
+ status = rtems_partition_get_buffer( Partition_id[ 1 ], &buffer_address_1 );
+ directive_failed( status, "rtems_partition_get_buffer");
+ puts( "TA1 - rtems_partition_get_buffer - RTEMS_SUCCESSFUL" );
+
+ status = rtems_partition_get_buffer( Partition_id[ 1 ], &buffer_address_2 );
+ directive_failed( status, "rtems_partition_get_buffer" );
+ puts( "TA1 - rtems_partition_get_buffer - RTEMS_SUCCESSFUL" );
+
+ status = rtems_partition_get_buffer( Partition_id[ 1 ], &buffer_address_3 );
+ fatal_directive_status(
+ status,
+ RTEMS_UNSATISFIED,
+ "rtems_partition_get_buffer unsatisfied"
+ );
+ puts( "TA1 - rtems_partition_get_buffer - RTEMS_UNSATISFIED" );
+
+ status = rtems_partition_delete( Partition_id[ 1 ] );
+ fatal_directive_status(
+ status,
+ RTEMS_RESOURCE_IN_USE,
+ "rtems_partition_delete with buffers in use"
+ );
+ puts( "TA1 - rtems_partition_delete - RTEMS_RESOURCE_IN_USE" );
+
+ status = rtems_partition_return_buffer(
+ Partition_id[ 1 ],
+ Region_good_area /* NOTE: Region Memory */
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ADDRESS,
+ "rtems_partition_return_buffer with buffer address out of partition"
+ );
+ puts(
+ "TA1 - rtems_partition_return_buffer - RTEMS_INVALID_ADDRESS - out of range"
+ );
+
+ status = rtems_partition_return_buffer(
+ Partition_id[ 1 ],
+ &Partition_good_area[ 7 ]
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ADDRESS,
+ "rtems_partition_return_buffer with buffer address not on boundary"
+ );
+ puts_nocr( "TA1 - rtems_partition_return_buffer - " );
+ puts ( "RTEMS_INVALID_ADDRESS - not on boundary");
+}
diff --git a/testsuites/sptests/sp09/screen12.c b/testsuites/sptests/sp09/screen12.c
new file mode 100644
index 0000000000..300d54043a
--- /dev/null
+++ b/testsuites/sptests/sp09/screen12.c
@@ -0,0 +1,327 @@
+/* Screen12
+ *
+ * This routine generates error screen 12 for test 9.
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+void Screen12()
+{
+ void *segment_address_1;
+ void *segment_address_2;
+ void *segment_address_3;
+ rtems_unsigned32 offset;
+ rtems_unsigned32 good_front_flag;
+ rtems_unsigned32 good_back_flag;
+ rtems_status_code status;
+
+ status = rtems_region_create(
+ 0,
+ Region_good_area,
+ 128,
+ 32,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Junk_id
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_NAME,
+ "rtems_region_create with illegal name"
+ );
+ puts( "TA1 - rtems_region_create - RTEMS_INVALID_NAME" );
+
+ status = rtems_region_create(
+ Region_name[ 1 ],
+ Region_bad_area,
+ 128,
+ 32,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Junk_id
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ADDRESS,
+ "rtems_region_create with illegal address"
+ );
+ puts( "TA1 - rtems_region_create - RTEMS_INVALID_ADDRESS" );
+
+ status = rtems_region_create(
+ Region_name[ 1 ],
+ Region_good_area,
+ 128,
+ 34,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Junk_id
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_SIZE,
+ "rtems_region_create with illegal size"
+ );
+ puts( "TA1 - rtems_region_create - RTEMS_INVALID_SIZE" );
+
+ status = rtems_region_create(
+ Region_name[ 1 ],
+ &Region_good_area[ REGION_START_OFFSET ],
+ REGION_LENGTH,
+ 128,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Region_id[ 1 ]
+ );
+ directive_failed( status, "rtems_region_create" );
+ puts( "TA1 - rtems_region_create - RTEMS_SUCCESSFUL" );
+
+ status = rtems_region_create(
+ Region_name[ 1 ],
+ Region_good_area,
+ 512,
+ 128,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Junk_id
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_TOO_MANY,
+ "rtems_region_create of too many"
+ );
+ puts( "TA1 - rtems_region_create - RTEMS_TOO_MANY" );
+
+ status = rtems_region_delete( 100 );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_region_delete with illegal id"
+ );
+ puts( "TA1 - rtems_region_delete - unknown RTEMS_INVALID_ID" );
+
+ status = rtems_region_delete( 0x10100 );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_region_delete with illegal id"
+ );
+ puts( "TA1 - rtems_region_delete - local RTEMS_INVALID_ID" );
+
+ status = rtems_region_ident( 0, &Junk_id );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_NAME,
+ "rtems_region_ident with illegal name"
+ );
+ puts( "TA1 - rtems_region_ident - RTEMS_INVALID_NAME" );
+
+ status = rtems_region_get_segment(
+ 100,
+ 128,
+ RTEMS_DEFAULT_OPTIONS,
+ RTEMS_NO_TIMEOUT,
+ &segment_address_1
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_region_get_segment with illegal id"
+ );
+ puts( "TA1 - rtems_region_get_segment - RTEMS_INVALID_ID" );
+
+ status = rtems_region_get_segment(
+ Region_id[ 1 ],
+ sizeof( Region_good_area ) * 2,
+ RTEMS_DEFAULT_OPTIONS,
+ RTEMS_NO_TIMEOUT,
+ &segment_address_1
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_SIZE,
+ "rtems_region_get_segment with illegal size"
+ );
+ puts( "TA1 - rtems_region_get_segment - RTEMS_INVALID_SIZE" );
+
+ status = rtems_region_get_segment(
+ Region_id[ 1 ],
+ 384,
+ RTEMS_DEFAULT_OPTIONS,
+ RTEMS_NO_TIMEOUT,
+ &segment_address_1
+ );
+ directive_failed( status, "rtems_region_get_segment" );
+ puts( "TA1 - rtems_region_get_segment - RTEMS_SUCCESSFUL" );
+
+ status = rtems_region_get_segment(
+ Region_id[ 1 ],
+ 384,
+ RTEMS_NO_WAIT,
+ RTEMS_NO_TIMEOUT,
+ &segment_address_2
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_UNSATISFIED,
+ "rtems_region_get_segment unsatisfied"
+ );
+ puts( "TA1 - rtems_region_get_segment - RTEMS_UNSATISFIED" );
+
+ puts( "TA1 - rtems_region_get_segment - timeout in 3 seconds" );
+ status = rtems_region_get_segment(
+ Region_id[ 1 ],
+ 128,
+ RTEMS_DEFAULT_OPTIONS,
+ 3 * TICKS_PER_SECOND,
+ &segment_address_3
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_TIMEOUT,
+ "rtems_region_get_segment timeout"
+ );
+ puts( "TA1 - rtems_region_get_segment - woke up with RTEMS_TIMEOUT" );
+
+ status = rtems_region_delete( Region_id[ 1 ] );
+ fatal_directive_status(
+ status,
+ RTEMS_RESOURCE_IN_USE,
+ "rtems_region_delete with buffers in use"
+ );
+ puts( "TA1 - rtems_region_delete - RTEMS_RESOURCE_IN_USE" );
+
+ status = rtems_region_return_segment( 100, segment_address_1 );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_region_return_segment with illegal id"
+ );
+ puts( "TA1 - rtems_region_return_segment - RTEMS_INVALID_ID" );
+
+ status = rtems_region_return_segment( Region_id[ 1 ], Region_good_area );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ADDRESS,
+ "rtems_region_return_segment with illegal segment"
+ );
+ puts( "TA1 - rtems_region_return_segment - RTEMS_INVALID_ADDRESS" );
+
+/*
+ * The following generate internal heap errors. Thus this code
+ * is subject to change if the heap code changes.
+ */
+
+ puts( "TA1 - rtems_debug_disable - RTEMS_DEBUG_REGION" );
+ rtems_debug_disable( RTEMS_DEBUG_REGION );
+
+ offset = (segment_address_1 - (void *)Region_good_area) / 4;
+
+/* bad FRONT_FLAG error */
+
+ good_front_flag = Region_good_area[ offset - 1 ];
+ Region_good_area[ offset - 1 ] = good_front_flag + 2;
+
+ status = rtems_region_return_segment( Region_id[ 1 ], segment_address_1 );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ADDRESS,
+ "rtems_region_return_segment with back_flag != front_flag"
+ );
+ puts( "TA1 - rtems_region_return_segment - RTEMS_INVALID_ADDRESS" );
+
+ Region_good_area[ offset - 1 ] = good_front_flag;
+
+/* bad FRONT_FLAG error */
+
+ good_back_flag = Region_good_area[ offset - 2 ];
+ Region_good_area[ offset - 2 ] = 1024;
+
+ status = rtems_region_return_segment( Region_id[ 1 ], segment_address_1 );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ADDRESS,
+ "rtems_region_return_segment with back_flag != front_flag"
+ );
+ puts( "TA1 - rtems_region_return_segment - RTEMS_INVALID_ADDRESS" );
+
+ Region_good_area[ offset - 2 ] = good_back_flag;
+
+ puts( "TA1 - rtems_debug_enable - RTEMS_DEBUG_REGION" );
+ rtems_debug_enable( RTEMS_DEBUG_REGION );
+
+ status = rtems_region_extend(
+ 100,
+ Region_good_area,
+ 128
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_region_extend with illegal id"
+ );
+ puts( "TA1 - rtems_region_extend - RTEMS_INVALID_ID" );
+
+ status = rtems_region_extend(
+ Region_id[ 1 ],
+ &Region_good_area[ REGION_START_OFFSET + 16 ],
+ 128
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ADDRESS,
+ "rtems_region_extend with illegal starting address"
+ );
+ puts( "TA1 - rtems_region_extend - within heap - RTEMS_INVALID_ADDRESS" );
+
+ status = rtems_region_extend(
+ Region_id[ 1 ],
+ Region_bad_area,
+ 128
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_NOT_IMPLEMENTED,
+ "rtems_region_extend with unsupported starting address"
+ );
+ puts(
+ "TA1 - rtems_region_extend - non-contiguous lower - RTEMS_NOT_IMPLEMENTED"
+ );
+
+ status = rtems_region_extend(
+ Region_id[ 1 ],
+ &Region_good_area[ REGION_START_OFFSET - REGION_LENGTH ],
+ 128
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_NOT_IMPLEMENTED,
+ "rtems_region_extend with unsupported starting address"
+ );
+ puts(
+ "TA1 - rtems_region_extend - contiguous lower - RTEMS_NOT_IMPLEMENTED"
+ );
+
+ status = rtems_region_extend(
+ Region_id[ 1 ],
+ &Region_good_area[ REGION_START_OFFSET + REGION_LENGTH + 16 ],
+ 128
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_NOT_IMPLEMENTED,
+ "rtems_region_extend with unsupported starting address"
+ );
+ puts(
+ "TA1 - rtems_region_extend - non-contiguous higher - RTEMS_NOT_IMPLEMENTED"
+ );
+
+}
diff --git a/testsuites/sptests/sp09/screen13.c b/testsuites/sptests/sp09/screen13.c
new file mode 100644
index 0000000000..c96adeec40
--- /dev/null
+++ b/testsuites/sptests/sp09/screen13.c
@@ -0,0 +1,115 @@
+/* Screen13
+ *
+ * This routine generates error screen 13 for test 9.
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+void Screen13()
+{
+ rtems_unsigned32 result;
+ rtems_time_of_day time;
+ rtems_status_code status;
+
+ status = rtems_io_close( 0xffff, 0x0000, NULL, &result );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_NUMBER,
+ "rtems_io_close with bad major number"
+ );
+ puts( "TA1 - rtems_io_close - RTEMS_INVALID_NUMBER" );
+ status = rtems_io_control( 0xffff, 0x00000, NULL, &result );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_NUMBER,
+ "rtems_io_close with bad major number"
+ );
+ puts( "TA1 - rtems_io_control - RTEMS_INVALID_NUMBER" );
+ status = rtems_io_initialize( 0xffff, 0x00000, NULL, &result );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_NUMBER,
+ "rtems_io_initialize with bad major number"
+ );
+ puts( "TA1 - rtems_io_initialize - RTEMS_INVALID_NUMBER" );
+ status = rtems_io_open( 0xffff, 0x00000, NULL, &result );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_NUMBER,
+ "rtems_io_open with bad major number"
+ );
+ puts( "TA1 - rtems_io_open - RTEMS_INVALID_NUMBER" );
+ status = rtems_io_read( 0xffff, 0x00000, NULL, &result );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_NUMBER,
+ "rtems_io_read with bad major number"
+ );
+ puts( "TA1 - rtems_io_read - RTEMS_INVALID_NUMBER" );
+ status = rtems_io_write( 0xffff, 0x0ffff, NULL, &result );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_NUMBER,
+ "rtems_io_write with bad major number"
+ );
+ puts( "TA1 - rtems_io_write - RTEMS_INVALID_NUMBER" );
+
+ build_time( &time, 12, 31, 2000, 23, 59, 59, 0 );
+ status = rtems_clock_set( &time );
+ directive_failed( status, "rtems_clock_set" );
+ print_time( "TA1 - rtems_clock_set - ", &time, " - RTEMS_SUCCESSFUL\n" );
+ status = rtems_task_wake_after( 1 * TICKS_PER_SECOND );
+ status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
+ directive_failed( status, "rtems_clock_set" );
+ print_time( "TA1 - rtems_clock_get - ", &time, " - RTEMS_SUCCESSFUL\n" );
+
+ build_time( &time, 12, 31, 1999, 23, 59, 59, 0 );
+ status = rtems_clock_set( &time );
+ directive_failed( status, "rtems_clock_set" );
+ print_time( "TA1 - rtems_clock_set - ", &time, " - RTEMS_SUCCESSFUL\n" );
+ status = rtems_task_wake_after( 1 * TICKS_PER_SECOND );
+ status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
+ directive_failed( status, "rtems_clock_set" );
+ print_time( "TA1 - rtems_clock_get - ", &time, " - RTEMS_SUCCESSFUL\n" );
+
+ build_time( &time, 12, 31, 2100, 23, 59, 59, 0 );
+ status = rtems_clock_set( &time );
+ directive_failed( status, "rtems_clock_set" );
+ print_time( "TA1 - rtems_clock_set - ", &time, " - RTEMS_SUCCESSFUL\n" );
+ status = rtems_task_wake_after( 1 * TICKS_PER_SECOND );
+ status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
+ directive_failed( status, "rtems_clock_set" );
+ print_time( "TA1 - rtems_clock_get - ", &time, " - RTEMS_SUCCESSFUL\n" );
+
+ build_time( &time, 12, 31, 2099, 23, 59, 59, 0 );
+ status = rtems_clock_set( &time );
+ directive_failed( status, "rtems_clock_set" );
+ print_time( "TA1 - rtems_clock_set - ", &time, " - RTEMS_SUCCESSFUL\n" );
+ status = rtems_task_wake_after( 1 * TICKS_PER_SECOND );
+ status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
+ directive_failed( status, "rtems_clock_set" );
+ print_time( "TA1 - rtems_clock_get - ", &time, " - RTEMS_SUCCESSFUL\n" );
+
+ build_time( &time, 12, 31, 1991, 23, 59, 59, 0 );
+ status = rtems_clock_set( &time );
+ directive_failed( status, "rtems_clock_set" );
+ print_time( "TA1 - rtems_clock_set - ", &time, " - RTEMS_SUCCESSFUL\n" );
+ status = rtems_task_wake_after( 1 * TICKS_PER_SECOND );
+ status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
+ directive_failed( status, "rtems_clock_set" );
+ print_time( "TA1 - rtems_clock_get - ", &time, " - RTEMS_SUCCESSFUL\n" );
+}
diff --git a/testsuites/sptests/sp09/screen14.c b/testsuites/sptests/sp09/screen14.c
new file mode 100644
index 0000000000..bf80f04c3c
--- /dev/null
+++ b/testsuites/sptests/sp09/screen14.c
@@ -0,0 +1,162 @@
+/* Screen14
+ *
+ * This routine generates error screen 14 for test 9.
+ *
+ * Input parameters: NONE
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+void Screen14()
+{
+ rtems_status_code status;
+ rtems_time_of_day time;
+
+ status = rtems_timer_create( 0, &Junk_id );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_NAME,
+ "rtems_timer_create with illegal name"
+ );
+ puts( "TA1 - rtems_timer_create - RTEMS_INVALID_NAME" );
+
+ status = rtems_timer_create( Timer_name[ 1 ], &Timer_id[ 1 ] );
+ directive_failed( status, "rtems_timer_create" );
+ puts( "TA1 - rtems_timer_create - 1 - RTEMS_SUCCESSFUL" );
+
+ status = rtems_timer_create( 2, &Junk_id );
+ fatal_directive_status(
+ status,
+ RTEMS_TOO_MANY,
+ "rtems_timer_create for too many"
+ );
+ puts( "TA1 - rtems_timer_create - 2 - RTEMS_TOO_MANY" );
+
+ status = rtems_timer_delete( 100 );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_timer_delete with illegal id"
+ );
+ puts( "TA1 - rtems_timer_delete - local RTEMS_INVALID_ID" );
+
+ status = rtems_timer_delete( 0x010100 );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_timer_delete with illegal id"
+ );
+ puts( "TA1 - rtems_timer_delete - global RTEMS_INVALID_ID" );
+
+ status = rtems_timer_ident( 0, &Junk_id );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_NAME,
+ "rtems_timer_ident with illegal name"
+ );
+ puts( "TA1 - rtems_timer_ident - RTEMS_INVALID_NAME" );
+
+ status = rtems_timer_cancel( 0x010100 );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_timer_cancel with illegal id"
+ );
+ puts( "TA1 - rtems_timer_cancel - RTEMS_INVALID_ID" );
+
+ status = rtems_timer_cancel( Timer_id[ 1 ] );
+ fatal_directive_status(
+ status,
+ RTEMS_INCORRECT_STATE,
+ "rtems_timer_cancel before initiated"
+ );
+ puts( "TA1 - rtems_timer_cancel - RTEMS_INCORRECT_STATE" );
+
+ status = rtems_timer_reset( 0x010100 );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_timer_reset with illegal id"
+ );
+ puts( "TA1 - rtems_timer_reset - RTEMS_INVALID_ID" );
+
+ status = rtems_timer_reset( Timer_id[ 1 ] );
+ fatal_directive_status(
+ status,
+ RTEMS_NOT_DEFINED,
+ "rtems_timer_reset before initiated"
+ );
+ puts( "TA1 - rtems_timer_reset - RTEMS_NOT_DEFINED" );
+
+ status = rtems_timer_fire_after(
+ 0x010100,
+ 5 * TICKS_PER_SECOND,
+ Delayed_routine,
+ NULL
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_timer_fire_after illegal id"
+ );
+ puts( "TA1 - rtems_timer_fire_after - RTEMS_INVALID_ID" );
+
+ build_time( &time, 12, 31, 1994, 9, 0, 0, 0 );
+ status = rtems_timer_fire_when( 0x010100, &time, Delayed_routine, NULL );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_ID,
+ "rtems_timer_fire_when with illegal id"
+ );
+ puts( "TA1 - rtems_timer_fire_when - RTEMS_INVALID_ID" );
+
+ status = rtems_timer_fire_after( Timer_id[ 1 ], 0, Delayed_routine, NULL );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_NUMBER,
+ "rtems_timer_fire_after with 0 ticks"
+ );
+ puts( "TA1 - rtems_timer_fire_after - RTEMS_INVALID_NUMBER" );
+
+ build_time( &time, 2, 5, 1987, 8, 30, 45, 0 );
+ status = rtems_timer_fire_when( Timer_id[ 1 ], &time, Delayed_routine, NULL );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_CLOCK,
+ "rtems_timer_fire_when with illegal time"
+ );
+ print_time(
+ "TA1 - rtems_timer_fire_when - ",
+ &time,
+ " - RTEMS_INVALID_CLOCK\n"
+ );
+
+ status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time );
+ directive_failed( status, "rtems_clock_set" );
+ print_time( "TA1 - rtems_clock_get - ", &time, "\n" );
+
+ build_time( &time, 2, 5, 1990, 8, 30, 45, 0 );
+ status = rtems_timer_fire_when( Timer_id[ 1 ], &time, Delayed_routine, NULL );
+ fatal_directive_status(
+ status,
+ RTEMS_INVALID_CLOCK,
+ "rtems_timer_fire_when before current time"
+ );
+ print_time(
+ "TA1 - rtems_timer_fire_when - ",
+ &time,
+ " - before RTEMS_INVALID_CLOCK\n"
+ );
+}
diff --git a/testsuites/sptests/sp09/sp09.doc b/testsuites/sptests/sp09/sp09.doc
new file mode 100644
index 0000000000..f4e8391c47
--- /dev/null
+++ b/testsuites/sptests/sp09/sp09.doc
@@ -0,0 +1,36 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: test9
+
+directives:
+ ex_init, ex_start, tm_tick, i_return,
+ t_create,t_delete, t_getreg, t_ident, t_restart, t_resume, t_setpri,
+ t_setreg, t_start, t_suspend, tm_delete, tm_get,
+ tm_set, tm_wkafter, tm_wkwhen, ev_receive, ev_send, sm_create, sm_delete,
+ sm_ident, sm_p, sm_v, q_broadcast, q_create, q_delete, q_ident, q_receive,
+ q_send, q_urgent, as_catch, as_send, as_return, rn_create, rn_delete,
+ rn_getseg, rn_ident, rn_retseg, pt_create, pt_delete, pt_getbug, pt_ident,
+ pt_retbuf, de_close, de_cntrl, de_init, de_open, de_read, de_write
+
+concepts:
+
+ a. Verifies all error codes returned by the executive in single
+ processor configurations.
+
+ b. Verifies error conditions in the following kernel routines or macros:
+ _Ck_date_time, _Expired, _Q_submit, _Get_mnodes, _Get_node,
+ _Free_mem, _Get_mem, _Valid_block, _Set_tcb, _Set_resource,
+ _In_range, _On_boundary
diff --git a/testsuites/sptests/sp09/sp09.scn b/testsuites/sptests/sp09/sp09.scn
new file mode 100644
index 0000000000..534fc47e09
--- /dev/null
+++ b/testsuites/sptests/sp09/sp09.scn
@@ -0,0 +1,249 @@
+*** TEST 9 ***
+INIT - rtems_task_create - RTEMS_INVALID_SIZE -- NOT CHECKED
+INIT - rtems_task_create - RTEMS_INVALID_PRIORITY
+INIT - rtems_task_restart - RTEMS_INCORRECT_STATE
+TA1 - rtems_task_delete - RTEMS_INVALID_ID
+TA1 - rtems_task_get_note - RTEMS_INVALID_NUMBER
+TA1 - rtems_task_get_note - RTEMS_INVALID_ID
+TA1 - rtems_task_ident - current task RTEMS_SUCCESSFUL
+TA1 - rtems_task_ident - global RTEMS_INVALID_NAME
+TA1 - rtems_task_ident - local RTEMS_INVALID_NAME
+TA1 - rtems_task_ident - RTEMS_INVALID_NODE
+TA1 - rtems_task_restart - RTEMS_INVALID_ID
+TA1 - rtems_task_resume - RTEMS_INVALID_ID
+TA1 - rtems_task_resume - RTEMS_INCORRECT_STATE
+TA1 - rtems_task_set_priority - RTEMS_INVALID_PRIORITY
+TA1 - rtems_task_set_priority - RTEMS_INVALID_ID
+TA1 - rtems_task_set_note - RTEMS_INVALID_NUMBER
+TA1 - rtems_task_set_note - RTEMS_INVALID_ID
+TA1 - rtems_task_start - RTEMS_INVALID_ID
+TA1 - rtems_task_start - RTEMS_INCORRECT_STATE
+TA1 - rtems_task_suspend - RTEMS_INVALID_ID
+<pause - screen 2>
+TA1 - rtems_clock_get - RTEMS_NOT_DEFINED
+TA1 - rtems_task_wake_when - RTEMS_NOT_DEFINED
+TA1 - rtems_timer_fire_when - RTEMS_NOT_DEFINED
+TA1 - rtems_clock_set - 08:30:45 02/05/1987 - RTEMS_INVALID_CLOCK
+TA1 - rtems_clock_set - 08:30:45 15/05/1988 - RTEMS_INVALID_CLOCK
+TA1 - rtems_clock_set - 08:30:45 02/32/1988 - RTEMS_INVALID_CLOCK
+TA1 - rtems_clock_set - 25:30:45 02/05/1988 - RTEMS_INVALID_CLOCK
+TA1 - rtems_clock_set - 08:61:45 02/05/1988 - RTEMS_INVALID_CLOCK
+TA1 - rtems_clock_set - 08:30:61 02/05/1988 - RTEMS_INVALID_CLOCK
+TA1 - rtems_clock_set - 08:30:45 02/05/1988 - RTEMS_INVALID_CLOCK
+TA1 - rtems_clock_set - 08:30:45 02/05/1988 - RTEMS_SUCCESSFUL
+TA1 - rtems_task_wake_when - TICKINVALID - sleep about 3 seconds
+TA1 - rtems_task_wake_when - TICKINVALID - woke up RTEMS_SUCCESSFUL
+TA1 - rtems_task_wake_when - 08:30:48 02/05/1961 - RTEMS_INVALID_CLOCK
+TA1 - rtems_task_wake_when - 25:30:48 02/05/1988 - RTEMS_INVALID_CLOCK
+TA1 - current time - 08:30:51 02/05/1988
+TA1 - rtems_task_wake_when - 08:30:51 01/05/1988 - RTEMS_INVALID_CLOCK
+<pause - screen 3>
+TA1 - rtems_task_create - RTEMS_INVALID_NAME
+TA1 - rtems_task_create - stack size - RTEMS_UNSATISFIED
+TA1 - rtems_task_create - TA2 created - RTEMS_SUCCESSFUL
+TA1 - rtems_task_suspend - suspend TA2 - RTEMS_SUCCESSFUL
+TA1 - rtems_task_suspend - suspend TA2 - RTEMS_ALREADY_SUSPENDED
+TA1 - rtems_task_resume - TA2 resumed - RTEMS_SUCCESSFUL
+TA1 - rtems_task_create - TA3 created - RTEMS_SUCCESSFUL
+TA1 - rtems_task_create - 4 created - RTEMS_SUCCESSFUL
+TA1 - rtems_task_create - 5 created - RTEMS_SUCCESSFUL
+TA1 - rtems_task_create - 6 created - RTEMS_SUCCESSFUL
+TA1 - rtems_task_create - 7 created - RTEMS_SUCCESSFUL
+TA1 - rtems_task_create - 8 created - RTEMS_SUCCESSFUL
+TA1 - rtems_task_create - 9 created - RTEMS_SUCCESSFUL
+TA1 - rtems_task_create - 10 created - RTEMS_SUCCESSFUL
+TA1 - rtems_task_create - 11 - RTEMS_TOO_MANY
+TA1 - rtems_task_create - RTEMS_MP_NOT_CONFIGURED
+<pause - screen 4>
+TA1 - rtems_event_receive - RTEMS_UNSATISFIED ( all conditions )
+TA1 - rtems_event_receive - RTEMS_UNSATISFIED ( any condition )
+TA1 - rtems_event_receive - timeout in 3 seconds
+TA1 - rtems_event_receive - woke up with RTEMS_TIMEOUT
+TA1 - rtems_event_send - RTEMS_INVALID_ID
+TA1 - rtems_task_wake_after - sleep 1 second - RTEMS_SUCCESSFUL
+TA1 - rtems_clock_set - 08:30:45 02/05/1988 - RTEMS_SUCCESSFUL
+<pause - screen 5>
+TA1 - rtems_semaphore_create - RTEMS_INVALID_NAME
+TA1 - rtems_semaphore_create - 1 - RTEMS_SUCCESSFUL
+TA1 - rtems_semaphore_create - 2 - RTEMS_SUCCESSFUL
+TA1 - rtems_semaphore_create - 3 - RTEMS_TOO_MANY
+TA1 - rtems_semaphore_create - RTEMS_NOT_DEFINED
+TA1 - rtems_semaphore_create - RTEMS_NOT_DEFINED
+TA1 - rtems_semaphore_create - RTEMS_INVALID_NUMBER
+TA1 - rtems_semaphore_create - RTEMS_MP_NOT_CONFIGURED
+TA1 - rtems_semaphore_delete - unknown RTEMS_INVALID_ID
+TA1 - rtems_semaphore_delete - local RTEMS_INVALID_ID
+TA1 - rtems_semaphore_ident - global RTEMS_INVALID_NAME
+TA1 - rtems_semaphore_ident - local RTEMS_INVALID_NAME
+<pause - screen 6>
+TA1 - rtems_semaphore_obtain - RTEMS_INVALID_ID
+TA1 - rtems_semaphore_obtain - got sem 1 - RTEMS_SUCCESSFUL
+TA1 - rtems_semaphore_obtain - RTEMS_UNSATISFIED
+TA1 - rtems_semaphore_obtain - timeout in 3 seconds
+TA1 - rtems_semaphore_obtain - woke up with RTEMS_TIMEOUT
+TA1 - rtems_semaphore_release - RTEMS_NOT_OWNER_OF_RESOURCE
+TA1 - rtems_semaphore_release - RTEMS_INVALID_ID
+TA1 - rtems_task_start - start TA2 - RTEMS_SUCCESSFUL
+TA1 - rtems_task_wake_after - yield processor - RTEMS_SUCCESSFUL
+TA2 - rtems_semaphore_obtain - sem 1 - RTEMS_WAIT FOREVER
+TA1 - rtems_semaphore_delete - delete sem 1 - RTEMS_SUCCESSFUL
+TA1 - rtems_semaphore_obtain - binary semaphore
+TA1 - rtems_semaphore_delete - delete sem 2 - RTEMS_RESOURCE_IN_USE
+TA1 - rtems_task_wake_after - yield processor - RTEMS_SUCCESSFUL
+TA2 - rtems_semaphore_obtain - woke up with RTEMS_OBJECT_WAS_DELETED
+TA2 - rtems_task_delete - delete self - RTEMS_SUCCESSFUL
+<pause - screen 7>
+TA1 - rtems_message_queue_broadcast - RTEMS_INVALID_ID
+TA1 - rtems_message_queue_create - Q 1 - RTEMS_INVALID_NAME
+TA1 - rtems_message_queue_create - Q 1 - RTEMS_MP_NOT_CONFIGURED
+TA1 - rtems_message_queue_create - Q 1 - RTEMS_LIMIT - RTEMS_SUCCESSFUL
+TA1 - rtems_message_queue_create - Q 2 - RTEMS_TOO_MANY
+TA1 - rtems_message_queue_delete - unknown RTEMS_INVALID_ID
+TA1 - rtems_message_queue_delete - local RTEMS_INVALID_ID
+TA1 - rtems_message_queue_ident - RTEMS_INVALID_NAME
+TA1 - rtems_message_queue_flush - RTEMS_INVALID_ID
+TA1 - rtems_message_queue_receive - RTEMS_INVALID_ID
+TA1 - rtems_message_queue_receive - Q 1 - RTEMS_UNSATISFIED
+TA1 - rtems_message_queue_receive - Q 1 - timeout in 3 seconds
+TA1 - rtems_message_queue_receive - Q 1 - woke up with RTEMS_TIMEOUT
+TA1 - rtems_message_queue_send - RTEMS_INVALID_ID
+TA1 - rtems_message_queue_send - BUFFER 1 TO Q 1 - RTEMS_SUCCESSFUL
+TA1 - rtems_message_queue_send - BUFFER 2 TO Q 1 - RTEMS_SUCCESSFUL
+TA1 - rtems_message_queue_send - BUFFER 3 TO Q 1 - RTEMS_TOO_MANY
+<pause - screen 8>
+TA1 - rtems_message_queue_delete - Q 1 - RTEMS_SUCCESSFUL
+TA1 - rtems_message_queue_create - Q 1 - RTEMS_LIMIT - RTEMS_SUCCESSFUL
+TA1 - rtems_message_queue_send - BUFFER 1 TO Q 1 - RTEMS_SUCCESSFUL
+TA1 - rtems_message_queue_send - BUFFER 2 TO Q 1 - RTEMS_SUCCESSFUL
+TA1 - rtems_message_queue_send - BUFFER 3 TO Q 1 - RTEMS_TOO_MANY
+TA1 - rtems_message_queue_delete - Q 1 - RTEMS_SUCCESSFUL
+TA1 - rtems_message_queue_create - Q 1 - RTEMS_LIMIT - RTEMS_SUCCESSFUL
+TA1 - rtems_message_queue_send - BUFFER 1 TO Q 1 - RTEMS_SUCCESSFUL
+TA1 - rtems_message_queue_send - BUFFER 2 TO Q 1 - RTEMS_SUCCESSFUL
+TA1 - rtems_message_queue_send - BUFFER 3 TO Q 1 - RTEMS_UNSATISFIED
+TA1 - rtems_message_queue_delete - Q 1 - RTEMS_SUCCESSFUL
+TA1 - rtems_message_queue_create - Q 1 - RTEMS_LIMIT - RTEMS_SUCCESSFUL
+TA1 - rtems_task_start - start TA3 - RTEMS_SUCCESSFUL
+TA1 - rtems_task_wake_after - yield processor - RTEMS_SUCCESSFUL
+TA3 - rtems_message_queue_receive - Q 1 - RTEMS_WAIT FOREVER
+TA1 - rtems_message_queue_delete - delete Q 1 - RTEMS_SUCCESSFUL
+TA1 - rtems_task_wake_after - yield processor - RTEMS_SUCCESSFUL
+TA3 - rtems_message_queue_receive - woke up with RTEMS_OBJECT_WAS_DELETED
+TA3 - rtems_task_delete - delete self - RTEMS_SUCCESSFUL
+<pause - screen 9>
+TA1 - rtems_interrupt_catch - RTEMS_INVALID_NUMBER
+TA1 - rtems_interrupt_catch - RTEMS_INVALID_ADDRESS
+TA1 - rtems_signal_send - RTEMS_INVALID_ID
+TA1 - rtems_signal_send - RTEMS_NOT_DEFINED
+TA1 - rtems_port_create - RTEMS_INVALID_NAME
+TA1 - rtems_port_create - RTEMS_INVALID_ADDRESS
+TA1 - rtems_port_create - RTEMS_TOO_MANY
+TA1 - rtems_port_delete - RTEMS_INVALID_ID
+TA1 - rtems_port_ident - RTEMS_INVALID_NAME
+TA1 - rtems_port_external_to_internal - RTEMS_INVALID_ID
+TA1 - rtems_port_internal_to_external - RTEMS_INVALID_ID
+<pause - screen 10>
+TA1 - rtems_rate_monotonic_create - RTEMS_INVALID_NAME
+TA1 - rtems_rate_monotonic_create - RTEMS_SUCCESSFUL
+TA1 - rtems_rate_monotonic_create - RTEMS_TOO_MANY
+TA1 - rtems_rate_monotonic_ident - RTEMS_INVALID_NAME
+TA1 - rtems_rate_monotonic_period - unknown RTEMS_INVALID_ID
+TA1 - rtems_rate_monotonic_period - local RTEMS_INVALID_ID
+TA1 - rtems_rate_monotonic_period(RTEMS_PERIOD_STATUS) - RTEMS_NOT_DEFINED
+TA1 - rtems_rate_monotonic_period - 100 ticks - RTEMS_SUCCESSFUL
+TA1 - rtems_rate_monotonic_period(RTEMS_PERIOD_STATUS) - RTEMS_SUCCESSFUL
+TA1 - rtems_rate_monotonic_period(RTEMS_PERIOD_STATUS) - RTEMS_TIMEOUT
+TA1 - rtems_rate_monotonic_cancel - unknown RTEMS_INVALID_ID
+TA1 - rtems_rate_monotonic_cancel - local RTEMS_INVALID_ID
+TA1 - rtems_rate_monotonic_cancel - RTEMS_SUCCESSFUL
+TA1 - rtems_rate_monotonic_period - 5 ticks - RTEMS_TIMEOUT
+TA1 - yielding to TA4
+TA4 - rtems_rate_monotonic_cancel - RTEMS_NOT_OWNER_OF_RESOURCE
+TA4 - rtems_rate_monotonic_period - RTEMS_NOT_OWNER_OF_RESOURCE
+TA4 - rtems_task_delete - delete self - RTEMS_SUCCESSFUL
+TA1 - rtems_rate_monotonic_delete - unknown RTEMS_INVALID_ID
+TA1 - rtems_rate_monotonic_delete - local RTEMS_INVALID_ID
+TA1 - rtems_rate_monotonic_delete - RTEMS_SUCCESSFUL
+<pause - screen 11>
+TA1 - rtems_partition_create - RTEMS_INVALID_NAME
+TA1 - rtems_partition_create - length - RTEMS_INVALID_SIZE
+TA1 - rtems_partition_create - buffer size - RTEMS_INVALID_SIZE
+TA1 - rtems_partition_create - length < buffer size - RTEMS_INVALID_SIZE
+TA1 - rtems_partition_create - RTEMS_MP_NOT_CONFIGURED
+TA1 - rtems_partition_create - RTEMS_INVALID_ADDRESS
+TA1 - rtems_partition_create - RTEMS_INVALID_SIZE
+TA1 - rtems_partition_delete - unknown RTEMS_INVALID_ID
+TA1 - rtems_partition_delete - local RTEMS_INVALID_ID
+TA1 - rtems_partition_get_buffer - RTEMS_INVALID_ID
+TA1 - rtems_partition_ident - RTEMS_INVALID_NAME
+TA1 - rtems_partition_return_buffer - RTEMS_INVALID_ID
+TA1 - rtems_partition_create - RTEMS_SUCCESSFUL
+TA1 - rtems_partition_create - RTEMS_TOO_MANY
+TA1 - rtems_partition_get_buffer - RTEMS_SUCCESSFUL
+TA1 - rtems_partition_get_buffer - RTEMS_SUCCESSFUL
+TA1 - rtems_partition_get_buffer - RTEMS_UNSATISFIED
+TA1 - rtems_partition_delete - RTEMS_RESOURCE_IN_USE
+TA1 - rtems_partition_return_buffer - RTEMS_INVALID_ADDRESS - out of range
+TA1 - rtems_partition_return_buffer - RTEMS_INVALID_ADDRESS - not on boundary
+<pause - screen 12>
+TA1 - rtems_region_create - RTEMS_INVALID_NAME
+TA1 - rtems_region_create - RTEMS_INVALID_ADDRESS
+TA1 - rtems_region_create - RTEMS_INVALID_SIZE
+TA1 - rtems_region_create - RTEMS_SUCCESSFUL
+TA1 - rtems_region_create - RTEMS_TOO_MANY
+TA1 - rtems_region_delete - unknown RTEMS_INVALID_ID
+TA1 - rtems_region_delete - local RTEMS_INVALID_ID
+TA1 - rtems_region_ident - RTEMS_INVALID_NAME
+TA1 - rtems_region_get_segment - RTEMS_INVALID_ID
+TA1 - rtems_region_get_segment - RTEMS_INVALID_SIZE
+TA1 - rtems_region_get_segment - RTEMS_SUCCESSFUL
+TA1 - rtems_region_get_segment - RTEMS_UNSATISFIED
+TA1 - rtems_region_get_segment - timeout in 3 seconds
+TA1 - rtems_region_get_segment - woke up with RTEMS_TIMEOUT
+TA1 - rtems_region_delete - RTEMS_RESOURCE_IN_USE
+TA1 - rtems_region_return_segment - RTEMS_INVALID_ID
+TA1 - rtems_region_return_segment - RTEMS_INVALID_ADDRESS
+TA1 - rtems_debug_disable - RTEMS_DEBUG_REGION
+TA1 - rtems_region_return_segment - RTEMS_INVALID_ADDRESS
+TA1 - rtems_region_return_segment - RTEMS_INVALID_ADDRESS
+TA1 - rtems_debug_enable - RTEMS_DEBUG_REGION
+TA1 - rtems_region_extend - RTEMS_INVALID_ID
+TA1 - rtems_region_extend - within heap - RTEMS_INVALID_ADDRESS
+TA1 - rtems_region_extend - non-contiguous lower - RTEMS_NOT_IMPLEMENTED
+TA1 - rtems_region_extend - contiguous lower - RTEMS_NOT_IMPLEMENTED
+TA1 - rtems_region_extend - non-contiguous higher - RTEMS_NOT_IMPLEMENTED
+<pause - screen 13>
+TA1 - rtems_io_close - RTEMS_INVALID_NUMBER
+TA1 - rtems_io_control - RTEMS_INVALID_NUMBER
+TA1 - rtems_io_initialize - RTEMS_INVALID_NUMBER
+TA1 - rtems_io_open - RTEMS_INVALID_NUMBER
+TA1 - rtems_io_read - RTEMS_INVALID_NUMBER
+TA1 - rtems_io_write - RTEMS_INVALID_NUMBER
+TA1 - rtems_clock_set - 23:59:59 12/31/2000 - RTEMS_SUCCESSFUL
+TA1 - rtems_clock_get - 00:00:00 01/01/2001 - RTEMS_SUCCESSFUL
+TA1 - rtems_clock_set - 23:59:59 12/31/1999 - RTEMS_SUCCESSFUL
+TA1 - rtems_clock_get - 00:00:00 01/01/2000 - RTEMS_SUCCESSFUL
+TA1 - rtems_clock_set - 23:59:59 12/31/2100 - RTEMS_SUCCESSFUL
+TA1 - rtems_clock_get - 00:00:00 01/01/2101 - RTEMS_SUCCESSFUL
+TA1 - rtems_clock_set - 23:59:59 12/31/2099 - RTEMS_SUCCESSFUL
+TA1 - rtems_clock_get - 00:00:00 01/01/2100 - RTEMS_SUCCESSFUL
+TA1 - rtems_clock_set - 23:59:59 12/31/1991 - RTEMS_SUCCESSFUL
+TA1 - rtems_clock_get - 00:00:00 01/01/1992 - RTEMS_SUCCESSFUL
+<pause - screen 14>
+TA1 - rtems_timer_create - RTEMS_INVALID_NAME
+TA1 - rtems_timer_create - 1 - RTEMS_SUCCESSFUL
+TA1 - rtems_timer_create - 2 - RTEMS_TOO_MANY
+TA1 - rtems_timer_delete - local RTEMS_INVALID_ID
+TA1 - rtems_timer_delete - global RTEMS_INVALID_ID
+TA1 - rtems_timer_ident - RTEMS_INVALID_NAME
+TA1 - rtems_timer_cancel - RTEMS_INVALID_ID
+TA1 - rtems_timer_cancel - RTEMS_INCORRECT_STATE
+TA1 - rtems_timer_reset - RTEMS_INVALID_ID
+TA1 - rtems_timer_reset - RTEMS_NOT_DEFINED
+TA1 - rtems_timer_fire_after - RTEMS_INVALID_ID
+TA1 - rtems_timer_fire_when - RTEMS_INVALID_ID
+TA1 - rtems_timer_fire_after - RTEMS_INVALID_NUMBER
+TA1 - rtems_timer_fire_when - 08:30:45 02/05/1987 - RTEMS_INVALID_CLOCK
+TA1 - rtems_clock_get - 00:00:00 01/01/1992
+TA1 - rtems_timer_fire_when - 08:30:45 02/05/1990 - before RTEMS_INVALID_CLOCK
+*** END OF TEST 9 ***
diff --git a/testsuites/sptests/sp09/system.h b/testsuites/sptests/sp09/system.h
new file mode 100644
index 0000000000..aa2c6d17e4
--- /dev/null
+++ b/testsuites/sptests/sp09/system.h
@@ -0,0 +1,30 @@
+/* system.h
+ *
+ * This include file contains information that is included in every
+ * function in the test set.
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include <rtems.h>
+#include "tmacros.h"
+
+/* Miscellaneous */
+
+#define EXTERN extern /* external definition */
+
+/* macros */
+
+/* structures */
+
+#include "gvar.h"
+
+/* end of include file */
diff --git a/testsuites/sptests/sp09/task1.c b/testsuites/sptests/sp09/task1.c
new file mode 100644
index 0000000000..dbf28f57a8
--- /dev/null
+++ b/testsuites/sptests/sp09/task1.c
@@ -0,0 +1,74 @@
+/* Task_1
+ *
+ * This task generates all possible errors for the RTEMS executive.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+#ifdef pause
+#undef pause
+#endif
+
+rtems_task Task_1(
+ rtems_task_argument argument
+)
+{
+ Screen1();
+ pause_and_screen_number( 2 );
+
+ Screen2();
+ pause_and_screen_number( 3 );
+
+ Screen3();
+ pause_and_screen_number( 4 );
+
+ Screen4();
+ pause_and_screen_number( 5 );
+
+ Screen5();
+ pause_and_screen_number( 6 );
+
+ Screen6();
+ pause_and_screen_number( 7 );
+
+ Screen7();
+ pause_and_screen_number( 8 );
+
+ Screen8();
+ pause_and_screen_number( 9 );
+
+ Screen9();
+ pause_and_screen_number( 10 );
+
+ Screen10();
+ pause_and_screen_number( 11 );
+
+ Screen11();
+ pause_and_screen_number( 12 );
+
+ Screen12();
+ pause_and_screen_number( 13 );
+
+ Screen13();
+ pause_and_screen_number( 14 );
+
+ Screen14();
+
+ puts( "*** END OF TEST 9 ***" );
+ exit( 0 );
+}
diff --git a/testsuites/sptests/sp09/task2.c b/testsuites/sptests/sp09/task2.c
new file mode 100644
index 0000000000..e9bda81fa3
--- /dev/null
+++ b/testsuites/sptests/sp09/task2.c
@@ -0,0 +1,48 @@
+/* Task_2
+ *
+ * This routine serves as a test task. Its only purpose is to generate the
+ * error where a semaphore is deleted while a task is waiting for it.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_task Task_2(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+
+ puts( "TA2 - rtems_semaphore_obtain - sem 1 - RTEMS_WAIT FOREVER" );
+ status = rtems_semaphore_obtain(
+ Semaphore_id[ 1 ],
+ RTEMS_DEFAULT_OPTIONS,
+ RTEMS_NO_TIMEOUT
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_OBJECT_WAS_DELETED,
+ "rtems_semaphore_obtain waiting to be deleted"
+ );
+ puts(
+ "TA2 - rtems_semaphore_obtain - woke up with RTEMS_OBJECT_WAS_DELETED"
+ );
+
+ puts( "TA2 - rtems_task_delete - delete self - RTEMS_SUCCESSFUL" );
+ status = rtems_task_delete( RTEMS_SELF );
+ directive_failed( status, "rtems_task_delete of TA2" );
+}
diff --git a/testsuites/sptests/sp09/task3.c b/testsuites/sptests/sp09/task3.c
new file mode 100644
index 0000000000..8420c51f4d
--- /dev/null
+++ b/testsuites/sptests/sp09/task3.c
@@ -0,0 +1,51 @@
+/* Task_3
+ *
+ * This routine serves as a test task. Its only purpose in life is to
+ * generate the error where a message queue is deleted while a task
+ * is waiting there for a message.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_task Task_3(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+ long buffer[ 4 ];
+
+ puts( "TA3 - rtems_message_queue_receive - Q 1 - RTEMS_WAIT FOREVER" );
+ status = rtems_message_queue_receive(
+ Queue_id[ 1 ],
+ (long (*)[4])buffer,
+ RTEMS_DEFAULT_OPTIONS,
+ RTEMS_NO_TIMEOUT
+ );
+ fatal_directive_status(
+ status,
+ RTEMS_OBJECT_WAS_DELETED,
+ "rtems_message_queue_receive waiting to be deleted"
+ );
+ puts(
+ "TA3 - rtems_message_queue_receive - woke up with RTEMS_OBJECT_WAS_DELETED"
+ );
+
+ puts( "TA3 - rtems_task_delete - delete self - RTEMS_SUCCESSFUL" );
+ status = rtems_task_delete( RTEMS_SELF );
+ directive_failed( status, "rtems_task_delete of TA3" );
+}
diff --git a/testsuites/sptests/sp09/task4.c b/testsuites/sptests/sp09/task4.c
new file mode 100644
index 0000000000..73cd63373c
--- /dev/null
+++ b/testsuites/sptests/sp09/task4.c
@@ -0,0 +1,50 @@
+/* Task_4
+ *
+ * This routine serves as a test task. Its only purpose in life is to
+ * generate the error where a rate monotonic period is accessed by a
+ * task other than its creator.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+
+rtems_task Task_4(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+
+ status = rtems_rate_monotonic_cancel( Period_id[ 1 ] );
+ fatal_directive_status(
+ status,
+ RTEMS_NOT_OWNER_OF_RESOURCE,
+ "rtems_rate_monotonic_cancel not the owner"
+ );
+ puts( "TA4 - rtems_rate_monotonic_cancel - RTEMS_NOT_OWNER_OF_RESOURCE" );
+
+ status = rtems_rate_monotonic_period( Period_id[ 1 ], 5 );
+ fatal_directive_status(
+ status,
+ RTEMS_NOT_OWNER_OF_RESOURCE,
+ "rtems_rate_monotonic_period not the owner"
+ );
+ puts( "TA4 - rtems_rate_monotonic_period - RTEMS_NOT_OWNER_OF_RESOURCE" );
+
+ puts( "TA4 - rtems_task_delete - delete self - RTEMS_SUCCESSFUL" );
+ status = rtems_task_delete( RTEMS_SELF );
+ directive_failed( status, "rtems_task_delete of TA4" );
+}
diff --git a/testsuites/sptests/sp11/init.c b/testsuites/sptests/sp11/init.c
new file mode 100644
index 0000000000..99ef1d55a0
--- /dev/null
+++ b/testsuites/sptests/sp11/init.c
@@ -0,0 +1,95 @@
+/* Init
+ *
+ * This routine is the initialization task for this test program.
+ * It is a user initialization task and has the responsibility for creating
+ * and starting the tasks that make up the test. If the time of day
+ * clock is required for the test, it should also be set to a known
+ * value by this function.
+ *
+ * Input parameters:
+ * argument - task argument
+ *
+ * Output parameters: NONE
+ *
+ * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+ * On-Line Applications Research Corporation (OAR).
+ * All rights assigned to U.S. Government, 1994.
+ *
+ * This material may be reproduced by or for the U.S. Government pursuant
+ * to the copyright license under the clause at DFARS 252.227-7013. This
+ * notice must appear in all copies of this file and its derivatives.
+ *
+ * $Id$
+ */
+
+#include "system.h"
+#undef EXTERN
+#define EXTERN
+#include "conftbl.h"
+#include "gvar.h"
+
+rtems_task Init(
+ rtems_task_argument argument
+)
+{
+ rtems_status_code status;
+
+ puts( "\n\n*** TEST 11 ***" );
+
+ Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' );
+ Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' );
+
+ status = rtems_task_create(
+ Task_name[ 1 ],
+ 4,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 1 ]
+ );
+ directive_failed( status, "rtems_task_create of TA1" );
+
+ status = rtems_task_create(
+ Task_name[ 2 ],
+ 4,
+ 2048,
+ RTEMS_DEFAULT_MODES,
+ RTEMS_DEFAULT_ATTRIBUTES,
+ &Task_id[ 2 ]
+ );
+ directive_failed( status, "rtems_task_create of TA2" );
+
+ status = rtems_task_start( Task_id[ 1 ], Task_1, 0 );
+ directive_failed( status, "rtems_task_start of TA1" );
+
+ status = rtems_task_start( Task_id[ 2 ], Task_2, 0 );
+ directive_failed( status, "rtems_task_start of TA2" );
+
+ Timer_name[ 1 ] = rtems_build_name( 'T', 'M', '1', ' ' );
+ Timer_name[ 2 ] = rtems_build_name( 'T', 'M', '2', ' ' );
+ Timer_name[ 3 ] = rtems_build_name( 'T', 'M', '3', ' ' );
+ Timer_name[ 4 ] = rtems_build_name( 'T', 'M', '4', ' ' );
+ Timer_name[ 5 ] = rtems_build_name( 'T', 'M', '5', ' ' );
+ Timer_name[ 6 ] = rtems_build_name( 'T', 'M', '6', ' ' );
+
+ status = rtems_timer_create( Timer_name[ 1 ], &Timer_id[ 1 ] );
+ directive_failed( status, "rtems_timer_create of TM1" );
+
+ status = rtems_timer_create( Timer_name[ 2 ], &Timer_id[ 2 ] );
+ directive_failed( status, "rtems_timer_create of TM2" );
+
+ status = rtems_timer_create( Timer_name[ 3 ], &Timer_id[ 3 ] );
+ directive_failed( status, "rtems_timer_create of TM3" );
+
+ status = rtems_timer_create( Timer_name[ 4 ], &Timer_id[ 4 ] );
+ directive_failed( status, "rtems_timer_create of TM4" );
+
+ status = rtems_timer_create( Timer_name[ 5 ], &Timer_id[ 5 ] );
+ directive_failed( status, "rtems_timer_create of TM5" );
+
+ status = rtems_timer_create( Timer_name[ 6 ], &Timer_id[ 6 ] );
+ directive_failed( status, "rtems_timer_create of TM6" );
+
+ status = rtems_task_delete( RTEMS_SELF );
+ directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
+}
diff --git a/testsuites/sptests/sp11/sp11.doc b/testsuites/sptests/sp11/sp11.doc
new file mode 100644
index 0000000000..d88f5eb86d
--- /dev/null
+++ b/testsuites/sptests/sp11/sp11.doc
@@ -0,0 +1,26 @@
+#
+# $Id$
+#
+# COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994.
+# On-Line Applications Research Corporation (OAR).
+# All rights assigned to U.S. Government, 1994.
+#
+# This material may be reproduced by or for the U.S. Government pursuant
+# to the copyright license under the clause at DFARS 252.227-7013. This
+# notice must appear in all copies of this file and its derivatives.
+#
+
+
+This file describes the directives and concepts tested by this test set.
+
+test set name: test11
+
+directives:
+ ex_init, ex_start, t_create, t_start, t_delete, tm_tick, i_return,
+ ev_send, ev_receive
+ tm_wkafter, tm_set, tm_get
+
+concepts:
+
+ a. This test checks out the event manager along with the associated
+ event directives contained in the time manager.
diff --git a/testsuites/sptests/sp11/sp11.scn b/testsuites/sptests/sp11/sp11.scn
new file mode 100644
index 0000000000..7abb8afe45
--- /dev/null
+++ b/testsuites/sptests/sp11/sp11.scn
@@ -0,0 +1,74 @@
+*** TEST 11 ***
+TA1 - rtems_event_send - send RTEMS_EVENT_16 to TA2
+TA1 - rtems_event_receive - waiting forever on RTEMS_EVENT_14 and RTEMS_EVENT_15
+TA2 - rtems_event_receive - waiting forever on RTEMS_EVENT_16
+TA2 - RTEMS_EVENT_16 received - eventout => 00010000
+TA2 - rtems_event_send - send RTEMS_EVENT_14 and RTEMS_EVENT_15 to TA1
+TA2 - rtems_event_receive - RTEMS_EVENT_17 or RTEMS_EVENT_18 - forever and ANY
+TA1 - RTEMS_EVENT_14 and RTEMS_EVENT_15 received - eventout => 0000c000
+TA1 - rtems_event_send - send RTEMS_EVENT_18 to TA2
+TA1 - rtems_event_receive - waiting with 10 second timeout on RTEMS_EVENT_14
+TA2 - RTEMS_EVENT_17 or RTEMS_EVENT_18 received - eventout => 00040000
+TA2 - rtems_event_send - send RTEMS_EVENT_14 to TA1
+TA2 - rtems_clock_set - 08:15:00 02/12/1988
+TA2 - rtems_event_send - sending RTEMS_EVENT_10 to self after 5 seconds
+TA2 - rtems_event_receive - waiting forever on RTEMS_EVENT_10
+TA1 - RTEMS_EVENT_14 received - eventout => 00004000
+TA1 - rtems_event_send - send RTEMS_EVENT_19 to TA2
+TA1 - rtems_clock_get - 08:15:00 02/12/1988
+<pause>
+TA1 - rtems_event_send - send RTEMS_EVENT_18 to self after 5 seconds
+TA1 - rtems_event_receive - waiting forever on RTEMS_EVENT_18
+TA2 - RTEMS_EVENT_10 received - eventout => 00000400
+TA2 - rtems_clock_get - 08:15:05 02/12/1988
+TA2 - rtems_event_receive - RTEMS_PENDING_EVENTS
+TA2 - eventout => 00080000
+TA2 - rtems_event_receive - RTEMS_EVENT_1