From d8daeafaba5f460e788aad239db7150765c2a7b7 Mon Sep 17 00:00:00 2001 From: cvs2git Date: Tue, 11 Feb 2003 23:44:42 +0000 Subject: [PATCH] This commit was manufactured by cvs2svn to create branch 'rtems-4-6-branch'. Sprout from master 2003-02-11 23:44:41 UTC Joel Sherrill '2003-02-11 Joel Sherrill ' Cherrypick from rtemsdoc-4-5-branch 1997-05-27 12:40:10 UTC Joel Sherrill 'base RTEMS documentation': doc/common/treedef.tex Delete: bootstrap c/src/ada/.cvsignore c/src/ada/ChangeLog c/src/ada/Makefile.am c/src/ada/rtems-multiprocessing.adb c/src/ada/rtems-multiprocessing.ads c/src/ada/rtems.adb c/src/ada/rtems.ads c/src/lib/libcpu/powerpc/new-exceptions/ChangeLog c/src/lib/libcpu/powerpc/new-exceptions/cpu.c c/src/lib/libcpu/powerpc/new-exceptions/cpu_asm.S c/src/lib/libcpu/powerpc/old-exceptions/ChangeLog c/src/lib/libcpu/powerpc/old-exceptions/README c/src/lib/libcpu/powerpc/old-exceptions/TODO c/src/lib/libcpu/powerpc/old-exceptions/cpu.c c/src/lib/libcpu/powerpc/old-exceptions/cpu_asm.S c/src/lib/libcpu/powerpc/old-exceptions/irq_stub.S c/src/lib/libcpu/powerpc/old-exceptions/ppccache.c c/src/lib/libcpu/powerpc/old-exceptions/rtems/score/ppc_offs.h c/src/libchip/shmdr/.cvsignore c/src/libchip/shmdr/README c/src/libchip/shmdr/addlq.c c/src/libchip/shmdr/cnvpkt.c c/src/libchip/shmdr/dump.c c/src/libchip/shmdr/fatal.c c/src/libchip/shmdr/getlq.c c/src/libchip/shmdr/getpkt.c c/src/libchip/shmdr/init.c c/src/libchip/shmdr/initlq.c c/src/libchip/shmdr/intr.c c/src/libchip/shmdr/mpci.h c/src/libchip/shmdr/mpisr.c c/src/libchip/shmdr/poll.c c/src/libchip/shmdr/receive.c c/src/libchip/shmdr/retpkt.c c/src/libchip/shmdr/send.c c/src/libchip/shmdr/setckvec.c c/src/libchip/shmdr/shm_driver.h cpukit/ftpd/Makefile.am cpukit/ftpd/ftpd.c cpukit/ftpd/ftpd.h cpukit/httpd/.cvsignore cpukit/httpd/Makefile.am cpukit/httpd/NOTES cpukit/httpd/asp.c cpukit/httpd/balloc.c cpukit/httpd/default.c cpukit/httpd/ej.h cpukit/httpd/ejIntrn.h cpukit/httpd/ejlex.c cpukit/httpd/ejparse.c cpukit/httpd/emfdb.c cpukit/httpd/emfdb.h cpukit/httpd/form.c cpukit/httpd/h.c cpukit/httpd/handler.c cpukit/httpd/license.txt cpukit/httpd/md5.h cpukit/httpd/md5c.c cpukit/httpd/mime.c cpukit/httpd/misc.c cpukit/httpd/ringq.c cpukit/httpd/rom.c cpukit/httpd/rtems_webserver.h cpukit/httpd/security.c cpukit/httpd/sock.c cpukit/httpd/socket.c cpukit/httpd/sym.c cpukit/httpd/uemf.c cpukit/httpd/uemf.h cpukit/httpd/um.c cpukit/httpd/um.h cpukit/httpd/url.c cpukit/httpd/value.c cpukit/httpd/wbase64.c cpukit/httpd/webcomp.c cpukit/httpd/webmain.c cpukit/httpd/webpage.c cpukit/httpd/webrom.c cpukit/httpd/webs.c cpukit/httpd/webs.h cpukit/httpd/websuemf.c cpukit/httpd/wsIntrn.h cpukit/libnetworking/netinet/in_cksum_arm.h cpukit/libnetworking/netinet/in_cksum_i386.h cpukit/libnetworking/netinet/in_cksum_m68k.h cpukit/libnetworking/netinet/in_cksum_powerpc.h cpukit/pppd/Makefile.am cpukit/pppd/README cpukit/pppd/STATUS cpukit/pppd/auth.c cpukit/pppd/cbcp.c cpukit/pppd/cbcp.h cpukit/pppd/ccp.c cpukit/pppd/ccp.h cpukit/pppd/chap.c cpukit/pppd/chap.h cpukit/pppd/chap_ms.c cpukit/pppd/chap_ms.h cpukit/pppd/chat.c cpukit/pppd/demand.c cpukit/pppd/example/Makefile-user cpukit/pppd/example/README cpukit/pppd/example/init.c cpukit/pppd/example/netconfig.h cpukit/pppd/example/ppp.conf cpukit/pppd/example/pppd.options cpukit/pppd/example/pppdapp.c cpukit/pppd/example/system.h cpukit/pppd/fsm.c cpukit/pppd/fsm.h cpukit/pppd/ipcp.c cpukit/pppd/ipcp.h cpukit/pppd/ipxcp.c cpukit/pppd/ipxcp.h cpukit/pppd/lcp.c cpukit/pppd/lcp.h cpukit/pppd/magic.c cpukit/pppd/magic.h cpukit/pppd/md4.c cpukit/pppd/md4.h cpukit/pppd/md5.c cpukit/pppd/md5.h cpukit/pppd/options.c cpukit/pppd/patchlevel.h cpukit/pppd/pathnames.h cpukit/pppd/pppd.8 cpukit/pppd/pppd.h cpukit/pppd/rtemsdialer.h cpukit/pppd/rtemsmain.c cpukit/pppd/rtemspppd.c cpukit/pppd/rtemspppd.h cpukit/pppd/sys-rtems.c cpukit/pppd/upap.c cpukit/pppd/upap.h cpukit/pppd/utils.c cpukit/rtems/src/clocktodtoseconds.c cpukit/rtems/src/clocktodvalidate.c cpukit/score/cpu/arm/rtems/asm.h cpukit/score/cpu/c4x/rtems/asm.h cpukit/score/cpu/c4x/rtems/tic4x/c4xio.h cpukit/score/cpu/h8300/rtems/asm.h cpukit/score/cpu/i386/rtems/asm.h cpukit/score/cpu/m68k/rtems/asm.h cpukit/score/cpu/m68k/rtems/m68k/m68302.h cpukit/score/cpu/m68k/rtems/m68k/m68360.h cpukit/score/cpu/m68k/rtems/m68k/qsm.h cpukit/score/cpu/m68k/rtems/m68k/sim.h cpukit/score/cpu/mips/rtems/asm.h cpukit/score/cpu/mips/rtems/mips/idtcpu.h cpukit/score/cpu/mips/rtems/mips/iregdef.h cpukit/score/cpu/no_cpu/rtems/asm.h cpukit/score/cpu/or32/rtems/asm.h cpukit/score/cpu/powerpc/rtems/asm.h cpukit/score/cpu/sh/rtems/asm.h cpukit/score/cpu/sparc/rtems/asm.h cpukit/telnetd/Makefile.am cpukit/telnetd/README cpukit/telnetd/icmds.c cpukit/telnetd/pty.c cpukit/telnetd/pty.h cpukit/telnetd/telnetd.c cpukit/telnetd/telnetd.h cpukit/zlib/doc/rfc1950.txt cpukit/zlib/doc/rfc1951.txt cpukit/zlib/doc/rfc1952.txt testsuites/.cvsignore testsuites/ChangeLog testsuites/Makefile.am testsuites/PROBLEMS testsuites/README testsuites/configure.ac testsuites/itrontests/.cvsignore testsuites/itrontests/ChangeLog testsuites/itrontests/Makefile.am testsuites/itrontests/README testsuites/itrontests/configure.ac testsuites/itrontests/itronhello/.cvsignore testsuites/itrontests/itronhello/Makefile.am testsuites/itrontests/itronhello/init.c testsuites/itrontests/itronhello/itronhello.doc testsuites/itrontests/itronhello/itronhello.scn testsuites/itrontests/itronhello/system.h testsuites/itrontests/itronmbf01/.cvsignore testsuites/itrontests/itronmbf01/Makefile.am testsuites/itrontests/itronmbf01/init.c testsuites/itrontests/itronmbf01/itronmbf01.doc testsuites/itrontests/itronmbf01/itronmbf01.scn testsuites/itrontests/itronmbf01/system.h testsuites/itrontests/itronmbox01/.cvsignore testsuites/itrontests/itronmbox01/Makefile.am testsuites/itrontests/itronmbox01/init.c testsuites/itrontests/itronmbox01/itronmbox01.doc testsuites/itrontests/itronmbox01/itronmbox01.scn testsuites/itrontests/itronmbox01/system.h testsuites/itrontests/itronsem01/.cvsignore testsuites/itrontests/itronsem01/Makefile.am testsuites/itrontests/itronsem01/init.c testsuites/itrontests/itronsem01/itronsem01.doc testsuites/itrontests/itronsem01/itronsem01.scn testsuites/itrontests/itronsem01/system.h testsuites/itrontests/itrontask01/.cvsignore testsuites/itrontests/itrontask01/Makefile.am testsuites/itrontests/itrontask01/init.c testsuites/itrontests/itrontask01/itrontask01.doc testsuites/itrontests/itrontask01/itrontask01.scn testsuites/itrontests/itrontask01/system.h testsuites/itrontests/itrontask01/task1.c testsuites/itrontests/itrontask02/.cvsignore testsuites/itrontests/itrontask02/Makefile.am testsuites/itrontests/itrontask02/dormant.c testsuites/itrontests/itrontask02/init.c testsuites/itrontests/itrontask02/itrontask02.doc testsuites/itrontests/itrontask02/itrontask02.scn testsuites/itrontests/itrontask02/system.h testsuites/itrontests/itrontask03/.cvsignore testsuites/itrontests/itrontask03/Makefile.am testsuites/itrontests/itrontask03/init.c testsuites/itrontests/itrontask03/itrontask03.doc testsuites/itrontests/itrontask03/itrontask03.scn testsuites/itrontests/itrontask03/preempt.c testsuites/itrontests/itrontask03/system.h testsuites/itrontests/itrontask03/task1.c testsuites/itrontests/itrontask03/task2.c testsuites/itrontests/itrontask03/task3.c testsuites/itrontests/itrontask04/.cvsignore testsuites/itrontests/itrontask04/Makefile.am testsuites/itrontests/itrontask04/init.c testsuites/itrontests/itrontask04/itrontask04.doc testsuites/itrontests/itrontask04/itrontask04.scn testsuites/itrontests/itrontask04/system.h testsuites/itrontests/itrontask04/task1.c testsuites/itrontests/itrontask04/task2.c testsuites/itrontests/itrontask04/task3.c testsuites/itrontests/itrontests.am testsuites/itrontests/itrontime01/.cvsignore testsuites/itrontests/itrontime01/Makefile.am testsuites/itrontests/itrontime01/init.c testsuites/itrontests/itrontime01/itrontime01.doc testsuites/itrontests/itrontime01/itrontime01.scn testsuites/itrontests/itrontime01/system.h testsuites/libtests/.cvsignore testsuites/libtests/ChangeLog testsuites/libtests/Makefile.am testsuites/libtests/README testsuites/libtests/configure.ac testsuites/libtests/cpuuse/.cvsignore testsuites/libtests/cpuuse/Makefile.am testsuites/libtests/cpuuse/cpuuse.scn testsuites/libtests/cpuuse/init.c testsuites/libtests/cpuuse/system.h testsuites/libtests/cpuuse/task1.c testsuites/libtests/cpuuse/task2.c testsuites/libtests/cpuuse/task3.c testsuites/libtests/cpuuse/tswitch.c testsuites/libtests/libtests.am testsuites/libtests/malloctest/.cvsignore testsuites/libtests/malloctest/Makefile.am testsuites/libtests/malloctest/init.c testsuites/libtests/malloctest/malloctest.scn testsuites/libtests/malloctest/system.h testsuites/libtests/malloctest/task1.c testsuites/libtests/monitor/.cvsignore testsuites/libtests/monitor/Makefile.am testsuites/libtests/monitor/init.c testsuites/libtests/monitor/system.h testsuites/libtests/putenvtest/.cvsignore testsuites/libtests/putenvtest/Makefile.am testsuites/libtests/putenvtest/init.c testsuites/libtests/rtems++/.cvsignore testsuites/libtests/rtems++/Init.cc testsuites/libtests/rtems++/Makefile.am testsuites/libtests/rtems++/System.h testsuites/libtests/rtems++/Task1.cc testsuites/libtests/rtems++/Task2.cc testsuites/libtests/rtems++/Task3.cc testsuites/libtests/rtems++/rtems++.doc testsuites/libtests/rtems++/rtems++.scn testsuites/libtests/rtmonuse/.cvsignore testsuites/libtests/rtmonuse/Makefile.am testsuites/libtests/rtmonuse/getall.c testsuites/libtests/rtmonuse/init.c testsuites/libtests/rtmonuse/rtmonuse.scn testsuites/libtests/rtmonuse/system.h testsuites/libtests/rtmonuse/task1.c testsuites/libtests/stackchk/.cvsignore testsuites/libtests/stackchk/Makefile.am testsuites/libtests/stackchk/blow.c testsuites/libtests/stackchk/init.c testsuites/libtests/stackchk/stackchk.scn testsuites/libtests/stackchk/system.h testsuites/libtests/stackchk/task1.c testsuites/libtests/termios/.cvsignore testsuites/libtests/termios/Makefile.am testsuites/libtests/termios/README testsuites/libtests/termios/init.c testsuites/mptests/.cvsignore testsuites/mptests/ChangeLog testsuites/mptests/Makefile.am testsuites/mptests/README testsuites/mptests/configure.ac testsuites/mptests/mp01/.cvsignore testsuites/mptests/mp01/Makefile.am testsuites/mptests/mp01/init.c testsuites/mptests/mp01/node1/.cvsignore testsuites/mptests/mp01/node1/Makefile.am testsuites/mptests/mp01/node1/mp01.doc testsuites/mptests/mp01/node1/mp01.scn testsuites/mptests/mp01/node2/.cvsignore testsuites/mptests/mp01/node2/Makefile.am testsuites/mptests/mp01/node2/mp01.doc testsuites/mptests/mp01/node2/mp01.scn testsuites/mptests/mp01/system.h testsuites/mptests/mp01/task1.c testsuites/mptests/mp02/.cvsignore testsuites/mptests/mp02/Makefile.am testsuites/mptests/mp02/init.c testsuites/mptests/mp02/node1/.cvsignore testsuites/mptests/mp02/node1/Makefile.am testsuites/mptests/mp02/node1/mp02.doc testsuites/mptests/mp02/node1/mp02.scn testsuites/mptests/mp02/node2/.cvsignore testsuites/mptests/mp02/node2/Makefile.am testsuites/mptests/mp02/node2/mp02.doc testsuites/mptests/mp02/node2/mp02.scn testsuites/mptests/mp02/system.h testsuites/mptests/mp02/task1.c testsuites/mptests/mp03/.cvsignore testsuites/mptests/mp03/Makefile.am testsuites/mptests/mp03/delay.c testsuites/mptests/mp03/init.c testsuites/mptests/mp03/node1/.cvsignore testsuites/mptests/mp03/node1/Makefile.am testsuites/mptests/mp03/node1/mp03.doc testsuites/mptests/mp03/node1/mp03.scn testsuites/mptests/mp03/node2/.cvsignore testsuites/mptests/mp03/node2/Makefile.am testsuites/mptests/mp03/node2/mp03.doc testsuites/mptests/mp03/node2/mp03.scn testsuites/mptests/mp03/system.h testsuites/mptests/mp03/task1.c testsuites/mptests/mp04/.cvsignore testsuites/mptests/mp04/Makefile.am testsuites/mptests/mp04/init.c testsuites/mptests/mp04/node1/.cvsignore testsuites/mptests/mp04/node1/Makefile.am testsuites/mptests/mp04/node1/mp04.doc testsuites/mptests/mp04/node1/mp04.scn testsuites/mptests/mp04/node2/.cvsignore testsuites/mptests/mp04/node2/Makefile.am testsuites/mptests/mp04/node2/mp04.doc testsuites/mptests/mp04/node2/mp04.scn testsuites/mptests/mp04/system.h testsuites/mptests/mp04/task1.c testsuites/mptests/mp05/.cvsignore testsuites/mptests/mp05/Makefile.am testsuites/mptests/mp05/asr.c testsuites/mptests/mp05/init.c testsuites/mptests/mp05/node1/.cvsignore testsuites/mptests/mp05/node1/Makefile.am testsuites/mptests/mp05/node1/mp05.doc testsuites/mptests/mp05/node1/mp05.scn testsuites/mptests/mp05/node2/.cvsignore testsuites/mptests/mp05/node2/Makefile.am testsuites/mptests/mp05/node2/mp05.doc testsuites/mptests/mp05/node2/mp05.scn testsuites/mptests/mp05/system.h testsuites/mptests/mp05/task1.c testsuites/mptests/mp06/.cvsignore testsuites/mptests/mp06/Makefile.am testsuites/mptests/mp06/init.c testsuites/mptests/mp06/node1/.cvsignore testsuites/mptests/mp06/node1/Makefile.am testsuites/mptests/mp06/node1/mp06.doc testsuites/mptests/mp06/node1/mp06.scn testsuites/mptests/mp06/node2/.cvsignore testsuites/mptests/mp06/node2/Makefile.am testsuites/mptests/mp06/node2/mp06.doc testsuites/mptests/mp06/node2/mp06.scn testsuites/mptests/mp06/system.h testsuites/mptests/mp06/task1.c testsuites/mptests/mp07/.cvsignore testsuites/mptests/mp07/Makefile.am testsuites/mptests/mp07/init.c testsuites/mptests/mp07/node1/.cvsignore testsuites/mptests/mp07/node1/Makefile.am testsuites/mptests/mp07/node1/mp07.doc testsuites/mptests/mp07/node1/mp07.scn testsuites/mptests/mp07/node2/.cvsignore testsuites/mptests/mp07/node2/Makefile.am testsuites/mptests/mp07/node2/mp07.doc testsuites/mptests/mp07/node2/mp07.scn testsuites/mptests/mp07/system.h testsuites/mptests/mp07/task1.c testsuites/mptests/mp08/.cvsignore testsuites/mptests/mp08/Makefile.am testsuites/mptests/mp08/init.c testsuites/mptests/mp08/node1/.cvsignore testsuites/mptests/mp08/node1/Makefile.am testsuites/mptests/mp08/node1/mp08.doc testsuites/mptests/mp08/node1/mp08.scn testsuites/mptests/mp08/node2/.cvsignore testsuites/mptests/mp08/node2/Makefile.am testsuites/mptests/mp08/node2/mp08.doc testsuites/mptests/mp08/node2/mp08.scn testsuites/mptests/mp08/system.h testsuites/mptests/mp08/task1.c testsuites/mptests/mp09/.cvsignore testsuites/mptests/mp09/Makefile.am testsuites/mptests/mp09/init.c testsuites/mptests/mp09/node1/.cvsignore testsuites/mptests/mp09/node1/Makefile.am testsuites/mptests/mp09/node1/mp09.doc testsuites/mptests/mp09/node1/mp09.scn testsuites/mptests/mp09/node2/.cvsignore testsuites/mptests/mp09/node2/Makefile.am testsuites/mptests/mp09/node2/mp09.doc testsuites/mptests/mp09/node2/mp09.scn testsuites/mptests/mp09/recvmsg.c testsuites/mptests/mp09/sendmsg.c testsuites/mptests/mp09/system.h testsuites/mptests/mp09/task1.c testsuites/mptests/mp10/.cvsignore testsuites/mptests/mp10/Makefile.am testsuites/mptests/mp10/init.c testsuites/mptests/mp10/node1/.cvsignore testsuites/mptests/mp10/node1/Makefile.am testsuites/mptests/mp10/node1/mp10.doc testsuites/mptests/mp10/node1/mp10.scn testsuites/mptests/mp10/node2/.cvsignore testsuites/mptests/mp10/node2/Makefile.am testsuites/mptests/mp10/node2/mp10.doc testsuites/mptests/mp10/node2/mp10.scn testsuites/mptests/mp10/system.h testsuites/mptests/mp10/task1.c testsuites/mptests/mp10/task2.c testsuites/mptests/mp10/task3.c testsuites/mptests/mp11/.cvsignore testsuites/mptests/mp11/Makefile.am testsuites/mptests/mp11/init.c testsuites/mptests/mp11/node1/.cvsignore testsuites/mptests/mp11/node1/Makefile.am testsuites/mptests/mp11/node1/mp11.doc testsuites/mptests/mp11/node1/mp11.scn testsuites/mptests/mp11/node2/.cvsignore testsuites/mptests/mp11/node2/Makefile.am testsuites/mptests/mp11/node2/mp11.doc testsuites/mptests/mp11/node2/mp11.scn testsuites/mptests/mp11/system.h testsuites/mptests/mp12/.cvsignore testsuites/mptests/mp12/Makefile.am testsuites/mptests/mp12/init.c testsuites/mptests/mp12/node1/.cvsignore testsuites/mptests/mp12/node1/Makefile.am testsuites/mptests/mp12/node1/mp12.doc testsuites/mptests/mp12/node1/mp12.scn testsuites/mptests/mp12/node2/.cvsignore testsuites/mptests/mp12/node2/Makefile.am testsuites/mptests/mp12/node2/mp12.doc testsuites/mptests/mp12/node2/mp12.scn testsuites/mptests/mp12/system.h testsuites/mptests/mp13/.cvsignore testsuites/mptests/mp13/Makefile.am testsuites/mptests/mp13/init.c testsuites/mptests/mp13/node1/.cvsignore testsuites/mptests/mp13/node1/Makefile.am testsuites/mptests/mp13/node1/mp13.doc testsuites/mptests/mp13/node1/mp13.scn testsuites/mptests/mp13/node2/.cvsignore testsuites/mptests/mp13/node2/Makefile.am testsuites/mptests/mp13/node2/mp13.doc testsuites/mptests/mp13/node2/mp13.scn testsuites/mptests/mp13/system.h testsuites/mptests/mp13/task1.c testsuites/mptests/mp13/task2.c testsuites/mptests/mp14/.cvsignore testsuites/mptests/mp14/Makefile.am testsuites/mptests/mp14/delay.c testsuites/mptests/mp14/evtask1.c testsuites/mptests/mp14/evtmtask.c testsuites/mptests/mp14/exit.c testsuites/mptests/mp14/init.c testsuites/mptests/mp14/msgtask1.c testsuites/mptests/mp14/node1/.cvsignore testsuites/mptests/mp14/node1/Makefile.am testsuites/mptests/mp14/node1/mp14.doc testsuites/mptests/mp14/node1/mp14.scn testsuites/mptests/mp14/node2/.cvsignore testsuites/mptests/mp14/node2/Makefile.am testsuites/mptests/mp14/node2/mp14.doc testsuites/mptests/mp14/node2/mp14.scn testsuites/mptests/mp14/pttask1.c testsuites/mptests/mp14/smtask1.c testsuites/mptests/mp14/system.h testsuites/mptests/mptests.am testsuites/psxtests/.cvsignore testsuites/psxtests/ChangeLog testsuites/psxtests/Makefile.am testsuites/psxtests/configure.ac testsuites/psxtests/include/.cvsignore testsuites/psxtests/include/Makefile.am testsuites/psxtests/include/pmacros.h testsuites/psxtests/psx01/.cvsignore testsuites/psxtests/psx01/Makefile.am testsuites/psxtests/psx01/init.c testsuites/psxtests/psx01/psx01.scn testsuites/psxtests/psx01/system.h testsuites/psxtests/psx01/task.c testsuites/psxtests/psx02/.cvsignore testsuites/psxtests/psx02/Makefile.am testsuites/psxtests/psx02/init.c testsuites/psxtests/psx02/psx02.scn testsuites/psxtests/psx02/system.h testsuites/psxtests/psx02/task.c testsuites/psxtests/psx03/.cvsignore testsuites/psxtests/psx03/Makefile.am testsuites/psxtests/psx03/init.c testsuites/psxtests/psx03/psx03.scn testsuites/psxtests/psx03/system.h testsuites/psxtests/psx03/task.c testsuites/psxtests/psx04/.cvsignore testsuites/psxtests/psx04/Makefile.am testsuites/psxtests/psx04/init.c testsuites/psxtests/psx04/psx04.scn testsuites/psxtests/psx04/system.h testsuites/psxtests/psx04/task1.c testsuites/psxtests/psx04/task2.c testsuites/psxtests/psx04/task3.c testsuites/psxtests/psx05/.cvsignore testsuites/psxtests/psx05/Makefile.am testsuites/psxtests/psx05/init.c testsuites/psxtests/psx05/psx05.scn testsuites/psxtests/psx05/system.h testsuites/psxtests/psx05/task.c testsuites/psxtests/psx05/task2.c testsuites/psxtests/psx05/task3.c testsuites/psxtests/psx06/.cvsignore testsuites/psxtests/psx06/Makefile.am testsuites/psxtests/psx06/init.c testsuites/psxtests/psx06/psx06.scn testsuites/psxtests/psx06/system.h testsuites/psxtests/psx06/task.c testsuites/psxtests/psx06/task2.c testsuites/psxtests/psx07/.cvsignore testsuites/psxtests/psx07/Makefile.am testsuites/psxtests/psx07/init.c testsuites/psxtests/psx07/psx07.scn testsuites/psxtests/psx07/system.h testsuites/psxtests/psx07/task.c testsuites/psxtests/psx08/.cvsignore testsuites/psxtests/psx08/Makefile.am testsuites/psxtests/psx08/init.c testsuites/psxtests/psx08/psx08.scn testsuites/psxtests/psx08/system.h testsuites/psxtests/psx08/task1.c testsuites/psxtests/psx08/task2.c testsuites/psxtests/psx08/task3.c testsuites/psxtests/psx09/.cvsignore testsuites/psxtests/psx09/Makefile.am testsuites/psxtests/psx09/init.c testsuites/psxtests/psx09/psx09.scn testsuites/psxtests/psx09/system.h testsuites/psxtests/psx10/.cvsignore testsuites/psxtests/psx10/Makefile.am testsuites/psxtests/psx10/init.c testsuites/psxtests/psx10/psx10.scn testsuites/psxtests/psx10/system.h testsuites/psxtests/psx10/task.c testsuites/psxtests/psx10/task2.c testsuites/psxtests/psx10/task3.c testsuites/psxtests/psx11/.cvsignore testsuites/psxtests/psx11/Makefile.am testsuites/psxtests/psx11/init.c testsuites/psxtests/psx11/psx11.scn testsuites/psxtests/psx11/system.h testsuites/psxtests/psx11/task.c testsuites/psxtests/psx12/.cvsignore testsuites/psxtests/psx12/Makefile.am testsuites/psxtests/psx12/init.c testsuites/psxtests/psx12/psx12.scn testsuites/psxtests/psx12/system.h testsuites/psxtests/psx12/task.c testsuites/psxtests/psx13/.cvsignore testsuites/psxtests/psx13/Makefile.am testsuites/psxtests/psx13/main.c testsuites/psxtests/psx13/psx13.scn testsuites/psxtests/psx13/test.c testsuites/psxtests/psxcancel/.cvsignore testsuites/psxtests/psxcancel/Makefile.am testsuites/psxtests/psxcancel/init.c testsuites/psxtests/psxcancel/psxcancel.scn testsuites/psxtests/psxchroot01/.cvsignore testsuites/psxtests/psxchroot01/Makefile.am testsuites/psxtests/psxchroot01/main.c testsuites/psxtests/psxchroot01/psxchroot01.scn testsuites/psxtests/psxchroot01/test.c testsuites/psxtests/psxfile01/.cvsignore testsuites/psxtests/psxfile01/Makefile.am testsuites/psxtests/psxfile01/main.c testsuites/psxtests/psxfile01/psxfile01.scn testsuites/psxtests/psxfile01/test.c testsuites/psxtests/psxfile01/test_cat.c testsuites/psxtests/psxfile01/test_extend.c testsuites/psxtests/psxfile01/test_write.c testsuites/psxtests/psxhdrs/.cvsignore testsuites/psxtests/psxhdrs/Makefile.am testsuites/psxtests/psxhdrs/clock01.c testsuites/psxtests/psxhdrs/clock02.c testsuites/psxtests/psxhdrs/clock03.c testsuites/psxtests/psxhdrs/clock04.c testsuites/psxtests/psxhdrs/clock05.c testsuites/psxtests/psxhdrs/clock06.c testsuites/psxtests/psxhdrs/cond01.c testsuites/psxtests/psxhdrs/cond02.c testsuites/psxtests/psxhdrs/cond03.c testsuites/psxtests/psxhdrs/cond04.c testsuites/psxtests/psxhdrs/cond05.c testsuites/psxtests/psxhdrs/cond06.c testsuites/psxtests/psxhdrs/cond07.c testsuites/psxtests/psxhdrs/cond08.c testsuites/psxtests/psxhdrs/cond09.c testsuites/psxtests/psxhdrs/cond10.c testsuites/psxtests/psxhdrs/key01.c testsuites/psxtests/psxhdrs/key02.c testsuites/psxtests/psxhdrs/key03.c testsuites/psxtests/psxhdrs/key04.c testsuites/psxtests/psxhdrs/mutex01.c testsuites/psxtests/psxhdrs/mutex02.c testsuites/psxtests/psxhdrs/mutex03.c testsuites/psxtests/psxhdrs/mutex04.c testsuites/psxtests/psxhdrs/mutex05.c testsuites/psxtests/psxhdrs/mutex06.c testsuites/psxtests/psxhdrs/mutex07.c testsuites/psxtests/psxhdrs/mutex08.c testsuites/psxtests/psxhdrs/mutex09.c testsuites/psxtests/psxhdrs/mutex10.c testsuites/psxtests/psxhdrs/mutex11.c testsuites/psxtests/psxhdrs/mutex12.c testsuites/psxtests/psxhdrs/mutex13.c testsuites/psxtests/psxhdrs/mutex14.c testsuites/psxtests/psxhdrs/mutex15.c testsuites/psxtests/psxhdrs/mutex16.c testsuites/psxtests/psxhdrs/proc01.c testsuites/psxtests/psxhdrs/proc02.c testsuites/psxtests/psxhdrs/proc03.c testsuites/psxtests/psxhdrs/proc04.c testsuites/psxtests/psxhdrs/proc05.c testsuites/psxtests/psxhdrs/proc06.c testsuites/psxtests/psxhdrs/proc07.c testsuites/psxtests/psxhdrs/proc08.c testsuites/psxtests/psxhdrs/proc09.c testsuites/psxtests/psxhdrs/proc10.c testsuites/psxtests/psxhdrs/proc11.c testsuites/psxtests/psxhdrs/proc12.c testsuites/psxtests/psxhdrs/proc13.c testsuites/psxtests/psxhdrs/proc14.c testsuites/psxtests/psxhdrs/pthread01.c testsuites/psxtests/psxhdrs/pthread02.c testsuites/psxtests/psxhdrs/pthread03.c testsuites/psxtests/psxhdrs/pthread04.c testsuites/psxtests/psxhdrs/pthread05.c testsuites/psxtests/psxhdrs/pthread06.c testsuites/psxtests/psxhdrs/pthread07.c testsuites/psxtests/psxhdrs/pthread08.c testsuites/psxtests/psxhdrs/pthread09.c testsuites/psxtests/psxhdrs/pthread10.c testsuites/psxtests/psxhdrs/pthread11.c testsuites/psxtests/psxhdrs/pthread12.c testsuites/psxtests/psxhdrs/pthread13.c testsuites/psxtests/psxhdrs/pthread14.c testsuites/psxtests/psxhdrs/pthread15.c testsuites/psxtests/psxhdrs/pthread16.c testsuites/psxtests/psxhdrs/pthread17.c testsuites/psxtests/psxhdrs/pthread18.c testsuites/psxtests/psxhdrs/pthread19.c testsuites/psxtests/psxhdrs/pthread20.c testsuites/psxtests/psxhdrs/pthread21.c testsuites/psxtests/psxhdrs/pthread22.c testsuites/psxtests/psxhdrs/pthread23.c testsuites/psxtests/psxhdrs/pthread24.c testsuites/psxtests/psxhdrs/pthread25.c testsuites/psxtests/psxhdrs/pthread26.c testsuites/psxtests/psxhdrs/pthread27.c testsuites/psxtests/psxhdrs/pthread28.c testsuites/psxtests/psxhdrs/pthread29.c testsuites/psxtests/psxhdrs/pthread30.c testsuites/psxtests/psxhdrs/pthread31.c testsuites/psxtests/psxhdrs/pthread32.c testsuites/psxtests/psxhdrs/pthread33.c testsuites/psxtests/psxhdrs/pthread34.c testsuites/psxtests/psxhdrs/pthread35.c testsuites/psxtests/psxhdrs/pthread36.c testsuites/psxtests/psxhdrs/sched01.c testsuites/psxtests/psxhdrs/sched02.c testsuites/psxtests/psxhdrs/sched03.c testsuites/psxtests/psxhdrs/sched04.c testsuites/psxtests/psxhdrs/sched05.c testsuites/psxtests/psxhdrs/sched06.c testsuites/psxtests/psxhdrs/sched07.c testsuites/psxtests/psxhdrs/sched08.c testsuites/psxtests/psxhdrs/signal01.c testsuites/psxtests/psxhdrs/signal02.c testsuites/psxtests/psxhdrs/signal03.c testsuites/psxtests/psxhdrs/signal04.c testsuites/psxtests/psxhdrs/signal05.c testsuites/psxtests/psxhdrs/signal06.c testsuites/psxtests/psxhdrs/signal07.c testsuites/psxtests/psxhdrs/signal08.c testsuites/psxtests/psxhdrs/signal09.c testsuites/psxtests/psxhdrs/signal10.c testsuites/psxtests/psxhdrs/signal11.c testsuites/psxtests/psxhdrs/signal12.c testsuites/psxtests/psxhdrs/signal13.c testsuites/psxtests/psxhdrs/signal14.c testsuites/psxtests/psxhdrs/signal15.c testsuites/psxtests/psxhdrs/signal16.c testsuites/psxtests/psxhdrs/signal17.c testsuites/psxtests/psxhdrs/signal18.c testsuites/psxtests/psxhdrs/signal19.c testsuites/psxtests/psxhdrs/signal20.c testsuites/psxtests/psxhdrs/signal21.c testsuites/psxtests/psxhdrs/signal22.c testsuites/psxtests/psxhdrs/time01.c testsuites/psxtests/psxhdrs/time02.c testsuites/psxtests/psxhdrs/time03.c testsuites/psxtests/psxhdrs/time04.c testsuites/psxtests/psxhdrs/time05.c testsuites/psxtests/psxhdrs/time06.c testsuites/psxtests/psxhdrs/time07.c testsuites/psxtests/psxhdrs/time08.c testsuites/psxtests/psxhdrs/time09.c testsuites/psxtests/psxhdrs/time10.c testsuites/psxtests/psxhdrs/time11.c testsuites/psxtests/psxhdrs/time12.c testsuites/psxtests/psxhdrs/time13.c testsuites/psxtests/psxhdrs/timer01.c testsuites/psxtests/psxhdrs/timer02.c testsuites/psxtests/psxhdrs/timer03.c testsuites/psxtests/psxhdrs/timer04.c testsuites/psxtests/psxhdrs/timer05.c testsuites/psxtests/psxhdrs/timer06.c testsuites/psxtests/psxmount/.cvsignore testsuites/psxtests/psxmount/Makefile.am testsuites/psxtests/psxmount/main.c testsuites/psxtests/psxmount/psxmount.scn testsuites/psxtests/psxmount/test.c testsuites/psxtests/psxmsgq01/.cvsignore testsuites/psxtests/psxmsgq01/Makefile.am testsuites/psxtests/psxmsgq01/init.c testsuites/psxtests/psxmsgq01/psxmsgq01.scn testsuites/psxtests/psxmsgq01/system.h testsuites/psxtests/psxreaddir/.cvsignore testsuites/psxtests/psxreaddir/Makefile.am testsuites/psxtests/psxreaddir/main.c testsuites/psxtests/psxreaddir/psxreaddir.scn testsuites/psxtests/psxreaddir/test.c testsuites/psxtests/psxsem01/.cvsignore testsuites/psxtests/psxsem01/Makefile.am testsuites/psxtests/psxsem01/init.c testsuites/psxtests/psxsem01/psxsem01.scn testsuites/psxtests/psxsem01/system.h testsuites/psxtests/psxstat/.cvsignore testsuites/psxtests/psxstat/Makefile.am testsuites/psxtests/psxstat/main.c testsuites/psxtests/psxstat/psxstat.scn testsuites/psxtests/psxstat/test.c testsuites/psxtests/psxtests.am testsuites/psxtests/psxtime/.cvsignore testsuites/psxtests/psxtime/Makefile.am testsuites/psxtests/psxtime/main.c testsuites/psxtests/psxtime/psxtime.scn testsuites/psxtests/psxtime/test.c testsuites/psxtests/psxtimer/.cvsignore testsuites/psxtests/psxtimer/Makefile.am testsuites/psxtests/psxtimer/psxtimer.c testsuites/psxtests/psxtimer/psxtimer.scn testsuites/psxtests/psxtimer/system.h testsuites/samples/.cvsignore testsuites/samples/ChangeLog testsuites/samples/Makefile.am testsuites/samples/README testsuites/samples/base_mp/.cvsignore testsuites/samples/base_mp/Makefile.am testsuites/samples/base_mp/apptask.c testsuites/samples/base_mp/init.c testsuites/samples/base_mp/node1/.cvsignore testsuites/samples/base_mp/node1/Makefile.am testsuites/samples/base_mp/node1/base_mp.doc testsuites/samples/base_mp/node1/base_mp.scn testsuites/samples/base_mp/node2/.cvsignore testsuites/samples/base_mp/node2/Makefile.am testsuites/samples/base_mp/node2/base_mp.doc testsuites/samples/base_mp/node2/base_mp.scn testsuites/samples/base_mp/system.h testsuites/samples/base_sp/.cvsignore testsuites/samples/base_sp/Makefile.am testsuites/samples/base_sp/apptask.c testsuites/samples/base_sp/base_sp.doc testsuites/samples/base_sp/base_sp.scn testsuites/samples/base_sp/init.c testsuites/samples/base_sp/system.h testsuites/samples/cdtest/.cvsignore testsuites/samples/cdtest/Makefile.am testsuites/samples/cdtest/cdtest.scn testsuites/samples/cdtest/init.c testsuites/samples/cdtest/main.cc testsuites/samples/cdtest/system.h testsuites/samples/configure.ac testsuites/samples/hello/.cvsignore testsuites/samples/hello/Makefile.am testsuites/samples/hello/hello.doc testsuites/samples/hello/hello.scn testsuites/samples/hello/init.c testsuites/samples/hello/system.h testsuites/samples/loopback/.cvsignore testsuites/samples/loopback/Makefile.am testsuites/samples/loopback/README testsuites/samples/loopback/init.c testsuites/samples/loopback/loopback.scn testsuites/samples/minimum/.cvsignore testsuites/samples/minimum/Makefile.am testsuites/samples/minimum/init.c testsuites/samples/minimum/minimum.doc testsuites/samples/minimum/minimum.scn testsuites/samples/paranoia/.cvsignore testsuites/samples/paranoia/Makefile.am testsuites/samples/paranoia/init.c testsuites/samples/paranoia/paranoia.c testsuites/samples/paranoia/paranoia.doc testsuites/samples/paranoia/system.h testsuites/samples/sample.am testsuites/samples/ticker/.cvsignore testsuites/samples/ticker/Makefile.am testsuites/samples/ticker/init.c testsuites/samples/ticker/system.h testsuites/samples/ticker/tasks.c testsuites/samples/ticker/ticker.doc testsuites/samples/ticker/ticker.scn testsuites/samples/unlimited/.cvsignore testsuites/samples/unlimited/Makefile.am testsuites/samples/unlimited/init.c testsuites/samples/unlimited/system.h testsuites/samples/unlimited/test1.c testsuites/samples/unlimited/test2.c testsuites/samples/unlimited/test3.c testsuites/samples/unlimited/unlimited.doc testsuites/samples/unlimited/unlimited.scn testsuites/sptests/.cvsignore testsuites/sptests/ChangeLog testsuites/sptests/Makefile.am testsuites/sptests/README testsuites/sptests/configure.ac testsuites/sptests/sp01/.cvsignore testsuites/sptests/sp01/Makefile.am testsuites/sptests/sp01/init.c testsuites/sptests/sp01/sp01.doc testsuites/sptests/sp01/sp01.scn testsuites/sptests/sp01/system.h testsuites/sptests/sp01/task1.c testsuites/sptests/sp02/.cvsignore testsuites/sptests/sp02/Makefile.am testsuites/sptests/sp02/init.c testsuites/sptests/sp02/preempt.c testsuites/sptests/sp02/sp02.doc testsuites/sptests/sp02/sp02.scn testsuites/sptests/sp02/system.h testsuites/sptests/sp02/task1.c testsuites/sptests/sp02/task2.c testsuites/sptests/sp02/task3.c testsuites/sptests/sp03/.cvsignore testsuites/sptests/sp03/Makefile.am testsuites/sptests/sp03/init.c testsuites/sptests/sp03/sp03.doc testsuites/sptests/sp03/sp03.scn testsuites/sptests/sp03/system.h testsuites/sptests/sp03/task1.c testsuites/sptests/sp03/task2.c testsuites/sptests/sp04/.cvsignore testsuites/sptests/sp04/Makefile.am testsuites/sptests/sp04/init.c testsuites/sptests/sp04/sp04.doc testsuites/sptests/sp04/sp04.scn testsuites/sptests/sp04/system.h testsuites/sptests/sp04/task1.c testsuites/sptests/sp04/task2.c testsuites/sptests/sp04/task3.c testsuites/sptests/sp04/tswitch.c testsuites/sptests/sp05/.cvsignore testsuites/sptests/sp05/Makefile.am testsuites/sptests/sp05/init.c testsuites/sptests/sp05/sp05.doc testsuites/sptests/sp05/sp05.scn testsuites/sptests/sp05/system.h testsuites/sptests/sp05/task1.c testsuites/sptests/sp05/task2.c testsuites/sptests/sp05/task3.c testsuites/sptests/sp06/.cvsignore testsuites/sptests/sp06/Makefile.am testsuites/sptests/sp06/init.c testsuites/sptests/sp06/sp06.doc testsuites/sptests/sp06/sp06.scn testsuites/sptests/sp06/system.h testsuites/sptests/sp06/task1.c testsuites/sptests/sp06/task2.c testsuites/sptests/sp06/task3.c testsuites/sptests/sp07/.cvsignore testsuites/sptests/sp07/Makefile.am testsuites/sptests/sp07/init.c testsuites/sptests/sp07/sp07.doc testsuites/sptests/sp07/sp07.scn testsuites/sptests/sp07/system.h testsuites/sptests/sp07/task1.c testsuites/sptests/sp07/task2.c testsuites/sptests/sp07/task3.c testsuites/sptests/sp07/task4.c testsuites/sptests/sp07/taskexit.c testsuites/sptests/sp07/tcreate.c testsuites/sptests/sp07/tdelete.c testsuites/sptests/sp07/trestart.c testsuites/sptests/sp07/tstart.c testsuites/sptests/sp08/.cvsignore testsuites/sptests/sp08/Makefile.am testsuites/sptests/sp08/init.c testsuites/sptests/sp08/sp08.doc testsuites/sptests/sp08/sp08.scn testsuites/sptests/sp08/system.h testsuites/sptests/sp08/task1.c testsuites/sptests/sp09/.cvsignore testsuites/sptests/sp09/Makefile.am testsuites/sptests/sp09/delay.c testsuites/sptests/sp09/init.c testsuites/sptests/sp09/isr.c testsuites/sptests/sp09/screen01.c testsuites/sptests/sp09/screen02.c testsuites/sptests/sp09/screen03.c testsuites/sptests/sp09/screen04.c testsuites/sptests/sp09/screen05.c testsuites/sptests/sp09/screen06.c testsuites/sptests/sp09/screen07.c testsuites/sptests/sp09/screen08.c testsuites/sptests/sp09/screen09.c testsuites/sptests/sp09/screen10.c testsuites/sptests/sp09/screen11.c testsuites/sptests/sp09/screen12.c testsuites/sptests/sp09/screen13.c testsuites/sptests/sp09/screen14.c testsuites/sptests/sp09/sp09.doc testsuites/sptests/sp09/sp09.scn testsuites/sptests/sp09/system.h testsuites/sptests/sp09/task1.c testsuites/sptests/sp09/task2.c testsuites/sptests/sp09/task3.c testsuites/sptests/sp09/task4.c testsuites/sptests/sp11/.cvsignore testsuites/sptests/sp11/Makefile.am testsuites/sptests/sp11/init.c testsuites/sptests/sp11/sp11.doc testsuites/sptests/sp11/sp11.scn testsuites/sptests/sp11/system.h testsuites/sptests/sp11/task1.c testsuites/sptests/sp11/task2.c testsuites/sptests/sp11/timer.c testsuites/sptests/sp12/.cvsignore testsuites/sptests/sp12/Makefile.am testsuites/sptests/sp12/init.c testsuites/sptests/sp12/pridrv.c testsuites/sptests/sp12/pritask.c testsuites/sptests/sp12/sp12.doc testsuites/sptests/sp12/sp12.scn testsuites/sptests/sp12/system.h testsuites/sptests/sp12/task1.c testsuites/sptests/sp12/task2.c testsuites/sptests/sp12/task3.c testsuites/sptests/sp12/task4.c testsuites/sptests/sp12/task5.c testsuites/sptests/sp13/.cvsignore testsuites/sptests/sp13/Makefile.am testsuites/sptests/sp13/fillbuff.c testsuites/sptests/sp13/init.c testsuites/sptests/sp13/putbuff.c testsuites/sptests/sp13/sp13.doc testsuites/sptests/sp13/sp13.scn testsuites/sptests/sp13/system.h testsuites/sptests/sp13/task1.c testsuites/sptests/sp13/task2.c testsuites/sptests/sp13/task3.c testsuites/sptests/sp14/.cvsignore testsuites/sptests/sp14/Makefile.am testsuites/sptests/sp14/asr.c testsuites/sptests/sp14/init.c testsuites/sptests/sp14/sp14.doc testsuites/sptests/sp14/sp14.scn testsuites/sptests/sp14/system.h testsuites/sptests/sp14/task1.c testsuites/sptests/sp14/task2.c testsuites/sptests/sp15/.cvsignore testsuites/sptests/sp15/Makefile.am testsuites/sptests/sp15/init.c testsuites/sptests/sp15/sp15.doc testsuites/sptests/sp15/sp15.scn testsuites/sptests/sp15/system.h testsuites/sptests/sp15/task1.c testsuites/sptests/sp16/.cvsignore testsuites/sptests/sp16/Makefile.am testsuites/sptests/sp16/init.c testsuites/sptests/sp16/sp16.doc testsuites/sptests/sp16/sp16.scn testsuites/sptests/sp16/system.h testsuites/sptests/sp16/task1.c testsuites/sptests/sp16/task2.c testsuites/sptests/sp16/task3.c testsuites/sptests/sp16/task4.c testsuites/sptests/sp16/task5.c testsuites/sptests/sp17/.cvsignore testsuites/sptests/sp17/Makefile.am testsuites/sptests/sp17/asr.c testsuites/sptests/sp17/init.c testsuites/sptests/sp17/sp17.doc testsuites/sptests/sp17/sp17.scn testsuites/sptests/sp17/system.h testsuites/sptests/sp17/task1.c testsuites/sptests/sp17/task2.c testsuites/sptests/sp19/.cvsignore testsuites/sptests/sp19/Makefile.am testsuites/sptests/sp19/first.c testsuites/sptests/sp19/fptask.c testsuites/sptests/sp19/fptest.h testsuites/sptests/sp19/init.c testsuites/sptests/sp19/inttest.h testsuites/sptests/sp19/sp19.doc testsuites/sptests/sp19/sp19.scn testsuites/sptests/sp19/system.h testsuites/sptests/sp19/task1.c testsuites/sptests/sp20/.cvsignore testsuites/sptests/sp20/Makefile.am testsuites/sptests/sp20/getall.c testsuites/sptests/sp20/init.c testsuites/sptests/sp20/sp20.doc testsuites/sptests/sp20/sp20.scn testsuites/sptests/sp20/system.h testsuites/sptests/sp20/task1.c testsuites/sptests/sp21/.cvsignore testsuites/sptests/sp21/Makefile.am testsuites/sptests/sp21/init.c testsuites/sptests/sp21/sp21.doc testsuites/sptests/sp21/sp21.scn testsuites/sptests/sp21/system.h testsuites/sptests/sp21/task1.c testsuites/sptests/sp22/.cvsignore testsuites/sptests/sp22/Makefile.am testsuites/sptests/sp22/delay.c testsuites/sptests/sp22/init.c testsuites/sptests/sp22/prtime.c testsuites/sptests/sp22/sp22.doc testsuites/sptests/sp22/sp22.scn testsuites/sptests/sp22/system.h testsuites/sptests/sp22/task1.c testsuites/sptests/sp23/.cvsignore testsuites/sptests/sp23/Makefile.am testsuites/sptests/sp23/init.c testsuites/sptests/sp23/sp23.doc testsuites/sptests/sp23/sp23.scn testsuites/sptests/sp23/system.h testsuites/sptests/sp23/task1.c testsuites/sptests/sp24/.cvsignore testsuites/sptests/sp24/Makefile.am testsuites/sptests/sp24/init.c testsuites/sptests/sp24/resume.c testsuites/sptests/sp24/sp24.doc testsuites/sptests/sp24/sp24.scn testsuites/sptests/sp24/system.h testsuites/sptests/sp24/task1.c testsuites/sptests/sp25/.cvsignore testsuites/sptests/sp25/Makefile.am testsuites/sptests/sp25/init.c testsuites/sptests/sp25/sp25.doc testsuites/sptests/sp25/sp25.scn testsuites/sptests/sp25/system.h testsuites/sptests/sp25/task1.c testsuites/sptests/sp26/.cvsignore testsuites/sptests/sp26/Makefile.am testsuites/sptests/sp26/init.c testsuites/sptests/sp26/sp26.doc testsuites/sptests/sp26/sp26.scn testsuites/sptests/sp26/system.h testsuites/sptests/sp26/task1.c testsuites/sptests/sp27/.cvsignore testsuites/sptests/sp27/Makefile.am testsuites/sptests/sp27/init.c testsuites/sptests/sp27/sp27.doc testsuites/sptests/sp27/sp27.scn testsuites/sptests/sp28/.cvsignore testsuites/sptests/sp28/Makefile.am testsuites/sptests/sp28/init.c testsuites/sptests/sp28/sp28.doc testsuites/sptests/sp28/sp28.scn testsuites/sptests/sp29/.cvsignore testsuites/sptests/sp29/Makefile.am testsuites/sptests/sp29/init.c testsuites/sptests/sp29/sp29.doc testsuites/sptests/sp29/sp29.scn testsuites/sptests/sp30/.cvsignore testsuites/sptests/sp30/Makefile.am testsuites/sptests/sp30/init.c testsuites/sptests/sp30/resume.c testsuites/sptests/sp30/sp30.doc testsuites/sptests/sp30/sp30.scn testsuites/sptests/sp30/system.h testsuites/sptests/sp30/task1.c testsuites/sptests/sp31/.cvsignore testsuites/sptests/sp31/Makefile.am testsuites/sptests/sp31/delay.c testsuites/sptests/sp31/init.c testsuites/sptests/sp31/prtime.c testsuites/sptests/sp31/sp31.doc testsuites/sptests/sp31/sp31.scn testsuites/sptests/sp31/system.h testsuites/sptests/sp31/task1.c testsuites/sptests/sp32/.cvsignore testsuites/sptests/sp32/Makefile.am testsuites/sptests/sp32/init.c testsuites/sptests/sp32/sp32.scn testsuites/sptests/spfatal/.cvsignore testsuites/sptests/spfatal/Makefile.am testsuites/sptests/spfatal/README testsuites/sptests/spfatal/fatal.c testsuites/sptests/spfatal/init.c testsuites/sptests/spfatal/puterr.c testsuites/sptests/spfatal/spfatal.doc testsuites/sptests/spfatal/spfatal.scn testsuites/sptests/spfatal/system.h testsuites/sptests/spfatal/task1.c testsuites/sptests/spsize/.cvsignore testsuites/sptests/spsize/Makefile.am testsuites/sptests/spsize/getint.c testsuites/sptests/spsize/init.c testsuites/sptests/spsize/size.c testsuites/sptests/spsize/size.scn testsuites/sptests/spsize/system.h testsuites/sptests/sptests.am testsuites/support/.cvsignore testsuites/support/ChangeLog testsuites/support/Makefile.am testsuites/support/configure.ac testsuites/support/include/.cvsignore testsuites/support/include/buffer_test_io.h testsuites/support/include/tmacros.h testsuites/tmitrontests/.cvsignore testsuites/tmitrontests/ChangeLog testsuites/tmitrontests/Makefile.am testsuites/tmitrontests/README testsuites/tmitrontests/configure.ac testsuites/tmitrontests/include/.cvsignore testsuites/tmitrontests/include/Makefile.am testsuites/tmitrontests/include/timesys.h testsuites/tmitrontests/tmitronsem01/.cvsignore testsuites/tmitrontests/tmitronsem01/Makefile.am testsuites/tmitrontests/tmitronsem01/init.c testsuites/tmitrontests/tmitronsem01/system.h testsuites/tmitrontests/tmitronsem01/tmitronsem01.doc testsuites/tmitrontests/tmitrontests.am testsuites/tmtests/.cvsignore testsuites/tmtests/ChangeLog testsuites/tmtests/Makefile.am testsuites/tmtests/README testsuites/tmtests/configure.ac testsuites/tmtests/include/.cvsignore testsuites/tmtests/include/Makefile.am testsuites/tmtests/include/timesys.h testsuites/tmtests/tm01/.cvsignore testsuites/tmtests/tm01/Makefile.am testsuites/tmtests/tm01/system.h testsuites/tmtests/tm01/task1.c testsuites/tmtests/tm01/tm01.doc testsuites/tmtests/tm02/.cvsignore testsuites/tmtests/tm02/Makefile.am testsuites/tmtests/tm02/system.h testsuites/tmtests/tm02/task1.c testsuites/tmtests/tm02/tm02.doc testsuites/tmtests/tm03/.cvsignore testsuites/tmtests/tm03/Makefile.am testsuites/tmtests/tm03/system.h testsuites/tmtests/tm03/task1.c testsuites/tmtests/tm03/tm03.doc testsuites/tmtests/tm04/.cvsignore testsuites/tmtests/tm04/Makefile.am testsuites/tmtests/tm04/system.h testsuites/tmtests/tm04/task1.c testsuites/tmtests/tm04/tm04.doc testsuites/tmtests/tm05/.cvsignore testsuites/tmtests/tm05/Makefile.am testsuites/tmtests/tm05/system.h testsuites/tmtests/tm05/task1.c testsuites/tmtests/tm05/tm05.doc testsuites/tmtests/tm06/.cvsignore testsuites/tmtests/tm06/Makefile.am testsuites/tmtests/tm06/system.h testsuites/tmtests/tm06/task1.c testsuites/tmtests/tm06/tm06.doc testsuites/tmtests/tm07/.cvsignore testsuites/tmtests/tm07/Makefile.am testsuites/tmtests/tm07/system.h testsuites/tmtests/tm07/task1.c testsuites/tmtests/tm07/tm07.doc testsuites/tmtests/tm08/.cvsignore testsuites/tmtests/tm08/Makefile.am testsuites/tmtests/tm08/system.h testsuites/tmtests/tm08/task1.c testsuites/tmtests/tm08/tm08.doc testsuites/tmtests/tm09/.cvsignore testsuites/tmtests/tm09/Makefile.am testsuites/tmtests/tm09/system.h testsuites/tmtests/tm09/task1.c testsuites/tmtests/tm09/tm09.doc testsuites/tmtests/tm10/.cvsignore testsuites/tmtests/tm10/Makefile.am testsuites/tmtests/tm10/system.h testsuites/tmtests/tm10/task1.c testsuites/tmtests/tm10/tm10.doc testsuites/tmtests/tm11/.cvsignore testsuites/tmtests/tm11/Makefile.am testsuites/tmtests/tm11/system.h testsuites/tmtests/tm11/task1.c testsuites/tmtests/tm11/tm11.doc testsuites/tmtests/tm12/.cvsignore testsuites/tmtests/tm12/Makefile.am testsuites/tmtests/tm12/system.h testsuites/tmtests/tm12/task1.c testsuites/tmtests/tm12/tm12.doc testsuites/tmtests/tm13/.cvsignore testsuites/tmtests/tm13/Makefile.am testsuites/tmtests/tm13/system.h testsuites/tmtests/tm13/task1.c testsuites/tmtests/tm13/tm13.doc testsuites/tmtests/tm14/.cvsignore testsuites/tmtests/tm14/Makefile.am testsuites/tmtests/tm14/system.h testsuites/tmtests/tm14/task1.c testsuites/tmtests/tm14/tm14.doc testsuites/tmtests/tm15/.cvsignore testsuites/tmtests/tm15/Makefile.am testsuites/tmtests/tm15/system.h testsuites/tmtests/tm15/task1.c testsuites/tmtests/tm15/tm15.doc testsuites/tmtests/tm16/.cvsignore testsuites/tmtests/tm16/Makefile.am testsuites/tmtests/tm16/system.h testsuites/tmtests/tm16/task1.c testsuites/tmtests/tm16/tm16.doc testsuites/tmtests/tm17/.cvsignore testsuites/tmtests/tm17/Makefile.am testsuites/tmtests/tm17/system.h testsuites/tmtests/tm17/task1.c testsuites/tmtests/tm17/tm17.doc testsuites/tmtests/tm18/.cvsignore testsuites/tmtests/tm18/Makefile.am testsuites/tmtests/tm18/system.h testsuites/tmtests/tm18/task1.c testsuites/tmtests/tm18/tm18.doc testsuites/tmtests/tm19/.cvsignore testsuites/tmtests/tm19/Makefile.am testsuites/tmtests/tm19/system.h testsuites/tmtests/tm19/task1.c testsuites/tmtests/tm19/tm19.doc testsuites/tmtests/tm20/.cvsignore testsuites/tmtests/tm20/Makefile.am testsuites/tmtests/tm20/system.h testsuites/tmtests/tm20/task1.c testsuites/tmtests/tm20/tm20.doc testsuites/tmtests/tm21/.cvsignore testsuites/tmtests/tm21/Makefile.am testsuites/tmtests/tm21/system.h testsuites/tmtests/tm21/task1.c testsuites/tmtests/tm21/tm21.doc testsuites/tmtests/tm22/.cvsignore testsuites/tmtests/tm22/Makefile.am testsuites/tmtests/tm22/system.h testsuites/tmtests/tm22/task1.c testsuites/tmtests/tm22/tm22.doc testsuites/tmtests/tm23/.cvsignore testsuites/tmtests/tm23/Makefile.am testsuites/tmtests/tm23/system.h testsuites/tmtests/tm23/task1.c testsuites/tmtests/tm23/tm23.doc testsuites/tmtests/tm24/.cvsignore testsuites/tmtests/tm24/Makefile.am testsuites/tmtests/tm24/system.h testsuites/tmtests/tm24/task1.c testsuites/tmtests/tm24/tm24.doc testsuites/tmtests/tm25/.cvsignore testsuites/tmtests/tm25/Makefile.am testsuites/tmtests/tm25/system.h testsuites/tmtests/tm25/task1.c testsuites/tmtests/tm25/tm25.doc testsuites/tmtests/tm26/.cvsignore testsuites/tmtests/tm26/Makefile.am testsuites/tmtests/tm26/fptest.h testsuites/tmtests/tm26/system.h testsuites/tmtests/tm26/task1.c testsuites/tmtests/tm26/tm26.doc testsuites/tmtests/tm27/.cvsignore testsuites/tmtests/tm27/Makefile.am testsuites/tmtests/tm27/system.h testsuites/tmtests/tm27/task1.c testsuites/tmtests/tm27/tm27.doc testsuites/tmtests/tm28/.cvsignore testsuites/tmtests/tm28/Makefile.am testsuites/tmtests/tm28/system.h testsuites/tmtests/tm28/task1.c testsuites/tmtests/tm28/tm28.doc testsuites/tmtests/tm29/.cvsignore testsuites/tmtests/tm29/Makefile.am testsuites/tmtests/tm29/system.h testsuites/tmtests/tm29/task1.c testsuites/tmtests/tm29/tm29.doc testsuites/tmtests/tmck/.cvsignore testsuites/tmtests/tmck/Makefile.am testsuites/tmtests/tmck/system.h testsuites/tmtests/tmck/task1.c testsuites/tmtests/tmck/tmck.doc testsuites/tmtests/tmoverhd/.cvsignore testsuites/tmtests/tmoverhd/Makefile.am testsuites/tmtests/tmoverhd/dumrtems.h testsuites/tmtests/tmoverhd/empty.c testsuites/tmtests/tmoverhd/system.h testsuites/tmtests/tmoverhd/testtask.c testsuites/tmtests/tmoverhd/tmoverhd.doc testsuites/tmtests/tmtests.am testsuites/tools/.cvsignore testsuites/tools/ChangeLog testsuites/tools/Makefile.am testsuites/tools/configure.ac testsuites/tools/generic/.cvsignore testsuites/tools/generic/ChangeLog testsuites/tools/generic/Makefile.am testsuites/tools/generic/configure.ac testsuites/tools/generic/difftest.in testsuites/tools/generic/sorttimes.in --- bootstrap | 194 -- c/src/ada/.cvsignore | 14 - c/src/ada/ChangeLog | 62 - c/src/ada/Makefile.am | 24 - c/src/ada/rtems-multiprocessing.adb | 38 - c/src/ada/rtems-multiprocessing.ads | 30 - c/src/ada/rtems.adb | 1947 ----------- c/src/ada/rtems.ads | 1457 --------- .../libcpu/powerpc/new-exceptions/ChangeLog | 86 - c/src/lib/libcpu/powerpc/new-exceptions/cpu.c | 148 - .../libcpu/powerpc/new-exceptions/cpu_asm.S | 405 --- .../libcpu/powerpc/old-exceptions/ChangeLog | 78 - .../lib/libcpu/powerpc/old-exceptions/README | 80 - c/src/lib/libcpu/powerpc/old-exceptions/TODO | 8 - c/src/lib/libcpu/powerpc/old-exceptions/cpu.c | 895 ------ .../libcpu/powerpc/old-exceptions/cpu_asm.S | 653 ---- .../libcpu/powerpc/old-exceptions/irq_stub.S | 275 -- .../libcpu/powerpc/old-exceptions/ppccache.c | 61 - .../old-exceptions/rtems/score/ppc_offs.h | 166 - c/src/libchip/shmdr/.cvsignore | 2 - c/src/libchip/shmdr/README | 9 - c/src/libchip/shmdr/addlq.c | 42 - c/src/libchip/shmdr/cnvpkt.c | 41 - c/src/libchip/shmdr/dump.c | 50 - c/src/libchip/shmdr/fatal.c | 38 - c/src/libchip/shmdr/getlq.c | 47 - c/src/libchip/shmdr/getpkt.c | 35 - c/src/libchip/shmdr/init.c | 253 -- c/src/libchip/shmdr/initlq.c | 34 - c/src/libchip/shmdr/intr.c | 57 - c/src/libchip/shmdr/mpci.h | 58 - c/src/libchip/shmdr/mpisr.c | 22 - c/src/libchip/shmdr/poll.c | 52 - c/src/libchip/shmdr/receive.c | 43 - c/src/libchip/shmdr/retpkt.c | 31 - c/src/libchip/shmdr/send.c | 60 - c/src/libchip/shmdr/setckvec.c | 33 - c/src/libchip/shmdr/shm_driver.h | 544 ---- cpukit/ftpd/Makefile.am | 44 - cpukit/ftpd/ftpd.c | 2062 ------------ cpukit/ftpd/ftpd.h | 57 - cpukit/httpd/.cvsignore | 2 - cpukit/httpd/Makefile.am | 59 - cpukit/httpd/NOTES | 29 - cpukit/httpd/asp.c | 319 -- cpukit/httpd/balloc.c | 966 ------ cpukit/httpd/default.c | 402 --- cpukit/httpd/ej.h | 44 - cpukit/httpd/ejIntrn.h | 228 -- cpukit/httpd/ejlex.c | 713 ----- cpukit/httpd/ejparse.c | 1802 ----------- cpukit/httpd/emfdb.c | 1050 ------ cpukit/httpd/emfdb.h | 102 - cpukit/httpd/form.c | 166 - cpukit/httpd/h.c | 193 -- cpukit/httpd/handler.c | 361 --- cpukit/httpd/license.txt | 124 - cpukit/httpd/md5.h | 48 - cpukit/httpd/md5c.c | 335 -- cpukit/httpd/mime.c | 112 - cpukit/httpd/misc.c | 652 ---- cpukit/httpd/ringq.c | 582 ---- cpukit/httpd/rom.c | 191 -- cpukit/httpd/rtems_webserver.h | 7 - cpukit/httpd/security.c | 230 -- cpukit/httpd/sock.c | 789 ----- cpukit/httpd/socket.c | 1018 ------ cpukit/httpd/sym.c | 473 --- cpukit/httpd/uemf.c | 281 -- cpukit/httpd/uemf.h | 1044 ------ cpukit/httpd/um.c | 1415 -------- cpukit/httpd/um.h | 184 -- cpukit/httpd/url.c | 210 -- cpukit/httpd/value.c | 1211 ------- cpukit/httpd/wbase64.c | 147 - cpukit/httpd/webcomp.c | 186 -- cpukit/httpd/webmain.c | 499 --- cpukit/httpd/webpage.c | 140 - cpukit/httpd/webrom.c | 13 - cpukit/httpd/webs.c | 2838 ----------------- cpukit/httpd/webs.h | 229 -- cpukit/httpd/websuemf.c | 210 -- cpukit/httpd/wsIntrn.h | 301 -- cpukit/libnetworking/netinet/in_cksum_arm.h | 276 -- cpukit/libnetworking/netinet/in_cksum_i386.h | 204 -- cpukit/libnetworking/netinet/in_cksum_m68k.h | 223 -- .../libnetworking/netinet/in_cksum_powerpc.h | 173 - cpukit/pppd/Makefile.am | 41 - cpukit/pppd/README | 29 - cpukit/pppd/STATUS | 27 - cpukit/pppd/auth.c | 1121 ------- cpukit/pppd/cbcp.c | 456 --- cpukit/pppd/cbcp.h | 26 - cpukit/pppd/ccp.c | 1227 ------- cpukit/pppd/ccp.h | 48 - cpukit/pppd/chap.c | 860 ----- cpukit/pppd/chap.h | 124 - cpukit/pppd/chap_ms.c | 338 -- cpukit/pppd/chap_ms.h | 33 - cpukit/pppd/chat.c | 818 ----- cpukit/pppd/demand.c | 347 -- cpukit/pppd/example/Makefile-user | 45 - cpukit/pppd/example/README | 15 - cpukit/pppd/example/init.c | 24 - cpukit/pppd/example/netconfig.h | 36 - cpukit/pppd/example/ppp.conf | 27 - cpukit/pppd/example/pppd.options | 9 - cpukit/pppd/example/pppdapp.c | 146 - cpukit/pppd/example/system.h | 42 - cpukit/pppd/fsm.c | 764 ----- cpukit/pppd/fsm.h | 144 - cpukit/pppd/ipcp.c | 1769 ---------- cpukit/pppd/ipcp.h | 73 - cpukit/pppd/ipxcp.c | 1449 --------- cpukit/pppd/ipxcp.h | 71 - cpukit/pppd/lcp.c | 1953 ------------ cpukit/pppd/lcp.h | 88 - cpukit/pppd/magic.c | 85 - cpukit/pppd/magic.h | 23 - cpukit/pppd/md4.c | 298 -- cpukit/pppd/md4.h | 64 - cpukit/pppd/md5.c | 308 -- cpukit/pppd/md5.h | 58 - cpukit/pppd/options.c | 1525 --------- cpukit/pppd/patchlevel.h | 6 - cpukit/pppd/pathnames.h | 43 - cpukit/pppd/pppd.8 | 1480 --------- cpukit/pppd/pppd.h | 664 ---- cpukit/pppd/rtemsdialer.h | 24 - cpukit/pppd/rtemsmain.c | 899 ------ cpukit/pppd/rtemspppd.c | 217 -- cpukit/pppd/rtemspppd.h | 29 - cpukit/pppd/sys-rtems.c | 1330 -------- cpukit/pppd/upap.c | 638 ---- cpukit/pppd/upap.h | 87 - cpukit/pppd/utils.c | 872 ----- cpukit/rtems/src/clocktodtoseconds.c | 64 - cpukit/rtems/src/clocktodvalidate.c | 63 - cpukit/score/cpu/arm/rtems/asm.h | 125 - cpukit/score/cpu/c4x/rtems/asm.h | 101 - cpukit/score/cpu/c4x/rtems/tic4x/c4xio.h | 110 - cpukit/score/cpu/h8300/rtems/asm.h | 123 - cpukit/score/cpu/i386/rtems/asm.h | 138 - cpukit/score/cpu/m68k/rtems/asm.h | 144 - cpukit/score/cpu/m68k/rtems/m68k/m68302.h | 661 ---- cpukit/score/cpu/m68k/rtems/m68k/m68360.h | 889 ------ cpukit/score/cpu/m68k/rtems/m68k/qsm.h | 205 -- cpukit/score/cpu/m68k/rtems/m68k/sim.h | 334 -- cpukit/score/cpu/mips/rtems/asm.h | 159 - cpukit/score/cpu/mips/rtems/mips/idtcpu.h | 478 --- cpukit/score/cpu/mips/rtems/mips/iregdef.h | 332 -- cpukit/score/cpu/no_cpu/rtems/asm.h | 101 - cpukit/score/cpu/or32/rtems/asm.h | 101 - cpukit/score/cpu/powerpc/rtems/asm.h | 292 -- cpukit/score/cpu/sh/rtems/asm.h | 136 - cpukit/score/cpu/sparc/rtems/asm.h | 123 - cpukit/telnetd/Makefile.am | 39 - cpukit/telnetd/README | 28 - cpukit/telnetd/icmds.c | 48 - cpukit/telnetd/pty.c | 407 --- cpukit/telnetd/pty.h | 63 - cpukit/telnetd/telnetd.c | 133 - cpukit/telnetd/telnetd.h | 35 - cpukit/zlib/doc/rfc1950.txt | 619 ---- cpukit/zlib/doc/rfc1951.txt | 955 ------ cpukit/zlib/doc/rfc1952.txt | 675 ---- testsuites/.cvsignore | 14 - testsuites/ChangeLog | 57 - testsuites/Makefile.am | 12 - testsuites/PROBLEMS | 42 - testsuites/README | 44 - testsuites/configure.ac | 63 - testsuites/itrontests/.cvsignore | 14 - testsuites/itrontests/ChangeLog | 120 - testsuites/itrontests/Makefile.am | 13 - testsuites/itrontests/README | 6 - testsuites/itrontests/configure.ac | 49 - testsuites/itrontests/itronhello/.cvsignore | 2 - testsuites/itrontests/itronhello/Makefile.am | 41 - testsuites/itrontests/itronhello/init.c | 33 - .../itrontests/itronhello/itronhello.doc | 23 - .../itrontests/itronhello/itronhello.scn | 3 - testsuites/itrontests/itronhello/system.h | 39 - testsuites/itrontests/itronmbf01/.cvsignore | 2 - testsuites/itrontests/itronmbf01/Makefile.am | 41 - testsuites/itrontests/itronmbf01/init.c | 367 --- .../itrontests/itronmbf01/itronmbf01.doc | 12 - .../itrontests/itronmbf01/itronmbf01.scn | 71 - testsuites/itrontests/itronmbf01/system.h | 40 - testsuites/itrontests/itronmbox01/.cvsignore | 2 - testsuites/itrontests/itronmbox01/Makefile.am | 41 - testsuites/itrontests/itronmbox01/init.c | 36 - .../itrontests/itronmbox01/itronmbox01.doc | 0 .../itrontests/itronmbox01/itronmbox01.scn | 3 - testsuites/itrontests/itronmbox01/system.h | 37 - testsuites/itrontests/itronsem01/.cvsignore | 2 - testsuites/itrontests/itronsem01/Makefile.am | 41 - testsuites/itrontests/itronsem01/init.c | 332 -- .../itrontests/itronsem01/itronsem01.doc | 12 - .../itrontests/itronsem01/itronsem01.scn | 61 - testsuites/itrontests/itronsem01/system.h | 40 - testsuites/itrontests/itrontask01/.cvsignore | 2 - testsuites/itrontests/itrontask01/Makefile.am | 41 - testsuites/itrontests/itrontask01/init.c | 71 - .../itrontests/itrontask01/itrontask01.doc | 61 - .../itrontests/itrontask01/itrontask01.scn | 18 - testsuites/itrontests/itrontask01/system.h | 42 - testsuites/itrontests/itrontask01/task1.c | 54 - testsuites/itrontests/itrontask02/.cvsignore | 2 - testsuites/itrontests/itrontask02/Makefile.am | 41 - testsuites/itrontests/itrontask02/dormant.c | 44 - testsuites/itrontests/itrontask02/init.c | 580 ---- .../itrontests/itrontask02/itrontask02.doc | 34 - .../itrontests/itrontask02/itrontask02.scn | 80 - testsuites/itrontests/itrontask02/system.h | 47 - testsuites/itrontests/itrontask03/.cvsignore | 2 - testsuites/itrontests/itrontask03/Makefile.am | 41 - testsuites/itrontests/itrontask03/init.c | 144 - .../itrontests/itrontask03/itrontask03.doc | 54 - .../itrontests/itrontask03/itrontask03.scn | 21 - testsuites/itrontests/itrontask03/preempt.c | 54 - testsuites/itrontests/itrontask03/system.h | 49 - testsuites/itrontests/itrontask03/task1.c | 57 - testsuites/itrontests/itrontask03/task2.c | 31 - testsuites/itrontests/itrontask03/task3.c | 39 - testsuites/itrontests/itrontask04/.cvsignore | 2 - testsuites/itrontests/itrontask04/Makefile.am | 41 - testsuites/itrontests/itrontask04/init.c | 93 - .../itrontests/itrontask04/itrontask04.doc | 49 - .../itrontests/itrontask04/itrontask04.scn | 35 - testsuites/itrontests/itrontask04/system.h | 47 - testsuites/itrontests/itrontask04/task1.c | 44 - testsuites/itrontests/itrontask04/task2.c | 40 - testsuites/itrontests/itrontask04/task3.c | 53 - testsuites/itrontests/itrontests.am | 25 - testsuites/itrontests/itrontime01/.cvsignore | 2 - testsuites/itrontests/itrontime01/Makefile.am | 41 - testsuites/itrontests/itrontime01/init.c | 62 - .../itrontests/itrontime01/itrontime01.doc | 0 .../itrontests/itrontime01/itrontime01.scn | 4 - testsuites/itrontests/itrontime01/system.h | 37 - testsuites/libtests/.cvsignore | 14 - testsuites/libtests/ChangeLog | 124 - testsuites/libtests/Makefile.am | 13 - testsuites/libtests/README | 10 - testsuites/libtests/configure.ac | 51 - testsuites/libtests/cpuuse/.cvsignore | 2 - testsuites/libtests/cpuuse/Makefile.am | 42 - testsuites/libtests/cpuuse/cpuuse.scn | 34 - testsuites/libtests/cpuuse/init.c | 105 - testsuites/libtests/cpuuse/system.h | 81 - testsuites/libtests/cpuuse/task1.c | 102 - testsuites/libtests/cpuuse/task2.c | 47 - testsuites/libtests/cpuuse/task3.c | 28 - testsuites/libtests/cpuuse/tswitch.c | 65 - testsuites/libtests/libtests.am | 13 - testsuites/libtests/malloctest/.cvsignore | 2 - testsuites/libtests/malloctest/Makefile.am | 42 - testsuites/libtests/malloctest/init.c | 113 - testsuites/libtests/malloctest/malloctest.scn | 468 --- testsuites/libtests/malloctest/system.h | 51 - testsuites/libtests/malloctest/task1.c | 72 - testsuites/libtests/monitor/.cvsignore | 2 - testsuites/libtests/monitor/Makefile.am | 43 - testsuites/libtests/monitor/init.c | 73 - testsuites/libtests/monitor/system.h | 59 - testsuites/libtests/putenvtest/.cvsignore | 2 - testsuites/libtests/putenvtest/Makefile.am | 42 - testsuites/libtests/putenvtest/init.c | 61 - testsuites/libtests/rtems++/.cvsignore | 2 - testsuites/libtests/rtems++/Init.cc | 62 - testsuites/libtests/rtems++/Makefile.am | 48 - testsuites/libtests/rtems++/System.h | 135 - testsuites/libtests/rtems++/Task1.cc | 681 ---- testsuites/libtests/rtems++/Task2.cc | 80 - testsuites/libtests/rtems++/Task3.cc | 80 - testsuites/libtests/rtems++/rtems++.doc | 29 - testsuites/libtests/rtems++/rtems++.scn | 161 - testsuites/libtests/rtmonuse/.cvsignore | 2 - testsuites/libtests/rtmonuse/Makefile.am | 42 - testsuites/libtests/rtmonuse/getall.c | 42 - testsuites/libtests/rtmonuse/init.c | 70 - testsuites/libtests/rtmonuse/rtmonuse.scn | 27 - testsuites/libtests/rtmonuse/system.h | 61 - testsuites/libtests/rtmonuse/task1.c | 123 - testsuites/libtests/stackchk/.cvsignore | 2 - testsuites/libtests/stackchk/Makefile.am | 42 - testsuites/libtests/stackchk/blow.c | 48 - testsuites/libtests/stackchk/init.c | 85 - testsuites/libtests/stackchk/stackchk.scn | 9 - testsuites/libtests/stackchk/system.h | 53 - testsuites/libtests/stackchk/task1.c | 43 - testsuites/libtests/termios/.cvsignore | 2 - testsuites/libtests/termios/Makefile.am | 42 - testsuites/libtests/termios/README | 99 - testsuites/libtests/termios/init.c | 781 ----- testsuites/mptests/.cvsignore | 14 - testsuites/mptests/ChangeLog | 197 -- testsuites/mptests/Makefile.am | 13 - testsuites/mptests/README | 10 - testsuites/mptests/configure.ac | 85 - testsuites/mptests/mp01/.cvsignore | 2 - testsuites/mptests/mp01/Makefile.am | 11 - testsuites/mptests/mp01/init.c | 95 - testsuites/mptests/mp01/node1/.cvsignore | 2 - testsuites/mptests/mp01/node1/Makefile.am | 50 - testsuites/mptests/mp01/node1/mp01.doc | 52 - testsuites/mptests/mp01/node1/mp01.scn | 15 - testsuites/mptests/mp01/node2/.cvsignore | 2 - testsuites/mptests/mp01/node2/Makefile.am | 50 - testsuites/mptests/mp01/node2/mp01.doc | 12 - testsuites/mptests/mp01/node2/mp01.scn | 15 - testsuites/mptests/mp01/system.h | 47 - testsuites/mptests/mp01/task1.c | 83 - testsuites/mptests/mp02/.cvsignore | 2 - testsuites/mptests/mp02/Makefile.am | 11 - testsuites/mptests/mp02/init.c | 59 - testsuites/mptests/mp02/node1/.cvsignore | 2 - testsuites/mptests/mp02/node1/Makefile.am | 50 - testsuites/mptests/mp02/node1/mp02.doc | 46 - testsuites/mptests/mp02/node1/mp02.scn | 14 - testsuites/mptests/mp02/node2/.cvsignore | 2 - testsuites/mptests/mp02/node2/Makefile.am | 50 - testsuites/mptests/mp02/node2/mp02.doc | 12 - testsuites/mptests/mp02/node2/mp02.scn | 14 - testsuites/mptests/mp02/system.h | 46 - testsuites/mptests/mp02/task1.c | 117 - testsuites/mptests/mp03/.cvsignore | 2 - testsuites/mptests/mp03/Makefile.am | 11 - testsuites/mptests/mp03/delay.c | 30 - testsuites/mptests/mp03/init.c | 64 - testsuites/mptests/mp03/node1/.cvsignore | 2 - testsuites/mptests/mp03/node1/Makefile.am | 50 - testsuites/mptests/mp03/node1/mp03.doc | 44 - testsuites/mptests/mp03/node1/mp03.scn | 24 - testsuites/mptests/mp03/node2/.cvsignore | 2 - testsuites/mptests/mp03/node2/Makefile.am | 50 - testsuites/mptests/mp03/node2/mp03.doc | 12 - testsuites/mptests/mp03/node2/mp03.scn | 24 - testsuites/mptests/mp03/system.h | 58 - testsuites/mptests/mp03/task1.c | 154 - testsuites/mptests/mp04/.cvsignore | 2 - testsuites/mptests/mp04/Makefile.am | 11 - testsuites/mptests/mp04/init.c | 59 - testsuites/mptests/mp04/node1/.cvsignore | 2 - testsuites/mptests/mp04/node1/Makefile.am | 50 - testsuites/mptests/mp04/node1/mp04.doc | 40 - testsuites/mptests/mp04/node1/mp04.scn | 8 - testsuites/mptests/mp04/node2/.cvsignore | 2 - testsuites/mptests/mp04/node2/Makefile.am | 50 - testsuites/mptests/mp04/node2/mp04.doc | 12 - testsuites/mptests/mp04/node2/mp04.scn | 8 - testsuites/mptests/mp04/system.h | 47 - testsuites/mptests/mp04/task1.c | 82 - testsuites/mptests/mp05/.cvsignore | 2 - testsuites/mptests/mp05/Makefile.am | 11 - testsuites/mptests/mp05/asr.c | 36 - testsuites/mptests/mp05/init.c | 64 - testsuites/mptests/mp05/node1/.cvsignore | 2 - testsuites/mptests/mp05/node1/Makefile.am | 50 - testsuites/mptests/mp05/node1/mp05.doc | 44 - testsuites/mptests/mp05/node1/mp05.scn | 11 - testsuites/mptests/mp05/node2/.cvsignore | 2 - testsuites/mptests/mp05/node2/Makefile.am | 50 - testsuites/mptests/mp05/node2/mp05.doc | 12 - testsuites/mptests/mp05/node2/mp05.scn | 10 - testsuites/mptests/mp05/system.h | 63 - testsuites/mptests/mp05/task1.c | 105 - testsuites/mptests/mp06/.cvsignore | 2 - testsuites/mptests/mp06/Makefile.am | 11 - testsuites/mptests/mp06/init.c | 64 - testsuites/mptests/mp06/node1/.cvsignore | 2 - testsuites/mptests/mp06/node1/Makefile.am | 50 - testsuites/mptests/mp06/node1/mp06.doc | 44 - testsuites/mptests/mp06/node1/mp06.scn | 11 - testsuites/mptests/mp06/node2/.cvsignore | 2 - testsuites/mptests/mp06/node2/Makefile.am | 50 - testsuites/mptests/mp06/node2/mp06.doc | 12 - testsuites/mptests/mp06/node2/mp06.scn | 12 - testsuites/mptests/mp06/system.h | 52 - testsuites/mptests/mp06/task1.c | 175 - testsuites/mptests/mp07/.cvsignore | 2 - testsuites/mptests/mp07/Makefile.am | 11 - testsuites/mptests/mp07/init.c | 64 - testsuites/mptests/mp07/node1/.cvsignore | 2 - testsuites/mptests/mp07/node1/Makefile.am | 50 - testsuites/mptests/mp07/node1/mp07.doc | 45 - testsuites/mptests/mp07/node1/mp07.scn | 10 - testsuites/mptests/mp07/node2/.cvsignore | 2 - testsuites/mptests/mp07/node2/Makefile.am | 50 - testsuites/mptests/mp07/node2/mp07.doc | 12 - testsuites/mptests/mp07/node2/mp07.scn | 9 - testsuites/mptests/mp07/system.h | 52 - testsuites/mptests/mp07/task1.c | 102 - testsuites/mptests/mp08/.cvsignore | 2 - testsuites/mptests/mp08/Makefile.am | 11 - testsuites/mptests/mp08/init.c | 73 - testsuites/mptests/mp08/node1/.cvsignore | 2 - testsuites/mptests/mp08/node1/Makefile.am | 50 - testsuites/mptests/mp08/node1/mp08.doc | 51 - testsuites/mptests/mp08/node1/mp08.scn | 11 - testsuites/mptests/mp08/node2/.cvsignore | 2 - testsuites/mptests/mp08/node2/Makefile.am | 50 - testsuites/mptests/mp08/node2/mp08.doc | 12 - testsuites/mptests/mp08/node2/mp08.scn | 12 - testsuites/mptests/mp08/system.h | 51 - testsuites/mptests/mp08/task1.c | 88 - testsuites/mptests/mp09/.cvsignore | 2 - testsuites/mptests/mp09/Makefile.am | 11 - testsuites/mptests/mp09/init.c | 73 - testsuites/mptests/mp09/node1/.cvsignore | 2 - testsuites/mptests/mp09/node1/Makefile.am | 50 - testsuites/mptests/mp09/node1/mp09.doc | 49 - testsuites/mptests/mp09/node1/mp09.scn | 22 - testsuites/mptests/mp09/node2/.cvsignore | 2 - testsuites/mptests/mp09/node2/Makefile.am | 50 - testsuites/mptests/mp09/node2/mp09.doc | 12 - testsuites/mptests/mp09/node2/mp09.scn | 27 - testsuites/mptests/mp09/recvmsg.c | 46 - testsuites/mptests/mp09/sendmsg.c | 59 - testsuites/mptests/mp09/system.h | 60 - testsuites/mptests/mp09/task1.c | 108 - testsuites/mptests/mp10/.cvsignore | 2 - testsuites/mptests/mp10/Makefile.am | 11 - testsuites/mptests/mp10/init.c | 142 - testsuites/mptests/mp10/node1/.cvsignore | 2 - testsuites/mptests/mp10/node1/Makefile.am | 50 - testsuites/mptests/mp10/node1/mp10.doc | 45 - testsuites/mptests/mp10/node1/mp10.scn | 4 - testsuites/mptests/mp10/node2/.cvsignore | 2 - testsuites/mptests/mp10/node2/Makefile.am | 50 - testsuites/mptests/mp10/node2/mp10.doc | 12 - testsuites/mptests/mp10/node2/mp10.scn | 19 - testsuites/mptests/mp10/system.h | 66 - testsuites/mptests/mp10/task1.c | 51 - testsuites/mptests/mp10/task2.c | 46 - testsuites/mptests/mp10/task3.c | 49 - testsuites/mptests/mp11/.cvsignore | 2 - testsuites/mptests/mp11/Makefile.am | 11 - testsuites/mptests/mp11/init.c | 104 - testsuites/mptests/mp11/node1/.cvsignore | 2 - testsuites/mptests/mp11/node1/Makefile.am | 50 - testsuites/mptests/mp11/node1/mp11.doc | 41 - testsuites/mptests/mp11/node1/mp11.scn | 10 - testsuites/mptests/mp11/node2/.cvsignore | 2 - testsuites/mptests/mp11/node2/Makefile.am | 50 - testsuites/mptests/mp11/node2/mp11.doc | 12 - testsuites/mptests/mp11/node2/mp11.scn | 2 - testsuites/mptests/mp11/system.h | 56 - testsuites/mptests/mp12/.cvsignore | 2 - testsuites/mptests/mp12/Makefile.am | 11 - testsuites/mptests/mp12/init.c | 112 - testsuites/mptests/mp12/node1/.cvsignore | 2 - testsuites/mptests/mp12/node1/Makefile.am | 50 - testsuites/mptests/mp12/node1/mp12.doc | 51 - testsuites/mptests/mp12/node1/mp12.scn | 6 - testsuites/mptests/mp12/node2/.cvsignore | 2 - testsuites/mptests/mp12/node2/Makefile.am | 50 - testsuites/mptests/mp12/node2/mp12.doc | 12 - testsuites/mptests/mp12/node2/mp12.scn | 10 - testsuites/mptests/mp12/system.h | 55 - testsuites/mptests/mp13/.cvsignore | 2 - testsuites/mptests/mp13/Makefile.am | 11 - testsuites/mptests/mp13/init.c | 114 - testsuites/mptests/mp13/node1/.cvsignore | 2 - testsuites/mptests/mp13/node1/Makefile.am | 50 - testsuites/mptests/mp13/node1/mp13.doc | 47 - testsuites/mptests/mp13/node1/mp13.scn | 14 - testsuites/mptests/mp13/node2/.cvsignore | 2 - testsuites/mptests/mp13/node2/Makefile.am | 50 - testsuites/mptests/mp13/node2/mp13.doc | 12 - testsuites/mptests/mp13/node2/mp13.scn | 16 - testsuites/mptests/mp13/system.h | 60 - testsuites/mptests/mp13/task1.c | 72 - testsuites/mptests/mp13/task2.c | 105 - testsuites/mptests/mp14/.cvsignore | 2 - testsuites/mptests/mp14/Makefile.am | 12 - testsuites/mptests/mp14/delay.c | 33 - testsuites/mptests/mp14/evtask1.c | 86 - testsuites/mptests/mp14/evtmtask.c | 64 - testsuites/mptests/mp14/exit.c | 39 - testsuites/mptests/mp14/init.c | 190 -- testsuites/mptests/mp14/msgtask1.c | 106 - testsuites/mptests/mp14/node1/.cvsignore | 2 - testsuites/mptests/mp14/node1/Makefile.am | 51 - testsuites/mptests/mp14/node1/mp14.doc | 49 - testsuites/mptests/mp14/node1/mp14.scn | 41 - testsuites/mptests/mp14/node2/.cvsignore | 2 - testsuites/mptests/mp14/node2/Makefile.am | 51 - testsuites/mptests/mp14/node2/mp14.doc | 12 - testsuites/mptests/mp14/node2/mp14.scn | 38 - testsuites/mptests/mp14/pttask1.c | 70 - testsuites/mptests/mp14/smtask1.c | 72 - testsuites/mptests/mp14/system.h | 119 - testsuites/mptests/mptests.am | 29 - testsuites/psxtests/.cvsignore | 14 - testsuites/psxtests/ChangeLog | 261 -- testsuites/psxtests/Makefile.am | 21 - testsuites/psxtests/configure.ac | 65 - testsuites/psxtests/include/.cvsignore | 2 - testsuites/psxtests/include/Makefile.am | 8 - testsuites/psxtests/include/pmacros.h | 89 - testsuites/psxtests/psx01/.cvsignore | 2 - testsuites/psxtests/psx01/Makefile.am | 44 - testsuites/psxtests/psx01/init.c | 242 -- testsuites/psxtests/psx01/psx01.scn | 53 - testsuites/psxtests/psx01/system.h | 53 - testsuites/psxtests/psx01/task.c | 93 - testsuites/psxtests/psx02/.cvsignore | 2 - testsuites/psxtests/psx02/Makefile.am | 44 - testsuites/psxtests/psx02/init.c | 145 - testsuites/psxtests/psx02/psx02.scn | 26 - testsuites/psxtests/psx02/system.h | 51 - testsuites/psxtests/psx02/task.c | 44 - testsuites/psxtests/psx03/.cvsignore | 2 - testsuites/psxtests/psx03/Makefile.am | 44 - testsuites/psxtests/psx03/init.c | 203 -- testsuites/psxtests/psx03/psx03.scn | 21 - testsuites/psxtests/psx03/system.h | 54 - testsuites/psxtests/psx03/task.c | 64 - testsuites/psxtests/psx04/.cvsignore | 2 - testsuites/psxtests/psx04/Makefile.am | 44 - testsuites/psxtests/psx04/init.c | 557 ---- testsuites/psxtests/psx04/psx04.scn | 99 - testsuites/psxtests/psx04/system.h | 63 - testsuites/psxtests/psx04/task1.c | 43 - testsuites/psxtests/psx04/task2.c | 41 - testsuites/psxtests/psx04/task3.c | 118 - testsuites/psxtests/psx05/.cvsignore | 2 - testsuites/psxtests/psx05/Makefile.am | 44 - testsuites/psxtests/psx05/init.c | 583 ---- testsuites/psxtests/psx05/psx05.scn | 103 - testsuites/psxtests/psx05/system.h | 65 - testsuites/psxtests/psx05/task.c | 57 - testsuites/psxtests/psx05/task2.c | 48 - testsuites/psxtests/psx05/task3.c | 50 - testsuites/psxtests/psx06/.cvsignore | 2 - testsuites/psxtests/psx06/Makefile.am | 44 - testsuites/psxtests/psx06/init.c | 120 - testsuites/psxtests/psx06/psx06.scn | 20 - testsuites/psxtests/psx06/system.h | 59 - testsuites/psxtests/psx06/task.c | 50 - testsuites/psxtests/psx06/task2.c | 51 - testsuites/psxtests/psx07/.cvsignore | 2 - testsuites/psxtests/psx07/Makefile.am | 44 - testsuites/psxtests/psx07/init.c | 493 --- testsuites/psxtests/psx07/psx07.scn | 96 - testsuites/psxtests/psx07/system.h | 50 - testsuites/psxtests/psx07/task.c | 33 - testsuites/psxtests/psx08/.cvsignore | 2 - testsuites/psxtests/psx08/Makefile.am | 44 - testsuites/psxtests/psx08/init.c | 97 - testsuites/psxtests/psx08/psx08.scn | 22 - testsuites/psxtests/psx08/system.h | 60 - testsuites/psxtests/psx08/task1.c | 31 - testsuites/psxtests/psx08/task2.c | 55 - testsuites/psxtests/psx08/task3.c | 51 - testsuites/psxtests/psx09/.cvsignore | 2 - testsuites/psxtests/psx09/Makefile.am | 44 - testsuites/psxtests/psx09/init.c | 225 -- testsuites/psxtests/psx09/psx09.scn | 22 - testsuites/psxtests/psx09/system.h | 56 - testsuites/psxtests/psx10/.cvsignore | 2 - testsuites/psxtests/psx10/Makefile.am | 44 - testsuites/psxtests/psx10/init.c | 311 -- testsuites/psxtests/psx10/psx10.scn | 55 - testsuites/psxtests/psx10/system.h | 66 - testsuites/psxtests/psx10/task.c | 64 - testsuites/psxtests/psx10/task2.c | 46 - testsuites/psxtests/psx10/task3.c | 45 - testsuites/psxtests/psx11/.cvsignore | 2 - testsuites/psxtests/psx11/Makefile.am | 44 - testsuites/psxtests/psx11/init.c | 107 - testsuites/psxtests/psx11/psx11.scn | 18 - testsuites/psxtests/psx11/system.h | 50 - testsuites/psxtests/psx11/task.c | 91 - testsuites/psxtests/psx12/.cvsignore | 2 - testsuites/psxtests/psx12/Makefile.am | 44 - testsuites/psxtests/psx12/init.c | 139 - testsuites/psxtests/psx12/psx12.scn | 11 - testsuites/psxtests/psx12/system.h | 52 - testsuites/psxtests/psx12/task.c | 33 - testsuites/psxtests/psx13/.cvsignore | 2 - testsuites/psxtests/psx13/Makefile.am | 41 - testsuites/psxtests/psx13/main.c | 45 - testsuites/psxtests/psx13/psx13.scn | 16 - testsuites/psxtests/psx13/test.c | 688 ---- testsuites/psxtests/psxcancel/.cvsignore | 2 - testsuites/psxtests/psxcancel/Makefile.am | 44 - testsuites/psxtests/psxcancel/init.c | 127 - testsuites/psxtests/psxcancel/psxcancel.scn | 14 - testsuites/psxtests/psxchroot01/.cvsignore | 2 - testsuites/psxtests/psxchroot01/Makefile.am | 41 - testsuites/psxtests/psxchroot01/main.c | 35 - .../psxtests/psxchroot01/psxchroot01.scn | 9 - testsuites/psxtests/psxchroot01/test.c | 123 - testsuites/psxtests/psxfile01/.cvsignore | 2 - testsuites/psxtests/psxfile01/Makefile.am | 41 - testsuites/psxtests/psxfile01/main.c | 45 - testsuites/psxtests/psxfile01/psxfile01.scn | 208 -- testsuites/psxtests/psxfile01/test.c | 547 ---- testsuites/psxtests/psxfile01/test_cat.c | 83 - testsuites/psxtests/psxfile01/test_extend.c | 62 - testsuites/psxtests/psxfile01/test_write.c | 61 - testsuites/psxtests/psxhdrs/.cvsignore | 2 - testsuites/psxtests/psxhdrs/Makefile.am | 40 - testsuites/psxtests/psxhdrs/clock01.c | 28 - testsuites/psxtests/psxhdrs/clock02.c | 28 - testsuites/psxtests/psxhdrs/clock03.c | 28 - testsuites/psxtests/psxhdrs/clock04.c | 28 - testsuites/psxtests/psxhdrs/clock05.c | 34 - testsuites/psxtests/psxhdrs/clock06.c | 31 - testsuites/psxtests/psxhdrs/cond01.c | 27 - testsuites/psxtests/psxhdrs/cond02.c | 27 - testsuites/psxtests/psxhdrs/cond03.c | 28 - testsuites/psxtests/psxhdrs/cond04.c | 27 - testsuites/psxtests/psxhdrs/cond05.c | 27 - testsuites/psxtests/psxhdrs/cond06.c | 28 - testsuites/psxtests/psxhdrs/cond07.c | 29 - testsuites/psxtests/psxhdrs/cond08.c | 31 - testsuites/psxtests/psxhdrs/cond09.c | 34 - testsuites/psxtests/psxhdrs/cond10.c | 27 - testsuites/psxtests/psxhdrs/key01.c | 33 - testsuites/psxtests/psxhdrs/key02.c | 31 - testsuites/psxtests/psxhdrs/key03.c | 29 - testsuites/psxtests/psxhdrs/key04.c | 27 - testsuites/psxtests/psxhdrs/mutex01.c | 27 - testsuites/psxtests/psxhdrs/mutex02.c | 27 - testsuites/psxtests/psxhdrs/mutex03.c | 28 - testsuites/psxtests/psxhdrs/mutex04.c | 27 - testsuites/psxtests/psxhdrs/mutex05.c | 27 - testsuites/psxtests/psxhdrs/mutex06.c | 27 - testsuites/psxtests/psxhdrs/mutex07.c | 35 - testsuites/psxtests/psxhdrs/mutex08.c | 31 - testsuites/psxtests/psxhdrs/mutex09.c | 31 - testsuites/psxtests/psxhdrs/mutex10.c | 31 - testsuites/psxtests/psxhdrs/mutex11.c | 34 - testsuites/psxtests/psxhdrs/mutex12.c | 27 - testsuites/psxtests/psxhdrs/mutex13.c | 31 - testsuites/psxtests/psxhdrs/mutex14.c | 31 - testsuites/psxtests/psxhdrs/mutex15.c | 31 - testsuites/psxtests/psxhdrs/mutex16.c | 34 - testsuites/psxtests/psxhdrs/proc01.c | 22 - testsuites/psxtests/psxhdrs/proc02.c | 22 - testsuites/psxtests/psxhdrs/proc03.c | 23 - testsuites/psxtests/psxhdrs/proc04.c | 23 - testsuites/psxtests/psxhdrs/proc05.c | 23 - testsuites/psxtests/psxhdrs/proc06.c | 23 - testsuites/psxtests/psxhdrs/proc07.c | 25 - testsuites/psxtests/psxhdrs/proc08.c | 25 - testsuites/psxtests/psxhdrs/proc09.c | 26 - testsuites/psxtests/psxhdrs/proc10.c | 22 - testsuites/psxtests/psxhdrs/proc11.c | 24 - testsuites/psxtests/psxhdrs/proc12.c | 22 - testsuites/psxtests/psxhdrs/proc13.c | 22 - testsuites/psxtests/psxhdrs/proc14.c | 24 - testsuites/psxtests/psxhdrs/pthread01.c | 27 - testsuites/psxtests/psxhdrs/pthread02.c | 27 - testsuites/psxtests/psxhdrs/pthread03.c | 31 - testsuites/psxtests/psxhdrs/pthread04.c | 28 - testsuites/psxtests/psxhdrs/pthread05.c | 35 - testsuites/psxtests/psxhdrs/pthread06.c | 32 - testsuites/psxtests/psxhdrs/pthread07.c | 37 - testsuites/psxtests/psxhdrs/pthread08.c | 26 - testsuites/psxtests/psxhdrs/pthread09.c | 26 - testsuites/psxtests/psxhdrs/pthread10.c | 28 - testsuites/psxtests/psxhdrs/pthread11.c | 51 - testsuites/psxtests/psxhdrs/pthread12.c | 31 - testsuites/psxtests/psxhdrs/pthread13.c | 31 - testsuites/psxtests/psxhdrs/pthread14.c | 28 - testsuites/psxtests/psxhdrs/pthread15.c | 31 - testsuites/psxtests/psxhdrs/pthread16.c | 28 - testsuites/psxtests/psxhdrs/pthread17.c | 35 - testsuites/psxtests/psxhdrs/pthread18.c | 28 - testsuites/psxtests/psxhdrs/pthread19.c | 28 - testsuites/psxtests/psxhdrs/pthread20.c | 28 - testsuites/psxtests/psxhdrs/pthread21.c | 28 - testsuites/psxtests/psxhdrs/pthread22.c | 49 - testsuites/psxtests/psxhdrs/pthread23.c | 29 - testsuites/psxtests/psxhdrs/pthread24.c | 35 - testsuites/psxtests/psxhdrs/pthread25.c | 33 - testsuites/psxtests/psxhdrs/pthread26.c | 30 - testsuites/psxtests/psxhdrs/pthread27.c | 31 - testsuites/psxtests/psxhdrs/pthread28.c | 32 - testsuites/psxtests/psxhdrs/pthread29.c | 35 - testsuites/psxtests/psxhdrs/pthread30.c | 35 - testsuites/psxtests/psxhdrs/pthread31.c | 28 - testsuites/psxtests/psxhdrs/pthread32.c | 34 - testsuites/psxtests/psxhdrs/pthread33.c | 24 - testsuites/psxtests/psxhdrs/pthread34.c | 30 - testsuites/psxtests/psxhdrs/pthread35.c | 31 - testsuites/psxtests/psxhdrs/pthread36.c | 28 - testsuites/psxtests/psxhdrs/sched01.c | 43 - testsuites/psxtests/psxhdrs/sched02.c | 30 - testsuites/psxtests/psxhdrs/sched03.c | 51 - testsuites/psxtests/psxhdrs/sched04.c | 29 - testsuites/psxtests/psxhdrs/sched05.c | 26 - testsuites/psxtests/psxhdrs/sched06.c | 34 - testsuites/psxtests/psxhdrs/sched07.c | 34 - testsuites/psxtests/psxhdrs/sched08.c | 30 - testsuites/psxtests/psxhdrs/signal01.c | 26 - testsuites/psxtests/psxhdrs/signal02.c | 26 - testsuites/psxtests/psxhdrs/signal03.c | 23 - testsuites/psxtests/psxhdrs/signal04.c | 26 - testsuites/psxtests/psxhdrs/signal05.c | 23 - testsuites/psxtests/psxhdrs/signal06.c | 38 - testsuites/psxtests/psxhdrs/signal07.c | 31 - testsuites/psxtests/psxhdrs/signal08.c | 33 - testsuites/psxtests/psxhdrs/signal09.c | 28 - testsuites/psxtests/psxhdrs/signal10.c | 24 - testsuites/psxtests/psxhdrs/signal11.c | 25 - testsuites/psxtests/psxhdrs/signal12.c | 25 - testsuites/psxtests/psxhdrs/signal13.c | 31 - testsuites/psxtests/psxhdrs/signal14.c | 25 - testsuites/psxtests/psxhdrs/signal15.c | 25 - testsuites/psxtests/psxhdrs/signal16.c | 35 - testsuites/psxtests/psxhdrs/signal17.c | 26 - testsuites/psxtests/psxhdrs/signal18.c | 27 - testsuites/psxtests/psxhdrs/signal19.c | 26 - testsuites/psxtests/psxhdrs/signal20.c | 25 - testsuites/psxtests/psxhdrs/signal21.c | 22 - testsuites/psxtests/psxhdrs/signal22.c | 25 - testsuites/psxtests/psxhdrs/time01.c | 22 - testsuites/psxtests/psxhdrs/time02.c | 27 - testsuites/psxtests/psxhdrs/time03.c | 33 - testsuites/psxtests/psxhdrs/time04.c | 22 - testsuites/psxtests/psxhdrs/time05.c | 27 - testsuites/psxtests/psxhdrs/time06.c | 23 - testsuites/psxtests/psxhdrs/time07.c | 23 - testsuites/psxtests/psxhdrs/time08.c | 23 - testsuites/psxtests/psxhdrs/time09.c | 23 - testsuites/psxtests/psxhdrs/time10.c | 24 - testsuites/psxtests/psxhdrs/time11.c | 24 - testsuites/psxtests/psxhdrs/time12.c | 24 - testsuites/psxtests/psxhdrs/time13.c | 24 - testsuites/psxtests/psxhdrs/timer01.c | 36 - testsuites/psxtests/psxhdrs/timer02.c | 27 - testsuites/psxtests/psxhdrs/timer03.c | 38 - testsuites/psxtests/psxhdrs/timer04.c | 28 - testsuites/psxtests/psxhdrs/timer05.c | 27 - testsuites/psxtests/psxhdrs/timer06.c | 30 - testsuites/psxtests/psxmount/.cvsignore | 2 - testsuites/psxtests/psxmount/Makefile.am | 41 - testsuites/psxtests/psxmount/main.c | 37 - testsuites/psxtests/psxmount/psxmount.scn | 86 - testsuites/psxtests/psxmount/test.c | 447 --- testsuites/psxtests/psxmsgq01/.cvsignore | 2 - testsuites/psxtests/psxmsgq01/Makefile.am | 44 - testsuites/psxtests/psxmsgq01/init.c | 1313 -------- testsuites/psxtests/psxmsgq01/psxmsgq01.scn | 116 - testsuites/psxtests/psxmsgq01/system.h | 75 - testsuites/psxtests/psxreaddir/.cvsignore | 2 - testsuites/psxtests/psxreaddir/Makefile.am | 41 - testsuites/psxtests/psxreaddir/main.c | 35 - testsuites/psxtests/psxreaddir/psxreaddir.scn | 236 -- testsuites/psxtests/psxreaddir/test.c | 501 --- testsuites/psxtests/psxsem01/.cvsignore | 2 - testsuites/psxtests/psxsem01/Makefile.am | 44 - testsuites/psxtests/psxsem01/init.c | 246 -- testsuites/psxtests/psxsem01/psxsem01.scn | 37 - testsuites/psxtests/psxsem01/system.h | 55 - testsuites/psxtests/psxstat/.cvsignore | 2 - testsuites/psxtests/psxstat/Makefile.am | 41 - testsuites/psxtests/psxstat/main.c | 46 - testsuites/psxtests/psxstat/psxstat.scn | 1199 ------- testsuites/psxtests/psxstat/test.c | 857 ----- testsuites/psxtests/psxtests.am | 25 - testsuites/psxtests/psxtime/.cvsignore | 2 - testsuites/psxtests/psxtime/Makefile.am | 39 - testsuites/psxtests/psxtime/main.c | 42 - testsuites/psxtests/psxtime/psxtime.scn | 302 -- testsuites/psxtests/psxtime/test.c | 115 - testsuites/psxtests/psxtimer/.cvsignore | 2 - testsuites/psxtests/psxtimer/Makefile.am | 44 - testsuites/psxtests/psxtimer/psxtimer.c | 337 -- testsuites/psxtests/psxtimer/psxtimer.scn | 37 - testsuites/psxtests/psxtimer/system.h | 64 - testsuites/samples/.cvsignore | 14 - testsuites/samples/ChangeLog | 194 -- testsuites/samples/Makefile.am | 25 - testsuites/samples/README | 72 - testsuites/samples/base_mp/.cvsignore | 2 - testsuites/samples/base_mp/Makefile.am | 11 - testsuites/samples/base_mp/apptask.c | 38 - testsuites/samples/base_mp/init.c | 46 - testsuites/samples/base_mp/node1/.cvsignore | 2 - testsuites/samples/base_mp/node1/Makefile.am | 50 - testsuites/samples/base_mp/node1/base_mp.doc | 12 - testsuites/samples/base_mp/node1/base_mp.scn | 5 - testsuites/samples/base_mp/node2/.cvsignore | 2 - testsuites/samples/base_mp/node2/Makefile.am | 50 - testsuites/samples/base_mp/node2/base_mp.doc | 12 - testsuites/samples/base_mp/node2/base_mp.scn | 5 - testsuites/samples/base_mp/system.h | 47 - testsuites/samples/base_sp/.cvsignore | 2 - testsuites/samples/base_sp/Makefile.am | 41 - testsuites/samples/base_sp/apptask.c | 39 - testsuites/samples/base_sp/base_sp.doc | 12 - testsuites/samples/base_sp/base_sp.scn | 5 - testsuites/samples/base_sp/init.c | 48 - testsuites/samples/base_sp/system.h | 40 - testsuites/samples/cdtest/.cvsignore | 2 - testsuites/samples/cdtest/Makefile.am | 48 - testsuites/samples/cdtest/cdtest.scn | 31 - testsuites/samples/cdtest/init.c | 26 - testsuites/samples/cdtest/main.cc | 214 -- testsuites/samples/cdtest/system.h | 40 - testsuites/samples/configure.ac | 55 - testsuites/samples/hello/.cvsignore | 2 - testsuites/samples/hello/Makefile.am | 41 - testsuites/samples/hello/hello.doc | 12 - testsuites/samples/hello/hello.scn | 3 - testsuites/samples/hello/init.c | 36 - testsuites/samples/hello/system.h | 38 - testsuites/samples/loopback/.cvsignore | 2 - testsuites/samples/loopback/Makefile.am | 41 - testsuites/samples/loopback/README | 65 - testsuites/samples/loopback/init.c | 267 -- testsuites/samples/loopback/loopback.scn | 56 - testsuites/samples/minimum/.cvsignore | 2 - testsuites/samples/minimum/Makefile.am | 39 - testsuites/samples/minimum/init.c | 41 - testsuites/samples/minimum/minimum.doc | 12 - testsuites/samples/minimum/minimum.scn | 1 - testsuites/samples/paranoia/.cvsignore | 2 - testsuites/samples/paranoia/Makefile.am | 47 - testsuites/samples/paranoia/init.c | 49 - testsuites/samples/paranoia/paranoia.c | 2304 ------------- testsuites/samples/paranoia/paranoia.doc | 12 - testsuites/samples/paranoia/system.h | 41 - testsuites/samples/sample.am | 20 - testsuites/samples/ticker/.cvsignore | 2 - testsuites/samples/ticker/Makefile.am | 41 - testsuites/samples/ticker/init.c | 75 - testsuites/samples/ticker/system.h | 115 - testsuites/samples/ticker/tasks.c | 45 - testsuites/samples/ticker/ticker.doc | 12 - testsuites/samples/ticker/ticker.scn | 16 - testsuites/samples/unlimited/.cvsignore | 2 - testsuites/samples/unlimited/Makefile.am | 41 - testsuites/samples/unlimited/init.c | 127 - testsuites/samples/unlimited/system.h | 90 - testsuites/samples/unlimited/test1.c | 106 - testsuites/samples/unlimited/test2.c | 229 -- testsuites/samples/unlimited/test3.c | 146 - testsuites/samples/unlimited/unlimited.doc | 36 - testsuites/samples/unlimited/unlimited.scn | 337 -- testsuites/sptests/.cvsignore | 14 - testsuites/sptests/ChangeLog | 319 -- testsuites/sptests/Makefile.am | 15 - testsuites/sptests/README | 9 - testsuites/sptests/configure.ac | 74 - testsuites/sptests/sp01/.cvsignore | 2 - testsuites/sptests/sp01/Makefile.am | 38 - testsuites/sptests/sp01/init.c | 85 - testsuites/sptests/sp01/sp01.doc | 42 - testsuites/sptests/sp01/sp01.scn | 18 - testsuites/sptests/sp01/system.h | 45 - testsuites/sptests/sp01/task1.c | 49 - testsuites/sptests/sp02/.cvsignore | 2 - testsuites/sptests/sp02/Makefile.am | 38 - testsuites/sptests/sp02/init.c | 151 - testsuites/sptests/sp02/preempt.c | 31 - testsuites/sptests/sp02/sp02.doc | 36 - testsuites/sptests/sp02/sp02.scn | 15 - testsuites/sptests/sp02/system.h | 58 - testsuites/sptests/sp02/task1.c | 65 - testsuites/sptests/sp02/task2.c | 33 - testsuites/sptests/sp02/task3.c | 36 - testsuites/sptests/sp03/.cvsignore | 2 - testsuites/sptests/sp03/Makefile.am | 38 - testsuites/sptests/sp03/init.c | 66 - testsuites/sptests/sp03/sp03.doc | 23 - testsuites/sptests/sp03/sp03.scn | 26 - testsuites/sptests/sp03/system.h | 50 - testsuites/sptests/sp03/task1.c | 58 - testsuites/sptests/sp03/task2.c | 45 - testsuites/sptests/sp04/.cvsignore | 2 - testsuites/sptests/sp04/Makefile.am | 38 - testsuites/sptests/sp04/init.c | 109 - testsuites/sptests/sp04/sp04.doc | 37 - testsuites/sptests/sp04/sp04.scn | 25 - testsuites/sptests/sp04/system.h | 81 - testsuites/sptests/sp04/task1.c | 117 - testsuites/sptests/sp04/task2.c | 28 - testsuites/sptests/sp04/task3.c | 28 - testsuites/sptests/sp04/tswitch.c | 62 - testsuites/sptests/sp05/.cvsignore | 2 - testsuites/sptests/sp05/Makefile.am | 38 - testsuites/sptests/sp05/init.c | 80 - testsuites/sptests/sp05/sp05.doc | 25 - testsuites/sptests/sp05/sp05.scn | 47 - testsuites/sptests/sp05/system.h | 53 - testsuites/sptests/sp05/task1.c | 77 - testsuites/sptests/sp05/task2.c | 38 - testsuites/sptests/sp05/task3.c | 38 - testsuites/sptests/sp06/.cvsignore | 2 - testsuites/sptests/sp06/Makefile.am | 38 - testsuites/sptests/sp06/init.c | 86 - testsuites/sptests/sp06/sp06.doc | 25 - testsuites/sptests/sp06/sp06.scn | 40 - testsuites/sptests/sp06/system.h | 56 - testsuites/sptests/sp06/task1.c | 60 - testsuites/sptests/sp06/task2.c | 39 - testsuites/sptests/sp06/task3.c | 31 - testsuites/sptests/sp07/.cvsignore | 2 - testsuites/sptests/sp07/Makefile.am | 39 - testsuites/sptests/sp07/init.c | 127 - testsuites/sptests/sp07/sp07.doc | 36 - testsuites/sptests/sp07/sp07.scn | 33 - testsuites/sptests/sp07/system.h | 87 - testsuites/sptests/sp07/task1.c | 84 - testsuites/sptests/sp07/task2.c | 77 - testsuites/sptests/sp07/task3.c | 33 - testsuites/sptests/sp07/task4.c | 29 - testsuites/sptests/sp07/taskexit.c | 32 - testsuites/sptests/sp07/tcreate.c | 34 - testsuites/sptests/sp07/tdelete.c | 36 - testsuites/sptests/sp07/trestart.c | 33 - testsuites/sptests/sp07/tstart.c | 33 - testsuites/sptests/sp08/.cvsignore | 2 - testsuites/sptests/sp08/Makefile.am | 38 - testsuites/sptests/sp08/init.c | 52 - testsuites/sptests/sp08/sp08.doc | 25 - testsuites/sptests/sp08/sp08.scn | 22 - testsuites/sptests/sp08/system.h | 50 - testsuites/sptests/sp08/task1.c | 255 -- testsuites/sptests/sp09/.cvsignore | 2 - testsuites/sptests/sp09/Makefile.am | 42 - testsuites/sptests/sp09/delay.c | 27 - testsuites/sptests/sp09/init.c | 119 - testsuites/sptests/sp09/isr.c | 26 - testsuites/sptests/sp09/screen01.c | 179 -- testsuites/sptests/sp09/screen02.c | 191 -- testsuites/sptests/sp09/screen03.c | 217 -- testsuites/sptests/sp09/screen04.c | 84 - testsuites/sptests/sp09/screen05.c | 170 - testsuites/sptests/sp09/screen06.c | 124 - testsuites/sptests/sp09/screen07.c | 208 -- testsuites/sptests/sp09/screen08.c | 129 - testsuites/sptests/sp09/screen09.c | 163 - testsuites/sptests/sp09/screen10.c | 163 - testsuites/sptests/sp09/screen11.c | 264 -- testsuites/sptests/sp09/screen12.c | 344 -- testsuites/sptests/sp09/screen13.c | 113 - testsuites/sptests/sp09/screen14.c | 245 -- testsuites/sptests/sp09/sp09.doc | 35 - testsuites/sptests/sp09/sp09.scn | 261 -- testsuites/sptests/sp09/system.h | 141 - testsuites/sptests/sp09/task1.c | 69 - testsuites/sptests/sp09/task2.c | 47 - testsuites/sptests/sp09/task3.c | 52 - testsuites/sptests/sp09/task4.c | 49 - testsuites/sptests/sp11/.cvsignore | 2 - testsuites/sptests/sp11/Makefile.am | 38 - testsuites/sptests/sp11/init.c | 91 - testsuites/sptests/sp11/sp11.doc | 25 - testsuites/sptests/sp11/sp11.scn | 74 - testsuites/sptests/sp11/system.h | 90 - testsuites/sptests/sp11/task1.c | 409 --- testsuites/sptests/sp11/task2.c | 125 - testsuites/sptests/sp11/timer.c | 96 - testsuites/sptests/sp12/.cvsignore | 2 - testsuites/sptests/sp12/Makefile.am | 38 - testsuites/sptests/sp12/init.c | 178 -- testsuites/sptests/sp12/pridrv.c | 130 - testsuites/sptests/sp12/pritask.c | 90 - testsuites/sptests/sp12/sp12.doc | 26 - testsuites/sptests/sp12/sp12.scn | 78 - testsuites/sptests/sp12/system.h | 82 - testsuites/sptests/sp12/task1.c | 152 - testsuites/sptests/sp12/task2.c | 64 - testsuites/sptests/sp12/task3.c | 49 - testsuites/sptests/sp12/task4.c | 36 - testsuites/sptests/sp12/task5.c | 54 - testsuites/sptests/sp13/.cvsignore | 2 - testsuites/sptests/sp13/Makefile.am | 38 - testsuites/sptests/sp13/fillbuff.c | 46 - testsuites/sptests/sp13/init.c | 113 - testsuites/sptests/sp13/putbuff.c | 40 - testsuites/sptests/sp13/sp13.doc | 24 - testsuites/sptests/sp13/sp13.scn | 78 - testsuites/sptests/sp13/system.h | 69 - testsuites/sptests/sp13/task1.c | 363 --- testsuites/sptests/sp13/task2.c | 138 - testsuites/sptests/sp13/task3.c | 77 - testsuites/sptests/sp14/.cvsignore | 2 - testsuites/sptests/sp14/Makefile.am | 38 - testsuites/sptests/sp14/asr.c | 46 - testsuites/sptests/sp14/init.c | 71 - testsuites/sptests/sp14/sp14.doc | 23 - testsuites/sptests/sp14/sp14.scn | 33 - testsuites/sptests/sp14/system.h | 78 - testsuites/sptests/sp14/task1.c | 115 - testsuites/sptests/sp14/task2.c | 47 - testsuites/sptests/sp15/.cvsignore | 2 - testsuites/sptests/sp15/Makefile.am | 38 - testsuites/sptests/sp15/init.c | 77 - testsuites/sptests/sp15/sp15.doc | 23 - testsuites/sptests/sp15/sp15.scn | 16 - testsuites/sptests/sp15/system.h | 60 - testsuites/sptests/sp15/task1.c | 128 - testsuites/sptests/sp16/.cvsignore | 2 - testsuites/sptests/sp16/Makefile.am | 38 - testsuites/sptests/sp16/init.c | 127 - testsuites/sptests/sp16/sp16.doc | 23 - testsuites/sptests/sp16/sp16.scn | 58 - testsuites/sptests/sp16/system.h | 89 - testsuites/sptests/sp16/task1.c | 281 -- testsuites/sptests/sp16/task2.c | 85 - testsuites/sptests/sp16/task3.c | 56 - testsuites/sptests/sp16/task4.c | 59 - testsuites/sptests/sp16/task5.c | 72 - testsuites/sptests/sp17/.cvsignore | 2 - testsuites/sptests/sp17/Makefile.am | 38 - testsuites/sptests/sp17/asr.c | 31 - testsuites/sptests/sp17/init.c | 68 - testsuites/sptests/sp17/sp17.doc | 34 - testsuites/sptests/sp17/sp17.scn | 8 - testsuites/sptests/sp17/system.h | 56 - testsuites/sptests/sp17/task1.c | 47 - testsuites/sptests/sp17/task2.c | 44 - testsuites/sptests/sp19/.cvsignore | 2 - testsuites/sptests/sp19/Makefile.am | 38 - testsuites/sptests/sp19/first.c | 65 - testsuites/sptests/sp19/fptask.c | 97 - testsuites/sptests/sp19/fptest.h | 171 - testsuites/sptests/sp19/init.c | 149 - testsuites/sptests/sp19/inttest.h | 148 - testsuites/sptests/sp19/sp19.doc | 22 - testsuites/sptests/sp19/sp19.scn | 50 - testsuites/sptests/sp19/system.h | 58 - testsuites/sptests/sp19/task1.c | 58 - testsuites/sptests/sp20/.cvsignore | 2 - testsuites/sptests/sp20/Makefile.am | 38 - testsuites/sptests/sp20/getall.c | 43 - testsuites/sptests/sp20/init.c | 69 - testsuites/sptests/sp20/sp20.doc | 23 - testsuites/sptests/sp20/sp20.scn | 40 - testsuites/sptests/sp20/system.h | 61 - testsuites/sptests/sp20/task1.c | 153 - testsuites/sptests/sp21/.cvsignore | 2 - testsuites/sptests/sp21/Makefile.am | 38 - testsuites/sptests/sp21/init.c | 52 - testsuites/sptests/sp21/sp21.doc | 27 - testsuites/sptests/sp21/sp21.scn | 19 - testsuites/sptests/sp21/system.h | 46 - testsuites/sptests/sp21/task1.c | 105 - testsuites/sptests/sp22/.cvsignore | 2 - testsuites/sptests/sp22/Makefile.am | 38 - testsuites/sptests/sp22/delay.c | 31 - testsuites/sptests/sp22/init.c | 65 - testsuites/sptests/sp22/prtime.c | 31 - testsuites/sptests/sp22/sp22.doc | 19 - testsuites/sptests/sp22/sp22.scn | 29 - testsuites/sptests/sp22/system.h | 58 - testsuites/sptests/sp22/task1.c | 163 - testsuites/sptests/sp23/.cvsignore | 2 - testsuites/sptests/sp23/Makefile.am | 38 - testsuites/sptests/sp23/init.c | 68 - testsuites/sptests/sp23/sp23.doc | 25 - testsuites/sptests/sp23/sp23.scn | 9 - testsuites/sptests/sp23/system.h | 57 - testsuites/sptests/sp23/task1.c | 95 - testsuites/sptests/sp24/.cvsignore | 2 - testsuites/sptests/sp24/Makefile.am | 38 - testsuites/sptests/sp24/init.c | 75 - testsuites/sptests/sp24/resume.c | 33 - testsuites/sptests/sp24/sp24.doc | 50 - testsuites/sptests/sp24/sp24.scn | 16 - testsuites/sptests/sp24/system.h | 55 - testsuites/sptests/sp24/task1.c | 57 - testsuites/sptests/sp25/.cvsignore | 2 - testsuites/sptests/sp25/Makefile.am | 38 - testsuites/sptests/sp25/init.c | 65 - testsuites/sptests/sp25/sp25.doc | 31 - testsuites/sptests/sp25/sp25.scn | 32 - testsuites/sptests/sp25/system.h | 55 - testsuites/sptests/sp25/task1.c | 240 -- testsuites/sptests/sp26/.cvsignore | 2 - testsuites/sptests/sp26/Makefile.am | 38 - testsuites/sptests/sp26/init.c | 38 - testsuites/sptests/sp26/sp26.doc | 23 - testsuites/sptests/sp26/sp26.scn | 8 - testsuites/sptests/sp26/system.h | 46 - testsuites/sptests/sp26/task1.c | 120 - testsuites/sptests/sp27/.cvsignore | 2 - testsuites/sptests/sp27/Makefile.am | 35 - testsuites/sptests/sp27/init.c | 105 - testsuites/sptests/sp27/sp27.doc | 0 testsuites/sptests/sp27/sp27.scn | 2 - testsuites/sptests/sp28/.cvsignore | 2 - testsuites/sptests/sp28/Makefile.am | 35 - testsuites/sptests/sp28/init.c | 123 - testsuites/sptests/sp28/sp28.doc | 0 testsuites/sptests/sp28/sp28.scn | 5 - testsuites/sptests/sp29/.cvsignore | 2 - testsuites/sptests/sp29/Makefile.am | 35 - testsuites/sptests/sp29/init.c | 184 -- testsuites/sptests/sp29/sp29.doc | 0 testsuites/sptests/sp29/sp29.scn | 4 - testsuites/sptests/sp30/.cvsignore | 2 - testsuites/sptests/sp30/Makefile.am | 35 - testsuites/sptests/sp30/init.c | 82 - testsuites/sptests/sp30/resume.c | 33 - testsuites/sptests/sp30/sp30.doc | 50 - testsuites/sptests/sp30/sp30.scn | 16 - testsuites/sptests/sp30/system.h | 55 - testsuites/sptests/sp30/task1.c | 57 - testsuites/sptests/sp31/.cvsignore | 2 - testsuites/sptests/sp31/Makefile.am | 35 - testsuites/sptests/sp31/delay.c | 31 - testsuites/sptests/sp31/init.c | 77 - testsuites/sptests/sp31/prtime.c | 31 - testsuites/sptests/sp31/sp31.doc | 19 - testsuites/sptests/sp31/sp31.scn | 52 - testsuites/sptests/sp31/system.h | 58 - testsuites/sptests/sp31/task1.c | 274 -- testsuites/sptests/sp32/.cvsignore | 2 - testsuites/sptests/sp32/Makefile.am | 34 - testsuites/sptests/sp32/init.c | 111 - testsuites/sptests/sp32/sp32.scn | 7 - testsuites/sptests/spfatal/.cvsignore | 2 - testsuites/sptests/spfatal/Makefile.am | 38 - testsuites/sptests/spfatal/README | 8 - testsuites/sptests/spfatal/fatal.c | 136 - testsuites/sptests/spfatal/init.c | 50 - testsuites/sptests/spfatal/puterr.c | 67 - testsuites/sptests/spfatal/spfatal.doc | 27 - testsuites/sptests/spfatal/spfatal.scn | 8 - testsuites/sptests/spfatal/system.h | 74 - testsuites/sptests/spfatal/task1.c | 28 - testsuites/sptests/spsize/.cvsignore | 2 - testsuites/sptests/spsize/Makefile.am | 36 - testsuites/sptests/spsize/getint.c | 31 - testsuites/sptests/spsize/init.c | 63 - testsuites/sptests/spsize/size.c | 683 ---- testsuites/sptests/spsize/size.scn | 1 - testsuites/sptests/spsize/system.h | 45 - testsuites/sptests/sptests.am | 25 - testsuites/support/.cvsignore | 14 - testsuites/support/ChangeLog | 93 - testsuites/support/Makefile.am | 25 - testsuites/support/configure.ac | 23 - testsuites/support/include/.cvsignore | 2 - testsuites/support/include/buffer_test_io.h | 117 - testsuites/support/include/tmacros.h | 243 -- testsuites/tmitrontests/.cvsignore | 14 - testsuites/tmitrontests/ChangeLog | 81 - testsuites/tmitrontests/Makefile.am | 14 - testsuites/tmitrontests/README | 6 - testsuites/tmitrontests/configure.ac | 45 - testsuites/tmitrontests/include/.cvsignore | 2 - testsuites/tmitrontests/include/Makefile.am | 8 - testsuites/tmitrontests/include/timesys.h | 55 - .../tmitrontests/tmitronsem01/.cvsignore | 2 - .../tmitrontests/tmitronsem01/Makefile.am | 45 - testsuites/tmitrontests/tmitronsem01/init.c | 144 - testsuites/tmitrontests/tmitronsem01/system.h | 39 - .../tmitronsem01/tmitronsem01.doc | 9 - testsuites/tmitrontests/tmitrontests.am | 13 - testsuites/tmtests/.cvsignore | 14 - testsuites/tmtests/ChangeLog | 197 -- testsuites/tmtests/Makefile.am | 14 - testsuites/tmtests/README | 21 - testsuites/tmtests/configure.ac | 76 - testsuites/tmtests/include/.cvsignore | 2 - testsuites/tmtests/include/Makefile.am | 8 - testsuites/tmtests/include/timesys.h | 66 - testsuites/tmtests/tm01/.cvsignore | 2 - testsuites/tmtests/tm01/Makefile.am | 45 - testsuites/tmtests/tm01/system.h | 40 - testsuites/tmtests/tm01/task1.c | 188 -- testsuites/tmtests/tm01/tm01.doc | 12 - testsuites/tmtests/tm02/.cvsignore | 2 - testsuites/tmtests/tm02/Makefile.am | 45 - testsuites/tmtests/tm02/system.h | 41 - testsuites/tmtests/tm02/task1.c | 157 - testsuites/tmtests/tm02/tm02.doc | 12 - testsuites/tmtests/tm03/.cvsignore | 2 - testsuites/tmtests/tm03/Makefile.am | 45 - testsuites/tmtests/tm03/system.h | 41 - testsuites/tmtests/tm03/task1.c | 150 - testsuites/tmtests/tm03/tm03.doc | 12 - testsuites/tmtests/tm04/.cvsignore | 2 - testsuites/tmtests/tm04/Makefile.am | 45 - testsuites/tmtests/tm04/system.h | 40 - testsuites/tmtests/tm04/task1.c | 387 --- testsuites/tmtests/tm04/tm04.doc | 12 - testsuites/tmtests/tm05/.cvsignore | 2 - testsuites/tmtests/tm05/Makefile.am | 45 - testsuites/tmtests/tm05/system.h | 41 - testsuites/tmtests/tm05/task1.c | 131 - testsuites/tmtests/tm05/tm05.doc | 12 - testsuites/tmtests/tm06/.cvsignore | 2 - testsuites/tmtests/tm06/Makefile.am | 45 - testsuites/tmtests/tm06/system.h | 41 - testsuites/tmtests/tm06/task1.c | 161 - testsuites/tmtests/tm06/tm06.doc | 12 - testsuites/tmtests/tm07/.cvsignore | 2 - testsuites/tmtests/tm07/Makefile.am | 45 - testsuites/tmtests/tm07/system.h | 41 - testsuites/tmtests/tm07/task1.c | 119 - testsuites/tmtests/tm07/tm07.doc | 12 - testsuites/tmtests/tm08/.cvsignore | 2 - testsuites/tmtests/tm08/Makefile.am | 45 - testsuites/tmtests/tm08/system.h | 41 - testsuites/tmtests/tm08/task1.c | 254 -- testsuites/tmtests/tm08/tm08.doc | 12 - testsuites/tmtests/tm09/.cvsignore | 2 - testsuites/tmtests/tm09/Makefile.am | 45 - testsuites/tmtests/tm09/system.h | 42 - testsuites/tmtests/tm09/task1.c | 227 -- testsuites/tmtests/tm09/tm09.doc | 12 - testsuites/tmtests/tm10/.cvsignore | 2 - testsuites/tmtests/tm10/Makefile.am | 45 - testsuites/tmtests/tm10/system.h | 40 - testsuites/tmtests/tm10/task1.c | 164 - testsuites/tmtests/tm10/tm10.doc | 12 - testsuites/tmtests/tm11/.cvsignore | 2 - testsuites/tmtests/tm11/Makefile.am | 45 - testsuites/tmtests/tm11/system.h | 40 - testsuites/tmtests/tm11/task1.c | 156 - testsuites/tmtests/tm11/tm11.doc | 12 - testsuites/tmtests/tm12/.cvsignore | 2 - testsuites/tmtests/tm12/Makefile.am | 45 - testsuites/tmtests/tm12/system.h | 40 - testsuites/tmtests/tm12/task1.c | 146 - testsuites/tmtests/tm12/tm12.doc | 12 - testsuites/tmtests/tm13/.cvsignore | 2 - testsuites/tmtests/tm13/Makefile.am | 45 - testsuites/tmtests/tm13/system.h | 40 - testsuites/tmtests/tm13/task1.c | 155 - testsuites/tmtests/tm13/tm13.doc | 12 - testsuites/tmtests/tm14/.cvsignore | 2 - testsuites/tmtests/tm14/Makefile.am | 45 - testsuites/tmtests/tm14/system.h | 40 - testsuites/tmtests/tm14/task1.c | 146 - testsuites/tmtests/tm14/tm14.doc | 12 - testsuites/tmtests/tm15/.cvsignore | 2 - testsuites/tmtests/tm15/Makefile.am | 45 - testsuites/tmtests/tm15/system.h | 40 - testsuites/tmtests/tm15/task1.c | 221 -- testsuites/tmtests/tm15/tm15.doc | 12 - testsuites/tmtests/tm16/.cvsignore | 2 - testsuites/tmtests/tm16/Makefile.am | 45 - testsuites/tmtests/tm16/system.h | 40 - testsuites/tmtests/tm16/task1.c | 147 - testsuites/tmtests/tm16/tm16.doc | 12 - testsuites/tmtests/tm17/.cvsignore | 2 - testsuites/tmtests/tm17/Makefile.am | 45 - testsuites/tmtests/tm17/system.h | 40 - testsuites/tmtests/tm17/task1.c | 126 - testsuites/tmtests/tm17/tm17.doc | 12 - testsuites/tmtests/tm18/.cvsignore | 2 - testsuites/tmtests/tm18/Makefile.am | 45 - testsuites/tmtests/tm18/system.h | 40 - testsuites/tmtests/tm18/task1.c | 111 - testsuites/tmtests/tm18/tm18.doc | 12 - testsuites/tmtests/tm19/.cvsignore | 2 - testsuites/tmtests/tm19/Makefile.am | 45 - testsuites/tmtests/tm19/system.h | 40 - testsuites/tmtests/tm19/task1.c | 207 -- testsuites/tmtests/tm19/tm19.doc | 12 - testsuites/tmtests/tm20/.cvsignore | 2 - testsuites/tmtests/tm20/Makefile.am | 45 - testsuites/tmtests/tm20/system.h | 42 - testsuites/tmtests/tm20/task1.c | 473 --- testsuites/tmtests/tm20/tm20.doc | 12 - testsuites/tmtests/tm21/.cvsignore | 2 - testsuites/tmtests/tm21/Makefile.am | 45 - testsuites/tmtests/tm21/system.h | 47 - testsuites/tmtests/tm21/task1.c | 237 -- testsuites/tmtests/tm21/tm21.doc | 12 - testsuites/tmtests/tm22/.cvsignore | 2 - testsuites/tmtests/tm22/Makefile.am | 45 - testsuites/tmtests/tm22/system.h | 40 - testsuites/tmtests/tm22/task1.c | 201 -- testsuites/tmtests/tm22/tm22.doc | 12 - testsuites/tmtests/tm23/.cvsignore | 2 - testsuites/tmtests/tm23/Makefile.am | 45 - testsuites/tmtests/tm23/system.h | 40 - testsuites/tmtests/tm23/task1.c | 301 -- testsuites/tmtests/tm23/tm23.doc | 12 - testsuites/tmtests/tm24/.cvsignore | 2 - testsuites/tmtests/tm24/Makefile.am | 45 - testsuites/tmtests/tm24/system.h | 39 - testsuites/tmtests/tm24/task1.c | 123 - testsuites/tmtests/tm24/tm24.doc | 12 - testsuites/tmtests/tm25/.cvsignore | 2 - testsuites/tmtests/tm25/Makefile.am | 45 - testsuites/tmtests/tm25/system.h | 40 - testsuites/tmtests/tm25/task1.c | 108 - testsuites/tmtests/tm25/tm25.doc | 12 - testsuites/tmtests/tm26/.cvsignore | 2 - testsuites/tmtests/tm26/Makefile.am | 45 - testsuites/tmtests/tm26/fptest.h | 164 - testsuites/tmtests/tm26/system.h | 40 - testsuites/tmtests/tm26/task1.c | 594 ---- testsuites/tmtests/tm26/tm26.doc | 12 - testsuites/tmtests/tm27/.cvsignore | 2 - testsuites/tmtests/tm27/Makefile.am | 45 - testsuites/tmtests/tm27/system.h | 39 - testsuites/tmtests/tm27/task1.c | 279 -- testsuites/tmtests/tm27/tm27.doc | 12 - testsuites/tmtests/tm28/.cvsignore | 2 - testsuites/tmtests/tm28/Makefile.am | 45 - testsuites/tmtests/tm28/system.h | 40 - testsuites/tmtests/tm28/task1.c | 133 - testsuites/tmtests/tm28/tm28.doc | 12 - testsuites/tmtests/tm29/.cvsignore | 2 - testsuites/tmtests/tm29/Makefile.am | 45 - testsuites/tmtests/tm29/system.h | 41 - testsuites/tmtests/tm29/task1.c | 206 -- testsuites/tmtests/tm29/tm29.doc | 12 - testsuites/tmtests/tmck/.cvsignore | 2 - testsuites/tmtests/tmck/Makefile.am | 45 - testsuites/tmtests/tmck/system.h | 39 - testsuites/tmtests/tmck/task1.c | 179 -- testsuites/tmtests/tmck/tmck.doc | 19 - testsuites/tmtests/tmoverhd/.cvsignore | 2 - testsuites/tmtests/tmoverhd/Makefile.am | 45 - testsuites/tmtests/tmoverhd/dumrtems.h | 254 -- testsuites/tmtests/tmoverhd/empty.c | 40 - testsuites/tmtests/tmoverhd/system.h | 57 - testsuites/tmtests/tmoverhd/testtask.c | 1278 -------- testsuites/tmtests/tmoverhd/tmoverhd.doc | 12 - testsuites/tmtests/tmtests.am | 13 - testsuites/tools/.cvsignore | 14 - testsuites/tools/ChangeLog | 54 - testsuites/tools/Makefile.am | 10 - testsuites/tools/configure.ac | 24 - testsuites/tools/generic/.cvsignore | 16 - testsuites/tools/generic/ChangeLog | 47 - testsuites/tools/generic/Makefile.am | 25 - testsuites/tools/generic/configure.ac | 26 - testsuites/tools/generic/difftest.in | 117 - testsuites/tools/generic/sorttimes.in | 194 -- 1338 files changed, 131909 deletions(-) delete mode 100755 bootstrap delete mode 100644 c/src/ada/.cvsignore delete mode 100644 c/src/ada/ChangeLog delete mode 100644 c/src/ada/Makefile.am delete mode 100644 c/src/ada/rtems-multiprocessing.adb delete mode 100644 c/src/ada/rtems-multiprocessing.ads delete mode 100644 c/src/ada/rtems.adb delete mode 100644 c/src/ada/rtems.ads delete mode 100644 c/src/lib/libcpu/powerpc/new-exceptions/ChangeLog delete mode 100644 c/src/lib/libcpu/powerpc/new-exceptions/cpu.c delete mode 100644 c/src/lib/libcpu/powerpc/new-exceptions/cpu_asm.S delete mode 100644 c/src/lib/libcpu/powerpc/old-exceptions/ChangeLog delete mode 100644 c/src/lib/libcpu/powerpc/old-exceptions/README delete mode 100644 c/src/lib/libcpu/powerpc/old-exceptions/TODO delete mode 100644 c/src/lib/libcpu/powerpc/old-exceptions/cpu.c delete mode 100644 c/src/lib/libcpu/powerpc/old-exceptions/cpu_asm.S delete mode 100644 c/src/lib/libcpu/powerpc/old-exceptions/irq_stub.S delete mode 100644 c/src/lib/libcpu/powerpc/old-exceptions/ppccache.c delete mode 100644 c/src/lib/libcpu/powerpc/old-exceptions/rtems/score/ppc_offs.h delete mode 100644 c/src/libchip/shmdr/.cvsignore delete mode 100644 c/src/libchip/shmdr/README delete mode 100644 c/src/libchip/shmdr/addlq.c delete mode 100644 c/src/libchip/shmdr/cnvpkt.c delete mode 100644 c/src/libchip/shmdr/dump.c delete mode 100644 c/src/libchip/shmdr/fatal.c delete mode 100644 c/src/libchip/shmdr/getlq.c delete mode 100644 c/src/libchip/shmdr/getpkt.c delete mode 100644 c/src/libchip/shmdr/init.c delete mode 100644 c/src/libchip/shmdr/initlq.c delete mode 100644 c/src/libchip/shmdr/intr.c delete mode 100644 c/src/libchip/shmdr/mpci.h delete mode 100644 c/src/libchip/shmdr/mpisr.c delete mode 100644 c/src/libchip/shmdr/poll.c delete mode 100644 c/src/libchip/shmdr/receive.c delete mode 100644 c/src/libchip/shmdr/retpkt.c delete mode 100644 c/src/libchip/shmdr/send.c delete mode 100644 c/src/libchip/shmdr/setckvec.c delete mode 100644 c/src/libchip/shmdr/shm_driver.h delete mode 100644 cpukit/ftpd/Makefile.am delete mode 100644 cpukit/ftpd/ftpd.c delete mode 100644 cpukit/ftpd/ftpd.h delete mode 100644 cpukit/httpd/.cvsignore delete mode 100644 cpukit/httpd/Makefile.am delete mode 100644 cpukit/httpd/NOTES delete mode 100644 cpukit/httpd/asp.c delete mode 100644 cpukit/httpd/balloc.c delete mode 100644 cpukit/httpd/default.c delete mode 100644 cpukit/httpd/ej.h delete mode 100644 cpukit/httpd/ejIntrn.h delete mode 100644 cpukit/httpd/ejlex.c delete mode 100644 cpukit/httpd/ejparse.c delete mode 100644 cpukit/httpd/emfdb.c delete mode 100644 cpukit/httpd/emfdb.h delete mode 100644 cpukit/httpd/form.c delete mode 100644 cpukit/httpd/h.c delete mode 100644 cpukit/httpd/handler.c delete mode 100644 cpukit/httpd/license.txt delete mode 100644 cpukit/httpd/md5.h delete mode 100644 cpukit/httpd/md5c.c delete mode 100644 cpukit/httpd/mime.c delete mode 100644 cpukit/httpd/misc.c delete mode 100644 cpukit/httpd/ringq.c delete mode 100644 cpukit/httpd/rom.c delete mode 100644 cpukit/httpd/rtems_webserver.h delete mode 100644 cpukit/httpd/security.c delete mode 100644 cpukit/httpd/sock.c delete mode 100644 cpukit/httpd/socket.c delete mode 100644 cpukit/httpd/sym.c delete mode 100644 cpukit/httpd/uemf.c delete mode 100644 cpukit/httpd/uemf.h delete mode 100644 cpukit/httpd/um.c delete mode 100644 cpukit/httpd/um.h delete mode 100644 cpukit/httpd/url.c delete mode 100644 cpukit/httpd/value.c delete mode 100644 cpukit/httpd/wbase64.c delete mode 100644 cpukit/httpd/webcomp.c delete mode 100644 cpukit/httpd/webmain.c delete mode 100644 cpukit/httpd/webpage.c delete mode 100644 cpukit/httpd/webrom.c delete mode 100644 cpukit/httpd/webs.c delete mode 100644 cpukit/httpd/webs.h delete mode 100644 cpukit/httpd/websuemf.c delete mode 100644 cpukit/httpd/wsIntrn.h delete mode 100644 cpukit/libnetworking/netinet/in_cksum_arm.h delete mode 100644 cpukit/libnetworking/netinet/in_cksum_i386.h delete mode 100644 cpukit/libnetworking/netinet/in_cksum_m68k.h delete mode 100644 cpukit/libnetworking/netinet/in_cksum_powerpc.h delete mode 100644 cpukit/pppd/Makefile.am delete mode 100644 cpukit/pppd/README delete mode 100644 cpukit/pppd/STATUS delete mode 100644 cpukit/pppd/auth.c delete mode 100644 cpukit/pppd/cbcp.c delete mode 100644 cpukit/pppd/cbcp.h delete mode 100644 cpukit/pppd/ccp.c delete mode 100644 cpukit/pppd/ccp.h delete mode 100644 cpukit/pppd/chap.c delete mode 100644 cpukit/pppd/chap.h delete mode 100644 cpukit/pppd/chap_ms.c delete mode 100644 cpukit/pppd/chap_ms.h delete mode 100644 cpukit/pppd/chat.c delete mode 100644 cpukit/pppd/demand.c delete mode 100644 cpukit/pppd/example/Makefile-user delete mode 100644 cpukit/pppd/example/README delete mode 100644 cpukit/pppd/example/init.c delete mode 100644 cpukit/pppd/example/netconfig.h delete mode 100644 cpukit/pppd/example/ppp.conf delete mode 100644 cpukit/pppd/example/pppd.options delete mode 100644 cpukit/pppd/example/pppdapp.c delete mode 100644 cpukit/pppd/example/system.h delete mode 100644 cpukit/pppd/fsm.c delete mode 100644 cpukit/pppd/fsm.h delete mode 100644 cpukit/pppd/ipcp.c delete mode 100644 cpukit/pppd/ipcp.h delete mode 100644 cpukit/pppd/ipxcp.c delete mode 100644 cpukit/pppd/ipxcp.h delete mode 100644 cpukit/pppd/lcp.c delete mode 100644 cpukit/pppd/lcp.h delete mode 100644 cpukit/pppd/magic.c delete mode 100644 cpukit/pppd/magic.h delete mode 100644 cpukit/pppd/md4.c delete mode 100644 cpukit/pppd/md4.h delete mode 100644 cpukit/pppd/md5.c delete mode 100644 cpukit/pppd/md5.h delete mode 100644 cpukit/pppd/options.c delete mode 100644 cpukit/pppd/patchlevel.h delete mode 100644 cpukit/pppd/pathnames.h delete mode 100644 cpukit/pppd/pppd.8 delete mode 100644 cpukit/pppd/pppd.h delete mode 100644 cpukit/pppd/rtemsdialer.h delete mode 100644 cpukit/pppd/rtemsmain.c delete mode 100644 cpukit/pppd/rtemspppd.c delete mode 100644 cpukit/pppd/rtemspppd.h delete mode 100644 cpukit/pppd/sys-rtems.c delete mode 100644 cpukit/pppd/upap.c delete mode 100644 cpukit/pppd/upap.h delete mode 100644 cpukit/pppd/utils.c delete mode 100644 cpukit/rtems/src/clocktodtoseconds.c delete mode 100644 cpukit/rtems/src/clocktodvalidate.c delete mode 100644 cpukit/score/cpu/arm/rtems/asm.h delete mode 100644 cpukit/score/cpu/c4x/rtems/asm.h delete mode 100644 cpukit/score/cpu/c4x/rtems/tic4x/c4xio.h delete mode 100644 cpukit/score/cpu/h8300/rtems/asm.h delete mode 100644 cpukit/score/cpu/i386/rtems/asm.h delete mode 100644 cpukit/score/cpu/m68k/rtems/asm.h delete mode 100644 cpukit/score/cpu/m68k/rtems/m68k/m68302.h delete mode 100644 cpukit/score/cpu/m68k/rtems/m68k/m68360.h delete mode 100644 cpukit/score/cpu/m68k/rtems/m68k/qsm.h delete mode 100644 cpukit/score/cpu/m68k/rtems/m68k/sim.h delete mode 100644 cpukit/score/cpu/mips/rtems/asm.h delete mode 100644 cpukit/score/cpu/mips/rtems/mips/idtcpu.h delete mode 100644 cpukit/score/cpu/mips/rtems/mips/iregdef.h delete mode 100644 cpukit/score/cpu/no_cpu/rtems/asm.h delete mode 100644 cpukit/score/cpu/or32/rtems/asm.h delete mode 100644 cpukit/score/cpu/powerpc/rtems/asm.h delete mode 100644 cpukit/score/cpu/sh/rtems/asm.h delete mode 100644 cpukit/score/cpu/sparc/rtems/asm.h delete mode 100644 cpukit/telnetd/Makefile.am delete mode 100644 cpukit/telnetd/README delete mode 100644 cpukit/telnetd/icmds.c delete mode 100644 cpukit/telnetd/pty.c delete mode 100644 cpukit/telnetd/pty.h delete mode 100644 cpukit/telnetd/telnetd.c delete mode 100644 cpukit/telnetd/telnetd.h delete mode 100644 cpukit/zlib/doc/rfc1950.txt delete mode 100644 cpukit/zlib/doc/rfc1951.txt delete mode 100644 cpukit/zlib/doc/rfc1952.txt delete mode 100644 testsuites/.cvsignore delete mode 100644 testsuites/ChangeLog delete mode 100644 testsuites/Makefile.am delete mode 100644 testsuites/PROBLEMS delete mode 100644 testsuites/README delete mode 100644 testsuites/configure.ac delete mode 100644 testsuites/itrontests/.cvsignore delete mode 100644 testsuites/itrontests/ChangeLog delete mode 100644 testsuites/itrontests/Makefile.am delete mode 100644 testsuites/itrontests/README delete mode 100644 testsuites/itrontests/configure.ac delete mode 100644 testsuites/itrontests/itronhello/.cvsignore delete mode 100644 testsuites/itrontests/itronhello/Makefile.am delete mode 100644 testsuites/itrontests/itronhello/init.c delete mode 100644 testsuites/itrontests/itronhello/itronhello.doc delete mode 100644 testsuites/itrontests/itronhello/itronhello.scn delete mode 100644 testsuites/itrontests/itronhello/system.h delete mode 100644 testsuites/itrontests/itronmbf01/.cvsignore delete mode 100644 testsuites/itrontests/itronmbf01/Makefile.am delete mode 100644 testsuites/itrontests/itronmbf01/init.c delete mode 100644 testsuites/itrontests/itronmbf01/itronmbf01.doc delete mode 100644 testsuites/itrontests/itronmbf01/itronmbf01.scn delete mode 100644 testsuites/itrontests/itronmbf01/system.h delete mode 100644 testsuites/itrontests/itronmbox01/.cvsignore delete mode 100644 testsuites/itrontests/itronmbox01/Makefile.am delete mode 100644 testsuites/itrontests/itronmbox01/init.c delete mode 100644 testsuites/itrontests/itronmbox01/itronmbox01.doc delete mode 100644 testsuites/itrontests/itronmbox01/itronmbox01.scn delete mode 100644 testsuites/itrontests/itronmbox01/system.h delete mode 100644 testsuites/itrontests/itronsem01/.cvsignore delete mode 100644 testsuites/itrontests/itronsem01/Makefile.am delete mode 100644 testsuites/itrontests/itronsem01/init.c delete mode 100644 testsuites/itrontests/itronsem01/itronsem01.doc delete mode 100644 testsuites/itrontests/itronsem01/itronsem01.scn delete mode 100644 testsuites/itrontests/itronsem01/system.h delete mode 100644 testsuites/itrontests/itrontask01/.cvsignore delete mode 100644 testsuites/itrontests/itrontask01/Makefile.am delete mode 100644 testsuites/itrontests/itrontask01/init.c delete mode 100644 testsuites/itrontests/itrontask01/itrontask01.doc delete mode 100644 testsuites/itrontests/itrontask01/itrontask01.scn delete mode 100644 testsuites/itrontests/itrontask01/system.h delete mode 100644 testsuites/itrontests/itrontask01/task1.c delete mode 100644 testsuites/itrontests/itrontask02/.cvsignore delete mode 100644 testsuites/itrontests/itrontask02/Makefile.am delete mode 100644 testsuites/itrontests/itrontask02/dormant.c delete mode 100644 testsuites/itrontests/itrontask02/init.c delete mode 100644 testsuites/itrontests/itrontask02/itrontask02.doc delete mode 100644 testsuites/itrontests/itrontask02/itrontask02.scn delete mode 100644 testsuites/itrontests/itrontask02/system.h delete mode 100644 testsuites/itrontests/itrontask03/.cvsignore delete mode 100644 testsuites/itrontests/itrontask03/Makefile.am delete mode 100644 testsuites/itrontests/itrontask03/init.c delete mode 100644 testsuites/itrontests/itrontask03/itrontask03.doc delete mode 100644 testsuites/itrontests/itrontask03/itrontask03.scn delete mode 100644 testsuites/itrontests/itrontask03/preempt.c delete mode 100644 testsuites/itrontests/itrontask03/system.h delete mode 100644 testsuites/itrontests/itrontask03/task1.c delete mode 100644 testsuites/itrontests/itrontask03/task2.c delete mode 100644 testsuites/itrontests/itrontask03/task3.c delete mode 100644 testsuites/itrontests/itrontask04/.cvsignore delete mode 100644 testsuites/itrontests/itrontask04/Makefile.am delete mode 100644 testsuites/itrontests/itrontask04/init.c delete mode 100644 testsuites/itrontests/itrontask04/itrontask04.doc delete mode 100644 testsuites/itrontests/itrontask04/itrontask04.scn delete mode 100644 testsuites/itrontests/itrontask04/system.h delete mode 100644 testsuites/itrontests/itrontask04/task1.c delete mode 100644 testsuites/itrontests/itrontask04/task2.c delete mode 100644 testsuites/itrontests/itrontask04/task3.c delete mode 100644 testsuites/itrontests/itrontests.am delete mode 100644 testsuites/itrontests/itrontime01/.cvsignore delete mode 100644 testsuites/itrontests/itrontime01/Makefile.am delete mode 100644 testsuites/itrontests/itrontime01/init.c delete mode 100644 testsuites/itrontests/itrontime01/itrontime01.doc delete mode 100644 testsuites/itrontests/itrontime01/itrontime01.scn delete mode 100644 testsuites/itrontests/itrontime01/system.h delete mode 100644 testsuites/libtests/.cvsignore delete mode 100644 testsuites/libtests/ChangeLog delete mode 100644 testsuites/libtests/Makefile.am delete mode 100644 testsuites/libtests/README delete mode 100644 testsuites/libtests/configure.ac delete mode 100644 testsuites/libtests/cpuuse/.cvsignore delete mode 100644 testsuites/libtests/cpuuse/Makefile.am delete mode 100644 testsuites/libtests/cpuuse/cpuuse.scn delete mode 100644 testsuites/libtests/cpuuse/init.c delete mode 100644 testsuites/libtests/cpuuse/system.h delete mode 100644 testsuites/libtests/cpuuse/task1.c delete mode 100644 testsuites/libtests/cpuuse/task2.c delete mode 100644 testsuites/libtests/cpuuse/task3.c delete mode 100644 testsuites/libtests/cpuuse/tswitch.c delete mode 100644 testsuites/libtests/libtests.am delete mode 100644 testsuites/libtests/malloctest/.cvsignore delete mode 100644 testsuites/libtests/malloctest/Makefile.am delete mode 100644 testsuites/libtests/malloctest/init.c delete mode 100644 testsuites/libtests/malloctest/malloctest.scn delete mode 100644 testsuites/libtests/malloctest/system.h delete mode 100644 testsuites/libtests/malloctest/task1.c delete mode 100644 testsuites/libtests/monitor/.cvsignore delete mode 100644 testsuites/libtests/monitor/Makefile.am delete mode 100644 testsuites/libtests/monitor/init.c delete mode 100644 testsuites/libtests/monitor/system.h delete mode 100644 testsuites/libtests/putenvtest/.cvsignore delete mode 100644 testsuites/libtests/putenvtest/Makefile.am delete mode 100644 testsuites/libtests/putenvtest/init.c delete mode 100644 testsuites/libtests/rtems++/.cvsignore delete mode 100644 testsuites/libtests/rtems++/Init.cc delete mode 100644 testsuites/libtests/rtems++/Makefile.am delete mode 100644 testsuites/libtests/rtems++/System.h delete mode 100644 testsuites/libtests/rtems++/Task1.cc delete mode 100644 testsuites/libtests/rtems++/Task2.cc delete mode 100644 testsuites/libtests/rtems++/Task3.cc delete mode 100644 testsuites/libtests/rtems++/rtems++.doc delete mode 100644 testsuites/libtests/rtems++/rtems++.scn delete mode 100644 testsuites/libtests/rtmonuse/.cvsignore delete mode 100644 testsuites/libtests/rtmonuse/Makefile.am delete mode 100644 testsuites/libtests/rtmonuse/getall.c delete mode 100644 testsuites/libtests/rtmonuse/init.c delete mode 100644 testsuites/libtests/rtmonuse/rtmonuse.scn delete mode 100644 testsuites/libtests/rtmonuse/system.h delete mode 100644 testsuites/libtests/rtmonuse/task1.c delete mode 100644 testsuites/libtests/stackchk/.cvsignore delete mode 100644 testsuites/libtests/stackchk/Makefile.am delete mode 100644 testsuites/libtests/stackchk/blow.c delete mode 100644 testsuites/libtests/stackchk/init.c delete mode 100644 testsuites/libtests/stackchk/stackchk.scn delete mode 100644 testsuites/libtests/stackchk/system.h delete mode 100644 testsuites/libtests/stackchk/task1.c delete mode 100644 testsuites/libtests/termios/.cvsignore delete mode 100644 testsuites/libtests/termios/Makefile.am delete mode 100644 testsuites/libtests/termios/README delete mode 100644 testsuites/libtests/termios/init.c delete mode 100644 testsuites/mptests/.cvsignore delete mode 100644 testsuites/mptests/ChangeLog delete mode 100644 testsuites/mptests/Makefile.am delete mode 100644 testsuites/mptests/README delete mode 100644 testsuites/mptests/configure.ac delete mode 100644 testsuites/mptests/mp01/.cvsignore delete mode 100644 testsuites/mptests/mp01/Makefile.am delete mode 100644 testsuites/mptests/mp01/init.c delete mode 100644 testsuites/mptests/mp01/node1/.cvsignore delete mode 100644 testsuites/mptests/mp01/node1/Makefile.am delete mode 100644 testsuites/mptests/mp01/node1/mp01.doc delete mode 100644 testsuites/mptests/mp01/node1/mp01.scn delete mode 100644 testsuites/mptests/mp01/node2/.cvsignore delete mode 100644 testsuites/mptests/mp01/node2/Makefile.am delete mode 100644 testsuites/mptests/mp01/node2/mp01.doc delete mode 100644 testsuites/mptests/mp01/node2/mp01.scn delete mode 100644 testsuites/mptests/mp01/system.h delete mode 100644 testsuites/mptests/mp01/task1.c delete mode 100644 testsuites/mptests/mp02/.cvsignore delete mode 100644 testsuites/mptests/mp02/Makefile.am delete mode 100644 testsuites/mptests/mp02/init.c delete mode 100644 testsuites/mptests/mp02/node1/.cvsignore delete mode 100644 testsuites/mptests/mp02/node1/Makefile.am delete mode 100644 testsuites/mptests/mp02/node1/mp02.doc delete mode 100644 testsuites/mptests/mp02/node1/mp02.scn delete mode 100644 testsuites/mptests/mp02/node2/.cvsignore delete mode 100644 testsuites/mptests/mp02/node2/Makefile.am delete mode 100644 testsuites/mptests/mp02/node2/mp02.doc delete mode 100644 testsuites/mptests/mp02/node2/mp02.scn delete mode 100644 testsuites/mptests/mp02/system.h delete mode 100644 testsuites/mptests/mp02/task1.c delete mode 100644 testsuites/mptests/mp03/.cvsignore delete mode 100644 testsuites/mptests/mp03/Makefile.am delete mode 100644 testsuites/mptests/mp03/delay.c delete mode 100644 testsuites/mptests/mp03/init.c delete mode 100644 testsuites/mptests/mp03/node1/.cvsignore delete mode 100644 testsuites/mptests/mp03/node1/Makefile.am delete mode 100644 testsuites/mptests/mp03/node1/mp03.doc delete mode 100644 testsuites/mptests/mp03/node1/mp03.scn delete mode 100644 testsuites/mptests/mp03/node2/.cvsignore delete mode 100644 testsuites/mptests/mp03/node2/Makefile.am delete mode 100644 testsuites/mptests/mp03/node2/mp03.doc delete mode 100644 testsuites/mptests/mp03/node2/mp03.scn delete mode 100644 testsuites/mptests/mp03/system.h delete mode 100644 testsuites/mptests/mp03/task1.c delete mode 100644 testsuites/mptests/mp04/.cvsignore delete mode 100644 testsuites/mptests/mp04/Makefile.am delete mode 100644 testsuites/mptests/mp04/init.c delete mode 100644 testsuites/mptests/mp04/node1/.cvsignore delete mode 100644 testsuites/mptests/mp04/node1/Makefile.am delete mode 100644 testsuites/mptests/mp04/node1/mp04.doc delete mode 100644 testsuites/mptests/mp04/node1/mp04.scn delete mode 100644 testsuites/mptests/mp04/node2/.cvsignore delete mode 100644 testsuites/mptests/mp04/node2/Makefile.am delete mode 100644 testsuites/mptests/mp04/node2/mp04.doc delete mode 100644 testsuites/mptests/mp04/node2/mp04.scn delete mode 100644 testsuites/mptests/mp04/system.h delete mode 100644 testsuites/mptests/mp04/task1.c delete mode 100644 testsuites/mptests/mp05/.cvsignore delete mode 100644 testsuites/mptests/mp05/Makefile.am delete mode 100644 testsuites/mptests/mp05/asr.c delete mode 100644 testsuites/mptests/mp05/init.c delete mode 100644 testsuites/mptests/mp05/node1/.cvsignore delete mode 100644 testsuites/mptests/mp05/node1/Makefile.am delete mode 100644 testsuites/mptests/mp05/node1/mp05.doc delete mode 100644 testsuites/mptests/mp05/node1/mp05.scn delete mode 100644 testsuites/mptests/mp05/node2/.cvsignore delete mode 100644 testsuites/mptests/mp05/node2/Makefile.am delete mode 100644 testsuites/mptests/mp05/node2/mp05.doc delete mode 100644 testsuites/mptests/mp05/node2/mp05.scn delete mode 100644 testsuites/mptests/mp05/system.h delete mode 100644 testsuites/mptests/mp05/task1.c delete mode 100644 testsuites/mptests/mp06/.cvsignore delete mode 100644 testsuites/mptests/mp06/Makefile.am delete mode 100644 testsuites/mptests/mp06/init.c delete mode 100644 testsuites/mptests/mp06/node1/.cvsignore delete mode 100644 testsuites/mptests/mp06/node1/Makefile.am delete mode 100644 testsuites/mptests/mp06/node1/mp06.doc delete mode 100644 testsuites/mptests/mp06/node1/mp06.scn delete mode 100644 testsuites/mptests/mp06/node2/.cvsignore delete mode 100644 testsuites/mptests/mp06/node2/Makefile.am delete mode 100644 testsuites/mptests/mp06/node2/mp06.doc delete mode 100644 testsuites/mptests/mp06/node2/mp06.scn delete mode 100644 testsuites/mptests/mp06/system.h delete mode 100644 testsuites/mptests/mp06/task1.c delete mode 100644 testsuites/mptests/mp07/.cvsignore delete mode 100644 testsuites/mptests/mp07/Makefile.am delete mode 100644 testsuites/mptests/mp07/init.c delete mode 100644 testsuites/mptests/mp07/node1/.cvsignore delete mode 100644 testsuites/mptests/mp07/node1/Makefile.am delete mode 100644 testsuites/mptests/mp07/node1/mp07.doc delete mode 100644 testsuites/mptests/mp07/node1/mp07.scn delete mode 100644 testsuites/mptests/mp07/node2/.cvsignore delete mode 100644 testsuites/mptests/mp07/node2/Makefile.am delete mode 100644 testsuites/mptests/mp07/node2/mp07.doc delete mode 100644 testsuites/mptests/mp07/node2/mp07.scn delete mode 100644 testsuites/mptests/mp07/system.h delete mode 100644 testsuites/mptests/mp07/task1.c delete mode 100644 testsuites/mptests/mp08/.cvsignore delete mode 100644 testsuites/mptests/mp08/Makefile.am delete mode 100644 testsuites/mptests/mp08/init.c delete mode 100644 testsuites/mptests/mp08/node1/.cvsignore delete mode 100644 testsuites/mptests/mp08/node1/Makefile.am delete mode 100644 testsuites/mptests/mp08/node1/mp08.doc delete mode 100644 testsuites/mptests/mp08/node1/mp08.scn delete mode 100644 testsuites/mptests/mp08/node2/.cvsignore delete mode 100644 testsuites/mptests/mp08/node2/Makefile.am delete mode 100644 testsuites/mptests/mp08/node2/mp08.doc delete mode 100644 testsuites/mptests/mp08/node2/mp08.scn delete mode 100644 testsuites/mptests/mp08/system.h delete mode 100644 testsuites/mptests/mp08/task1.c delete mode 100644 testsuites/mptests/mp09/.cvsignore delete mode 100644 testsuites/mptests/mp09/Makefile.am delete mode 100644 testsuites/mptests/mp09/init.c delete mode 100644 testsuites/mptests/mp09/node1/.cvsignore delete mode 100644 testsuites/mptests/mp09/node1/Makefile.am delete mode 100644 testsuites/mptests/mp09/node1/mp09.doc delete mode 100644 testsuites/mptests/mp09/node1/mp09.scn delete mode 100644 testsuites/mptests/mp09/node2/.cvsignore delete mode 100644 testsuites/mptests/mp09/node2/Makefile.am delete mode 100644 testsuites/mptests/mp09/node2/mp09.doc delete mode 100644 testsuites/mptests/mp09/node2/mp09.scn delete mode 100644 testsuites/mptests/mp09/recvmsg.c delete mode 100644 testsuites/mptests/mp09/sendmsg.c delete mode 100644 testsuites/mptests/mp09/system.h delete mode 100644 testsuites/mptests/mp09/task1.c delete mode 100644 testsuites/mptests/mp10/.cvsignore delete mode 100644 testsuites/mptests/mp10/Makefile.am delete mode 100644 testsuites/mptests/mp10/init.c delete mode 100644 testsuites/mptests/mp10/node1/.cvsignore delete mode 100644 testsuites/mptests/mp10/node1/Makefile.am delete mode 100644 testsuites/mptests/mp10/node1/mp10.doc delete mode 100644 testsuites/mptests/mp10/node1/mp10.scn delete mode 100644 testsuites/mptests/mp10/node2/.cvsignore delete mode 100644 testsuites/mptests/mp10/node2/Makefile.am delete mode 100644 testsuites/mptests/mp10/node2/mp10.doc delete mode 100644 testsuites/mptests/mp10/node2/mp10.scn delete mode 100644 testsuites/mptests/mp10/system.h delete mode 100644 testsuites/mptests/mp10/task1.c delete mode 100644 testsuites/mptests/mp10/task2.c delete mode 100644 testsuites/mptests/mp10/task3.c delete mode 100644 testsuites/mptests/mp11/.cvsignore delete mode 100644 testsuites/mptests/mp11/Makefile.am delete mode 100644 testsuites/mptests/mp11/init.c delete mode 100644 testsuites/mptests/mp11/node1/.cvsignore delete mode 100644 testsuites/mptests/mp11/node1/Makefile.am delete mode 100644 testsuites/mptests/mp11/node1/mp11.doc delete mode 100644 testsuites/mptests/mp11/node1/mp11.scn delete mode 100644 testsuites/mptests/mp11/node2/.cvsignore delete mode 100644 testsuites/mptests/mp11/node2/Makefile.am delete mode 100644 testsuites/mptests/mp11/node2/mp11.doc delete mode 100644 testsuites/mptests/mp11/node2/mp11.scn delete mode 100644 testsuites/mptests/mp11/system.h delete mode 100644 testsuites/mptests/mp12/.cvsignore delete mode 100644 testsuites/mptests/mp12/Makefile.am delete mode 100644 testsuites/mptests/mp12/init.c delete mode 100644 testsuites/mptests/mp12/node1/.cvsignore delete mode 100644 testsuites/mptests/mp12/node1/Makefile.am delete mode 100644 testsuites/mptests/mp12/node1/mp12.doc delete mode 100644 testsuites/mptests/mp12/node1/mp12.scn delete mode 100644 testsuites/mptests/mp12/node2/.cvsignore delete mode 100644 testsuites/mptests/mp12/node2/Makefile.am delete mode 100644 testsuites/mptests/mp12/node2/mp12.doc delete mode 100644 testsuites/mptests/mp12/node2/mp12.scn delete mode 100644 testsuites/mptests/mp12/system.h delete mode 100644 testsuites/mptests/mp13/.cvsignore delete mode 100644 testsuites/mptests/mp13/Makefile.am delete mode 100644 testsuites/mptests/mp13/init.c delete mode 100644 testsuites/mptests/mp13/node1/.cvsignore delete mode 100644 testsuites/mptests/mp13/node1/Makefile.am delete mode 100644 testsuites/mptests/mp13/node1/mp13.doc delete mode 100644 testsuites/mptests/mp13/node1/mp13.scn delete mode 100644 testsuites/mptests/mp13/node2/.cvsignore delete mode 100644 testsuites/mptests/mp13/node2/Makefile.am delete mode 100644 testsuites/mptests/mp13/node2/mp13.doc delete mode 100644 testsuites/mptests/mp13/node2/mp13.scn delete mode 100644 testsuites/mptests/mp13/system.h delete mode 100644 testsuites/mptests/mp13/task1.c delete mode 100644 testsuites/mptests/mp13/task2.c delete mode 100644 testsuites/mptests/mp14/.cvsignore delete mode 100644 testsuites/mptests/mp14/Makefile.am delete mode 100644 testsuites/mptests/mp14/delay.c delete mode 100644 testsuites/mptests/mp14/evtask1.c delete mode 100644 testsuites/mptests/mp14/evtmtask.c delete mode 100644 testsuites/mptests/mp14/exit.c delete mode 100644 testsuites/mptests/mp14/init.c delete mode 100644 testsuites/mptests/mp14/msgtask1.c delete mode 100644 testsuites/mptests/mp14/node1/.cvsignore delete mode 100644 testsuites/mptests/mp14/node1/Makefile.am delete mode 100644 testsuites/mptests/mp14/node1/mp14.doc delete mode 100644 testsuites/mptests/mp14/node1/mp14.scn delete mode 100644 testsuites/mptests/mp14/node2/.cvsignore delete mode 100644 testsuites/mptests/mp14/node2/Makefile.am delete mode 100644 testsuites/mptests/mp14/node2/mp14.doc delete mode 100644 testsuites/mptests/mp14/node2/mp14.scn delete mode 100644 testsuites/mptests/mp14/pttask1.c delete mode 100644 testsuites/mptests/mp14/smtask1.c delete mode 100644 testsuites/mptests/mp14/system.h delete mode 100644 testsuites/mptests/mptests.am delete mode 100644 testsuites/psxtests/.cvsignore delete mode 100644 testsuites/psxtests/ChangeLog delete mode 100644 testsuites/psxtests/Makefile.am delete mode 100644 testsuites/psxtests/configure.ac delete mode 100644 testsuites/psxtests/include/.cvsignore delete mode 100644 testsuites/psxtests/include/Makefile.am delete mode 100644 testsuites/psxtests/include/pmacros.h delete mode 100644 testsuites/psxtests/psx01/.cvsignore delete mode 100644 testsuites/psxtests/psx01/Makefile.am delete mode 100644 testsuites/psxtests/psx01/init.c delete mode 100644 testsuites/psxtests/psx01/psx01.scn delete mode 100644 testsuites/psxtests/psx01/system.h delete mode 100644 testsuites/psxtests/psx01/task.c delete mode 100644 testsuites/psxtests/psx02/.cvsignore delete mode 100644 testsuites/psxtests/psx02/Makefile.am delete mode 100644 testsuites/psxtests/psx02/init.c delete mode 100644 testsuites/psxtests/psx02/psx02.scn delete mode 100644 testsuites/psxtests/psx02/system.h delete mode 100644 testsuites/psxtests/psx02/task.c delete mode 100644 testsuites/psxtests/psx03/.cvsignore delete mode 100644 testsuites/psxtests/psx03/Makefile.am delete mode 100644 testsuites/psxtests/psx03/init.c delete mode 100644 testsuites/psxtests/psx03/psx03.scn delete mode 100644 testsuites/psxtests/psx03/system.h delete mode 100644 testsuites/psxtests/psx03/task.c delete mode 100644 testsuites/psxtests/psx04/.cvsignore delete mode 100644 testsuites/psxtests/psx04/Makefile.am delete mode 100644 testsuites/psxtests/psx04/init.c delete mode 100644 testsuites/psxtests/psx04/psx04.scn delete mode 100644 testsuites/psxtests/psx04/system.h delete mode 100644 testsuites/psxtests/psx04/task1.c delete mode 100644 testsuites/psxtests/psx04/task2.c delete mode 100644 testsuites/psxtests/psx04/task3.c delete mode 100644 testsuites/psxtests/psx05/.cvsignore delete mode 100644 testsuites/psxtests/psx05/Makefile.am delete mode 100644 testsuites/psxtests/psx05/init.c delete mode 100644 testsuites/psxtests/psx05/psx05.scn delete mode 100644 testsuites/psxtests/psx05/system.h delete mode 100644 testsuites/psxtests/psx05/task.c delete mode 100644 testsuites/psxtests/psx05/task2.c delete mode 100644 testsuites/psxtests/psx05/task3.c delete mode 100644 testsuites/psxtests/psx06/.cvsignore delete mode 100644 testsuites/psxtests/psx06/Makefile.am delete mode 100644 testsuites/psxtests/psx06/init.c delete mode 100644 testsuites/psxtests/psx06/psx06.scn delete mode 100644 testsuites/psxtests/psx06/system.h delete mode 100644 testsuites/psxtests/psx06/task.c delete mode 100644 testsuites/psxtests/psx06/task2.c delete mode 100644 testsuites/psxtests/psx07/.cvsignore delete mode 100644 testsuites/psxtests/psx07/Makefile.am delete mode 100644 testsuites/psxtests/psx07/init.c delete mode 100644 testsuites/psxtests/psx07/psx07.scn delete mode 100644 testsuites/psxtests/psx07/system.h delete mode 100644 testsuites/psxtests/psx07/task.c delete mode 100644 testsuites/psxtests/psx08/.cvsignore delete mode 100644 testsuites/psxtests/psx08/Makefile.am delete mode 100644 testsuites/psxtests/psx08/init.c delete mode 100644 testsuites/psxtests/psx08/psx08.scn delete mode 100644 testsuites/psxtests/psx08/system.h delete mode 100644 testsuites/psxtests/psx08/task1.c delete mode 100644 testsuites/psxtests/psx08/task2.c delete mode 100644 testsuites/psxtests/psx08/task3.c delete mode 100644 testsuites/psxtests/psx09/.cvsignore delete mode 100644 testsuites/psxtests/psx09/Makefile.am delete mode 100644 testsuites/psxtests/psx09/init.c delete mode 100644 testsuites/psxtests/psx09/psx09.scn delete mode 100644 testsuites/psxtests/psx09/system.h delete mode 100644 testsuites/psxtests/psx10/.cvsignore delete mode 100644 testsuites/psxtests/psx10/Makefile.am delete mode 100644 testsuites/psxtests/psx10/init.c delete mode 100644 testsuites/psxtests/psx10/psx10.scn delete mode 100644 testsuites/psxtests/psx10/system.h delete mode 100644 testsuites/psxtests/psx10/task.c delete mode 100644 testsuites/psxtests/psx10/task2.c delete mode 100644 testsuites/psxtests/psx10/task3.c delete mode 100644 testsuites/psxtests/psx11/.cvsignore delete mode 100644 testsuites/psxtests/psx11/Makefile.am delete mode 100644 testsuites/psxtests/psx11/init.c delete mode 100644 testsuites/psxtests/psx11/psx11.scn delete mode 100644 testsuites/psxtests/psx11/system.h delete mode 100644 testsuites/psxtests/psx11/task.c delete mode 100644 testsuites/psxtests/psx12/.cvsignore delete mode 100644 testsuites/psxtests/psx12/Makefile.am delete mode 100644 testsuites/psxtests/psx12/init.c delete mode 100644 testsuites/psxtests/psx12/psx12.scn delete mode 100644 testsuites/psxtests/psx12/system.h delete mode 100644 testsuites/psxtests/psx12/task.c delete mode 100644 testsuites/psxtests/psx13/.cvsignore delete mode 100644 testsuites/psxtests/psx13/Makefile.am delete mode 100644 testsuites/psxtests/psx13/main.c delete mode 100644 testsuites/psxtests/psx13/psx13.scn delete mode 100644 testsuites/psxtests/psx13/test.c delete mode 100644 testsuites/psxtests/psxcancel/.cvsignore delete mode 100644 testsuites/psxtests/psxcancel/Makefile.am delete mode 100644 testsuites/psxtests/psxcancel/init.c delete mode 100644 testsuites/psxtests/psxcancel/psxcancel.scn delete mode 100644 testsuites/psxtests/psxchroot01/.cvsignore delete mode 100644 testsuites/psxtests/psxchroot01/Makefile.am delete mode 100644 testsuites/psxtests/psxchroot01/main.c delete mode 100644 testsuites/psxtests/psxchroot01/psxchroot01.scn delete mode 100644 testsuites/psxtests/psxchroot01/test.c delete mode 100644 testsuites/psxtests/psxfile01/.cvsignore delete mode 100644 testsuites/psxtests/psxfile01/Makefile.am delete mode 100644 testsuites/psxtests/psxfile01/main.c delete mode 100644 testsuites/psxtests/psxfile01/psxfile01.scn delete mode 100644 testsuites/psxtests/psxfile01/test.c delete mode 100644 testsuites/psxtests/psxfile01/test_cat.c delete mode 100644 testsuites/psxtests/psxfile01/test_extend.c delete mode 100644 testsuites/psxtests/psxfile01/test_write.c delete mode 100644 testsuites/psxtests/psxhdrs/.cvsignore delete mode 100644 testsuites/psxtests/psxhdrs/Makefile.am delete mode 100644 testsuites/psxtests/psxhdrs/clock01.c delete mode 100644 testsuites/psxtests/psxhdrs/clock02.c delete mode 100644 testsuites/psxtests/psxhdrs/clock03.c delete mode 100644 testsuites/psxtests/psxhdrs/clock04.c delete mode 100644 testsuites/psxtests/psxhdrs/clock05.c delete mode 100644 testsuites/psxtests/psxhdrs/clock06.c delete mode 100644 testsuites/psxtests/psxhdrs/cond01.c delete mode 100644 testsuites/psxtests/psxhdrs/cond02.c delete mode 100644 testsuites/psxtests/psxhdrs/cond03.c delete mode 100644 testsuites/psxtests/psxhdrs/cond04.c delete mode 100644 testsuites/psxtests/psxhdrs/cond05.c delete mode 100644 testsuites/psxtests/psxhdrs/cond06.c delete mode 100644 testsuites/psxtests/psxhdrs/cond07.c delete mode 100644 testsuites/psxtests/psxhdrs/cond08.c delete mode 100644 testsuites/psxtests/psxhdrs/cond09.c delete mode 100644 testsuites/psxtests/psxhdrs/cond10.c delete mode 100644 testsuites/psxtests/psxhdrs/key01.c delete mode 100644 testsuites/psxtests/psxhdrs/key02.c delete mode 100644 testsuites/psxtests/psxhdrs/key03.c delete mode 100644 testsuites/psxtests/psxhdrs/key04.c delete mode 100644 testsuites/psxtests/psxhdrs/mutex01.c delete mode 100644 testsuites/psxtests/psxhdrs/mutex02.c delete mode 100644 testsuites/psxtests/psxhdrs/mutex03.c delete mode 100644 testsuites/psxtests/psxhdrs/mutex04.c delete mode 100644 testsuites/psxtests/psxhdrs/mutex05.c delete mode 100644 testsuites/psxtests/psxhdrs/mutex06.c delete mode 100644 testsuites/psxtests/psxhdrs/mutex07.c delete mode 100644 testsuites/psxtests/psxhdrs/mutex08.c delete mode 100644 testsuites/psxtests/psxhdrs/mutex09.c delete mode 100644 testsuites/psxtests/psxhdrs/mutex10.c delete mode 100644 testsuites/psxtests/psxhdrs/mutex11.c delete mode 100644 testsuites/psxtests/psxhdrs/mutex12.c delete mode 100644 testsuites/psxtests/psxhdrs/mutex13.c delete mode 100644 testsuites/psxtests/psxhdrs/mutex14.c delete mode 100644 testsuites/psxtests/psxhdrs/mutex15.c delete mode 100644 testsuites/psxtests/psxhdrs/mutex16.c delete mode 100644 testsuites/psxtests/psxhdrs/proc01.c delete mode 100644 testsuites/psxtests/psxhdrs/proc02.c delete mode 100644 testsuites/psxtests/psxhdrs/proc03.c delete mode 100644 testsuites/psxtests/psxhdrs/proc04.c delete mode 100644 testsuites/psxtests/psxhdrs/proc05.c delete mode 100644 testsuites/psxtests/psxhdrs/proc06.c delete mode 100644 testsuites/psxtests/psxhdrs/proc07.c delete mode 100644 testsuites/psxtests/psxhdrs/proc08.c delete mode 100644 testsuites/psxtests/psxhdrs/proc09.c delete mode 100644 testsuites/psxtests/psxhdrs/proc10.c delete mode 100644 testsuites/psxtests/psxhdrs/proc11.c delete mode 100644 testsuites/psxtests/psxhdrs/proc12.c delete mode 100644 testsuites/psxtests/psxhdrs/proc13.c delete mode 100644 testsuites/psxtests/psxhdrs/proc14.c delete mode 100644 testsuites/psxtests/psxhdrs/pthread01.c delete mode 100644 testsuites/psxtests/psxhdrs/pthread02.c delete mode 100644 testsuites/psxtests/psxhdrs/pthread03.c delete mode 100644 testsuites/psxtests/psxhdrs/pthread04.c delete mode 100644 testsuites/psxtests/psxhdrs/pthread05.c delete mode 100644 testsuites/psxtests/psxhdrs/pthread06.c delete mode 100644 testsuites/psxtests/psxhdrs/pthread07.c delete mode 100644 testsuites/psxtests/psxhdrs/pthread08.c delete mode 100644 testsuites/psxtests/psxhdrs/pthread09.c delete mode 100644 testsuites/psxtests/psxhdrs/pthread10.c delete mode 100644 testsuites/psxtests/psxhdrs/pthread11.c delete mode 100644 testsuites/psxtests/psxhdrs/pthread12.c delete mode 100644 testsuites/psxtests/psxhdrs/pthread13.c delete mode 100644 testsuites/psxtests/psxhdrs/pthread14.c delete mode 100644 testsuites/psxtests/psxhdrs/pthread15.c delete mode 100644 testsuites/psxtests/psxhdrs/pthread16.c delete mode 100644 testsuites/psxtests/psxhdrs/pthread17.c delete mode 100644 testsuites/psxtests/psxhdrs/pthread18.c delete mode 100644 testsuites/psxtests/psxhdrs/pthread19.c delete mode 100644 testsuites/psxtests/psxhdrs/pthread20.c delete mode 100644 testsuites/psxtests/psxhdrs/pthread21.c delete mode 100644 testsuites/psxtests/psxhdrs/pthread22.c delete mode 100644 testsuites/psxtests/psxhdrs/pthread23.c delete mode 100644 testsuites/psxtests/psxhdrs/pthread24.c delete mode 100644 testsuites/psxtests/psxhdrs/pthread25.c delete mode 100644 testsuites/psxtests/psxhdrs/pthread26.c delete mode 100644 testsuites/psxtests/psxhdrs/pthread27.c delete mode 100644 testsuites/psxtests/psxhdrs/pthread28.c delete mode 100644 testsuites/psxtests/psxhdrs/pthread29.c delete mode 100644 testsuites/psxtests/psxhdrs/pthread30.c delete mode 100644 testsuites/psxtests/psxhdrs/pthread31.c delete mode 100644 testsuites/psxtests/psxhdrs/pthread32.c delete mode 100644 testsuites/psxtests/psxhdrs/pthread33.c delete mode 100644 testsuites/psxtests/psxhdrs/pthread34.c delete mode 100644 testsuites/psxtests/psxhdrs/pthread35.c delete mode 100644 testsuites/psxtests/psxhdrs/pthread36.c delete mode 100644 testsuites/psxtests/psxhdrs/sched01.c delete mode 100644 testsuites/psxtests/psxhdrs/sched02.c delete mode 100644 testsuites/psxtests/psxhdrs/sched03.c delete mode 100644 testsuites/psxtests/psxhdrs/sched04.c delete mode 100644 testsuites/psxtests/psxhdrs/sched05.c delete mode 100644 testsuites/psxtests/psxhdrs/sched06.c delete mode 100644 testsuites/psxtests/psxhdrs/sched07.c delete mode 100644 testsuites/psxtests/psxhdrs/sched08.c delete mode 100644 testsuites/psxtests/psxhdrs/signal01.c delete mode 100644 testsuites/psxtests/psxhdrs/signal02.c delete mode 100644 testsuites/psxtests/psxhdrs/signal03.c delete mode 100644 testsuites/psxtests/psxhdrs/signal04.c delete mode 100644 testsuites/psxtests/psxhdrs/signal05.c delete mode 100644 testsuites/psxtests/psxhdrs/signal06.c delete mode 100644 testsuites/psxtests/psxhdrs/signal07.c delete mode 100644 testsuites/psxtests/psxhdrs/signal08.c delete mode 100644 testsuites/psxtests/psxhdrs/signal09.c delete mode 100644 testsuites/psxtests/psxhdrs/signal10.c delete mode 100644 testsuites/psxtests/psxhdrs/signal11.c delete mode 100644 testsuites/psxtests/psxhdrs/signal12.c delete mode 100644 testsuites/psxtests/psxhdrs/signal13.c delete mode 100644 testsuites/psxtests/psxhdrs/signal14.c delete mode 100644 testsuites/psxtests/psxhdrs/signal15.c delete mode 100644 testsuites/psxtests/psxhdrs/signal16.c delete mode 100644 testsuites/psxtests/psxhdrs/signal17.c delete mode 100644 testsuites/psxtests/psxhdrs/signal18.c delete mode 100644 testsuites/psxtests/psxhdrs/signal19.c delete mode 100644 testsuites/psxtests/psxhdrs/signal20.c delete mode 100644 testsuites/psxtests/psxhdrs/signal21.c delete mode 100644 testsuites/psxtests/psxhdrs/signal22.c delete mode 100644 testsuites/psxtests/psxhdrs/time01.c delete mode 100644 testsuites/psxtests/psxhdrs/time02.c delete mode 100644 testsuites/psxtests/psxhdrs/time03.c delete mode 100644 testsuites/psxtests/psxhdrs/time04.c delete mode 100644 testsuites/psxtests/psxhdrs/time05.c delete mode 100644 testsuites/psxtests/psxhdrs/time06.c delete mode 100644 testsuites/psxtests/psxhdrs/time07.c delete mode 100644 testsuites/psxtests/psxhdrs/time08.c delete mode 100644 testsuites/psxtests/psxhdrs/time09.c delete mode 100644 testsuites/psxtests/psxhdrs/time10.c delete mode 100644 testsuites/psxtests/psxhdrs/time11.c delete mode 100644 testsuites/psxtests/psxhdrs/time12.c delete mode 100644 testsuites/psxtests/psxhdrs/time13.c delete mode 100644 testsuites/psxtests/psxhdrs/timer01.c delete mode 100644 testsuites/psxtests/psxhdrs/timer02.c delete mode 100644 testsuites/psxtests/psxhdrs/timer03.c delete mode 100644 testsuites/psxtests/psxhdrs/timer04.c delete mode 100644 testsuites/psxtests/psxhdrs/timer05.c delete mode 100644 testsuites/psxtests/psxhdrs/timer06.c delete mode 100644 testsuites/psxtests/psxmount/.cvsignore delete mode 100644 testsuites/psxtests/psxmount/Makefile.am delete mode 100644 testsuites/psxtests/psxmount/main.c delete mode 100644 testsuites/psxtests/psxmount/psxmount.scn delete mode 100644 testsuites/psxtests/psxmount/test.c delete mode 100644 testsuites/psxtests/psxmsgq01/.cvsignore delete mode 100644 testsuites/psxtests/psxmsgq01/Makefile.am delete mode 100644 testsuites/psxtests/psxmsgq01/init.c delete mode 100644 testsuites/psxtests/psxmsgq01/psxmsgq01.scn delete mode 100644 testsuites/psxtests/psxmsgq01/system.h delete mode 100644 testsuites/psxtests/psxreaddir/.cvsignore delete mode 100644 testsuites/psxtests/psxreaddir/Makefile.am delete mode 100644 testsuites/psxtests/psxreaddir/main.c delete mode 100644 testsuites/psxtests/psxreaddir/psxreaddir.scn delete mode 100644 testsuites/psxtests/psxreaddir/test.c delete mode 100644 testsuites/psxtests/psxsem01/.cvsignore delete mode 100644 testsuites/psxtests/psxsem01/Makefile.am delete mode 100644 testsuites/psxtests/psxsem01/init.c delete mode 100644 testsuites/psxtests/psxsem01/psxsem01.scn delete mode 100644 testsuites/psxtests/psxsem01/system.h delete mode 100644 testsuites/psxtests/psxstat/.cvsignore delete mode 100644 testsuites/psxtests/psxstat/Makefile.am delete mode 100644 testsuites/psxtests/psxstat/main.c delete mode 100644 testsuites/psxtests/psxstat/psxstat.scn delete mode 100644 testsuites/psxtests/psxstat/test.c delete mode 100644 testsuites/psxtests/psxtests.am delete mode 100644 testsuites/psxtests/psxtime/.cvsignore delete mode 100644 testsuites/psxtests/psxtime/Makefile.am delete mode 100644 testsuites/psxtests/psxtime/main.c delete mode 100644 testsuites/psxtests/psxtime/psxtime.scn delete mode 100644 testsuites/psxtests/psxtime/test.c delete mode 100644 testsuites/psxtests/psxtimer/.cvsignore delete mode 100644 testsuites/psxtests/psxtimer/Makefile.am delete mode 100644 testsuites/psxtests/psxtimer/psxtimer.c delete mode 100644 testsuites/psxtests/psxtimer/psxtimer.scn delete mode 100644 testsuites/psxtests/psxtimer/system.h delete mode 100644 testsuites/samples/.cvsignore delete mode 100644 testsuites/samples/ChangeLog delete mode 100644 testsuites/samples/Makefile.am delete mode 100644 testsuites/samples/README delete mode 100644 testsuites/samples/base_mp/.cvsignore delete mode 100644 testsuites/samples/base_mp/Makefile.am delete mode 100644 testsuites/samples/base_mp/apptask.c delete mode 100644 testsuites/samples/base_mp/init.c delete mode 100644 testsuites/samples/base_mp/node1/.cvsignore delete mode 100644 testsuites/samples/base_mp/node1/Makefile.am delete mode 100644 testsuites/samples/base_mp/node1/base_mp.doc delete mode 100644 testsuites/samples/base_mp/node1/base_mp.scn delete mode 100644 testsuites/samples/base_mp/node2/.cvsignore delete mode 100644 testsuites/samples/base_mp/node2/Makefile.am delete mode 100644 testsuites/samples/base_mp/node2/base_mp.doc delete mode 100644 testsuites/samples/base_mp/node2/base_mp.scn delete mode 100644 testsuites/samples/base_mp/system.h delete mode 100644 testsuites/samples/base_sp/.cvsignore delete mode 100644 testsuites/samples/base_sp/Makefile.am delete mode 100644 testsuites/samples/base_sp/apptask.c delete mode 100644 testsuites/samples/base_sp/base_sp.doc delete mode 100644 testsuites/samples/base_sp/base_sp.scn delete mode 100644 testsuites/samples/base_sp/init.c delete mode 100644 testsuites/samples/base_sp/system.h delete mode 100644 testsuites/samples/cdtest/.cvsignore delete mode 100644 testsuites/samples/cdtest/Makefile.am delete mode 100644 testsuites/samples/cdtest/cdtest.scn delete mode 100644 testsuites/samples/cdtest/init.c delete mode 100644 testsuites/samples/cdtest/main.cc delete mode 100644 testsuites/samples/cdtest/system.h delete mode 100644 testsuites/samples/configure.ac delete mode 100644 testsuites/samples/hello/.cvsignore delete mode 100644 testsuites/samples/hello/Makefile.am delete mode 100644 testsuites/samples/hello/hello.doc delete mode 100644 testsuites/samples/hello/hello.scn delete mode 100644 testsuites/samples/hello/init.c delete mode 100644 testsuites/samples/hello/system.h delete mode 100644 testsuites/samples/loopback/.cvsignore delete mode 100644 testsuites/samples/loopback/Makefile.am delete mode 100644 testsuites/samples/loopback/README delete mode 100644 testsuites/samples/loopback/init.c delete mode 100644 testsuites/samples/loopback/loopback.scn delete mode 100644 testsuites/samples/minimum/.cvsignore delete mode 100644 testsuites/samples/minimum/Makefile.am delete mode 100644 testsuites/samples/minimum/init.c delete mode 100644 testsuites/samples/minimum/minimum.doc delete mode 100644 testsuites/samples/minimum/minimum.scn delete mode 100644 testsuites/samples/paranoia/.cvsignore delete mode 100644 testsuites/samples/paranoia/Makefile.am delete mode 100644 testsuites/samples/paranoia/init.c delete mode 100644 testsuites/samples/paranoia/paranoia.c delete mode 100644 testsuites/samples/paranoia/paranoia.doc delete mode 100644 testsuites/samples/paranoia/system.h delete mode 100644 testsuites/samples/sample.am delete mode 100644 testsuites/samples/ticker/.cvsignore delete mode 100644 testsuites/samples/ticker/Makefile.am delete mode 100644 testsuites/samples/ticker/init.c delete mode 100644 testsuites/samples/ticker/system.h delete mode 100644 testsuites/samples/ticker/tasks.c delete mode 100644 testsuites/samples/ticker/ticker.doc delete mode 100644 testsuites/samples/ticker/ticker.scn delete mode 100644 testsuites/samples/unlimited/.cvsignore delete mode 100644 testsuites/samples/unlimited/Makefile.am delete mode 100644 testsuites/samples/unlimited/init.c delete mode 100644 testsuites/samples/unlimited/system.h delete mode 100644 testsuites/samples/unlimited/test1.c delete mode 100644 testsuites/samples/unlimited/test2.c delete mode 100644 testsuites/samples/unlimited/test3.c delete mode 100644 testsuites/samples/unlimited/unlimited.doc delete mode 100644 testsuites/samples/unlimited/unlimited.scn delete mode 100644 testsuites/sptests/.cvsignore delete mode 100644 testsuites/sptests/ChangeLog delete mode 100644 testsuites/sptests/Makefile.am delete mode 100644 testsuites/sptests/README delete mode 100644 testsuites/sptests/configure.ac delete mode 100644 testsuites/sptests/sp01/.cvsignore delete mode 100644 testsuites/sptests/sp01/Makefile.am delete mode 100644 testsuites/sptests/sp01/init.c delete mode 100644 testsuites/sptests/sp01/sp01.doc delete mode 100644 testsuites/sptests/sp01/sp01.scn delete mode 100644 testsuites/sptests/sp01/system.h delete mode 100644 testsuites/sptests/sp01/task1.c delete mode 100644 testsuites/sptests/sp02/.cvsignore delete mode 100644 testsuites/sptests/sp02/Makefile.am delete mode 100644 testsuites/sptests/sp02/init.c delete mode 100644 testsuites/sptests/sp02/preempt.c delete mode 100644 testsuites/sptests/sp02/sp02.doc delete mode 100644 testsuites/sptests/sp02/sp02.scn delete mode 100644 testsuites/sptests/sp02/system.h delete mode 100644 testsuites/sptests/sp02/task1.c delete mode 100644 testsuites/sptests/sp02/task2.c delete mode 100644 testsuites/sptests/sp02/task3.c delete mode 100644 testsuites/sptests/sp03/.cvsignore delete mode 100644 testsuites/sptests/sp03/Makefile.am delete mode 100644 testsuites/sptests/sp03/init.c delete mode 100644 testsuites/sptests/sp03/sp03.doc delete mode 100644 testsuites/sptests/sp03/sp03.scn delete mode 100644 testsuites/sptests/sp03/system.h delete mode 100644 testsuites/sptests/sp03/task1.c delete mode 100644 testsuites/sptests/sp03/task2.c delete mode 100644 testsuites/sptests/sp04/.cvsignore delete mode 100644 testsuites/sptests/sp04/Makefile.am delete mode 100644 testsuites/sptests/sp04/init.c delete mode 100644 testsuites/sptests/sp04/sp04.doc delete mode 100644 testsuites/sptests/sp04/sp04.scn delete mode 100644 testsuites/sptests/sp04/system.h delete mode 100644 testsuites/sptests/sp04/task1.c delete mode 100644 testsuites/sptests/sp04/task2.c delete mode 100644 testsuites/sptests/sp04/task3.c delete mode 100644 testsuites/sptests/sp04/tswitch.c delete mode 100644 testsuites/sptests/sp05/.cvsignore delete mode 100644 testsuites/sptests/sp05/Makefile.am delete mode 100644 testsuites/sptests/sp05/init.c delete mode 100644 testsuites/sptests/sp05/sp05.doc delete mode 100644 testsuites/sptests/sp05/sp05.scn delete mode 100644 testsuites/sptests/sp05/system.h delete mode 100644 testsuites/sptests/sp05/task1.c delete mode 100644 testsuites/sptests/sp05/task2.c delete mode 100644 testsuites/sptests/sp05/task3.c delete mode 100644 testsuites/sptests/sp06/.cvsignore delete mode 100644 testsuites/sptests/sp06/Makefile.am delete mode 100644 testsuites/sptests/sp06/init.c delete mode 100644 testsuites/sptests/sp06/sp06.doc delete mode 100644 testsuites/sptests/sp06/sp06.scn delete mode 100644 testsuites/sptests/sp06/system.h delete mode 100644 testsuites/sptests/sp06/task1.c delete mode 100644 testsuites/sptests/sp06/task2.c delete mode 100644 testsuites/sptests/sp06/task3.c delete mode 100644 testsuites/sptests/sp07/.cvsignore delete mode 100644 testsuites/sptests/sp07/Makefile.am delete mode 100644 testsuites/sptests/sp07/init.c delete mode 100644 testsuites/sptests/sp07/sp07.doc delete mode 100644 testsuites/sptests/sp07/sp07.scn delete mode 100644 testsuites/sptests/sp07/system.h delete mode 100644 testsuites/sptests/sp07/task1.c delete mode 100644 testsuites/sptests/sp07/task2.c delete mode 100644 testsuites/sptests/sp07/task3.c delete mode 100644 testsuites/sptests/sp07/task4.c delete mode 100644 testsuites/sptests/sp07/taskexit.c delete mode 100644 testsuites/sptests/sp07/tcreate.c delete mode 100644 testsuites/sptests/sp07/tdelete.c delete mode 100644 testsuites/sptests/sp07/trestart.c delete mode 100644 testsuites/sptests/sp07/tstart.c delete mode 100644 testsuites/sptests/sp08/.cvsignore delete mode 100644 testsuites/sptests/sp08/Makefile.am delete mode 100644 testsuites/sptests/sp08/init.c delete mode 100644 testsuites/sptests/sp08/sp08.doc delete mode 100644 testsuites/sptests/sp08/sp08.scn delete mode 100644 testsuites/sptests/sp08/system.h delete mode 100644 testsuites/sptests/sp08/task1.c delete mode 100644 testsuites/sptests/sp09/.cvsignore delete mode 100644 testsuites/sptests/sp09/Makefile.am delete mode 100644 testsuites/sptests/sp09/delay.c delete mode 100644 testsuites/sptests/sp09/init.c delete mode 100644 testsuites/sptests/sp09/isr.c delete mode 100644 testsuites/sptests/sp09/screen01.c delete mode 100644 testsuites/sptests/sp09/screen02.c delete mode 100644 testsuites/sptests/sp09/screen03.c delete mode 100644 testsuites/sptests/sp09/screen04.c delete mode 100644 testsuites/sptests/sp09/screen05.c delete mode 100644 testsuites/sptests/sp09/screen06.c delete mode 100644 testsuites/sptests/sp09/screen07.c delete mode 100644 testsuites/sptests/sp09/screen08.c delete mode 100644 testsuites/sptests/sp09/screen09.c delete mode 100644 testsuites/sptests/sp09/screen10.c delete mode 100644 testsuites/sptests/sp09/screen11.c delete mode 100644 testsuites/sptests/sp09/screen12.c delete mode 100644 testsuites/sptests/sp09/screen13.c delete mode 100644 testsuites/sptests/sp09/screen14.c delete mode 100644 testsuites/sptests/sp09/sp09.doc delete mode 100644 testsuites/sptests/sp09/sp09.scn delete mode 100644 testsuites/sptests/sp09/system.h delete mode 100644 testsuites/sptests/sp09/task1.c delete mode 100644 testsuites/sptests/sp09/task2.c delete mode 100644 testsuites/sptests/sp09/task3.c delete mode 100644 testsuites/sptests/sp09/task4.c delete mode 100644 testsuites/sptests/sp11/.cvsignore delete mode 100644 testsuites/sptests/sp11/Makefile.am delete mode 100644 testsuites/sptests/sp11/init.c delete mode 100644 testsuites/sptests/sp11/sp11.doc delete mode 100644 testsuites/sptests/sp11/sp11.scn delete mode 100644 testsuites/sptests/sp11/system.h delete mode 100644 testsuites/sptests/sp11/task1.c delete mode 100644 testsuites/sptests/sp11/task2.c delete mode 100644 testsuites/sptests/sp11/timer.c delete mode 100644 testsuites/sptests/sp12/.cvsignore delete mode 100644 testsuites/sptests/sp12/Makefile.am delete mode 100644 testsuites/sptests/sp12/init.c delete mode 100644 testsuites/sptests/sp12/pridrv.c delete mode 100644 testsuites/sptests/sp12/pritask.c delete mode 100644 testsuites/sptests/sp12/sp12.doc delete mode 100644 testsuites/sptests/sp12/sp12.scn delete mode 100644 testsuites/sptests/sp12/system.h delete mode 100644 testsuites/sptests/sp12/task1.c delete mode 100644 testsuites/sptests/sp12/task2.c delete mode 100644 testsuites/sptests/sp12/task3.c delete mode 100644 testsuites/sptests/sp12/task4.c delete mode 100644 testsuites/sptests/sp12/task5.c delete mode 100644 testsuites/sptests/sp13/.cvsignore delete mode 100644 testsuites/sptests/sp13/Makefile.am delete mode 100644 testsuites/sptests/sp13/fillbuff.c delete mode 100644 testsuites/sptests/sp13/init.c delete mode 100644 testsuites/sptests/sp13/putbuff.c delete mode 100644 testsuites/sptests/sp13/sp13.doc delete mode 100644 testsuites/sptests/sp13/sp13.scn delete mode 100644 testsuites/sptests/sp13/system.h delete mode 100644 testsuites/sptests/sp13/task1.c delete mode 100644 testsuites/sptests/sp13/task2.c delete mode 100644 testsuites/sptests/sp13/task3.c delete mode 100644 testsuites/sptests/sp14/.cvsignore delete mode 100644 testsuites/sptests/sp14/Makefile.am delete mode 100644 testsuites/sptests/sp14/asr.c delete mode 100644 testsuites/sptests/sp14/init.c delete mode 100644 testsuites/sptests/sp14/sp14.doc delete mode 100644 testsuites/sptests/sp14/sp14.scn delete mode 100644 testsuites/sptests/sp14/system.h delete mode 100644 testsuites/sptests/sp14/task1.c delete mode 100644 testsuites/sptests/sp14/task2.c delete mode 100644 testsuites/sptests/sp15/.cvsignore delete mode 100644 testsuites/sptests/sp15/Makefile.am delete mode 100644 testsuites/sptests/sp15/init.c delete mode 100644 testsuites/sptests/sp15/sp15.doc delete mode 100644 testsuites/sptests/sp15/sp15.scn delete mode 100644 testsuites/sptests/sp15/system.h delete mode 100644 testsuites/sptests/sp15/task1.c delete mode 100644 testsuites/sptests/sp16/.cvsignore delete mode 100644 testsuites/sptests/sp16/Makefile.am delete mode 100644 testsuites/sptests/sp16/init.c delete mode 100644 testsuites/sptests/sp16/sp16.doc delete mode 100644 testsuites/sptests/sp16/sp16.scn delete mode 100644 testsuites/sptests/sp16/system.h delete mode 100644 testsuites/sptests/sp16/task1.c delete mode 100644 testsuites/sptests/sp16/task2.c delete mode 100644 testsuites/sptests/sp16/task3.c delete mode 100644 testsuites/sptests/sp16/task4.c delete mode 100644 testsuites/sptests/sp16/task5.c delete mode 100644 testsuites/sptests/sp17/.cvsignore delete mode 100644 testsuites/sptests/sp17/Makefile.am delete mode 100644 testsuites/sptests/sp17/asr.c delete mode 100644 testsuites/sptests/sp17/init.c delete mode 100644 testsuites/sptests/sp17/sp17.doc delete mode 100644 testsuites/sptests/sp17/sp17.scn delete mode 100644 testsuites/sptests/sp17/system.h delete mode 100644 testsuites/sptests/sp17/task1.c delete mode 100644 testsuites/sptests/sp17/task2.c delete mode 100644 testsuites/sptests/sp19/.cvsignore delete mode 100644 testsuites/sptests/sp19/Makefile.am delete mode 100644 testsuites/sptests/sp19/first.c delete mode 100644 testsuites/sptests/sp19/fptask.c delete mode 100644 testsuites/sptests/sp19/fptest.h delete mode 100644 testsuites/sptests/sp19/init.c delete mode 100644 testsuites/sptests/sp19/inttest.h delete mode 100644 testsuites/sptests/sp19/sp19.doc delete mode 100644 testsuites/sptests/sp19/sp19.scn delete mode 100644 testsuites/sptests/sp19/system.h delete mode 100644 testsuites/sptests/sp19/task1.c delete mode 100644 testsuites/sptests/sp20/.cvsignore delete mode 100644 testsuites/sptests/sp20/Makefile.am delete mode 100644 testsuites/sptests/sp20/getall.c delete mode 100644 testsuites/sptests/sp20/init.c delete mode 100644 testsuites/sptests/sp20/sp20.doc delete mode 100644 testsuites/sptests/sp20/sp20.scn delete mode 100644 testsuites/sptests/sp20/system.h delete mode 100644 testsuites/sptests/sp20/task1.c delete mode 100644 testsuites/sptests/sp21/.cvsignore delete mode 100644 testsuites/sptests/sp21/Makefile.am delete mode 100644 testsuites/sptests/sp21/init.c delete mode 100644 testsuites/sptests/sp21/sp21.doc delete mode 100644 testsuites/sptests/sp21/sp21.scn delete mode 100644 testsuites/sptests/sp21/system.h delete mode 100644 testsuites/sptests/sp21/task1.c delete mode 100644 testsuites/sptests/sp22/.cvsignore delete mode 100644 testsuites/sptests/sp22/Makefile.am delete mode 100644 testsuites/sptests/sp22/delay.c delete mode 100644 testsuites/sptests/sp22/init.c delete mode 100644 testsuites/sptests/sp22/prtime.c delete mode 100644 testsuites/sptests/sp22/sp22.doc delete mode 100644 testsuites/sptests/sp22/sp22.scn delete mode 100644 testsuites/sptests/sp22/system.h delete mode 100644 testsuites/sptests/sp22/task1.c delete mode 100644 testsuites/sptests/sp23/.cvsignore delete mode 100644 testsuites/sptests/sp23/Makefile.am delete mode 100644 testsuites/sptests/sp23/init.c delete mode 100644 testsuites/sptests/sp23/sp23.doc delete mode 100644 testsuites/sptests/sp23/sp23.scn delete mode 100644 testsuites/sptests/sp23/system.h delete mode 100644 testsuites/sptests/sp23/task1.c delete mode 100644 testsuites/sptests/sp24/.cvsignore delete mode 100644 testsuites/sptests/sp24/Makefile.am delete mode 100644 testsuites/sptests/sp24/init.c delete mode 100644 testsuites/sptests/sp24/resume.c delete mode 100644 testsuites/sptests/sp24/sp24.doc delete mode 100644 testsuites/sptests/sp24/sp24.scn delete mode 100644 testsuites/sptests/sp24/system.h delete mode 100644 testsuites/sptests/sp24/task1.c delete mode 100644 testsuites/sptests/sp25/.cvsignore delete mode 100644 testsuites/sptests/sp25/Makefile.am delete mode 100644 testsuites/sptests/sp25/init.c delete mode 100644 testsuites/sptests/sp25/sp25.doc delete mode 100644 testsuites/sptests/sp25/sp25.scn delete mode 100644 testsuites/sptests/sp25/system.h delete mode 100644 testsuites/sptests/sp25/task1.c delete mode 100644 testsuites/sptests/sp26/.cvsignore delete mode 100644 testsuites/sptests/sp26/Makefile.am delete mode 100644 testsuites/sptests/sp26/init.c delete mode 100644 testsuites/sptests/sp26/sp26.doc delete mode 100644 testsuites/sptests/sp26/sp26.scn delete mode 100644 testsuites/sptests/sp26/system.h delete mode 100644 testsuites/sptests/sp26/task1.c delete mode 100644 testsuites/sptests/sp27/.cvsignore delete mode 100644 testsuites/sptests/sp27/Makefile.am delete mode 100644 testsuites/sptests/sp27/init.c delete mode 100644 testsuites/sptests/sp27/sp27.doc delete mode 100644 testsuites/sptests/sp27/sp27.scn delete mode 100644 testsuites/sptests/sp28/.cvsignore delete mode 100644 testsuites/sptests/sp28/Makefile.am delete mode 100644 testsuites/sptests/sp28/init.c delete mode 100644 testsuites/sptests/sp28/sp28.doc delete mode 100644 testsuites/sptests/sp28/sp28.scn delete mode 100644 testsuites/sptests/sp29/.cvsignore delete mode 100644 testsuites/sptests/sp29/Makefile.am delete mode 100644 testsuites/sptests/sp29/init.c delete mode 100644 testsuites/sptests/sp29/sp29.doc delete mode 100644 testsuites/sptests/sp29/sp29.scn delete mode 100644 testsuites/sptests/sp30/.cvsignore delete mode 100644 testsuites/sptests/sp30/Makefile.am delete mode 100644 testsuites/sptests/sp30/init.c delete mode 100644 testsuites/sptests/sp30/resume.c delete mode 100644 testsuites/sptests/sp30/sp30.doc delete mode 100644 testsuites/sptests/sp30/sp30.scn delete mode 100644 testsuites/sptests/sp30/system.h delete mode 100644 testsuites/sptests/sp30/task1.c delete mode 100644 testsuites/sptests/sp31/.cvsignore delete mode 100644 testsuites/sptests/sp31/Makefile.am delete mode 100644 testsuites/sptests/sp31/delay.c delete mode 100644 testsuites/sptests/sp31/init.c delete mode 100644 testsuites/sptests/sp31/prtime.c delete mode 100644 testsuites/sptests/sp31/sp31.doc delete mode 100644 testsuites/sptests/sp31/sp31.scn delete mode 100644 testsuites/sptests/sp31/system.h delete mode 100644 testsuites/sptests/sp31/task1.c delete mode 100644 testsuites/sptests/sp32/.cvsignore delete mode 100644 testsuites/sptests/sp32/Makefile.am delete mode 100644 testsuites/sptests/sp32/init.c delete mode 100644 testsuites/sptests/sp32/sp32.scn delete mode 100644 testsuites/sptests/spfatal/.cvsignore delete mode 100644 testsuites/sptests/spfatal/Makefile.am delete mode 100644 testsuites/sptests/spfatal/README delete mode 100644 testsuites/sptests/spfatal/fatal.c delete mode 100644 testsuites/sptests/spfatal/init.c delete mode 100644 testsuites/sptests/spfatal/puterr.c delete mode 100644 testsuites/sptests/spfatal/spfatal.doc delete mode 100644 testsuites/sptests/spfatal/spfatal.scn delete mode 100644 testsuites/sptests/spfatal/system.h delete mode 100644 testsuites/sptests/spfatal/task1.c delete mode 100644 testsuites/sptests/spsize/.cvsignore delete mode 100644 testsuites/sptests/spsize/Makefile.am delete mode 100644 testsuites/sptests/spsize/getint.c delete mode 100644 testsuites/sptests/spsize/init.c delete mode 100644 testsuites/sptests/spsize/size.c delete mode 100644 testsuites/sptests/spsize/size.scn delete mode 100644 testsuites/sptests/spsize/system.h delete mode 100644 testsuites/sptests/sptests.am delete mode 100644 testsuites/support/.cvsignore delete mode 100644 testsuites/support/ChangeLog delete mode 100644 testsuites/support/Makefile.am delete mode 100644 testsuites/support/configure.ac delete mode 100644 testsuites/support/include/.cvsignore delete mode 100644 testsuites/support/include/buffer_test_io.h delete mode 100644 testsuites/support/include/tmacros.h delete mode 100644 testsuites/tmitrontests/.cvsignore delete mode 100644 testsuites/tmitrontests/ChangeLog delete mode 100644 testsuites/tmitrontests/Makefile.am delete mode 100644 testsuites/tmitrontests/README delete mode 100644 testsuites/tmitrontests/configure.ac delete mode 100644 testsuites/tmitrontests/include/.cvsignore delete mode 100644 testsuites/tmitrontests/include/Makefile.am delete mode 100644 testsuites/tmitrontests/include/timesys.h delete mode 100644 testsuites/tmitrontests/tmitronsem01/.cvsignore delete mode 100644 testsuites/tmitrontests/tmitronsem01/Makefile.am delete mode 100644 testsuites/tmitrontests/tmitronsem01/init.c delete mode 100644 testsuites/tmitrontests/tmitronsem01/system.h delete mode 100644 testsuites/tmitrontests/tmitronsem01/tmitronsem01.doc delete mode 100644 testsuites/tmitrontests/tmitrontests.am delete mode 100644 testsuites/tmtests/.cvsignore delete mode 100644 testsuites/tmtests/ChangeLog delete mode 100644 testsuites/tmtests/Makefile.am delete mode 100644 testsuites/tmtests/README delete mode 100644 testsuites/tmtests/configure.ac delete mode 100644 testsuites/tmtests/include/.cvsignore delete mode 100644 testsuites/tmtests/include/Makefile.am delete mode 100644 testsuites/tmtests/include/timesys.h delete mode 100644 testsuites/tmtests/tm01/.cvsignore delete mode 100644 testsuites/tmtests/tm01/Makefile.am delete mode 100644 testsuites/tmtests/tm01/system.h delete mode 100644 testsuites/tmtests/tm01/task1.c delete mode 100644 testsuites/tmtests/tm01/tm01.doc delete mode 100644 testsuites/tmtests/tm02/.cvsignore delete mode 100644 testsuites/tmtests/tm02/Makefile.am delete mode 100644 testsuites/tmtests/tm02/system.h delete mode 100644 testsuites/tmtests/tm02/task1.c delete mode 100644 testsuites/tmtests/tm02/tm02.doc delete mode 100644 testsuites/tmtests/tm03/.cvsignore delete mode 100644 testsuites/tmtests/tm03/Makefile.am delete mode 100644 testsuites/tmtests/tm03/system.h delete mode 100644 testsuites/tmtests/tm03/task1.c delete mode 100644 testsuites/tmtests/tm03/tm03.doc delete mode 100644 testsuites/tmtests/tm04/.cvsignore delete mode 100644 testsuites/tmtests/tm04/Makefile.am delete mode 100644 testsuites/tmtests/tm04/system.h delete mode 100644 testsuites/tmtests/tm04/task1.c delete mode 100644 testsuites/tmtests/tm04/tm04.doc delete mode 100644 testsuites/tmtests/tm05/.cvsignore delete mode 100644 testsuites/tmtests/tm05/Makefile.am delete mode 100644 testsuites/tmtests/tm05/system.h delete mode 100644 testsuites/tmtests/tm05/task1.c delete mode 100644 testsuites/tmtests/tm05/tm05.doc delete mode 100644 testsuites/tmtests/tm06/.cvsignore delete mode 100644 testsuites/tmtests/tm06/Makefile.am delete mode 100644 testsuites/tmtests/tm06/system.h delete mode 100644 testsuites/tmtests/tm06/task1.c delete mode 100644 testsuites/tmtests/tm06/tm06.doc delete mode 100644 testsuites/tmtests/tm07/.cvsignore delete mode 100644 testsuites/tmtests/tm07/Makefile.am delete mode 100644 testsuites/tmtests/tm07/system.h delete mode 100644 testsuites/tmtests/tm07/task1.c delete mode 100644 testsuites/tmtests/tm07/tm07.doc delete mode 100644 testsuites/tmtests/tm08/.cvsignore delete mode 100644 testsuites/tmtests/tm08/Makefile.am delete mode 100644 testsuites/tmtests/tm08/system.h delete mode 100644 testsuites/tmtests/tm08/task1.c delete mode 100644 testsuites/tmtests/tm08/tm08.doc delete mode 100644 testsuites/tmtests/tm09/.cvsignore delete mode 100644 testsuites/tmtests/tm09/Makefile.am delete mode 100644 testsuites/tmtests/tm09/system.h delete mode 100644 testsuites/tmtests/tm09/task1.c delete mode 100644 testsuites/tmtests/tm09/tm09.doc delete mode 100644 testsuites/tmtests/tm10/.cvsignore delete mode 100644 testsuites/tmtests/tm10/Makefile.am delete mode 100644 testsuites/tmtests/tm10/system.h delete mode 100644 testsuites/tmtests/tm10/task1.c delete mode 100644 testsuites/tmtests/tm10/tm10.doc delete mode 100644 testsuites/tmtests/tm11/.cvsignore delete mode 100644 testsuites/tmtests/tm11/Makefile.am delete mode 100644 testsuites/tmtests/tm11/system.h delete mode 100644 testsuites/tmtests/tm11/task1.c delete mode 100644 testsuites/tmtests/tm11/tm11.doc delete mode 100644 testsuites/tmtests/tm12/.cvsignore delete mode 100644 testsuites/tmtests/tm12/Makefile.am delete mode 100644 testsuites/tmtests/tm12/system.h delete mode 100644 testsuites/tmtests/tm12/task1.c delete mode 100644 testsuites/tmtests/tm12/tm12.doc delete mode 100644 testsuites/tmtests/tm13/.cvsignore delete mode 100644 testsuites/tmtests/tm13/Makefile.am delete mode 100644 testsuites/tmtests/tm13/system.h delete mode 100644 testsuites/tmtests/tm13/task1.c delete mode 100644 testsuites/tmtests/tm13/tm13.doc delete mode 100644 testsuites/tmtests/tm14/.cvsignore delete mode 100644 testsuites/tmtests/tm14/Makefile.am delete mode 100644 testsuites/tmtests/tm14/system.h delete mode 100644 testsuites/tmtests/tm14/task1.c delete mode 100644 testsuites/tmtests/tm14/tm14.doc delete mode 100644 testsuites/tmtests/tm15/.cvsignore delete mode 100644 testsuites/tmtests/tm15/Makefile.am delete mode 100644 testsuites/tmtests/tm15/system.h delete mode 100644 testsuites/tmtests/tm15/task1.c delete mode 100644 testsuites/tmtests/tm15/tm15.doc delete mode 100644 testsuites/tmtests/tm16/.cvsignore delete mode 100644 testsuites/tmtests/tm16/Makefile.am delete mode 100644 testsuites/tmtests/tm16/system.h delete mode 100644 testsuites/tmtests/tm16/task1.c delete mode 100644 testsuites/tmtests/tm16/tm16.doc delete mode 100644 testsuites/tmtests/tm17/.cvsignore delete mode 100644 testsuites/tmtests/tm17/Makefile.am delete mode 100644 testsuites/tmtests/tm17/system.h delete mode 100644 testsuites/tmtests/tm17/task1.c delete mode 100644 testsuites/tmtests/tm17/tm17.doc delete mode 100644 testsuites/tmtests/tm18/.cvsignore delete mode 100644 testsuites/tmtests/tm18/Makefile.am delete mode 100644 testsuites/tmtests/tm18/system.h delete mode 100644 testsuites/tmtests/tm18/task1.c delete mode 100644 testsuites/tmtests/tm18/tm18.doc delete mode 100644 testsuites/tmtests/tm19/.cvsignore delete mode 100644 testsuites/tmtests/tm19/Makefile.am delete mode 100644 testsuites/tmtests/tm19/system.h delete mode 100644 testsuites/tmtests/tm19/task1.c delete mode 100644 testsuites/tmtests/tm19/tm19.doc delete mode 100644 testsuites/tmtests/tm20/.cvsignore delete mode 100644 testsuites/tmtests/tm20/Makefile.am delete mode 100644 testsuites/tmtests/tm20/system.h delete mode 100644 testsuites/tmtests/tm20/task1.c delete mode 100644 testsuites/tmtests/tm20/tm20.doc delete mode 100644 testsuites/tmtests/tm21/.cvsignore delete mode 100644 testsuites/tmtests/tm21/Makefile.am delete mode 100644 testsuites/tmtests/tm21/system.h delete mode 100644 testsuites/tmtests/tm21/task1.c delete mode 100644 testsuites/tmtests/tm21/tm21.doc delete mode 100644 testsuites/tmtests/tm22/.cvsignore delete mode 100644 testsuites/tmtests/tm22/Makefile.am delete mode 100644 testsuites/tmtests/tm22/system.h delete mode 100644 testsuites/tmtests/tm22/task1.c delete mode 100644 testsuites/tmtests/tm22/tm22.doc delete mode 100644 testsuites/tmtests/tm23/.cvsignore delete mode 100644 testsuites/tmtests/tm23/Makefile.am delete mode 100644 testsuites/tmtests/tm23/system.h delete mode 100644 testsuites/tmtests/tm23/task1.c delete mode 100644 testsuites/tmtests/tm23/tm23.doc delete mode 100644 testsuites/tmtests/tm24/.cvsignore delete mode 100644 testsuites/tmtests/tm24/Makefile.am delete mode 100644 testsuites/tmtests/tm24/system.h delete mode 100644 testsuites/tmtests/tm24/task1.c delete mode 100644 testsuites/tmtests/tm24/tm24.doc delete mode 100644 testsuites/tmtests/tm25/.cvsignore delete mode 100644 testsuites/tmtests/tm25/Makefile.am delete mode 100644 testsuites/tmtests/tm25/system.h delete mode 100644 testsuites/tmtests/tm25/task1.c delete mode 100644 testsuites/tmtests/tm25/tm25.doc delete mode 100644 testsuites/tmtests/tm26/.cvsignore delete mode 100644 testsuites/tmtests/tm26/Makefile.am delete mode 100644 testsuites/tmtests/tm26/fptest.h delete mode 100644 testsuites/tmtests/tm26/system.h delete mode 100644 testsuites/tmtests/tm26/task1.c delete mode 100644 testsuites/tmtests/tm26/tm26.doc delete mode 100644 testsuites/tmtests/tm27/.cvsignore delete mode 100644 testsuites/tmtests/tm27/Makefile.am delete mode 100644 testsuites/tmtests/tm27/system.h delete mode 100644 testsuites/tmtests/tm27/task1.c delete mode 100644 testsuites/tmtests/tm27/tm27.doc delete mode 100644 testsuites/tmtests/tm28/.cvsignore delete mode 100644 testsuites/tmtests/tm28/Makefile.am delete mode 100644 testsuites/tmtests/tm28/system.h delete mode 100644 testsuites/tmtests/tm28/task1.c delete mode 100644 testsuites/tmtests/tm28/tm28.doc delete mode 100644 testsuites/tmtests/tm29/.cvsignore delete mode 100644 testsuites/tmtests/tm29/Makefile.am delete mode 100644 testsuites/tmtests/tm29/system.h delete mode 100644 testsuites/tmtests/tm29/task1.c delete mode 100644 testsuites/tmtests/tm29/tm29.doc delete mode 100644 testsuites/tmtests/tmck/.cvsignore delete mode 100644 testsuites/tmtests/tmck/Makefile.am delete mode 100644 testsuites/tmtests/tmck/system.h delete mode 100644 testsuites/tmtests/tmck/task1.c delete mode 100644 testsuites/tmtests/tmck/tmck.doc delete mode 100644 testsuites/tmtests/tmoverhd/.cvsignore delete mode 100644 testsuites/tmtests/tmoverhd/Makefile.am delete mode 100644 testsuites/tmtests/tmoverhd/dumrtems.h delete mode 100644 testsuites/tmtests/tmoverhd/empty.c delete mode 100644 testsuites/tmtests/tmoverhd/system.h delete mode 100644 testsuites/tmtests/tmoverhd/testtask.c delete mode 100644 testsuites/tmtests/tmoverhd/tmoverhd.doc delete mode 100644 testsuites/tmtests/tmtests.am delete mode 100644 testsuites/tools/.cvsignore delete mode 100644 testsuites/tools/ChangeLog delete mode 100644 testsuites/tools/Makefile.am delete mode 100644 testsuites/tools/configure.ac delete mode 100644 testsuites/tools/generic/.cvsignore delete mode 100644 testsuites/tools/generic/ChangeLog delete mode 100644 testsuites/tools/generic/Makefile.am delete mode 100644 testsuites/tools/generic/configure.ac delete mode 100644 testsuites/tools/generic/difftest.in delete mode 100644 testsuites/tools/generic/sorttimes.in diff --git a/bootstrap b/bootstrap deleted file mode 100755 index 36787c4b98..0000000000 --- a/bootstrap +++ /dev/null @@ -1,194 +0,0 @@ -#! /bin/sh -# -# helps bootstrapping, when checked out from CVS -# requires GNU autoconf and GNU automake -# -# $Id$ - -# this is not meant to be exported outside the source tree - -# NOTE: Inspired by libtool's autogen script - -# to be run from the toplevel directory of RTEMS' -# source tree - -AUTOCONF_VERS=2\.57 -AUTOMAKE_VERS=1\.7\.2 - -progname=`basename $0` -top_srcdir=`dirname $0` - -verbose=""; -quiet="false" -mode="generate" - -usage() -{ - echo - echo "usage: ${progname} [-h|-q|-v]" - echo - echo "options:" - echo " -h .. display this message and exit"; - echo " -q .. quiet, don't display directories"; - echo " -v .. verbose, pass -v to automake when invoking automake" - echo " -c .. clean, remove all aclocal/autoconf/automake generated files" - echo - exit 1; -} - -generate_bspdir_acinclude() -{ -cat << EOF > acinclude.m4~ -# RTEMS_CHECK_BSPDIR(RTEMS_BSP) -AC_DEFUN([RTEMS_CHECK_BSPDIR], -[ - RTEMS_BSP_ALIAS(ifelse([\$1],,[\${RTEMS_BSP}],[\$1]),bspdir) - case "\$bspdir" in -EOF - -for i in */bsp_specs; do - d=`dirname $i` -cat << EOF >> acinclude.m4~ - $d ) - AC_CONFIG_SUBDIRS([$d]);; -EOF -done -cat << EOF >> acinclude.m4~ - *) - AC_MSG_ERROR([Invalid BSP]);; - esac -]) -EOF -if cmp -s acinclude.m4 acinclude.m4~ 2>/dev/null; then - echo "acinclude.m4 is unchanged"; -else - cp acinclude.m4~ acinclude.m4 -fi -rm -f acinclude.m4~ -} - -if test ! -f $top_srcdir/aclocal/version.m4; then - echo "${progname}:" - echo " Installation problem: Can't find file aclocal/version.m4" - exit 1; -fi - -while test $# -gt 0; do -case $1 in --h|--he|--hel|--help) - usage ;; --q|--qu|--qui|--quie|--quiet) - quiet="true"; - shift;; --v|--ve|--ver|--verb|--verbo|--verbos|--verbose) - verbose="-v"; - shift;; --c|--cl|--cle|--clea|--clean) - mode="clean"; - shift;; --*) echo "unknown option $1" ; - usage ;; -*) echo "invalid parameter $1" ; - usage ;; -esac -done - -case $mode in -generate) - AUTOCONF=${AUTOCONF-autoconf} - if test -z "$AUTOCONF"; then - echo "You must have autoconf installed to run $program" - fi - if test -z "`$AUTOCONF --version 2>/dev/null | grep -e \" $AUTOCONF_VERS\"`"; then -cat << EOF -RTEMS requires autoconf version $AUTOCONF_VERS. - -You are trying to use $AUTOCONF which does not seem to be sufficient -EOF - exit 1 - fi - - AUTOMAKE=${AUTOMAKE-automake} - if test -z "$AUTOMAKE"; then - echo "You must have automake installed to run $program" - fi - if test -z "`$AUTOMAKE --version 2>/dev/null | grep -e \" $AUTOMAKE_VERS\"`"; then -cat << EOF -RTEMS requires automake version $AUTOMAKE_VERS. - -You are trying to use $AUTOMAKE which does not seem to be sufficient -EOF - exit 1 - fi - - case $top_srcdir in - /* ) aclocal_dir=$top_srcdir - ;; - *) aclocal_dir=`pwd`/$top_srcdir - ;; - esac - - confs=`find . \( -name 'configure.in' -o -name 'configure.ac' \) -print` - for i in $confs; do - dir=`dirname $i`; - configure=`basename $i`; - ( test "$quiet" = "true" || echo "$dir"; - cd $dir; - test -n "`grep RTEMS_CHECK_BSPDIR ${configure}`" && \ - generate_bspdir_acinclude; - pat="s,\$(RTEMS_TOPdir),${aclocal_dir},g" - aclocal_args=`grep '^[ ]*ACLOCAL_AMFLAGS' Makefile.am | \ - sed -e 's%.*ACLOCAL_AMFLAGS.*\=[ ]*%%g' -e $pat ` ; - test "$verbose" = "-v" && echo "aclocal $aclocal_args" - aclocal $aclocal_args; - test -n "`grep CONFIG_HEADER ${configure}`" && autoheader \ - && test "$verbose" = "-v" && echo "autoheader"; - test -n "`grep RTEMS_BSP_CONFIGURE ${configure}`" && autoheader \ - && test "$verbose" = "-v" && echo "autoheader"; - test -f Makefile.am && automake -a -c $verbose ; - autoconf; - test -f Makefile.am && test -n "`grep 'stamp-h\.in' Makefile.in`" \ - && echo timestamp > stamp-h.in - ) - done - ;; - -clean) - test "$quiet" = "true" || echo "removing automake generated Makefile.in files" - files=`find . -name 'Makefile.am' -print | sed -e 's%\.am%\.in%g'` ; - for i in $files; do if test -f $i; then - rm -f $i - test "$verbose" = "-v" && echo "$i" - fi; done - - test "$quiet" = "true" || echo "removing configure files" - files=`find . -name 'configure' -print` ; - test "$verbose" = "-v" && test -n "$files" && echo "$files" ; - for i in $files; do if test -f $i; then - rm -f $i config.guess config.sub depcomp install-sh mdate-sh missing \ - mkinstalldirs texinfo.tex - test "$verbose" = "-v" && echo "$i" - fi; done - - test "$quiet" = "true" || echo "removing aclocal.m4 files" - files=`find . -name 'aclocal.m4' -print` ; - test "$verbose" = "-v" && test -n "$files" && echo "$files" ; - for i in $files; do if test -f $i; then - rm -f $i - test "$verbose" = "-v" && echo "$i" - fi; done - - find . -name '*~' -print | xargs rm -f - find . -name 'bspopts.h*' -print | xargs rm -f - find . -name '*.orig' -print | xargs rm -f - find . -name '*.rej' -print | xargs rm -f - find . -name 'config.status' -print | xargs rm -f - find . -name 'config.log' -print | xargs rm -f - find . -name 'config.cache' -print | xargs rm -f - find . -name 'Makefile' -print | xargs rm -f - find . -name '.deps' -print | xargs rm -rf - find . -name '.libs' -print | xargs rm -rf - find . -name 'stamp-h.in' | xargs rm -rf - find . -name 'autom4te*.cache' | xargs rm -rf - ;; -esac diff --git a/c/src/ada/.cvsignore b/c/src/ada/.cvsignore deleted file mode 100644 index bfdfd995be..0000000000 --- a/c/src/ada/.cvsignore +++ /dev/null @@ -1,14 +0,0 @@ -aclocal.m4 -autom4te*.cache -config.cache -config.guess -config.log -config.status -config.sub -configure -depcomp -install-sh -Makefile -Makefile.in -missing -mkinstalldirs diff --git a/c/src/ada/ChangeLog b/c/src/ada/ChangeLog deleted file mode 100644 index be33f23137..0000000000 --- a/c/src/ada/ChangeLog +++ /dev/null @@ -1,62 +0,0 @@ -2003-02-11 Ralf Corsepius - - * configure.ac: AM_INIT_AUTOMAKE([1.7.2]). - -2003-02-11 Ralf Corsepius - - * configure.ac: AC_PREREQ(2.57). - -2003-02-03 Joel Sherrill - - PR 338/filesystem - * rtems.adb, rtems.ads: Side-effect of fixing reentrancy problem with - rtems_io_lookup_name() (API change). - -2003-01-03 Joel Sherrill - - * rtems.ads: Corrected Configuration_Table record definition to - match current RTEMS source. sp01 now runs. - -2002-11-19 Ralf Corsepius - - * configure.ac: Fix package name. - -2002-10-29 Ralf Corsepius - - * configure.ac: Remove AC_ENABLE_MULTILIB. - * Makefile.am: Add CVS-Id. - -2002-10-25 Ralf Corsepius - - * configure.ac: Add nostdinc to AM_INIT_AUTOMAKE. - -2002-10-21 Ralf Corsepius - - * .cvsignore: Reformat. - Add autom4te*cache. - Remove autom4te.cache. - -2002-08-30 Joel Sherrill - - * rtems.adb (IO_Initialize): Make this match the C prototype. - -2002-08-27 Joel Sherrill - - * rtems.ads: Corrected binding for Io_Initialize. - -2001-08-23 Ralf Corsepius - - * configure.ac: New. - * Makefile.am: New. - * .cvsignore: New. - -2001-02-01 Joel Sherrill - - * rtems.ads, rtems.adb: Formatting cleaned up. Task based timer - directives added. This is Timer_Initiate_Server, - Timer_Server_Fire_After, and Timer_Server_Fire_When. - -2001-02-01 Joel Sherrill - - * ChangeLog: New file. - diff --git a/c/src/ada/Makefile.am b/c/src/ada/Makefile.am deleted file mode 100644 index e0c2c91409..0000000000 --- a/c/src/ada/Makefile.am +++ /dev/null @@ -1,24 +0,0 @@ -# -# $Id$ -# - -ACLOCAL_AMFLAGS = -I ../aclocal - -$(PROJECT_INCLUDE)/adainclude: - $(mkinstalldirs) $@ -$(PROJECT_INCLUDE)/adainclude/%: % - $(INSTALL_DATA) $< $@ - -adaincludedir = $(includedir)/adainclude - -adainclude_HEADERS = rtems.adb rtems.ads -adainclude_HEADERS += rtems-multiprocessing.adb rtems-multiprocessing.ads - -TMPINSTALL_FILES = \ - $(PROJECT_INCLUDE)/adainclude \ - $(adainclude_HEADERS:%=$(PROJECT_INCLUDE)/adainclude/%) \ - $(nodist_adalib_HEADERS:%=$(PROJECT_INCLUDE)/adainclude/%) - -all-local: $(TMPINSTALL_FILES) - -include $(top_srcdir)/../automake/local.am diff --git a/c/src/ada/rtems-multiprocessing.adb b/c/src/ada/rtems-multiprocessing.adb deleted file mode 100644 index 9e196f5e8b..0000000000 --- a/c/src/ada/rtems-multiprocessing.adb +++ /dev/null @@ -1,38 +0,0 @@ --- --- RTEMS Multiprocessing Manager/ Body --- --- DESCRIPTION: --- --- This package provides the interface to the Multiprocessing Manager --- of the RTEMS API. --- --- DEPENDENCIES: --- --- --- COPYRIGHT (c) 1997. --- On-Line Applications Research Corporation (OAR). --- --- The license and distribution terms for this file may in --- the file LICENSE in this distribution or at --- http://www.OARcorp.com/rtems/license.html. --- --- $Id$ --- - -package body RTEMS.Multiprocessing is - - -- - -- Announce - -- - - procedure Announce is - procedure Multiprocessing_Announce_Base; - pragma Import (C, Multiprocessing_Announce_Base, - "rtems_multiprocessing_announce"); - begin - - Multiprocessing_Announce_Base; - - end Announce; - -end RTEMS.Multiprocessing; diff --git a/c/src/ada/rtems-multiprocessing.ads b/c/src/ada/rtems-multiprocessing.ads deleted file mode 100644 index 6a4a63d365..0000000000 --- a/c/src/ada/rtems-multiprocessing.ads +++ /dev/null @@ -1,30 +0,0 @@ --- --- RTEMS Multiprocessing Manager/ Specification --- --- DESCRIPTION: --- --- This package provides the interface to the Multiprocessing Manager --- of the RTEMS API. --- --- DEPENDENCIES: --- --- --- COPYRIGHT (c) 1997. --- On-Line Applications Research Corporation (OAR). --- --- The license and distribution terms for this file may in --- the file LICENSE in this distribution or at --- http://www.OARcorp.com/rtems/license.html. --- --- $Id$ --- - -package RTEMS.Multiprocessing is - - -- - -- Multiprocessing Manager - -- - - procedure Announce; - -end RTEMS.Multiprocessing; diff --git a/c/src/ada/rtems.adb b/c/src/ada/rtems.adb deleted file mode 100644 index 37e111482e..0000000000 --- a/c/src/ada/rtems.adb +++ /dev/null @@ -1,1947 +0,0 @@ --- --- RTEMS / Body --- --- DESCRIPTION: --- --- This package provides the interface to the RTEMS API. --- --- --- DEPENDENCIES: --- --- --- --- COPYRIGHT (c) 1997-2003. --- On-Line Applications Research Corporation (OAR). --- --- The license and distribution terms for this file may in --- the file LICENSE in this distribution or at --- http://www.OARcorp.com/rtems/license.html. --- --- $Id$ --- - -with Ada; -with Ada.Unchecked_Conversion; -with System; -with Interfaces; use Interfaces; -with Interfaces.C; - -package body RTEMS is - - -- - -- Utility Functions - -- - - function From_Ada_Boolean ( - Ada_Boolean : Standard.Boolean - ) return RTEMS.Boolean is - begin - - if Ada_Boolean = Standard.True then - return RTEMS.True; - end if; - - return RTEMS.False; - - end From_Ada_Boolean; - - function To_Ada_Boolean ( - RTEMS_Boolean : RTEMS.Boolean - ) return Standard.Boolean is - begin - - if RTEMS_Boolean = RTEMS.True then - return Standard.True; - end if; - - return Standard.False; - - end To_Ada_Boolean; - - function Milliseconds_To_Microseconds ( - Milliseconds : RTEMS.Unsigned32 - ) return RTEMS.Unsigned32 is - begin - - return Milliseconds * 1000; - - end Milliseconds_To_Microseconds; - - function Microseconds_To_Ticks ( - Microseconds : RTEMS.Unsigned32 - ) return RTEMS.Interval is - Microseconds_Per_Tick : RTEMS.Interval; - pragma Import (C, Microseconds_Per_Tick, "_TOD_Microseconds_per_tick"); - begin - - return Microseconds / Microseconds_Per_Tick; - - end Microseconds_To_Ticks; - - function Milliseconds_To_Ticks ( - Milliseconds : RTEMS.Unsigned32 - ) return RTEMS.Interval is - begin - - return Microseconds_To_Ticks(Milliseconds_To_Microseconds(Milliseconds)); - - end Milliseconds_To_Ticks; - - function Build_Name ( - C1 : in Character; - C2 : in Character; - C3 : in Character; - C4 : in Character - ) return RTEMS.Name is - C1_Value : RTEMS.Unsigned32; - C2_Value : RTEMS.Unsigned32; - C3_Value : RTEMS.Unsigned32; - C4_Value : RTEMS.Unsigned32; - begin - - C1_Value := Character'Pos( C1 ); - C2_Value := Character'Pos( C2 ); - C3_Value := Character'Pos( C3 ); - C4_Value := Character'Pos( C4 ); - - return Interfaces.Shift_Left( C1_Value, 24 ) or - Interfaces.Shift_Left( C2_Value, 16 ) or - Interfaces.Shift_Left( C3_Value, 8 ) or - C4_Value; - - end Build_Name; - - procedure Name_To_Characters ( - Name : in RTEMS.Name; - C1 : out Character; - C2 : out Character; - C3 : out Character; - C4 : out Character - ) is - C1_Value : RTEMS.Unsigned32; - C2_Value : RTEMS.Unsigned32; - C3_Value : RTEMS.Unsigned32; - C4_Value : RTEMS.Unsigned32; - begin - - C1_Value := Interfaces.Shift_Right( Name, 24 ); - C2_Value := Interfaces.Shift_Right( Name, 16 ); - C3_Value := Interfaces.Shift_Right( Name, 8 ); - C4_Value := Name; - - C1_Value := C1_Value and 16#00FF#; - C2_Value := C2_Value and 16#00FF#; - C3_Value := C3_Value and 16#00FF#; - C4_Value := C4_Value and 16#00FF#; - - C1 := Character'Val( C1_Value ); - C2 := Character'Val( C2_Value ); - C3 := Character'Val( C3_Value ); - C4 := Character'Val( C4_Value ); - - end Name_To_Characters; - - function Get_Node ( - ID : in RTEMS.ID - ) return RTEMS.Unsigned32 is - begin - - -- May not be right - return Interfaces.Shift_Right( ID, 16 ); - - end Get_Node; - - function Get_Index ( - ID : in RTEMS.ID - ) return RTEMS.Unsigned32 is - begin - - -- May not be right - return ID and 16#FFFF#; - - end Get_Index; - - function Are_Statuses_Equal ( - Status : in RTEMS.Status_Codes; - Desired : in RTEMS.Status_Codes - ) return Standard.Boolean is - begin - - if Status = Desired then - return Standard.True; - end if; - - return Standard.False; - - end Are_Statuses_Equal; - - function Is_Status_Successful ( - Status : in RTEMS.Status_Codes - ) return Standard.Boolean is - begin - - if Status = RTEMS.Successful then - return Standard.True; - end if; - - return Standard.False; - - end Is_Status_Successful; - - function Subtract ( - Left : in RTEMS.Address; - Right : in RTEMS.Address - ) return RTEMS.Unsigned32 is - function To_Unsigned32 is - new Ada.Unchecked_Conversion (System.Address, RTEMS.Unsigned32); - - begin - return To_Unsigned32(Left) - To_Unsigned32(Right); - end Subtract; - - function Are_Equal ( - Left : in RTEMS.Address; - Right : in RTEMS.Address - ) return Standard.Boolean is - function To_Unsigned32 is - new Ada.Unchecked_Conversion (System.Address, RTEMS.Unsigned32); - - begin - return (To_Unsigned32(Left) = To_Unsigned32(Right)); - end Are_Equal; - - -- - -- - -- RTEMS API - -- - - -- - -- Initialization Manager - -- - - procedure Initialize_Executive ( - Configuration_Table : in RTEMS.Configuration_Table_Pointer; - CPU_Table : in RTEMS.CPU_Table_Pointer - ) is - procedure Initialize_Executive_Base ( - Configuration_Table : in RTEMS.Configuration_Table_Pointer; - CPU_Table : in RTEMS.CPU_Table_Pointer - ); - pragma Import (C, Initialize_Executive_Base, - "rtems_initialize_executive"); - - begin - - Initialize_Executive_Base (Configuration_Table, CPU_Table); - - end Initialize_Executive; - - procedure Initialize_Executive_Early ( - Configuration_Table : in RTEMS.Configuration_Table_Pointer; - CPU_Table : in RTEMS.CPU_Table_Pointer; - Level : out RTEMS.ISR_Level - ) is - function Initialize_Executive_Early_Base ( - Configuration_Table : in RTEMS.Configuration_Table_Pointer; - CPU_Table : in RTEMS.CPU_Table_Pointer - ) return RTEMS.ISR_Level; - pragma Import (C, Initialize_Executive_Early_Base, - "rtems_initialize_executive_early"); - - begin - - Level := Initialize_Executive_Early_Base (Configuration_Table, CPU_Table); - - end Initialize_Executive_Early; - - procedure Initialize_Executive_Late ( - BSP_Level : in RTEMS.ISR_Level - ) is - procedure Initialize_Executive_Late_Base ( - Level : in RTEMS.ISR_Level - ); - pragma Import (C, Initialize_Executive_Late_Base, - "rtems_initialize_executive_late"); - - begin - - Initialize_Executive_Late_Base (BSP_Level); - - end Initialize_Executive_Late; - - procedure Shutdown_Executive ( - Result : in RTEMS.Unsigned32 - ) is - procedure Shutdown_Executive_Base; - pragma Import (C,Shutdown_Executive_Base,"rtems_shutdown_executive"); - begin - - Shutdown_Executive_Base; - - end Shutdown_Executive; - - -- - -- Task Manager - -- - - procedure Task_Create ( - Name : in RTEMS.Name; - Initial_Priority : in RTEMS.Task_Priority; - Stack_Size : in RTEMS.Unsigned32; - Initial_Modes : in RTEMS.Mode; - Attribute_Set : in RTEMS.Attribute; - ID : out RTEMS.ID; - Result : out RTEMS.Status_Codes - ) is - function Task_Create_Base ( - Name : RTEMS.Name; - Initial_Priority : RTEMS.Task_Priority; - Stack_Size : RTEMS.Unsigned32; - Initial_Modes : RTEMS.Mode; - Attribute_Set : RTEMS.Attribute; - ID : access RTEMS.ID - ) return RTEMS.Status_Codes; - pragma Import (C, Task_Create_Base, "rtems_task_create"); - ID_Base : aliased RTEMS.ID := ID; - begin - Result := Task_Create_Base ( - Name, - Initial_Priority, - Stack_Size, - Initial_Modes, - Attribute_Set, - ID_Base'Unchecked_Access - ); - ID := ID_Base; - end Task_Create; - - procedure Task_Ident ( - Name : in RTEMS.Name; - Node : in RTEMS.Node; - ID : out RTEMS.ID; - Result : out RTEMS.Status_Codes - ) is - - function Task_Ident_Base ( - Name : RTEMS.Name; - Node : RTEMS.Node; - ID : access RTEMS.ID - ) return RTEMS.Status_Codes; - pragma Import (C, Task_Ident_Base, "rtems_task_ident"); - ID_Base : aliased RTEMS.ID := ID; - - begin - - Result := Task_Ident_Base ( Name, Node, ID_Base'Unchecked_Access ); - ID := ID_Base; - - end Task_Ident; - - procedure Task_Start ( - ID : in RTEMS.ID; - Entry_Point : in RTEMS.Task_Entry; - Argument : in RTEMS.Task_Argument; - Result : out RTEMS.Status_Codes - ) is - function Task_Start_Base ( - ID : RTEMS.ID; - Entry_Point : RTEMS.Task_Entry; - Argument : RTEMS.Task_Argument - ) return RTEMS.Status_Codes; - pragma Import (C, Task_Start_Base, "rtems_task_start"); - begin - - Result := Task_Start_Base ( ID, Entry_Point, Argument ); - - end Task_Start; - - procedure Task_Restart ( - ID : in RTEMS.ID; - Argument : in RTEMS.Task_Argument; - Result : out RTEMS.Status_Codes - ) is - function Task_Restart_Base ( - ID : RTEMS.ID; - Argument : RTEMS.Task_Argument - ) return RTEMS.Status_Codes; - pragma Import (C, Task_Restart_Base, "rtems_task_restart"); - begin - - Result := Task_Restart_Base ( ID, Argument ); - - end Task_Restart; - - procedure Task_Delete ( - ID : in RTEMS.ID; - Result : out RTEMS.Status_Codes - ) is - function Task_Delete_Base ( - ID : RTEMS.ID - ) return RTEMS.Status_Codes; - pragma Import (C, Task_Delete_Base, "rtems_task_delete"); - begin - - Result := Task_Delete_Base ( ID ); - - end Task_Delete; - - procedure Task_Suspend ( - ID : in RTEMS.ID; - Result : out RTEMS.Status_Codes - ) is - function Task_Suspend_Base ( - ID : RTEMS.ID - ) return RTEMS.Status_Codes; - pragma Import (C, Task_Suspend_Base, "rtems_task_suspend"); - begin - - Result := Task_Suspend_Base ( ID ); - - end Task_Suspend; - - procedure Task_Resume ( - ID : in RTEMS.ID; - Result : out RTEMS.Status_Codes - ) is - function Task_Resume_Base ( - ID : RTEMS.ID - ) return RTEMS.Status_Codes; - pragma Import (C, Task_Resume_Base, "rtems_task_resume"); - begin - - Result := Task_Resume_Base ( ID ); - - end Task_Resume; - - procedure Task_Set_Priority ( - ID : in RTEMS.ID; - New_Priority : in RTEMS.Task_Priority; - Old_Priority : out RTEMS.Task_Priority; - Result : out RTEMS.Status_Codes - ) is - function Task_Set_Priority_Base ( - ID : RTEMS.ID; - New_Priority : RTEMS.Task_Priority; - Old_Priority : access RTEMS.Task_Priority - ) return RTEMS.Status_Codes; - pragma Import (C, Task_Set_Priority_Base, "rtems_task_set_priority"); - Old_Priority_Base : aliased RTEMS.Task_Priority := Old_Priority; - begin - - Result := Task_Set_Priority_Base ( - ID, - New_Priority, - Old_Priority_Base'Unchecked_Access - ); - Old_Priority := Old_Priority_Base; - - end Task_Set_Priority; - - procedure Task_Mode ( - Mode_Set : in RTEMS.Mode; - Mask : in RTEMS.Mode; - Previous_Mode_Set : out RTEMS.Mode; - Result : out RTEMS.Status_Codes - ) is - function Task_Mode_Base ( - Mode_Set : RTEMS.Mode; - Mask : RTEMS.Mode; - Previous_Mode_Set : access RTEMS.Mode - ) return RTEMS.Status_Codes; - pragma Import (C, Task_Mode_Base, "rtems_task_mode"); - Previous_Mode_Set_Base : aliased RTEMS.Mode := Previous_Mode_Set; - begin - - Result := Task_Mode_Base ( - Mode_Set, - Mask, - Previous_Mode_Set_Base'Unchecked_Access - ); - Previous_Mode_Set := Previous_Mode_Set_Base; - - end Task_Mode; - - procedure Task_Get_Note ( - ID : in RTEMS.ID; - Notepad : in RTEMS.Notepad_Index; - Note : out RTEMS.Unsigned32; - Result : out RTEMS.Status_Codes - ) is - function Task_Get_Note_Base ( - ID : RTEMS.ID; - Notepad : RTEMS.Notepad_Index; - Note : access RTEMS.Unsigned32 - ) return RTEMS.Status_Codes; - pragma Import (C, Task_Get_Note_Base, "rtems_task_get_note"); - Note_Base : aliased RTEMS.Unsigned32 := Note; - begin - - Result := Task_Get_Note_Base ( ID, Notepad, Note_Base'Unchecked_Access ); - Note := NOTE_Base; - - end Task_Get_Note; - - procedure Task_Set_Note ( - ID : in RTEMS.ID; - Notepad : in RTEMS.Notepad_Index; - Note : in RTEMS.Unsigned32; - Result : out RTEMS.Status_Codes - ) is - function Task_Set_Note_Base ( - ID : RTEMS.ID; - Notepad : RTEMS.Notepad_Index; - Note : RTEMS.Unsigned32 - ) return RTEMS.Status_Codes; - pragma Import (C, Task_Set_Note_Base, "rtems_task_set_note"); - begin - - Result := Task_Set_Note_Base ( ID, Notepad, Note ); - - end Task_Set_Note; - - procedure Task_Wake_When ( - Time_Buffer : in RTEMS.Time_Of_Day; - Result : out RTEMS.Status_Codes - ) is - function Task_Wake_When_Base ( - Time_Buffer : RTEMS.Time_Of_Day - ) return RTEMS.Status_Codes; - pragma Import (C, Task_Wake_When_Base, "rtems_task_wake_when"); - begin - - Result := Task_Wake_When_Base ( Time_Buffer ); - - end Task_Wake_When; - - procedure Task_Wake_After ( - Ticks : in RTEMS.Interval; - Result : out RTEMS.Status_Codes - ) is - function Task_Wake_After_Base ( - Ticks : RTEMS.Interval - ) return RTEMS.Status_Codes; - pragma Import (C, Task_Wake_After_Base, "rtems_task_wake_after"); - begin - - Result := Task_Wake_After_Base ( Ticks ); - - end Task_Wake_After; - - -- - -- Interrupt Manager - -- - - procedure Interrupt_Catch ( - New_ISR_Handler : in RTEMS.Address; - Vector : in RTEMS.Vector_Number; - Old_ISR_Handler : out RTEMS.Address; - Result : out RTEMS.Status_Codes - ) is - function Interrupt_Catch_Base ( - New_ISR_Handler : RTEMS.Address; - Vector : RTEMS.Vector_Number; - Old_ISR_Handler : access RTEMS.Address - ) return RTEMS.Status_Codes; - pragma Import (C, Interrupt_Catch_Base, "rtems_interrupt_catch"); - Old_ISR_Handler_Base : aliased RTEMS.Address := Old_ISR_Handler; - begin - - Result := Interrupt_Catch_Base ( - New_ISR_Handler, - Vector, - OLD_ISR_HANDLER_Base'Unchecked_Access - ); - Old_ISR_Handler := OLD_ISR_HANDLER_Base; - - end Interrupt_Catch; - - -- Interrupt_Disable is interfaced in the specification - -- Interrupt_Enable is interfaced in the specification - -- Interrupt_Flash is interfaced in the specification - -- Interrupt_Is_In_Progress is interfaced in the specification - - -- - -- Clock Manager - -- - - procedure Clock_Get ( - Option : in RTEMS.Clock_Get_Options; - Time_Buffer : in RTEMS.Address; - Result : out RTEMS.Status_Codes - ) is - function Clock_Get_base ( - Option : RTEMS.Clock_Get_Options; - Time_Buffer : RTEMS.Address - ) return RTEMS.Status_Codes; - pragma Import (C, Clock_Get_base, "rtems_clock_get"); - begin - - Result := Clock_Get_base ( Option, Time_Buffer ); - - end Clock_Get; - - procedure Clock_Set ( - Time_Buffer : in RTEMS.Time_Of_Day; - Result : out RTEMS.Status_Codes - ) is - function Clock_Set_base ( - Time_Buffer : RTEMS.Time_Of_Day - ) return RTEMS.Status_Codes; - pragma Import (C, Clock_Set_base, "rtems_clock_set"); - begin - - Result := Clock_Set_base ( Time_Buffer ); - - end Clock_Set; - - procedure Clock_Tick ( - Result : out RTEMS.Status_Codes - ) is - function Clock_Tick_Base return RTEMS.Status_Codes; - pragma Import (C, Clock_Tick_Base, "rtems_clock_tick"); - begin - - Result := Clock_Tick_Base; - - end Clock_Tick; - - -- - -- Extension Manager - -- - - procedure Extension_Create ( - Name : in RTEMS.Name; - Table : in RTEMS.Extensions_Table_Pointer; - ID : out RTEMS.ID; - Result : out RTEMS.Status_Codes - ) is - function Extension_Create_Base ( - Name : RTEMS.Name; - Table : RTEMS.Extensions_Table_Pointer; - ID : access RTEMS.ID - ) return RTEMS.Status_Codes; - pragma Import (C, Extension_Create_Base, "rtems_extension_create"); - ID_Base : aliased RTEMS.ID := ID; - begin - - Result := Extension_Create_Base ( Name, Table, ID_Base'Unchecked_Access ); - ID := ID_Base; - - end Extension_Create; - - procedure Extension_Ident ( - Name : in RTEMS.Name; - ID : out RTEMS.ID; - Result : out RTEMS.Status_Codes - ) is - function Extension_Ident_Base ( - Name : RTEMS.Name; - ID : access RTEMS.ID - ) return RTEMS.Status_Codes; - pragma Import (C, Extension_Ident_Base, "rtems_extension_ident"); - ID_Base : aliased RTEMS.ID := ID; - begin - - Result := Extension_Ident_Base ( Name, ID_Base'Unchecked_Access ); - ID := ID_Base; - - end Extension_Ident; - - procedure Extension_Delete ( - ID : in RTEMS.ID; - Result : out RTEMS.Status_Codes - ) is - function Extension_Delete_Base ( - ID : RTEMS.ID - ) return RTEMS.Status_Codes; - pragma Import (C, Extension_Delete_Base, "rtems_extension_delete"); - begin - - Result := Extension_Delete_Base ( ID ); - - end Extension_Delete; - - -- - -- Timer Manager - -- - - procedure Timer_Create ( - Name : in RTEMS.Name; - ID : out RTEMS.ID; - Result : out RTEMS.Status_Codes - ) is - function Timer_Create_Base ( - Name : RTEMS.Name; - ID : access RTEMS.ID - ) return RTEMS.Status_Codes; - pragma Import (C, Timer_Create_Base, "rtems_timer_create"); - ID_Base : aliased RTEMS.ID := ID; - begin - - Result := Timer_Create_Base ( Name, ID_Base'Unchecked_Access ); - ID := ID_Base; - - end Timer_Create; - - procedure Timer_Ident ( - Name : in RTEMS.Name; - ID : out RTEMS.ID; - Result : out RTEMS.Status_Codes - ) is - function Timer_Ident_Base ( - Name : RTEMS.Name; - ID : access RTEMS.ID - ) return RTEMS.Status_Codes; - pragma Import (C, Timer_Ident_Base, "rtems_timer_ident"); - ID_Base : aliased RTEMS.ID := ID; - begin - - Result := Timer_Ident_Base ( Name, ID_Base'Unchecked_Access ); - ID := ID_Base; - - end Timer_Ident; - - procedure Timer_Delete ( - ID : in RTEMS.ID; - Result : out RTEMS.Status_Codes - ) is - function Timer_Delete_Base ( - ID : RTEMS.ID - ) return RTEMS.Status_Codes; - pragma Import (C, Timer_Delete_Base, "rtems_timer_delete"); - begin - - Result := Timer_Delete_Base ( ID ); - - end Timer_Delete; - - procedure Timer_Fire_After ( - ID : in RTEMS.ID; - Ticks : in RTEMS.Interval; - Routine : in RTEMS.Timer_Service_Routine; - User_Data : in RTEMS.Address; - Result : out RTEMS.Status_Codes - ) is - function Timer_Fire_After_Base ( - ID : RTEMS.ID; - Ticks : RTEMS.Interval; - Routine : RTEMS.Timer_Service_Routine; - User_Data : RTEMS.Address - ) return RTEMS.Status_Codes; - pragma Import (C, Timer_Fire_After_Base, "rtems_timer_fire_after"); - begin - - Result := Timer_Fire_After_Base ( ID, Ticks, Routine, User_Data ); - - end Timer_Fire_After; - - procedure Timer_Server_Fire_After ( - ID : in RTEMS.ID; - Ticks : in RTEMS.Interval; - Routine : in RTEMS.Timer_Service_Routine; - User_Data : in RTEMS.Address; - Result : out RTEMS.Status_Codes - ) is - function Timer_Server_Fire_After_Base ( - ID : RTEMS.ID; - Ticks : RTEMS.Interval; - Routine : RTEMS.Timer_Service_Routine; - User_Data : RTEMS.Address - ) return RTEMS.Status_Codes; - pragma Import ( - C, - Timer_Server_Fire_After_Base, - "rtems_timer_server_fire_after" - ); - begin - - Result := Timer_Server_Fire_After_Base ( ID, Ticks, Routine, User_Data ); - - end Timer_Server_Fire_After; - - procedure Timer_Fire_When ( - ID : in RTEMS.ID; - Wall_Time : in RTEMS.Time_Of_Day; - Routine : in RTEMS.Timer_Service_Routine; - User_Data : in RTEMS.Address; - Result : out RTEMS.Status_Codes - ) is - function Timer_Fire_When_Base ( - ID : RTEMS.ID; - Wall_Time : RTEMS.Time_Of_Day; - Routine : RTEMS.Timer_Service_Routine; - User_Data : RTEMS.Address - ) return RTEMS.Status_Codes; - pragma Import (C, Timer_Fire_When_Base, "rtems_timer_fire_when"); - begin - - Result := Timer_Fire_When_Base ( ID, Wall_Time, Routine, User_Data ); - - end Timer_Fire_When; - - procedure Timer_Server_Fire_When ( - ID : in RTEMS.ID; - Wall_Time : in RTEMS.Time_Of_Day; - Routine : in RTEMS.Timer_Service_Routine; - User_Data : in RTEMS.Address; - Result : out RTEMS.Status_Codes - ) is - function Timer_Server_Fire_When_Base ( - ID : RTEMS.ID; - Wall_Time : RTEMS.Time_Of_Day; - Routine : RTEMS.Timer_Service_Routine; - User_Data : RTEMS.Address - ) return RTEMS.Status_Codes; - pragma Import ( - C, - Timer_Server_Fire_When_Base, - "rtems_timer_server_fire_when" - ); - begin - - Result := - Timer_Server_Fire_When_Base ( ID, Wall_Time, Routine, User_Data ); - end Timer_Server_Fire_When; - - procedure Timer_Reset ( - ID : in RTEMS.ID; - Result : out RTEMS.Status_Codes - ) is - function Timer_Reset_Base ( - ID : RTEMS.ID - ) return RTEMS.Status_Codes; - pragma Import (C, Timer_Reset_Base, "rtems_timer_reset"); - begin - - Result := Timer_Reset_Base ( ID ); - - end Timer_Reset; - - procedure Timer_Cancel ( - ID : in RTEMS.ID; - Result : out RTEMS.Status_Codes - ) is - function Timer_Cancel_Base ( - ID : RTEMS.ID - ) return RTEMS.Status_Codes; - pragma Import (C, Timer_Cancel_Base, "rtems_timer_cancel"); - begin - - Result := Timer_Cancel_Base ( ID ); - - end Timer_Cancel; - - procedure Timer_Initiate_Server ( - Server_Priority : in RTEMS.Task_Priority; - Stack_Size : in RTEMS.Unsigned32; - Attribute_Set : in RTEMS.Attribute; - Result : out RTEMS.Status_Codes - ) is - function Timer_Initiate_Server_Base ( - Server_Priority : RTEMS.Task_Priority; - Stack_Size : RTEMS.Unsigned32; - Attribute_Set : RTEMS.Attribute - ) return RTEMS.Status_Codes; - pragma Import ( - C, - Timer_Initiate_Server_Base, - "rtems_timer_initiate_server" - ); - begin - Result := Timer_Initiate_Server_Base ( - Server_Priority, - Stack_Size, - Attribute_Set - ); - end Timer_Initiate_Server; - - -- - -- Semaphore Manager - -- - - procedure Semaphore_Create ( - Name : in RTEMS.Name; - Count : in RTEMS.Unsigned32; - Attribute_Set : in RTEMS.Attribute; - Priority_Ceiling : in RTEMS.Task_Priority; - ID : out RTEMS.ID; - Result : out RTEMS.Status_Codes - ) is - function Semaphore_Create_Base ( - Name : RTEMS.Name; - Count : RTEMS.Unsigned32; - Attribute_Set : RTEMS.Attribute; - Priority_Ceiling : RTEMS.Task_Priority; - ID : access RTEMS.ID - ) return RTEMS.Status_Codes; - pragma Import (C, Semaphore_Create_Base, "rtems_semaphore_create"); - ID_Base : aliased RTEMS.ID := ID; - begin - - Result := Semaphore_Create_Base ( - Name, - Count, - Attribute_Set, - Priority_Ceiling, - ID_Base'Unchecked_Access - ); - ID := ID_Base; - - end Semaphore_Create; - - procedure Semaphore_Delete ( - ID : in RTEMS.ID; - Result : out RTEMS.Status_Codes - ) is - function Semaphore_Delete_Base ( - ID : RTEMS.ID - ) return RTEMS.Status_Codes; - pragma Import (C, Semaphore_Delete_Base, "rtems_semaphore_delete"); - begin - - Result := Semaphore_Delete_Base ( ID ); - - end Semaphore_Delete; - - procedure Semaphore_Ident ( - Name : in RTEMS.Name; - Node : in RTEMS.Unsigned32; - ID : out RTEMS.ID; - Result : out RTEMS.Status_Codes - ) is - function Semaphore_Ident_Base ( - Name : RTEMS.Name; - Node : RTEMS.Unsigned32; - ID : access RTEMS.ID - ) return RTEMS.Status_Codes; - pragma Import (C, Semaphore_Ident_Base, "rtems_semaphore_ident"); - ID_Base : aliased RTEMS.ID := ID; - begin - - Result := Semaphore_Ident_Base ( Name, Node, ID_Base'Unchecked_Access ); - ID := ID_Base; - - end Semaphore_Ident; - - procedure Semaphore_Obtain ( - ID : in RTEMS.ID; - Option_Set : in RTEMS.Option; - Timeout : in RTEMS.Interval; - Result : out RTEMS.Status_Codes - ) is - function Semaphore_Obtain_Base ( - ID : RTEMS.ID; - Option_Set : RTEMS.Option; - Timeout : RTEMS.Interval - ) return RTEMS.Status_Codes; - pragma Import (C, Semaphore_Obtain_Base, "rtems_semaphore_obtain"); - begin - - Result := Semaphore_Obtain_Base ( ID, Option_Set, Timeout ); - - end Semaphore_Obtain; - - procedure Semaphore_Release ( - ID : in RTEMS.ID; - Result : out RTEMS.Status_Codes - ) is - function Semaphore_Release_Base ( - ID : RTEMS.ID - ) return RTEMS.Status_Codes; - pragma Import (C, Semaphore_Release_Base, "rtems_semaphore_release"); - begin - - Result := Semaphore_Release_Base ( ID ); - - end Semaphore_Release; - - -- - -- Message Queue Manager - -- - - procedure Message_Queue_Create ( - Name : in RTEMS.Name; - Count : in RTEMS.Unsigned32; - Max_Message_Size : in RTEMS.Unsigned32; - Attribute_Set : in RTEMS.Attribute; - ID : out RTEMS.ID; - Result : out RTEMS.Status_Codes - ) is - -- XXX broken - function Message_Queue_Create_Base ( - Name : RTEMS.Name; - Count : RTEMS.Unsigned32; - Max_Message_Size : RTEMS.Unsigned32; - Attribute_Set : RTEMS.Attribute; - ID : access RTEMS.ID - ) return RTEMS.Status_Codes; - pragma Import (C, - Message_Queue_Create_Base, "rtems_message_queue_create"); - ID_Base : aliased RTEMS.ID := ID; - begin - - Result := Message_Queue_Create_Base ( - Name, - Count, - Max_Message_Size, - Attribute_Set, - ID_Base'Unchecked_Access - ); - ID := ID_Base; - - end Message_Queue_Create; - - procedure Message_Queue_Ident ( - Name : in RTEMS.Name; - Node : in RTEMS.Unsigned32; - ID : out RTEMS.ID; - Result : out RTEMS.Status_Codes - ) is - function Message_Queue_Ident_Base ( - Name : RTEMS.Name; - Node : RTEMS.Unsigned32; - ID : access RTEMS.ID - ) return RTEMS.Status_Codes; - pragma Import (C, Message_Queue_Ident_Base, "rtems_message_queue_ident"); - ID_Base : aliased RTEMS.ID := ID; - begin - - Result := - Message_Queue_Ident_Base ( Name, Node, ID_Base'Unchecked_Access ); - ID := ID_Base; - - end Message_Queue_Ident; - - procedure Message_Queue_Delete ( - ID : in RTEMS.ID; - Result : out RTEMS.Status_Codes - ) is - function Message_Queue_Delete_Base ( - ID : RTEMS.ID - ) return RTEMS.Status_Codes; - pragma Import ( - C, Message_Queue_Delete_Base, "rtems_message_queue_delete"); - begin - - Result := Message_Queue_Delete_Base ( ID ); - - end Message_Queue_Delete; - - procedure Message_Queue_Send ( - ID : in RTEMS.ID; - Buffer : in RTEMS.Address; - Size : in RTEMS.Unsigned32; - Result : out RTEMS.Status_Codes - ) is - function Message_Queue_Send_Base ( - ID : RTEMS.ID; - Buffer : RTEMS.Address; - Size : RTEMS.Unsigned32 - ) return RTEMS.Status_Codes; - pragma Import (C, Message_Queue_Send_Base, "rtems_message_queue_send"); - begin - - Result := Message_Queue_Send_Base ( ID, Buffer, Size ); - - end Message_Queue_Send; - - procedure Message_Queue_Urgent ( - ID : in RTEMS.ID; - Buffer : in RTEMS.Address; - Size : in RTEMS.Unsigned32; - Result : out RTEMS.Status_Codes - ) is - function Message_Queue_Urgent_Base ( - ID : RTEMS.ID; - Buffer : RTEMS.Address; - Size : RTEMS.Unsigned32 - ) return RTEMS.Status_Codes; - pragma Import (C, Message_Queue_Urgent_Base, - "rtems_message_queue_urgent"); - begin - - Result := Message_Queue_Urgent_Base ( ID, Buffer, Size ); - - end Message_Queue_Urgent; - - procedure Message_Queue_Broadcast ( - ID : in RTEMS.ID; - Buffer : in RTEMS.Address; - Size : in RTEMS.Unsigned32; - Count : out RTEMS.Unsigned32; - Result : out RTEMS.Status_Codes - ) is - function Message_Queue_Broadcast_Base ( - ID : RTEMS.ID; - Buffer : RTEMS.Address; - Size : RTEMS.Unsigned32; - Count : access RTEMS.Unsigned32 - ) return RTEMS.Status_Codes; - pragma Import (C, Message_Queue_Broadcast_Base, - "rtems_message_queue_broadcast"); - Count_Base : aliased RTEMS.Unsigned32 := Count; - begin - - Result := Message_Queue_Broadcast_Base ( - ID, - Buffer, - Size, - Count_Base'Unchecked_Access - ); - Count := Count_Base; - - end Message_Queue_Broadcast; - - procedure Message_Queue_Receive ( - ID : in RTEMS.ID; - Buffer : in RTEMS.Address; - Option_Set : in RTEMS.Option; - Timeout : in RTEMS.Interval; - Size : out RTEMS.Unsigned32; - Result : out RTEMS.Status_Codes - ) is - function Message_Queue_Receive_Base ( - ID : RTEMS.ID; - Buffer : RTEMS.Address; - Size : access RTEMS.Unsigned32; - Option_Set : RTEMS.Option; - Timeout : RTEMS.Interval - ) return RTEMS.Status_Codes; - pragma Import (C, Message_Queue_Receive_Base, - "rtems_message_queue_receive"); - Size_Base : aliased RTEMS.Unsigned32; - begin - - Result := Message_Queue_Receive_Base ( - ID, - Buffer, - Size_Base'Unchecked_Access, - Option_Set, - Timeout - ); - Size := Size_Base; - - end Message_Queue_Receive; - - procedure Message_Queue_Flush ( - ID : in RTEMS.ID; - Count : out RTEMS.Unsigned32; - Result : out RTEMS.Status_Codes - ) is - function Message_Queue_Flush_Base ( - ID : RTEMS.ID; - Count : access RTEMS.Unsigned32 - ) return RTEMS.Status_Codes; - pragma Import (C, Message_Queue_Flush_Base, "rtems_message_queue_flush"); - COUNT_Base : aliased RTEMS.Unsigned32 := Count; - begin - - Result := Message_Queue_Flush_Base ( ID, COUNT_Base'Unchecked_Access ); - Count := COUNT_Base; - - end Message_Queue_Flush; - - -- - -- Event Manager - -- - - procedure Event_Send ( - ID : in RTEMS.ID; - Event_In : in RTEMS.Event_Set; - Result : out RTEMS.Status_Codes - ) is - function Event_Send_Base ( - ID : RTEMS.ID; - Event_In : RTEMS.Event_Set - ) return RTEMS.Status_Codes; - pragma Import (C, Event_Send_Base, "rtems_event_send"); - begin - - Result := Event_Send_Base ( ID, Event_In ); - - end Event_Send; - - procedure Event_Receive ( - Event_In : in RTEMS.Event_Set; - Option_Set : in RTEMS.Option; - Ticks : in RTEMS.Interval; - Event_Out : out RTEMS.Event_Set; - Result : out RTEMS.Status_Codes - ) is - function Event_Receive_Base ( - Event_In : RTEMS.Event_Set; - Option_Set : RTEMS.Option; - Ticks : RTEMS.Interval; - Event_Out : access RTEMS.Event_Set - ) return RTEMS.Status_Codes; - pragma Import (C, Event_Receive_Base, "rtems_event_receive"); - Event_Out_Base : aliased RTEMS.Event_Set; -- := Event_Out; - begin - - Result := Event_Receive_Base ( - Event_In, - Option_Set, - Ticks, - Event_Out_Base'Access - ); - Event_Out := Event_Out_Base; - - end Event_Receive; - - -- - -- Signal Manager - -- - - procedure Signal_Catch ( - ASR_Handler : in RTEMS.ASR_Handler; - Mode_Set : in RTEMS.Mode; - Result : out RTEMS.Status_Codes - ) is - function Signal_Catch_Base ( - ASR_Handler : RTEMS.ASR_Handler; - Mode_Set : RTEMS.Mode - ) return RTEMS.Status_Codes; - pragma Import (C, Signal_Catch_Base, "rtems_signal_catch"); - begin - - Result := Signal_Catch_Base ( ASR_Handler, Mode_Set ); - - end Signal_Catch; - - procedure Signal_Send ( - ID : in RTEMS.ID; - Signal_Set : in RTEMS.Signal_Set; - Result : out RTEMS.Status_Codes - ) is - function Signal_Send_Base ( - ID : RTEMS.ID; - Signal_Set : RTEMS.Signal_Set - ) return RTEMS.Status_Codes; - pragma Import (C, Signal_Send_Base, "rtems_signal_send"); - begin - - Result := Signal_Send_Base ( ID, Signal_Set ); - - end Signal_Send; - - - -- - -- Partition Manager - -- - - procedure Partition_Create ( - Name : in RTEMS.Name; - Starting_Address : in RTEMS.Address; - Length : in RTEMS.Unsigned32; - Buffer_Size : in RTEMS.Unsigned32; - Attribute_Set : in RTEMS.Attribute; - ID : out RTEMS.ID; - Result : out RTEMS.Status_Codes - ) is - function Partition_Create_Base ( - Name : RTEMS.Name; - Starting_Address : RTEMS.Address; - Length : RTEMS.Unsigned32; - Buffer_Size : RTEMS.Unsigned32; - Attribute_Set : RTEMS.Attribute; - ID : access RTEMS.Event_Set - ) return RTEMS.Status_Codes; - pragma Import (C, Partition_Create_Base, "rtems_partition_create"); - ID_Base : aliased RTEMS.ID := ID; - begin - - Result := Partition_Create_Base ( - Name, - Starting_Address, - Length, - Buffer_Size, - Attribute_Set, - ID_Base'Unchecked_Access - ); - ID := ID_Base; - - end Partition_Create; - - procedure Partition_Ident ( - Name : in RTEMS.Name; - Node : in RTEMS.Unsigned32; - ID : out RTEMS.ID; - Result : out RTEMS.Status_Codes - ) is - function Partition_Ident_Base ( - Name : RTEMS.Name; - Node : RTEMS.Unsigned32; - ID : access RTEMS.Event_Set - ) return RTEMS.Status_Codes; - pragma Import (C, Partition_Ident_Base, "rtems_partition_ident"); - ID_Base : aliased RTEMS.ID := ID; - begin - - Result := Partition_Ident_Base ( Name, Node, ID_Base'Unchecked_Access ); - ID := ID_Base; - - end Partition_Ident; - - procedure Partition_Delete ( - ID : in RTEMS.ID; - Result : out RTEMS.Status_Codes - ) is - function Partition_Delete_Base ( - ID : RTEMS.ID - ) return RTEMS.Status_Codes; - pragma Import (C, Partition_Delete_Base, "rtems_partition_delete"); - begin - - Result := Partition_Delete_Base ( ID ); - - end Partition_Delete; - - procedure Partition_Get_Buffer ( - ID : in RTEMS.ID; - Buffer : out RTEMS.Address; - Result : out RTEMS.Status_Codes - ) is - function Partition_Get_Buffer_Base ( - ID : RTEMS.ID; - Buffer : access RTEMS.Address - ) return RTEMS.Status_Codes; - pragma Import (C, Partition_Get_Buffer_Base, - "rtems_partition_get_buffer"); - Buffer_Base : aliased RTEMS.Address := Buffer; - begin - - Result := Partition_Get_Buffer_Base ( ID, Buffer_Base'Unchecked_Access ); - Buffer := Buffer_Base; - - end Partition_Get_Buffer; - - procedure Partition_Return_Buffer ( - ID : in RTEMS.ID; - Buffer : in RTEMS.Address; - Result : out RTEMS.Status_Codes - ) is - function Partition_Return_Buffer_Base ( - ID : RTEMS.Name; - Buffer : RTEMS.Address - ) return RTEMS.Status_Codes; - pragma Import (C, Partition_Return_Buffer_Base, - "rtems_partition_return_buffer"); - begin - - Result := Partition_Return_Buffer_Base ( ID, Buffer ); - - end Partition_Return_Buffer; - - -- - -- Region Manager - -- - - procedure Region_Create ( - Name : in RTEMS.Name; - Starting_Address : in RTEMS.Address; - Length : in RTEMS.Unsigned32; - Page_Size : in RTEMS.Unsigned32; - Attribute_Set : in RTEMS.Attribute; - ID : out RTEMS.ID; - Result : out RTEMS.Status_Codes - ) is - function Region_Create_Base ( - Name : RTEMS.Name; - Starting_Address : RTEMS.Address; - Length : RTEMS.Unsigned32; - Page_Size : RTEMS.Unsigned32; - Attribute_Set : RTEMS.Attribute; - ID : access RTEMS.ID - ) return RTEMS.Status_Codes; - pragma Import (C, Region_Create_Base, "rtems_region_create"); - ID_Base : aliased RTEMS.ID := ID; - begin - - Result := Region_Create_Base ( - Name, - Starting_Address, - Length, - Page_Size, - Attribute_Set, - ID_Base'Unchecked_Access - ); - ID := ID_Base; - - end Region_Create; - - procedure Region_Ident ( - Name : in RTEMS.Name; - ID : out RTEMS.ID; - Result : out RTEMS.Status_Codes - ) is - function Region_Ident_Base ( - Name : RTEMS.Name; - ID : access RTEMS.ID - ) return RTEMS.Status_Codes; - pragma Import (C, Region_Ident_Base, "rtems_region_ident"); - ID_Base : aliased RTEMS.ID := ID; - begin - - Result := Region_Ident_Base ( Name, ID_Base'Unchecked_Access ); - ID := ID_Base; - - end Region_Ident; - - procedure Region_Delete ( - ID : in RTEMS.ID; - Result : out RTEMS.Status_Codes - ) is - function Region_Delete_Base ( - ID : RTEMS.ID - ) return RTEMS.Status_Codes; - pragma Import (C, Region_Delete_Base, "rtems_region_delete"); - begin - - Result := Region_Delete_Base ( ID ); - - end Region_Delete; - - procedure Region_Extend ( - ID : in RTEMS.ID; - Starting_Address : in RTEMS.Address; - Length : in RTEMS.Unsigned32; - Result : out RTEMS.Status_Codes - ) is - function Region_Extend_Base ( - ID : RTEMS.ID; - Starting_Address : RTEMS.Address; - Length : RTEMS.Unsigned32 - ) return RTEMS.Status_Codes; - pragma Import (C, Region_Extend_Base, "rtems_region_extend"); - begin - - Result := Region_Extend_Base ( ID, Starting_Address, Length ); - - end Region_Extend; - - procedure Region_Get_Segment ( - ID : in RTEMS.ID; - Size : in RTEMS.Unsigned32; - Option_Set : in RTEMS.Option; - Timeout : in RTEMS.Interval; - Segment : out RTEMS.Address; - Result : out RTEMS.Status_Codes - ) is - function Region_Get_Segment_Base ( - ID : RTEMS.ID; - Size : RTEMS.Unsigned32; - Option_Set : RTEMS.Option; - Timeout : RTEMS.Interval; - Segment : access RTEMS.Address - ) return RTEMS.Status_Codes; - pragma Import (C, Region_Get_Segment_Base, "rtems_region_get_segment"); - Segment_Base : aliased RTEMS.Address := Segment; - begin - - Result := Region_Get_Segment_Base ( - ID, - Size, - Option_Set, - Timeout, - Segment_Base'Unchecked_Access - ); - Segment := SEGMENT_Base; - - end Region_Get_Segment; - - procedure Region_Get_Segment_Size ( - ID : in RTEMS.ID; - Segment : in RTEMS.Address; - Size : out RTEMS.Unsigned32; - Result : out RTEMS.Status_Codes - ) is - function Region_Get_Segment_Size_Base ( - ID : RTEMS.ID; - Segment : RTEMS.Address; - Size : access RTEMS.Unsigned32 - ) return RTEMS.Status_Codes; - pragma Import (C, Region_Get_Segment_Size_Base, - "rtems_region_get_segment_size"); - Size_Base : aliased RTEMS.Unsigned32 := Size; - begin - - Result := Region_Get_Segment_Size_Base ( - ID, - Segment, - Size_Base'Unchecked_Access - ); - Size := SIZE_Base; - - end Region_Get_Segment_Size; - - procedure Region_Return_Segment ( - ID : in RTEMS.ID; - Segment : in RTEMS.Address; - Result : out RTEMS.Status_Codes - ) is - function Region_Return_Segment_Base ( - ID : RTEMS.ID; - Segment : RTEMS.Address - ) return RTEMS.Status_Codes; - pragma Import (C, Region_Return_Segment_Base, - "rtems_region_return_segment"); - begin - - Result := Region_Return_Segment_Base ( ID, Segment ); - - end Region_Return_Segment; - - -- - -- Dual Ported Memory Manager - -- - - procedure Port_Create ( - Name : in RTEMS.Name; - Internal_Start : in RTEMS.Address; - External_Start : in RTEMS.Address; - Length : in RTEMS.Unsigned32; - ID : out RTEMS.ID; - Result : out RTEMS.Status_Codes - ) is - function Port_Create_Base ( - Name : RTEMS.Name; - Internal_Start : RTEMS.Address; - External_Start : RTEMS.Address; - Length : RTEMS.Unsigned32; - ID : access RTEMS.ID - ) return RTEMS.Status_Codes; - pragma Import (C, Port_Create_Base, "rtems_port_create"); - ID_Base : aliased RTEMS.ID := ID; - begin - - Result := Port_Create_Base ( - Name, - Internal_Start, - External_Start, - Length, - ID_Base'Unchecked_Access - ); - ID := ID_Base; - - end Port_Create; - - procedure Port_Ident ( - Name : in RTEMS.Name; - ID : out RTEMS.ID; - Result : out RTEMS.Status_Codes - ) is - function Port_Ident_Base ( - Name : RTEMS.Name; - ID : access RTEMS.ID - ) return RTEMS.Status_Codes; - pragma Import (C, Port_Ident_Base, "rtems_port_ident"); - ID_Base : aliased RTEMS.ID := ID; - begin - - Result := Port_Ident_Base ( Name, ID_Base'Unchecked_Access ); - ID := ID_Base; - - end Port_Ident; - - procedure Port_Delete ( - ID : in RTEMS.ID; - Result : out RTEMS.Status_Codes - ) is - function Port_Delete_Base ( - ID : RTEMS.ID - ) return RTEMS.Status_Codes; - pragma Import (C, Port_Delete_Base, "rtems_port_delete"); - begin - - Result := Port_Delete_Base ( ID ); - - end Port_Delete; - - procedure Port_External_To_Internal ( - ID : in RTEMS.ID; - External : in RTEMS.Address; - Internal : out RTEMS.Address; - Result : out RTEMS.Status_Codes - ) is - function Port_External_To_Internal_Base ( - ID : RTEMS.ID; - External : RTEMS.Address; - Internal : access RTEMS.Address - ) return RTEMS.Status_Codes; - pragma Import (C, Port_External_To_Internal_Base, - "rtems_port_external_to_internal"); - Internal_Base : aliased RTEMS.Address := Internal; - begin - - Result := Port_External_To_Internal_Base ( - ID, - External, - Internal_Base'Unchecked_Access - ); - Internal := INTERNAL_Base; - - end Port_External_To_Internal; - - procedure Port_Internal_To_External ( - ID : in RTEMS.ID; - Internal : in RTEMS.Address; - External : out RTEMS.Address; - Result : out RTEMS.Status_Codes - ) is - function Port_Internal_To_External_Base ( - ID : RTEMS.ID; - Internal : RTEMS.Address; - External : access RTEMS.Address - ) return RTEMS.Status_Codes; - pragma Import (C, Port_Internal_To_External_Base, - "rtems_port_internal_to_external"); - External_Base : aliased RTEMS.Address := External; - begin - - Result := Port_Internal_To_External_Base ( - ID, - Internal, - External_Base'Unchecked_Access - ); - External := EXTERNAL_Base; - - end Port_Internal_To_External; - - -- - -- Input/Output Manager - -- - - procedure IO_Initialize ( - Major : in RTEMS.Device_Major_Number; - Minor : in RTEMS.Device_Minor_Number; - Argument : in RTEMS.Address; - Result : out RTEMS.Status_Codes - ) is - function IO_Initialize_Base ( - Major : RTEMS.Device_Major_Number; - Minor : RTEMS.Device_Minor_Number; - Argument : RTEMS.Address - ) return RTEMS.Status_Codes; - pragma Import (C, IO_Initialize_Base, "rtems_io_initialize"); - begin - - Result := IO_Initialize_Base ( Major, Minor, Argument ); - - end IO_Initialize; - - procedure IO_Register_Name ( - Name : in String; - Major : in RTEMS.Device_Major_Number; - Minor : in RTEMS.Device_Minor_Number; - Result : out RTEMS.Status_Codes - ) is - function IO_Register_Name_Base ( - Name : Interfaces.C.Char_Array; - Major : RTEMS.Device_Major_Number; - Minor : RTEMS.Device_Minor_Number - ) return RTEMS.Status_Codes; - pragma Import (C, IO_Register_Name_Base, "rtems_io_register_name"); - begin - - Result := - IO_Register_Name_Base ( Interfaces.C.To_C (Name), Major, Minor ); - - end IO_Register_Name; - - procedure IO_Lookup_Name ( - Name : in String; - Device_Info : in RTEMS.Driver_Name_t_Pointer; - Result : out RTEMS.Status_Codes - ) is - function IO_Lookup_Name_Base ( - Name : Interfaces.C.Char_Array; - Device_Info : access RTEMS.Driver_Name_t - ) return RTEMS.Status_Codes; - pragma Import (C, IO_Lookup_Name_Base, "rtems_io_lookup_name"); - Device_Info_Base : aliased RTEMS.Driver_Name_t; - begin - - Result := IO_Lookup_Name_Base ( - Interfaces.C.To_C (Name), - Device_Info_Base'Unchecked_Access - ); - Device_Info := Device_Info_Base; - - end IO_Lookup_Name; - - procedure IO_Open ( - Major : in RTEMS.Device_Major_Number; - Minor : in RTEMS.Device_Minor_Number; - Argument : in RTEMS.Address; - Result : out RTEMS.Status_Codes - ) is - function IO_Open_Base ( - Major : RTEMS.Device_Major_Number; - Minor : RTEMS.Device_Minor_Number; - Argument : RTEMS.Address - ) return RTEMS.Status_Codes; - pragma Import (C, IO_Open_Base, "rtems_io_open"); - begin - - Result := IO_Open_Base (Major, Minor, Argument); - - end IO_Open; - - procedure IO_Close ( - Major : in RTEMS.Device_Major_Number; - Minor : in RTEMS.Device_Minor_Number; - Argument : in RTEMS.Address; - Result : out RTEMS.Status_Codes - ) is - function IO_Close_Base ( - Major : RTEMS.Device_Major_Number; - Minor : RTEMS.Device_Minor_Number; - Argument : RTEMS.Address - ) return RTEMS.Status_Codes; - pragma Import (C, IO_Close_Base, "rtems_io_close"); - begin - - Result := IO_Close_Base (Major, Minor, Argument); - - end IO_Close; - - procedure IO_Read ( - Major : in RTEMS.Device_Major_Number; - Minor : in RTEMS.Device_Minor_Number; - Argument : in RTEMS.Address; - Result : out RTEMS.Status_Codes - ) is - function IO_Read_Base ( - Major : RTEMS.Device_Major_Number; - Minor : RTEMS.Device_Minor_Number; - Argument : RTEMS.Address - ) return RTEMS.Status_Codes; - pragma Import (C, IO_Read_Base, "rtems_io_read"); - begin - - Result := IO_Read_Base (Major, Minor, Argument); - - end IO_Read; - - procedure IO_Write ( - Major : in RTEMS.Device_Major_Number; - Minor : in RTEMS.Device_Minor_Number; - Argument : in RTEMS.Address; - Result : out RTEMS.Status_Codes - ) is - function IO_Write_Base ( - Major : RTEMS.Device_Major_Number; - Minor : RTEMS.Device_Minor_Number; - Argument : RTEMS.Address - ) return RTEMS.Status_Codes; - pragma Import (C, IO_Write_Base, "rtems_io_write"); - begin - - Result := IO_Write_Base (Major, Minor, Argument); - - end IO_Write; - - procedure IO_Control ( - Major : in RTEMS.Device_Major_Number; - Minor : in RTEMS.Device_Minor_Number; - Argument : in RTEMS.Address; - Result : out RTEMS.Status_Codes - ) is - function IO_Control_Base ( - Major : RTEMS.Device_Major_Number; - Minor : RTEMS.Device_Minor_Number; - Argument : RTEMS.Address - ) return RTEMS.Status_Codes; - pragma Import (C, IO_Control_Base, "rtems_io_control"); - begin - - Result := IO_Control_Base (Major, Minor, Argument); - - end IO_Control; - - -- - -- Fatal Error Manager - -- - - procedure Fatal_Error_Occurred ( - The_Error : in RTEMS.Unsigned32 - ) is - procedure Fatal_Error_Occurred_base ( - The_Error : RTEMS.Unsigned32 - ); - pragma Import (C, Fatal_Error_Occurred_Base, "rtems_fatal_error_occurred"); - begin - - Fatal_Error_Occurred_Base ( The_Error ); - - end Fatal_Error_Occurred; - - - -- - -- Rate Monotonic Manager - -- - - procedure Rate_Monotonic_Create ( - Name : in RTEMS.Name; - ID : out RTEMS.ID; - Result : out RTEMS.Status_Codes - ) is - function Rate_Monotonic_Create_base ( - Name : RTEMS.Name; - ID : access RTEMS.ID - ) return RTEMS.Status_Codes; - pragma Import (C, Rate_Monotonic_Create_base, "rtems_rate_monotonic_create"); - ID_Base : aliased RTEMS.ID := ID; - begin - - Result := Rate_Monotonic_Create_base ( Name, ID_Base'Unchecked_Access ); - ID := ID_Base; - - end Rate_Monotonic_Create; - - procedure Rate_Monotonic_Ident ( - Name : in RTEMS.Name; - ID : out RTEMS.ID; - Result : out RTEMS.Status_Codes - ) is - function Rate_Monotonic_Ident_Base ( - Name : RTEMS.Name; - ID : access RTEMS.ID - ) return RTEMS.Status_Codes; - pragma Import (C, Rate_Monotonic_Ident_Base, "rtems_rate_monotonic_ident"); - ID_Base : aliased RTEMS.ID := ID; - begin - - Result := Rate_Monotonic_Ident_Base ( Name, ID_Base'Unchecked_Access ); - - ID := ID_Base; - - end Rate_Monotonic_Ident; - - procedure Rate_Monotonic_Delete ( - ID : in RTEMS.ID; - Result : out RTEMS.Status_Codes - ) is - function Rate_Monotonic_Delete_Base ( - ID : RTEMS.ID - ) return RTEMS.Status_Codes; - pragma Import (C, Rate_Monotonic_Delete_Base, - "rtems_rate_monotonic_delete"); - begin - - Result := Rate_Monotonic_Delete_base ( ID ); - - end Rate_Monotonic_Delete; - - procedure Rate_Monotonic_Cancel ( - ID : in RTEMS.ID; - Result : out RTEMS.Status_Codes - ) is - function Rate_Monotonic_Cancel_Base ( - ID : RTEMS.ID - ) return RTEMS.Status_Codes; - pragma Import (C, Rate_Monotonic_Cancel_Base, - "rtems_rate_monotonic_cancel"); - begin - - Result := Rate_Monotonic_Cancel_Base ( ID ); - - end Rate_Monotonic_Cancel; - - procedure Rate_Monotonic_Period ( - ID : in RTEMS.ID; - Length : in RTEMS.Interval; - Result : out RTEMS.Status_Codes - ) is - function Rate_Monotonic_Period_Base ( - ID : RTEMS.ID; - Length : RTEMS.Interval - ) return RTEMS.Status_Codes; - pragma Import (C, Rate_Monotonic_Period_Base, - "rtems_rate_monotonic_period"); - begin - - Result := Rate_Monotonic_Period_base ( ID, Length ); - - end Rate_Monotonic_Period; - - - procedure Rate_Monotonic_Get_Status ( - ID : in RTEMS.ID; - Status : out RTEMS.Rate_Monotonic_Period_Status; - Result : out RTEMS.Status_Codes - ) is - function Rate_Monotonic_Get_Status_Base ( - ID : RTEMS.ID; - Status : access RTEMS.Rate_Monotonic_Period_Status - ) return RTEMS.Status_Codes; - pragma Import (C, Rate_Monotonic_Get_Status_Base, - "rtems_rate_monotonic_get_status"); - - Status_Base : aliased RTEMS.Rate_Monotonic_Period_Status; - begin - - Result := Rate_Monotonic_Get_Status_Base ( - ID, - Status_Base'Unchecked_Access - ); - - Status := Status_Base; - - - end Rate_Monotonic_Get_Status; - - - -- - -- Debug Manager - -- - - procedure Debug_Enable ( - To_Be_Enabled : in RTEMS.Debug_Set - ) is - procedure Debug_Enable_Base ( - To_Be_Enabled : RTEMS.Debug_Set - ); - pragma Import (C, Debug_Enable_Base, "rtems_debug_enable"); - begin - - Debug_Enable_Base ( To_Be_Enabled ); - - end Debug_Enable; - - procedure Debug_Disable ( - To_Be_Disabled : in RTEMS.Debug_Set - ) is - procedure Debug_Disable_Base ( - To_Be_Disabled : RTEMS.Debug_Set - ); - pragma Import (C, Debug_Disable_Base, "rtems_debug_disable"); - begin - - Debug_Disable_Base ( To_Be_Disabled ); - - end Debug_Disable; - - function Debug_Is_Enabled ( - Level : in RTEMS.Debug_Set - ) return RTEMS.Boolean is - function Debug_Is_Enabled_Base ( - Level : RTEMS.Debug_Set - ) return RTEMS.Boolean; - pragma Import (C, Debug_Is_Enabled_Base, "_Debug_Is_enabled"); - begin - - return Debug_Is_Enabled_Base ( Level ); - - end Debug_Is_Enabled; - - -- HACK - -- function Configuration - -- return RTEMS.Configuration_Table_Pointer is - -- Configuration_base : RTEMS.Configuration_Table_Pointer; - -- pragma Import (C, Configuration_base, "_Configuration_Table"); - -- begin - -- return Configuration_Base; - -- end Configuration; - -end RTEMS; diff --git a/c/src/ada/rtems.ads b/c/src/ada/rtems.ads deleted file mode 100644 index caa197dc8c..0000000000 --- a/c/src/ada/rtems.ads +++ /dev/null @@ -1,1457 +0,0 @@ --- --- RTEMS / Specification --- --- DESCRIPTION: --- --- This package provides the interface to the RTEMS API. --- --- DEPENDENCIES: --- --- --- --- COPYRIGHT (c) 1997. --- On-Line Applications Research Corporation (OAR). --- --- The license and distribution terms for this file may in --- the file LICENSE in this distribution or at --- http://www.OARcorp.com/rtems/license.html. --- --- $Id$ --- - -with System; -with System.Storage_Elements; use System.Storage_Elements; -with Interfaces; -with Interfaces.C; - -package RTEMS is -pragma Elaborate_Body (RTEMS); - - Structure_Alignment : constant := 8; - - -- - -- RTEMS Base Types - -- - - subtype Unsigned8 is Interfaces.Unsigned_8; - subtype Unsigned16 is Interfaces.Unsigned_16; - subtype Unsigned32 is Interfaces.Unsigned_32; - subtype Signed32 is Interfaces.Integer_32; - - type Unsigned32_Pointer is access all RTEMS.Unsigned32; - type Unsigned16_Pointer is access all RTEMS.Unsigned16; - type Unsigned8_Pointer is access all RTEMS.Unsigned8; - type Signed32_Pointer is access all RTEMS.Signed32; - - subtype Boolean is RTEMS.Unsigned32; - subtype Address is System.Address; - subtype Single is Interfaces.C.C_float; - subtype Double is Interfaces.C.Double; - - -- - -- The following define the size of each of the base types in - -- both bits and system units. - -- - - Unsigned8_Bits : constant := 7; - Unsigned16_Bits : constant := 15; - Unsigned32_Bits : constant := 31; - Boolean_Bits : constant := 31; - Address_Bits : constant := 31; - Single_Bits : constant := 31; - Double_Bits : constant := 63; - - Unsigned8_Units : constant := 1; - Unsigned16_Units : constant := 2; - Unsigned32_Units : constant := 4; - Boolean_Units : constant := 4; - Address_Units : constant := 4; - Single_Units : constant := 4; - Double_Units : constant := 8; - - Null_Address : constant RTEMS.Address := - System.Storage_Elements.To_Address(0); - - True : constant RTEMS.Boolean := 1; - False : constant RTEMS.Boolean := 0; - - -- More Types - -- - - subtype Name is RTEMS.Unsigned32; - subtype ID is RTEMS.Unsigned32; - subtype Interval is RTEMS.Unsigned32; - subtype Attribute is RTEMS.Unsigned32; - subtype Mode is RTEMS.Unsigned32; - subtype Option is RTEMS.Unsigned32; - subtype Task_Priority is RTEMS.Unsigned32; - subtype Notepad_Index is RTEMS.Unsigned32 range 0 .. 15; - - subtype Event_Set is RTEMS.Unsigned32; - subtype Signal_Set is RTEMS.Unsigned32; - subtype Debug_Set is RTEMS.Unsigned32; - subtype Device_Major_Number is RTEMS.Unsigned32; - subtype Device_Minor_Number is RTEMS.Unsigned32; - subtype Vector_Number is RTEMS.Unsigned32; - subtype ISR_Level is RTEMS.Unsigned32; - - subtype Node is RTEMS.Unsigned32; - - -- - -- Task Related Types - -- XXXX fix this - subtype Task_Argument is RTEMS.Unsigned32; - type Task_Argument_PTR is access all Task_Argument; - - -- XXXX fix this - subtype TCB is RTEMS.Unsigned32; - type TCB_Pointer is access all RTEMS.TCB; - - subtype Task_States is RTEMS.Unsigned32; - - type Task_Entry is access procedure ( - Argument : RTEMS.Unsigned32 - ); - - -- - -- Clock and Time of Day Types - -- - - type Time_Of_Day is - record - Year : RTEMS.Unsigned32; -- year, A.D. - Month : RTEMS.Unsigned32; -- month, 1 .. 12 - Day : RTEMS.Unsigned32; -- day, 1 .. 31 - Hour : RTEMS.Unsigned32; -- hour, 0 .. 23 - Minute : RTEMS.Unsigned32; -- minute, 0 .. 59 - Second : RTEMS.Unsigned32; -- second, 0 .. 59 - Ticks : RTEMS.Unsigned32; -- elapsed ticks between seconds - end record; - - type Clock_Time_Value is - record - Seconds : RTEMS.Unsigned32; - Microseconds : RTEMS.Unsigned32; - end record; - - type Clock_Get_Options is ( - Clock_Get_TOD, - Clock_Get_Seconds_Since_Epoch, - Clock_Get_Ticks_Since_Boot, - Clock_Get_Ticks_Per_Seconds, - Clock_Get_Time_Value - ); - - -- - -- Device Driver Entry Prototype - -- - - type Device_Driver_Entry is access function ( - Major : in RTEMS.Device_Major_Number; - Minor : in RTEMS.Device_Major_Number; - Argument : in RTEMS.Unsigned32; - ID : in RTEMS.Unsigned32 - ) return RTEMS.Unsigned32; - - type Driver_Address_Table_Entry is - record - Initialization : RTEMS.Device_Driver_Entry; - Open : RTEMS.Device_Driver_Entry; - Close : RTEMS.Device_Driver_Entry; - Read : RTEMS.Device_Driver_Entry; - Write : RTEMS.Device_Driver_Entry; - Control : RTEMS.Device_Driver_Entry; - end record; - - type Driver_Address_Table is array ( RTEMS.Unsigned32 - range 1 .. RTEMS.Unsigned32'Last ) of RTEMS.Driver_Address_Table_Entry; - - type Driver_Address_Table_Pointer is access all Driver_Address_Table; - - type Driver_Name_t is - record - Device_Name : RTEMS.Address; - Device_Name_Length : RTEMS.Unsigned32; - Major : RTEMS.Device_Major_Number; - Minor : RTEMS.Device_Minor_Number; - end record; - - type Driver_Name_t_Pointer is access all Driver_Name_t; - - -- - -- Ident Options - -- - - Search_All_Nodes : constant RTEMS.Node := 0; - - -- - -- Options - -- - - Default_Options : constant RTEMS.Option := 16#0000#; - - Wait : constant RTEMS.Option := 16#0000#; - No_Wait : constant RTEMS.Option := 16#0001#; - - Event_All : constant RTEMS.Option := 16#0000#; - Event_Any : constant RTEMS.Option := 16#0002#; - - -- - -- Mode constants - -- - - Default_Modes : constant RTEMS.Mode := 16#0000#; - - All_Mode_Masks : constant RTEMS.Mode := 16#0000_ffff#; - Current_Mode : constant RTEMS.Mode := 16#0000_0000#; - Preempt_Mask : constant RTEMS.Mode := 16#0000_0100#; - Timeslice_Mask : constant RTEMS.Mode := 16#0000_0200#; - ASR_Mask : constant RTEMS.Mode := 16#0000_0400#; - Interrupt_Mask : RTEMS.Mode; - Preempt : constant RTEMS.Mode := 16#0000_0000#; - No_Preempt : constant RTEMS.Mode := 16#0000_0100#; - No_Timeslice : constant RTEMS.Mode := 16#0000_0000#; - Timeslice : constant RTEMS.Mode := 16#0000_0200#; - ASR : constant RTEMS.Mode := 16#0000_0000#; - No_ASR : constant RTEMS.Mode := 16#0000_0400#; - - pragma Import (C, Interrupt_Mask, "rtems_interrupt_mask"); - - -- - -- Attribute constants - -- - - Default_Attributes : constant RTEMS.Attribute := 16#00000000#; - No_Floating_Point : constant RTEMS.Attribute := 16#00000000#; - Floating_Point : constant RTEMS.Attribute := 16#00000001#; - Local : constant RTEMS.Attribute := 16#00000000#; - Global : constant RTEMS.Attribute := 16#00000002#; - FIFO : constant RTEMS.Attribute := 16#00000000#; - Priority : constant RTEMS.Attribute := 16#00000004#; - Counting_Semaphore : constant RTEMS.Attribute := 16#00000000#; - Binary_Semaphore : constant RTEMS.Attribute := 16#00000010#; - No_Inherit_Priority : constant RTEMS.Attribute := 16#00000000#; - Inherit_Priority : constant RTEMS.Attribute := 16#00000020#; - No_Priority_Ceiling : constant RTEMS.Attribute := 16#00000000#; - Priority_Ceiling : constant RTEMS.Attribute := 16#00000040#; - - function Interrupt_Level ( - Level : in RTEMS.Unsigned32 - ) return RTEMS.Attribute; - pragma Import (C, Interrupt_Level, "rtems_interrupt_level_attribute"); - - Minimum_Stack_Size : RTEMS.Unsigned32; - pragma Import (C, Minimum_Stack_Size, "rtems_minimum_stack_size"); - - - -- - -- Notepad index constants - -- - - Notepad_0 : constant RTEMS.Unsigned32 := 0; - Notepad_1 : constant RTEMS.Unsigned32 := 1; - Notepad_2 : constant RTEMS.Unsigned32 := 2; - Notepad_3 : constant RTEMS.Unsigned32 := 3; - Notepad_4 : constant RTEMS.Unsigned32 := 4; - Notepad_5 : constant RTEMS.Unsigned32 := 5; - Notepad_6 : constant RTEMS.Unsigned32 := 6; - Notepad_7 : constant RTEMS.Unsigned32 := 7; - Notepad_8 : constant RTEMS.Unsigned32 := 8; - Notepad_9 : constant RTEMS.Unsigned32 := 9; - Notepad_10 : constant RTEMS.Unsigned32 := 10; - Notepad_11 : constant RTEMS.Unsigned32 := 11; - Notepad_12 : constant RTEMS.Unsigned32 := 12; - Notepad_13 : constant RTEMS.Unsigned32 := 13; - Notepad_14 : constant RTEMS.Unsigned32 := 14; - Notepad_15 : constant RTEMS.Unsigned32 := 15; - - -- - -- Miscellaneous - -- - - No_Timeout : constant RTEMS.Interval := 0; - Self : constant RTEMS.ID := 0; - Period_Status : constant RTEMS.Interval := 0; - Yield_Processor : constant RTEMS.Interval := 0; - Current_Priority : constant RTEMS.Task_Priority := 0; - No_Priority : constant RTEMS.Task_Priority := 0; - - - -- - -- Extension Callouts and Table - -- - - type Thread_Create_Extension is access procedure ( - Current_Task : in RTEMS.TCB_Pointer; - New_Task : in RTEMS.TCB_Pointer - ); - - type Thread_Start_Extension is access procedure ( - Current_Task : in RTEMS.TCB_Pointer; - Started_Task : in RTEMS.TCB_Pointer - ); - - type Thread_Restart_Extension is access procedure ( - Current_Task : in RTEMS.TCB_Pointer; - Restarted_Task : in RTEMS.TCB_Pointer - ); - - type Thread_Delete_Extension is access procedure ( - Current_Task : in RTEMS.TCB_Pointer; - Deleted_Task : in RTEMS.TCB_Pointer - ); - - type Thread_Switch_Extension is access procedure ( - Current_Task : in RTEMS.TCB_Pointer; - Heir_Task : in RTEMS.TCB_Pointer - ); - - type Thread_Post_Switch_Extension is access procedure ( - Current_Task : in RTEMS.TCB_Pointer - ); - - type Thread_Begin_Extension is access procedure ( - Current_Task : in RTEMS.TCB_Pointer - ); - - type Thread_Exitted_Extension is access procedure ( - Current_Task : in RTEMS.TCB_Pointer - ); - - type Fatal_Error_Extension is access procedure ( - Error : in RTEMS.Unsigned32 - ); - - type Extensions_Table is - record - Thread_Create : RTEMS.Thread_Create_Extension; - Thread_Start : RTEMS.Thread_Start_Extension; - Thread_Restart : RTEMS.Thread_Restart_Extension; - Thread_Delete : RTEMS.Thread_Delete_Extension; - Thread_Switch : RTEMS.Thread_Switch_Extension; - Thread_Post_Switch : RTEMS.Thread_Post_Switch_Extension; - Thread_Begin : RTEMS.Thread_Begin_Extension; - Thread_Exitted : RTEMS.Thread_Exitted_Extension; - Fatal : RTEMS.Fatal_Error_Extension; - end record; - - type Extensions_Table_Pointer is access all Extensions_Table; - - -- - -- The following type define a pointer to a watchdog/timer service routine. - -- - - type Timer_Service_Routine is access procedure ( - ID : in RTEMS.ID; - User_Data : in RTEMS.Address - ); - - -- - -- The following type define a pointer to a signal service routine. - -- - - type ASR_Handler is access procedure ( - Signals : in RTEMS.Signal_Set - ); - - -- - -- The following type defines the status information returned - -- about a period. - -- - - type Rate_Monotonic_Period_States is ( - Inactive, -- off chain, never initialized - Owner_Is_Blocking, -- on chain, owner is blocking on it - Active, -- on chain, running continuously - Expired_While_Blocking, -- on chain, expired while owner was was blocking - Expired -- off chain, will be reset by next - -- rtems_rate_monotonic_period - ); - - for Rate_Monotonic_Period_States'Size use 32; - - for Rate_Monotonic_Period_States use ( - Inactive => 0, - Owner_Is_Blocking => 1, - Active => 2, - Expired_While_Blocking => 3, - Expired => 4 - ); - - type Rate_Monotonic_Period_Status is - record - State : RTEMS.Rate_Monotonic_Period_States; - Ticks_Since_Last_Period : RTEMS.Unsigned32; - Ticks_Executed_Since_Last_Period : RTEMS.Unsigned32; - end record; - - -- - -- Method Completions Status Codes - -- - - type Status_Codes is ( - Successful, -- successful completion - Task_Exitted, -- returned from a task - MP_Not_Configured, -- multiprocessing not configured - Invalid_Name, -- invalid object name - Invalid_ID, -- invalid object id - Too_Many, -- too many - Timeout, -- timed out waiting - Object_Was_Deleted, -- object deleted while waiting - Invalid_Size, -- specified size was invalid - Invalid_Address, -- address specified is invalid - Invalid_Number, -- number was invalid - Not_Defined, -- item has not been initialized - Resource_In_Use, -- resources still outstanding - Unsatisfied, -- request not satisfied - Incorrect_State, -- task is in wrong state - Already_Suspended, -- task already in state - Illegal_On_Self, -- illegal on calling task - Illegal_On_Remote_Object, -- illegal for remote object - Called_From_ISR, -- called from wrong environment - Invalid_Priority, -- invalid task priority - Invalid_Clock, -- invalid date/time - Invalid_Node, -- invalid node id - Not_Configured, -- directive not configured - Not_Owner_Of_Resource, -- not owner of resource - Not_Implemented, -- directive not implemented - Internal_Error, -- RTEMS inconsistency detected - No_Memory, -- no memory left in heap - IO_Error, -- driver IO error - Proxy_Blocking -- internal multiprocessing only - ); - - for Status_Codes'Size use 32; - - for Status_Codes use ( - Successful => 0, - Task_Exitted => 1, - MP_Not_Configured => 2, - Invalid_Name => 3, - Invalid_ID => 4, - Too_Many => 5, - Timeout => 6, - Object_Was_Deleted => 7, - Invalid_Size => 8, - Invalid_Address => 9, - Invalid_NumbeR => 10, - Not_Defined => 11, - Resource_In_Use => 12, - Unsatisfied => 13, - Incorrect_State => 14, - Already_Suspended => 15, - Illegal_On_Self => 16, - Illegal_On_Remote_Object => 17, - Called_From_ISR => 18, - Invalid_Priority => 19, - Invalid_Clock => 20, - Invalid_Node => 21, - Not_Configured => 22, - Not_Owner_Of_Resource => 23, - Not_ImplementeD => 24, - Internal_Error => 25, - No_Memory => 26, - IO_Error => 27, - Proxy_Blocking => 28 - ); - - -- - -- RTEMS Events - -- - - Pending_Events : constant RTEMS.Event_Set := 16#0000_0000#; - All_Events : constant RTEMS.Event_Set := 16#FFFF_FFFF#; - Event_0 : constant RTEMS.Event_Set := 16#0000_0001#; - Event_1 : constant RTEMS.Event_Set := 16#0000_0002#; - Event_2 : constant RTEMS.Event_Set := 16#0000_0004#; - Event_3 : constant RTEMS.Event_Set := 16#0000_0008#; - Event_4 : constant RTEMS.Event_Set := 16#0000_0010#; - Event_5 : constant RTEMS.Event_Set := 16#0000_0020#; - Event_6 : constant RTEMS.Event_Set := 16#0000_0040#; - Event_7 : constant RTEMS.Event_Set := 16#0000_0080#; - Event_8 : constant RTEMS.Event_Set := 16#0000_0100#; - Event_9 : constant RTEMS.Event_Set := 16#0000_0200#; - Event_10 : constant RTEMS.Event_Set := 16#0000_0400#; - Event_11 : constant RTEMS.Event_Set := 16#0000_0800#; - Event_12 : constant RTEMS.Event_Set := 16#0000_1000#; - Event_13 : constant RTEMS.Event_Set := 16#0000_2000#; - Event_14 : constant RTEMS.Event_Set := 16#0000_4000#; - Event_15 : constant RTEMS.Event_Set := 16#0000_8000#; - Event_16 : constant RTEMS.Event_Set := 16#0001_0000#; - Event_17 : constant RTEMS.Event_Set := 16#0002_0000#; - Event_18 : constant RTEMS.Event_Set := 16#0004_0000#; - Event_19 : constant RTEMS.Event_Set := 16#0008_0000#; - Event_20 : constant RTEMS.Event_Set := 16#0010_0000#; - Event_21 : constant RTEMS.Event_Set := 16#0020_0000#; - Event_22 : constant RTEMS.Event_Set := 16#0040_0000#; - Event_23 : constant RTEMS.Event_Set := 16#0080_0000#; - Event_24 : constant RTEMS.Event_Set := 16#0100_0000#; - Event_25 : constant RTEMS.Event_Set := 16#0200_0000#; - Event_26 : constant RTEMS.Event_Set := 16#0400_0000#; - Event_27 : constant RTEMS.Event_Set := 16#0800_0000#; - Event_28 : constant RTEMS.Event_Set := 16#1000_0000#; - Event_29 : constant RTEMS.Event_Set := 16#2000_0000#; - Event_30 : constant RTEMS.Event_Set := 16#4000_0000#; - Event_31 : constant RTEMS.Event_Set := 16#8000_0000#; - - -- - -- RTEMS Signals - -- - - All_Signals : constant RTEMS.Signal_Set := 16#7FFFFFFF#; - Signal_0 : constant RTEMS.Signal_Set := 16#00000001#; - Signal_1 : constant RTEMS.Signal_Set := 16#00000002#; - Signal_2 : constant RTEMS.Signal_Set := 16#00000004#; - Signal_3 : constant RTEMS.Signal_Set := 16#00000008#; - Signal_4 : constant RTEMS.Signal_Set := 16#00000010#; - Signal_5 : constant RTEMS.Signal_Set := 16#00000020#; - Signal_6 : constant RTEMS.Signal_Set := 16#00000040#; - Signal_7 : constant RTEMS.Signal_Set := 16#00000080#; - Signal_8 : constant RTEMS.Signal_Set := 16#00000100#; - Signal_9 : constant RTEMS.Signal_Set := 16#00000200#; - Signal_10 : constant RTEMS.Signal_Set := 16#00000400#; - Signal_11 : constant RTEMS.Signal_Set := 16#00000800#; - Signal_12 : constant RTEMS.Signal_Set := 16#00001000#; - Signal_13 : constant RTEMS.Signal_Set := 16#00002000#; - Signal_14 : constant RTEMS.Signal_Set := 16#00004000#; - Signal_15 : constant RTEMS.Signal_Set := 16#00008000#; - Signal_16 : constant RTEMS.Signal_Set := 16#00010000#; - Signal_17 : constant RTEMS.Signal_Set := 16#00020000#; - Signal_18 : constant RTEMS.Signal_Set := 16#00040000#; - Signal_19 : constant RTEMS.Signal_Set := 16#00080000#; - Signal_20 : constant RTEMS.Signal_Set := 16#00100000#; - Signal_21 : constant RTEMS.Signal_Set := 16#00200000#; - Signal_22 : constant RTEMS.Signal_Set := 16#00400000#; - Signal_23 : constant RTEMS.Signal_Set := 16#00800000#; - Signal_24 : constant RTEMS.Signal_Set := 16#01000000#; - Signal_25 : constant RTEMS.Signal_Set := 16#02000000#; - Signal_26 : constant RTEMS.Signal_Set := 16#04000000#; - Signal_27 : constant RTEMS.Signal_Set := 16#08000000#; - Signal_28 : constant RTEMS.Signal_Set := 16#10000000#; - Signal_29 : constant RTEMS.Signal_Set := 16#20000000#; - Signal_30 : constant RTEMS.Signal_Set := 16#40000000#; - Signal_31 : constant RTEMS.Signal_Set := 16#80000000#; - - -- - -- RTEMS API Configuration Information - -- - - type Initialization_Tasks_Table_Entry is - record - Name : RTEMS.Name; -- task name - Stack_Size : RTEMS.Unsigned32; -- task stack size - Initial_Priority : RTEMS.Task_priority; -- task priority - Attribute_Set : RTEMS.Attribute; -- task attributes - Entry_Point : RTEMS.Task_Entry; -- task entry point - Mode_Set : RTEMS.Mode; -- task initial mode - Argument : RTEMS.Unsigned32; -- task argument - end record; - - type Initialization_Tasks_Table is array ( RTEMS.Unsigned32 range <> ) of - RTEMS.Initialization_Tasks_Table_Entry; - - type Initialization_Tasks_Table_Pointer is access all - Initialization_Tasks_Table; - - type API_Configuration_Table is - record - Maximum_Tasks : RTEMS.Unsigned32; - Maximum_Timers : RTEMS.Unsigned32; - Maximum_Semaphores : RTEMS.Unsigned32; - Maximum_Message_queues : RTEMS.Unsigned32; - Maximum_Partitions : RTEMS.Unsigned32; - Maximum_Regions : RTEMS.Unsigned32; - Maximum_Ports : RTEMS.Unsigned32; - Maximum_Periods : RTEMS.Unsigned32; - Number_Of_Initialization_Tasks : RTEMS.Unsigned32; - User_Initialization_Tasks_Table : - RTEMS.Initialization_Tasks_Table_Pointer; - end record; - - type API_Configuration_Table_Pointer is access all API_Configuration_Table; - - -- - -- RTEMS POSIX API Configuration Information - -- - - type POSIX_Thread_Entry is access procedure ( - Argument : in RTEMS.Address - ); - - type POSIX_Initialization_Threads_Table_Entry is - record - Thread_Entry : RTEMS.POSIX_Thread_Entry; - end record; - - type POSIX_Initialization_Threads_Table is array - ( RTEMS.Unsigned32 range <> ) of - RTEMS.POSIX_Initialization_Threads_Table_Entry; - - type POSIX_Initialization_Threads_Table_Pointer is access all - POSIX_Initialization_Threads_Table; - - type POSIX_API_Configuration_Table_Entry is - record - Maximum_Threads : Interfaces.C.Int; - Maximum_Mutexes : Interfaces.C.Int; - Maximum_Condition_Variables : Interfaces.C.Int; - Maximum_Keys : Interfaces.C.Int; - Maximum_Queued_Signals : Interfaces.C.Int; - Number_Of_Initialization_Tasks : Interfaces.C.Int; - User_Initialization_Tasks_Table : - RTEMS.POSIX_Initialization_Threads_Table_Pointer; - end record; - - type POSIX_API_Configuration_Table is array ( RTEMS.Unsigned32 range <> ) of - RTEMS.POSIX_API_Configuration_Table_Entry; - - type POSIX_API_Configuration_Table_Pointer is access all - RTEMS.POSIX_API_Configuration_Table; - - -- - -- MPCI Information include MPCI Configuration - -- - - type Configuration_Table_Pointer; - - type MP_Packet_Classes is ( - MP_PACKET_MPCI_INTERNAL, - MP_PACKET_TASKS, - MP_PACKET_MESSAGE_QUEUE, - MP_PACKET_SEMAPHORE, - MP_PACKET_PARTITION, - MP_PACKET_REGION, - MP_PACKET_EVENT, - MP_PACKET_SIGNAL - ); - - for MP_Packet_Classes use ( - MP_PACKET_MPCI_INTERNAL => 0, - MP_PACKET_TASKS => 1, - MP_PACKET_MESSAGE_QUEUE => 2, - MP_PACKET_SEMAPHORE => 3, - MP_PACKET_PARTITION => 4, - MP_PACKET_REGION => 5, - MP_PACKET_EVENT => 6, - MP_PACKET_SIGNAL => 7 - ); - - type Packet_Prefix is - record - The_Class : RTEMS.MP_Packet_Classes; - ID : RTEMS.ID; - Source_TID : RTEMS.ID; - Source_Priority : RTEMS.Task_Priority; - Return_Code : RTEMS.Unsigned32; - Length : RTEMS.Unsigned32; - To_Convert : RTEMS.Unsigned32; - Timeout : RTEMS.Interval; - end record; - - type Packet_Prefix_Pointer is access all Packet_Prefix; - - type MPCI_Initialization_Entry is access procedure ( - Configuration : in RTEMS.Configuration_Table_Pointer - ); - - type MPCI_Get_Packet_Entry is access procedure ( - Packet : access RTEMS.Packet_Prefix_Pointer - ); - - type MPCI_Return_Packet_Entry is access procedure ( - Packet : in RTEMS.Packet_Prefix_Pointer - ); - - type MPCI_Send_Entry is access procedure ( - Packet : in RTEMS.Packet_Prefix_Pointer - ); - - type MPCI_Receive_Entry is access procedure ( - Packet : access RTEMS.Packet_Prefix_Pointer - ); - - type MPCI_Table is - record - Default_Timeout : RTEMS.Unsigned32; -- in ticks - Maximum_Packet_Size : RTEMS.Unsigned32; - Initialization : RTEMS.MPCI_Initialization_Entry; - Get_Packet : RTEMS.MPCI_Get_Packet_Entry; - Return_Packet : RTEMS.MPCI_Return_Packet_Entry; - Send : RTEMS.MPCI_Send_Entry; - Receive : RTEMS.MPCI_Receive_Entry; - end record; - - type MPCI_Table_Pointer is access all MPCI_Table; - - -- - -- Configuration Information - -- - - type Multiprocessing_Table is - record - Node : RTEMS.Unsigned32; - Maximum_Nodes : RTEMS.Unsigned32; - Maximum_Global_Objects : RTEMS.Unsigned32; - Maximum_Proxies : RTEMS.Unsigned32; - User_MPCI_Table : RTEMS.MPCI_Table_Pointer; - end record; - - type Multiprocessing_Table_Pointer is access all Multiprocessing_Table; - - type Configuration_Table is - record - Work_Space_Start : RTEMS.Address; - Work_Space_Size : RTEMS.Unsigned32; - Maximum_Extensions : RTEMS.Unsigned32; - Microseconds_Per_Tick : RTEMS.Unsigned32; - Ticks_Per_Timeslice : RTEMS.Unsigned32; - Maximum_Devices : RTEMS.Unsigned32; - Maximum_Drivers : RTEMS.Unsigned32; - Number_Of_Device_Drivers : RTEMS.Unsigned32; - Device_Driver_Table : RTEMS.Driver_Address_Table_Pointer; - Number_Of_Initial_Extensions : RTEMS.Unsigned32; - User_Extension_Table : RTEMS.Extensions_Table_Pointer; - User_Multiprocessing_Table : RTEMS.Multiprocessing_Table_Pointer; - - RTEMS_API_Configuration : RTEMS.API_Configuration_Table_Pointer; - POSIX_API_Configuration : RTEMS.POSIX_API_Configuration_Table_Pointer; - ITRON_API_Configuration : RTEMS.Address; -- XXX FIX ME - end record; - - type Configuration_Table_Pointer is access all Configuration_Table; - - -- - -- For now, do not provide access to the CPU Table from Ada. - -- When this type is provided, a CPU dependent file must - -- define it. - -- - - subtype CPU_Table is RTEMS.Address; - type CPU_Table_Pointer is access all CPU_Table; - - -- - -- Utility Functions - -- - - function From_Ada_Boolean ( - Ada_Boolean : Standard.Boolean - ) return RTEMS.Boolean; - - function To_Ada_Boolean ( - RTEMS_Boolean : RTEMS.Boolean - ) return Standard.Boolean; - - function Milliseconds_To_Microseconds ( - Milliseconds : RTEMS.Unsigned32 - ) return RTEMS.Unsigned32; - - function Microseconds_To_Ticks ( - Microseconds : RTEMS.Unsigned32 - ) return RTEMS.Interval; - - function Milliseconds_To_Ticks ( - Milliseconds : RTEMS.Unsigned32 - ) return RTEMS.Interval; - - function Build_Name ( - C1 : in Character; - C2 : in Character; - C3 : in Character; - C4 : in Character - ) return RTEMS.Name; - - procedure Name_To_Characters ( - Name : in RTEMS.Name; - C1 : out Character; - C2 : out Character; - C3 : out Character; - C4 : out Character - ); - - function Get_Node ( - ID : in RTEMS.ID - ) return RTEMS.Unsigned32; - - function Get_Index ( - ID : in RTEMS.ID - ) return RTEMS.Unsigned32; - - function Are_Statuses_Equal ( - Status : in RTEMS.Status_Codes; - Desired : in RTEMS.Status_Codes - ) return Standard.Boolean; - - function Is_Status_Successful ( - Status : in RTEMS.Status_Codes - ) return Standard.Boolean; - - function Subtract ( - Left : in RTEMS.Address; - Right : in RTEMS.Address - ) return RTEMS.Unsigned32; - - function Are_Equal ( - Left : in RTEMS.Address; - Right : in RTEMS.Address - ) return Standard.Boolean; - -- - -- RTEMS API - -- - - -- - -- Initialization Manager - -- - - procedure Initialize_Executive ( - Configuration_Table : in RTEMS.Configuration_Table_Pointer; - CPU_Table : in RTEMS.CPU_Table_Pointer - ); - - procedure Initialize_Executive_Early ( - Configuration_Table : in RTEMS.Configuration_Table_Pointer; - CPU_Table : in RTEMS.CPU_Table_Pointer; - Level : out RTEMS.ISR_Level - ); - - procedure Initialize_Executive_Late ( - BSP_Level : in RTEMS.ISR_Level - ); - - procedure Shutdown_Executive ( - Result : in RTEMS.Unsigned32 - ); - - -- - -- Task Manager - -- - - procedure Task_Create ( - Name : in RTEMS.Name; - Initial_Priority : in RTEMS.Task_Priority; - Stack_Size : in Unsigned32; - Initial_Modes : in RTEMS.Mode; - Attribute_Set : in RTEMS.Attribute; - ID : out RTEMS.ID; - Result : out RTEMS.Status_Codes - ); - - procedure Task_Ident ( - Name : in RTEMS.Name; - Node : in RTEMS.Node; - ID : out RTEMS.ID; - Result : out RTEMS.Status_Codes - ); - - procedure Task_Start ( - ID : in RTEMS.ID; - Entry_Point : in RTEMS.Task_Entry; - Argument : in RTEMS.Task_Argument; - Result : out RTEMS.Status_Codes - ); - - procedure Task_Restart ( - ID : in RTEMS.ID; - Argument : in RTEMS.Task_Argument; - Result : out RTEMS.Status_Codes - ); - - procedure Task_Delete ( - ID : in RTEMS.ID; - Result : out RTEMS.Status_Codes - ); - - procedure Task_Suspend ( - ID : in RTEMS.ID; - Result : out RTEMS.Status_Codes - ); - - procedure Task_Resume ( - ID : in RTEMS.ID; - Result : out RTEMS.Status_Codes - ); - - procedure Task_Set_Priority ( - ID : in RTEMS.ID; - New_Priority : in RTEMS.Task_Priority; - Old_Priority : out RTEMS.Task_Priority; - Result : out RTEMS.Status_Codes - ); - - procedure Task_Mode ( - Mode_Set : in RTEMS.Mode; - Mask : in RTEMS.Mode; - Previous_Mode_Set : out RTEMS.Mode; - Result : out RTEMS.Status_Codes - ); - - procedure Task_Get_Note ( - ID : in RTEMS.ID; - Notepad : in RTEMS.Notepad_Index; - Note : out RTEMS.Unsigned32; - Result : out RTEMS.Status_Codes - ); - - procedure Task_Set_Note ( - ID : in RTEMS.ID; - Notepad : in RTEMS.Notepad_Index; - Note : in RTEMS.Unsigned32; - Result : out RTEMS.Status_Codes - ); - - procedure Task_Wake_When ( - Time_Buffer : in RTEMS.Time_Of_Day; - Result : out RTEMS.Status_Codes - ); - - procedure Task_Wake_After ( - Ticks : in RTEMS.Interval; - Result : out RTEMS.Status_Codes - ); - - -- - -- Interrupt Manager - -- - - procedure Interrupt_Catch ( - New_ISR_Handler : in RTEMS.Address; - Vector : in RTEMS.Vector_Number; - Old_ISR_Handler : out RTEMS.Address; - Result : out RTEMS.Status_Codes - ); - - function Interrupt_Disable return RTEMS.ISR_Level; - pragma Interface (C, Interrupt_Disable); - pragma Interface_Name (Interrupt_Disable, "rtems_interrupt_disable"); - - procedure Interrupt_Enable ( - Level : in RTEMS.ISR_Level - ); - pragma Interface (C, Interrupt_Enable); - pragma Interface_Name (Interrupt_Enable, "rtems_interrupt_enable"); - - procedure Interrupt_Flash ( - Level : in RTEMS.ISR_Level - ); - pragma Interface (C, Interrupt_Flash); - pragma Interface_Name (Interrupt_Flash, "rtems_interrupt_flash"); - - function Interrupt_Is_In_Progress return RTEMS.Boolean; - pragma Interface (C, Interrupt_Is_In_Progress); - pragma Interface_Name - (Interrupt_Is_In_Progress, "rtems_interrupt_is_in_progress"); - - -- - -- Clock Manager - -- - - procedure Clock_Get ( - Option : in RTEMS.Clock_Get_Options; - Time_Buffer : in RTEMS.Address; - Result : out RTEMS.Status_Codes - ); - - procedure Clock_Set ( - Time_Buffer : in RTEMS.Time_Of_Day; - Result : out RTEMS.Status_Codes - ); - - procedure Clock_Tick ( - Result : out RTEMS.Status_Codes - ); - - -- - -- Extension Manager - -- - - procedure Extension_Create ( - Name : in RTEMS.Name; - Table : in RTEMS.Extensions_Table_Pointer; - ID : out RTEMS.ID; - Result : out RTEMS.Status_Codes - ); - - procedure Extension_Ident ( - Name : in RTEMS.Name; - ID : out RTEMS.ID; - Result : out RTEMS.Status_Codes - ); - - procedure Extension_Delete ( - ID : in RTEMS.ID; - Result : out RTEMS.Status_Codes - ); - - - -- - -- Timer Manager - -- - - procedure Timer_Create ( - Name : in RTEMS.Name; - ID : out RTEMS.ID; - Result : out RTEMS.Status_Codes - ); - - procedure Timer_Ident ( - Name : in RTEMS.Name; - ID : out RTEMS.ID; - Result : out RTEMS.Status_Codes - ); - - procedure Timer_Delete ( - ID : in RTEMS.ID; - Result : out RTEMS.Status_Codes - ); - - procedure Timer_Fire_After ( - ID : in RTEMS.ID; - Ticks : in RTEMS.Interval; - Routine : in RTEMS.Timer_Service_Routine; - User_Data : in RTEMS.Address; - Result : out RTEMS.Status_Codes - ); - - procedure Timer_Server_Fire_After ( - ID : in RTEMS.ID; - Ticks : in RTEMS.Interval; - Routine : in RTEMS.Timer_Service_Routine; - User_Data : in RTEMS.Address; - Result : out RTEMS.Status_Codes - ); - - procedure Timer_Fire_When ( - ID : in RTEMS.ID; - Wall_Time : in RTEMS.Time_Of_Day; - Routine : in RTEMS.Timer_Service_Routine; - User_Data : in RTEMS.Address; - Result : out RTEMS.Status_Codes - ); - - procedure Timer_Server_Fire_When ( - ID : in RTEMS.ID; - Wall_Time : in RTEMS.Time_Of_Day; - Routine : in RTEMS.Timer_Service_Routine; - User_Data : in RTEMS.Address; - Result : out RTEMS.Status_Codes - ); - - procedure Timer_Reset ( - ID : in RTEMS.ID; - Result : out RTEMS.Status_Codes - ); - - procedure Timer_Cancel ( - ID : in RTEMS.ID; - Result : out RTEMS.Status_Codes - ); - - procedure Timer_Initiate_Server ( - Server_Priority : in RTEMS.Task_Priority; - Stack_Size : in Unsigned32; - Attribute_Set : in RTEMS.Attribute; - Result : out RTEMS.Status_Codes - ); - - -- - -- Semaphore Manager - -- - - procedure Semaphore_Create ( - Name : in RTEMS.Name; - Count : in RTEMS.Unsigned32; - Attribute_Set : in RTEMS.Attribute; - Priority_Ceiling : in RTEMS.Task_Priority; - ID : out RTEMS.ID; - Result : out RTEMS.Status_Codes - ); - - procedure Semaphore_Delete ( - ID : in RTEMS.ID; - Result : out RTEMS.Status_Codes - ); - - procedure Semaphore_Ident ( - Name : in RTEMS.Name; - Node : in RTEMS.Unsigned32; - ID : out RTEMS.ID; - Result : out RTEMS.Status_Codes - ); - - procedure Semaphore_Obtain ( - ID : in RTEMS.ID; - Option_Set : in RTEMS.Option; - Timeout : in RTEMS.Interval; - Result : out RTEMS.Status_Codes - ); - - procedure Semaphore_Release ( - ID : in RTEMS.ID; - Result : out RTEMS.Status_Codes - ); - - - -- - -- Message Queue Manager - -- - - procedure Message_Queue_Create ( - Name : in RTEMS.Name; - Count : in RTEMS.Unsigned32; - Max_Message_Size : in RTEMS.Unsigned32; - Attribute_Set : in RTEMS.Attribute; - ID : out RTEMS.ID; - Result : out RTEMS.Status_Codes - ); - - procedure Message_Queue_Ident ( - Name : in RTEMS.Name; - Node : in RTEMS.Unsigned32; - ID : out RTEMS.ID; - Result : out RTEMS.Status_Codes - ); - - procedure Message_Queue_Delete ( - ID : in RTEMS.ID; - Result : out RTEMS.Status_Codes - ); - - procedure Message_Queue_Send ( - ID : in RTEMS.ID; - Buffer : in RTEMS.Address; - Size : in RTEMS.Unsigned32; - Result : out RTEMS.Status_Codes - ); - - procedure Message_Queue_Urgent ( - ID : in RTEMS.ID; - Buffer : in RTEMS.Address; - Size : in RTEMS.Unsigned32; - Result : out RTEMS.Status_Codes - ); - - procedure Message_Queue_Broadcast ( - ID : in RTEMS.ID; - Buffer : in RTEMS.Address; - Size : in RTEMS.Unsigned32; - Count : out RTEMS.Unsigned32; - Result : out RTEMS.Status_Codes - ); - - procedure Message_Queue_Receive ( - ID : in RTEMS.ID; - Buffer : in RTEMS.Address; - Option_Set : in RTEMS.Option; - Timeout : in RTEMS.Interval; - Size : out RTEMS.Unsigned32; - Result : out RTEMS.Status_Codes - ); - - procedure Message_Queue_Flush ( - ID : in RTEMS.ID; - Count : out RTEMS.Unsigned32; - Result : out RTEMS.Status_Codes - ); - - - -- - -- Event Manager - -- - - procedure Event_Send ( - ID : in RTEMS.ID; - Event_In : in RTEMS.Event_Set; - Result : out RTEMS.Status_Codes - ); - - procedure Event_Receive ( - Event_In : in RTEMS.Event_Set; - Option_Set : in RTEMS.Option; - Ticks : in RTEMS.Interval; - Event_Out : out RTEMS.Event_Set; - Result : out RTEMS.Status_Codes - ); - - -- - -- Signal Manager - -- - - procedure Signal_Catch ( - ASR_Handler : in RTEMS.ASR_Handler; - Mode_Set : in RTEMS.Mode; - Result : out RTEMS.Status_Codes - ); - - procedure Signal_Send ( - ID : in RTEMS.ID; - Signal_Set : in RTEMS.Signal_Set; - Result : out RTEMS.Status_Codes - ); - - - -- - -- Partition Manager - -- - - procedure Partition_Create ( - Name : in RTEMS.Name; - Starting_Address : in RTEMS.Address; - Length : in RTEMS.Unsigned32; - Buffer_Size : in RTEMS.Unsigned32; - Attribute_Set : in RTEMS.Attribute; - ID : out RTEMS.ID; - Result : out RTEMS.Status_Codes - ); - - procedure Partition_Ident ( - Name : in RTEMS.Name; - Node : in RTEMS.Unsigned32; - ID : out RTEMS.ID; - Result : out RTEMS.Status_Codes - ); - - procedure Partition_Delete ( - ID : in RTEMS.ID; - Result : out RTEMS.Status_Codes - ); - - procedure Partition_Get_Buffer ( - ID : in RTEMS.ID; - Buffer : out RTEMS.Address; - Result : out RTEMS.Status_Codes - ); - - procedure Partition_Return_Buffer ( - ID : in RTEMS.ID; - Buffer : in RTEMS.Address; - Result : out RTEMS.Status_Codes - ); - - - -- - -- Region Manager - -- - - procedure Region_Create ( - Name : in RTEMS.Name; - Starting_Address : in RTEMS.Address; - Length : in RTEMS.Unsigned32; - Page_Size : in RTEMS.Unsigned32; - Attribute_Set : in RTEMS.Attribute; - ID : out RTEMS.ID; - Result : out RTEMS.Status_Codes - ); - - procedure Region_Ident ( - Name : in RTEMS.Name; - ID : out RTEMS.ID; - Result : out RTEMS.Status_Codes - ); - - procedure Region_Delete ( - ID : in RTEMS.ID; - Result : out RTEMS.Status_Codes - ); - - procedure Region_Extend ( - ID : in RTEMS.ID; - Starting_Address : in RTEMS.Address; - Length : in RTEMS.Unsigned32; - Result : out RTEMS.Status_Codes - ); - - procedure Region_Get_Segment ( - ID : in RTEMS.ID; - Size : in RTEMS.Unsigned32; - Option_Set : in RTEMS.Option; - Timeout : in RTEMS.Interval; - Segment : out RTEMS.Address; - Result : out RTEMS.Status_Codes - ); - - procedure Region_Get_Segment_Size ( - ID : in RTEMS.ID; - Segment : in RTEMS.Address; - Size : out RTEMS.Unsigned32; - Result : out RTEMS.Status_Codes - ); - - procedure Region_Return_Segment ( - ID : in RTEMS.ID; - Segment : in RTEMS.Address; - Result : out RTEMS.Status_Codes - ); - - - -- - -- Dual Ported Memory Manager - -- - - procedure Port_Create ( - Name : in RTEMS.Name; - Internal_Start : in RTEMS.Address; - External_Start : in RTEMS.Address; - Length : in RTEMS.Unsigned32; - ID : out RTEMS.ID; - Result : out RTEMS.Status_Codes - ); - - procedure Port_Ident ( - Name : in RTEMS.Name; - ID : out RTEMS.ID; - Result : out RTEMS.Status_Codes - ); - - procedure Port_Delete ( - ID : in RTEMS.ID; - Result : out RTEMS.Status_Codes - ); - - procedure Port_External_To_Internal ( - ID : in RTEMS.ID; - External : in RTEMS.Address; - Internal : out RTEMS.Address; - Result : out RTEMS.Status_Codes - ); - - procedure Port_Internal_To_External ( - ID : in RTEMS.ID; - Internal : in RTEMS.Address; - External : out RTEMS.Address; - Result : out RTEMS.Status_Codes - ); - - -- - -- Input/Output Manager - -- - - procedure IO_Initialize ( - Major : in RTEMS.Device_Major_Number; - Minor : in RTEMS.Device_Minor_Number; - Argument : in RTEMS.Address; - Result : out RTEMS.Status_Codes - ); - - procedure IO_Register_Name ( - Name : in String; - Major : in RTEMS.Device_Major_Number; - Minor : in RTEMS.Device_Minor_Number; - Result : out RTEMS.Status_Codes - ); - - procedure IO_Lookup_Name ( - Name : in String; - Device_Info : In RTEMS.Driver_Name_t_Pointer; - Result : out RTEMS.Status_Codes - ); - - procedure IO_Open ( - Major : in RTEMS.Device_Major_Number; - Minor : in RTEMS.Device_Minor_Number; - Argument : in RTEMS.Address; - Result : out RTEMS.Status_Codes - ); - - procedure IO_Close ( - Major : in RTEMS.Device_Major_Number; - Minor : in RTEMS.Device_Minor_Number; - Argument : in RTEMS.Address; - Result : out RTEMS.Status_Codes - ); - - procedure IO_Read ( - Major : in RTEMS.Device_Major_Number; - Minor : in RTEMS.Device_Minor_Number; - Argument : in RTEMS.Address; - Result : out RTEMS.Status_Codes - ); - - procedure IO_Write ( - Major : in RTEMS.Device_Major_Number; - Minor : in RTEMS.Device_Minor_Number; - Argument : in RTEMS.Address; - Result : out RTEMS.Status_Codes - ); - - procedure IO_Control ( - Major : in RTEMS.Device_Major_Number; - Minor : in RTEMS.Device_Minor_Number; - Argument : in RTEMS.Address; - Result : out RTEMS.Status_Codes - ); - - - -- - -- Fatal Error Manager - -- - - procedure Fatal_Error_Occurred ( - The_Error : in RTEMS.Unsigned32 - ); - - - -- - -- Rate Monotonic Manager - -- - - procedure Rate_Monotonic_Create ( - Name : in RTEMS.Name; - ID : out RTEMS.ID; - Result : out RTEMS.Status_Codes - ); - - procedure Rate_Monotonic_Ident ( - Name : in RTEMS.Name; - ID : out RTEMS.ID; - Result : out RTEMS.Status_Codes - ); - - procedure Rate_Monotonic_Delete ( - ID : in RTEMS.ID; - Result : out RTEMS.Status_Codes - ); - - procedure Rate_Monotonic_Cancel ( - ID : in RTEMS.ID; - Result : out RTEMS.Status_Codes - ); - - procedure Rate_Monotonic_Period ( - ID : in RTEMS.ID; - Length : in RTEMS.Interval; - Result : out RTEMS.Status_Codes - ); - - procedure Rate_Monotonic_Get_Status ( - ID : in RTEMS.ID; - Status : out RTEMS.Rate_Monotonic_Period_Status; - Result : out RTEMS.Status_Codes - ); - - - -- - -- Debug Manager - -- - - Debug_All_Mask : constant RTEMS.Debug_Set := 16#ffffffff#; - Debug_Region : constant RTEMS.Debug_Set := 16#00000001#; - - procedure Debug_Enable ( - To_Be_Enabled : in RTEMS.Debug_Set - ); - - procedure Debug_Disable ( - To_Be_Disabled : in RTEMS.Debug_Set - ); - - function Debug_Is_Enabled ( - Level : in RTEMS.Debug_Set - ) return RTEMS.Boolean; - - -- - -- Some Useful Data Items - -- - - Configuration : RTEMS.Configuration_Table_Pointer; - pragma Import (C, Configuration, "_Configuration_Table"); - -end RTEMS; diff --git a/c/src/lib/libcpu/powerpc/new-exceptions/ChangeLog b/c/src/lib/libcpu/powerpc/new-exceptions/ChangeLog deleted file mode 100644 index ccf0ca5d0e..0000000000 --- a/c/src/lib/libcpu/powerpc/new-exceptions/ChangeLog +++ /dev/null @@ -1,86 +0,0 @@ -2003-02-11 Ralf Corsepius - - * configure.ac: AM_INIT_AUTOMAKE([1.7.2]). - -2003-02-11 Ralf Corsepius - - * configure.ac: AC_PREREQ(2.57). - -2002-12-17 Ralf Corsepius - - * Makefile.am: Don't include @RTEMS_BSP@.cfg. - * configure.ac: Remove RTEMS_CHECK_CUSTOM_BSP. - -2002-11-01 Joel Sherrill - - * cpu.c: Currently only the mpc8260 BSP supports interrupt nesting. - NOTE: These needs to be generalized as the patch is applied to other - BSPs. - -2002-10-21 Ralf Corsepius - - * .cvsignore: Reformat. - Add autom4te*cache. - Remove autom4te.cache. - -2002-08-11 Ralf Corsepius - - * Makefile.am: Use .$(OBJEXT) instead of .o. - -2001-05-14 Till Straumann - - * cpu.c: Per PR211 fix - saving/restoring floating point context. The fpsave and fprestore - routines are only used in a executing context which _is_ fp and hence - has the FPU enabled. The current behavior required the FPU always to - be on which is very dangerous if lazy context switching is used. - [Joel Note: Some ports explicitly enabled the FPU in the FP save and - restore routines to avoid this.] - - The patch also makes sure (on powerpc only) that the FPU is disabled - for integer tasks. Note that this is crucial if deferred fp context - switching is used. Otherwise, fp context corruption may go undetected! - Also note that even tasks which merely push/pop FP registers to/from - the stack without modifying them still MUST be FP tasks - otherwise - (if lazy FP context switching is used), FP register corruption (of - other, FP, tasks may occur)! - - Furthermore, (on PPC) by default, lazy FP context save/restore - is _disabled_. - -2002-04-18 Ralf Corsepius - - * rtems/score/cpu.h: Removed. - * Makefile.am: Reflect changes above. - -2001-04-03 Joel Sherrill - - * Per PR94, all rtems/score/CPUtypes.h are named rtems/score/types.h. - * rtems/score/cpu.h: Account for name change. - -2002-03-27 Ralf Corsepius - - * configure.ac: - AC_INIT(package,_RTEMS_VERSION,_RTEMS_BUGS). - AM_INIT_AUTOMAKE([no-define foreign 1.6]). - * Makefile.am: Remove AUTOMAKE_OPTIONS. - -2001-11-28 Joel Sherrill , - - This was tracked as PR91. - * rtems/score/cpu.h: Added CPU_PROVIDES_ISR_IS_IN_PROGRESS macro which - is used to specify if the port uses the standard macro for this (FALSE). - A TRUE setting indicates the port provides its own implementation. - * rtems/score/c_isr.inl: Deleted and contents merged into cpu.c. - * cpu.c: Received contents of c_isr.inl. - * Makefile.am: Deleted reference to c_isr.inl. - -2001-11-26 Ralf Corsepius - - * .cvsignore: Add aclocal.m4, autom4te.*, config.*, configure. - -2001-11-21 Ralf Corsepius - - * Makefile.am: Preinstall c_isr.inl (HACK). - * ChangeLog: New file. - diff --git a/c/src/lib/libcpu/powerpc/new-exceptions/cpu.c b/c/src/lib/libcpu/powerpc/new-exceptions/cpu.c deleted file mode 100644 index 32589213ae..0000000000 --- a/c/src/lib/libcpu/powerpc/new-exceptions/cpu.c +++ /dev/null @@ -1,148 +0,0 @@ -/* - * PowerPC CPU Dependent Source - * - * Author: Andrew Bray - * - * COPYRIGHT (c) 1995 by i-cubed ltd. - * - * 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 i-cubed limited not be used in - * advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * i-cubed limited makes no representations about the suitability - * of this software for any purpose. - * - * Derived from c/src/exec/cpu/no_cpu/cpu.c: - * - * COPYRIGHT (c) 1989-1997. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be found in - * the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include -#include -#include -#include - - -/* _CPU_Initialize - * - * This routine performs processor dependent initialization. - * - * INPUT PARAMETERS: - * cpu_table - CPU table to initialize - * thread_dispatch - address of disptaching routine - */ - -void _CPU_Initialize( - rtems_cpu_table *cpu_table, - void (*thread_dispatch) /* ignored on this CPU */ -) -{ - _CPU_Table = *cpu_table; -} - -/*PAGE - * - * _CPU_Context_Initialize - */ - -void _CPU_Context_Initialize( - Context_Control *the_context, - unsigned32 *stack_base, - unsigned32 size, - unsigned32 new_level, - void *entry_point, - boolean is_fp -) -{ - unsigned32 msr_value; - unsigned32 sp; - - sp = (unsigned32)stack_base + size - CPU_MINIMUM_STACK_FRAME_SIZE; - *((unsigned32 *)sp) = 0; - the_context->gpr1 = sp; - - _CPU_MSR_GET( msr_value ); - - if (!(new_level & CPU_MODES_INTERRUPT_MASK)) { - msr_value |= MSR_EE; - } - else { - msr_value &= ~MSR_EE; - } - - the_context->msr = msr_value; - - /* - * The FP bit of the MSR should only be enabled if this is a floating - * point task. Unfortunately, the vfprintf_r routine in newlib - * ends up pushing a floating point register regardless of whether or - * not a floating point number is being printed. Serious restructuring - * of vfprintf.c will be required to avoid this behavior. At this - * time (7 July 1997), this restructuring is not being done. - */ - - /* Till Straumann: For deferred FPContext save/restore, make sure integer - * tasks have no FPU access in order to catch violations. - * Otherwise, the FP registers may be corrupted. - * Since we set the_contex->msr using our current MSR, - * we must make sure MSR_FP is off if (!is_fp)... - */ -#if defined(CPU_USE_DEFERRED_FP_SWITCH) && (CPU_USE_DEFERRED_FP_SWITCH==TRUE) - if ( is_fp ) -#endif - the_context->msr |= PPC_MSR_FP; -#if defined(CPU_USE_DEFERRED_FP_SWITCH) && (CPU_USE_DEFERRED_FP_SWITCH==TRUE) - else - the_context->msr &= ~PPC_MSR_FP; -#endif - - the_context->pc = (unsigned32)entry_point; -} - - - -/*PAGE - * - * _CPU_Install_interrupt_stack - */ - -void _CPU_Install_interrupt_stack( void ) -{ -} - -/*PAGE - * - * This is the PowerPC specific implementation of the routine which - * returns TRUE if an interrupt is in progress. - */ - -boolean _ISR_Is_in_progress( void ) -{ - /* - * Until the patch on PR288 is in all new exception BSPs, this is - * the safest thing to do. - */ -#ifdef mpc8260 - return (_ISR_Nest_level != 0); -#else - register unsigned int isr_nesting_level; - /* - * Move from special purpose register 0 (mfspr SPRG0, r3) - */ - asm volatile ("mfspr %0, 272" : "=r" (isr_nesting_level)); - return isr_nesting_level; -#endif -} - diff --git a/c/src/lib/libcpu/powerpc/new-exceptions/cpu_asm.S b/c/src/lib/libcpu/powerpc/new-exceptions/cpu_asm.S deleted file mode 100644 index d5cd0d0f2a..0000000000 --- a/c/src/lib/libcpu/powerpc/new-exceptions/cpu_asm.S +++ /dev/null @@ -1,405 +0,0 @@ - -/* cpu_asm.s 1.1 - 95/12/04 - * - * This file contains the assembly code for the PowerPC implementation - * of RTEMS. - * - * Author: Andrew Bray - * - * COPYRIGHT (c) 1995 by i-cubed ltd. - * - * 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 i-cubed limited not be used in - * advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * i-cubed limited makes no representations about the suitability - * of this software for any purpose. - * - * Derived from c/src/exec/cpu/no_cpu/cpu_asm.c: - * - * COPYRIGHT (c) 1989-1997. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may in - * the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* - * Offsets for various Contexts - */ - .set GP_1, 0 - .set GP_2, (GP_1 + 4) - .set GP_13, (GP_2 + 4) - .set GP_14, (GP_13 + 4) - - .set GP_15, (GP_14 + 4) - .set GP_16, (GP_15 + 4) - .set GP_17, (GP_16 + 4) - .set GP_18, (GP_17 + 4) - - .set GP_19, (GP_18 + 4) - .set GP_20, (GP_19 + 4) - .set GP_21, (GP_20 + 4) - .set GP_22, (GP_21 + 4) - - .set GP_23, (GP_22 + 4) - .set GP_24, (GP_23 + 4) - .set GP_25, (GP_24 + 4) - .set GP_26, (GP_25 + 4) - - .set GP_27, (GP_26 + 4) - .set GP_28, (GP_27 + 4) - .set GP_29, (GP_28 + 4) - .set GP_30, (GP_29 + 4) - - .set GP_31, (GP_30 + 4) - .set GP_CR, (GP_31 + 4) - .set GP_PC, (GP_CR + 4) - .set GP_MSR, (GP_PC + 4) - -#if (PPC_HAS_DOUBLE==1) - .set FP_SIZE, 8 -#define LDF lfd -#define STF stfd -#else - .set FP_SIZE, 4 -#define LDF lfs -#define STF stfs -#endif - - .set FP_0, 0 - .set FP_1, (FP_0 + FP_SIZE) - .set FP_2, (FP_1 + FP_SIZE) - .set FP_3, (FP_2 + FP_SIZE) - .set FP_4, (FP_3 + FP_SIZE) - .set FP_5, (FP_4 + FP_SIZE) - .set FP_6, (FP_5 + FP_SIZE) - .set FP_7, (FP_6 + FP_SIZE) - .set FP_8, (FP_7 + FP_SIZE) - .set FP_9, (FP_8 + FP_SIZE) - .set FP_10, (FP_9 + FP_SIZE) - .set FP_11, (FP_10 + FP_SIZE) - .set FP_12, (FP_11 + FP_SIZE) - .set FP_13, (FP_12 + FP_SIZE) - .set FP_14, (FP_13 + FP_SIZE) - .set FP_15, (FP_14 + FP_SIZE) - .set FP_16, (FP_15 + FP_SIZE) - .set FP_17, (FP_16 + FP_SIZE) - .set FP_18, (FP_17 + FP_SIZE) - .set FP_19, (FP_18 + FP_SIZE) - .set FP_20, (FP_19 + FP_SIZE) - .set FP_21, (FP_20 + FP_SIZE) - .set FP_22, (FP_21 + FP_SIZE) - .set FP_23, (FP_22 + FP_SIZE) - .set FP_24, (FP_23 + FP_SIZE) - .set FP_25, (FP_24 + FP_SIZE) - .set FP_26, (FP_25 + FP_SIZE) - .set FP_27, (FP_26 + FP_SIZE) - .set FP_28, (FP_27 + FP_SIZE) - .set FP_29, (FP_28 + FP_SIZE) - .set FP_30, (FP_29 + FP_SIZE) - .set FP_31, (FP_30 + FP_SIZE) - .set FP_FPSCR, (FP_31 + FP_SIZE) - - .set IP_LINK, 0 - .set IP_0, (IP_LINK + 8) - .set IP_2, (IP_0 + 4) - - .set IP_3, (IP_2 + 4) - .set IP_4, (IP_3 + 4) - .set IP_5, (IP_4 + 4) - .set IP_6, (IP_5 + 4) - - .set IP_7, (IP_6 + 4) - .set IP_8, (IP_7 + 4) - .set IP_9, (IP_8 + 4) - .set IP_10, (IP_9 + 4) - - .set IP_11, (IP_10 + 4) - .set IP_12, (IP_11 + 4) - .set IP_13, (IP_12 + 4) - .set IP_28, (IP_13 + 4) - - .set IP_29, (IP_28 + 4) - .set IP_30, (IP_29 + 4) - .set IP_31, (IP_30 + 4) - .set IP_CR, (IP_31 + 4) - - .set IP_CTR, (IP_CR + 4) - .set IP_XER, (IP_CTR + 4) - .set IP_LR, (IP_XER + 4) - .set IP_PC, (IP_LR + 4) - - .set IP_MSR, (IP_PC + 4) - .set IP_END, (IP_MSR + 16) - - BEGIN_CODE -/* - * _CPU_Context_save_fp_context - * - * This routine is responsible for saving the FP context - * at *fp_context_ptr. If the point to load the FP context - * from is changed then the pointer is modified by this routine. - * - * Sometimes a macro implementation of this is in cpu.h which dereferences - * the ** and a similarly named routine in this file is passed something - * like a (Context_Control_fp *). The general rule on making this decision - * is to avoid writing assembly language. - */ - - ALIGN (PPC_CACHE_ALIGNMENT, PPC_CACHE_ALIGN_POWER) - PUBLIC_PROC (_CPU_Context_save_fp) -PROC (_CPU_Context_save_fp): -#if (PPC_HAS_FPU == 1) - lwz r3, 0(r3) - STF f0, FP_0(r3) - STF f1, FP_1(r3) - STF f2, FP_2(r3) - STF f3, FP_3(r3) - STF f4, FP_4(r3) - STF f5, FP_5(r3) - STF f6, FP_6(r3) - STF f7, FP_7(r3) - STF f8, FP_8(r3) - STF f9, FP_9(r3) - STF f10, FP_10(r3) - STF f11, FP_11(r3) - STF f12, FP_12(r3) - STF f13, FP_13(r3) - STF f14, FP_14(r3) - STF f15, FP_15(r3) - STF f16, FP_16(r3) - STF f17, FP_17(r3) - STF f18, FP_18(r3) - STF f19, FP_19(r3) - STF f20, FP_20(r3) - STF f21, FP_21(r3) - STF f22, FP_22(r3) - STF f23, FP_23(r3) - STF f24, FP_24(r3) - STF f25, FP_25(r3) - STF f26, FP_26(r3) - STF f27, FP_27(r3) - STF f28, FP_28(r3) - STF f29, FP_29(r3) - STF f30, FP_30(r3) - STF f31, FP_31(r3) - mffs f2 - STF f2, FP_FPSCR(r3) -#endif - blr - -/* - * _CPU_Context_restore_fp_context - * - * This routine is responsible for restoring the FP context - * at *fp_context_ptr. If the point to load the FP context - * from is changed then the pointer is modified by this routine. - * - * Sometimes a macro implementation of this is in cpu.h which dereferences - * the ** and a similarly named routine in this file is passed something - * like a (Context_Control_fp *). The general rule on making this decision - * is to avoid writing assembly language. - */ - - ALIGN (PPC_CACHE_ALIGNMENT, PPC_CACHE_ALIGN_POWER) - PUBLIC_PROC (_CPU_Context_restore_fp) -PROC (_CPU_Context_restore_fp): -#if (PPC_HAS_FPU == 1) - lwz r3, 0(r3) - LDF f2, FP_FPSCR(r3) - mtfsf 255, f2 - LDF f0, FP_0(r3) - LDF f1, FP_1(r3) - LDF f2, FP_2(r3) - LDF f3, FP_3(r3) - LDF f4, FP_4(r3) - LDF f5, FP_5(r3) - LDF f6, FP_6(r3) - LDF f7, FP_7(r3) - LDF f8, FP_8(r3) - LDF f9, FP_9(r3) - LDF f10, FP_10(r3) - LDF f11, FP_11(r3) - LDF f12, FP_12(r3) - LDF f13, FP_13(r3) - LDF f14, FP_14(r3) - LDF f15, FP_15(r3) - LDF f16, FP_16(r3) - LDF f17, FP_17(r3) - LDF f18, FP_18(r3) - LDF f19, FP_19(r3) - LDF f20, FP_20(r3) - LDF f21, FP_21(r3) - LDF f22, FP_22(r3) - LDF f23, FP_23(r3) - LDF f24, FP_24(r3) - LDF f25, FP_25(r3) - LDF f26, FP_26(r3) - LDF f27, FP_27(r3) - LDF f28, FP_28(r3) - LDF f29, FP_29(r3) - LDF f30, FP_30(r3) - LDF f31, FP_31(r3) -#endif - blr - - -/* _CPU_Context_switch - * - * This routine performs a normal non-FP context switch. - */ - ALIGN (PPC_CACHE_ALIGNMENT, PPC_CACHE_ALIGN_POWER) - PUBLIC_PROC (_CPU_Context_switch) -PROC (_CPU_Context_switch): - sync - isync - /* This assumes that all the registers are in the given order */ - li r5, 32 - addi r3,r3,-4 -#if ( PPC_USE_DATA_CACHE ) - dcbz r5, r3 -#endif - stw r1, GP_1+4(r3) - stw r2, GP_2+4(r3) -#if (PPC_USE_MULTIPLE == 1) - addi r3, r3, GP_18+4 -#if ( PPC_USE_DATA_CACHE ) - dcbz r5, r3 -#endif - stmw r13, GP_13-GP_18(r3) -#else - stw r13, GP_13+4(r3) - stw r14, GP_14+4(r3) - stw r15, GP_15+4(r3) - stw r16, GP_16+4(r3) - stw r17, GP_17+4(r3) - stwu r18, GP_18+4(r3) -#if ( PPC_USE_DATA_CACHE ) - dcbz r5, r3 -#endif - stw r19, GP_19-GP_18(r3) - stw r20, GP_20-GP_18(r3) - stw r21, GP_21-GP_18(r3) - stw r22, GP_22-GP_18(r3) - stw r23, GP_23-GP_18(r3) - stw r24, GP_24-GP_18(r3) - stw r25, GP_25-GP_18(r3) - stw r26, GP_26-GP_18(r3) - stw r27, GP_27-GP_18(r3) - stw r28, GP_28-GP_18(r3) - stw r29, GP_29-GP_18(r3) - stw r30, GP_30-GP_18(r3) - stw r31, GP_31-GP_18(r3) -#endif -#if ( PPC_USE_DATA_CACHE ) - dcbt r0, r4 -#endif - mfcr r6 - stw r6, GP_CR-GP_18(r3) - mflr r7 - stw r7, GP_PC-GP_18(r3) - mfmsr r8 - stw r8, GP_MSR-GP_18(r3) - -#if ( PPC_USE_DATA_CACHE ) - dcbt r5, r4 -#endif - lwz r1, GP_1(r4) - lwz r2, GP_2(r4) -#if (PPC_USE_MULTIPLE == 1) - addi r4, r4, GP_19 -#if ( PPC_USE_DATA_CACHE ) - dcbt r5, r4 -#endif - lmw r13, GP_13-GP_19(r4) -#else - lwz r13, GP_13(r4) - lwz r14, GP_14(r4) - lwz r15, GP_15(r4) - lwz r16, GP_16(r4) - lwz r17, GP_17(r4) - lwz r18, GP_18(r4) - lwzu r19, GP_19(r4) -#if ( PPC_USE_DATA_CACHE ) - dcbt r5, r4 -#endif - lwz r20, GP_20-GP_19(r4) - lwz r21, GP_21-GP_19(r4) - lwz r22, GP_22-GP_19(r4) - lwz r23, GP_23-GP_19(r4) - lwz r24, GP_24-GP_19(r4) - lwz r25, GP_25-GP_19(r4) - lwz r26, GP_26-GP_19(r4) - lwz r27, GP_27-GP_19(r4) - lwz r28, GP_28-GP_19(r4) - lwz r29, GP_29-GP_19(r4) - lwz r30, GP_30-GP_19(r4) - lwz r31, GP_31-GP_19(r4) -#endif - lwz r6, GP_CR-GP_19(r4) - lwz r7, GP_PC-GP_19(r4) - lwz r8, GP_MSR-GP_19(r4) - mtcrf 255, r6 - mtlr r7 - mtmsr r8 - - blr - -/* - * _CPU_Context_restore - * - * This routine is generallu used only to restart self in an - * efficient manner. It may simply be a label in _CPU_Context_switch. - * - * NOTE: May be unnecessary to reload some registers. - */ -/* - * ACB: Don't worry about cache optimisation here - this is not THAT critical. - */ - ALIGN (PPC_CACHE_ALIGNMENT, PPC_CACHE_ALIGN_POWER) - PUBLIC_PROC (_CPU_Context_restore) -PROC (_CPU_Context_restore): - lwz r5, GP_CR(r3) - lwz r6, GP_PC(r3) - lwz r7, GP_MSR(r3) - mtcrf 255, r5 - mtlr r6 - mtmsr r7 - lwz r1, GP_1(r3) - lwz r2, GP_2(r3) -#if (PPC_USE_MULTIPLE == 1) - lmw r13, GP_13(r3) -#else - lwz r13, GP_13(r3) - lwz r14, GP_14(r3) - lwz r15, GP_15(r3) - lwz r16, GP_16(r3) - lwz r17, GP_17(r3) - lwz r18, GP_18(r3) - lwz r19, GP_19(r3) - lwz r20, GP_20(r3) - lwz r21, GP_21(r3) - lwz r22, GP_22(r3) - lwz r23, GP_23(r3) - lwz r24, GP_24(r3) - lwz r25, GP_25(r3) - lwz r26, GP_26(r3) - lwz r27, GP_27(r3) - lwz r28, GP_28(r3) - lwz r29, GP_29(r3) - lwz r30, GP_30(r3) - lwz r31, GP_31(r3) -#endif - - blr - diff --git a/c/src/lib/libcpu/powerpc/old-exceptions/ChangeLog b/c/src/lib/libcpu/powerpc/old-exceptions/ChangeLog deleted file mode 100644 index 854d204304..0000000000 --- a/c/src/lib/libcpu/powerpc/old-exceptions/ChangeLog +++ /dev/null @@ -1,78 +0,0 @@ -2003-02-11 Ralf Corsepius - - * configure.ac: AM_INIT_AUTOMAKE([1.7.2]). - -2003-02-11 Ralf Corsepius - - * configure.ac: AC_PREREQ(2.57). - -2002-12-17 Ralf Corsepius - - * Makefile.am: Don't include @RTEMS_BSP@.cfg. - * configure.ac: Remove RTEMS_CHECK_CUSTOM_BSP. - -2002-10-21 Ralf Corsepius - - * .cvsignore: Reformat. - Add autom4te*cache. - Remove autom4te.cache. - -2002-09-14 Joel Sherrill - - * cpu.c: Include declaration of variable i in ifdef USE_SPRG to - eliminate warning. - -2002-08-11 Ralf Corsepius - - * Makefile.am: Use .$(OBJEXT) instead of .o. - -2002-07-21 Ralf Corsepius - - * Makefile.am: Fix oversights in previous patch. - -2002-07-21 Ralf Corsepius - - * rtems.S: Remove. - * Makefile.am: Reflect having removed rtems.S. Use AM_CPPFLAGS - instead of INCLUDES (Latest automake standard). - -2002-04-30 Ralf Corsepius - - * cpu.c: Include . - -2002-04-18 Ralf Corsepius - - * rtems/score/cpu.h: Removed. - * Makefile.am: Reflect changes above. - -2001-04-03 Joel Sherrill - - * Per PR94, all rtems/score/CPUtypes.h are named rtems/score/types.h. - * rtems/score/cpu.h: Account for name change. - -2002-03-27 Ralf Corsepius - - * configure.ac: - AC_INIT(package,_RTEMS_VERSION,_RTEMS_BUGS). - AM_INIT_AUTOMAKE([no-define foreign 1.6]). - * Makefile.am: Remove AUTOMAKE_OPTIONS. - -2001-11-28 Joel Sherrill , - - This was tracked as PR91. - * rtems/score/cpu.h: Added CPU_PROVIDES_ISR_IS_IN_PROGRESS macro which - is used to specify if the port uses the standard macro for this (FALSE). - A TRUE setting indicates the port provides its own implementation. - * rtems/score/c_isr.inl: Deleted and contents merged into cpu.c. - * cpu.c: Received contents of c_isr.inl. - * Makefile.am: Deleted reference to c_isr.inl. - -2001-11-26 Ralf Corsepius - - * .cvsignore: Add aclocal.m4, autom4te.*, config.*, configure. - -2001-11-21 Ralf Corsepius - - * Makefile.am: Preinstall c_isr.inl (HACK). - * ChangeLog: New file. - diff --git a/c/src/lib/libcpu/powerpc/old-exceptions/README b/c/src/lib/libcpu/powerpc/old-exceptions/README deleted file mode 100644 index c72bebfe0c..0000000000 --- a/c/src/lib/libcpu/powerpc/old-exceptions/README +++ /dev/null @@ -1,80 +0,0 @@ -# -# $Id$ -# - -There are various issues regarding this port: - - - -1) Legal - -This port is written by Andrew Bray , and -is copyright 1995 i-cubed ltd. - -This port was later updated by Joel Sherrill -to test the support for the PPC603, PPC603e, and MPC604. This -was tested on the PowerPC simulator PSIM and a VMEbus single board -computer. - -2) CPU support. - -This release fully supports the PPC403GA, PPC403GB, PPC603, PPC603e, -MPC604, MPC750, and numerous MPC8xx processors. A good faith attempt -has been made to include support other models based upon available -documentation including the MPC5xx. There are two interrupt structures -supported by the PowerPC port. The newer structure is supported by -all the MPC750 and MPC604 BSPs. This structure is required to use -the RDBG remote debugging support. - -This port was originally written and tested on the PPC403GA (using -software floating point). Current ports are tested primarily on -60x CPUs using the PowerPC simulator PSIM. - -Andrew Bray received assistance during the initial porting effort -from IBM and Blue Micro and we would like to gratefully acknowledge -that help. - -The support for the PPC602 processor is incomplete as only sketchy -data is currently available. Perhaps this model has been dropped. - -3) Application Binary Interface - -In the context of RTEMS, the ABI is of interest for the following -aspects: - -a) Register usage. Which registers are used to provide static variable - linkage, stack pointer etc. - -b) Function calling convention. How parameters are passed, how function - variables should be invoked, how values are returned, etc. - -c) Stack frame layout. - -I am aware of a number of ABIs for the PowerPC: - -a) The PowerOpen ABI. This is the original Power ABI used on the RS/6000. - This is the only ABI supported by versions of GCC before 2.7.0. - -b) The SVR4 ABI. This is the ABI defined by SunSoft for the Solaris port - to the PowerPC. - -c) The Embedded ABI. This is an embedded ABI for PowerPC use, which has no - operating system interface defined. It is promoted by SunSoft, Motorola, - and Cygnus Support. Cygnus are porting the GNU toolchain to this ABI. - -d) GCC 2.7.0. This compiler is partway along the road to supporting the EABI, - but is currently halfway in between. - -This port was built and tested using the PowerOpen ABI, with the following -caveat: we used an ELF assembler and linker. So some attention may be -required on the assembler files to get them through a traditional (XCOFF) -PowerOpen assembler. - -This port contains support for the other ABIs, but this may prove to be -incomplete as it is untested. - -The RTEMS PowerPC port supports EABI as the primary ABI. The powerpc-rtems -GNU toolset configuration is EABI. - -Andrew Bray, 4 December 1995 -Joel Sherrill, 16 July 1997 diff --git a/c/src/lib/libcpu/powerpc/old-exceptions/TODO b/c/src/lib/libcpu/powerpc/old-exceptions/TODO deleted file mode 100644 index 64c96cb14c..0000000000 --- a/c/src/lib/libcpu/powerpc/old-exceptions/TODO +++ /dev/null @@ -1,8 +0,0 @@ -# -# $Id$ -# - -Todo list: - -Maybe decode external interrupts like the HPPA does. - See c/src/lib/libcpu/powerpc/ppc403/ictrl/* for implementation on ppc403 diff --git a/c/src/lib/libcpu/powerpc/old-exceptions/cpu.c b/c/src/lib/libcpu/powerpc/old-exceptions/cpu.c deleted file mode 100644 index d0b76b69ff..0000000000 --- a/c/src/lib/libcpu/powerpc/old-exceptions/cpu.c +++ /dev/null @@ -1,895 +0,0 @@ -/* - * PowerPC CPU Dependent Source - * - * Author: Andrew Bray - * - * COPYRIGHT (c) 1995 by i-cubed ltd. - * - * 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 i-cubed limited not be used in - * advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * i-cubed limited makes no representations about the suitability - * of this software for any purpose. - * - * Derived from c/src/exec/cpu/no_cpu/cpu.c: - * - * COPYRIGHT (c) 1989-1997. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be found in - * the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include -#include -#include -#include - -#include - -/* - * These are for testing purposes. - */ - -/* _CPU_Initialize - * - * This routine performs processor dependent initialization. - * - * INPUT PARAMETERS: - * cpu_table - CPU table to initialize - * thread_dispatch - address of disptaching routine - */ - -static void ppc_spurious(int, CPU_Interrupt_frame *); - -int _CPU_spurious_count = 0; -int _CPU_last_spurious = 0; - -void _CPU_Initialize( - rtems_cpu_table *cpu_table, - void (*thread_dispatch) /* ignored on this CPU */ -) -{ -#if (PPC_USE_SPRG) - int i; -#endif -#if (PPC_ABI != PPC_ABI_POWEROPEN) - register unsigned32 r2 = 0; -#if (PPC_ABI != PPC_ABI_GCC27) - register unsigned32 r13 = 0; - - asm ("mr %0,13" : "=r" ((r13)) : "0" ((r13))); - _CPU_IRQ_info.Default_r13 = r13; -#endif - - asm ("mr %0,2" : "=r" ((r2)) : "0" ((r2))); - _CPU_IRQ_info.Default_r2 = r2; -#endif - - _CPU_IRQ_info.Nest_level = &_ISR_Nest_level; - _CPU_IRQ_info.Disable_level = &_Thread_Dispatch_disable_level; - /* fill in _CPU_IRQ_info.Vector_table later */ -#if (PPC_ABI == PPC_ABI_POWEROPEN) - _CPU_IRQ_info.Dispatch_r2 = ((unsigned32 *)_Thread_Dispatch)[1]; -#endif - _CPU_IRQ_info.Switch_necessary = &_Context_Switch_necessary; - _CPU_IRQ_info.Signal = &_ISR_Signals_to_thread_executing; - -#if (PPC_USE_SPRG) - i = (int)&_CPU_IRQ_info; - asm volatile("mtspr 0x113, %0" : "=r" (i) : "0" (i)); /* SPRG 3 */ -#endif - - /* - * Store Msr Value in the IRQ info structure. - */ - _CPU_MSR_Value(_CPU_IRQ_info.msr_initial); - -#if (PPC_USE_SPRG) - i = _CPU_IRQ_info.msr_initial; - asm volatile("mtspr 0x112, %0" : "=r" (i) : "0" (i)); /* SPRG 2 */ -#endif - - _CPU_Table = *cpu_table; -} - -/* - * _CPU_Initialize_vectors() - * - * Support routine to initialize the RTEMS vector table after it is allocated. - * - * PowerPC Specific Information: - * - * Complete initialization since the table is now allocated. - */ - -void _CPU_Initialize_vectors(void) -{ - int i; - proc_ptr handler = (proc_ptr)ppc_spurious; - - _CPU_IRQ_info.Vector_table = _ISR_Vector_table; - - if ( _CPU_Table.spurious_handler ) - handler = (proc_ptr)_CPU_Table.spurious_handler; - - for (i = 0; i < PPC_INTERRUPT_MAX; i++) - _ISR_Vector_table[i] = handler; - -} - -/*PAGE - * - * _CPU_ISR_Calculate_level - * - * The PowerPC puts its interrupt enable status in the MSR register - * which also contains things like endianness control. To be more - * awkward, the layout varies from processor to processor. This - * is why it was necessary to adopt a scheme which allowed the user - * to specify specifically which interrupt sources were enabled. - */ - -unsigned32 _CPU_ISR_Calculate_level( - unsigned32 new_level -) -{ - register unsigned32 new_msr = 0; - - /* - * Set the critical interrupt enable bit - */ - -#if (PPC_HAS_RFCI) - if ( !(new_level & PPC_INTERRUPT_LEVEL_CE) ) - new_msr |= PPC_MSR_CE; -#endif - - if ( !(new_level & PPC_INTERRUPT_LEVEL_ME) ) - new_msr |= PPC_MSR_ME; - - if ( !(new_level & PPC_INTERRUPT_LEVEL_EE) ) - new_msr |= PPC_MSR_EE; - - return new_msr; -} - -/*PAGE - * - * _CPU_ISR_Set_level - * - * This routine sets the requested level in the MSR. - */ - -void _CPU_ISR_Set_level( - unsigned32 new_level -) -{ - register unsigned32 tmp = 0; - register unsigned32 new_msr; - - new_msr = _CPU_ISR_Calculate_level( new_level ); - - asm volatile ( - "mfmsr %0; andc %0,%0,%1; and %2, %2, %1; or %0, %0, %2; mtmsr %0" : - "=&r" ((tmp)) : - "r" ((PPC_MSR_DISABLE_MASK)), "r" ((new_msr)), "0" ((tmp)) - ); -} - -/*PAGE - * - * _CPU_ISR_Get_level - * - * This routine gets the current interrupt level from the MSR and - * converts it to an RTEMS interrupt level. - */ - -unsigned32 _CPU_ISR_Get_level( void ) -{ - unsigned32 level = 0; - unsigned32 msr; - - asm volatile("mfmsr %0" : "=r" ((msr))); - - msr &= PPC_MSR_DISABLE_MASK; - - /* - * Set the critical interrupt enable bit - */ - -#if (PPC_HAS_RFCI) - if ( !(msr & PPC_MSR_CE) ) - level |= PPC_INTERRUPT_LEVEL_CE; -#endif - - if ( !(msr & PPC_MSR_ME) ) - level |= PPC_INTERRUPT_LEVEL_ME; - - if ( !(msr & PPC_MSR_EE) ) - level |= PPC_INTERRUPT_LEVEL_EE; - - return level; -} - -/*PAGE - * - * _CPU_Context_Initialize - */ - -#if (PPC_ABI == PPC_ABI_POWEROPEN) -#define CPU_MINIMUM_STACK_FRAME_SIZE 56 -#else /* PPC_ABI_SVR4 or PPC_ABI_EABI */ -#define CPU_MINIMUM_STACK_FRAME_SIZE 8 -#endif - -void _CPU_Context_Initialize( - Context_Control *the_context, - unsigned32 *stack_base, - unsigned32 size, - unsigned32 new_level, - void *entry_point, - boolean is_fp -) -{ - unsigned32 msr_value; - unsigned32 sp; - - sp = (unsigned32)stack_base + size - CPU_MINIMUM_STACK_FRAME_SIZE; - *((unsigned32 *)sp) = 0; - the_context->gpr1 = sp; - - the_context->msr = _CPU_ISR_Calculate_level( new_level ); - - /* - * The FP bit of the MSR should only be enabled if this is a floating - * point task. Unfortunately, the vfprintf_r routine in newlib - * ends up pushing a floating point register regardless of whether or - * not a floating point number is being printed. Serious restructuring - * of vfprintf.c will be required to avoid this behavior. At this - * time (7 July 1997), this restructuring is not being done. - */ - - /*if ( is_fp ) */ - the_context->msr |= PPC_MSR_FP; - - /* - * Calculate the task's MSR value: - * - * + Set the exception prefix bit to point to the exception table - * + Force the RI bit - * + Use the DR and IR bits - */ - _CPU_MSR_Value( msr_value ); - the_context->msr |= (msr_value & PPC_MSR_EP); - the_context->msr |= PPC_MSR_RI; - the_context->msr |= msr_value & (PPC_MSR_DR|PPC_MSR_IR); - -#if (PPC_ABI == PPC_ABI_POWEROPEN) - { unsigned32 *desc = (unsigned32 *)entry_point; - - the_context->pc = desc[0]; - the_context->gpr2 = desc[1]; - } -#endif - -#if (PPC_ABI == PPC_ABI_SVR4) - { unsigned r13 = 0; - asm volatile ("mr %0, 13" : "=r" ((r13))); - - the_context->pc = (unsigned32)entry_point; - the_context->gpr13 = r13; - } -#endif - -#if (PPC_ABI == PPC_ABI_EABI) - { unsigned32 r2 = 0; - unsigned r13 = 0; - asm volatile ("mr %0,2; mr %1,13" : "=r" ((r2)), "=r" ((r13))); - - the_context->pc = (unsigned32)entry_point; - the_context->gpr2 = r2; - the_context->gpr13 = r13; - } -#endif -} - - -/* _CPU_ISR_install_vector - * - * This kernel routine installs the RTEMS handler for the - * specified vector. - * - * Input parameters: - * vector - interrupt vector number - * old_handler - former ISR for this vector number - * new_handler - replacement ISR for this vector number - * - * Output parameters: NONE - * - */ - -void _CPU_ISR_install_vector( - unsigned32 vector, - proc_ptr new_handler, - proc_ptr *old_handler -) -{ - proc_ptr ignored; - *old_handler = _ISR_Vector_table[ vector ]; - - /* - * If the interrupt vector table is a table of pointer to isr entry - * points, then we need to install the appropriate RTEMS interrupt - * handler for this vector number. - */ - - /* - * Install the wrapper so this ISR can be invoked properly. - */ - if (_CPU_Table.exceptions_in_RAM) - _CPU_ISR_install_raw_handler( vector, _ISR_Handler, &ignored ); - - /* - * We put the actual user ISR address in '_ISR_vector_table'. This will - * be used by the _ISR_Handler so the user gets control. - */ - - _ISR_Vector_table[ vector ] = new_handler ? (ISR_Handler_entry)new_handler : - _CPU_Table.spurious_handler ? - (ISR_Handler_entry)_CPU_Table.spurious_handler : - (ISR_Handler_entry)ppc_spurious; -} - -/*PAGE - * - * _CPU_Install_interrupt_stack - */ - -void _CPU_Install_interrupt_stack( void ) -{ -#if (PPC_ABI == PPC_ABI_POWEROPEN || PPC_ABI == PPC_ABI_GCC27) - _CPU_IRQ_info.Stack = _CPU_Interrupt_stack_high - 56; -#else - _CPU_IRQ_info.Stack = _CPU_Interrupt_stack_high - 8; -#endif -} - -/* Handle a spurious interrupt */ -static void ppc_spurious(int v, CPU_Interrupt_frame *i) -{ -#if 0 - printf("Spurious interrupt on vector %d from %08.8x\n", - v, i->pc); -#endif -#if defined(ppc403) || defined(ppc405) - if (v == PPC_IRQ_EXTERNAL) - { - register int r = 0; - - asm volatile("mtdcr 0x42, %0" : - "=&r" ((r)) : "0" ((r))); /* EXIER */ - } - else if (v == PPC_IRQ_PIT) - { - register int r = 0x08000000; - - asm volatile("mtspr 0x3d8, %0" : - "=&r" ((r)) : "0" ((r))); /* TSR */ - } - else if (v == PPC_IRQ_FIT) - { - register int r = 0x04000000; - - asm volatile("mtspr 0x3d8, %0" : - "=&r" ((r)) : "0" ((r))); /* TSR */ - } -#endif - ++_CPU_spurious_count; - _CPU_last_spurious = v; -} - -void _CPU_Fatal_error(unsigned32 _error) -{ - asm volatile ("mr 3, %0" : : "r" ((_error))); - asm volatile ("tweq 5,5"); - asm volatile ("li 0,0; mtmsr 0"); - while (1) ; -} - -#define PPC_SYNCHRONOUS_TRAP_BIT_MASK 0x100 -#define PPC_ASYNCHRONOUS_TRAP( _trap ) (_trap) -#define PPC_SYNCHRONOUS_TRAP ( _trap ) ((_trap)+PPC_SYNCHRONOUS_TRAP_BIT_MASK) -#define PPC_REAL_TRAP_NUMBER ( _trap ) ((_trap)%PPC_SYNCHRONOUS_TRAP_BIT_MASK) - - -const CPU_Trap_table_entry _CPU_Trap_slot_template = { - -#if (PPC_ABI == PPC_ABI_POWEROPEN || PPC_ABI == PPC_ABI_GCC27) -#error " Vector install not tested." -#if (PPC_HAS_FPU) -#error " Vector install not tested." - 0x9421feb0, /* stwu r1, -(20*4 + 18*8 + IP_END)(r1) */ -#else -#error " Vector install not tested." - 0x9421ff40, /* stwu r1, -(20*4 + IP_END)(r1) */ -#endif -#else - 0x9421ff90, /* stwu r1, -(IP_END)(r1) */ -#endif - - 0x90010008, /* stw %r0, IP_0(%r1) */ - 0x38000000, /* li %r0, PPC_IRQ */ - 0x48000002 /* ba PROC (_ISR_Handler) */ -}; - -#if defined(mpc860) || defined(mpc821) -const CPU_Trap_table_entry _CPU_Trap_slot_template_m860 = { - 0x7c0803ac, /* mtlr %r0 */ - 0x81210028, /* lwz %r9, IP_9(%r1) */ - 0x38000000, /* li %r0, PPC_IRQ */ - 0x48000002 /* b PROC (_ISR_Handler) */ -}; -#endif /* mpc860 */ - -unsigned32 ppc_exception_vector_addr( - unsigned32 vector -); - - -/*PAGE - * - * _CPU_ISR_install_raw_handler - * - * This routine installs the specified handler as a "raw" non-executive - * supported trap handler (a.k.a. interrupt service routine). - * - * Input Parameters: - * vector - trap table entry number plus synchronous - * vs. asynchronous information - * new_handler - address of the handler to be installed - * old_handler - pointer to an address of the handler previously installed - * - * Output Parameters: NONE - * *new_handler - address of the handler previously installed - * - * NOTE: - * - * This routine is based on the SPARC routine _CPU_ISR_install_raw_handler. - * Install a software trap handler as an executive interrupt handler - * (which is desirable since RTEMS takes care of window and register issues), - * then the executive needs to know that the return address is to the trap - * rather than the instruction following the trap. - * - */ - -void _CPU_ISR_install_raw_handler( - unsigned32 vector, - proc_ptr new_handler, - proc_ptr *old_handler -) -{ - unsigned32 real_vector; - CPU_Trap_table_entry *slot; - unsigned32 u32_handler=0; - - /* - * Get the "real" trap number for this vector ignoring the synchronous - * versus asynchronous indicator included with our vector numbers. - */ - - real_vector = vector; - - /* - * Get the current base address of the trap table and calculate a pointer - * to the slot we are interested in. - */ - slot = (CPU_Trap_table_entry *)ppc_exception_vector_addr( real_vector ); - - /* - * Get the address of the old_handler from the trap table. - * - * NOTE: The old_handler returned will be bogus if it does not follow - * the RTEMS model. - */ - -#define HIGH_BITS_MASK 0xFFFFFC00 -#define HIGH_BITS_SHIFT 10 -#define LOW_BITS_MASK 0x000003FF - - if (slot->stwu_r1 == _CPU_Trap_slot_template.stwu_r1) { - /* - * Set u32_handler = to target address - */ - u32_handler = slot->b_Handler & 0x03fffffc; - - /* IMD FIX: sign extend address fragment... */ - if (u32_handler & 0x02000000) { - u32_handler |= 0xfc000000; - } - - *old_handler = (proc_ptr) u32_handler; - } else -/* There are two kinds of handlers for the MPC860. One is the 'standard' - * one like above. The other is for the cascaded interrupts from the SIU - * and CPM. Therefore we must check for the alternate one if the standard - * one is not present - */ -#if defined(mpc860) || defined(mpc821) - if (slot->stwu_r1 == _CPU_Trap_slot_template_m860.stwu_r1) { - /* - * Set u32_handler = to target address - */ - u32_handler = slot->b_Handler & 0x03fffffc; - *old_handler = (proc_ptr) u32_handler; - } else -#endif /* mpc860 */ - - *old_handler = 0; - - /* - * Copy the template to the slot and then fix it. - */ -#if defined(mpc860) || defined(mpc821) - if (vector >= PPC_IRQ_IRQ0) - *slot = _CPU_Trap_slot_template_m860; - else -#endif /* mpc860 */ - *slot = _CPU_Trap_slot_template; - - u32_handler = (unsigned32) new_handler; - - /* - * IMD FIX: insert address fragment only (bits 6..29) - * therefore check for proper address range - * and remove unwanted bits - */ - if ((u32_handler & 0xfc000000) == 0xfc000000) { - u32_handler &= ~0xfc000000; - } - else if ((u32_handler & 0xfc000000) != 0x00000000) { - _Internal_error_Occurred(INTERNAL_ERROR_CORE, - TRUE, - u32_handler); - } - - slot->b_Handler |= u32_handler; - - slot->li_r0_IRQ |= vector; - - _CPU_Data_Cache_Block_Flush( slot ); -} - -unsigned32 ppc_exception_vector_addr( - unsigned32 vector -) -{ -#if (!PPC_HAS_EVPR) - unsigned32 Msr; -#endif - unsigned32 Top = 0; - unsigned32 Offset = 0x000; - -#if (PPC_HAS_EXCEPTION_PREFIX) - _CPU_MSR_Value ( Msr ); - if ( ( Msr & PPC_MSR_EP) != 0 ) /* Vectors at FFFx_xxxx */ - Top = 0xfff00000; -#elif (PPC_HAS_EVPR) - asm volatile( "mfspr %0,0x3d6" : "=r" (Top)); /* EVPR */ - Top = Top & 0xffff0000; -#endif - - switch ( vector ) { - case PPC_IRQ_SYSTEM_RESET: /* on 40x aka PPC_IRQ_CRIT */ - Offset = 0x00100; - break; - case PPC_IRQ_MCHECK: - Offset = 0x00200; - break; - case PPC_IRQ_PROTECT: - Offset = 0x00300; - break; - case PPC_IRQ_ISI: - Offset = 0x00400; - break; - case PPC_IRQ_EXTERNAL: - Offset = 0x00500; - break; - case PPC_IRQ_ALIGNMENT: - Offset = 0x00600; - break; - case PPC_IRQ_PROGRAM: - Offset = 0x00700; - break; - case PPC_IRQ_NOFP: - Offset = 0x00800; - break; - case PPC_IRQ_DECREMENTER: - Offset = 0x00900; - break; - case PPC_IRQ_RESERVED_A: - Offset = 0x00a00; - break; - case PPC_IRQ_RESERVED_B: - Offset = 0x00b00; - break; - case PPC_IRQ_SCALL: - Offset = 0x00c00; - break; - case PPC_IRQ_TRACE: - Offset = 0x00d00; - break; - case PPC_IRQ_FP_ASST: - Offset = 0x00e00; - break; - -#if defined(ppc403) || defined(ppc405) - -/* PPC_IRQ_CRIT is the same vector as PPC_IRQ_RESET - case PPC_IRQ_CRIT: - Offset = 0x00100; - break; -*/ - case PPC_IRQ_PIT: - Offset = 0x01000; - break; - case PPC_IRQ_FIT: - Offset = 0x01010; - break; - case PPC_IRQ_WATCHDOG: - Offset = 0x01020; - break; - case PPC_IRQ_DEBUG: - Offset = 0x02000; - break; - -#elif defined(ppc601) - case PPC_IRQ_TRACE: - Offset = 0x02000; - break; - -#elif defined(ppc603) - case PPC_IRQ_TRANS_MISS: - Offset = 0x1000; - break; - case PPC_IRQ_DATA_LOAD: - Offset = 0x1100; - break; - case PPC_IRQ_DATA_STORE: - Offset = 0x1200; - break; - case PPC_IRQ_ADDR_BRK: - Offset = 0x1300; - break; - case PPC_IRQ_SYS_MGT: - Offset = 0x1400; - break; - -#elif defined(ppc603e) - case PPC_TLB_INST_MISS: - Offset = 0x1000; - break; - case PPC_TLB_LOAD_MISS: - Offset = 0x1100; - break; - case PPC_TLB_STORE_MISS: - Offset = 0x1200; - break; - case PPC_IRQ_ADDRBRK: - Offset = 0x1300; - break; - case PPC_IRQ_SYS_MGT: - Offset = 0x1400; - break; - -#elif defined(mpc604) - case PPC_IRQ_ADDR_BRK: - Offset = 0x1300; - break; - case PPC_IRQ_SYS_MGT: - Offset = 0x1400; - break; - -#elif defined(mpc860) || defined(mpc821) - case PPC_IRQ_EMULATE: - Offset = 0x1000; - break; - case PPC_IRQ_INST_MISS: - Offset = 0x1100; - break; - case PPC_IRQ_DATA_MISS: - Offset = 0x1200; - break; - case PPC_IRQ_INST_ERR: - Offset = 0x1300; - break; - case PPC_IRQ_DATA_ERR: - Offset = 0x1400; - break; - case PPC_IRQ_DATA_BPNT: - Offset = 0x1c00; - break; - case PPC_IRQ_INST_BPNT: - Offset = 0x1d00; - break; - case PPC_IRQ_IO_BPNT: - Offset = 0x1e00; - break; - case PPC_IRQ_DEV_PORT: - Offset = 0x1f00; - break; - case PPC_IRQ_IRQ0: - Offset = 0x2000; - break; - case PPC_IRQ_LVL0: - Offset = 0x2040; - break; - case PPC_IRQ_IRQ1: - Offset = 0x2080; - break; - case PPC_IRQ_LVL1: - Offset = 0x20c0; - break; - case PPC_IRQ_IRQ2: - Offset = 0x2100; - break; - case PPC_IRQ_LVL2: - Offset = 0x2140; - break; - case PPC_IRQ_IRQ3: - Offset = 0x2180; - break; - case PPC_IRQ_LVL3: - Offset = 0x21c0; - break; - case PPC_IRQ_IRQ4: - Offset = 0x2200; - break; - case PPC_IRQ_LVL4: - Offset = 0x2240; - break; - case PPC_IRQ_IRQ5: - Offset = 0x2280; - break; - case PPC_IRQ_LVL5: - Offset = 0x22c0; - break; - case PPC_IRQ_IRQ6: - Offset = 0x2300; - break; - case PPC_IRQ_LVL6: - Offset = 0x2340; - break; - case PPC_IRQ_IRQ7: - Offset = 0x2380; - break; - case PPC_IRQ_LVL7: - Offset = 0x23c0; - break; - case PPC_IRQ_CPM_ERROR: - Offset = 0x2400; - break; - case PPC_IRQ_CPM_PC4: - Offset = 0x2410; - break; - case PPC_IRQ_CPM_PC5: - Offset = 0x2420; - break; - case PPC_IRQ_CPM_SMC2: - Offset = 0x2430; - break; - case PPC_IRQ_CPM_SMC1: - Offset = 0x2440; - break; - case PPC_IRQ_CPM_SPI: - Offset = 0x2450; - break; - case PPC_IRQ_CPM_PC6: - Offset = 0x2460; - break; - case PPC_IRQ_CPM_TIMER4: - Offset = 0x2470; - break; - case PPC_IRQ_CPM_RESERVED_8: - Offset = 0x2480; - break; - case PPC_IRQ_CPM_PC7: - Offset = 0x2490; - break; - case PPC_IRQ_CPM_PC8: - Offset = 0x24a0; - break; - case PPC_IRQ_CPM_PC9: - Offset = 0x24b0; - break; - case PPC_IRQ_CPM_TIMER3: - Offset = 0x24c0; - break; - case PPC_IRQ_CPM_RESERVED_D: - Offset = 0x24d0; - break; - case PPC_IRQ_CPM_PC10: - Offset = 0x24e0; - break; - case PPC_IRQ_CPM_PC11: - Offset = 0x24f0; - break; - case PPC_IRQ_CPM_I2C: - Offset = 0x2500; - break; - case PPC_IRQ_CPM_RISC_TIMER: - Offset = 0x2510; - break; - case PPC_IRQ_CPM_TIMER2: - Offset = 0x2520; - break; - case PPC_IRQ_CPM_RESERVED_13: - Offset = 0x2530; - break; - case PPC_IRQ_CPM_IDMA2: - Offset = 0x2540; - break; - case PPC_IRQ_CPM_IDMA1: - Offset = 0x2550; - break; - case PPC_IRQ_CPM_SDMA_ERROR: - Offset = 0x2560; - break; - case PPC_IRQ_CPM_PC12: - Offset = 0x2570; - break; - case PPC_IRQ_CPM_PC13: - Offset = 0x2580; - break; - case PPC_IRQ_CPM_TIMER1: - Offset = 0x2590; - break; - case PPC_IRQ_CPM_PC14: - Offset = 0x25a0; - break; - case PPC_IRQ_CPM_SCC4: - Offset = 0x25b0; - break; - case PPC_IRQ_CPM_SCC3: - Offset = 0x25c0; - break; - case PPC_IRQ_CPM_SCC2: - Offset = 0x25d0; - break; - case PPC_IRQ_CPM_SCC1: - Offset = 0x25e0; - break; - case PPC_IRQ_CPM_PC15: - Offset = 0x25f0; - break; -#endif - - } - Top += Offset; - return Top; -} - -/*PAGE - * - * This is the PowerPC specific implementation of the routine which - * returns TRUE if an interrupt is in progress. - * - * NOTE: This is the same as the generic version. But since the - * PowerPC is still supporting old and new exception processing - * models and the new exception processing model has a hardware - * way of doing this, we have to provide this capability here - * for symmetry. - */ - -boolean _ISR_Is_in_progress( void ) -{ - return (_ISR_Nest_level != 0); -} diff --git a/c/src/lib/libcpu/powerpc/old-exceptions/cpu_asm.S b/c/src/lib/libcpu/powerpc/old-exceptions/cpu_asm.S deleted file mode 100644 index b21e9d81ba..0000000000 --- a/c/src/lib/libcpu/powerpc/old-exceptions/cpu_asm.S +++ /dev/null @@ -1,653 +0,0 @@ - -/* cpu_asm.s 1.1 - 95/12/04 - * - * This file contains the assembly code for the PowerPC implementation - * of RTEMS. - * - * Author: Andrew Bray - * - * COPYRIGHT (c) 1995 by i-cubed ltd. - * - * 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 i-cubed limited not be used in - * advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * i-cubed limited makes no representations about the suitability - * of this software for any purpose. - * - * Derived from c/src/exec/cpu/no_cpu/cpu_asm.c: - * - * COPYRIGHT (c) 1989-1997. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may in - * the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -/* - * FIXME: This file is bsp-dependent. - */ -#include - -#include -#include - - BEGIN_CODE -/* - * _CPU_Context_save_fp_context - * - * This routine is responsible for saving the FP context - * at *fp_context_ptr. If the point to load the FP context - * from is changed then the pointer is modified by this routine. - * - * Sometimes a macro implementation of this is in cpu.h which dereferences - * the ** and a similarly named routine in this file is passed something - * like a (Context_Control_fp *). The general rule on making this decision - * is to avoid writing assembly language. - */ - - ALIGN (PPC_CACHE_ALIGNMENT, PPC_CACHE_ALIGN_POWER) - PUBLIC_PROC (_CPU_Context_save_fp) -PROC (_CPU_Context_save_fp): -#if (PPC_HAS_FPU == 1) - lwz r3, 0(r3) -#if (PPC_HAS_DOUBLE == 1) - stfd f0, FP_0(r3) - stfd f1, FP_1(r3) - stfd f2, FP_2(r3) - stfd f3, FP_3(r3) - stfd f4, FP_4(r3) - stfd f5, FP_5(r3) - stfd f6, FP_6(r3) - stfd f7, FP_7(r3) - stfd f8, FP_8(r3) - stfd f9, FP_9(r3) - stfd f10, FP_10(r3) - stfd f11, FP_11(r3) - stfd f12, FP_12(r3) - stfd f13, FP_13(r3) - stfd f14, FP_14(r3) - stfd f15, FP_15(r3) - stfd f16, FP_16(r3) - stfd f17, FP_17(r3) - stfd f18, FP_18(r3) - stfd f19, FP_19(r3) - stfd f20, FP_20(r3) - stfd f21, FP_21(r3) - stfd f22, FP_22(r3) - stfd f23, FP_23(r3) - stfd f24, FP_24(r3) - stfd f25, FP_25(r3) - stfd f26, FP_26(r3) - stfd f27, FP_27(r3) - stfd f28, FP_28(r3) - stfd f29, FP_29(r3) - stfd f30, FP_30(r3) - stfd f31, FP_31(r3) - mffs f2 - stfd f2, FP_FPSCR(r3) -#else - stfs f0, FP_0(r3) - stfs f1, FP_1(r3) - stfs f2, FP_2(r3) - stfs f3, FP_3(r3) - stfs f4, FP_4(r3) - stfs f5, FP_5(r3) - stfs f6, FP_6(r3) - stfs f7, FP_7(r3) - stfs f8, FP_8(r3) - stfs f9, FP_9(r3) - stfs f10, FP_10(r3) - stfs f11, FP_11(r3) - stfs f12, FP_12(r3) - stfs f13, FP_13(r3) - stfs f14, FP_14(r3) - stfs f15, FP_15(r3) - stfs f16, FP_16(r3) - stfs f17, FP_17(r3) - stfs f18, FP_18(r3) - stfs f19, FP_19(r3) - stfs f20, FP_20(r3) - stfs f21, FP_21(r3) - stfs f22, FP_22(r3) - stfs f23, FP_23(r3) - stfs f24, FP_24(r3) - stfs f25, FP_25(r3) - stfs f26, FP_26(r3) - stfs f27, FP_27(r3) - stfs f28, FP_28(r3) - stfs f29, FP_29(r3) - stfs f30, FP_30(r3) - stfs f31, FP_31(r3) - mffs f2 - stfs f2, FP_FPSCR(r3) -#endif -#endif - blr - -/* - * _CPU_Context_restore_fp_context - * - * This routine is responsible for restoring the FP context - * at *fp_context_ptr. If the point to load the FP context - * from is changed then the pointer is modified by this routine. - * - * Sometimes a macro implementation of this is in cpu.h which dereferences - * the ** and a similarly named routine in this file is passed something - * like a (Context_Control_fp *). The general rule on making this decision - * is to avoid writing assembly language. - */ - - ALIGN (PPC_CACHE_ALIGNMENT, PPC_CACHE_ALIGN_POWER) - PUBLIC_PROC (_CPU_Context_restore_fp) -PROC (_CPU_Context_restore_fp): -#if (PPC_HAS_FPU == 1) - lwz r3, 0(r3) -#if (PPC_HAS_DOUBLE == 1) - lfd f2, FP_FPSCR(r3) - mtfsf 255, f2 - lfd f0, FP_0(r3) - lfd f1, FP_1(r3) - lfd f2, FP_2(r3) - lfd f3, FP_3(r3) - lfd f4, FP_4(r3) - lfd f5, FP_5(r3) - lfd f6, FP_6(r3) - lfd f7, FP_7(r3) - lfd f8, FP_8(r3) - lfd f9, FP_9(r3) - lfd f10, FP_10(r3) - lfd f11, FP_11(r3) - lfd f12, FP_12(r3) - lfd f13, FP_13(r3) - lfd f14, FP_14(r3) - lfd f15, FP_15(r3) - lfd f16, FP_16(r3) - lfd f17, FP_17(r3) - lfd f18, FP_18(r3) - lfd f19, FP_19(r3) - lfd f20, FP_20(r3) - lfd f21, FP_21(r3) - lfd f22, FP_22(r3) - lfd f23, FP_23(r3) - lfd f24, FP_24(r3) - lfd f25, FP_25(r3) - lfd f26, FP_26(r3) - lfd f27, FP_27(r3) - lfd f28, FP_28(r3) - lfd f29, FP_29(r3) - lfd f30, FP_30(r3) - lfd f31, FP_31(r3) -#else - lfs f2, FP_FPSCR(r3) - mtfsf 255, f2 - lfs f0, FP_0(r3) - lfs f1, FP_1(r3) - lfs f2, FP_2(r3) - lfs f3, FP_3(r3) - lfs f4, FP_4(r3) - lfs f5, FP_5(r3) - lfs f6, FP_6(r3) - lfs f7, FP_7(r3) - lfs f8, FP_8(r3) - lfs f9, FP_9(r3) - lfs f10, FP_10(r3) - lfs f11, FP_11(r3) - lfs f12, FP_12(r3) - lfs f13, FP_13(r3) - lfs f14, FP_14(r3) - lfs f15, FP_15(r3) - lfs f16, FP_16(r3) - lfs f17, FP_17(r3) - lfs f18, FP_18(r3) - lfs f19, FP_19(r3) - lfs f20, FP_20(r3) - lfs f21, FP_21(r3) - lfs f22, FP_22(r3) - lfs f23, FP_23(r3) - lfs f24, FP_24(r3) - lfs f25, FP_25(r3) - lfs f26, FP_26(r3) - lfs f27, FP_27(r3) - lfs f28, FP_28(r3) - lfs f29, FP_29(r3) - lfs f30, FP_30(r3) - lfs f31, FP_31(r3) -#endif -#endif - blr - - -/* _CPU_Context_switch - * - * This routine performs a normal non-FP context switch. - */ - ALIGN (PPC_CACHE_ALIGNMENT, PPC_CACHE_ALIGN_POWER) - PUBLIC_PROC (_CPU_Context_switch) -PROC (_CPU_Context_switch): - sync - isync -#if (PPC_CACHE_ALIGNMENT == 4) /* No cache */ - stw r1, GP_1(r3) - lwz r1, GP_1(r4) - stw r2, GP_2(r3) - lwz r2, GP_2(r4) -#if (PPC_USE_MULTIPLE == 1) - stmw r13, GP_13(r3) - lmw r13, GP_13(r4) -#else - stw r13, GP_13(r3) - lwz r13, GP_13(r4) - stw r14, GP_14(r3) - lwz r14, GP_14(r4) - stw r15, GP_15(r3) - lwz r15, GP_15(r4) - stw r16, GP_16(r3) - lwz r16, GP_16(r4) - stw r17, GP_17(r3) - lwz r17, GP_17(r4) - stw r18, GP_18(r3) - lwz r18, GP_18(r4) - stw r19, GP_19(r3) - lwz r19, GP_19(r4) - stw r20, GP_20(r3) - lwz r20, GP_20(r4) - stw r21, GP_21(r3) - lwz r21, GP_21(r4) - stw r22, GP_22(r3) - lwz r22, GP_22(r4) - stw r23, GP_23(r3) - lwz r23, GP_23(r4) - stw r24, GP_24(r3) - lwz r24, GP_24(r4) - stw r25, GP_25(r3) - lwz r25, GP_25(r4) - stw r26, GP_26(r3) - lwz r26, GP_26(r4) - stw r27, GP_27(r3) - lwz r27, GP_27(r4) - stw r28, GP_28(r3) - lwz r28, GP_28(r4) - stw r29, GP_29(r3) - lwz r29, GP_29(r4) - stw r30, GP_30(r3) - lwz r30, GP_30(r4) - stw r31, GP_31(r3) - lwz r31, GP_31(r4) -#endif - mfcr r5 - stw r5, GP_CR(r3) - lwz r5, GP_CR(r4) - mflr r6 - mtcrf 255, r5 - stw r6, GP_PC(r3) - lwz r6, GP_PC(r4) - mfmsr r7 - mtlr r6 - stw r7, GP_MSR(r3) - lwz r7, GP_MSR(r4) - mtmsr r7 -#endif -#if (PPC_CACHE_ALIGNMENT == 16) - /* This assumes that all the registers are in the given order */ - li r5, 16 - addi r3,r3,-4 -#if ( PPC_USE_DATA_CACHE ) - dcbz r5, r3 -#endif - stw r1, GP_1+4(r3) - stw r2, GP_2+4(r3) -#if (PPC_USE_MULTIPLE == 1) - addi r3, r3, GP_14+4 -#if ( PPC_USE_DATA_CACHE ) - dcbz r5, r3 -#endif - - addi r3, r3, GP_18-GP_14 -#if ( PPC_USE_DATA_CACHE ) - dcbz r5, r3 -#endif - addi r3, r3, GP_22-GP_18 -#if ( PPC_USE_DATA_CACHE ) - dcbz r5, r3 -#endif - addi r3, r3, GP_26-GP_22 -#if ( PPC_USE_DATA_CACHE ) - dcbz r5, r3 -#endif - stmw r13, GP_13-GP_26(r3) -#else - stw r13, GP_13+4(r3) - stwu r14, GP_14+4(r3) -#if ( PPC_USE_DATA_CACHE ) - dcbz r5, r3 -#endif - stw r15, GP_15-GP_14(r3) - stw r16, GP_16-GP_14(r3) - stw r17, GP_17-GP_14(r3) - stwu r18, GP_18-GP_14(r3) -#if ( PPC_USE_DATA_CACHE ) - dcbz r5, r3 -#endif - stw r19, GP_19-GP_18(r3) - stw r20, GP_20-GP_18(r3) - stw r21, GP_21-GP_18(r3) - stwu r22, GP_22-GP_18(r3) -#if ( PPC_USE_DATA_CACHE ) - dcbz r5, r3 -#endif - stw r23, GP_23-GP_22(r3) - stw r24, GP_24-GP_22(r3) - stw r25, GP_25-GP_22(r3) - stwu r26, GP_26-GP_22(r3) -#if ( PPC_USE_DATA_CACHE ) - dcbz r5, r3 -#endif - stw r27, GP_27-GP_26(r3) - stw r28, GP_28-GP_26(r3) - stw r29, GP_29-GP_26(r3) - stw r30, GP_30-GP_26(r3) - stw r31, GP_31-GP_26(r3) -#endif -#if ( PPC_USE_DATA_CACHE ) - dcbt r0, r4 -#endif - mfcr r6 - stw r6, GP_CR-GP_26(r3) - mflr r7 - stw r7, GP_PC-GP_26(r3) - mfmsr r8 - stw r8, GP_MSR-GP_26(r3) - -#if ( PPC_USE_DATA_CACHE ) - dcbt r5, r4 -#endif - lwz r1, GP_1(r4) - lwz r2, GP_2(r4) -#if (PPC_USE_MULTIPLE == 1) - addi r4, r4, GP_15 -#if ( PPC_USE_DATA_CACHE ) - dcbt r5, r4 -#endif - addi r4, r4, GP_19-GP_15 -#if ( PPC_USE_DATA_CACHE ) - dcbt r5, r4 -#endif - addi r4, r4, GP_23-GP_19 -#if ( PPC_USE_DATA_CACHE ) - dcbt r5, r4 -#endif - addi r4, r4, GP_27-GP_23 -#if ( PPC_USE_DATA_CACHE ) - dcbt r5, r4 -#endif - lmw r13, GP_13-GP_27(r4) -#else - lwz r13, GP_13(r4) - lwz r14, GP_14(r4) - lwzu r15, GP_15(r4) -#if ( PPC_USE_DATA_CACHE ) - dcbt r5, r4 -#endif - lwz r16, GP_16-GP_15(r4) - lwz r17, GP_17-GP_15(r4) - lwz r18, GP_18-GP_15(r4) - lwzu r19, GP_19-GP_15(r4) -#if ( PPC_USE_DATA_CACHE ) - dcbt r5, r4 -#endif - lwz r20, GP_20-GP_19(r4) - lwz r21, GP_21-GP_19(r4) - lwz r22, GP_22-GP_19(r4) - lwzu r23, GP_23-GP_19(r4) -#if ( PPC_USE_DATA_CACHE ) - dcbt r5, r4 -#endif - lwz r24, GP_24-GP_23(r4) - lwz r25, GP_25-GP_23(r4) - lwz r26, GP_26-GP_23(r4) - lwzu r27, GP_27-GP_23(r4) -#if ( PPC_USE_DATA_CACHE ) - dcbt r5, r4 -#endif - lwz r28, GP_28-GP_27(r4) - lwz r29, GP_29-GP_27(r4) - lwz r30, GP_30-GP_27(r4) - lwz r31, GP_31-GP_27(r4) -#endif - lwz r6, GP_CR-GP_27(r4) - lwz r7, GP_PC-GP_27(r4) - lwz r8, GP_MSR-GP_27(r4) - mtcrf 255, r6 - mtlr r7 - mtmsr r8 -#endif -#if (PPC_CACHE_ALIGNMENT == 32) - /* This assumes that all the registers are in the given order */ - li r5, 32 - addi r3,r3,-4 -#if ( PPC_USE_DATA_CACHE ) - dcbz r5, r3 -#endif - stw r1, GP_1+4(r3) - stw r2, GP_2+4(r3) -#if (PPC_USE_MULTIPLE == 1) - addi r3, r3, GP_18+4 -#if ( PPC_USE_DATA_CACHE ) - dcbz r5, r3 -#endif - stmw r13, GP_13-GP_18(r3) -#else - stw r13, GP_13+4(r3) - stw r14, GP_14+4(r3) - stw r15, GP_15+4(r3) - stw r16, GP_16+4(r3) - stw r17, GP_17+4(r3) - stwu r18, GP_18+4(r3) -#if ( PPC_USE_DATA_CACHE ) - dcbz r5, r3 -#endif - stw r19, GP_19-GP_18(r3) - stw r20, GP_20-GP_18(r3) - stw r21, GP_21-GP_18(r3) - stw r22, GP_22-GP_18(r3) - stw r23, GP_23-GP_18(r3) - stw r24, GP_24-GP_18(r3) - stw r25, GP_25-GP_18(r3) - stw r26, GP_26-GP_18(r3) - stw r27, GP_27-GP_18(r3) - stw r28, GP_28-GP_18(r3) - stw r29, GP_29-GP_18(r3) - stw r30, GP_30-GP_18(r3) - stw r31, GP_31-GP_18(r3) -#endif -#if ( PPC_USE_DATA_CACHE ) - dcbt r0, r4 -#endif - mfcr r6 - stw r6, GP_CR-GP_18(r3) - mflr r7 - stw r7, GP_PC-GP_18(r3) - mfmsr r8 - stw r8, GP_MSR-GP_18(r3) - -#if ( PPC_USE_DATA_CACHE ) - dcbt r5, r4 -#endif - lwz r1, GP_1(r4) - lwz r2, GP_2(r4) -#if (PPC_USE_MULTIPLE == 1) - addi r4, r4, GP_19 -#if ( PPC_USE_DATA_CACHE ) - dcbt r5, r4 -#endif - lmw r13, GP_13-GP_19(r4) -#else - lwz r13, GP_13(r4) - lwz r14, GP_14(r4) - lwz r15, GP_15(r4) - lwz r16, GP_16(r4) - lwz r17, GP_17(r4) - lwz r18, GP_18(r4) - lwzu r19, GP_19(r4) -#if ( PPC_USE_DATA_CACHE ) - dcbt r5, r4 -#endif - lwz r20, GP_20-GP_19(r4) - lwz r21, GP_21-GP_19(r4) - lwz r22, GP_22-GP_19(r4) - lwz r23, GP_23-GP_19(r4) - lwz r24, GP_24-GP_19(r4) - lwz r25, GP_25-GP_19(r4) - lwz r26, GP_26-GP_19(r4) - lwz r27, GP_27-GP_19(r4) - lwz r28, GP_28-GP_19(r4) - lwz r29, GP_29-GP_19(r4) - lwz r30, GP_30-GP_19(r4) - lwz r31, GP_31-GP_19(r4) -#endif - lwz r6, GP_CR-GP_19(r4) - lwz r7, GP_PC-GP_19(r4) - lwz r8, GP_MSR-GP_19(r4) - mtcrf 255, r6 - mtlr r7 - mtmsr r8 -#endif - blr - -/* - * _CPU_Context_restore - * - * This routine is generallu used only to restart self in an - * efficient manner. It may simply be a label in _CPU_Context_switch. - * - * NOTE: May be unnecessary to reload some registers. - */ -/* - * ACB: Don't worry about cache optimisation here - this is not THAT critical. - */ - ALIGN (PPC_CACHE_ALIGNMENT, PPC_CACHE_ALIGN_POWER) - PUBLIC_PROC (_CPU_Context_restore) -PROC (_CPU_Context_restore): - lwz r5, GP_CR(r3) - lwz r6, GP_PC(r3) - lwz r7, GP_MSR(r3) - mtcrf 255, r5 - mtlr r6 - mtmsr r7 - lwz r1, GP_1(r3) - lwz r2, GP_2(r3) -#if (PPC_USE_MULTIPLE == 1) - lmw r13, GP_13(r3) -#else - lwz r13, GP_13(r3) - lwz r14, GP_14(r3) - lwz r15, GP_15(r3) - lwz r16, GP_16(r3) - lwz r17, GP_17(r3) - lwz r18, GP_18(r3) - lwz r19, GP_19(r3) - lwz r20, GP_20(r3) - lwz r21, GP_21(r3) - lwz r22, GP_22(r3) - lwz r23, GP_23(r3) - lwz r24, GP_24(r3) - lwz r25, GP_25(r3) - lwz r26, GP_26(r3) - lwz r27, GP_27(r3) - lwz r28, GP_28(r3) - lwz r29, GP_29(r3) - lwz r30, GP_30(r3) - lwz r31, GP_31(r3) -#endif - - blr - -/* Individual interrupt prologues look like this: - * #if (PPC_ABI == PPC_ABI_POWEROPEN || PPC_ABI == PPC_ABI_GCC27) - * #if (PPC_HAS_FPU) - * stwu r1, -(20*4 + 18*8 + IP_END)(r1) - * #else - * stwu r1, -(20*4 + IP_END)(r1) - * #endif - * #else - * stwu r1, -(IP_END)(r1) - * #endif - * stw r0, IP_0(r1) - * - * li r0, vectornum - * b PROC (_ISR_Handler{,C}) - */ - -/* void __ISR_Handler() - * - * This routine provides the RTEMS interrupt management. - * The vector number is in r0. R0 has already been stacked. - * - */ - ALIGN (PPC_CACHE_ALIGNMENT, PPC_CACHE_ALIGN_POWER) - PUBLIC_PROC (_ISR_Handler) -PROC (_ISR_Handler): -#define LABEL(x) x -/* XXX ?? -#define MTSAVE(x) mtspr sprg0, x -#define MFSAVE(x) mfspr x, sprg0 -*/ -#define MTPC(x) mtspr srr0, x -#define MFPC(x) mfspr x, srr0 -#define MTMSR(x) mtspr srr1, x -#define MFMSR(x) mfspr x, srr1 - - #include "irq_stub.S" - rfi - -#if (PPC_HAS_RFCI == 1) -/* void __ISR_HandlerC() - * - * This routine provides the RTEMS interrupt management. - * For critical interrupts - * - */ - ALIGN (PPC_CACHE_ALIGNMENT, PPC_CACHE_ALIGN_POWER) - PUBLIC_PROC (_ISR_HandlerC) -PROC (_ISR_HandlerC): -#undef LABEL -#undef MTSAVE -#undef MFSAVE -#undef MTPC -#undef MFPC -#undef MTMSR -#undef MFMSR -#define LABEL(x) x##_C -/* XXX?? -#define MTSAVE(x) mtspr sprg1, x -#define MFSAVE(x) mfspr x, sprg1 -*/ -#define MTPC(x) mtspr srr2, x -#define MFPC(x) mfspr x, srr2 -#define MTMSR(x) mtspr srr3, x -#define MFMSR(x) mfspr x, srr3 - #include "irq_stub.S" - rfci -#endif - -/* PowerOpen descriptors for indirect function calls. - */ - -#if (PPC_ABI == PPC_ABI_POWEROPEN) - DESCRIPTOR (_CPU_Context_save_fp) - DESCRIPTOR (_CPU_Context_restore_fp) - DESCRIPTOR (_CPU_Context_switch) - DESCRIPTOR (_CPU_Context_restore) - DESCRIPTOR (_ISR_Handler) -#if (PPC_HAS_RFCI == 1) - DESCRIPTOR (_ISR_HandlerC) -#endif -#endif diff --git a/c/src/lib/libcpu/powerpc/old-exceptions/irq_stub.S b/c/src/lib/libcpu/powerpc/old-exceptions/irq_stub.S deleted file mode 100644 index 71c6332a41..0000000000 --- a/c/src/lib/libcpu/powerpc/old-exceptions/irq_stub.S +++ /dev/null @@ -1,275 +0,0 @@ -/* - * This file contains the interrupt handler assembly code for the PowerPC - * implementation of RTEMS. It is #included from cpu_asm.s. - * - * Author: Andrew Bray - * - * COPYRIGHT (c) 1995 by i-cubed ltd. - * - * 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 i-cubed limited not be used in - * advertising or publicity pertaining to distribution of the - * software without specific, written prior permission. - * i-cubed limited makes no representations about the suitability - * of this software for any purpose. - * - * $Id$ - */ - -/* - * FIXME: this file is bsp dependent. - */ -#include - -/* void __ISR_Handler() - * - * This routine provides the RTEMS interrupt management. - * The vector number is in r0. R0 has already been stacked. - * - */ - PUBLIC_VAR (_CPU_IRQ_info ) - - /* Finish off the interrupt frame */ - stw r2, IP_2(r1) - stw r3, IP_3(r1) - stw r4, IP_4(r1) - stw r5, IP_5(r1) - stw r6, IP_6(r1) - stw r7, IP_7(r1) - stw r8, IP_8(r1) - stw r9, IP_9(r1) - stw r10, IP_10(r1) - stw r11, IP_11(r1) - stw r12, IP_12(r1) - stw r13, IP_13(r1) - stmw r28, IP_28(r1) - mfcr r5 - mfctr r6 - mfxer r7 - mflr r8 - MFPC (r9) - MFMSR (r10) - /* Establish addressing */ -#if (PPC_USE_SPRG) - mfspr r11, sprg3 -#else - lis r11,_CPU_IRQ_info@ha - addi r11,r11,_CPU_IRQ_info@l -#endif -#if ( PPC_USE_DATA_CACHE ) - dcbt r0, r11 -#endif - stw r5, IP_CR(r1) - stw r6, IP_CTR(r1) - stw r7, IP_XER(r1) - stw r8, IP_LR(r1) - stw r9, IP_PC(r1) - stw r10, IP_MSR(r1) - - lwz r30, Vector_table(r11) - slwi r4,r0,2 - lwz r28, Nest_level(r11) - add r4, r4, r30 - - lwz r30, 0(r28) - mr r3, r0 - lwz r31, Stack(r11) - /* - * #if ( CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE ) - * if ( _ISR_Nest_level == 0 ) - * switch to software interrupt stack - * #endif - */ - /* Switch stacks, here we must prevent ALL interrupts */ -#if (PPC_USE_SPRG) - mfmsr r5 - mfspr r6, sprg2 -#else - lwz r6,msr_initial(r11) - lis r5,~PPC_MSR_DISABLE_MASK@ha - ori r5,r5,~PPC_MSR_DISABLE_MASK@l - and r6,r6,r5 - mfmsr r5 -#endif - mtmsr r6 - cmpwi r30, 0 - lwz r29, Disable_level(r11) - subf r31,r1,r31 - bne LABEL (nested) - stwux r1,r1,r31 -LABEL (nested): - /* - * _ISR_Nest_level++; - */ - lwz r31, 0(r29) - addi r30,r30,1 - stw r30,0(r28) - /* From here on out, interrupts can be re-enabled. RTEMS - * convention says not. - */ - lwz r4,0(r4) - /* - * _Thread_Dispatch_disable_level++; - */ - addi r31,r31,1 - stw r31, 0(r29) -/* SCE 980217 - * - * We need address translation ON when we call our ISR routine - - mtmsr r5 - - */ - - /* - * (*_ISR_Vector_table[ vector ])( vector ); - */ -#if (PPC_ABI == PPC_ABI_POWEROPEN) - lwz r6,0(r4) - lwz r2,4(r4) - mtlr r6 - lwz r11,8(r4) -#endif -#if (PPC_ABI == PPC_ABI_GCC27) - lwz r2, Default_r2(r11) - mtlr r4 - #lwz r2, 0(r2) -#endif -#if (PPC_ABI == PPC_ABI_SVR4 || PPC_ABI == PPC_ABI_EABI) - mtlr r4 - lwz r2, Default_r2(r11) - lwz r13, Default_r13(r11) - #lwz r2, 0(r2) - #lwz r13, 0(r13) -#endif - mr r4,r1 - blrl - /* NOP marker for debuggers */ - or r6,r6,r6 - - /* We must re-disable the interrupts */ -#if (PPC_USE_SPRG) - mfspr r11, sprg3 - mfspr r0, sprg2 -#else - lis r11,_CPU_IRQ_info@ha - addi r11,r11,_CPU_IRQ_info@l - lwz r0,msr_initial(r11) - lis r30,~PPC_MSR_DISABLE_MASK@ha - ori r30,r30,~PPC_MSR_DISABLE_MASK@l - and r0,r0,r30 -#endif - mtmsr r0 - lwz r30, 0(r28) - lwz r31, 0(r29) - - /* - * if (--Thread_Dispatch_disable,--_ISR_Nest_level) - * goto easy_exit; - */ - addi r30, r30, -1 - cmpwi r30, 0 - addi r31, r31, -1 - stw r30, 0(r28) - stw r31, 0(r29) - bne LABEL (easy_exit) - cmpwi r31, 0 - - lwz r30, Switch_necessary(r11) - - /* - * #if ( CPU_HAS_SOFTWARE_INTERRUPT_STACK == TRUE ) - * restore stack - * #endif - */ - lwz r1,0(r1) - bne LABEL (easy_exit) - lwz r30, 0(r30) - lwz r31, Signal(r11) - - /* - * if ( _Context_Switch_necessary ) - * goto switch - */ - cmpwi r30, 0 - lwz r28, 0(r31) - li r6,0 - bne LABEL (switch) - /* - * if ( !_ISR_Signals_to_thread_executing ) - * goto easy_exit - * _ISR_Signals_to_thread_executing = 0; - */ - cmpwi r28, 0 - beq LABEL (easy_exit) - - /* - * switch: - * call _Thread_Dispatch() or prepare to return to _ISR_Dispatch - */ -LABEL (switch): - stw r6, 0(r31) - /* Re-enable interrupts */ - lwz r0, IP_MSR(r1) -#if (PPC_ABI == PPC_ABI_POWEROPEN) - lwz r2, Dispatch_r2(r11) -#else - /* R2 and R13 still hold their values from the last call */ -#endif - mtmsr r0 - bl SYM (_Thread_Dispatch) - /* NOP marker for debuggers */ - or r6,r6,r6 - /* - * prepare to get out of interrupt - */ - /* Re-disable IRQs */ -#if (PPC_USE_SPRG) - mfspr r0, sprg2 -#else - lis r11,_CPU_IRQ_info@ha - addi r11,r11,_CPU_IRQ_info@l - lwz r0,msr_initial(r11) - lis r5,~PPC_MSR_DISABLE_MASK@ha - ori r5,r5,~PPC_MSR_DISABLE_MASK@l - and r0,r0,r5 -#endif - mtmsr r0 - - /* - * easy_exit: - * prepare to get out of interrupt - * return from interrupt - */ -LABEL (easy_exit): - lwz r5, IP_CR(r1) - lwz r6, IP_CTR(r1) - lwz r7, IP_XER(r1) - lwz r8, IP_LR(r1) - lwz r9, IP_PC(r1) - lwz r10, IP_MSR(r1) - mtcrf 255,r5 - mtctr r6 - mtxer r7 - mtlr r8 - MTPC (r9) - MTMSR (r10) - lwz r0, IP_0(r1) - lwz r2, IP_2(r1) - lwz r3, IP_3(r1) - lwz r4, IP_4(r1) - lwz r5, IP_5(r1) - lwz r6, IP_6(r1) - lwz r7, IP_7(r1) - lwz r8, IP_8(r1) - lwz r9, IP_9(r1) - lwz r10, IP_10(r1) - lwz r11, IP_11(r1) - lwz r12, IP_12(r1) - lwz r13, IP_13(r1) - lmw r28, IP_28(r1) - lwz r1, 0(r1) diff --git a/c/src/lib/libcpu/powerpc/old-exceptions/ppccache.c b/c/src/lib/libcpu/powerpc/old-exceptions/ppccache.c deleted file mode 100644 index ecfb4b96ca..0000000000 --- a/c/src/lib/libcpu/powerpc/old-exceptions/ppccache.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * PowerPC Cache enable routines - * - * $Id$ - */ - -#include - -#define PPC_Get_HID0( _value ) \ - do { \ - _value = 0; /* to avoid warnings */ \ - asm volatile( \ - "mfspr %0, 0x3f0;" /* get HID0 */ \ - "isync" \ - : "=r" (_value) \ - : "0" (_value) \ - ); \ - } while (0) - -#define PPC_Set_HID0( _value ) \ - do { \ - asm volatile( \ - "isync;" \ - "mtspr 0x3f0, %0;" /* load HID0 */ \ - "isync" \ - : "=r" (_value) \ - : "0" (_value) \ - ); \ - } while (0) - - -void powerpc_instruction_cache_enable () -{ - unsigned32 value; - - /* - * Enable the instruction cache - */ - - PPC_Get_HID0( value ); - - value |= 0x00008000; /* Set ICE bit */ - - PPC_Set_HID0( value ); -} - -void powerpc_data_cache_enable () -{ - unsigned32 value; - - /* - * enable data cache - */ - - PPC_Get_HID0( value ); - - value |= 0x00004000; /* set DCE bit */ - - PPC_Set_HID0( value ); -} - diff --git a/c/src/lib/libcpu/powerpc/old-exceptions/rtems/score/ppc_offs.h b/c/src/lib/libcpu/powerpc/old-exceptions/rtems/score/ppc_offs.h deleted file mode 100644 index d319107aaa..0000000000 --- a/c/src/lib/libcpu/powerpc/old-exceptions/rtems/score/ppc_offs.h +++ /dev/null @@ -1,166 +0,0 @@ -/* -*- asm -*- */ -#ifndef __PPC_OFFS_H -#define __PPC_OFFS_H - -/* - * Offsets for various Contexts - */ - .set GP_1, 0 - .set GP_2, (GP_1 + 4) - .set GP_13, (GP_2 + 4) - .set GP_14, (GP_13 + 4) - - .set GP_15, (GP_14 + 4) - .set GP_16, (GP_15 + 4) - .set GP_17, (GP_16 + 4) - .set GP_18, (GP_17 + 4) - - .set GP_19, (GP_18 + 4) - .set GP_20, (GP_19 + 4) - .set GP_21, (GP_20 + 4) - .set GP_22, (GP_21 + 4) - - .set GP_23, (GP_22 + 4) - .set GP_24, (GP_23 + 4) - .set GP_25, (GP_24 + 4) - .set GP_26, (GP_25 + 4) - - .set GP_27, (GP_26 + 4) - .set GP_28, (GP_27 + 4) - .set GP_29, (GP_28 + 4) - .set GP_30, (GP_29 + 4) - - .set GP_31, (GP_30 + 4) - .set GP_CR, (GP_31 + 4) - .set GP_PC, (GP_CR + 4) - .set GP_MSR, (GP_PC + 4) - -#if (PPC_HAS_DOUBLE == 1) - .set FP_0, 0 - .set FP_1, (FP_0 + 8) - .set FP_2, (FP_1 + 8) - .set FP_3, (FP_2 + 8) - .set FP_4, (FP_3 + 8) - .set FP_5, (FP_4 + 8) - .set FP_6, (FP_5 + 8) - .set FP_7, (FP_6 + 8) - .set FP_8, (FP_7 + 8) - .set FP_9, (FP_8 + 8) - .set FP_10, (FP_9 + 8) - .set FP_11, (FP_10 + 8) - .set FP_12, (FP_11 + 8) - .set FP_13, (FP_12 + 8) - .set FP_14, (FP_13 + 8) - .set FP_15, (FP_14 + 8) - .set FP_16, (FP_15 + 8) - .set FP_17, (FP_16 + 8) - .set FP_18, (FP_17 + 8) - .set FP_19, (FP_18 + 8) - .set FP_20, (FP_19 + 8) - .set FP_21, (FP_20 + 8) - .set FP_22, (FP_21 + 8) - .set FP_23, (FP_22 + 8) - .set FP_24, (FP_23 + 8) - .set FP_25, (FP_24 + 8) - .set FP_26, (FP_25 + 8) - .set FP_27, (FP_26 + 8) - .set FP_28, (FP_27 + 8) - .set FP_29, (FP_28 + 8) - .set FP_30, (FP_29 + 8) - .set FP_31, (FP_30 + 8) - .set FP_FPSCR, (FP_31 + 8) -#else - .set FP_0, 0 - .set FP_1, (FP_0 + 4) - .set FP_2, (FP_1 + 4) - .set FP_3, (FP_2 + 4) - .set FP_4, (FP_3 + 4) - .set FP_5, (FP_4 + 4) - .set FP_6, (FP_5 + 4) - .set FP_7, (FP_6 + 4) - .set FP_8, (FP_7 + 4) - .set FP_9, (FP_8 + 4) - .set FP_10, (FP_9 + 4) - .set FP_11, (FP_10 + 4) - .set FP_12, (FP_11 + 4) - .set FP_13, (FP_12 + 4) - .set FP_14, (FP_13 + 4) - .set FP_15, (FP_14 + 4) - .set FP_16, (FP_15 + 4) - .set FP_17, (FP_16 + 4) - .set FP_18, (FP_17 + 4) - .set FP_19, (FP_18 + 4) - .set FP_20, (FP_19 + 4) - .set FP_21, (FP_20 + 4) - .set FP_22, (FP_21 + 4) - .set FP_23, (FP_22 + 4) - .set FP_24, (FP_23 + 4) - .set FP_25, (FP_24 + 4) - .set FP_26, (FP_25 + 4) - .set FP_27, (FP_26 + 4) - .set FP_28, (FP_27 + 4) - .set FP_29, (FP_28 + 4) - .set FP_30, (FP_29 + 4) - .set FP_31, (FP_30 + 4) - .set FP_FPSCR, (FP_31 + 4) -#endif - - .set IP_LINK, 0 -#if (PPC_ABI == PPC_ABI_POWEROPEN || PPC_ABI == PPC_ABI_GCC27) - .set IP_0, (IP_LINK + 56) -#else - .set IP_0, (IP_LINK + 8) -#endif - .set IP_2, (IP_0 + 4) - - .set IP_3, (IP_2 + 4) - .set IP_4, (IP_3 + 4) - .set IP_5, (IP_4 + 4) - .set IP_6, (IP_5 + 4) - - .set IP_7, (IP_6 + 4) - .set IP_8, (IP_7 + 4) - .set IP_9, (IP_8 + 4) - .set IP_10, (IP_9 + 4) - - .set IP_11, (IP_10 + 4) - .set IP_12, (IP_11 + 4) - .set IP_13, (IP_12 + 4) - .set IP_28, (IP_13 + 4) - - .set IP_29, (IP_28 + 4) - .set IP_30, (IP_29 + 4) - .set IP_31, (IP_30 + 4) - .set IP_CR, (IP_31 + 4) - - .set IP_CTR, (IP_CR + 4) - .set IP_XER, (IP_CTR + 4) - .set IP_LR, (IP_XER + 4) - .set IP_PC, (IP_LR + 4) - - .set IP_MSR, (IP_PC + 4) - .set IP_END, (IP_MSR + 16) - - /* _CPU_IRQ_info offsets */ - - /* These must be in this order */ - .set Nest_level, 0 - .set Disable_level, 4 - .set Vector_table, 8 - .set Stack, 12 -#if (PPC_ABI == PPC_ABI_POWEROPEN) - .set Dispatch_r2, 16 - .set Switch_necessary, 20 -#else - .set Default_r2, 16 -#if (PPC_ABI != PPC_ABI_GCC27) - .set Default_r13, 20 - .set Switch_necessary, 24 -#else - .set Switch_necessary, 20 -#endif -#endif - .set Signal, Switch_necessary + 4 - .set msr_initial, Signal + 4 - -#endif /* __PPC_OFFS_H */ diff --git a/c/src/libchip/shmdr/.cvsignore b/c/src/libchip/shmdr/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/c/src/libchip/shmdr/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/c/src/libchip/shmdr/README b/c/src/libchip/shmdr/README deleted file mode 100644 index 5ed9e861b0..0000000000 --- a/c/src/libchip/shmdr/README +++ /dev/null @@ -1,9 +0,0 @@ -# -# $Id$ -# - -The mpci.h file provided in here is too simple for an MPCI with -multiple ways to get to a node. - -This version of the shm driver needs to be reorganized to follow -the better model of the Ada version. diff --git a/c/src/libchip/shmdr/addlq.c b/c/src/libchip/shmdr/addlq.c deleted file mode 100644 index 141b98796e..0000000000 --- a/c/src/libchip/shmdr/addlq.c +++ /dev/null @@ -1,42 +0,0 @@ -/* void Shm_Locked_queue_Add( lq_cb, ecb ) - * - * This routine adds an envelope control block to a shared memory queue. - * - * Input parameters: - * lq_cb - pointer to a locked queue control block - * ecb - pointer to an envelope control block - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include "shm_driver.h" - -void Shm_Locked_queue_Add( - Shm_Locked_queue_Control *lq_cb, - Shm_Envelope_control *ecb -) -{ - rtems_unsigned32 index; - - ecb->next = Shm_Locked_queue_End_of_list; - ecb->queue = lq_cb->owner; - index = ecb->index; - - Shm_Lock( lq_cb ); - if ( Shm_Convert(lq_cb->front) != Shm_Locked_queue_End_of_list ) - Shm_Envelopes[ Shm_Convert(lq_cb->rear) ].next = index; - else - lq_cb->front = index; - lq_cb->rear = index; - Shm_Unlock( lq_cb ); -} diff --git a/c/src/libchip/shmdr/cnvpkt.c b/c/src/libchip/shmdr/cnvpkt.c deleted file mode 100644 index 616bbad8e7..0000000000 --- a/c/src/libchip/shmdr/cnvpkt.c +++ /dev/null @@ -1,41 +0,0 @@ -/* void Shm_Convert_packet( &packet ) - * - * This routine is the shared memory locked queue MPCI driver routine - * used to convert the RTEMS's information in a packet from non-native - * format to processor native format. - * - * Input parameters: - * packet - pointer to a packet - * - * Output parameters: - * *packet - packet in native format - * - * NOTE: Message buffers are not manipulated. - * Endian conversion is currently the only conversion. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include "shm_driver.h" - -void Shm_Convert_packet( - rtems_packet_prefix *packet -) -{ - rtems_unsigned32 *pkt, i; - - pkt = (rtems_unsigned32 *) packet; - for ( i=RTEMS_MINIMUN_HETERO_CONVERSION ; i ; i--, pkt++ ) - *pkt = CPU_swap_u32( *pkt ); - - for ( i=packet->to_convert ; i ; i--, pkt++ ) - *pkt = CPU_swap_u32( *pkt ); -} diff --git a/c/src/libchip/shmdr/dump.c b/c/src/libchip/shmdr/dump.c deleted file mode 100644 index 10e8e6dbd7..0000000000 --- a/c/src/libchip/shmdr/dump.c +++ /dev/null @@ -1,50 +0,0 @@ -/* - * This routine is invoked following a reset to report the statistics - * gathered during the previous execution. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include - -#include "shm_driver.h" - -void -Shm_Print_statistics(void) -{ - rtems_unsigned32 ticks; - rtems_unsigned32 ticks_per_second; - rtems_unsigned32 seconds; - int packets_per_second; - - (void) rtems_clock_get( RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &ticks ); - (void) rtems_clock_get( RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticks_per_second ); - - seconds = ticks / ticks_per_second; - if ( seconds == 0 ) - seconds = 1; - - packets_per_second = Shm_Receive_message_count / seconds; - if ( (Shm_Receive_message_count % seconds) >= (seconds / 2) ) - packets_per_second++; - - printf( "\n\nSHMDR STATISTICS (NODE %d)\n", Shm_Local_node ); - printf( "TICKS SINCE BOOT = %d\n", ticks ); - printf( "TICKS PER SECOND = %d\n", ticks_per_second ); - printf( "ISRs=%d\n", Shm_Interrupt_count ); - printf( "RECV=%d\n", Shm_Receive_message_count ); - printf( "NULL=%d\n", Shm_Null_message_count ); - printf( "PKTS/SEC=%d\n", packets_per_second ); -} diff --git a/c/src/libchip/shmdr/fatal.c b/c/src/libchip/shmdr/fatal.c deleted file mode 100644 index 340c65e59e..0000000000 --- a/c/src/libchip/shmdr/fatal.c +++ /dev/null @@ -1,38 +0,0 @@ -/* void MPCI_Fatal( error ) - * - * This routine is the shared memory driver fatal error handler. - * - * Input parameters: - * error - fatal error code - * - * Output parameters: NEVER RETURNS - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include "shm_driver.h" - -void MPCI_Fatal( - Internal_errors_Source source, - boolean is_internal, - rtems_unsigned32 error -) -{ - /* Eventually need to attempt to broadcast a K_FATAL message - * without checking for all possible errors (do not want to - * recurse). - * - * Also need to avoid using Shm_Node_statuses if the driver has not been - * initialized. - */ - - Shm_Local_node_status->error = Shm_Convert(error); -} diff --git a/c/src/libchip/shmdr/getlq.c b/c/src/libchip/shmdr/getlq.c deleted file mode 100644 index 199721b9ab..0000000000 --- a/c/src/libchip/shmdr/getlq.c +++ /dev/null @@ -1,47 +0,0 @@ -/* Shm_Envelope_control *Shm_Locked_queue_Get( lq_cb ) - * - * This routine returns an envelope control block from a shared - * memory queue. - * - * Input parameters: - * lq_cb - pointer to a locked queue control block - * - * Output parameters: - * returns - pointer to an envelope control block - * - NULL if no envelopes on specified queue - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include - -Shm_Envelope_control *Shm_Locked_queue_Get( - Shm_Locked_queue_Control *lq_cb -) -{ - Shm_Envelope_control *tmp_ecb; - rtems_unsigned32 tmpfront; - - tmp_ecb = NULL; - Shm_Lock( lq_cb ); - - tmpfront = Shm_Convert(lq_cb->front); - if ( tmpfront != Shm_Locked_queue_End_of_list ) { - tmp_ecb = &Shm_Envelopes[ tmpfront ]; - lq_cb->front = tmp_ecb->next; - if ( tmp_ecb->next == Shm_Locked_queue_End_of_list ) - lq_cb->rear = Shm_Locked_queue_End_of_list; - tmp_ecb->next = Shm_Locked_queue_Not_on_list; - } - - Shm_Unlock( lq_cb ); - return( tmp_ecb ); -} diff --git a/c/src/libchip/shmdr/getpkt.c b/c/src/libchip/shmdr/getpkt.c deleted file mode 100644 index 9ed8e42a46..0000000000 --- a/c/src/libchip/shmdr/getpkt.c +++ /dev/null @@ -1,35 +0,0 @@ -/* Shm_Get_packet - * - * This routine is the shared memory locked queue MPCI driver - * routine used to obtain an empty message packet. - * - * Input parameters: - * packet - address of pointer to packet - * - * Output parameters: - * *(cpb->get_packet) - address of allocated packet - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include "shm_driver.h" - -rtems_mpci_entry Shm_Get_packet( - rtems_packet_prefix **packet -) -{ - Shm_Envelope_control *ecb; - - ecb = Shm_Allocate_envelope(); - if ( !ecb ) - rtems_fatal_error_occurred ( SHM_NO_FREE_PKTS ); - *packet = Shm_Envelope_control_to_packet_prefix_pointer( ecb ); -} diff --git a/c/src/libchip/shmdr/init.c b/c/src/libchip/shmdr/init.c deleted file mode 100644 index b4ca93a08a..0000000000 --- a/c/src/libchip/shmdr/init.c +++ /dev/null @@ -1,253 +0,0 @@ -/* Shm_Initialization - * - * This routine is the shared memory communications initerface - * driver initialization routine. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define _SHM_INIT - -#include -#include - -#include /* memset() */ -#include /* malloc() */ -#include - -/* - * User extension to install MPCI_Fatal as a fatal error - * handler extension - */ - -rtems_extensions_table MPCI_Shm_extensions; - -rtems_mpci_entry Shm_Initialization( void ) - -{ - rtems_unsigned32 i, all_initialized; - rtems_unsigned32 interrupt_cause, interrupt_value; - void *interrupt_address; - Shm_Node_status_control *nscb; - rtems_unsigned32 extension_id; /* for installation of MPCI_Fatal */ - rtems_unsigned32 remaining_memory; -/* XXX these should use "public" methods to set their values.... */ - rtems_configuration_table *configuration = _Configuration_Table; - rtems_multiprocessing_table *mp_configuration = _Configuration_MP_table; - - Shm_RTEMS_Configuration = configuration; - Shm_RTEMS_MP_Configuration = mp_configuration; - - Shm_Local_node = Shm_RTEMS_MP_Configuration->node; - Shm_Maximum_nodes = Shm_RTEMS_MP_Configuration->maximum_nodes; - - Shm_Get_configuration( Shm_Local_node, &Shm_Configuration ); - - Shm_Interrupt_table = (Shm_Interrupt_information *) malloc( - sizeof(Shm_Interrupt_information) * (Shm_Maximum_nodes + 1) - ); - - assert( Shm_Interrupt_table ); - - - Shm_Receive_message_count = 0; - Shm_Null_message_count = 0; - Shm_Interrupt_count = 0; - - /* - * Set the Node Status indicators - */ - - Shm_Pending_initialization = - Shm_Convert(rtems_build_name( 'P', 'E', 'N', 'D' )); - Shm_Initialization_complete = - Shm_Convert(rtems_build_name( 'C', 'O', 'M', 'P' )); - Shm_Active_node = - Shm_Convert(rtems_build_name( 'A', 'C', 'T', 'V' )); - - /* - * Initialize the constants used by the Locked Queue code. - */ - - Shm_Locked_queue_End_of_list = Shm_Convert( 0xffffffff ); - Shm_Locked_queue_Not_on_list = Shm_Convert( 0xfffffffe ); - - /* - * Set the base addresses for the: - * + Node Status Table - * + Free Pool and Receive Queues - * + Envelopes - */ - - Shm_Node_statuses = (Shm_Node_status_control *) START_NS_CBS; - Shm_Locked_queues = (Shm_Locked_queue_Control *) START_LQ_CBS; - Shm_Envelopes = (Shm_Envelope_control *) START_ENVELOPES; - - /* - * Calculate the maximum number of envelopes which can be - * placed the remaining shared memory. - */ - - remaining_memory = - ((void *)Shm_Configuration->base + Shm_Configuration->length) - - ((void *)Shm_Envelopes); - - Shm_Maximum_envelopes = remaining_memory / sizeof( Shm_Envelope_control ); - Shm_Maximum_envelopes -= 1; - - /* - * Set the pointer to the receive queue for the local node. - * When we receive a node, we will get it from here before - * processing it. - */ - - Shm_Local_receive_queue = &Shm_Locked_queues[ Shm_Local_node ]; - Shm_Local_node_status = &Shm_Node_statuses[ Shm_Local_node ]; - - /* - * Convert local interrupt cause information into the - * neutral format so other nodes will be able to - * understand it. - */ - - interrupt_address = - (void *) Shm_Convert( (rtems_unsigned32)Shm_Configuration->Intr.address ); - interrupt_value = Shm_Convert( Shm_Configuration->Intr.value ); - interrupt_cause = Shm_Convert( Shm_Configuration->Intr.length ); - - if ( Shm_Configuration->poll_intr == POLLED_MODE ) Shm_setclockvec(); - else Shm_setvec(); - - if ( Shm_Is_master_node() ) { - - /* - * Zero out the shared memory area. - */ - - (void) memset( - (void *) Shm_Configuration->base, - 0, - Shm_Configuration->length - ); - - /* - * Initialize all of the locked queues (the free envelope - * pool and a receive queue per node) and set all of the - * node's status so they will be waiting to initialization - * to complete. - */ - - Shm_Locked_queue_Initialize( FREE_ENV_CB, FREE_ENV_POOL ); - - for ( i=SHM_FIRST_NODE ; i<=Shm_Maximum_nodes ; i++ ) { - Shm_Initialize_receive_queue( i ); - - Shm_Node_statuses[ i ].status = Shm_Pending_initialization; - Shm_Node_statuses[ i ].error = 0; - } - - /* - * Initialize all of the envelopes and place them in the - * free pool. - */ - - for ( i=0 ; iint_address = (rtems_unsigned32) interrupt_address; - Shm_Local_node_status->int_value = interrupt_value; - Shm_Local_node_status->int_length = interrupt_cause; - - Shm_Local_node_status->status = Shm_Initialization_complete; - - /* - * Loop until all nodes have completed initialization. - */ - - do { - all_initialized = 1; - - for ( i = SHM_FIRST_NODE ; i <= Shm_Maximum_nodes ; i++ ) - if ( Shm_Node_statuses[ i ].status != Shm_Initialization_complete ) - all_initialized = 0; - - } while ( all_initialized == 0 ); - - /* - * Tell the other nodes we think that the system is up. - */ - - for ( i = SHM_FIRST_NODE ; i <= Shm_Maximum_nodes ; i++ ) - Shm_Node_statuses[ i ].status = Shm_Active_node; - - } else { /* is not MASTER node */ - - /* - * Initialize the node status for the non-master nodes. - * Because the master node zeroes out memory, it is - * necessary for them to keep putting their values in - * the node status area until the master says they - * should become active. - */ - - Shm_Local_node_status->status = Shm_Pending_initialization; - - do { - - if ( Shm_Local_node_status->status == Shm_Pending_initialization ) { - - /* - * Initialize this node's interrupt information in the - * shared area so other nodes can interrupt us. - */ - - Shm_Local_node_status->int_address = - (rtems_unsigned32) interrupt_address; - Shm_Local_node_status->int_value = interrupt_value; - Shm_Local_node_status->int_length = interrupt_cause; - - Shm_Local_node_status->status = Shm_Initialization_complete; - } - } while ( Shm_Local_node_status->status != Shm_Active_node ) ; - } - - /* - * Initialize the Interrupt Information Table - */ - - for ( i = SHM_FIRST_NODE ; i <= Shm_Maximum_nodes ; i++ ) { - nscb = &Shm_Node_statuses[ i ]; - - Shm_Interrupt_table[i].address = Shm_Convert_address( - (void *)Shm_Convert(((vol_u32) nscb->int_address)) - ); - Shm_Interrupt_table[i].value = Shm_Convert( nscb->int_value ); - Shm_Interrupt_table[i].length = Shm_Convert( nscb->int_length ); - } - - MPCI_Shm_extensions.fatal = MPCI_Fatal; - - (void) rtems_extension_create( - rtems_build_name( 'M', 'P', 'E', 'X' ), - &MPCI_Shm_extensions, - &extension_id - ); -} diff --git a/c/src/libchip/shmdr/initlq.c b/c/src/libchip/shmdr/initlq.c deleted file mode 100644 index e2e0dd1f8c..0000000000 --- a/c/src/libchip/shmdr/initlq.c +++ /dev/null @@ -1,34 +0,0 @@ -/* void Shm_Locked_queue_Initialize( lq_cb, owner ) - * - * This routine initializes a shared memory locked queue. - * - * Input parameters: - * lq_cb - pointer to the control block of the queue - * to be initialized - * owner - unique idenitifier of who owns this queue. - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include "shm_driver.h" - -void Shm_Locked_queue_Initialize( - Shm_Locked_queue_Control *lq_cb, - rtems_unsigned32 owner -) -{ - Shm_Initialize_lock( lq_cb ); - lq_cb->front = Shm_Locked_queue_End_of_list; - lq_cb->rear = Shm_Locked_queue_End_of_list; - lq_cb->owner = Shm_Convert(owner); -} diff --git a/c/src/libchip/shmdr/intr.c b/c/src/libchip/shmdr/intr.c deleted file mode 100644 index 3374919222..0000000000 --- a/c/src/libchip/shmdr/intr.c +++ /dev/null @@ -1,57 +0,0 @@ -/* void Shm_Cause_interrupt( node ) - * - * This routine is the shared memory driver routine which - * generates interrupts to other CPUs. - * - * It uses the information placed in the node status control - * block by each node. For example, when used with the Motorola - * MVME136 board, the MPCSR is used. - * - * Input parameters: - * node - destination of this packet (0 = broadcast) - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include "shm_driver.h" - -void Shm_Cause_interrupt( - rtems_unsigned32 node -) -{ - Shm_Interrupt_information *intr; - rtems_unsigned8 *u8; - rtems_unsigned16 *u16; - rtems_unsigned32 *u32; - rtems_unsigned32 value; - - intr = &Shm_Interrupt_table[node]; - value = intr->value; - - switch ( intr->length ) { - case NO_INTERRUPT: - break; - case BYTE: - u8 = (rtems_unsigned8 *)intr->address; - *u8 = (rtems_unsigned8) value; - break; - case WORD: - u16 = (rtems_unsigned16 *)intr->address; - *u16 = (rtems_unsigned16) value; - break; - case LONG: - u32 = (rtems_unsigned32 *)intr->address; - *u32 = (rtems_unsigned32) value; - break; - } -} diff --git a/c/src/libchip/shmdr/mpci.h b/c/src/libchip/shmdr/mpci.h deleted file mode 100644 index 203c77dbcd..0000000000 --- a/c/src/libchip/shmdr/mpci.h +++ /dev/null @@ -1,58 +0,0 @@ -/* mpci.h - * - * This include file contains all the renaming necessary to - * have an application use the Shared Memory Driver as its - * sole mechanism for MPCI. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#ifndef __SHM_MPCI_h -#define __SHM_MPCI_h - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#define MPCI_Initialization( _configuration ) \ - Shm_Initialization( _configuration ) - -#define MPCI_Get_packet( _the_packet ) \ - Shm_Get_packet( _the_packet ) - -#define MPCI_Return_packet( _the_packet ) \ - Shm_Return_packet( _the_packet ) - -#define MPCI_Receive_packet( _the_packet ) \ - Shm_Receive_packet( _the_packet ) - -#define MPCI_Send_packet( _destination, _the_packet ) \ - Shm_Send_packet( _destination, _the_packet ) - -/* Unnecessary... mapped in shm_driver.h -#define MPCI_Fatal( _the_error ) \ - Shm_Fatal( _the_error ) -*/ - -#define MPCI_Enable_statistics() - -#define MPCI_Print_statistics() \ - Shm_Print_statistics() - -/* no need to rename the MPCI_Table either */ - -#ifdef __cplusplus -} -#endif - -#endif -/* end of include file */ diff --git a/c/src/libchip/shmdr/mpisr.c b/c/src/libchip/shmdr/mpisr.c deleted file mode 100644 index fc761101cd..0000000000 --- a/c/src/libchip/shmdr/mpisr.c +++ /dev/null @@ -1,22 +0,0 @@ -/* _Shm_isr() - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include "shm_driver.h" - -rtems_isr Shm_isr( - rtems_vector_number vector -) -{ - Shm_Interrupt_count += 1; - rtems_multiprocessing_announce(); -} diff --git a/c/src/libchip/shmdr/poll.c b/c/src/libchip/shmdr/poll.c deleted file mode 100644 index 9c3571ae22..0000000000 --- a/c/src/libchip/shmdr/poll.c +++ /dev/null @@ -1,52 +0,0 @@ -/* void Shm_Poll() - * - * This routine polls to see if a packet has arrived. If one - * has it informs the executive. It is typically called from - * the clock tick interrupt service routine. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include -#include - -#include "shm_driver.h" - -void Shm_Poll() -{ - rtems_unsigned32 tmpfront; - rtems_libio_ioctl_args_t args; - - /* invoke clock isr */ - args.iop = 0; - args.command = rtems_build_name('I', 'S', 'R', ' '); - (void) rtems_io_control(rtems_clock_major, rtems_clock_minor, &args); - - /* - * Check for msgs only if we are "up" - * This avoids a race condition where we may get a clock - * interrupt before MPCI has completed its init - */ - - if (_System_state_Is_up(_System_state_Get())) - { - tmpfront = Shm_Local_receive_queue->front; - if ( Shm_Convert(tmpfront) != Shm_Locked_queue_End_of_list ) - { - rtems_multiprocessing_announce(); - Shm_Interrupt_count++; - } - } -} diff --git a/c/src/libchip/shmdr/receive.c b/c/src/libchip/shmdr/receive.c deleted file mode 100644 index 8d1b2349f7..0000000000 --- a/c/src/libchip/shmdr/receive.c +++ /dev/null @@ -1,43 +0,0 @@ -/* Shm_Receive_packet - * - * This routine is the shared memory locked queue MPCI driver routine - * used to obtain a packet containing a message from this node's - * receive queue. - * - * Input parameters: - * packet - address of a pointer to a packet - * - * Output parameters: - * *(rpb->packet) - pointer to packet - * NULL if no packet currently available - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include "shm_driver.h" - -rtems_mpci_entry Shm_Receive_packet( - rtems_packet_prefix **packet -) -{ - Shm_Envelope_control *ecb; - - ecb = Shm_Locked_queue_Get( Shm_Local_receive_queue ); - if ( ecb ) { - *(packet) = Shm_Envelope_control_to_packet_prefix_pointer( ecb ); - if ( ecb->Preamble.endian != Shm_Configuration->format ) - Shm_Convert_packet( *packet ); - Shm_Receive_message_count++; - } else { - *(packet) = NULL; - Shm_Null_message_count++; - } -} diff --git a/c/src/libchip/shmdr/retpkt.c b/c/src/libchip/shmdr/retpkt.c deleted file mode 100644 index c013916603..0000000000 --- a/c/src/libchip/shmdr/retpkt.c +++ /dev/null @@ -1,31 +0,0 @@ -/* Shm_Return_packet - * - * This routine is the shared memory locked queue MPCI driver - * routine used to return a message packet to a free envelope - * pool accessible by this node. - * - * Input parameters: - * packet - address of pointer to packet - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include "shm_driver.h" - -rtems_mpci_entry Shm_Return_packet( - rtems_packet_prefix *packet -) -{ - Shm_Free_envelope( Shm_Packet_prefix_to_envelope_control_pointer(packet) ); -} - diff --git a/c/src/libchip/shmdr/send.c b/c/src/libchip/shmdr/send.c deleted file mode 100644 index 2e5f60988e..0000000000 --- a/c/src/libchip/shmdr/send.c +++ /dev/null @@ -1,60 +0,0 @@ -/* Shm_Send_packet - * - * This routine is the shared memory driver locked queue write - * MPCI driver routine. This routine sends the specified packet - * to the destination specified by "node". A "node" value of - * zero designates that this packet is to be broadcasted. - * - * Input parameters: - * node - destination of this packet (0 = broadcast) - * packet - address of packet - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include "shm_driver.h" - -struct pkt_cpy { - rtems_unsigned32 packet[MAX_PACKET_SIZE/4]; -}; - -rtems_mpci_entry Shm_Send_packet( - rtems_unsigned32 node, - rtems_packet_prefix *packet -) -{ - Shm_Envelope_control *ecb, *tmp_ecb; - rtems_unsigned32 nnum; - - ecb = Shm_Packet_prefix_to_envelope_control_pointer( packet ); - if ( node ) { - Shm_Build_preamble( ecb, node ); - Shm_Build_postamble( ecb ); - Shm_Append_to_receive_queue( node, ecb ); - (*Shm_Configuration->cause_intr)( node ); - } - else { - for( nnum = SHM_FIRST_NODE ; nnum <= Shm_Maximum_nodes ; nnum++ ) - if ( Shm_Local_node != nnum ) { - tmp_ecb = Shm_Allocate_envelope(); - if ( !tmp_ecb ) - rtems_fatal_error_occurred( SHM_NO_FREE_PKTS ); - Shm_Build_preamble( tmp_ecb, nnum ); - *((struct pkt_cpy *)tmp_ecb->packet) = *((struct pkt_cpy *)packet); - Shm_Build_postamble( tmp_ecb ); - Shm_Append_to_receive_queue( nnum, tmp_ecb ); - (*Shm_Configuration->cause_intr)( nnum ); - } - Shm_Free_envelope( ecb ); - } -} diff --git a/c/src/libchip/shmdr/setckvec.c b/c/src/libchip/shmdr/setckvec.c deleted file mode 100644 index 9be1b48945..0000000000 --- a/c/src/libchip/shmdr/setckvec.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Shm_setclockvec - * - * This routines installs the shared memory clock interrupt handler - * used when the driver is used in polling mode. - * - * INPUT PARAMETERS: NONE - * - * OUTPUT PARAMETERS: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include - -#include "shm_driver.h" - -rtems_isr Shm_setclockvec() -{ - rtems_libio_ioctl_args_t args; - args.iop = 0; - args.command = rtems_build_name('N', 'E', 'W', ' '); - args.buffer = (void *) Shm_Poll; - - (void) rtems_io_control(rtems_clock_major, rtems_clock_minor, &args); -} diff --git a/c/src/libchip/shmdr/shm_driver.h b/c/src/libchip/shmdr/shm_driver.h deleted file mode 100644 index 1d846d6e10..0000000000 --- a/c/src/libchip/shmdr/shm_driver.h +++ /dev/null @@ -1,544 +0,0 @@ -/* shm_driver.h - * - * This include file contains all the constants, structures, - * and global variables for this RTEMS based shared memory - * communications interface driver. - * - * Processor board dependencies are in other files. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#ifndef __SHM_h -#define __SHM_h - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* The information contained in the Node Status, Locked Queue, and - * Envelope Control Blocks must be maintained in a NEUTRAL format. - * Currently the neutral format may be selected as big or little - * endian by simply defining either NEUTRAL_BIG or NEUTRAL_LITTLE. - * - * It is CRITICAL to note that the neutral format can ONLY be - * changed by modifying this file and recompiling the ENTIRE - * SHM driver including ALL target specific support files. - * - * The following table details the memory contents for the endian - * field of the Node Status Control Block in the various - * data format configurations (data is in hexadecimal): - * - * NEUTRAL NATIVE BYTE 0 BYTE 1 BYTE 2 BYTE 3 - * ======= ====== ====== ====== ====== ====== - * BIG BIG 00 00 00 01 - * BIG LITTLE 10 00 00 00 - * LITTLE BIG 01 00 00 00 - * LITTLE LITTLE 00 00 00 10 - * - * - * NOTE: XXX - * PORTABILITY OF LOCKING INSTRUCTIONS - * =================================== - * The locking mechanism described below is not - * general enough. Where the hardware supports - * it we should use "atomic swap" instructions - * so the values in the lock can be tailored to - * support a CPU with only weak atomic memory - * instructions. There are combinations of - * CPUs with inflexible atomic memory instructions - * which appear to be incompatible. For example, - * the SPARClite instruction uses a byte which is - * 0xFF when locked. The PA-RISC uses 1 to indicate - * locked and 0 when unlocked. These CPUs appear to - * have incompatible lock instructions. But - * they could be used in a heterogenous system - * with does not mix SPARCs and PA-RISCs. For - * example, the i386 and SPARC or i386 and SPARC - * could work together. The bottom line is that - * not every CPU will work together using this - * locking scheme. There are supposed to be - * algorithms to do this without hardware assist - * and one of these should be incorporated into - * the shared memory driver. - * - * The most flexible scheme using the instructions - * of the various CPUs for efficiency would be to use - * "atomic swaps" wherever possible. Make the lock - * and unlock configurable much like BIG vs LITTLE - * endian use of shared memory is now. The values - * of the lock could then reflect the "worst" - * CPU in a system. This still results in mixes - * of CPUs which are incompatible. - * - * The current locking mechanism is based upon the MC68020 - * "tas" instruction which is atomic. All ports to other CPUs - * comply with the restrictive placement of lock bit by this - * instruction. The lock bit is the most significant bit in a - * big-endian rtems_unsigned32. On other processors, the lock is - * typically implemented via an atomic swap or atomic modify - * bits type instruction. - */ - -#define NEUTRAL_BIG - -#ifdef NEUTRAL_BIG -#define SHM_BIG 0x00000001 -#define SHM_LITTLE 0x10000000 -#endif - -#ifdef NEUTRAL_LITTLE -#define SHM_BIG 0x01000000 -#define SHM_LITTLE 0x00000010 -#endif - -/* - * The following are the values used to fill in the lock field. Some CPUs - * are able to write only a single value into field. By making the - * lock and unlock values configurable, CPUs which support "atomic swap" - * instructions can generally be made to work in any heterogeneous - * configuration. However, it is possible for two CPUs to be incompatible - * in regards to the lock field values. This occurs when two CPUs - * which write only a single value to the field are used in a system - * but the two CPUs write different incompatible values. - * - * NOTE: The following is a first attempt at defining values which - * have a chance at working together. The m68k should use - * chk2 instead of tas to be less restrictive. Target endian - * problems (like the Force CPU386 which has (broken) big endian - * view of the VMEbus address space) are not addressed yet. - */ - -#if defined(__i960__) -#define SHM_LOCK_VALUE 0x00000080 -#define SHM_UNLOCK_VALUE 0 -#elif defined(__mc68000__) -#define SHM_LOCK_VALUE 0x80000000 -#define SHM_UNLOCK_VALUE 0 -#define SHM_LOCK_VALUE 0x80000000 -#define SHM_UNLOCK_VALUE 0 -#elif defined(__i386__) -#define SHM_LOCK_VALUE 0x80000000 -#define SHM_UNLOCK_VALUE 0 -#elif defined(__mips__) -#define SHM_LOCK_VALUE 0x80000000 -#define SHM_UNLOCK_VALUE 0 -#elif defined(__hppa__) -#define SHM_LOCK_VALUE 0 -#define SHM_UNLOCK_VALUE 1 -#elif defined(__PPC__) -#define SHM_LOCK_VALUE 1 -#define SHM_UNLOCK_VALUE 0 -#elif defined(__unix__) -#define SHM_LOCK_VALUE 0 -#define SHM_UNLOCK_VALUE 1 -#elif defined(_AM29K) -#define SHM_LOCK_VALUE 0 -#define SHM_UNLOCK_VALUE 1 -#elif defined(no_cpu) /* for this values are irrelevant */ -#define SHM_LOCK_VALUE 1 -#define SHM_UNLOCK_VALUE 0 -#else -#error "shm_driver.h - no SHM_LOCK_VALUE defined for this CPU architecture" -#endif - -#define Shm_Convert( value ) \ - ((Shm_Configuration->convert) ? \ - (*Shm_Configuration->convert)(value) : (value)) - -/* constants */ - -#define SHM_MASTER 1 /* master initialization node */ -#define SHM_FIRST_NODE 1 - -/* size constants */ - -#define KILOBYTE (1024) -#define MEGABYTE (1024*1024) - -/* inter-node interrupt values */ - -#define NO_INTERRUPT 0 /* used for polled nodes */ -#define BYTE 1 -#define WORD 2 -#define LONG 4 - -/* operational mode constants -- used in SHM Configuration Table */ -#define POLLED_MODE 0 -#define INTR_MODE 1 - -/* error codes */ - -#define NO_ERROR 0 -#define SHM_NO_FREE_PKTS 0xf0000 - -/* null pointers of different types */ - -#define NULL_ENV_CB ((Shm_Envelope_control *) 0) -#define NULL_CONVERT 0 - -/* - * size of stuff before preamble in envelope. - * It must be a constant since we will use it to generate MAX_PACKET_SIZE - */ - -#define SHM_ENVELOPE_PREFIX_OVERHEAD (4 * sizeof(vol_u32)) - -/* - * The following is adjusted so envelopes are MAX_ENVELOPE_SIZE bytes long. - * It must be >= RTEMS_MINIMUM_PACKET_SIZE in mppkt.h. - */ - -#ifndef MAX_ENVELOPE_SIZE -#define MAX_ENVELOPE_SIZE 0x180 -#endif - -#define MAX_PACKET_SIZE (MAX_ENVELOPE_SIZE - \ - SHM_ENVELOPE_PREFIX_OVERHEAD + \ - sizeof(Shm_Envelope_preamble) + \ - sizeof(Shm_Envelope_postamble)) - - -/* constants pertinent to Locked Queue routines */ - -#define LQ_UNLOCKED SHM_UNLOCK_VALUE -#define LQ_LOCKED SHM_LOCK_VALUE - -/* constants related to the Free Envelope Pool */ - -#define FREE_ENV_POOL 0 -#define FREE_ENV_CB (&Shm_Locked_queues[ FREE_ENV_POOL ]) - -/* The following are important when dealing with - * the shared memory communications interface area. - * - * NOTE: The starting address and length of the shared memory - * is defined in a system dependent file. - */ - -#define START_NS_CBS ((void *)Shm_Configuration->base) -#define START_LQ_CBS ((START_NS_CBS) + \ - ( (sizeof (Shm_Node_status_control)) * (Shm_Maximum_nodes + 1) ) ) -#define START_ENVELOPES ( ((void *) START_LQ_CBS) + \ - ( (sizeof (Shm_Locked_queue_Control)) * (Shm_Maximum_nodes + 1) ) ) -#define END_SHMCI_AREA ( (void *) START_ENVELOPES + \ - ( (sizeof (Shm_Envelope_control)) * Shm_Maximum_envelopes ) ) -#define END_SHARED_MEM (START_NS_CBS+Shm_Configuration->length) - -/* macros */ - -#define Shm_Is_master_node() \ - ( SHM_MASTER == Shm_Local_node ) - -#define Shm_Free_envelope( ecb ) \ - Shm_Locked_queue_Add( FREE_ENV_CB, (ecb) ) -#define Shm_Allocate_envelope() \ - Shm_Locked_queue_Get(FREE_ENV_CB) - -#define Shm_Initialize_receive_queue(node) \ - Shm_Locked_queue_Initialize( &Shm_Locked_queues[node], node ) - -#define Shm_Append_to_receive_queue(node, ecb) \ - Shm_Locked_queue_Add( &Shm_Locked_queues[node], (ecb) ) - -#define Shm_Envelope_control_to_packet_prefix_pointer(ecb) \ - ((void *)(ecb)->packet) - -#define Shm_Packet_prefix_to_envelope_control_pointer( pkt ) \ - ((Shm_Envelope_control *)((rtems_unsigned8 *)(pkt) - \ - (sizeof(Shm_Envelope_preamble) + SHM_ENVELOPE_PREFIX_OVERHEAD))) - -#define Shm_Build_preamble(ecb, node) \ - (ecb)->Preamble.endian = Shm_Configuration->format - -#define Shm_Build_postamble( ecb ) - -/* volatile types */ - -typedef volatile rtems_unsigned8 vol_u8; -typedef volatile rtems_unsigned32 vol_u32; - -/* shm control information */ - -struct shm_info { - vol_u32 not_currently_used_0; - vol_u32 not_currently_used_1; - vol_u32 not_currently_used_2; - vol_u32 not_currently_used_3; -}; - -typedef struct { - /*byte start_of_text;*/ - vol_u32 endian; - vol_u32 not_currently_used_0; - vol_u32 not_currently_used_1; - vol_u32 not_currently_used_2; -} Shm_Envelope_preamble; - -typedef struct { -} Shm_Envelope_postamble; - -/* WARNING! If you change this structure, don't forget to change - * SHM_ENVELOPE_PREFIX_OVERHEAD and - * Shm_Packet_prefix_to_envelope_control_pointer() above. - */ - -/* This comment block describes the contents of each field - * of the Envelope Control Block: - * - * next - The index of the next envelope on this queue. - * queue - The index of the queue this envelope is on. - * index - The index of this envelope. - * Preamble - Generic packet preamble. One day this structure - * could be enhanced to contain routing information. - * packet - RTEMS MPCI packet. Untouched by SHM Driver - * other than copying and format conversion as - * documented in the RTEMS User's Guide. - * Postamble - Generic packet postamble. One day this structure - * could be enhanced to contain checksum information. - */ - -typedef struct { - vol_u32 next; /* next envelope on queue */ - vol_u32 queue; /* queue on which this resides */ - vol_u32 index; /* index into array of envelopes*/ - vol_u32 pad0; /* insure the next one is aligned */ - Shm_Envelope_preamble Preamble; /* header information */ - vol_u8 packet[MAX_PACKET_SIZE]; /* RTEMS INFO */ - Shm_Envelope_postamble Postamble;/* trailer information */ -} Shm_Envelope_control; - -/* This comment block describes the contents of each field - * of the Locked Queue Control Block: - * - * lock - Lock used to insure mutually exclusive access. - * front - Index of first envelope on queue. This field - * is used to remove head of queue (receive). - * rear - Index of last envelope on queue. This field - * is used to add evelope to queue (send). - * owner - The node number of the recipient (owning) node. - * RTEMS does not use the node number zero (0). - * The zero node is used by the SHM Driver for the - * Free Envelope Queue shared by all nodes. - */ - -typedef struct { - vol_u32 lock; /* lock field for this queue */ - vol_u32 front; /* first envelope on queue */ - vol_u32 rear; /* last envelope on queue */ - vol_u32 owner; /* receiving (i.e. owning) node */ -} Shm_Locked_queue_Control; - -/* This comment block describes the contents of each field - * of the Node Status Control Block: - * - * status - Node status. Current values are Pending Initialization, - * Initialization Complete, and Active Node. Other values - * could be added to enhance fault tolerance. - * error - Zero if the node has not failed. Otherwise, - * this field contains a status indicating the - * failure reason. - * int_address, int_value, and int_length - * - These field are the Interrupt Information table - * for this node in neutral format. This is how - * each node knows how to generate interrupts. - */ - -typedef struct { - vol_u32 status; /* node status information */ - vol_u32 error; /* fatal error code */ - vol_u32 int_address; /* write here for interrupt */ - vol_u32 int_value; /* this value causes interrupt */ - vol_u32 int_length; /* for this length (0,1,2,4) */ - vol_u32 not_currently_used_0; - vol_u32 not_currently_used_1; - vol_u32 not_currently_used_2; -} Shm_Node_status_control; - -/* This comment block describes the contents of each field - * of the Interrupt Information Table. This table describes - * how another node can generate an interrupt to this node. - * This information is target board dependent. If the - * SHM Driver is in POLLED_MODE, then all fields should - * be initialized to NO_INTERRUPT. - * - * address - The address to which another node should - * write to cause an interrupt. - * value - The value which must be written - * length - The size of the value to write. Valid - * values are BYTE, WORD, and LONG. - * - * NOTE: The Node Status Control Block contains this - * information in neutral format and not in a - * structure to avoid potential alignment problems. - */ - -typedef struct { - vol_u32 *address; /* write here for interrupt */ - vol_u32 value; /* this value causes interrupt */ - vol_u32 length; /* for this length (0,1,2,4) */ -} Shm_Interrupt_information; - -/* SHM Configuration Table - * - * This comment block describes the contents of each field - * of the SHM Configuration Table. - * - * base - The base address of the shared memory. This - * address may be specific to this node. - * length - The length of the shared memory in bytes. - * format - The natural format for rtems_unsigned32's in the - * shared memory. Valid values are currently - * only SHM_LITTLE and SHM_BIG. - * convert - The address of the routine which converts - * between neutral and local format. - * poll_intr - The operational mode of the driver. Some - * target boards may not provide hardware for - * an interprocessor interrupt. If POLLED_MODE - * is selected, the SHM driver will install a - * wrapper around the Clock_isr() to poll for - * incoming packets. Throughput is dependent - * on the time between clock interrupts. - * Valid values are POLLED_MODE and INTR_MODE. - * cause_intr - This is the address of the routine used to - * write to a particular address and cause an - * interrupt on another node. This routine - * may need to be target dependent if something - * other than a normal write from C does not work. - * Intr - This structure describes the operation required - * to cause an interrupt to this node. The actual - * contents of this structure are described above. - */ - -struct shm_config_info { - vol_u32 *base; /* base address of SHM */ - vol_u32 length; /* length (in bytes) of SHM */ - vol_u32 format; /* SHM is big or little endian */ - vol_u32 (*convert)();/* neutral conversion routine */ - vol_u32 poll_intr;/* POLLED or INTR driven mode */ - void (*cause_intr)( rtems_unsigned32 ); - Shm_Interrupt_information Intr; /* cause intr information */ -}; - -typedef struct shm_config_info shm_config_table; - -/* global variables */ - -#ifdef _SHM_INIT -#define SHM_EXTERN -#else -#define SHM_EXTERN extern -#endif - -SHM_EXTERN shm_config_table *Shm_Configuration; -SHM_EXTERN Shm_Interrupt_information *Shm_Interrupt_table; -SHM_EXTERN Shm_Node_status_control *Shm_Node_statuses; -SHM_EXTERN Shm_Locked_queue_Control *Shm_Locked_queues; -SHM_EXTERN Shm_Envelope_control *Shm_Envelopes; -SHM_EXTERN rtems_configuration_table *Shm_RTEMS_Configuration; -SHM_EXTERN rtems_multiprocessing_table *Shm_RTEMS_MP_Configuration; -SHM_EXTERN rtems_unsigned32 Shm_Receive_message_count; -SHM_EXTERN rtems_unsigned32 Shm_Null_message_count; -SHM_EXTERN rtems_unsigned32 Shm_Interrupt_count; -SHM_EXTERN rtems_unsigned32 Shm_Local_node; -SHM_EXTERN Shm_Locked_queue_Control *Shm_Local_receive_queue; -SHM_EXTERN Shm_Node_status_control *Shm_Local_node_status; -SHM_EXTERN rtems_unsigned32 Shm_isrstat; - /* reported by shmdr */ - -SHM_EXTERN rtems_unsigned32 Shm_Pending_initialization; -SHM_EXTERN rtems_unsigned32 Shm_Initialization_complete; -SHM_EXTERN rtems_unsigned32 Shm_Active_node; - -SHM_EXTERN rtems_unsigned32 Shm_Maximum_nodes; -SHM_EXTERN rtems_unsigned32 Shm_Maximum_envelopes; - -SHM_EXTERN rtems_unsigned32 Shm_Locked_queue_End_of_list; -SHM_EXTERN rtems_unsigned32 Shm_Locked_queue_Not_on_list; - -/* functions */ - -/* locked queue routines */ -void Shm_Locked_queue_Add( - Shm_Locked_queue_Control *, Shm_Envelope_control * ); -Shm_Envelope_control *Shm_Locked_queue_Get( Shm_Locked_queue_Control * ); -void Shm_Locked_queue_Initialize( - Shm_Locked_queue_Control *, rtems_unsigned32 ); - /* Shm_Initialize_lock is CPU dependent */ - /* Shm_Lock is CPU dependent */ - /* Shm_Unlock is CPU dependent */ - -/* portable routines */ -void Init_env_pool(); -void Shm_Print_statistics( void ); -void MPCI_Fatal( Internal_errors_Source, boolean, rtems_unsigned32 ); -rtems_task Shm_Cause_interrupt( rtems_unsigned32 ); -void Shm_Poll(); -void Shm_setclockvec(); -void Shm_Convert_packet( rtems_packet_prefix * ); - -/* CPU specific routines are inlined in shmcpu.h */ - -/* target specific routines */ -void *Shm_Convert_address( void * ); -void Shm_Get_configuration( rtems_unsigned32, shm_config_table ** ); -void Shm_isr(); -void Shm_setvec( void ); - -void Shm_Initialize_lock( Shm_Locked_queue_Control * ); -void Shm_Lock( Shm_Locked_queue_Control * ); -void Shm_Unlock( Shm_Locked_queue_Control * ); - -/* MPCI entry points */ -rtems_mpci_entry Shm_Get_packet( - rtems_packet_prefix ** -); - -rtems_mpci_entry Shm_Initialization( void ); - -rtems_mpci_entry Shm_Receive_packet( - rtems_packet_prefix ** -); - -rtems_mpci_entry Shm_Return_packet( - rtems_packet_prefix * -); - -rtems_mpci_entry Shm_Send_packet( - rtems_unsigned32, - rtems_packet_prefix * -); - -extern rtems_mpci_table MPCI_table; - -#ifdef _SHM_INIT - -/* multiprocessor communications interface (MPCI) table */ - -rtems_mpci_table MPCI_table = { - 100000, /* default timeout value in ticks */ - MAX_PACKET_SIZE, /* maximum packet size */ - Shm_Initialization, /* initialization procedure */ - Shm_Get_packet, /* get packet procedure */ - Shm_Return_packet, /* return packet procedure */ - Shm_Send_packet, /* packet send procedure */ - Shm_Receive_packet /* packet receive procedure */ -}; - -#endif - -#ifdef __cplusplus -} -#endif - -#endif -/* end of include file */ diff --git a/cpukit/ftpd/Makefile.am b/cpukit/ftpd/Makefile.am deleted file mode 100644 index 9748f0af2c..0000000000 --- a/cpukit/ftpd/Makefile.am +++ /dev/null @@ -1,44 +0,0 @@ -## -## $Id$ -## - -include_rtemsdir = $(includedir)/rtems - -LIBNAME = lib.a -LIB = $(ARCH)/$(LIBNAME) - -C_FILES = ftpd.c -OBJS = $(C_FILES:%.c=$(ARCH)/%.$(OBJEXT)) - -include $(top_srcdir)/../../../automake/compile.am -include $(top_srcdir)/../../../automake/lib.am - -# -# Add local stuff here using += -# - -$(LIB): $(OBJS) - $(make-library) - -all-local: $(PREINSTALL_FILES) $(ARCH) $(OBJS) $(LIB) - -.PRECIOUS: $(LIB) - -EXTRA_DIST = ftpd.c ftpd.h - -include_HEADERS = ftpd.h - -include_rtems_HEADERS = - -PREINSTALL_FILES = $(PROJECT_INCLUDE) \ - $(include_HEADERS:%=$(PROJECT_INCLUDE)/%) \ - $(include_rtems_HEADERS:%=$(PROJECT_INCLUDE)/rtems/%) - -$(PROJECT_INCLUDE)/%.h: %.h - $(INSTALL_DATA) $< $@ -$(PROJECT_INCLUDE)/rtems: - @$(mkinstalldirs) $@ -$(PROJECT_INCLUDE)/rtems/%.h: %.h - $(INSTALL_DATA) $< $@ - -include $(top_srcdir)/../../../automake/local.am diff --git a/cpukit/ftpd/ftpd.c b/cpukit/ftpd/ftpd.c deleted file mode 100644 index 79a293eb0f..0000000000 --- a/cpukit/ftpd/ftpd.c +++ /dev/null @@ -1,2062 +0,0 @@ -/* FIXME: 1. Parse command is a hack. We can do better. - * 2. Some sort of access control? - * 3. OSV: hooks support seems to be bad, as it requires storing of - * entire input file in memory. Seem to be better to change it to - * something more reasonable, like having - * 'hook_write(void const *buf, int count)' routine that will be - * called multiple times while file is being received. - * 4. OSV: Remove hack with "/dev/null"? - * - * FTP Server Daemon - * - * Submitted by: Jake Janovetz - * - * Changed by: Sergei Organov (OSV) - * - * Changes: - * - * 2001-01-31 Sergei Organov - * - * * Hacks with current dir and root dir removed in favor of new libio - * support for task-local current and root directories. - * - * 2001-01-30 Sergei Organov - * - * * Bug in `close_data_socket()' introduced by previous change fixed. - * * `command_pasv()' changed to set timeout on socket we are listening on - * and code fixed to don't close socket twice on error. - * * `serr()' changed to clear `errno'. - * * `data_socket()' changed to clear `errno' before `bind()'. - * * `session()' changed to clear `errno' before processing session. - * - * 2001-01-29 Sergei Organov - * - * * `close_data_socket()' fixed to close both active and passive sockets - * * Initialize info->data_socket to -1 in `daemon()' - * * Initialize `fname' to empty string in `exec_command()' - * - * 2001-01-22 Sergei Organov - * - * * Timeouts on sockets implemented. 'idle' field added to - * configuration. No timeout by default to keep backward compatibility. - * Note: SITE IDLE command not implemented yet. - * * Basic global access control implemented. 'access' field added to - * configuration. No access limitations by default to keep backward - * compatibility. - * - * 2001-01-17 Sergei Organov - * - * * Anchor data socket for active mode (using self IP and port 20.) - * * Fixed default data port support (still not tested). - * * Don't allow IP address different from originating host in - * PORT command to improve security. - * * Fixed bug in MDTM command. - * * Check for correctness of parsing of argument in command_port(). - * * Fixed squeeze_path() to don't allow names like 'NAME/smth' where - * 'NAME' is not a directory. - * * Command parsing a little bit improved: command names are now - * converted to upper-case to be more compatible with RFC (command - * names are not case-sensitive.) - * * Reformat comments so that they have RTEMS look-and-feel. - * - * 2001-01-16 Sergei Organov - * - * * Fixed DELE, SITE CHMOD, RMD, MKD broken by previous changes - * * True ASCII mode implemented (doesn't work for hooks and /dev/null) - * * Passive mode implemented, PASV command added. - * * Default port for data connection could be used (untested, can't find - * ftp client that doesn't send PORT command) - * * SYST reply changed to UNIX, as former RTEMS isn't registered name. - * * Reply codes reviewed and fixed. - * - * 2001-01-08 Sergei Organov - * - * * use pool of pre-created threads to handle sessions - * * LIST output now similar to what "/bin/ls -al" would output, thus - * FTP clients could parse it. - * * LIST NAME now works (both for files and directories) - * * keep track of CWD for every session separately - * * ability to specify root directory name in configuration table - * * options sent in commands are ignored, thus LIST -al FILE works - * * added support for NLST, CDUP and MDTM commands - * * buffers are allocated on stack instead of heap where possible - * * drop using of task notepad to pass parameters - use function - * arguments instead - * * various bug-fixes, e.g., use of PF_INET in socket() instead of - * AF_INET, use snprintf() instead of sprintf() everywhere for safety, - * etc. - * - * $Id$ - */ - -/************************************************************************* - * ftpd.c - ************************************************************************* - * Description: - * - * This file contains the daemon which services requests that appear - * on the FTP port. This server is compatible with FTP, but it - * also provides 'hooks' to make it usable in situations where files - * are not used/necessary. Once the server is started, it runs - * forever. - * - * - * Organization: - * - * The FTP daemon is started upon boot along with a (configurable) - * number of tasks to handle sessions. It runs all the time and - * waits for connections on the known FTP port (21). When - * a connection is made, it wakes-up a 'session' task. That - * session then interacts with the remote host. When the session - * is complete, the session task goes to sleep. The daemon still - * runs, however. - * - * - * Supported commands are: - * - * RETR xxx - Sends a file from the client. - * STOR xxx - Receives a file from the client. xxx = filename. - * LIST xxx - Sends a file list to the client. - * NLST xxx - Sends a file list to the client. - * USER - Does nothing. - * PASS - Does nothing. - * SYST - Replies with the system type (`RTEMS'). - * DELE xxx - Delete file xxx. - * MKD xxx - Create directory xxx. - * RMD xxx - Remove directory xxx. - * PWD - Print working directory. - * CWD xxx - Change working directory. - * CDUP - Change to upper directory. - * SITE CHMOD xxx yyy - Change permissions on file yyy to xxx. - * PORT a,b,c,d,x,y - Setup for a data port to IP address a.b.c.d - * and port (x*256 + y). - * MDTM xxx - Send file modification date/time to the client. - * xxx = filename. - * PASV - Use passive mode data connection. - * - * - * The public routines contained in this file are: - * - * rtems_initialize_ftpd - Initializes and starts the server daemon, - * then returns to its caller. - * - *------------------------------------------------------------------------ - * Jake Janovetz - * University of Illinois - * 1406 West Green Street - * Urbana IL 61801 - ************************************************************************* - * Change History: - * 12/01/97 - Creation (JWJ) - * 2001-01-08 - Changes by OSV - *************************************************************************/ - -/************************************************************************* - * Meanings of first and second digits of reply codes: - * - * Reply: Description: - *-------- -------------- - * 1yz Positive preliminary reply. The action is being started but - * expect another reply before sending another command. - * 2yz Positive completion reply. A new command can be sent. - * 3yz Positive intermediate reply. The command has been accepted - * but another command must be sent. - * 4yz Transient negative completion reply. The requested action did - * not take place, but the error condition is temporary so the - * command can be reissued later. - * 5yz Permanent negative completion reply. The command was not - * accepted and should not be retried. - *------------------------------------------------------------------------- - * x0z Syntax errors. - * x1z Information. - * x2z Connections. Replies referring to the control or data - * connections. - * x3z Authentication and accounting. Replies for the login or - * accounting commands. - * x4z Unspecified. - * x5z Filesystem status. - *************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include "ftpd.h" - - -#ifdef __GNUC__ -/* change to #if 1 to disable syslog entirely */ -#if 0 -#undef syslog -#define syslog(a, b, ...) while(0){} -#endif -#endif - -#define FTPD_SERVER_MESSAGE "RTEMS FTP server (Version 1.1-JWJ) ready." - -#define FTPD_SYSTYPE "UNIX Type: L8" - -/* Seem to be unused */ -#if 0 -#define FTPD_WELCOME_MESSAGE \ - "Welcome to the RTEMS FTP server.\n" \ - "\n" \ - "Login accepted.\n" -#endif - -/* Various buffer sizes */ -enum -{ - FTPD_BUFSIZE = 256, /* Size for temporary buffers */ - FTPD_DATASIZE = 1024, /* Size for file transfer buffers */ - FTPD_STACKSIZE = 8 * 1024, /* Tasks stack size */ -}; - -/* Event to be used by session tasks for waiting */ -enum -{ - FTPD_RTEMS_EVENT = RTEMS_EVENT_1 -}; - -/* Configuration table */ -extern struct rtems_ftpd_configuration rtems_ftpd_configuration; - -/* this is not prototyped in strict ansi mode */ -FILE *fdopen (int fildes, const char *mode); - -/*PAGE - * SessionInfo structure. - * - * The following structure is allocated for each session. - */ -typedef struct -{ - struct sockaddr_in ctrl_addr; /* Control connection self address */ - struct sockaddr_in data_addr; /* Data address set by PORT command */ - struct sockaddr_in def_addr; /* Default address for data */ - int use_default; /* 1 - use default address for data */ - FILE *ctrl_fp; /* File pointer for control connection */ - int ctrl_socket; /* Socket for ctrl connection */ - int pasv_socket; /* Socket for PASV connection */ - int data_socket; /* Socket for data connection */ - int idle; /* Timeout in seconds */ - int xfer_mode; /* Transfer mode (ASCII/binary) */ - rtems_id tid; /* Task id */ -} FTPD_SessionInfo_t; - - -/* - * TaskPool structure. - */ -typedef struct -{ - FTPD_SessionInfo_t *info; - FTPD_SessionInfo_t **queue; - int count; - int head; - int tail; - rtems_id mutex; - rtems_id sem; -} FTPD_TaskPool_t; - -/* - * Task pool instance. - */ -static FTPD_TaskPool_t task_pool; - -/* - * Root directory - */ - -static char const* ftpd_root = "/"; - -/* - * Default idle timeout for sockets in seconds. - */ -static int ftpd_timeout = 0; - -/* - * Global access flags. - */ -static int ftpd_access = 0; - -/*PAGE - * - * serr - * - * Return error string corresponding to current 'errno'. - * - */ -static char const* -serr(void) -{ - int err = errno; - errno = 0; - return strerror(err); -} - -/*PAGE - * - * Utility routines for access control. - * - */ - -static int -can_read(void) -{ - return (ftpd_access & FTPD_NO_READ) == 0; -} - -static int -can_write(void) -{ - return (ftpd_access & FTPD_NO_WRITE) == 0; -} - -/*PAGE - * - * Task pool management routines - * - */ - - -/*PAGE - * - * task_pool_done - * - * Cleanup task pool. - * - * Input parameters: - * count - number of entries in task pool to cleanup - * - * Output parameters: - * NONE - * - */ -static void -task_pool_done(int count) -{ - int i; - for(i = 0; i < count; ++i) - rtems_task_delete(task_pool.info[i].tid); - if(task_pool.info) - free(task_pool.info); - if(task_pool.queue) - free(task_pool.queue); - if(task_pool.mutex != (rtems_id)-1) - rtems_semaphore_delete(task_pool.mutex); - if(task_pool.sem != (rtems_id)-1) - rtems_semaphore_delete(task_pool.sem); - task_pool.info = 0; - task_pool.queue = 0; - task_pool.count = 0; - task_pool.sem = -1; - task_pool.mutex = -1; -} - -/*PAGE - * - * task_pool_init - * - * Initialize task pool. - * - * Input parameters: - * count - number of entries in task pool to create - * priority - priority tasks are started with - * - * Output parameters: - * returns 1 on success, 0 on failure. - * - */ -static void session(rtems_task_argument arg); /* Forward declare */ - -static int -task_pool_init(int count, rtems_task_priority priority) -{ - int i; - rtems_status_code sc; - char id = 'a'; - - task_pool.count = 0; - task_pool.head = task_pool.tail = 0; - task_pool.mutex = (rtems_id)-1; - task_pool.sem = (rtems_id)-1; - - sc = rtems_semaphore_create( - rtems_build_name('F', 'T', 'P', 'M'), - 1, - RTEMS_DEFAULT_ATTRIBUTES - | RTEMS_BINARY_SEMAPHORE - | RTEMS_INHERIT_PRIORITY - | RTEMS_PRIORITY, - RTEMS_NO_PRIORITY, - &task_pool.mutex); - - if(sc == RTEMS_SUCCESSFUL) - sc = rtems_semaphore_create( - rtems_build_name('F', 'T', 'P', 'S'), - count, - RTEMS_DEFAULT_ATTRIBUTES, - RTEMS_NO_PRIORITY, - &task_pool.sem); - - if(sc != RTEMS_SUCCESSFUL) { - task_pool_done(0); - syslog(LOG_ERR, "ftpd: Can not create semaphores"); - return 0; - } - - task_pool.info = (FTPD_SessionInfo_t*) - malloc(sizeof(FTPD_SessionInfo_t) * count); - task_pool.queue = (FTPD_SessionInfo_t**) - malloc(sizeof(FTPD_SessionInfo_t*) * count); - if (NULL == task_pool.info || NULL == task_pool.queue) - { - task_pool_done(0); - syslog(LOG_ERR, "ftpd: Not enough memory"); - return 0; - } - - for(i = 0; i < count; ++i) - { - FTPD_SessionInfo_t *info = &task_pool.info[i]; - sc = rtems_task_create(rtems_build_name('F', 'T', 'P', id), - priority, FTPD_STACKSIZE, - RTEMS_PREEMPT | RTEMS_NO_TIMESLICE | - RTEMS_NO_ASR | RTEMS_INTERRUPT_LEVEL(0), - RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL, - &info->tid); - if (sc == RTEMS_SUCCESSFUL) - { - sc = rtems_task_start( - info->tid, session, (rtems_task_argument)info); - if (sc != RTEMS_SUCCESSFUL) - task_pool_done(i); - } - else - task_pool_done(i + 1); - if (sc != RTEMS_SUCCESSFUL) - { - syslog(LOG_ERR, "ftpd: Could not create/start FTPD session: %s", - rtems_status_text(sc)); - return 0; - } - task_pool.queue[i] = task_pool.info + i; - if (++id > 'z') - id = 'a'; - } - task_pool.count = count; - return 1; -} - -/*PAGE - * - * task_pool_obtain - * - * Obtain free task from task pool. - * - * Input parameters: - * NONE - * - * Output parameters: - * returns pointer to the corresponding SessionInfo structure on success, - * NULL if there are no free tasks in the pool. - * - */ -static FTPD_SessionInfo_t* -task_pool_obtain() -{ - FTPD_SessionInfo_t* info = 0; - rtems_status_code sc; - sc = rtems_semaphore_obtain(task_pool.sem, RTEMS_NO_WAIT, RTEMS_NO_TIMEOUT); - if (sc == RTEMS_SUCCESSFUL) - { - rtems_semaphore_obtain(task_pool.mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT); - info = task_pool.queue[task_pool.head]; - if(++task_pool.head >= task_pool.count) - task_pool.head = 0; - rtems_semaphore_release(task_pool.mutex); - } - return info; -} - -/*PAGE - * - * task_pool_release - * - * Return task obtained by 'obtain()' back to the task pool. - * - * Input parameters: - * info - pointer to corresponding SessionInfo structure. - * - * Output parameters: - * NONE - * - */ -static void -task_pool_release(FTPD_SessionInfo_t* info) -{ - rtems_semaphore_obtain(task_pool.mutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT); - task_pool.queue[task_pool.tail] = info; - if(++task_pool.tail >= task_pool.count) - task_pool.tail = 0; - rtems_semaphore_release(task_pool.mutex); - rtems_semaphore_release(task_pool.sem); -} - -/* - * End of task pool routines - */ - -/*PAGE - * - * Function: send_reply - * - * - * This procedure sends a reply to the client via the control - * connection. - * - * - * Input parameters: - * code - 3-digit reply code. - * text - Reply text. - * - * Output parameters: - * NONE - */ -static void -send_reply(FTPD_SessionInfo_t *info, int code, char *text) -{ - char const* s = (info->xfer_mode == TYPE_A) ? "\r" : ""; - /* If a text reply exists, add it to the reply data. */ - if (text != NULL) - fprintf(info->ctrl_fp, "%d %.70s%s\n", code, text, s); - else - fprintf(info->ctrl_fp, "%d%s\n", code, s); - fflush(info->ctrl_fp); -} - - -/*PAGE - * - * close_socket - * - * Close socket. - * - * Input parameters: - * s - socket descriptor. - * seconds - number of seconds the timeout should be, - * if >= 0 - infinite timeout (no timeout). - * - * Output parameters: - * returns 1 on success, 0 on failure. - */ -static int -set_socket_timeout(int s, int seconds) -{ - int res = 0; - struct timeval tv; - int len = sizeof(tv); - - if(seconds < 0) - seconds = 0; - tv.tv_usec = 0; - tv.tv_sec = seconds; - if(0 != setsockopt(s, SOL_SOCKET, SO_SNDTIMEO, &tv, len)) - syslog(LOG_ERR, "ftpd: Can't set send timeout on socket: %s.", serr()); - else if(0 != setsockopt(s, SOL_SOCKET, SO_RCVTIMEO, &tv, len)) - syslog(LOG_ERR, "ftpd: Can't set receive timeout on socket: %s.", serr()); - else - res = 1; - return res; -} - -/*PAGE - * - * close_socket - * - * Close socket. - * - * Input parameters: - * s - socket descriptor to be closed. - * - * Output parameters: - * returns 1 on success, 0 on failure - */ -static int -close_socket(int s) -{ - if (0 <= s) - { - if (0 != close(s)) - { - shutdown(s, 2); - if (0 != close(s)) - return 0; - } - } - return 1; -} - -/*PAGE - * - * data_socket - * - * Create data socket for session. - * - * Input parameters: - * info - corresponding SessionInfo structure - * - * Output parameters: - * returns socket descriptor, or -1 if failure - * - */ -static int -data_socket(FTPD_SessionInfo_t *info) -{ - int s = info->pasv_socket; - if(0 > s) - { - int on = 1; - s = socket(PF_INET, SOCK_STREAM, 0); - if(0 > s) - send_reply(info, 425, "Can't create data socket."); - else if(0 > setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on))) - { - close_socket(s); - s = -1; - } - else - { - struct sockaddr_in data_source; - int tries; - - /* anchor socket to avoid multi-homing problems */ - data_source = info->ctrl_addr; - data_source.sin_port = htons(20); /* ftp-data port */ - for(tries = 1; tries < 10; ++tries) - { - errno = 0; - if(bind(s, (struct sockaddr *)&data_source, sizeof(data_source)) >= 0) - break; - if (errno != EADDRINUSE) - tries = 10; - else - rtems_task_wake_after(tries * 10); - } - if(tries >= 10) - { - send_reply(info, 425, "Can't bind data socket."); - close_socket(s); - s = -1; - } - else - { - struct sockaddr_in *data_dest = - (info->use_default) ? &info->def_addr : &info->data_addr; - if(0 > connect(s, (struct sockaddr *)data_dest, sizeof(*data_dest))) - { - send_reply(info, 425, "Can't connect data socket."); - close_socket(s); - s = -1; - } - } - } - } - info->data_socket = s; - info->use_default = 1; - if(s >= 0) - set_socket_timeout(s, info->idle); - return s; -} - -/*PAGE - * - * close_data_socket - * - * Close data socket for session. - * - * Input parameters: - * info - corresponding SessionInfo structure - * - * Output parameters: - * NONE - * - */ -static void -close_data_socket(FTPD_SessionInfo_t *info) -{ - /* As at most one data socket could be open simultaneously and in some cases - data_socket == pasv_socket, we select socket to close, then close it. */ - int s = info->data_socket; - if(0 > s) - s = info->pasv_socket; - if(!close_socket(s)) - syslog(LOG_ERR, "ftpd: Error closing data socket."); - info->data_socket = -1; - info->pasv_socket = -1; - info->use_default = 1; -} - -/*PAGE - * - * close_stream - * - * Close control stream of session. - * - * Input parameters: - * info - corresponding SessionInfo structure - * - * Output parameters: - * NONE - * - */ -static void -close_stream(FTPD_SessionInfo_t* info) -{ - if (NULL != info->ctrl_fp) - { - if (0 != fclose(info->ctrl_fp)) - { - syslog(LOG_ERR, "ftpd: Could not close control stream: %s", serr()); - } - else - info->ctrl_socket = -1; - } - - if (!close_socket(info->ctrl_socket)) - syslog(LOG_ERR, "ftpd: Could not close control socket: %s", serr()); - - info->ctrl_fp = NULL; - info->ctrl_socket = -1; -} - - -/*PAGE - * - * send_mode_reply - * - * Sends BINARY/ASCII reply string depending on current transfer mode. - * - * Input parameters: - * info - corresponding SessionInfo structure - * - * Output parameters: - * NONE - * - */ -static void -send_mode_reply(FTPD_SessionInfo_t *info) -{ - if(info->xfer_mode == TYPE_I) - send_reply(info, 150, "Opening BINARY mode data connection."); - else - send_reply(info, 150, "Opening ASCII mode data connection."); -} - -/*PAGE - * - * command_retrieve - * - * Perform the "RETR" command (send file to client). - * - * Input parameters: - * info - corresponding SessionInfo structure - * char *filename - source filename. - * - * Output parameters: - * NONE - * - */ -static void -command_retrieve(FTPD_SessionInfo_t *info, char const *filename) -{ - int s = -1; - int fd = -1; - char buf[FTPD_DATASIZE]; - int res = 0; - - if(!can_read()) - { - send_reply(info, 550, "Access denied."); - return; - } - - if (0 > (fd = open(filename, O_RDONLY))) - { - send_reply(info, 550, "Error opening file."); - return; - } - - send_mode_reply(info); - - s = data_socket(info); - - if (0 <= s) - { - int n = -1; - - if(info->xfer_mode == TYPE_I) - { - while ((n = read(fd, buf, FTPD_DATASIZE)) > 0) - { - if(send(s, buf, n, 0) != n) - break; - } - } - else if (info->xfer_mode == TYPE_A) - { - int rest = 0; - while (rest == 0 && (n = read(fd, buf, FTPD_DATASIZE)) > 0) - { - char const* e = buf; - char const* b; - int i; - rest = n; - do - { - char lf = '\0'; - - b = e; - for(i = 0; i < rest; ++i, ++e) - { - if(*e == '\n') - { - lf = '\n'; - break; - } - } - if(send(s, b, i, 0) != i) - break; - if(lf == '\n') - { - if(send(s, "\r\n", 2, 0) != 2) - break; - ++e; - ++i; - } - } - while((rest -= i) > 0); - } - } - - if (0 == n) - { - if (0 == close(fd)) - { - fd = -1; - res = 1; - } - } - } - - if (-1 != fd) - close(fd); - - if (0 == res) - send_reply(info, 451, "File read error."); - else - send_reply(info, 226, "Transfer complete."); - - close_data_socket(info); - - return; -} - - -/*PAGE - * - * discard - * - * Analog of `write' routine that just discards passed data - * - * Input parameters: - * fd - file descriptor (ignored) - * buf - data to write (ignored) - * count - number of bytes in `buf' - * - * Output parameters: - * returns `count' - * - */ -static ssize_t -discard(int fd, void const* buf, size_t count) -{ - (void)fd; - (void)buf; - return count; -} - -/*PAGE - * - * command_store - * - * Performs the "STOR" command (receive data from client). - * - * Input parameters: - * info - corresponding SessionInfo structure - * char *filename - Destination filename. - * - * Output parameters: - * NONE - */ -static void -command_store(FTPD_SessionInfo_t *info, char const *filename) -{ - int s; - int n; - unsigned long size = 0; - struct rtems_ftpd_hook *usehook = NULL; - char buf[FTPD_DATASIZE]; - int res = 1; - int bare_lfs = 0; - int null = 0; - typedef ssize_t (*WriteProc)(int, void const*, size_t); - WriteProc wrt = &write; - - if(!can_write()) - { - send_reply(info, 550, "Access denied."); - return; - } - - send_mode_reply(info); - - s = data_socket(info); - if(0 > s) - return; - - null = !strcmp("/dev/null", filename); - if (null) - { - /* File "/dev/null" just throws data away. - * FIXME: this is hack. Using `/dev/null' filesystem entry would be - * better. - */ - wrt = &discard; - } - - if (!null && rtems_ftpd_configuration.hooks != NULL) - { - - /* Search our list of hooks to see if we need to do something special. */ - struct rtems_ftpd_hook *hook; - int i; - - i = 0; - hook = &rtems_ftpd_configuration.hooks[i++]; - while (hook->filename != NULL) - { - if (!strcmp(hook->filename, filename)) - { - usehook = hook; - break; - } - hook = &rtems_ftpd_configuration.hooks[i++]; - } - } - - if (usehook != NULL) - { - /* - * OSV: FIXME: Small buffer could be used and hook routine - * called multiple times instead. Alternatively, the support could be - * removed entirely in favor of configuring RTEMS pseudo-device with - * given name. - */ - - char *bigBufr; - size_t filesize = rtems_ftpd_configuration.max_hook_filesize + 1; - - /* - * Allocate space for our "file". - */ - bigBufr = (char *)malloc(filesize); - if (bigBufr == NULL) - { - send_reply(info, 451, "Local resource failure: malloc."); - close_data_socket(info); - return; - } - - /* - * Retrieve the file into our buffer space. - */ - size = 0; - while ((n = recv(s, bigBufr + size, filesize - size, 0)) > 0) - { - size += n; - } - if (size >= filesize) - { - send_reply(info, 451, "File too long: buffer size exceeded."); - free(bigBufr); - close_data_socket(info); - return; - } - - /* - * Call our hook. - */ - res = (usehook->hook_function)(bigBufr, size) == 0; - free(bigBufr); - if(!res) - { - send_reply(info, 451, "File processing failed."); - close_data_socket(info); - return; - } - } - else - { - /* Data transfer to regular file or /dev/null. */ - int fd = 0; - - if(!null) - fd = creat(filename, - S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH); - - if (0 > fd) - { - send_reply(info, 550, "Error creating file."); - close_data_socket(info); - return; - } - - if(info->xfer_mode == TYPE_I) - { - while ((n = recv(s, buf, FTPD_DATASIZE, 0)) > 0) - { - if (wrt(fd, buf, n) != n) - { - res = 0; - break; - } - } - } - else if(info->xfer_mode == TYPE_A) - { - int rest = 0; - int pended_cr = 0; - while (res && rest == 0 && (n = recv(s, buf, FTPD_DATASIZE, 0)) > 0) - { - char const* e = buf; - char const* b; - int i; - - rest = n; - if(pended_cr && *e != '\n') - { - char const lf = '\r'; - pended_cr = 0; - if(wrt(fd, &lf, 1) != 1) - { - res = 0; - break; - } - } - do - { - int count; - int sub = 0; - - b = e; - for(i = 0; i < rest; ++i, ++e) - { - int pcr = pended_cr; - pended_cr = 0; - if(*e == '\r') - { - pended_cr = 1; - } - else if(*e == '\n') - { - if(pcr) - { - sub = 2; - ++i; - ++e; - break; - } - ++bare_lfs; - } - } - if(res == 0) - break; - count = i - sub - pended_cr; - if(count > 0 && wrt(fd, b, count) != count) - { - res = 0; - break; - } - if(sub == 2 && wrt(fd, e - 1, 1) != 1) - res = 0; - } - while((rest -= i) > 0); - } - } - - if (0 > close(fd) || res == 0) - { - send_reply(info, 452, "Error writing file."); - close_data_socket(info); - return; - } - } - - if (bare_lfs > 0) - { - snprintf(buf, FTPD_BUFSIZE, - "Transfer complete. WARNING! %d bare linefeeds received in ASCII mode.", - bare_lfs); - send_reply(info, 226, buf); - } - else - send_reply(info, 226, "Transfer complete."); - close_data_socket(info); - -} - - -/*PAGE - * - * send_dirline - * - * Sends one line of LIST command reply corresponding to single file. - * - * Input parameters: - * s - socket descriptor to send data to - * wide - if 0, send only file name. If not 0, send 'stat' info as well in - * "ls -l" format. - * curTime - current time - * path - path to be prepended to what is given by 'add' - * add - path to be appended to what is given by 'path', the resulting path - * is then passed to 'stat()' routine - * name - file name to be reported in output - * buf - buffer for temporary data - * - * Output parameters: - * returns 0 on failure, 1 on success - * - */ -static int -send_dirline(int s, int wide, time_t curTime, char const* path, - char const* add, char const* fname, char* buf) -{ - if(wide) - { - struct stat stat_buf; - - int plen = strlen(path); - int alen = strlen(add); - if(plen == 0) - { - buf[plen++] = '/'; - buf[plen] = '\0'; - } - else - { - strcpy(buf, path); - if(alen > 0 && buf[plen - 1] != '/') - { - buf[plen++] = '/'; - if(plen >= FTPD_BUFSIZE) - return 0; - buf[plen] = '\0'; - } - } - if(plen + alen >= FTPD_BUFSIZE) - return 0; - strcpy(buf + plen, add); - - if (stat(buf, &stat_buf) == 0) - { - int len; - struct tm bt; - time_t tf = stat_buf.st_mtime; - enum { SIZE = 80 }; - enum { SIX_MONTHS = 365*24*60*60/2 }; - char timeBuf[SIZE]; - gmtime_r(&tf, &bt); - if(curTime > tf + SIX_MONTHS || tf > curTime + SIX_MONTHS) - strftime (timeBuf, SIZE, "%b %d %Y", &bt); - else - strftime (timeBuf, SIZE, "%b %d %H:%M", &bt); - - len = snprintf(buf, FTPD_BUFSIZE, - "%c%c%c%c%c%c%c%c%c%c 1 %5d %5d %11u %s %s\r\n", - (S_ISLNK(stat_buf.st_mode)?('l'): - (S_ISDIR(stat_buf.st_mode)?('d'):('-'))), - (stat_buf.st_mode & S_IRUSR)?('r'):('-'), - (stat_buf.st_mode & S_IWUSR)?('w'):('-'), - (stat_buf.st_mode & S_IXUSR)?('x'):('-'), - (stat_buf.st_mode & S_IRGRP)?('r'):('-'), - (stat_buf.st_mode & S_IWGRP)?('w'):('-'), - (stat_buf.st_mode & S_IXGRP)?('x'):('-'), - (stat_buf.st_mode & S_IROTH)?('r'):('-'), - (stat_buf.st_mode & S_IWOTH)?('w'):('-'), - (stat_buf.st_mode & S_IXOTH)?('x'):('-'), - (int)stat_buf.st_uid, - (int)stat_buf.st_gid, - (int)stat_buf.st_size, - timeBuf, - fname - ); - - if(send(s, buf, len, 0) != len) - return 0; - } - } - else - { - int len = snprintf(buf, FTPD_BUFSIZE, "%s\r\n", fname); - if(send(s, buf, len, 0) != len) - return 0; - } - return 1; -} - -/*PAGE - * - * command_list - * - * Send file list to client. - * - * Input parameters: - * info - corresponding SessionInfo structure - * char *fname - File (or directory) to list. - * - * Output parameters: - * NONE - */ -static void -command_list(FTPD_SessionInfo_t *info, char const *fname, int wide) -{ - int s; - DIR *dirp = 0; - struct dirent *dp = 0; - struct stat stat_buf; - char buf[FTPD_BUFSIZE]; - time_t curTime; - int sc = 1; - - send_reply(info, 150, "Opening ASCII mode data connection for LIST."); - - s = data_socket(info); - if(0 > s) - { - syslog(LOG_ERR, "ftpd: Error connecting to data socket."); - return; - } - - if(fname[0] == '\0') - fname = "."; - - if (0 > stat(fname, &stat_buf)) - { - snprintf(buf, FTPD_BUFSIZE, - "%s: No such file or directory.\r\n", fname); - send(s, buf, strlen(buf), 0); - } - else if (S_ISDIR(stat_buf.st_mode) && (NULL == (dirp = opendir(fname)))) - { - snprintf(buf, FTPD_BUFSIZE, - "%s: Can not open directory.\r\n", fname); - send(s, buf, strlen(buf), 0); - } - else - { - time(&curTime); - if(!dirp && *fname) - sc = sc && send_dirline(s, wide, curTime, fname, "", fname, buf); - else { - /* FIXME: need "." and ".." only when '-a' option is given */ - sc = sc && send_dirline(s, wide, curTime, fname, "", ".", buf); - sc = sc && send_dirline(s, wide, curTime, fname, - (strcmp(fname, ftpd_root) ? ".." : ""), "..", buf); - while (sc && (dp = readdir(dirp)) != NULL) - sc = sc && - send_dirline(s, wide, curTime, fname, dp->d_name, dp->d_name, buf); - } - } - - if(dirp) - closedir(dirp); - close_data_socket(info); - - if(sc) - send_reply(info, 226, "Transfer complete."); - else - send_reply(info, 426, "Connection aborted."); -} - - -/*PAGE - * - * command_cwd - * - * Change current working directory. - * - * Input parameters: - * info - corresponding SessionInfo structure - * dir - directory name passed in CWD command - * - * Output parameters: - * NONE - * - */ -static void -command_cwd(FTPD_SessionInfo_t *info, char *dir) -{ - if(chdir(dir) == 0) - send_reply(info, 250, "CWD command successful."); - else - send_reply(info, 550, "CWD command failed."); -} - - -/*PAGE - * - * command_pwd - * - * Send current working directory to client. - * - * Input parameters: - * info - corresponding SessionInfo structure - * - * Output parameters: - * NONE - */ -static void -command_pwd(FTPD_SessionInfo_t *info) -{ - char buf[FTPD_BUFSIZE]; - char const* cwd; - errno = 0; - buf[0] = '"'; - cwd = getcwd(buf + 1, FTPD_BUFSIZE - 4); - if(cwd) - { - int len = strlen(cwd); - static char const txt[] = "\" is the current directory."; - int size = sizeof(txt); - if(len + size + 1 >= FTPD_BUFSIZE) - size = FTPD_BUFSIZE - len - 2; - memcpy(buf + len + 1, txt, size); - buf[len + size] = '\0'; - send_reply(info, 250, buf); - } - else { - snprintf(buf, FTPD_BUFSIZE, "Error: %s.", serr()); - send_reply(info, 452, buf); - } -} - -/*PAGE - * - * command_mdtm - * - * Handle FTP MDTM command (send file modification time to client)/ - * - * Input parameters: - * info - corresponding SessionInfo structure - * fname - file name passed in MDTM command - * - * Output parameters: - * info->cwd is set to new CWD value. - */ -static void -command_mdtm(FTPD_SessionInfo_t *info, char const* fname) -{ - struct stat stbuf; - char buf[FTPD_BUFSIZE]; - - if (0 > stat(fname, &stbuf)) - { - snprintf(buf, FTPD_BUFSIZE, "%s: %s.", fname, serr()); - send_reply(info, 550, buf); - } - else - { - struct tm *t = gmtime(&stbuf.st_mtime); - snprintf(buf, FTPD_BUFSIZE, "%04d%02d%02d%02d%02d%02d", - 1900 + t->tm_year, - t->tm_mon+1, t->tm_mday, - t->tm_hour, t->tm_min, t->tm_sec); - send_reply(info, 213, buf); - } -} - -/*PAGE - * - * command_port - * - * This procedure fills address for data connection given the IP address and - * port of the remote machine. - * - * Input parameters: - * info - corresponding SessionInfo structure - * args - arguments to the "PORT" command. - * - * Output parameters: - * info->data_addr is set according to arguments of the PORT command. - * info->use_default is set to 0 on success, 1 on failure. - */ -static void -command_port(FTPD_SessionInfo_t *info, char const *args) -{ - enum { NUM_FIELDS = 6 }; - unsigned int a[NUM_FIELDS]; - int n; - - close_data_socket(info); - - n = sscanf(args, "%u,%u,%u,%u,%u,%u", a+0, a+1, a+2, a+3, a+4, a+5); - if(NUM_FIELDS == n) - { - int i; - unsigned8 b[NUM_FIELDS]; - - for(i = 0; i < NUM_FIELDS; ++i) - { - if(a[i] > 255) - break; - b[i] = (unsigned8)a[i]; - } - - if(i == NUM_FIELDS) - { - /* Note: while it contradicts with RFC959, we don't allow PORT command - * to specify IP address different than those of the originating client - * for the sake of safety. */ - unsigned32 const *ip = (unsigned32 *)b; - if(*ip == info->def_addr.sin_addr.s_addr) - { - info->data_addr.sin_addr.s_addr = *ip; - info->data_addr.sin_port = *(unsigned16 *)(b + 4); - info->data_addr.sin_family = AF_INET; - memset(info->data_addr.sin_zero, 0, sizeof(info->data_addr.sin_zero)); - - info->use_default = 0; - send_reply(info, 200, "PORT command successful."); - return; /* success */ - } - else - { - send_reply(info, 425, "Address doesn't match peer's IP."); - return; - } - } - } - send_reply(info, 501, "Syntax error."); -} - - -/*PAGE - * - * command_pasv - * - * Handle FTP PASV command. - * Open socket, listen for and accept connection on it. - * - * Input parameters: - * info - corresponding SessionInfo structure - * - * Output parameters: - * info->pasv_socket is set to the descriptor of the data socket - */ -static void -command_pasv(FTPD_SessionInfo_t *info) -{ - int s = -1; - int err = 1; - - close_data_socket(info); - - s = socket(PF_INET, SOCK_STREAM, 0); - if (s < 0) - syslog(LOG_ERR, "ftpd: Error creating PASV socket: %s", serr()); - else - { - struct sockaddr_in addr; - int addrLen = sizeof(addr); - - addr = info->ctrl_addr; - addr.sin_port = htons(0); - - if (0 > bind(s, (struct sockaddr *)&addr, addrLen)) - syslog(LOG_ERR, "ftpd: Error binding PASV socket: %s", serr()); - else if (0 > listen(s, 1)) - syslog(LOG_ERR, "ftpd: Error listening on PASV socket: %s", serr()); - else if(set_socket_timeout(s, info->idle)) - { - char buf[FTPD_BUFSIZE]; - unsigned char const *ip, *p; - - getsockname(s, (struct sockaddr *)&addr, &addrLen); - ip = (unsigned char const*)&(addr.sin_addr); - p = (unsigned char const*)&(addr.sin_port); - snprintf(buf, FTPD_BUFSIZE, "Entering passive mode (%u,%u,%u,%u,%u,%u).", - ip[0], ip[1], ip[2], ip[3], p[0], p[1]); - send_reply(info, 227, buf); - - info->pasv_socket = accept(s, (struct sockaddr *)&addr, &addrLen); - if (0 > info->pasv_socket) - syslog(LOG_ERR, "ftpd: Error accepting PASV connection: %s", serr()); - else - { - close_socket(s); - s = -1; - err = 0; - } - } - } - if(err) - { - /* (OSV) The note is from FreeBSD FTPD. - * Note: a response of 425 is not mentioned as a possible response to - * the PASV command in RFC959. However, it has been blessed as a - * legitimate response by Jon Postel in a telephone conversation - * with Rick Adams on 25 Jan 89. */ - send_reply(info, 425, "Can't open passive connection."); - close_socket(s); - } -} - - -/*PAGE - * - * skip_options - * - * Utility routine to skip options (if any) from input command. - * - * Input parameters: - * p - pointer to pointer to command - * - * Output parameters: - * p - is changed to point to first non-option argument - */ -static void -skip_options(char **p) -{ - char* buf = *p; - char* last = NULL; - while(1) { - while(isspace(*buf)) - ++buf; - if(*buf == '-') { - if(*++buf == '-') { /* `--' should terminate options */ - if(isspace(*++buf)) { - last = buf; - do ++buf; - while(isspace(*buf)); - break; - } - } - while(*buf && !isspace(*buf)) - ++buf; - last = buf; - } - else - break; - } - if(last) - *last = '\0'; - *p = buf; -} - -/*PAGE - * - * split_command - * - * Split command into command itself, options, and arguments. Command itself - * is converted to upper case. - * - * Input parameters: - * buf - initial command string - * - * Output parameter: - * buf - is modified by inserting '\0' at ends of split entities - * cmd - upper-cased command code - * opts - string containing all the options - * args - string containing all the arguments - */ -void -split_command(char *buf, char **cmd, char **opts, char **args) -{ - char* eoc; - char* p = buf; - while(isspace(*p)) - ++p; - *cmd = p; - while(*p && !isspace(*p)) - { - *p = toupper(*p); - ++p; - } - eoc = p; - if(*p) - *p++ = '\0'; - while(isspace(*p)) - ++p; - *opts = p; - skip_options(&p); - *args = p; - if(*opts == p) - *opts = eoc; - while(*p && *p != '\r' && *p != '\n') - ++p; - if(*p) - *p++ = '\0'; -} - -/*PAGE - * - * exec_command - * - * Parse and execute FTP command. - * - * FIXME: This section is somewhat of a hack. We should have a better - * way to parse commands. - * - * Input parameters: - * info - corresponding SessionInfo structure - * cmd - command to be executed (upper-case) - * args - arguments of the command - * - * Output parameters: - * NONE - */ -static void -exec_command(FTPD_SessionInfo_t *info, char* cmd, char* args) -{ - char fname[FTPD_BUFSIZE]; - int wrong_command = 0; - - fname[0] = '\0'; - - if (!strcmp("PORT", cmd)) - { - command_port(info, args); - } - else if (!strcmp("PASV", cmd)) - { - command_pasv(info); - } - else if (!strcmp("RETR", cmd)) - { - sscanf(args, "%254s", fname); - command_retrieve(info, fname); - } - else if (!strcmp("STOR", cmd)) - { - sscanf(args, "%254s", fname); - command_store(info, fname); - } - else if (!strcmp("LIST", cmd)) - { - sscanf(args, "%254s", fname); - command_list(info, fname, 1); - } - else if (!strcmp("NLST", cmd)) - { - sscanf(args, "%254s", fname); - command_list(info, fname, 0); - } - else if (!strcmp("MDTM", cmd)) - { - sscanf(args, "%254s", fname); - command_mdtm(info, fname); - } - else if (!strcmp("SYST", cmd)) - { - send_reply(info, 215, FTPD_SYSTYPE); - } - else if (!strcmp("TYPE", cmd)) - { - if (args[0] == 'I') - { - info->xfer_mode = TYPE_I; - send_reply(info, 200, "Type set to I."); - } - else if (args[0] == 'A') - { - info->xfer_mode = TYPE_A; - send_reply(info, 200, "Type set to A."); - } - else - { - info->xfer_mode = TYPE_I; - send_reply(info, 504, "Type not implemented. Set to I."); - } - } - else if (!strcmp("USER", cmd) || !strcmp("PASS", cmd)) - { - send_reply(info, 230, "User logged in."); - } - else if (!strcmp("DELE", cmd)) - { - if(!can_write()) - { - send_reply(info, 550, "Access denied."); - } - else if ( - 1 == sscanf(args, "%254s", fname) && - unlink(fname) == 0) - { - send_reply(info, 257, "DELE successful."); - } - else - { - send_reply(info, 550, "DELE failed."); - } - } - else if (!strcmp("SITE", cmd)) - { - char* opts; - split_command(args, &cmd, &opts, &args); - if(!strcmp("CHMOD", cmd)) - { - int mask; - - if(!can_write()) - { - send_reply(info, 550, "Access denied."); - } - else if( - 2 == sscanf(args, "%o %254s", &mask, fname) && - chmod(fname, (mode_t)mask) == 0) - { - send_reply(info, 257, "CHMOD successful."); - } - else - { - send_reply(info, 550, "CHMOD failed."); - } - } - else - wrong_command = 1; - } - else if (!strcmp("RMD", cmd)) - { - if(!can_write()) - { - send_reply(info, 550, "Access denied."); - } - else if ( - 1 == sscanf(args, "%254s", fname) && - rmdir(fname) == 0) - { - send_reply(info, 257, "RMD successful."); - } - else - { - send_reply(info, 550, "RMD failed."); - } - } - else if (!strcmp("MKD", cmd)) - { - if(!can_write()) - { - send_reply(info, 550, "Access denied."); - } - else if ( - 1 == sscanf(args, "%254s", fname) && - mkdir(fname, S_IRWXU | S_IRWXG | S_IRWXO) == 0) - { - send_reply(info, 257, "MKD successful."); - } - else - { - send_reply(info, 550, "MKD failed."); - } - } - else if (!strcmp("CWD", cmd)) - { - sscanf(args, "%254s", fname); - command_cwd(info, fname); - } - else if (!strcmp("CDUP", cmd)) - { - command_cwd(info, ".."); - } - else if (!strcmp("PWD", cmd)) - { - command_pwd(info); - } - else - wrong_command = 1; - - if(wrong_command) - send_reply(info, 500, "Command not understood."); -} - - -/*PAGE - * - * session - * - * This task handles single session. It is waked up when the FTP daemon gets a - * service request from a remote machine. Here, we watch for commands that - * will come through the control connection. These commands are then parsed - * and executed until the connection is closed, either unintentionally or - * intentionally with the "QUIT" command. - * - * Input parameters: - * arg - pointer to corresponding SessionInfo. - * - * Output parameters: - * NONE - */ -static void -session(rtems_task_argument arg) -{ - FTPD_SessionInfo_t *const info = (FTPD_SessionInfo_t *)arg; - int chroot_made = 0; - - rtems_libio_set_private_env(); - - /* chroot() can fail here because the directory may not exist yet. */ - chroot_made = chroot(ftpd_root) == 0; - - while(1) - { - rtems_event_set set; - - rtems_event_receive(FTPD_RTEMS_EVENT, RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, - &set); - - chroot_made = chroot_made || chroot(ftpd_root) == 0; - chdir("/"); - - errno = 0; - - send_reply(info, 220, FTPD_SERVER_MESSAGE); - - while (1) - { - char buf[FTPD_BUFSIZE]; - char *cmd, *opts, *args; - - if (fgets(buf, FTPD_BUFSIZE, info->ctrl_fp) == NULL) - { - syslog(LOG_INFO, "ftpd: Connection aborted."); - break; - } - - split_command(buf, &cmd, &opts, &args); - - if (!strcmp("QUIT", cmd)) - { - send_reply(info, 221, "Goodbye."); - break; - } - else - { - exec_command(info, cmd, args); - } - } - - /* Close connection and put ourselves back into the task pool. */ - close_data_socket(info); - close_stream(info); - task_pool_release(info); - } -} - - -/*PAGE - * - * daemon - * - * This task runs forever. It waits for service requests on the FTP port - * (port 21 by default). When a request is received, it opens a new session - * to handle those requests until the connection is closed. - * - * Input parameters: - * NONE - * - * Output parameters: - * NONE - */ -static void -daemon() -{ - int s; - int addrLen; - struct sockaddr_in addr; - FTPD_SessionInfo_t *info = NULL; - - - s = socket(PF_INET, SOCK_STREAM, 0); - if (s < 0) - syslog(LOG_ERR, "ftpd: Error creating socket: %s", serr()); - - addr.sin_family = AF_INET; - addr.sin_port = htons(rtems_ftpd_configuration.port); - addr.sin_addr.s_addr = htonl(INADDR_ANY); - memset(addr.sin_zero, 0, sizeof(addr.sin_zero)); - - if (0 > bind(s, (struct sockaddr *)&addr, sizeof(addr))) - syslog(LOG_ERR, "ftpd: Error binding control socket: %s", serr()); - else if (0 > listen(s, 1)) - syslog(LOG_ERR, "ftpd: Error listening on control socket: %s", serr()); - else while (1) - { - int ss; - addrLen = sizeof(addr); - ss = accept(s, (struct sockaddr *)&addr, &addrLen); - if (0 > ss) - syslog(LOG_ERR, "ftpd: Error accepting control connection: %s", serr()); - else if(!set_socket_timeout(ss, ftpd_timeout)) - close_socket(ss); - else - { - info = task_pool_obtain(); - if (NULL == info) - { - close_socket(ss); - } - else - { - info->ctrl_socket = ss; - if ((info->ctrl_fp = fdopen(info->ctrl_socket, "r+")) == NULL) - { - syslog(LOG_ERR, "ftpd: fdopen() on socket failed: %s", serr()); - close_stream(info); - task_pool_release(info); - } - else - { - /* Initialize corresponding SessionInfo structure */ - info->def_addr = addr; - if(0 > getsockname(ss, (struct sockaddr *)&addr, &addrLen)) - { - syslog(LOG_ERR, "ftpd: getsockname(): %s", serr()); - close_stream(info); - task_pool_release(info); - } - else - { - info->use_default = 1; - info->ctrl_addr = addr; - info->pasv_socket = -1; - info->data_socket = -1; - info->xfer_mode = TYPE_A; - info->data_addr.sin_port = - htons(ntohs(info->ctrl_addr.sin_port) - 1); - info->idle = ftpd_timeout; - /* Wakeup the session task. The task will call task_pool_release - after it closes connection. */ - rtems_event_send(info->tid, FTPD_RTEMS_EVENT); - } - } - } - } - } - rtems_task_delete(RTEMS_SELF); -} - - -/*PAGE - * - * rtems_ftpd_start - * - * Here, we start the FTPD task which waits for FTP requests and services - * them. This procedure returns to its caller once the task is started. - * - * - * Input parameters: - * - * Output parameters: - * returns RTEMS_SUCCESSFUL on successful start of the daemon. - */ -int -rtems_initialize_ftpd() -{ - rtems_status_code sc; - rtems_id tid; - rtems_task_priority priority; - int count; - - if (rtems_ftpd_configuration.port == 0) - { - rtems_ftpd_configuration.port = FTPD_CONTROL_PORT; - } - - if (rtems_ftpd_configuration.priority == 0) - { - rtems_ftpd_configuration.priority = 40; - } - priority = rtems_ftpd_configuration.priority; - - ftpd_timeout = rtems_ftpd_configuration.idle; - if (ftpd_timeout < 0) - ftpd_timeout = 0; - rtems_ftpd_configuration.idle = ftpd_timeout; - - ftpd_access = rtems_ftpd_configuration.access; - - if (rtems_ftpd_configuration.tasks_count <= 0) - rtems_ftpd_configuration.tasks_count = 1; - count = rtems_ftpd_configuration.tasks_count; - - if (!task_pool_init(count, priority)) - { - syslog(LOG_ERR, "ftpd: Could not initialize task pool."); - return RTEMS_UNSATISFIED; - } - - sc = rtems_task_create(rtems_build_name('F', 'T', 'P', 'D'), - priority, FTPD_STACKSIZE, - RTEMS_PREEMPT | RTEMS_NO_TIMESLICE | RTEMS_NO_ASR | - RTEMS_INTERRUPT_LEVEL(0), - RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL, - &tid); - - if (sc == RTEMS_SUCCESSFUL) - { - sc = rtems_task_start(tid, daemon, 0); - if (sc != RTEMS_SUCCESSFUL) - rtems_task_delete(tid); - } - - if (sc != RTEMS_SUCCESSFUL) - { - task_pool_done(count); - syslog(LOG_ERR, "ftpd: Could not create/start FTP daemon: %s", - rtems_status_text(sc)); - return RTEMS_UNSATISFIED; - } - - ftpd_root = "/"; - if ( - rtems_ftpd_configuration.root && - rtems_ftpd_configuration.root[0] == '/' - ) - ftpd_root = rtems_ftpd_configuration.root; - - rtems_ftpd_configuration.root = ftpd_root; - - syslog(LOG_INFO, "ftpd: FTP daemon started (%d session%s max)", - count, ((count > 1) ? "s" : "")); - - return RTEMS_SUCCESSFUL; -} diff --git a/cpukit/ftpd/ftpd.h b/cpukit/ftpd/ftpd.h deleted file mode 100644 index 678baa3d2b..0000000000 --- a/cpukit/ftpd/ftpd.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * FTP Server Information - * - * $Id$ - */ - -#ifndef __FTPD_H__ -#define __FTPD_H__ - - -#define FTPD_CONTROL_PORT 21 - -/* FTPD access control flags */ -enum -{ - FTPD_NO_WRITE = 0x1, - FTPD_NO_READ = 0x2, - FTPD_NO_RW = FTPD_NO_WRITE | FTPD_NO_READ -}; - -typedef int (*rtems_ftpd_hookfunction)(unsigned char *, unsigned long); - -struct rtems_ftpd_hook -{ - char *filename; - rtems_ftpd_hookfunction hook_function; -}; - -struct rtems_ftpd_configuration -{ - rtems_task_priority priority; /* FTPD task priority */ - unsigned long max_hook_filesize; /* Maximum buffersize */ - /* for hooks */ - int port; /* Well-known port */ - struct rtems_ftpd_hook *hooks; /* List of hooks */ - char const *root; /* Root for FTPD or 0 for / */ - int tasks_count; /* Max. connections */ - int idle; /* Idle timeout in seoconds - or 0 for no (inf) timeout */ - int access; /* 0 - r/w, 1 - read-only, - 2 - write-only, - 3 - browse-only */ -}; - -/* - * Reply codes. - */ -#define PRELIM 1 /* positive preliminary */ -#define COMPLETE 2 /* positive completion */ -#define CONTINUE 3 /* positive intermediate */ -#define TRANSIENT 4 /* transient negative completion */ -#define ERROR 5 /* permanent negative completion */ - -int rtems_initialize_ftpd(); - -#endif /* __FTPD_H__ */ - diff --git a/cpukit/httpd/.cvsignore b/cpukit/httpd/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/cpukit/httpd/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/cpukit/httpd/Makefile.am b/cpukit/httpd/Makefile.am deleted file mode 100644 index 7d84302064..0000000000 --- a/cpukit/httpd/Makefile.am +++ /dev/null @@ -1,59 +0,0 @@ -## -## $Id$ -## - -include_goaheaddir = $(includedir)/goahead - -LIBNAME = lib.a -LIB = $(ARCH)/$(LIBNAME) - -C_FILES = asp.c balloc.c default.c ejlex.c ejparse.c emfdb.c form.c \ - h.c handler.c md5c.c mime.c misc.c webpage.c ringq.c rom.c security.c \ - sock.c socket.c sym.c uemf.c um.c url.c value.c wbase64.c webrom.c webs.c \ - websuemf.c webmain.c -OBJS = $(C_FILES:%.c=$(ARCH)/%.$(OBJEXT)) - -H_FILES = ej.h ejIntrn.h emfdb.h md5.h uemf.h um.h webs.h wsIntrn.h - -include $(top_srcdir)/../../../automake/compile.am -include $(top_srcdir)/../../../automake/lib.am - -# -# Add local stuff here using += -# - -AM_CPPFLAGS += -DWEBS -DUEMF -DOS="RTEMS" - -$(LIB): $(OBJS) - $(make-library) - -$(PROJECT_INCLUDE): - $(mkinstalldirs) $@ - -$(PROJECT_INCLUDE)/goahead: - $(mkinstalldirs) $@ - -$(PROJECT_INCLUDE)/goahead/%.h: %.h - $(INSTALL_DATA) $< $@ - -$(PROJECT_INCLUDE)/rtems_webserver.h: rtems_webserver.h - $(INSTALL_DATA) $< $@ - -PREINSTALL_FILES = $(PROJECT_INCLUDE) $(PROJECT_INCLUDE)/rtems_webserver.h \ - $(PROJECT_INCLUDE)/goahead $(H_FILES:%.h=$(PROJECT_INCLUDE)/goahead/%.h) - -if HAS_POSIX -include_HEADERS = rtems_webserver.h -include_goahead_HEADERS = $(H_FILES) - -all-local: $(PREINSTALL_FILES) $(ARCH) $(OBJS) $(LIB) -endif - -.PRECIOUS: $(LIB) - -EXTRA_DIST = asp.c balloc.c default.c ej.h ejlex.c ejparse.c form.c h.c \ - handler.c mime.c misc.c ringq.c rom.c rtems_webserver.h security.c \ - sock.c socket.c sym.c uemf.c uemf.h um.h url.c value.c wbase64.c webcomp.c \ - webmain.c webpage.c webrom.c webs.c webs.h websuemf.c wsIntrn.h - -include $(top_srcdir)/../../../automake/local.am diff --git a/cpukit/httpd/NOTES b/cpukit/httpd/NOTES deleted file mode 100644 index 6b0e4c55b0..0000000000 --- a/cpukit/httpd/NOTES +++ /dev/null @@ -1,29 +0,0 @@ -# -# $Id$ -# - -Notes on merging GoAhead Webs 2.1. Eventually RTEMS should be supported -in their distributions and this directory removed. - -Applied patch from Antti P Miettinen . - -Obtain the original distribution from http://www.goahead.com for -documentation. - -Tailoring -========= -socket.c is RTEMS specific - -Renames -======= - -Distributed as This Directory -============== ================ -base64.c wbase64.c -page.c webpage.c - -RTEMS Specific Additions -======================== -webmain.c -rtems_webserver.h - diff --git a/cpukit/httpd/asp.c b/cpukit/httpd/asp.c deleted file mode 100644 index 9b37523e02..0000000000 --- a/cpukit/httpd/asp.c +++ /dev/null @@ -1,319 +0,0 @@ -/* - * asp.c -- Active Server Page Support - * - * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved. - * - * See the file "license.txt" for usage and redistribution license requirements - */ - -/******************************** Description *********************************/ - -/* - * The ASP module processes ASP pages and executes embedded scripts. It - * support an open scripting architecture with in-built support for - * Ejscript(TM). - */ - -/********************************* Includes ***********************************/ - -#include "wsIntrn.h" - -/********************************** Locals ************************************/ - -static sym_fd_t websAspFunctions = -1; /* Symbol table of functions */ -static int aspOpenCount = 0; /* count of apps using this module */ - -/***************************** Forward Declarations ***************************/ - -static char_t *strtokcmp(char_t *s1, char_t *s2); -static char_t *skipWhite(char_t *s); - -/************************************* Code ***********************************/ -/* - * Create script spaces and commands - */ - -int websAspOpen() -{ - if (++aspOpenCount == 1) { -/* - * Create the table for ASP functions - */ - websAspFunctions = symOpen(WEBS_SYM_INIT * 2); - -/* - * Create standard ASP commands - */ - websAspDefine(T("write"), websAspWrite); - } - return 0; -} - -/************************************* Code ***********************************/ -/* - * Close Asp symbol table. - */ - -void websAspClose() -{ - if (--aspOpenCount <= 0) { - if (websAspFunctions != -1) { - symClose(websAspFunctions); - websAspFunctions = -1; - } - } -} - -/******************************************************************************/ -/* - * Process ASP requests and expand all scripting commands. We read the - * entire ASP page into memory and then process. If you have really big - * documents, it is better to make them plain HTML files rather than ASPs. - */ - -int websAspRequest(webs_t wp, char_t *lpath) -{ - websStatType sbuf; - char *rbuf; - char_t *token, *lang, *result, *path, *ep, *cp, *buf, *nextp; - char_t *last; - int rc, engine, len, ejid; - - a_assert(websValid(wp)); - a_assert(lpath && *lpath); - - rc = -1; - buf = NULL; - rbuf = NULL; - engine = EMF_SCRIPT_EJSCRIPT; - wp->flags |= WEBS_HEADER_DONE; - path = websGetRequestPath(wp); - -/* - * Create Ejscript instance in case it is needed - */ - ejid = ejOpenEngine(wp->cgiVars, websAspFunctions); - if (ejid < 0) { - websError(wp, 200, T("Can't create Ejscript engine")); - goto done; - } - ejSetUserHandle(ejid, (int) wp); - - if (websPageStat(wp, lpath, path, &sbuf) < 0) { - websError(wp, 200, T("Can't stat %s"), lpath); - goto done; - } - -/* - * Create a buffer to hold the ASP file in-memory - */ - len = sbuf.size * sizeof(char); - if ((rbuf = balloc(B_L, len + 1)) == NULL) { - websError(wp, 200, T("Can't get memory")); - goto done; - } - rbuf[len] = '\0'; - - if (websPageReadData(wp, rbuf, len) != len) { - websError(wp, 200, T("Cant read %s"), lpath); - goto done; - } - websPageClose(wp); - -/* - * Convert to UNICODE if necessary. - */ - if ((buf = ballocAscToUni(rbuf, len)) == NULL) { - websError(wp, 200, T("Can't get memory")); - goto done; - } - -/* - * Scan for the next "<%" - */ - last = buf; - rc = 0; - while (rc == 0 && *last && ((nextp = gstrstr(last, T("<%"))) != NULL)) { - websWriteBlock(wp, last, (nextp - last)); - nextp = skipWhite(nextp + 2); - -/* - * Decode the language - */ - token = T("language"); - - if ((lang = strtokcmp(nextp, token)) != NULL) { - if ((cp = strtokcmp(lang, T("=javascript"))) != NULL) { - engine = EMF_SCRIPT_EJSCRIPT; - } else { - cp = nextp; - } - nextp = cp; - } - -/* - * Find tailing bracket and then evaluate the script - */ - if ((ep = gstrstr(nextp, T("%>"))) != NULL) { - - *ep = '\0'; - last = ep + 2; - nextp = skipWhite(nextp); -/* - * Handle backquoted newlines - */ - for (cp = nextp; *cp; ) { - if (*cp == '\\' && (cp[1] == '\r' || cp[1] == '\n')) { - *cp++ = ' '; - while (*cp == '\r' || *cp == '\n') { - *cp++ = ' '; - } - } else { - cp++; - } - } - -/* - * Now call the relevant script engine. Output is done directly - * by the ASP script procedure by calling websWrite() - */ - if (*nextp) { - result = NULL; - if (engine == EMF_SCRIPT_EJSCRIPT) { - rc = scriptEval(engine, nextp, &result, ejid); - } else { - rc = scriptEval(engine, nextp, &result, (int) wp); - } - if (rc < 0) { -/* - * On an error, discard all output accumulated so far - * and store the error in the result buffer. Be careful if the - * user has called websError() already. - */ - if (websValid(wp)) { - if (result) { - websWrite(wp, T("

ASP Error: %s

\n"), - result); - websWrite(wp, T("
%s
"), nextp); - bfree(B_L, result); - } else { - websWrite(wp, T("

ASP Error

\n%s\n"), - nextp); - } - websWrite(wp, T("\n")); - rc = 0; - } - goto done; - } - } - - } else { - websError(wp, 200, T("Unterminated script in %s: \n"), lpath); - rc = -1; - goto done; - } - } -/* - * Output any trailing HTML page text - */ - if (last && *last && rc == 0) { - websWriteBlock(wp, last, gstrlen(last)); - } - rc = 0; - -/* - * Common exit and cleanup - */ -done: - if (websValid(wp)) { - websPageClose(wp); - if (ejid >= 0) { - ejCloseEngine(ejid); - } - } - bfreeSafe(B_L, buf); - bfreeSafe(B_L, rbuf); - return rc; -} - -/******************************************************************************/ -/* - * Define an ASP Ejscript function. Bind an ASP name to a C procedure. - */ - -int websAspDefine(char_t *name, - int (*fn)(int ejid, webs_t wp, int argc, char_t **argv)) -{ - return ejSetGlobalFunctionDirect(websAspFunctions, name, - (int (*)(int, void*, int, char_t**)) fn); -} - -/******************************************************************************/ -/* - * Asp write command. This implemements <% write("text"); %> command - */ - -int websAspWrite(int ejid, webs_t wp, int argc, char_t **argv) -{ - int i; - - a_assert(websValid(wp)); - - for (i = 0; i < argc; ) { - a_assert(argv); - if (websWriteBlock(wp, argv[i], gstrlen(argv[i])) < 0) { - return -1; - } - if (++i < argc) { - if (websWriteBlock(wp, T(" "), 2) < 0) { - return -1; - } - } - } - return 0; -} - -/******************************************************************************/ -/* - * strtokcmp -- Find s2 in s1. We skip leading white space in s1. - * Return a pointer to the location in s1 after s2 ends. - */ - -static char_t *strtokcmp(char_t *s1, char_t *s2) -{ - int len; - - s1 = skipWhite(s1); - len = gstrlen(s2); - for (len = gstrlen(s2); len > 0 && (tolower(*s1) == tolower(*s2)); len--) { - if (*s2 == '\0') { - return s1; - } - s1++; - s2++; - } - if (len == 0) { - return s1; - } - return NULL; -} - -/******************************************************************************/ -/* - * Skip white space - */ - -static char_t *skipWhite(char_t *s) -{ - a_assert(s); - - if (s == NULL) { - return s; - } - while (*s && gisspace(*s)) { - s++; - } - return s; -} - -/******************************************************************************/ diff --git a/cpukit/httpd/balloc.c b/cpukit/httpd/balloc.c deleted file mode 100644 index d535a6605c..0000000000 --- a/cpukit/httpd/balloc.c +++ /dev/null @@ -1,966 +0,0 @@ -/* - * balloc.c -- Block allocation module - * - * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved. - * - * See the file "license.txt" for usage and redistribution license requirements - */ - -/******************************** Description *********************************/ - -/* - * This module implements a very fast block allocation scheme suitable for - * ROMed environments. It maintains block class queues for rapid allocation - * and minimal fragmentation. This module does not coalesce blocks. The - * storage space may be populated statically or via the traditional malloc - * mechanisms. Large blocks greater than the maximum class size may be - * allocated from the O/S or run-time system via malloc. To permit the use - * of malloc, call bopen with flags set to B_USE_MALLOC (this is the default). - * It is recommended that bopen be called first thing in the application. - * If it is not, it will be called with default values on the first call to - * balloc(). Note that this code is not designed for multi-threading purposes - * and it depends on newly declared variables being initialized to zero. - */ - -/********************************* Includes ***********************************/ - -#define IN_BALLOC - -#if UEMF - #include "uemf.h" -#else - #include "basic/basicInternal.h" -#endif - -#include -#include - -#if !NO_BALLOC -/********************************* Defines ************************************/ - -/* - * Define B_STATS if you wish to track memory block and stack usage - */ -#if B_STATS -/* - * Optional statistics - */ - -typedef struct { - long alloc; /* Block allocation calls */ - long inuse; /* Blocks in use */ -} bStatsType; - -typedef struct { - char_t file[FNAMESIZE]; - long allocated; /* Bytes currently allocated */ - long count; /* Current block count */ - long times; /* Count of alloc attempts */ - long largest; /* largest allocated here */ - int q; -} bStatsFileType; - -/* - * This one is very expensive but great stats - */ -typedef struct { - void *ptr; /* Pointer to memory */ - bStatsFileType *who; /* Who allocated the memory */ -} bStatsBlkType; - -static bStatsType bStats[B_MAX_CLASS]; /* Per class stats */ -static bStatsFileType bStatsFiles[B_MAX_FILES];/* Per file stats */ -static bStatsBlkType bStatsBlks[B_MAX_BLOCKS];/* Per block stats */ -static int bStatsBlksMax = 0; /* Max block entry */ -static int bStatsFilesMax = 0; /* Max file entry */ -static int bStatsMemInUse = 0; /* Memory currently in use */ -static int bStatsBallocInUse = 0; /* Memory currently balloced */ -static int bStatsMemMax = 0; /* Max memory ever used */ -static int bStatsBallocMax = 0; /* Max memory ever balloced */ -static void *bStackMin = (void*) -1;/* Miniumum stack position */ -static void *bStackStart; /* Starting stack position */ -static int bStatsMemMalloc = 0; /* Malloced memory */ -#endif /* B_STATS */ - -/* - * ROUNDUP4(size) returns the next higher integer value of size that is - * divisible by 4, or the value of size if size is divisible by 4. - * ROUNDUP4() is used in aligning memory allocations on 4-byte boundaries. - * - * Note: ROUNDUP4() is only required on some operating systems (IRIX). - */ - -#define ROUNDUP4(size) ((size) % 4) ? (size) + (4 - ((size) % 4)) : (size) - -/********************************** Locals ************************************/ -/* - * bQhead blocks are created as the original memory allocation is freed up. - * See bfree. - */ -static bType *bQhead[B_MAX_CLASS]; /* Per class block q head */ -static char *bFreeBuf; /* Pointer to free memory */ -static char *bFreeNext; /* Pointer to next free mem */ -static int bFreeSize; /* Size of free memory */ -static int bFreeLeft; /* Size of free left for use */ -static int bFlags = B_USE_MALLOC; /* Default to auto-malloc */ -static int bopenCount = 0; /* Num tasks using balloc */ - -/*************************** Forward Declarations *****************************/ - -#if B_STATS -static void bStatsAlloc(B_ARGS_DEC, void *ptr, int q, int size); -static void bStatsFree(B_ARGS_DEC, void *ptr, int q, int size); -static void bstatsWrite(int handle, char_t *fmt, ...); -static int bStatsFileSort(const void *cp1, const void *cp2); -#endif /* B_STATS */ - -#if B_FILL || B_VERIFY_CAUSES_SEVERE_OVERHEAD -static void bFillBlock(void *buf, int bufsize); -#endif - -#if B_VERIFY_CAUSES_SEVERE_OVERHEAD -static void verifyUsedBlock(bType *bp, int q); -static void verifyFreeBlock(bType *bp, int q); -void verifyBallocSpace(); -#endif - -static int ballocGetSize(int size, int *q); - -/********************************** Code **************************************/ -/* - * Initialize the balloc module. bopen should be called the very first thing - * after the application starts and bclose should be called the last thing - * before exiting. If bopen is not called, it will be called on the first - * allocation with default values. "buf" points to memory to use of size - * "bufsize". If buf is NULL, memory is allocated using malloc. flags may - * be set to B_USE_MALLOC if using malloc is okay. This routine will allocate - * an initial buffer of size bufsize for use by the application. - */ - -int bopen(void *buf, int bufsize, int flags) -{ - bFlags = flags; - -#if BASTARD_TESTING - srand(time(0L)); -#endif /* BASTARD_TESTING */ - -/* - * If bopen already called by a shared process, just increment the count - * and return; - */ - if (++bopenCount > 1) { - return 0; - } - - if (buf == NULL) { - if (bufsize == 0) { - bufsize = B_DEFAULT_MEM; - } -#ifdef IRIX - bufsize = ROUNDUP4(bufsize); -#endif - if ((buf = malloc(bufsize)) == NULL) { - return -1; - } -#if B_STATS - bStatsMemMalloc += bufsize; -#endif - } else { - bFlags |= B_USER_BUF; - } - - bFreeSize = bFreeLeft = bufsize; - bFreeBuf = bFreeNext = buf; - memset(bQhead, 0, sizeof(bQhead)); -#if B_FILL || B_VERIFY_CAUSES_SEVERE_OVERHEAD - bFillBlock(buf, bufsize); -#endif -#if B_STATS - bStackStart = &buf; -#endif -#if B_VERIFY_CAUSES_SEVERE_OVERHEAD - verifyFreeBlock(buf, bufsize); -#endif - return 0; -} - -/******************************************************************************/ -/* - * Close down the balloc module and free all malloced memory. - */ - -void bclose() -{ -#if B_VERIFY_CAUSES_SEVERE_OVERHEAD - verifyBallocSpace(); -#endif - if (--bopenCount <= 0 && !(bFlags & B_USER_BUF)) { - free(bFreeBuf); - bopenCount = 0; - } -} - -/******************************************************************************/ -/* - * Allocate a block of the requested size. First check the block - * queues for a suitable one. - */ - -void *balloc(B_ARGS_DEC, int size) -{ - bType *bp; - int q, memSize; - -/* - * Call bopen with default values if the application has not yet done so - */ - if (bFreeBuf == NULL) { - if (bopen(NULL, B_DEFAULT_MEM, 0) < 0) { - return NULL; - } - } -#if B_VERIFY_CAUSES_SEVERE_OVERHEAD - verifyBallocSpace(); -#endif - if (size < 0) { - return NULL; - } - -#if BASTARD_TESTING - if (rand() == 0x7fff) { - return NULL; - } -#endif /* BASTARD_TESTING */ - - - memSize = ballocGetSize(size, &q); - - if (q >= B_MAX_CLASS) { -/* - * Size if bigger than the maximum class. Malloc if use has been okayed - */ - if (bFlags & B_USE_MALLOC) { -#if B_STATS - bstats(0, NULL); -#endif -#ifdef IRIX - memSize = ROUNDUP4(memSize); -#endif - bp = (bType*) malloc(memSize); - if (bp == NULL) { - traceRaw(T("B: malloc failed\n")); - return NULL; - } -#if B_STATS - bStatsMemMalloc += memSize; -#endif -#if B_FILL || B_VERIFY_CAUSES_SEVERE_OVERHEAD - bFillBlock(bp, memSize); -#endif - - } else { - traceRaw(T("B: malloc failed\n")); - return NULL; - } - -/* - * the u.size is the actual size allocated for data - */ - bp->u.size = memSize - sizeof(bType); - bp->flags = B_MALLOCED; - - } else if ((bp = bQhead[q]) != NULL) { -/* - * Take first block off the relevant q if non-empty - */ - bQhead[q] = bp->u.next; -#if B_VERIFY_CAUSES_SEVERE_OVERHEAD - verifyFreeBlock(bp, q); -#endif -#if B_FILL || B_VERIFY_CAUSES_SEVERE_OVERHEAD - bFillBlock(bp, memSize); -#endif - bp->u.size = memSize - sizeof(bType); - bp->flags = 0; - - } else { - if (bFreeLeft > memSize) { -/* - * The q was empty, and the free list has spare memory so - * create a new block out of the primary free block - */ - bp = (bType*) bFreeNext; -#if B_VERIFY_CAUSES_SEVERE_OVERHEAD - verifyFreeBlock(bp, q); -#endif - bFreeNext += memSize; - bFreeLeft -= memSize; -#if B_FILL || B_VERIFY_CAUSES_SEVERE_OVERHEAD - bFillBlock(bp, memSize); -#endif - bp->u.size = memSize - sizeof(bType); - bp->flags = 0; - - } else if (bFlags & B_USE_MALLOC) { -#if B_STATS - static int once = 0; - if (once++ == 0) { - bstats(0, NULL); - } -#endif -/* - * Nothing left on the primary free list, so malloc a new block - */ -#ifdef IRIX - memSize = ROUNDUP4(memSize); -#endif - if ((bp = (bType*) malloc(memSize)) == NULL) { - traceRaw(T("B: malloc failed\n")); - return NULL; - } -#if B_STATS - bStatsMemMalloc += memSize; -#endif -#if B_FILL || B_VERIFY_CAUSES_SEVERE_OVERHEAD - bFillBlock(bp, memSize); -#endif - bp->u.size = memSize - sizeof(bType); - bp->flags = B_MALLOCED; - - } else { - traceRaw(T("B: malloc failed\n")); - return NULL; - } - } - -#if B_STATS - bStatsAlloc(B_ARGS, bp, q, memSize); -#endif - bp->flags |= B_INTEGRITY; - -/* - * The following is a good place to put a breakpoint when trying to reduce - * determine and reduce maximum memory use. - */ -#if 0 -#if B_STATS - if (bStatsBallocInUse == bStatsBallocMax) { - bstats(0, NULL); - } -#endif -#endif - return (void*) ((char*) bp + sizeof(bType)); -} - -/******************************************************************************/ -/* - * Free a block back to the relevant free q. We don't free back to the O/S - * or run time system unless the block is greater than the maximum class size. - * We also do not coalesce blocks. - */ - -void bfree(B_ARGS_DEC, void *mp) -{ - bType *bp; - int q, memSize; - -#if B_VERIFY_CAUSES_SEVERE_OVERHEAD - verifyBallocSpace(); -#endif - bp = (bType*) ((char*) mp - sizeof(bType)); - - a_assert((bp->flags & B_INTEGRITY_MASK) == B_INTEGRITY); - - if ((bp->flags & B_INTEGRITY_MASK) != B_INTEGRITY) { - return; - } - - memSize = ballocGetSize(bp->u.size, &q); - -#if B_VERIFY_CAUSES_SEVERE_OVERHEAD - verifyUsedBlock(bp,q); -#endif -#if B_STATS - bStatsFree(B_ARGS, bp, q, bp->u.size+sizeof(bType)); -#endif - if (bp->flags & B_MALLOCED) { - free(bp); - return; - } - -#if B_VERIFY_CAUSES_SEVERE_OVERHEAD - bFillBlock(bp, memSize); -#endif - -/* - * Simply link onto the head of the relevant q - */ - bp->u.next = bQhead[q]; - bQhead[q] = bp; - - bp->flags = B_FILL_WORD; -} - -/******************************************************************************/ -/* - * Safe free - */ - -void bfreeSafe(B_ARGS_DEC, void *mp) -{ - if (mp) { - bfree(B_ARGS, mp); - } -} - -/******************************************************************************/ -#if UNICODE -/* - * Duplicate a string, allow NULL pointers and then dup an empty string. - */ - -char *bstrdupA(B_ARGS_DEC, char *s) -{ - char *cp; - int len; - - if (s == NULL) { - s = ""; - } - len = strlen(s) + 1; - if (cp = balloc(B_ARGS, len)) { - strcpy(cp, s); - } - return cp; -} - -#endif /* UNICODE */ -/******************************************************************************/ -/* - * Duplicate an ascii string, allow NULL pointers and then dup an empty string. - * If UNICODE, bstrdup above works with wide chars, so we need this routine - * for ascii strings. - */ - -char_t *bstrdup(B_ARGS_DEC, char_t *s) -{ - char_t *cp; - int len; - - if (s == NULL) { - s = T(""); - } - len = gstrlen(s) + 1; - if ((cp = balloc(B_ARGS, len * sizeof(char_t))) != NULL) { - gstrcpy(cp, s); - } - return cp; -} - -/******************************************************************************/ -/* - * Reallocate a block. Allow NULL pointers and just do a malloc. - * Note: if the realloc fails, we return NULL and the previous buffer is - * preserved. - */ - -void *brealloc(B_ARGS_DEC, void *mp, int newsize) -{ - bType *bp; - void *newbuf; - - if (mp == NULL) { - return balloc(B_ARGS, newsize); - } - bp = (bType*) ((char*) mp - sizeof(bType)); - a_assert((bp->flags & B_INTEGRITY_MASK) == B_INTEGRITY); - -/* - * If the allocated memory already has enough room just return the previously - * allocated address. - */ - if (bp->u.size >= newsize) { - return mp; - } - if ((newbuf = balloc(B_ARGS, newsize)) != NULL) { - memcpy(newbuf, mp, bp->u.size); - bfree(B_ARGS, mp); - } - return newbuf; -} - -/******************************************************************************/ -/* - * Find the size of the block to be balloc'ed. It takes in a size, finds the - * smallest binary block it fits into, adds an overhead amount and returns. - * q is the binary size used to keep track of block sizes in use. Called - * from both balloc and bfree. - */ - -static int ballocGetSize(int size, int *q) -{ - int mask; - - mask = (size == 0) ? 0 : (size-1) >> B_SHIFT; - for (*q = 0; mask; mask >>= 1) { - *q = *q + 1; - } - return ((1 << (B_SHIFT + *q)) + sizeof(bType)); -} - -/******************************************************************************/ -#if B_FILL || B_VERIFY_CAUSES_SEVERE_OVERHEAD -/* - * Fill the block (useful during development to catch zero fill assumptions) - */ - -static void bFillBlock(void *buf, int bufsize) -{ - memset(buf, B_FILL_CHAR, bufsize); -} -#endif - -/******************************************************************************/ -#if B_STATS -/* - * Statistics. Do output via calling the writefn callback function with - * "handle" as the output file handle. - */ - -void bstats(int handle, void (*writefn)(int handle, char_t *fmt, ...)) -{ - bStatsFileType *fp, *files; - bStatsBlkType *blkp; - bType *bp; - char_t *cp; - int q, count, mem, total, len; - static int recurseProtect = 0; - - if (recurseProtect++ > 0) { - recurseProtect--; - return; - } - - if (writefn == NULL) { - writefn = bstatsWrite; - } - -/* - * Print stats for each memory block - */ - (*writefn)(handle, T("\nMemory Stats\n")); - -/* - * The following tabular format is now used for the output. - * Q Size Free Bytes Inuse Bytes Allocs - * dd ddddd ddd ddddd dddd ddddd dddd - */ - (*writefn)(handle, " Q Size Free Bytes Inuse Bytes Allocs\n"); - - total = 0; - for (q = 0; q < B_MAX_CLASS; q++) { - count = 0; - for (bp = bQhead[q]; bp; bp = bp->u.next) { - count++; - } - mem = count * (1 << (q + B_SHIFT)); - total += mem; - (*writefn)(handle, - T("%2d %5d %4d %6d %4d %5d %4d\n"), - q, 1 << (q + B_SHIFT), count, mem, bStats[q].inuse, - bStats[q].inuse * (1 << (q + B_SHIFT)), bStats[q].alloc); - } - - (*writefn)(handle, T("\n")); - -/* - * Print summary stats - * - * bFreeSize Initial memory reserved with bopen call - * bStatsMemMalloc memory from calls to system MALLOC - * bStatsMemMax - * bStatsBallocMax largest amount of memory from balloc calls - * bStatsMemInUse - * bStatsBallocInUse present balloced memory being used - * bStatsBlksMax); - * bStackStart - * bStackMin); - * total); - * bFreeLeft); - * - */ - (*writefn)(handle, T("Initial free list size %7d\n"), bFreeSize); - (*writefn)(handle, T("Max memory malloced %7d\n"), bStatsMemMalloc); - (*writefn)(handle, T("Max memory ever used %7d\n"), bStatsMemMax); - (*writefn)(handle, T("Max memory ever balloced %7d\n"), bStatsBallocMax); - (*writefn)(handle, T("Memory currently in use %7d\n"), bStatsMemInUse); - (*writefn)(handle, T("Memory currently balloced %7d\n"), bStatsBallocInUse); - (*writefn)(handle, T("Max blocks allocated %7d\n"), bStatsBlksMax); - (*writefn)(handle, T("Maximum stack used %7d\n"), - (int) bStackStart - (int) bStackMin); - - (*writefn)(handle, T("Free memory on all queues %7d\n"), total); - (*writefn)(handle, T("Free list buffer left %7d\n"), bFreeLeft); - (*writefn)(handle, T("Total free memory %7d\n"), bFreeLeft + total); - -/* - * Print per file allocation stats. Sort the copied table. - */ - len = sizeof(bStatsFileType) * B_MAX_FILES; - files = malloc(len); - if (files == NULL) { - (*writefn)(handle, T("Can't allocate stats memory\n")); - recurseProtect--; - return; - } - memcpy(files, bStatsFiles, len); - qsort(files, bStatsFilesMax, sizeof(bStatsFileType), bStatsFileSort); - - (*writefn)(handle, T("\nMemory Currently Allocated\n")); - total = 0; - (*writefn)(handle, - T(" bytes, blocks in use, total times,") - T("largest, q\n")); - - for (fp = files; fp < &files[bStatsFilesMax]; fp++) { - if (fp->file[0]) { - (*writefn)(handle, T("%18s, %7d, %5d, %6d, %7d,%4d\n"), - fp->file, fp->allocated, fp->count, fp->times, fp->largest, - fp->q); - total += fp->allocated; - } - } - (*writefn)(handle, T("\nTotal allocated %7d\n\n"), total); - -/* - * Dump the actual strings - */ - (*writefn)(handle, T("\nStrings\n")); - for (blkp = &bStatsBlks[bStatsBlksMax - 1]; blkp >= bStatsBlks; blkp--) { - if (blkp->ptr) { - cp = (char_t*) ((char*) blkp->ptr + sizeof(bType)); - fp = blkp->who; - if (gisalnum(*cp)) { - (*writefn)(handle, T("%-50s allocated by %s\n"), cp, - fp->file); - } - } - } - free(files); - recurseProtect--; -} - -/******************************************************************************/ -/* - * File sort function. Used to sort per file stats - */ - -static int bStatsFileSort(const void *cp1, const void *cp2) -{ - bStatsFileType *s1, *s2; - - s1 = (bStatsFileType*) cp1; - s2 = (bStatsFileType*) cp2; - - if (s1->allocated < s2->allocated) - return -1; - else if (s1->allocated == s2->allocated) - return 0; - return 1; -} - -/******************************************************************************/ -/* - * Accumulate allocation statistics - */ - -static void bStatsAlloc(B_ARGS_DEC, void *ptr, int q, int size) -{ - int memSize; - bStatsFileType *fp; - bStatsBlkType *bp; - char_t name[FNAMESIZE + 10]; - - gsprintf(name, T("%s:%d"), B_ARGS); - - bStats[q].alloc++; - bStats[q].inuse++; - bStatsMemInUse += size; - if (bStatsMemInUse > bStatsMemMax) { - bStatsMemMax = bStatsMemInUse; - } - memSize = (1 << (B_SHIFT + q)) + sizeof(bType); - bStatsBallocInUse += memSize; - if (bStatsBallocInUse > bStatsBallocMax) { - bStatsBallocMax = bStatsBallocInUse; - } - -/* - * Track maximum stack usage. Assumes a stack growth down. Approximate as - * we only measure this on block allocation. - */ - if ((void*) &file < bStackMin) { - bStackMin = (void*) &file; - } - -/* - * Find the file and adjust the stats for this file - */ - for (fp = bStatsFiles; fp < &bStatsFiles[bStatsFilesMax]; fp++) { - if (fp->file[0] == file[0] && gstrcmp(fp->file, name) == 0) { - fp->allocated += size; - fp->count++; - fp->times++; - if (fp->largest < size) { - fp->largest = size; - fp->q = q; - } - break; - } - } - -/* - * New entry: find the first free slot and create a new entry - */ - if (fp >= &bStatsFiles[bStatsFilesMax]) { - for (fp = bStatsFiles; fp < &bStatsFiles[B_MAX_FILES]; fp++) { - if (fp->file[0] == '\0') { - gstrncpy(fp->file, name, TSZ(fp->file)); - fp->allocated += size; - fp->count++; - fp->times++; - fp->largest = size; - fp->q = q; - if ((fp - bStatsFiles) >= bStatsFilesMax) { - bStatsFilesMax = (fp - bStatsFiles) + 1; - } - break; - } - } - } - -/* - * Update the per block stats. Allocate a new slot. - */ - for (bp = bStatsBlks; bp < &bStatsBlks[B_MAX_BLOCKS]; bp++) { - if (bp->ptr == NULL) { - bp->ptr = ptr; - bp->who = fp; - if ((bp - bStatsBlks) >= bStatsBlksMax) { - bStatsBlksMax = (bp - bStatsBlks) + 1; - } - break; - } - } -} - -/******************************************************************************/ -/* - * Free statistics - */ - -static void bStatsFree(B_ARGS_DEC, void *ptr, int q, int size) -{ - int memSize; - bStatsFileType *fp; - bStatsBlkType *bp; - - memSize = (1 << (B_SHIFT + q)) + sizeof(bType); - bStatsMemInUse -= size; - bStatsBallocInUse -= memSize; - bStats[q].inuse--; - -/* - * Update the per block stats. Try from the end first - */ - for (bp = &bStatsBlks[bStatsBlksMax - 1]; bp >= bStatsBlks; bp--) { - if (bp->ptr == ptr) { - bp->ptr = NULL; - fp = bp->who; - bp->who = NULL; - fp->allocated -= size; - fp->count--; - return; - } - } -} - -/******************************************************************************/ -/* - * Default output function. Just send to trace channel. - */ - -#undef sprintf -static void bstatsWrite(int handle, char_t *fmt, ...) -{ - va_list args; - char_t buf[BUF_MAX]; - - va_start(args, fmt); - vsprintf(buf, fmt, args); - va_end(args); - traceRaw(buf); -} - - -#else /* not B_STATS */ -/******************************************************************************/ -/* - * Dummy bstats for external calls that aren't protected by #if B_STATS. - */ - -void bstats(int handle, void (*writefn)(int handle, char_t *fmt, ...)) -{ -} -#endif /* B_STATS */ - -/******************************************************************************/ -#if B_VERIFY_CAUSES_SEVERE_OVERHEAD -/* - * The following routines verify the integrity of the balloc memory space. - * These functions use the B_FILL feature. Corruption is defined - * as bad integrity flags in allocated blocks or data other than B_FILL_CHAR - * being found anywhere in the space which is unallocated and that is not a - * next pointer in the free queues. a_assert is called if any corruption is - * found. CAUTION: These functions add severe processing overhead and should - * only be used when searching for a tough corruption problem. - */ - -/******************************************************************************/ -/* - * verifyUsedBlock verifies that a block which was previously allocated is - * still uncorrupted. - */ - -static void verifyUsedBlock(bType *bp, int q) -{ - int memSize, size; - char *p; - - memSize = (1 << (B_SHIFT + q)) + sizeof(bType); - a_assert((bp->flags & ~B_MALLOCED) == B_INTEGRITY); - size = bp->u.size; - for (p = ((char *)bp)+sizeof(bType)+size; p < ((char*)bp)+memSize; p++) { - a_assert(*p == B_FILL_CHAR); - } -} - -/******************************************************************************/ -/* - * verifyFreeBlock verifies that a previously free'd block in one of the queues - * is still uncorrupted. - */ - -static void verifyFreeBlock(bType *bp, int q) -{ - int memSize; - char *p; - - memSize = (1 << (B_SHIFT + q)) + sizeof(bType); - for (p = ((char *)bp)+sizeof(void*); p < ((char*)bp)+memSize; p++) { - a_assert(*p == B_FILL_CHAR); - } - bp = (bType *)p; - a_assert((bp->flags & ~B_MALLOCED) == B_INTEGRITY || - bp->flags == B_FILL_WORD); -} - -/******************************************************************************/ -/* - * verifyBallocSpace reads through the entire balloc memory space and - * verifies that all allocated blocks are uncorrupted and that, with the - * exception of free list next pointers, all other unallocated space is - * filled with B_FILL_CHAR. - */ - -void verifyBallocSpace() -{ - int q; - char *p; - bType *bp; - -/* - * First verify all the free blocks. - */ - for (q = 0; q < B_MAX_CLASS; q++) { - for (bp = bQhead[q]; bp != NULL; bp = bp->u.next) { - verifyFreeBlock(bp, q); - } - } - -/* - * Now verify other space - */ - p = bFreeBuf; - while (p < (bFreeBuf + bFreeSize)) { - bp = (bType *)p; - if (bp->u.size > 0xFFFFF) { - p += sizeof(bp->u); - while (p < (bFreeBuf + bFreeSize) && *p == B_FILL_CHAR) { - p++; - } - } else { - a_assert(((bp->flags & ~B_MALLOCED) == B_INTEGRITY) || - bp->flags == B_FILL_WORD); - p += (sizeof(bType) + bp->u.size); - while (p < (bFreeBuf + bFreeSize) && *p == B_FILL_CHAR) { - p++; - } - } - } -} -#endif /* B_VERIFY_CAUSES_SEVERE_OVERHEAD */ - -/******************************************************************************/ - -#else /* NO_BALLOC */ -int bopen(void *buf, int bufsize, int flags) -{ - return 0; -} - -/******************************************************************************/ - -void bclose() -{ -} - -/******************************************************************************/ - -void bstats(int handle, void (*writefn)(int handle, char_t *fmt, ...)) -{ -} - -/******************************************************************************/ - -char_t *bstrdupNoBalloc(char_t *s) -{ -#if UNICODE - if (s) { - return wcsdup(s); - } else { - return wcsdup(T("")); - } -#else - return bstrdupANoBalloc(s); -#endif -} - -/******************************************************************************/ - -char *bstrdupANoBalloc(char *s) -{ - char* buf; - - if (s == NULL) { - s = ""; - } - buf = malloc(strlen(s)+1); - strcpy(buf, s); - return buf; -} - -#endif /* NO_BALLOC */ -/******************************************************************************/ - diff --git a/cpukit/httpd/default.c b/cpukit/httpd/default.c deleted file mode 100644 index 6851995872..0000000000 --- a/cpukit/httpd/default.c +++ /dev/null @@ -1,402 +0,0 @@ -/* - * default.c -- Default URL handler. Includes support for ASP. - * - * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved. - * - * See the file "license.txt" for usage and redistribution license requirements - * - * $Id$ - */ - -/******************************** Description *********************************/ - -/* - * This module provides default URL handling and Active Server Page support. - * - * In many cases we don't check the return code of calls to websWrite as - * it is easier, smaller and non-fatal to continue even when the requesting - * browser has gone away. - */ - -/********************************* Includes ***********************************/ - -#include "wsIntrn.h" - -/*********************************** Locals ***********************************/ - -static char_t *websDefaultPage; /* Default page name */ -static char_t *websDefaultDir; /* Default Web page directory */ - -/**************************** Forward Declarations ****************************/ - -static void websDefaultWriteEvent(webs_t wp); - -/*********************************** Code *************************************/ -/* - * Process a default URL request. This will validate the URL and handle "../" - * and will provide support for Active Server Pages. As the handler is the - * last handler to run, it always indicates that it has handled the URL - * by returning 1. - */ - -int websDefaultHandler(webs_t wp, char_t *urlPrefix, char_t *webDir, int arg, - char_t *url, char_t *path, char_t *query) -{ - websStatType sbuf; - char_t *lpath, *tmp, *date; - int bytes, flags, nchars; - - a_assert(websValid(wp)); - a_assert(url && *url); - a_assert(path); - a_assert(query); - -/* - * Validate the URL and ensure that ".."s don't give access to unwanted files - */ - flags = websGetRequestFlags(wp); - - if (websValidateUrl(wp, path) < 0) { - websError(wp, 500, T("Invalid URL %s"), url); - return 1; - } - lpath = websGetRequestLpath(wp); - nchars = gstrlen(lpath) - 1; - if (lpath[nchars] == '/' || lpath[nchars] == '\\') { - lpath[nchars] = '\0'; - } - -/* - * If the file is a directory, redirect using the nominated default page - */ - if (websPageIsDirectory(lpath)) { - nchars = gstrlen(path); - if (path[nchars-1] == '/' || path[nchars-1] == '\\') { - path[--nchars] = '\0'; - } - nchars += gstrlen(websDefaultPage) + 2; - fmtAlloc(&tmp, nchars, T("%s/%s"), path, websDefaultPage); - websRedirect(wp, tmp); - bfreeSafe(B_L, tmp); - return 1; - } - -/* - * Open the document. Stat for later use. - */ - if (websPageOpen(wp, lpath, path, SOCKET_RDONLY | SOCKET_BINARY, - 0666) < 0) { - websError(wp, 400, - T("Cannot open URL %s"), url); - return 1; - } - if (websPageStat(wp, lpath, path, &sbuf) < 0) { - websError(wp, 400, T("Cannot stat page for URL %s"), - url); - return 1; - } - -/* - * If the page has not been modified since the user last received it and it - * is not dynamically generated each time (ASP), then optimize request by - * sending a 304 Use local copy response - */ - websStats.localHits++; -#if WEBS_IF_MODIFIED_SUPPORT - if (flags & WEBS_IF_MODIFIED && !(flags & WEBS_ASP)) { - if (sbuf.mtime <= wp->since) { - websWrite(wp, T("HTTP/1.0 304 Use local copy\r\n")); - -/* - * by license terms the following line of code must - * not be modified. - */ - websWrite(wp, T("Server: %s\r\n"), WEBS_NAME); - - if (flags & WEBS_KEEP_ALIVE) { - websWrite(wp, T("Connection: keep-alive\r\n")); - } - websWrite(wp, T("\r\n")); - websSetRequestFlags(wp, flags |= WEBS_HEADER_DONE); - websDone(wp, 304); - return 1; - } - } -#endif - -/* - * Output the normal HTTP response header - */ - if ((date = websGetDateString(NULL)) != NULL) { - websWrite(wp, T("HTTP/1.0 200 OK\r\nDate: %s\r\n"), date); - -/* - * By license terms the following line of code must not be modified. - */ - websWrite(wp, T("Server: %s\r\n"), WEBS_NAME); - bfree(B_L, date); - } - flags |= WEBS_HEADER_DONE; - -/* - * If this is an ASP request, ensure the remote browser doesn't cache it. - * Send back both HTTP/1.0 and HTTP/1.1 cache control directives - */ - if (flags & WEBS_ASP) { - bytes = 0; - websWrite(wp, T("Pragma: no-cache\r\nCache-Control: no-cache\r\n")); - - } else { - if ((date = websGetDateString(&sbuf)) != NULL) { - websWrite(wp, T("Last-modified: %s\r\n"), date); - bfree(B_L, date); - } - bytes = sbuf.size; - } - - if (bytes) { - websWrite(wp, T("Content-length: %d\r\n"), bytes); - websSetRequestBytes(wp, bytes); - } - websWrite(wp, T("Content-type: %s\r\n"), websGetRequestType(wp)); - - if ((flags & WEBS_KEEP_ALIVE) && !(flags & WEBS_ASP)) { - websWrite(wp, T("Connection: keep-alive\r\n")); - } - websWrite(wp, T("\r\n")); - -/* - * All done if the browser did a HEAD request - */ - if (flags & WEBS_HEAD_REQUEST) { - websDone(wp, 200); - return 1; - } - -/* - * Evaluate ASP requests - */ - if (flags & WEBS_ASP) { - if (websAspRequest(wp, lpath) < 0) { - return 1; - } - websDone(wp, 200); - return 1; - } - -#ifdef WEBS_SSL_SUPPORT - if (wp->flags & WEBS_SECURE) { - websDefaultWriteEvent(wp); - } else { - websSetRequestSocketHandler(wp, SOCKET_WRITABLE, websDefaultWriteEvent); - } -#else -/* - * For normal web documents, return the data via background write - */ - websSetRequestSocketHandler(wp, SOCKET_WRITABLE, websDefaultWriteEvent); -#endif - return 1; -} - -/******************************************************************************/ -/* - * Validate the URL path and process ".." path segments. Return -1 if the URL - * is bad. - */ - -int websValidateUrl(webs_t wp, char_t *path) -{ - char_t *parts[64]; /* Array of ptr's to URL parts */ - char_t *token, *dir, *lpath; - int i, len, npart; - - a_assert(websValid(wp)); - a_assert(path); - - dir = websGetRequestDir(wp); - if (dir == NULL || *dir == '\0') { - return -1; - } - -/* - * Copy the string so we don't destroy the original - */ - path = bstrdup(B_L, path); - websDecodeUrl(path, path, gstrlen(path)); - - len = npart = 0; - parts[0] = NULL; - token = gstrtok(path, T("/")); - -/* - * Look at each directory segment and process "." and ".." segments - * Don't allow the browser to pop outside the root web. - */ - while (token != NULL) { - if (gstrcmp(token, T("..")) == 0) { - if (npart > 0) { - npart--; - } - - } else if (gstrcmp(token, T(".")) != 0) { - parts[npart] = token; - len += gstrlen(token) + 1; - npart++; - } - token = gstrtok(NULL, T("/")); - } - -/* - * Create local path for document. Need extra space all "/" and null. - */ - if (npart || (gstrcmp(path, T("/")) == 0) || (path[0] == '\0')) { - lpath = balloc(B_L, (gstrlen(dir) + 1 + len + 1) * sizeof(char_t)); - gstrcpy(lpath, dir); - - for (i = 0; i < npart; i++) { - gstrcat(lpath, T("/")); - gstrcat(lpath, parts[i]); - } - websSetRequestLpath(wp, lpath); - bfree(B_L, path); - bfree(B_L, lpath); - - } else { - bfree(B_L, path); - return -1; - } - return 0; -} - -/******************************************************************************/ -/* - * Do output back to the browser in the background. This is a socket - * write handler. - */ - -static void websDefaultWriteEvent(webs_t wp) -{ - int len, wrote, flags, bytes, written; - char *buf; - - a_assert(websValid(wp)); - - flags = websGetRequestFlags(wp); - - websMarkTime(wp); - - wrote = bytes = 0; - written = websGetRequestWritten(wp); - -/* - * We only do this for non-ASP documents - */ - if ( !(flags & WEBS_ASP)) { - bytes = websGetRequestBytes(wp); -/* - * Note: websWriteDataNonBlock may return less than we wanted. It will - * return -1 on a socket error - */ - if ((buf = balloc(B_L, PAGE_READ_BUFSIZE)) == NULL) { - websError(wp, 200, T("Can't get memory")); - } - else { - while ((len = websPageReadData(wp, buf, PAGE_READ_BUFSIZE)) > 0) { - if ((wrote = websWriteDataNonBlock(wp, buf, len)) < 0) { - break; - } - written += wrote; - if (wrote != len) { - websPageSeek(wp, - (len - wrote)); - break; - } - } -/* - * Safety. If we are at EOF, we must be done - */ - if (len == 0) { - a_assert(written >= bytes); - written = bytes; - } - bfree(B_L, buf); - } - } - -/* - * We're done if an error, or all bytes output - */ - websSetRequestWritten(wp, written); - if (wrote < 0 || written >= bytes) { - websDone(wp, 200); - } -} - -/******************************************************************************/ -/* - * Closing down. Free resources. - */ - -void websDefaultClose() -{ - if (websDefaultPage) { - bfree(B_L, websDefaultPage); - websDefaultPage = NULL; - } - if (websDefaultDir) { - bfree(B_L, websDefaultDir); - websDefaultDir = NULL; - } -} - -/******************************************************************************/ -/* - * Get the default page for URL requests ending in "/" - */ - -char_t *websGetDefaultPage() -{ - return websDefaultPage; -} - -/******************************************************************************/ -/* - * Get the default web directory - */ - -char_t *websGetDefaultDir() -{ - return websDefaultDir; -} - -/******************************************************************************/ -/* - * Set the default page for URL requests ending in "/" - */ - -void websSetDefaultPage(char_t *page) -{ - a_assert(page && *page); - - if (websDefaultPage) { - bfree(B_L, websDefaultPage); - } - websDefaultPage = bstrdup(B_L, page); -} - -/******************************************************************************/ -/* - * Set the default web directory - */ - -void websSetDefaultDir(char_t *dir) -{ - a_assert(dir && *dir); - if (websDefaultDir) { - bfree(B_L, websDefaultDir); - } - websDefaultDir = bstrdup(B_L, dir); -} - -/******************************************************************************/ - diff --git a/cpukit/httpd/ej.h b/cpukit/httpd/ej.h deleted file mode 100644 index fa7a51a771..0000000000 --- a/cpukit/httpd/ej.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * ej.h -- Ejscript(TM) header - * - * Copyright (c) GoAhead Software Inc., 1992-2000. All Rights Reserved. - * - * See the file "license.txt" for information on usage and redistribution - */ - -#ifndef _h_EJ -#define _h_EJ 1 - -/******************************** Description *********************************/ - -/* - * GoAhead Ejscript(TM) header. This defines the Ejscript API and internal - * structures. - */ - -/********************************* Includes ***********************************/ - -#if ! UEMF - #include "basic/basic.h" - #include "emf/emf.h" -#else - #include "uemf.h" -#endif - -/********************************** Defines ***********************************/ - -/******************************** Prototypes **********************************/ - -extern int ejArgs(int argc, char_t **argv, char_t *fmt, ...); -extern void ejSetResult(int eid, char_t *s); -extern int ejOpenEngine(sym_fd_t variables, sym_fd_t functions); -extern void ejCloseEngine(int eid); -extern int ejSetGlobalFunction(int eid, char_t *name, - int (*fn)(int eid, void *handle, int argc, char_t **argv)); -extern void ejSetVar(int eid, char_t *var, char_t *value); -extern int ejGetVar(int eid, char_t *var, char_t **value); -extern char_t *ejEval(int eid, char_t *script, char_t **emsg); - -#endif /* _h_EJ */ - -/*****************************************************************************/ diff --git a/cpukit/httpd/ejIntrn.h b/cpukit/httpd/ejIntrn.h deleted file mode 100644 index 0ab7b9b5e5..0000000000 --- a/cpukit/httpd/ejIntrn.h +++ /dev/null @@ -1,228 +0,0 @@ -/* - * ejIntrn.h -- Ejscript(TM) header - * - * Copyright (c) GoAhead Software, Inc., 1992-2000 - * - * See the file "license.txt" for information on usage and redistribution - */ - -#ifndef _h_EJINTERNAL -#define _h_EJINTERNAL 1 - -/******************************** Description *********************************/ - -/* - * GoAhead Ejscript(TM) header. This defines the Ejscript API and internal - * structures. - */ - -/********************************* Includes ***********************************/ - -#include -#include -#include - -#if CE -#if ! UEMF - #include -#endif -#endif - -#if LYNX - #include -#endif - -#ifdef QNX4 - #include -#endif - -#if UEMF - #include "uemf.h" -#else - #include - #include - #include "basic/basicInternal.h" - #include "emf/emfInternal.h" -#endif - -#include "ej.h" - -/********************************** Defines ***********************************/ -/* - * Constants - */ -#define EJ_INC 110 /* Growth for tags/tokens */ -#define EJ_SCRIPT_INC 1023 /* Growth for ej scripts */ -#define EJ_OFFSET 1 /* hAlloc doesn't like 0 entries */ -#define EJ_MAX_RECURSE 100 /* Sanity for maximum recursion */ - -/* - * Ejscript Lexical analyser tokens - */ -#define TOK_ERR -1 /* Any error */ -#define TOK_LPAREN 1 /* ( */ -#define TOK_RPAREN 2 /* ) */ -#define TOK_IF 3 /* if */ -#define TOK_ELSE 4 /* else */ -#define TOK_LBRACE 5 /* { */ -#define TOK_RBRACE 6 /* } */ -#define TOK_LOGICAL 7 /* ||, &&, ! */ -#define TOK_EXPR 8 /* +, -, /, % */ -#define TOK_SEMI 9 /* ; */ -#define TOK_LITERAL 10 /* literal string */ -#define TOK_FUNCTION 11 /* function name */ -#define TOK_NEWLINE 12 /* newline white space */ -#define TOK_ID 13 /* function name */ -#define TOK_EOF 14 /* End of script */ -#define TOK_COMMA 15 /* Comma */ -#define TOK_VAR 16 /* var */ -#define TOK_ASSIGNMENT 17 /* = */ -#define TOK_FOR 18 /* for */ -#define TOK_INC_DEC 19 /* ++, -- */ -#define TOK_RETURN 20 /* return */ - -/* - * Expression operators - */ -#define EXPR_LESS 1 /* < */ -#define EXPR_LESSEQ 2 /* <= */ -#define EXPR_GREATER 3 /* > */ -#define EXPR_GREATEREQ 4 /* >= */ -#define EXPR_EQ 5 /* == */ -#define EXPR_NOTEQ 6 /* != */ -#define EXPR_PLUS 7 /* + */ -#define EXPR_MINUS 8 /* - */ -#define EXPR_DIV 9 /* / */ -#define EXPR_MOD 10 /* % */ -#define EXPR_LSHIFT 11 /* << */ -#define EXPR_RSHIFT 12 /* >> */ -#define EXPR_MUL 13 /* * */ -#define EXPR_ASSIGNMENT 14 /* = */ -#define EXPR_INC 15 /* ++ */ -#define EXPR_DEC 16 /* -- */ -#define EXPR_BOOL_COMP 17 /* ! */ -/* - * Conditional operators - */ -#define COND_AND 1 /* && */ -#define COND_OR 2 /* || */ -#define COND_NOT 3 /* ! */ - -/* - * States - */ -#define STATE_ERR -1 /* Error state */ -#define STATE_EOF 1 /* End of file */ -#define STATE_COND 2 /* Parsing a "(conditional)" stmt */ -#define STATE_COND_DONE 3 -#define STATE_RELEXP 4 /* Parsing a relational expr */ -#define STATE_RELEXP_DONE 5 -#define STATE_EXPR 6 /* Parsing an expression */ -#define STATE_EXPR_DONE 7 -#define STATE_STMT 8 /* Parsing General statement */ -#define STATE_STMT_DONE 9 -#define STATE_STMT_BLOCK_DONE 10 /* End of block "}" */ -#define STATE_ARG_LIST 11 /* Function arg list */ -#define STATE_ARG_LIST_DONE 12 -#define STATE_DEC_LIST 16 /* Declaration list */ -#define STATE_DEC_LIST_DONE 17 -#define STATE_DEC 18 -#define STATE_DEC_DONE 19 - -#define STATE_RET 20 /* Return statement */ - -#define STATE_BEGIN STATE_STMT - -/* - * Flags. Used in ej_t and as parameter to parse() - */ -#define FLAGS_EXE 0x1 /* Execute statements */ -#define FLAGS_VARIABLES 0x2 /* Allocated variables store */ -#define FLAGS_FUNCTIONS 0x4 /* Allocated function store */ - -/* - * Function call structure - */ -typedef struct { - char_t *fname; /* Function name */ - char_t **args; /* Args for function (halloc) */ - int nArgs; /* Number of args */ -} ejfunc_t; - -/* - * EJ evaluation block structure - */ -typedef struct ejEval { - ringq_t tokbuf; /* Current token */ - ringq_t script; /* Input script for parsing */ - char_t *putBackToken; /* Putback token string */ - int putBackTokenId; /* Putback token ID */ - char_t *line; /* Current line */ - int lineLength; /* Current line length */ - int lineNumber; /* Parse line number */ - int lineColumn; /* Column in line */ -} ejinput_t; - -/* - * Per Ejscript session structure - */ -typedef struct ej { - ejinput_t *input; /* Input evaluation block */ - sym_fd_t functions; /* Symbol table for functions */ - sym_fd_t *variables; /* hAlloc list of variables */ - int variableMax; /* Number of entries */ - ejfunc_t *func; /* Current function */ - char_t *result; /* Current expression result */ - char_t *error; /* Error message */ - char_t *token; /* Pointer to token string */ - int tid; /* Current token id */ - int eid; /* Halloc handle */ - int flags; /* Flags */ - int userHandle; /* User defined handle */ -} ej_t; - -/******************************** Prototypes **********************************/ - -extern int ejOpenBlock(int eid); -extern int ejCloseBlock(int eid, int vid); -extern char_t *ejEvalBlock(int eid, char_t *script, char_t **emsg); -#ifndef __NO_EJ_FILE -extern char_t *ejEvalFile(int eid, char_t *path, char_t **emsg); -#endif -extern int ejRemoveGlobalFunction(int eid, char_t *name); -extern void *ejGetGlobalFunction(int eid, char_t *name); -extern int ejSetGlobalFunctionDirect(sym_fd_t functions, char_t *name, - int (*fn)(int eid, void *handle, int argc, char_t **argv)); -extern void ejError(ej_t* ep, char_t* fmt, ...); -extern void ejSetUserHandle(int eid, int handle); -extern int ejGetUserHandle(int eid); -extern int ejGetLineNumber(int eid); -extern char_t *ejGetResult(int eid); -extern void ejSetLocalVar(int eid, char_t *var, char_t *value); -extern void ejSetGlobalVar(int eid, char_t *var, char_t *value); - -extern int ejLexOpen(ej_t* ep); -extern void ejLexClose(ej_t* ep); -extern int ejLexOpenScript(ej_t* ep, char_t *script); -extern void ejLexCloseScript(ej_t* ep); -extern void ejLexSaveInputState(ej_t* ep, ejinput_t* state); -extern void ejLexFreeInputState(ej_t* ep, ejinput_t* state); -extern void ejLexRestoreInputState(ej_t* ep, ejinput_t* state); -extern int ejLexGetToken(ej_t* ep, int state); -extern void ejLexPutbackToken(ej_t* ep, int tid, char_t *string); - -extern sym_fd_t ejGetVariableTable(int eid); -extern sym_fd_t ejGetFunctionTable(int eid); - -extern int ejEmfOpen(int eid); -extern void ejEmfClose(int eid); - -extern int ejEmfDbRead(int eid, void *handle, int argc, char_t **argv); -extern int ejEmfDbReadKeyed(int eid, void *handle, int argc, char_t **argv); -extern int ejEmfDbTableGetNrow(int eid, void *handle, int argc, char_t **argv); -extern int ejEmfDbDeleteRow(int eid, void *handle, int argc, char_t **argv); -extern int ejEmfTrace(int eid, void *handle, int argc, char_t **argv); -extern int ejEmfDbWrite(int eid, void *handle, int argc, char_t **argv); -extern int ejEmfDbCollectTable(int eid, void *handle, int argc, char_t **argv); - -#endif /* _h_EJINTERNAL */ diff --git a/cpukit/httpd/ejlex.c b/cpukit/httpd/ejlex.c deleted file mode 100644 index ea5cead255..0000000000 --- a/cpukit/httpd/ejlex.c +++ /dev/null @@ -1,713 +0,0 @@ -/* - * ejlex.c -- Ejscript(TM) Lexical Analyser - * - * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved. - * - * See the file "license.txt" for usage and redistribution license requirements - */ - -/******************************** Description *********************************/ - -/* - * Ejscript lexical analyser. This implementes a lexical analyser for a - * a subset of the JavaScript language. - */ - -/********************************** Includes **********************************/ - -#include "ejIntrn.h" - -#if UEMF - #include "uemf.h" -#else - #include "basic/basicInternal.h" -#endif - -/********************************** Defines ***********************************/ -#define OCTAL 8 -#define HEX 16 -/****************************** Forward Declarations **************************/ - -static int getLexicalToken(ej_t* ep, int state); -static int tokenAddChar(ej_t *ep, int c); -static int inputGetc(ej_t* ep); -static void inputPutback(ej_t* ep, int c); -static int charConvert(ej_t* ep, int base, int maxDig); - -/************************************* Code ***********************************/ -/* - * Setup the lexical analyser - */ - -int ejLexOpen(ej_t* ep) -{ - return 0; -} - -/******************************************************************************/ -/* - * Close the lexicial analyser - */ - -void ejLexClose(ej_t* ep) -{ -} - -/******************************************************************************/ -/* - * Open a new input script - */ - -int ejLexOpenScript(ej_t* ep, char_t *script) -{ - ejinput_t *ip; - - a_assert(ep); - a_assert(script); - - if ((ep->input = balloc(B_L, sizeof(ejinput_t))) == NULL) { - return -1; - } - ip = ep->input; - memset(ip, 0, sizeof(*ip)); - - a_assert(ip); - a_assert(ip->putBackToken == NULL); - a_assert(ip->putBackTokenId == 0); - -/* - * Create the parse token buffer and script buffer - */ - if (ringqOpen(&ip->tokbuf, EJ_INC, -1) < 0) { - return -1; - } - if (ringqOpen(&ip->script, EJ_SCRIPT_INC, -1) < 0) { - return -1; - } -/* - * Put the Ejscript into a ring queue for easy parsing - */ - ringqPutStr(&ip->script, script); - - ip->lineNumber = 1; - ip->lineLength = 0; - ip->lineColumn = 0; - ip->line = NULL; - - return 0; -} - -/******************************************************************************/ -/* - * Close the input script - */ - -void ejLexCloseScript(ej_t* ep) -{ - ejinput_t *ip; - - a_assert(ep); - - ip = ep->input; - a_assert(ip); - - if (ip->putBackToken) { - bfree(B_L, ip->putBackToken); - ip->putBackToken = NULL; - } - ip->putBackTokenId = 0; - - if (ip->line) { - bfree(B_L, ip->line); - ip->line = NULL; - } - - ringqClose(&ip->tokbuf); - ringqClose(&ip->script); - - bfree(B_L, ip); -} - -/******************************************************************************/ -/* - * Save the input state - */ - -void ejLexSaveInputState(ej_t* ep, ejinput_t* state) -{ - ejinput_t *ip; - - a_assert(ep); - - ip = ep->input; - a_assert(ip); - - *state = *ip; - if (ip->putBackToken) { - state->putBackToken = bstrdup(B_L, ip->putBackToken); - } -} - -/******************************************************************************/ -/* - * Restore the input state - */ - -void ejLexRestoreInputState(ej_t* ep, ejinput_t* state) -{ - ejinput_t *ip; - - a_assert(ep); - - ip = ep->input; - a_assert(ip); - - ip->tokbuf = state->tokbuf; - ip->script = state->script; - ip->putBackTokenId = state->putBackTokenId; - if (ip->putBackToken) { - bfree(B_L, ip->putBackToken); - } - if (state->putBackToken) { - ip->putBackToken = bstrdup(B_L, state->putBackToken); - } -} - -/******************************************************************************/ -/* - * Free a saved input state - */ - -void ejLexFreeInputState(ej_t* ep, ejinput_t* state) -{ - if (state->putBackToken) { - bfree(B_L, state->putBackToken); - state->putBackToken = NULL; - } -} - -/******************************************************************************/ -/* - * Get the next Ejscript token - */ - -int ejLexGetToken(ej_t* ep, int state) -{ - ep->tid = getLexicalToken(ep, state); - trace(9, T("ejGetToken: %d, \"%s\"\n"), ep->tid, ep->token); - return ep->tid; -} - -/******************************************************************************/ -/* - * Get the next Ejscript token - */ - -static int getLexicalToken(ej_t* ep, int state) -{ - ringq_t *inq, *tokq; - ejinput_t* ip; - int done, tid, c, quote, style; - - a_assert(ep); - ip = ep->input; - a_assert(ip); - - inq = &ip->script; - tokq = &ip->tokbuf; - - ep->tid = -1; - tid = -1; - ep->token = T(""); - - ringqFlush(tokq); - - if (ip->putBackTokenId > 0) { - ringqPutStr(tokq, ip->putBackToken); - tid = ip->putBackTokenId; - ip->putBackTokenId = 0; - ep->token = (char_t*) tokq->servp; - return tid; - } - - if ((c = inputGetc(ep)) < 0) { - return TOK_EOF; - } - - for (done = 0; !done; ) { - switch (c) { - case -1: - return TOK_EOF; - - case ' ': - case '\t': - case '\r': - do { - if ((c = inputGetc(ep)) < 0) - break; - } while (c == ' ' || c == '\t' || c == '\r'); - break; - - case '\n': - return TOK_NEWLINE; - - case '(': - tokenAddChar(ep, c); - return TOK_LPAREN; - - case ')': - tokenAddChar(ep, c); - return TOK_RPAREN; - - case '{': - tokenAddChar(ep, c); - return TOK_LBRACE; - - case '}': - tokenAddChar(ep, c); - return TOK_RBRACE; - - case '+': - if ((c = inputGetc(ep)) < 0) { - ejError(ep, T("Syntax Error")); - return TOK_ERR; - } - if (c != '+' ) { - inputPutback(ep, c); - tokenAddChar(ep, EXPR_PLUS); - return TOK_EXPR; - } - tokenAddChar(ep, EXPR_INC); - return TOK_INC_DEC; - - case '-': - if ((c = inputGetc(ep)) < 0) { - ejError(ep, T("Syntax Error")); - return TOK_ERR; - } - if (c != '-' ) { - inputPutback(ep, c); - tokenAddChar(ep, EXPR_MINUS); - return TOK_EXPR; - } - tokenAddChar(ep, EXPR_DEC); - return TOK_INC_DEC; - - case '*': - tokenAddChar(ep, EXPR_MUL); - return TOK_EXPR; - - case '%': - tokenAddChar(ep, EXPR_MOD); - return TOK_EXPR; - - case '/': -/* - * Handle the division operator and comments - */ - if ((c = inputGetc(ep)) < 0) { - ejError(ep, T("Syntax Error")); - return TOK_ERR; - } - if (c != '*' && c != '/') { - inputPutback(ep, c); - tokenAddChar(ep, EXPR_DIV); - return TOK_EXPR; - } - style = c; -/* - * Eat comments. Both C and C++ comment styles are supported. - */ - while (1) { - if ((c = inputGetc(ep)) < 0) { - ejError(ep, T("Syntax Error")); - return TOK_ERR; - } - if (c == '\n' && style == '/') { - break; - } else if (c == '*') { - c = inputGetc(ep); - if (style == '/') { - if (c == '\n') { - break; - } - } else { - if (c == '/') { - break; - } - } - } - } -/* - * Continue looking for a token, so get the next character - */ - if ((c = inputGetc(ep)) < 0) { - return TOK_EOF; - } - break; - - case '<': /* < and <= */ - if ((c = inputGetc(ep)) < 0) { - ejError(ep, T("Syntax Error")); - return TOK_ERR; - } - if (c == '<') { - tokenAddChar(ep, EXPR_LSHIFT); - return TOK_EXPR; - } else if (c == '=') { - tokenAddChar(ep, EXPR_LESSEQ); - return TOK_EXPR; - } - tokenAddChar(ep, EXPR_LESS); - inputPutback(ep, c); - return TOK_EXPR; - - case '>': /* > and >= */ - if ((c = inputGetc(ep)) < 0) { - ejError(ep, T("Syntax Error")); - return TOK_ERR; - } - if (c == '>') { - tokenAddChar(ep, EXPR_RSHIFT); - return TOK_EXPR; - } else if (c == '=') { - tokenAddChar(ep, EXPR_GREATEREQ); - return TOK_EXPR; - } - tokenAddChar(ep, EXPR_GREATER); - inputPutback(ep, c); - return TOK_EXPR; - - case '=': /* "==" */ - if ((c = inputGetc(ep)) < 0) { - ejError(ep, T("Syntax Error")); - return TOK_ERR; - } - if (c == '=') { - tokenAddChar(ep, EXPR_EQ); - return TOK_EXPR; - } - inputPutback(ep, c); - return TOK_ASSIGNMENT; - - case '!': /* "!=" or "!"*/ - if ((c = inputGetc(ep)) < 0) { - ejError(ep, T("Syntax Error")); - return TOK_ERR; - } - if (c == '=') { - tokenAddChar(ep, EXPR_NOTEQ); - return TOK_EXPR; - } - inputPutback(ep, c); - tokenAddChar(ep, EXPR_BOOL_COMP); - return TOK_EXPR; - - case ';': - tokenAddChar(ep, c); - return TOK_SEMI; - - case ',': - tokenAddChar(ep, c); - return TOK_COMMA; - - case '|': /* "||" */ - if ((c = inputGetc(ep)) < 0 || c != '|') { - ejError(ep, T("Syntax Error")); - return TOK_ERR; - } - tokenAddChar(ep, COND_OR); - return TOK_LOGICAL; - - case '&': /* "&&" */ - if ((c = inputGetc(ep)) < 0 || c != '&') { - ejError(ep, T("Syntax Error")); - return TOK_ERR; - } - tokenAddChar(ep, COND_AND); - return TOK_LOGICAL; - - case '\"': /* String quote */ - case '\'': - quote = c; - if ((c = inputGetc(ep)) < 0) { - ejError(ep, T("Syntax Error")); - return TOK_ERR; - } - - while (c != quote) { -/* - * check for escape sequence characters - */ - if (c == '\\') { - c = inputGetc(ep); - - if (gisdigit(c)) { -/* - * octal support, \101 maps to 65 = 'A'. put first char - * back so converter will work properly. - */ - inputPutback(ep, c); - c = charConvert(ep, OCTAL, 3); - - } else { - switch (c) { - case 'n': - c = '\n'; break; - case 'b': - c = '\b'; break; - case 'f': - c = '\f'; break; - case 'r': - c = '\r'; break; - case 't': - c = '\t'; break; - case 'x': -/* - * hex support, \x41 maps to 65 = 'A' - */ - c = charConvert(ep, HEX, 2); - break; - case 'u': -/* - * unicode support, \x0401 maps to 65 = 'A' - */ - c = charConvert(ep, HEX, 2); - c = c*16 + charConvert(ep, HEX, 2); - - break; - case '\'': - case '\"': - case '\\': - break; - default: - ejError(ep, T("Invalid Escape Sequence")); - return TOK_ERR; - } - } - if (tokenAddChar(ep, c) < 0) { - return TOK_ERR; - } - } else { - if (tokenAddChar(ep, c) < 0) { - return TOK_ERR; - } - } - if ((c = inputGetc(ep)) < 0) { - ejError(ep, T("Unmatched Quote")); - return TOK_ERR; - } - } - return TOK_LITERAL; - - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - do { - if (tokenAddChar(ep, c) < 0) { - return TOK_ERR; - } - if ((c = inputGetc(ep)) < 0) - break; - } while (gisdigit(c)); - inputPutback(ep, c); - return TOK_LITERAL; - - default: -/* - * Identifiers or a function names - */ - while (1) { - if (c == '\\') { -/* - * just ignore any \ characters. - */ - } else if (tokenAddChar(ep, c) < 0) { - break; - } - if ((c = inputGetc(ep)) < 0) { - break; - } - if (!gisalnum(c) && c != '$' && c != '_' && - c != '\\') { - break; - } - } - if (! gisalpha(*tokq->servp) && *tokq->servp != '$' && - *tokq->servp != '_') { - ejError(ep, T("Invalid identifier %s"), tokq->servp); - return TOK_ERR; - } -/* - * Check for reserved words (only "if", "else", "var", "for" - * and "return" at the moment) - */ - if (state == STATE_STMT) { - if (gstrcmp(ep->token, T("if")) == 0) { - return TOK_IF; - } else if (gstrcmp(ep->token, T("else")) == 0) { - return TOK_ELSE; - } else if (gstrcmp(ep->token, T("var")) == 0) { - return TOK_VAR; - } else if (gstrcmp(ep->token, T("for")) == 0) { - return TOK_FOR; - } else if (gstrcmp(ep->token, T("return")) == 0) { - if ((c == ';') || (c == '(')) { - inputPutback(ep, c); - } - return TOK_RETURN; - } - } - -/* - * Skip white space after token to find out whether this is - * a function or not. - */ - while (c == ' ' || c == '\t' || c == '\r' || c == '\n') { - if ((c = inputGetc(ep)) < 0) - break; - } - - tid = (c == '(') ? TOK_FUNCTION : TOK_ID; - done++; - } - } - -/* - * Putback the last extra character for next time - */ - inputPutback(ep, c); - return tid; -} - -/******************************************************************************/ -/* - * Putback the last token read - */ - -void ejLexPutbackToken(ej_t* ep, int tid, char_t *string) -{ - ejinput_t* ip; - - a_assert(ep); - ip = ep->input; - a_assert(ip); - - if (ip->putBackToken) { - bfree(B_L, ip->putBackToken); - } - ip->putBackTokenId = tid; - ip->putBackToken = bstrdup(B_L, string); -} - -/******************************************************************************/ -/* - * Add a character to the token ringq buffer - */ - -static int tokenAddChar(ej_t *ep, int c) -{ - ejinput_t* ip; - - a_assert(ep); - ip = ep->input; - a_assert(ip); - - if (ringqPutc(&ip->tokbuf, (char_t) c) < 0) { - ejError(ep, T("Token too big")); - return -1; - } - * ((char_t*) ip->tokbuf.endp) = '\0'; - ep->token = (char_t*) ip->tokbuf.servp; - - return 0; -} - -/******************************************************************************/ -/* - * Get another input character - */ - -static int inputGetc(ej_t* ep) -{ - ejinput_t *ip; - int c, len; - - a_assert(ep); - ip = ep->input; - - if ((len = ringqLen(&ip->script)) == 0) { - return -1; - } - - c = ringqGetc(&ip->script); - - if (c == '\n') { - ip->lineNumber++; - ip->lineColumn = 0; - } else { - if ((ip->lineColumn + 2) >= ip->lineLength) { - ip->lineLength += EJ_INC; - ip->line = brealloc(B_L, ip->line, ip->lineLength * sizeof(char_t)); - } - ip->line[ip->lineColumn++] = c; - ip->line[ip->lineColumn] = '\0'; - } - return c; -} - -/******************************************************************************/ -/* - * Putback a character onto the input queue - */ - -static void inputPutback(ej_t* ep, int c) -{ - ejinput_t *ip; - - a_assert(ep); - - ip = ep->input; - ringqInsertc(&ip->script, (char_t) c); - ip->lineColumn--; - ip->line[ip->lineColumn] = '\0'; -} - -/******************************************************************************/ -/* - * Convert a hex or octal character back to binary, return original char if - * not a hex digit - */ - -static int charConvert(ej_t* ep, int base, int maxDig) -{ - int i, c, lval, convChar; - - lval = 0; - for (i = 0; i < maxDig; i++) { - if ((c = inputGetc(ep)) < 0) { - break; - } -/* - * Initialize to out of range value - */ - convChar = base; - if (gisdigit(c)) { - convChar = c - '0'; - } else if (c >= 'a' && c <= 'f') { - convChar = c - 'a' + 10; - } else if (c >= 'A' && c <= 'F') { - convChar = c - 'A' + 10; - } -/* - * if unexpected character then return it to buffer. - */ - if (convChar >= base) { - inputPutback(ep, c); - break; - } - lval = (lval * base) + convChar; - } - return lval; -} - -/******************************************************************************/ diff --git a/cpukit/httpd/ejparse.c b/cpukit/httpd/ejparse.c deleted file mode 100644 index 8863c069ea..0000000000 --- a/cpukit/httpd/ejparse.c +++ /dev/null @@ -1,1802 +0,0 @@ -/* - * ejparse.c -- Ejscript(TM) Parser - * - * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved. - * - * See the file "license.txt" for usage and redistribution license requirements - */ - -/******************************** Description *********************************/ - -/* - * Ejscript parser. This implementes a subset of the JavaScript language. - * Multiple Ejscript parsers can be opened at a time. - */ - -/********************************** Includes **********************************/ - -#include "ejIntrn.h" - -#if CE - #include "CE/wincompat.h" -#endif - -/********************************** Local Data ********************************/ - -ej_t **ejHandles; /* List of ej handles */ -int ejMax = -1; /* Maximum size of */ - -/****************************** Forward Declarations **************************/ - -#ifndef B_STATS -#define setString(a,b,c) setstring(b,c) -#endif - -static ej_t *ejPtr(int eid); -static void clearString(char_t **ptr); -static void setString(B_ARGS_DEC, char_t **ptr, char_t *s); -static void appendString(char_t **ptr, char_t *s); -static int parse(ej_t *ep, int state, int flags); -static int parseStmt(ej_t *ep, int state, int flags); -static int parseDeclaration(ej_t *ep, int state, int flags); -static int parseArgs(ej_t *ep, int state, int flags); -static int parseCond(ej_t *ep, int state, int flags); -static int parseExpr(ej_t *ep, int state, int flags); -static int evalExpr(ej_t *ep, char_t *lhs, int rel, char_t *rhs); -static int evalCond(ej_t *ep, char_t *lhs, int rel, char_t *rhs); -static int evalFunction(ej_t *ep); -static void freeFunc(ejfunc_t *func); -static void ejRemoveNewlines(ej_t *ep, int state); - -/************************************* Code ***********************************/ -/* - * Initialize a Ejscript engine - */ - -int ejOpenEngine(sym_fd_t variables, sym_fd_t functions) -{ - ej_t *ep; - int eid, vid; - - if ((eid = hAllocEntry((void***) &ejHandles, &ejMax, sizeof(ej_t))) < 0) { - return -1; - } - ep = ejHandles[eid]; - ep->eid = eid; - -/* - * Create a top level symbol table if one is not provided for variables and - * functions. Variables may create other symbol tables for block level - * declarations so we use hAlloc to manage a list of variable tables. - */ - if ((vid = hAlloc((void***) &ep->variables)) < 0) { - ejMax = hFree((void***) &ejHandles, ep->eid); - return -1; - } - if (vid >= ep->variableMax) { - ep->variableMax = vid + 1; - } - - if (variables == -1) { - ep->variables[vid] = symOpen(64) + EJ_OFFSET; - ep->flags |= FLAGS_VARIABLES; - } else { - ep->variables[vid] = variables + EJ_OFFSET; - } - - if (functions == -1) { - ep->functions = symOpen(64); - ep->flags |= FLAGS_FUNCTIONS; - } else { - ep->functions = functions; - } - - ejLexOpen(ep); - -/* - * Define standard constants - */ - ejSetGlobalVar(ep->eid, T("null"), NULL); - -#if EMF - ejEmfOpen(ep->eid); -#endif - return ep->eid; -} - -/******************************************************************************/ -/* - * Close - */ - -void ejCloseEngine(int eid) -{ - ej_t *ep; - int i; - - if ((ep = ejPtr(eid)) == NULL) { - return; - } - -#if EMF - ejEmfClose(eid); -#endif - - bfreeSafe(B_L, ep->error); - ep->error = NULL; - bfreeSafe(B_L, ep->result); - ep->result = NULL; - - ejLexClose(ep); - - for (i = ep->variableMax - 1; i >= 0; i--) { - if (ep->flags & FLAGS_VARIABLES) { - symClose(ep->variables[i] - EJ_OFFSET); - } - ep->variableMax = hFree((void***) &ep->variables, i); - } - - if (ep->flags & FLAGS_FUNCTIONS) { - symClose(ep->functions); - } - - ejMax = hFree((void***) &ejHandles, ep->eid); - bfree(B_L, ep); -} - -#ifndef __NO_EJ_FILE -/******************************************************************************/ -/* - * Evaluate a Ejscript file - */ - -char_t *ejEvalFile(int eid, char_t *path, char_t **emsg) -{ - gstat_t sbuf; - ej_t *ep; - char_t *script, *rs; - char *fileBuf; - int fd; - - a_assert(path && *path); - - if (emsg) { - *emsg = NULL; - } - - if ((ep = ejPtr(eid)) == NULL) { - return NULL; - } - - if ((fd = gopen(path, O_RDONLY | O_BINARY, 0666)) < 0) { - ejError(ep, T("Bad handle %d"), eid); - return NULL; - } - - if (gstat(path, &sbuf) < 0) { - gclose(fd); - ejError(ep, T("Cant stat %s"), path); - return NULL; - } - - if ((fileBuf = balloc(B_L, sbuf.st_size + 1)) == NULL) { - gclose(fd); - ejError(ep, T("Cant malloc %d"), sbuf.st_size); - return NULL; - } - - if (gread(fd, fileBuf, sbuf.st_size) != (int)sbuf.st_size) { - gclose(fd); - bfree(B_L, fileBuf); - ejError(ep, T("Error reading %s"), path); - return NULL; - } - - fileBuf[sbuf.st_size] = '\0'; - gclose(fd); - - if ((script = ballocAscToUni(fileBuf, sbuf.st_size)) == NULL) { - bfree(B_L, fileBuf); - ejError(ep, T("Cant malloc %d"), sbuf.st_size + 1); - return NULL; - } - bfree(B_L, fileBuf); - - rs = ejEvalBlock(eid, script, emsg); - - bfree(B_L, script); - return rs; -} -#endif /* __NO_EJ_FILE */ - -/******************************************************************************/ -/* - * Create a new variable scope block so that consecutive ejEval calls may - * be made with the same varible scope. This space MUST be closed with - * ejCloseBlock when the evaluations are complete. - */ - -int ejOpenBlock(int eid) -{ - ej_t *ep; - int vid; - - if((ep = ejPtr(eid)) == NULL) { - return -1; - } - - if ((vid = hAlloc((void***) &ep->variables)) < 0) { - return -1; - } - - if (vid >= ep->variableMax) { - ep->variableMax = vid + 1; - } - ep->variables[vid] = symOpen(64) + EJ_OFFSET; - return vid; - -} - -/******************************************************************************/ -/* - * Close a variable scope block. The vid parameter is the return value from - * the call to ejOpenBlock - */ - -int ejCloseBlock(int eid, int vid) -{ - ej_t *ep; - - if((ep = ejPtr(eid)) == NULL) { - return -1; - } - symClose(ep->variables[vid] - EJ_OFFSET); - ep->variableMax = hFree((void***) &ep->variables, vid); - return 0; - -} - -/******************************************************************************/ -/* - * Create a new variable scope block and evaluate a script. All variables - * created during this context will be automatically deleted when complete. - */ - -char_t *ejEvalBlock(int eid, char_t *script, char_t **emsg) -{ - char_t* returnVal; - int vid; - - a_assert(script); - - vid = ejOpenBlock(eid); - returnVal = ejEval(eid, script, emsg); - ejCloseBlock(eid, vid); - - return returnVal; -} - -/******************************************************************************/ -/* - * Parse and evaluate a Ejscript. The caller may provide a symbol table to - * use for variables and function definitions. Return char_t pointer on - * success otherwise NULL pointer is returned. - */ - -char_t *ejEval(int eid, char_t *script, char_t **emsg) -{ - ej_t *ep; - ejinput_t *oldBlock; - int state; - void *endlessLoopTest; - int loopCounter; - - - a_assert(script); - - if (emsg) { - *emsg = NULL; - } - - if ((ep = ejPtr(eid)) == NULL) { - return NULL; - } - - setString(B_L, &ep->result, T("")); - -/* - * Allocate a new evaluation block, and save the old one - */ - oldBlock = ep->input; - ejLexOpenScript(ep, script); - -/* - * Do the actual parsing and evaluation - */ - loopCounter = 0; - endlessLoopTest = NULL; - - do { - state = parse(ep, STATE_BEGIN, FLAGS_EXE); - - if (state == STATE_RET) { - state = STATE_EOF; - } -/* - * prevent parser from going into infinite loop. If parsing the same - * line 10 times then fail and report Syntax error. Most normal error - * are caught in the parser itself. - */ - if (endlessLoopTest == ep->input->script.servp) { - if (loopCounter++ > 10) { - state = STATE_ERR; - ejError(ep, T("Syntax error")); - } - } else { - endlessLoopTest = ep->input->script.servp; - loopCounter = 0; - } - } while (state != STATE_EOF && state != STATE_ERR); - - ejLexCloseScript(ep); - -/* - * Return any error string to the user - */ - if (state == STATE_ERR && emsg) { - *emsg = bstrdup(B_L, ep->error); - } - -/* - * Restore the old evaluation block - */ - ep->input = oldBlock; - - if (state == STATE_EOF) { - return ep->result; - } - - if (state == STATE_ERR) { - return NULL; - } - - return ep->result; -} - -/******************************************************************************/ -/* - * Recursive descent parser for Ejscript - */ - -static int parse(ej_t *ep, int state, int flags) -{ - a_assert(ep); - - switch (state) { -/* - * Any statement, function arguments or conditional expressions - */ - case STATE_STMT: - if ((state = parseStmt(ep, state, flags)) != STATE_STMT_DONE && - state != STATE_EOF && state != STATE_STMT_BLOCK_DONE && - state != STATE_RET) { - state = STATE_ERR; - } - break; - - case STATE_DEC: - if ((state = parseStmt(ep, state, flags)) != STATE_DEC_DONE && - state != STATE_EOF) { - state = STATE_ERR; - } - break; - - case STATE_EXPR: - if ((state = parseStmt(ep, state, flags)) != STATE_EXPR_DONE && - state != STATE_EOF) { - state = STATE_ERR; - } - break; - -/* - * Variable declaration list - */ - case STATE_DEC_LIST: - state = parseDeclaration(ep, state, flags); - break; - -/* - * Function argument string - */ - case STATE_ARG_LIST: - state = parseArgs(ep, state, flags); - break; - -/* - * Logical condition list (relational operations separated by &&, ||) - */ - case STATE_COND: - state = parseCond(ep, state, flags); - break; - -/* - * Expression list - */ - case STATE_RELEXP: - state = parseExpr(ep, state, flags); - break; - } - - if (state == STATE_ERR && ep->error == NULL) { - ejError(ep, T("Syntax error")); - } - return state; -} - -/******************************************************************************/ -/* - * Parse any statement including functions and simple relational operations - */ - -static int parseStmt(ej_t *ep, int state, int flags) -{ - ejfunc_t func; - ejfunc_t *saveFunc; - ejinput_t condScript, endScript, bodyScript, incrScript; - char_t *value, *identifier; - int done, expectSemi, thenFlags, elseFlags, tid, cond, forFlags; - int ejVarType; - - a_assert(ep); - -/* - * Set these to NULL, else we try to free them if an error occurs. - */ - endScript.putBackToken = NULL; - bodyScript.putBackToken = NULL; - incrScript.putBackToken = NULL; - condScript.putBackToken = NULL; - - expectSemi = 0; - saveFunc = NULL; - - for (done = 0; !done; ) { - tid = ejLexGetToken(ep, state); - - switch (tid) { - default: - ejLexPutbackToken(ep, TOK_EXPR, ep->token); - done++; - break; - - case TOK_ERR: - state = STATE_ERR; - done++; - break; - - case TOK_EOF: - state = STATE_EOF; - done++; - break; - - case TOK_NEWLINE: - break; - - case TOK_SEMI: -/* - * This case is when we discover no statement and just a lone ';' - */ - if (state != STATE_STMT) { - ejLexPutbackToken(ep, tid, ep->token); - } - done++; - break; - - case TOK_ID: -/* - * This could either be a reference to a variable or an assignment - */ - identifier = NULL; - setString(B_L, &identifier, ep->token); -/* - * Peek ahead to see if this is an assignment - */ - tid = ejLexGetToken(ep, state); - if (tid == TOK_ASSIGNMENT) { - if (parse(ep, STATE_RELEXP, flags) != STATE_RELEXP_DONE) { - clearString(&identifier); - goto error; - } - if (flags & FLAGS_EXE) { - if ( state == STATE_DEC ) { - ejSetLocalVar(ep->eid, identifier, ep->result); - } else { - ejVarType = ejGetVar(ep->eid, identifier, &value); - if (ejVarType > 0) { - ejSetLocalVar(ep->eid, identifier, ep->result); - } else { - ejSetGlobalVar(ep->eid, identifier, ep->result); - } - } - } - - } else if (tid == TOK_INC_DEC ) { - value = NULL; - if (flags & FLAGS_EXE) { - ejVarType = ejGetVar(ep->eid, identifier, &value); - if (ejVarType < 0) { - ejError(ep, T("Undefined variable %s\n"), identifier); - goto error; - } - setString(B_L, &ep->result, value); - if (evalExpr(ep, value, (int) *ep->token, T("1")) < 0) { - state = STATE_ERR; - break; - } - - if (ejVarType > 0) { - ejSetLocalVar(ep->eid, identifier, ep->result); - } else { - ejSetGlobalVar(ep->eid, identifier, ep->result); - } - } - - } else { -/* - * If we are processing a declaration, allow undefined vars - */ - value = NULL; - if (state == STATE_DEC) { - if (ejGetVar(ep->eid, identifier, &value) > 0) { - ejError(ep, T("Variable already declared"), - identifier); - clearString(&identifier); - goto error; - } - ejSetLocalVar(ep->eid, identifier, NULL); - } else { - if ( flags & FLAGS_EXE ) { - if (ejGetVar(ep->eid, identifier, &value) < 0) { - ejError(ep, T("Undefined variable %s\n"), - identifier); - clearString(&identifier); - goto error; - } - } - } - setString(B_L, &ep->result, value); - ejLexPutbackToken(ep, tid, ep->token); - } - clearString(&identifier); - - if (state == STATE_STMT) { - expectSemi++; - } - done++; - break; - - case TOK_LITERAL: -/* - * Set the result to the literal (number or string constant) - */ - setString(B_L, &ep->result, ep->token); - if (state == STATE_STMT) { - expectSemi++; - } - done++; - break; - - case TOK_FUNCTION: -/* - * We must save any current ep->func value for the current stack frame - */ - if (ep->func) { - saveFunc = ep->func; - } - memset(&func, 0, sizeof(ejfunc_t)); - setString(B_L, &func.fname, ep->token); - ep->func = &func; - - setString(B_L, &ep->result, T("")); - if (ejLexGetToken(ep, state) != TOK_LPAREN) { - freeFunc(&func); - goto error; - } - - if (parse(ep, STATE_ARG_LIST, flags) != STATE_ARG_LIST_DONE) { - freeFunc(&func); - ep->func = saveFunc; - goto error; - } -/* - * Evaluate the function if required - */ - if (flags & FLAGS_EXE && evalFunction(ep) < 0) { - freeFunc(&func); - ep->func = saveFunc; - goto error; - } - - freeFunc(&func); - ep->func = saveFunc; - - if (ejLexGetToken(ep, state) != TOK_RPAREN) { - goto error; - } - if (state == STATE_STMT) { - expectSemi++; - } - done++; - break; - - case TOK_IF: - if (state != STATE_STMT) { - goto error; - } - if (ejLexGetToken(ep, state) != TOK_LPAREN) { - goto error; - } -/* - * Evaluate the entire condition list "(condition)" - */ - if (parse(ep, STATE_COND, flags) != STATE_COND_DONE) { - goto error; - } - if (ejLexGetToken(ep, state) != TOK_RPAREN) { - goto error; - } -/* - * This is the "then" case. We need to always parse both cases and - * execute only the relevant case. - */ - if (*ep->result == '1') { - thenFlags = flags; - elseFlags = flags & ~FLAGS_EXE; - } else { - thenFlags = flags & ~FLAGS_EXE; - elseFlags = flags; - } -/* - * Process the "then" case. Allow for RETURN statement - */ - switch (parse(ep, STATE_STMT, thenFlags)) { - case STATE_RET: - return STATE_RET; - case STATE_STMT_DONE: - break; - default: - goto error; - } -/* - * check to see if there is an "else" case - */ - ejRemoveNewlines(ep, state); - tid = ejLexGetToken(ep, state); - if (tid != TOK_ELSE) { - ejLexPutbackToken(ep, tid, ep->token); - done++; - break; - } -/* - * Process the "else" case. Allow for return. - */ - switch (parse(ep, STATE_STMT, elseFlags)) { - case STATE_RET: - return STATE_RET; - case STATE_STMT_DONE: - break; - default: - goto error; - } - done++; - break; - - case TOK_FOR: -/* - * Format for the expression is: - * - * for (initial; condition; incr) { - * body; - * } - */ - if (state != STATE_STMT) { - goto error; - } - if (ejLexGetToken(ep, state) != TOK_LPAREN) { - goto error; - } - -/* - * Evaluate the for loop initialization statement - */ - if (parse(ep, STATE_EXPR, flags) != STATE_EXPR_DONE) { - goto error; - } - if (ejLexGetToken(ep, state) != TOK_SEMI) { - goto error; - } - -/* - * The first time through, we save the current input context just - * to each step: prior to the conditional, the loop increment and the - * loop body. - */ - ejLexSaveInputState(ep, &condScript); - if (parse(ep, STATE_COND, flags) != STATE_COND_DONE) { - goto error; - } - cond = (*ep->result != '0'); - - if (ejLexGetToken(ep, state) != TOK_SEMI) { - goto error; - } - -/* - * Don't execute the loop increment statement or the body first time - */ - forFlags = flags & ~FLAGS_EXE; - ejLexSaveInputState(ep, &incrScript); - if (parse(ep, STATE_EXPR, forFlags) != STATE_EXPR_DONE) { - goto error; - } - if (ejLexGetToken(ep, state) != TOK_RPAREN) { - goto error; - } - -/* - * Parse the body and remember the end of the body script - */ - ejLexSaveInputState(ep, &bodyScript); - if (parse(ep, STATE_STMT, forFlags) != STATE_STMT_DONE) { - goto error; - } - ejLexSaveInputState(ep, &endScript); - -/* - * Now actually do the for loop. Note loop has been rotated - */ - while (cond && (flags & FLAGS_EXE) ) { -/* - * Evaluate the body - */ - ejLexRestoreInputState(ep, &bodyScript); - - switch (parse(ep, STATE_STMT, flags)) { - case STATE_RET: - return STATE_RET; - case STATE_STMT_DONE: - break; - default: - goto error; - } -/* - * Evaluate the increment script - */ - ejLexRestoreInputState(ep, &incrScript); - if (parse(ep, STATE_EXPR, flags) != STATE_EXPR_DONE) { - goto error; - } -/* - * Evaluate the condition - */ - ejLexRestoreInputState(ep, &condScript); - if (parse(ep, STATE_COND, flags) != STATE_COND_DONE) { - goto error; - } - cond = (*ep->result != '0'); - } - ejLexRestoreInputState(ep, &endScript); - done++; - break; - - case TOK_VAR: - if (parse(ep, STATE_DEC_LIST, flags) != STATE_DEC_LIST_DONE) { - goto error; - } - done++; - break; - - case TOK_COMMA: - ejLexPutbackToken(ep, TOK_EXPR, ep->token); - done++; - break; - - case TOK_LPAREN: - if (state == STATE_EXPR) { - if (parse(ep, STATE_RELEXP, flags) != STATE_RELEXP_DONE) { - goto error; - } - if (ejLexGetToken(ep, state) != TOK_RPAREN) { - goto error; - } - return STATE_EXPR_DONE; - } - done++; - break; - - case TOK_RPAREN: - ejLexPutbackToken(ep, tid, ep->token); - return STATE_EXPR_DONE; - - case TOK_LBRACE: -/* - * This handles any code in braces except "if () {} else {}" - */ - if (state != STATE_STMT) { - goto error; - } - -/* - * Parse will return STATE_STMT_BLOCK_DONE when the RBRACE is seen - */ - do { - state = parse(ep, STATE_STMT, flags); - } while (state == STATE_STMT_DONE); - -/* - * Allow return statement. - */ - if (state == STATE_RET) { - return state; - } - - if (ejLexGetToken(ep, state) != TOK_RBRACE) { - goto error; - } - return STATE_STMT_DONE; - - case TOK_RBRACE: - if (state == STATE_STMT) { - ejLexPutbackToken(ep, tid, ep->token); - return STATE_STMT_BLOCK_DONE; - } - goto error; - - case TOK_RETURN: - if (parse(ep, STATE_RELEXP, flags) != STATE_RELEXP_DONE) { - goto error; - } - if (flags & FLAGS_EXE) { - while ( ejLexGetToken(ep, state) != TOK_EOF ); - done++; - return STATE_RET; - } - break; - } - } - - if (expectSemi) { - tid = ejLexGetToken(ep, state); - if (tid != TOK_SEMI && tid != TOK_NEWLINE) { - goto error; - } - -/* - * Skip newline after semi-colon - */ - ejRemoveNewlines(ep, state); - } - -/* - * Free resources and return the correct status - */ -doneParse: - if (tid == TOK_FOR) { - ejLexFreeInputState(ep, &condScript); - ejLexFreeInputState(ep, &incrScript); - ejLexFreeInputState(ep, &endScript); - ejLexFreeInputState(ep, &bodyScript); - } - - if (state == STATE_STMT) { - return STATE_STMT_DONE; - } else if (state == STATE_DEC) { - return STATE_DEC_DONE; - } else if (state == STATE_EXPR) { - return STATE_EXPR_DONE; - } else if (state == STATE_EOF) { - return state; - } else { - return STATE_ERR; - } - -/* - * Common error exit - */ -error: - state = STATE_ERR; - goto doneParse; -} - -/******************************************************************************/ -/* - * Parse variable declaration list - */ - -static int parseDeclaration(ej_t *ep, int state, int flags) -{ - int tid; - - a_assert(ep); - -/* - * Declarations can be of the following forms: - * var x; - * var x, y, z; - * var x = 1 + 2 / 3, y = 2 + 4; - * - * We set the variable to NULL if there is no associated assignment. - */ - - do { - if ((tid = ejLexGetToken(ep, state)) != TOK_ID) { - return STATE_ERR; - } - ejLexPutbackToken(ep, tid, ep->token); - -/* - * Parse the entire assignment or simple identifier declaration - */ - if (parse(ep, STATE_DEC, flags) != STATE_DEC_DONE) { - return STATE_ERR; - } - -/* - * Peek at the next token, continue if comma seen - */ - tid = ejLexGetToken(ep, state); - if (tid == TOK_SEMI) { - return STATE_DEC_LIST_DONE; - } else if (tid != TOK_COMMA) { - return STATE_ERR; - } - } while (tid == TOK_COMMA); - - if (tid != TOK_SEMI) { - return STATE_ERR; - } - return STATE_DEC_LIST_DONE; -} - -/******************************************************************************/ -/* - * Parse function arguments - */ - -static int parseArgs(ej_t *ep, int state, int flags) -{ - int tid, aid; - - a_assert(ep); - - do { - state = parse(ep, STATE_RELEXP, flags); - if (state == STATE_EOF || state == STATE_ERR) { - return state; - } - if (state == STATE_RELEXP_DONE) { - aid = hAlloc((void***) &ep->func->args); - ep->func->args[aid] = bstrdup(B_L, ep->result); - ep->func->nArgs++; - } -/* - * Peek at the next token, continue if more args (ie. comma seen) - */ - tid = ejLexGetToken(ep, state); - if (tid != TOK_COMMA) { - ejLexPutbackToken(ep, tid, ep->token); - } - } while (tid == TOK_COMMA); - - if (tid != TOK_RPAREN && state != STATE_RELEXP_DONE) { - return STATE_ERR; - } - return STATE_ARG_LIST_DONE; -} - -/******************************************************************************/ -/* - * Parse conditional expression (relational ops separated by ||, &&) - */ - -static int parseCond(ej_t *ep, int state, int flags) -{ - char_t *lhs, *rhs; - int tid, operator; - - a_assert(ep); - - setString(B_L, &ep->result, T("")); - rhs = lhs = NULL; - operator = 0; - - do { -/* - * Recurse to handle one side of a conditional. Accumulate the - * left hand side and the final result in ep->result. - */ - state = parse(ep, STATE_RELEXP, flags); - if (state != STATE_RELEXP_DONE) { - state = STATE_ERR; - break; - } - - if (operator > 0) { - setString(B_L, &rhs, ep->result); - if (evalCond(ep, lhs, operator, rhs) < 0) { - state = STATE_ERR; - break; - } - } - setString(B_L, &lhs, ep->result); - - tid = ejLexGetToken(ep, state); - if (tid == TOK_LOGICAL) { - operator = (int) *ep->token; - - } else if (tid == TOK_RPAREN || tid == TOK_SEMI) { - ejLexPutbackToken(ep, tid, ep->token); - state = STATE_COND_DONE; - break; - - } else { - ejLexPutbackToken(ep, tid, ep->token); - } - - } while (state == STATE_RELEXP_DONE); - - if (lhs) { - bfree(B_L, lhs); - } - - if (rhs) { - bfree(B_L, rhs); - } - return state; -} - -/******************************************************************************/ -/* - * Parse expression (leftHandSide operator rightHandSide) - */ - -static int parseExpr(ej_t *ep, int state, int flags) -{ - char_t *lhs, *rhs; - int rel, tid; - - a_assert(ep); - - setString(B_L, &ep->result, T("")); - rhs = lhs = NULL; - rel = 0; - tid = 0; - - do { -/* - * This loop will handle an entire expression list. We call parse - * to evalutate each term which returns the result in ep->result. - */ - if (tid == TOK_LOGICAL) { - if ((state = parse(ep, STATE_RELEXP, flags)) != STATE_RELEXP_DONE) { - state = STATE_ERR; - break; - } - } else { - if ((state = parse(ep, STATE_EXPR, flags)) != STATE_EXPR_DONE) { - state = STATE_ERR; - break; - } - } - - if (rel > 0) { - setString(B_L, &rhs, ep->result); - if (tid == TOK_LOGICAL) { - if (evalCond(ep, lhs, rel, rhs) < 0) { - state = STATE_ERR; - break; - } - } else { - if (evalExpr(ep, lhs, rel, rhs) < 0) { - state = STATE_ERR; - break; - } - } - } - setString(B_L, &lhs, ep->result); - - if ((tid = ejLexGetToken(ep, state)) == TOK_EXPR || - tid == TOK_INC_DEC || tid == TOK_LOGICAL) { - rel = (int) *ep->token; - - } else { - ejLexPutbackToken(ep, tid, ep->token); - state = STATE_RELEXP_DONE; - } - - } while (state == STATE_EXPR_DONE); - - if (rhs) { - bfree(B_L, rhs); - } - - if (lhs) { - bfree(B_L, lhs); - } - - return state; -} - -/******************************************************************************/ -/* - * Evaluate a condition. Implements &&, ||, ! - */ - -static int evalCond(ej_t *ep, char_t *lhs, int rel, char_t *rhs) -{ - char_t buf[16]; - int l, r, lval; - - a_assert(lhs); - a_assert(rhs); - a_assert(rel > 0); - - lval = 0; - if (gisdigit((int)*lhs) && gisdigit((int)*rhs)) { - l = gatoi(lhs); - r = gatoi(rhs); - switch (rel) { - case COND_AND: - lval = l && r; - break; - case COND_OR: - lval = l || r; - break; - default: - ejError(ep, T("Bad operator %d"), rel); - return -1; - } - } else { - if (!gisdigit((int)*lhs)) { - ejError(ep, T("Conditional must be numeric"), lhs); - } else { - ejError(ep, T("Conditional must be numeric"), rhs); - } - } - - stritoa(lval, buf, sizeof(buf)); - setString(B_L, &ep->result, buf); - return 0; -} - -/******************************************************************************/ -/* - * Evaluate an operation - */ - -static int evalExpr(ej_t *ep, char_t *lhs, int rel, char_t *rhs) -{ - char_t *cp, buf[16]; - int numeric, l, r, lval; - - a_assert(lhs); - a_assert(rhs); - a_assert(rel > 0); - -/* - * All of the characters in the lhs and rhs must be numeric - */ - numeric = 1; - for (cp = lhs; *cp; cp++) { - if (!gisdigit((int)*cp)) { - numeric = 0; - break; - } - } - - if (numeric) { - for (cp = rhs; *cp; cp++) { - if (!gisdigit((int)*cp)) { - numeric = 0; - break; - } - } - } - - if (numeric) { - l = gatoi(lhs); - r = gatoi(rhs); - switch (rel) { - case EXPR_PLUS: - lval = l + r; - break; - case EXPR_INC: - lval = l + 1; - break; - case EXPR_MINUS: - lval = l - r; - break; - case EXPR_DEC: - lval = l - 1; - break; - case EXPR_MUL: - lval = l * r; - break; - case EXPR_DIV: - if (r != 0) { - lval = l / r; - } else { - lval = 0; - } - break; - case EXPR_MOD: - if (r != 0) { - lval = l % r; - } else { - lval = 0; - } - break; - case EXPR_LSHIFT: - lval = l << r; - break; - case EXPR_RSHIFT: - lval = l >> r; - break; - case EXPR_EQ: - lval = l == r; - break; - case EXPR_NOTEQ: - lval = l != r; - break; - case EXPR_LESS: - lval = (l < r) ? 1 : 0; - break; - case EXPR_LESSEQ: - lval = (l <= r) ? 1 : 0; - break; - case EXPR_GREATER: - lval = (l > r) ? 1 : 0; - break; - case EXPR_GREATEREQ: - lval = (l >= r) ? 1 : 0; - break; - case EXPR_BOOL_COMP: - lval = (r == 0) ? 1 : 0; - break; - default: - ejError(ep, T("Bad operator %d"), rel); - return -1; - } - - } else { - switch (rel) { - case EXPR_PLUS: - clearString(&ep->result); - appendString(&ep->result, lhs); - appendString(&ep->result, rhs); - return 0; - case EXPR_LESS: - lval = gstrcmp(lhs, rhs) < 0; - break; - case EXPR_LESSEQ: - lval = gstrcmp(lhs, rhs) <= 0; - break; - case EXPR_GREATER: - lval = gstrcmp(lhs, rhs) > 0; - break; - case EXPR_GREATEREQ: - lval = gstrcmp(lhs, rhs) >= 0; - break; - case EXPR_EQ: - lval = gstrcmp(lhs, rhs) == 0; - break; - case EXPR_NOTEQ: - lval = gstrcmp(lhs, rhs) != 0; - break; - case EXPR_INC: - case EXPR_DEC: - case EXPR_MINUS: - case EXPR_DIV: - case EXPR_MOD: - case EXPR_LSHIFT: - case EXPR_RSHIFT: - default: - ejError(ep, T("Bad operator")); - return -1; - } - } - - stritoa(lval, buf, sizeof(buf)); - setString(B_L, &ep->result, buf); - return 0; -} - -/******************************************************************************/ -/* - * Evaluate a function - */ - -static int evalFunction(ej_t *ep) -{ - sym_t *sp; - int (*fn)(int eid, void *handle, int argc, char_t **argv); - - if ((sp = symLookup(ep->functions, ep->func->fname)) == NULL) { - ejError(ep, T("Undefined procedure %s"), ep->func->fname); - return -1; - } - - fn = (int (*)(int, void*, int, char_t**)) sp->content.value.integer; - if (fn == NULL) { - ejError(ep, T("Undefined procedure %s"), ep->func->fname); - return -1; - } - - return (*fn)(ep->eid, (void*) ep->userHandle, ep->func->nArgs, - ep->func->args); -} - -/******************************************************************************/ -/* - * Output a parse ej_error message - */ - -void ejError(ej_t* ep, char_t* fmt, ...) -{ - va_list args; - ejinput_t *ip; - char_t *errbuf, *msgbuf; - - a_assert(ep); - a_assert(fmt); - ip = ep->input; - - va_start(args, fmt); - msgbuf = NULL; - fmtValloc(&msgbuf, E_MAX_ERROR, fmt, args); - va_end(args); - - if (ep && ip) { - fmtAlloc(&errbuf, E_MAX_ERROR, T("%s\n At line %d, line => \n\n%s\n"), - msgbuf, ip->lineNumber, ip->line); - bfreeSafe(B_L, ep->error); - ep->error = errbuf; - } - bfreeSafe(B_L, msgbuf); -} - -/******************************************************************************/ -/* - * Clear a string value - */ - -static void clearString(char_t **ptr) -{ - a_assert(ptr); - - if (*ptr) { - bfree(B_L, *ptr); - } - *ptr = NULL; -} - -/******************************************************************************/ -/* - * Set a string value - */ - -static void setString(B_ARGS_DEC, char_t **ptr, char_t *s) -{ - a_assert(ptr); - - if (*ptr) { - bfree(B_ARGS, *ptr); - } - *ptr = bstrdup(B_ARGS, s); -} - -/******************************************************************************/ -/* - * Append to the pointer value - */ - -static void appendString(char_t **ptr, char_t *s) -{ - int len, oldlen; - - a_assert(ptr); - - if (*ptr) { - len = gstrlen(s); - oldlen = gstrlen(*ptr); - *ptr = brealloc(B_L, *ptr, (len + oldlen + 1) * sizeof(char_t)); - gstrcpy(&(*ptr)[oldlen], s); - } else { - *ptr = bstrdup(B_L, s); - } -} - -/******************************************************************************/ -/* - * Define a function - */ - -int ejSetGlobalFunction(int eid, char_t *name, - int (*fn)(int eid, void *handle, int argc, char_t **argv)) -{ - ej_t *ep; - - if ((ep = ejPtr(eid)) == NULL) { - return -1; - } - return ejSetGlobalFunctionDirect(ep->functions, name, fn); -} - -/******************************************************************************/ -/* - * Define a function directly into the function symbol table. - */ - -int ejSetGlobalFunctionDirect(sym_fd_t functions, char_t *name, - int (*fn)(int eid, void *handle, int argc, char_t **argv)) -{ - if (symEnter(functions, name, valueInteger((long) fn), 0) == NULL) { - return -1; - } - return 0; -} - -/******************************************************************************/ -/* - * Remove ("undefine") a function - */ - -int ejRemoveGlobalFunction(int eid, char_t *name) -{ - ej_t *ep; - - if ((ep = ejPtr(eid)) == NULL) { - return -1; - } - return symDelete(ep->functions, name); -} - -/******************************************************************************/ -/* - * Get a function definition - */ - -void *ejGetGlobalFunction(int eid, char_t *name) -{ - ej_t *ep; - sym_t *sp; - int (*fn)(int eid, void *handle, int argc, char_t **argv); - - if ((ep = ejPtr(eid)) == NULL) { - return NULL; - } - - if ((sp = symLookup(ep->functions, name)) != NULL) { - fn = (int (*)(int, void*, int, char_t**)) sp->content.value.integer; - return (void*) fn; - } - return NULL; -} - -/******************************************************************************/ -/* - * Utility routine to crack Ejscript arguments. Return the number of args - * seen. This routine only supports %s and %d type args. - * - * Typical usage: - * - * if (ejArgs(argc, argv, "%s %d", &name, &age) < 2) { - * error("Insufficient args\n"); - * return -1; - * } - */ - -int ejArgs(int argc, char_t **argv, char_t *fmt, ...) -{ - va_list vargs; - char_t *cp, **sp; - int *ip; - int argn; - - va_start(vargs, fmt); - - if (argv == NULL) { - return 0; - } - - for (argn = 0, cp = fmt; cp && *cp && argv[argn]; ) { - if (*cp++ != '%') { - continue; - } - - switch (*cp) { - case 'd': - ip = va_arg(vargs, int*); - *ip = gatoi(argv[argn]); - break; - - case 's': - sp = va_arg(vargs, char_t**); - *sp = argv[argn]; - break; - - default: -/* - * Unsupported - */ - a_assert(0); - } - argn++; - } - - va_end(vargs); - return argn; -} - -/******************************************************************************/ -/* - * Define the user handle - */ - -void ejSetUserHandle(int eid, int handle) -{ - ej_t *ep; - - if ((ep = ejPtr(eid)) == NULL) { - return; - } - ep->userHandle = handle; -} - -/******************************************************************************/ -/* - * Get the user handle - */ - -int ejGetUserHandle(int eid) -{ - ej_t *ep; - - if ((ep = ejPtr(eid)) == NULL) { - return -1; - } - return ep->userHandle; -} - -/******************************************************************************/ -/* - * Get the current line number - */ - -int ejGetLineNumber(int eid) -{ - ej_t *ep; - - if ((ep = ejPtr(eid)) == NULL) { - return -1; - } - return ep->input->lineNumber; -} - -/******************************************************************************/ -/* - * Set the result - */ - -void ejSetResult(int eid, char_t *s) -{ - ej_t *ep; - - if ((ep = ejPtr(eid)) == NULL) { - return; - } - setString(B_L, &ep->result, s); -} - -/******************************************************************************/ -/* - * Get the result - */ - -char_t *ejGetResult(int eid) -{ - ej_t *ep; - - if ((ep = ejPtr(eid)) == NULL) { - return NULL; - } - return ep->result; -} - -/******************************************************************************/ -/* - * Set a variable. Note: a variable with a value of NULL means declared but - * undefined. The value is defined in the top-most variable frame. - */ - -void ejSetVar(int eid, char_t *var, char_t *value) -{ - ej_t *ep; - value_t v; - - a_assert(var && *var); - - if ((ep = ejPtr(eid)) == NULL) { - return; - } - - if (value == NULL) { - v = valueString(value, 0); - } else { - v = valueString(value, VALUE_ALLOCATE); - } - symEnter(ep->variables[ep->variableMax - 1] - EJ_OFFSET, var, v, 0); -} - -/******************************************************************************/ -/* - * Set a local variable. Note: a variable with a value of NULL means - * declared but undefined. The value is defined in the top-most variable frame. - */ - -void ejSetLocalVar(int eid, char_t *var, char_t *value) -{ - ej_t *ep; - value_t v; - - a_assert(var && *var); - - if ((ep = ejPtr(eid)) == NULL) { - return; - } - - if (value == NULL) { - v = valueString(value, 0); - } else { - v = valueString(value, VALUE_ALLOCATE); - } - symEnter(ep->variables[ep->variableMax - 1] - EJ_OFFSET, var, v, 0); -} - -/******************************************************************************/ -/* - * Set a global variable. Note: a variable with a value of NULL means - * declared but undefined. The value is defined in the global variable frame. - */ - -void ejSetGlobalVar(int eid, char_t *var, char_t *value) -{ - ej_t *ep; - value_t v; - - a_assert(var && *var); - - if ((ep = ejPtr(eid)) == NULL) { - return; - } - - if (value == NULL) { - v = valueString(value, 0); - } else { - v = valueString(value, VALUE_ALLOCATE); - } - symEnter(ep->variables[0] - EJ_OFFSET, var, v, 0); -} - -/******************************************************************************/ -/* - * Get a variable - */ - -int ejGetVar(int eid, char_t *var, char_t **value) -{ - ej_t *ep; - sym_t *sp; - int i; - - a_assert(var && *var); - a_assert(value); - - if ((ep = ejPtr(eid)) == NULL) { - return -1; - } - - i = ep->variableMax - 1; - if ((sp = symLookup(ep->variables[i] - EJ_OFFSET, var)) == NULL) { - i = 0; - if ((sp = symLookup(ep->variables[0] - EJ_OFFSET, var)) == NULL) { - return -1; - } - } - a_assert(sp->content.type == string); - *value = sp->content.value.string; - return i; -} - -/******************************************************************************/ -/* - * Get the variable symbol table - */ - -sym_fd_t ejGetVariableTable(int eid) -{ - ej_t *ep; - - if ((ep = ejPtr(eid)) == NULL) { - return -1; - } - return *ep->variables; -} - -/******************************************************************************/ -/* - * Get the functions symbol table - */ - -sym_fd_t ejGetFunctionTable(int eid) -{ - ej_t *ep; - - if ((ep = ejPtr(eid)) == NULL) { - return -1; - } - return ep->functions; -} - -/******************************************************************************/ -/* - * Free an argument list - */ - -static void freeFunc(ejfunc_t *func) -{ - int i; - - for (i = func->nArgs - 1; i >= 0; i--) { - bfree(B_L, func->args[i]); - func->nArgs = hFree((void***) &func->args, i); - } - - if (func->fname) { - bfree(B_L, func->fname); - func->fname = NULL; - } -} - -/******************************************************************************/ -/* - * Get Ejscript pointer - */ - -static ej_t *ejPtr(int eid) -{ - a_assert(0 <= eid && eid < ejMax); - - if (eid < 0 || eid >= ejMax || ejHandles[eid] == NULL) { - ejError(NULL, T("Bad handle %d"), eid); - return NULL; - } - return ejHandles[eid]; -} - -/******************************************************************************/ -/* - * This function removes any new lines. Used for else cases, etc. - */ -static void ejRemoveNewlines(ej_t *ep, int state) -{ - int tid; - - do { - tid = ejLexGetToken(ep, state); - } while (tid == TOK_NEWLINE); - - ejLexPutbackToken(ep, tid, ep->token); -} - -/******************************************************************************/ diff --git a/cpukit/httpd/emfdb.c b/cpukit/httpd/emfdb.c deleted file mode 100644 index 9a0c1dd1e3..0000000000 --- a/cpukit/httpd/emfdb.c +++ /dev/null @@ -1,1050 +0,0 @@ -/* - * emfdb.c -- EMF database compatability functions for GoAhead WebServer. - * - * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved. - * - * See the file "license.txt" for usage and redistribution license requirements - * - * $Id$ - */ - -/******************************** Description *********************************/ -/* - * Textfile-based database support for WebServer 2.1. - */ - -/********************************* Includes ***********************************/ - -#include "emfdb.h" -#include "wsIntrn.h" - -/********************************* Defines ************************************/ - -#define KEYWORD_TABLE T("TABLE") -#define KEYWORD_ROW T("ROW") - -/*********************************** Locals ***********************************/ - -/* - * Variable to support the basicSet and basicGet functions. - */ - -static char_t *basicProdDir = NULL; -static char_t *basicDefaultDir = T("."); /* Default set to current */ - -/* - * hAlloc chain list of table schemas to be closed - */ - -static int dbMaxTables = 0; -static dbTable_t **dbListTables = NULL; - -/****************************** Forward Declarations **************************/ - -static int crack(char_t *buf, char_t **key, char_t **val); -static char_t *trim(char_t *str); -static int GetColumnIndex(int tid, char_t *colName); - -/******************************************************************************/ -/* - * Add a schema to the module-internal schema database - */ - -int dbRegisterDBSchema(dbTable_t *pTableRegister) -{ - dbTable_t *pTable; - int tid; - - a_assert(pTableRegister); - - trace(4, T("DB: Registering database table <%s>\n"), - pTableRegister->name); - -/* - * Bump up the size of the table array - */ - tid = hAllocEntry((void***) &dbListTables, - &dbMaxTables, sizeof(dbTable_t)); - -/* - * Copy the table schema to the last spot in schema array - */ - a_assert(dbListTables); - pTable = dbListTables[tid]; - a_assert(pTable); - -/* - * Copy the name of the table - */ - pTable->name = bstrdup(B_L, pTableRegister->name); - -/* - * Copy the number of columns - */ - pTable->nColumns = pTableRegister->nColumns; - -/* - * Copy the column definitions - */ - if (pTable->nColumns > 0) { - int i; - pTable->columnNames = balloc(B_L, sizeof(char_t *) * pTable->nColumns); - pTable->columnTypes = balloc(B_L, sizeof(int *) * pTable->nColumns); - - for (i = 0; (i < pTableRegister->nColumns); i++) { - pTable->columnNames[i] = - bstrdup(B_L, pTableRegister->columnNames[i]); - pTable->columnTypes[i] = pTableRegister->columnTypes[i]; - } - - } else { - pTable->columnNames = NULL; - pTable->columnTypes = NULL; - } - -/* - * Zero out the table's data (very important!) - */ - pTable->nRows = 0; - pTable->rows = NULL; - - return 0; -} - -/******************************************************************************/ -/* - * This is provided for compatibility with EMF. Tables are "registered" - * with staticly defined schemas. There is only one did in this package: 0. - */ - -int dbOpen(char_t *tablename, char_t *filename, - int (*gettime)(int did), int flags) -{ - basicProdDir = NULL; - basicDefaultDir = T("."); - dbMaxTables = 0; - dbListTables = NULL; - return 0; -} - -/******************************************************************************/ -/* - * Delete all the rows of the tables, and all of the tables - */ - -void dbClose(int did) -{ - int table, column; - dbTable_t *pTable; - -/* - * Before doing anything, delete all the contents of the database - */ - dbZero(did); - -/* - * Now delete the tables - */ - for (table = 0; table < dbMaxTables; table++) { - pTable = dbListTables[table]; - - if (pTable != NULL) { -/* - * Delete the table schema - */ - if (pTable->nColumns) { - for (column = 0; column < pTable->nColumns; column++) { - bfreeSafe(B_L, pTable->columnNames[column]); - } - bfreeSafe(B_L, pTable->columnNames); - bfreeSafe(B_L, pTable->columnTypes); - } -/* - * Delete the table name - */ - bfreeSafe(B_L, pTable->name); -/* - * Free the table - */ - bfreeSafe(B_L, pTable); - hFree((void ***) &dbListTables, table); - } - } - - if (dbListTables) { - bfree(B_L, dbListTables); - } - -/* - * Set the global table list to a safe value - */ - dbListTables = NULL; - dbMaxTables = 0; -} - - -/******************************************************************************/ -/* - * Delete all the data records in all tables - */ - -void dbZero(int did) -{ - int table, row, column, nRows, nColumns; - int *pRow; - dbTable_t *pTable; - -/* - * Delete all data from all tables - */ - for (table = 0; table < dbMaxTables; table++) { - pTable = dbListTables[table]; -/* - * Delete the row data contained within the schema - */ - if (pTable) { - nColumns = pTable->nColumns; - nRows = pTable->nRows; - for (row = 0; row < nRows; row++) { - pRow = pTable->rows[row]; - if (pRow) { -/* - * Only delete the contents of rows not previously deleted! - */ - for (column = 0; column < nColumns; column++) { - if (pTable->columnTypes[column] == T_STRING) { - bfreeSafe(B_L, (char_t *)(pRow[column])); - pRow[column] = (int)NULL; - } - } - - bfreeSafe(B_L, pRow); - hFree((void ***) &pTable->rows, row); - } - } - - pTable->rows = NULL; - pTable->nRows = 0; - } - } -} - -/******************************************************************************/ -/* - * Find the a row in the table with the given string in the given column - */ - -int dbSearchStr(int did, char_t *tablename, - char_t *colName, char_t *value, int flags) -{ - int tid, nRows, nColumns, column; - dbTable_t *pTable; - - a_assert(tablename); - a_assert(colName); - a_assert(value); - - tid = dbGetTableId(0, tablename); - a_assert(tid >= 0); - - if ((tid >= 0) && (tid < dbMaxTables) && (dbListTables[tid] != NULL)) { - pTable = dbListTables[tid]; - } else { - return DB_ERR_TABLE_NOT_FOUND; - } - - nColumns = pTable->nColumns; - nRows = pTable->nRows; - column = GetColumnIndex(tid, colName); - a_assert (column >= 0); - - if (column >= 0) { - char_t *compareVal; - int row, *pRow; -/* - * Scan through rows until we find a match. - * Note that some of these rows may be deleted! - */ - row = 0; - while (row < nRows) { - pRow = pTable->rows[row]; - if (pRow) { - compareVal = (char_t *)(pRow[column]); - if (compareVal && (gstrcmp(compareVal, value) == 0)) { - return row; - } - } - row++; - } - } else { -/* - * Return -2 if search column was not found - */ - trace(3, T("DB: Unable to find column <%s> in table <%s>\n"), - colName, tablename); - return DB_ERR_COL_NOT_FOUND; - } - - return -1; -} - -/******************************************************************************/ -/* - * Add a new row to the given table. Return the new row ID. - */ - -int dbAddRow(int did, char_t *tablename) -{ - int tid, size; - dbTable_t *pTable; - - a_assert(tablename); - - tid = dbGetTableId(0, tablename); - a_assert(tid >= 0); - - if ((tid >= 0) && (tid < dbMaxTables) && (dbListTables[tid] != NULL)) { - pTable = dbListTables[tid]; - } else { - return DB_ERR_TABLE_NOT_FOUND; - } - - a_assert(pTable); - - if (pTable) { - trace(5, T("DB: Adding a row to table <%s>\n"), tablename); - - size = pTable->nColumns * max(sizeof(int), sizeof(char_t *)); - return hAllocEntry((void***) &(pTable->rows), &(pTable->nRows), size); - } - - return -1; -} - -/******************************************************************************/ -/* - * Delete a row in the table. - */ - -int dbDeleteRow(int did, char_t *tablename, int row) -{ - int tid, nColumns, nRows; - dbTable_t *pTable; - - a_assert(tablename); - tid = dbGetTableId(0, tablename); - a_assert(tid >= 0); - - if ((tid >= 0) && (tid < dbMaxTables) && (dbListTables[tid] != NULL)) { - pTable = dbListTables[tid]; - } else { - return DB_ERR_TABLE_NOT_FOUND; - } - - nColumns = pTable->nColumns; - nRows = pTable->nRows; - - if ((row >= 0) && (row < nRows)) { - int *pRow = pTable->rows[row]; - - if (pRow) { - int column = 0; -/* - * Free up any allocated strings - */ - while (column < nColumns) { - if (pRow[column] && - (pTable->columnTypes[column] == T_STRING)) { - bfree(B_L, (char_t *)pRow[column]); - } - - column++; - } -/* - * Zero out the row for safety - */ - memset(pRow, 0, nColumns * max(sizeof(int), sizeof(char_t *))); - - bfreeSafe(B_L, pRow); - pTable->nRows = hFree((void ***)&pTable->rows, row); - trace(5, T("DB: Deleted row <%d> from table <%s>\n"), - row, tablename); - } - return 0; - } else { - trace(3, T("DB: Unable to delete row <%d> from table <%s>\n"), - row, tablename); - } - - return -1; -} - -/*****************************************************************************/ -/* - * Grow the rows in the table to the nominated size. - */ - -int dbSetTableNrow(int did, char_t *tablename, int nNewRows) -{ - int nRet, tid, nRows, nColumns; - dbTable_t *pTable; - - a_assert(tablename); - tid = dbGetTableId(0, tablename); - a_assert(tid >= 0) ; - - if ((tid >= 0) && (tid < dbMaxTables) && (dbListTables[tid] != NULL)) { - pTable = dbListTables[tid]; - } else { - return DB_ERR_TABLE_NOT_FOUND; - } - - nRet = -1; - - a_assert(pTable); - if (pTable) { - nColumns = pTable->nColumns; - nRows = pTable->nRows; - nRet = 0; - - if (nRows >= nNewRows) { -/* - * If number of rows already allocated exceeds requested number, do nothing - */ - trace(4, T("DB: Ignoring row set to <%d> in table <%s>\n"), - nNewRows, tablename); - } else { - trace(4, T("DB: Setting rows to <%d> in table <%s>\n"), - nNewRows, tablename); - while (pTable->nRows < nNewRows) { - if (dbAddRow(did, tablename) < 0) { - return -1; - } - } - } - } - - return nRet; -} - -/******************************************************************************/ -/* - * Return the number of rows in the given table - */ - -int dbGetTableNrow(int did, char_t *tablename) -{ - int tid; - - a_assert(tablename); - tid = dbGetTableId(did, tablename); - - if ((tid >= 0) && (tid < dbMaxTables) && (dbListTables[tid] != NULL)) { - return (dbListTables[tid])->nRows; - } else { - return -1; - } -} - -/******************************************************************************/ -/* - * Do table driven read of the database - */ - -int dbReadInt(int did, char_t *table, char_t *column, int row, int *returnValue) -{ - int colIndex, *pRow, tid; - dbTable_t *pTable; - - a_assert(table); - a_assert(column); - a_assert(returnValue); - - tid = dbGetTableId(0, table); - a_assert(tid >= 0); - -/* - * Return -6 if table is not found - */ - if (tid < 0) { - return DB_ERR_TABLE_NOT_FOUND; - } - -/* - * Return -7 if table id has been deleted - */ - pTable = dbListTables[tid]; - if (pTable == NULL) { - return DB_ERR_TABLE_DELETED; - } - - a_assert(row >= 0); - - if ((row >= 0) && (row < pTable->nRows)) { - colIndex = GetColumnIndex(tid, column); - a_assert(colIndex >= 0); - - if (colIndex >= 0) { - pRow = pTable->rows[row]; - if (pRow) { - *returnValue = pRow[colIndex]; - return 0; - } - return DB_ERR_ROW_DELETED; - } - return DB_ERR_COL_NOT_FOUND; - } - - return DB_ERR_ROW_NOT_FOUND; -} - -/******************************************************************************/ -/* - * dbReadStr calls dbReadInt to do table driven read of database - */ - -int dbReadStr(int did, char_t *table, char_t *column, int row, - char_t **returnValue) -{ - return dbReadInt(did, table, column, row, (int *)returnValue); -} - -/******************************************************************************/ -/* - * The dbWriteInt function writes a value into a table at a given row and - * column. The existence of the row and column is verified before the - * write. 0 is returned on succes, -1 is returned on error. - */ - -int dbWriteInt(int did, char_t *table, char_t *column, int row, int iData) -{ - int tid, colIndex, *pRow; - dbTable_t *pTable; - - a_assert(table); - a_assert(column); - -/* - * Make sure that this table exists - */ - tid = dbGetTableId(0, table); - a_assert(tid >= 0); - - if (tid < 0) { - return DB_ERR_TABLE_NOT_FOUND; - } - - pTable = dbListTables[tid]; - - if (pTable) { -/* - * Make sure that the column exists - */ - colIndex = GetColumnIndex(tid, column); - a_assert(colIndex >= 0); - if (colIndex >= 0) { -/* - * Make sure that the row exists - */ - a_assert((row >= 0) && (row < pTable->nRows)); - if ((row >= 0) && (row < pTable->nRows)) { - pRow = pTable->rows[row]; - if (pRow) { - pRow[colIndex] = iData; - return 0; - } - return DB_ERR_ROW_DELETED; - } - return DB_ERR_ROW_NOT_FOUND; - } - return DB_ERR_COL_NOT_FOUND; - } - - return DB_ERR_TABLE_DELETED; -} - -/******************************************************************************/ -/* - * The dbWriteStr function writes a string value into a table at a given row - * and column. The existence of the row and column is verified before the - * write. The column is also checked to confirm it is a string field. - * 0 is returned on succes, -1 is returned on error. - */ - -int dbWriteStr(int did, char_t *table, char_t *column, int row, char_t *s) -{ - int tid, colIndex; - int *pRow; - char_t *ptr; - dbTable_t *pTable; - - a_assert(table); - a_assert(column); - - tid = dbGetTableId(0, table); - a_assert(tid >= 0); - - if (tid < 0) { - return DB_ERR_TABLE_NOT_FOUND; - } - -/* - * Make sure that this table exists - */ - pTable = dbListTables[tid]; - a_assert(pTable); - if (!pTable) { - return DB_ERR_TABLE_DELETED; - } - -/* - * Make sure that this column exists - */ - colIndex = GetColumnIndex(tid, column); - if (colIndex < 0) { - return DB_ERR_COL_NOT_FOUND; - } - -/* - * Make sure that this column is a string column - */ - if (pTable->columnTypes[colIndex] != T_STRING) { - return DB_ERR_BAD_FORMAT; - } - -/* - * Make sure that the row exists - */ - a_assert((row >= 0) && (row < pTable->nRows)); - if ((row >= 0) && (row < pTable->nRows)) { - pRow = pTable->rows[row]; - } else { - return DB_ERR_ROW_NOT_FOUND; - } - - if (!pRow) { - return DB_ERR_ROW_DELETED; - } - -/* - * If the column already has a value, be sure to delete it to prevent - * memory leaks. - */ - if (pRow[colIndex]) { - bfree(B_L, (char_t *) pRow[colIndex]); - } - -/* - * Make sure we make a copy of the string to write into the column. - * This allocated string will be deleted when the row is deleted. - */ - ptr = bstrdup(B_L, s); - pRow[colIndex] = (int)ptr; - - return 0; -} - -/******************************************************************************/ -/* - * Print a key-value pair to a file - */ - -static int dbWriteKeyValue(int fd, char_t *key, char_t *value) -{ - int rc; - int len; - char_t *pLineOut; - - a_assert(key && *key); - a_assert(value); - - fmtAlloc(&pLineOut, BUF_MAX, T("%s=%s\n"), key, value); - - if (pLineOut) { - len = gstrlen(pLineOut); -#if CE - rc = writeUniToAsc(fd, pLineOut, len); -#else - rc = gwrite(fd, pLineOut, len); -#endif - bfree(B_L, pLineOut); - } else { - rc = -1; - } - - return rc; -} - -/******************************************************************************/ -/* - * Persist a database to a file - */ - -int dbSave(int did, char_t *filename, int flags) -{ - int row, column, nColumns, nRows, fd, rc; - int *colTypes, *pRow, nRet, tid; - char_t *path, *tmpFile, *tmpNum; - char_t **colNames; - dbTable_t *pTable; - - trace(5, T("DB: About to save database to file\n")); - - a_assert(dbMaxTables > 0); - -/* - * First write to a temporary file, then switch around later. - */ - fmtAlloc(&tmpFile, FNAMESIZE, T("%s/data.tmp"), basicGetProductDir()); - if ((fd = gopen(tmpFile, - O_CREAT | O_TRUNC | O_WRONLY | O_BINARY, 0666)) < 0) { - trace(1, T("WARNING: Failed to open file %s\n"), tmpFile); - bfree(B_L, tmpFile); - return -1; - } - - nRet = 0; - - for (tid = 0; (tid < dbMaxTables) && (nRet != -1); tid++) { - pTable = dbListTables[tid]; - - if (pTable) { -/* - * Print the TABLE=tableName directive to the file - */ - rc = dbWriteKeyValue(fd, KEYWORD_TABLE, pTable->name); - - nColumns = pTable->nColumns; - nRows = pTable->nRows; - - for (row = 0; (row < nRows) && (nRet == 0); row++) { - pRow = pTable->rows[row]; -/* - * if row is NULL, the row has been deleted, so don't - * write it out. - */ - if ((pRow == NULL) || (pRow[0] == '\0') || - (*(char_t *)(pRow[0]) == '\0')) { - continue; - } -/* - * Print the ROW=rowNumber directive to the file - */ - fmtAlloc(&tmpNum, 20, T("%d"), row); - rc = dbWriteKeyValue(fd, KEYWORD_ROW, tmpNum); - bfreeSafe(B_L, tmpNum); - - colNames = pTable->columnNames; - colTypes = pTable->columnTypes; -/* - * Print the key-value pairs (COLUMN=value) for data cells - */ - for (column = 0; (column < nColumns) && (rc >= 0); - column++, colNames++, colTypes++) { - if (*colTypes == T_STRING) { - rc = dbWriteKeyValue(fd, *colNames, - (char_t *)(pRow[column])); - } else { - fmtAlloc(&tmpNum, 20, T("%d"), pRow[column]); - rc = dbWriteKeyValue(fd, *colNames, tmpNum); - bfreeSafe(B_L, tmpNum); - } - } - - if (rc < 0) { - trace(1, T("WARNING: Failed to write to file %s\n"), - tmpFile); - nRet = -1; - } - } - } - } - - gclose(fd); - -/* - * Replace the existing file with the temporary file, if no errors - */ - if (nRet == 0) { - fmtAlloc(&path, FNAMESIZE, T("%s/%s"), basicGetProductDir(), filename); - - gunlink(path); - if (grename(tmpFile, path) != 0) { - trace(1, T("WARNING: Failed to rename %s to %s\n"), tmpFile, path); - nRet = -1; - } - - bfree(B_L, path); - } - - bfree(B_L, tmpFile); - - return nRet; -} - -/******************************************************************************/ -/* - * Crack a keyword=value string into keyword and value. We can change buf. - */ - -static int crack(char_t *buf, char_t **key, char_t **val) -{ - char_t *ptr; - - if ((ptr = gstrrchr(buf, '\n')) != NULL || - (ptr = gstrrchr(buf, '\r')) != NULL) { - *ptr = '\0'; - } - -/* - * Find the = sign. It must exist. - */ - if ((ptr = gstrstr(buf, T("="))) == NULL) { - return -1; - } - - *ptr++ = '\0'; - *key = trim(buf); - *val = trim(ptr); - - return 0; -} - -/******************************************************************************/ -/* - * Parse the file. These files consist of key-value pairs, separated by the - * "=" sign. Parsing of tables starts with the "TABLE=value" pair, and rows - * are parsed starting with the "ROW=value" pair. - */ - -int dbLoad(int did, char_t *filename, int flags) -{ - gstat_t sbuf; - char_t *buf, *keyword, *value, *path, *ptr; - char_t *tablename; - int fd, tid, row; - dbTable_t *pTable; - - a_assert(did >= 0); - - fmtAlloc(&path, FNAMESIZE, T("%s/%s"), basicGetProductDir(), filename); - trace(4, T("DB: About to read data file <%s>\n"), path); - - if (gstat(path, &sbuf) < 0) { - trace(3, T("DB: Failed to stat persistent data file.\n")); - bfree(B_L, path); - return -1; - } - - fd = gopen(path, O_RDONLY | O_BINARY, 0666); - bfree(B_L, path); - - if (fd < 0) { - trace(3, T("DB: No persistent data file present.\n")); - return -1; - } - - if (sbuf.st_size <= 0) { - trace(3, T("DB: Persistent data file is empty.\n")); - gclose(fd); - return -1; - } -/* - * Read entire file into temporary buffer - */ - buf = balloc(B_L, sbuf.st_size + 1); -#if CE - if (readAscToUni(fd, &buf, sbuf.st_size) != (int)sbuf.st_size) { -#else - if (gread(fd, buf, sbuf.st_size) != (int)sbuf.st_size) { -#endif - trace(3, T("DB: Persistent data read failed.\n")); - bfree(B_L, buf); - gclose(fd); - return -1; - } - - gclose(fd); - *(buf + sbuf.st_size) = '\0'; - - row = -1; - tid = -1; - pTable = NULL; - ptr = gstrtok(buf, T("\n")); - tablename = NULL; - - do { - if (crack(ptr, &keyword, &value) < 0) { - trace(5, T("DB: Failed to crack line %s\n"), ptr); - continue; - } - - a_assert(keyword && *keyword); - - if (gstrcmp(keyword, KEYWORD_TABLE) == 0) { -/* - * Table name found, check to see if it's registered - */ - if (tablename) { - bfree(B_L, tablename); - } - - tablename = bstrdup(B_L, value); - tid = dbGetTableId(did, tablename); - - if (tid >= 0) { - pTable = dbListTables[tid]; - } else { - pTable = NULL; - } - - } else if (gstrcmp(keyword, KEYWORD_ROW) == 0) { -/* - * Row/Record indicator found, add a new row to table - */ - if (tid >= 0) { - int nRows = dbGetTableNrow(did, tablename); - - if (dbSetTableNrow(did, tablename, nRows + 1) == 0) { - row = nRows; - } - } - - } else if (row != -1) { -/* - * some other data found, assume it's a COLUMN=value - */ - int nColumn = GetColumnIndex(tid, keyword); - - if ((nColumn >= 0) && (pTable != NULL)) { - int nColumnType = pTable->columnTypes[nColumn]; - if (nColumnType == T_STRING) { - dbWriteStr(did, tablename, keyword, row, value); - } else { - dbWriteInt(did, tablename, keyword, row, gstrtoi(value)); - } - } - } - } while ((ptr = gstrtok(NULL, T("\n"))) != NULL); - - if (tablename) { - bfree(B_L, tablename); - } - - bfree(B_L, buf); - - return 0; -} - -/******************************************************************************/ -/* - * Return a table id given the table name - */ - -int dbGetTableId(int did, char_t *tablename) -{ - int tid; - dbTable_t *pTable; - - a_assert(tablename); - - for (tid = 0; (tid < dbMaxTables); tid++) { - if ((pTable = dbListTables[tid]) != NULL) { - if (gstrcmp(tablename, pTable->name) == 0) { - return tid; - } - } - } - - return -1; -} - -/******************************************************************************/ -/* - * Return a pointer to the table name, given its ID - */ - -char_t *dbGetTableName(int did, int tid) -{ - if ((tid >= 0) && (tid < dbMaxTables) && (dbListTables[tid] != NULL)) { - return (dbListTables[tid])->name; - } - - return NULL; -} - -/******************************************************************************/ -/* - * Trim leading white space. - */ - -static char_t *trim(char_t *str) -{ - while (isspace((int)*str)) { - str++; - } - return str; -} - -/******************************************************************************/ -/* - * Return a column index given the column name - */ - -static int GetColumnIndex(int tid, char_t *colName) -{ - int column; - dbTable_t *pTable; - - a_assert(colName); - - if ((tid >= 0) && (tid < dbMaxTables) && (dbListTables[tid] != NULL)) { - pTable = dbListTables[tid]; - - for (column = 0; (column < pTable->nColumns); column++) { - if (gstrcmp(colName, pTable->columnNames[column]) == 0) - return column; - } - } - - return -1; -} - -/******************************************************************************/ -/* - * Set the prefix-directory - */ - -void basicSetProductDir(char_t *proddir) -{ - int len; - - if (basicProdDir != NULL) { - bfree(B_L, basicProdDir); - } - - basicProdDir = bstrdup(B_L, proddir); -/* - * Make sure that prefix-directory doesn't end with a '/' - */ - len = gstrlen(basicProdDir); - if ((len > 0) && *(basicProdDir + len - 1) == '/') { - *(basicProdDir+len-1) = '\0'; - } -} - -/******************************************************************************/ -/* - * Return the prefix-directory - */ - -char_t *basicGetProductDir() -{ - if (basicProdDir) { - return basicProdDir; - } else { - return basicDefaultDir; - } -} - -/******************************************************************************/ diff --git a/cpukit/httpd/emfdb.h b/cpukit/httpd/emfdb.h deleted file mode 100644 index 0ba7e67401..0000000000 --- a/cpukit/httpd/emfdb.h +++ /dev/null @@ -1,102 +0,0 @@ -/* - * emfdb.h -- EMF database compatability functions for GoAhead WebServer. - * - * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved. - * - * See the file "license.txt" for usage and redistribution license requirements - * - * $Id$ - */ - -/******************************** Description *********************************/ -/* - * Emf-like textfile database support for WebServer 2.1. - */ - -/********************************* Includes ***********************************/ - -#ifndef _h_EMFDB -#define _h_EMFDB 1 - -#if ! UEMF - #include "basic/basic.h" - #include "emf/emf.h" -#else - #include "uemf.h" -#endif - - -/********************************* Defines ************************************/ - -#define T_INT 0 -#define T_STRING 1 - -#define DB_OK 0 -#define DB_ERR_GENERAL -1 -#define DB_ERR_COL_NOT_FOUND -2 -#define DB_ERR_COL_DELETED -3 -#define DB_ERR_ROW_NOT_FOUND -4 -#define DB_ERR_ROW_DELETED -5 -#define DB_ERR_TABLE_NOT_FOUND -6 -#define DB_ERR_TABLE_DELETED -7 -#define DB_ERR_BAD_FORMAT -8 - -typedef struct dbTable_s { - char_t *name; - int nColumns; - char_t **columnNames; - int *columnTypes; - int nRows; - int **rows; -} dbTable_t; - -/********************************** Prototypes ********************************/ - -/* - * Add a schema to the module-internal schema database - */ -extern int dbRegisterDBSchema(dbTable_t *sTable); - -extern int dbOpen(char_t *databasename, char_t *filename, - int (*gettime)(int did), int flags); -extern void dbClose(int did); -extern int dbGetTableId(int did, char_t *tname); -extern char_t *dbGetTableName(int did, int tid); -extern int dbReadInt(int did, char_t *table, char_t *column, int row, - int *returnValue); -extern int dbReadStr(int did, char_t *table, char_t *column, int row, - char_t **returnValue); -extern int dbWriteInt(int did, char_t *table, char_t *column, int row, - int idata); -extern int dbWriteStr(int did, char_t *table, char_t *column, int row, - char_t *s); -extern int dbAddRow(int did, char_t *table); -extern int dbDeleteRow(int did, char_t *table, int rid); -extern int dbSetTableNrow(int did, char_t *table, int nNewRows); -extern int dbGetTableNrow(int did, char_t *table); - -/* - * Dump the contents of a database to file - */ -extern int dbSave(int did, char_t *filename, int flags); - -/* - * Load the contents of a database to file - */ -extern int dbLoad(int did, char_t *filename, int flags); - -/* - * Search for a data in a given column - */ -extern int dbSearchStr(int did, char_t *table, char_t *column, - char_t *value, int flags); - -extern void dbZero(int did); - -extern char_t *basicGetProductDir(); -extern void basicSetProductDir(char_t *proddir); - -#endif /* _h_EMFDB */ - -/******************************************************************************/ - diff --git a/cpukit/httpd/form.c b/cpukit/httpd/form.c deleted file mode 100644 index dbad2d2e78..0000000000 --- a/cpukit/httpd/form.c +++ /dev/null @@ -1,166 +0,0 @@ -/* - * form.c -- Form processing (in-memory CGI) for the GoAhead Web server - * - * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved. - * - * See the file "license.txt" for usage and redistribution license requirements - */ - -/********************************** Description *******************************/ - -/* - * This module implements the /goform handler. It emulates CGI processing - * but performs this in-process and not as an external process. This enables - * a very high performance implementation with easy parsing and decoding - * of query strings and posted data. - */ - -/*********************************** Includes *********************************/ - -#include "wsIntrn.h" - -/************************************ Locals **********************************/ - -static sym_fd_t formSymtab = -1; /* Symbol table for form handlers */ - -/************************************* Code ***********************************/ -/* - * Process a form request. Returns 1 always to indicate it handled the URL - */ - -int websFormHandler(webs_t wp, char_t *urlPrefix, char_t *webDir, int arg, - char_t *url, char_t *path, char_t *query) -{ - sym_t *sp; - char_t formBuf[FNAMESIZE]; - char_t *cp, *formName; - int (*fn)(void *sock, char_t *path, char_t *args); - - a_assert(websValid(wp)); - a_assert(url && *url); - a_assert(path && *path == '/'); - - websStats.formHits++; - -/* - * Extract the form name - */ - gstrncpy(formBuf, path, TSZ(formBuf)); - if ((formName = gstrchr(&formBuf[1], '/')) == NULL) { - websError(wp, 200, T("Missing form name")); - return 1; - } - formName++; - if ((cp = gstrchr(formName, '/')) != NULL) { - *cp = '\0'; - } - -/* - * Lookup the C form function first and then try tcl (no javascript support - * yet). - */ - sp = symLookup(formSymtab, formName); - if (sp == NULL) { - websError(wp, 200, T("Form %s is not defined"), formName); - } else { - fn = (int (*)(void *, char_t *, char_t *)) sp->content.value.integer; - a_assert(fn); - if (fn) { -/* - * For good practice, forms must call websDone() - */ - (*fn)((void*) wp, formName, query); - -/* - * Remove the test to force websDone, since this prevents - * the server "push" from a form> - */ -#if 0 /* push */ - if (websValid(wp)) { - websError(wp, 200, T("Form didn't call websDone")); - } -#endif /* push */ - } - } - return 1; -} - -/******************************************************************************/ -/* - * Define a form function in the "form" map space. - */ - -int websFormDefine(char_t *name, void (*fn)(webs_t wp, char_t *path, - char_t *query)) -{ - a_assert(name && *name); - a_assert(fn); - - if (fn == NULL) { - return -1; - } - - symEnter(formSymtab, name, valueInteger((int) fn), (int) NULL); - return 0; -} - -/******************************************************************************/ -/* - * Open the symbol table for forms. - */ - -void websFormOpen() -{ - formSymtab = symOpen(WEBS_SYM_INIT); -} - -/******************************************************************************/ -/* - * Close the symbol table for forms. - */ - -void websFormClose() -{ - if (formSymtab != -1) { - symClose(formSymtab); - formSymtab = -1; - } -} - -/******************************************************************************/ -/* - * Write a webs header. This is a convenience routine to write a common - * header for a form back to the browser. - */ - -void websHeader(webs_t wp) -{ - a_assert(websValid(wp)); - - websWrite(wp, T("HTTP/1.0 200 OK\n")); - -/* - * By license terms the following line of code must not be modified - */ - websWrite(wp, T("Server: %s\r\n"), WEBS_NAME); - - websWrite(wp, T("Pragma: no-cache\n")); - websWrite(wp, T("Cache-control: no-cache\n")); - websWrite(wp, T("Content-Type: text/html\n")); - websWrite(wp, T("\n")); - websWrite(wp, T("\n")); -} - -/******************************************************************************/ -/* - * Write a webs footer - */ - -void websFooter(webs_t wp) -{ - a_assert(websValid(wp)); - - websWrite(wp, T("\n")); -} - -/******************************************************************************/ diff --git a/cpukit/httpd/h.c b/cpukit/httpd/h.c deleted file mode 100644 index 23bc1ddd9c..0000000000 --- a/cpukit/httpd/h.c +++ /dev/null @@ -1,193 +0,0 @@ -/* - * h.c -- Handle allocation module - * - * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved. - * See the file "license.txt" for usage and redistribution license requirements - */ - -/******************************** Description *********************************/ - -/* - * This module provides a simple API to allocate and free handles - * It maintains a dynamic array of pointers. These usually point to - * per-handle structures. - */ - -/********************************* Includes ***********************************/ - -#if UEMF - #include "uemf.h" -#else - #include "basic/basicInternal.h" -#endif - -/********************************** Defines ***********************************/ -/* - * The handle list stores the length of the list and the number of used - * handles in the first two words. These are hidden from the caller by - * returning a pointer to the third word to the caller - */ - -#define H_LEN 0 /* First entry holds length of list */ -#define H_USED 1 /* Second entry holds number of used */ -#define H_OFFSET 2 /* Offset to real start of list */ - -#define H_INCR 16 /* Grow handle list in chunks this size */ - -/*********************************** Code *************************************/ -/* - * Allocate a new file handle. On the first call, the caller must set the - * handle map to be a pointer to a null pointer. *map points to the second - * element in the handle array. - */ - -#if B_STATS -int HALLOC(B_ARGS_DEC, void ***map) -#else -int hAlloc(void ***map) -#endif -{ - int *mp; - int handle, len, memsize, incr; - - a_assert(map); - - if (*map == NULL) { - incr = H_INCR; - memsize = (incr + H_OFFSET) * sizeof(void**); -#if B_STATS - if ((mp = (int*) balloc(B_ARGS, memsize)) == NULL) { -#else - if ((mp = (int*) balloc(B_L, memsize)) == NULL) { -#endif - return -1; - } - memset(mp, 0, memsize); - mp[H_LEN] = incr; - mp[H_USED] = 0; - *map = (void**) &mp[H_OFFSET]; - } else { - mp = &((*(int**)map)[-H_OFFSET]); - } - - len = mp[H_LEN]; - -/* - * Find the first null handle - */ - if (mp[H_USED] < mp[H_LEN]) { - for (handle = 0; handle < len; handle++) { - if (mp[handle+H_OFFSET] == 0) { - mp[H_USED]++; - return handle; - } - } - } else { - handle = len; - } - -/* - * No free handle so grow the handle list. Grow list in chunks of H_INCR. - */ - len += H_INCR; - memsize = (len + H_OFFSET) * sizeof(void**); - if ((mp = (int*) brealloc(B_L, (void*) mp, memsize)) == NULL) { - return -1; - } - *map = (void**) &mp[H_OFFSET]; - mp[H_LEN] = len; - memset(&mp[H_OFFSET + len - H_INCR], 0, sizeof(int*) * H_INCR); - mp[H_USED]++; - return handle; -} - -/******************************************************************************/ -/* - * Free a handle. This function returns the value of the largest - * handle in use plus 1, to be saved as a max value. - */ - -int hFree(void ***map, int handle) -{ - int *mp; - int len; - - a_assert(map); - mp = &((*(int**)map)[-H_OFFSET]); - a_assert(mp[H_LEN] >= H_INCR); - - a_assert(mp[handle + H_OFFSET]); - a_assert(mp[H_USED]); - mp[handle + H_OFFSET] = 0; - if (--(mp[H_USED]) == 0) { - bfree(B_L, (void*) mp); - *map = NULL; - } - -/* - * Find the greatest handle number in use. - */ - if (*map == NULL) { - handle = -1; - } else { - len = mp[H_LEN]; - if (mp[H_USED] < mp[H_LEN]) { - for (handle = len - 1; handle >= 0; handle--) { - if (mp[handle + H_OFFSET]) - break; - } - } else { - handle = len; - } - } - return handle + 1; -} - -/******************************************************************************/ -/* - * Allocate an entry in the halloc array. - */ - -#if B_STATS -int HALLOCENTRY(B_ARGS_DEC, void ***list, int *max, int size) -#else -int hAllocEntry(void ***list, int *max, int size) -#endif -{ - char_t *cp; - int id; - - a_assert(list); - a_assert(max); - -#if B_STATS - if ((id = HALLOC(B_ARGS, (void***) list)) < 0) { -#else - if ((id = hAlloc((void***) list)) < 0) { -#endif - return -1; - } - - if (size > 0) { -#if B_STATS - if ((cp = balloc(B_ARGS, size)) == NULL) { -#else - if ((cp = balloc(B_L, size)) == NULL) { -#endif - hFree(list, id); - return -1; - } - a_assert(cp); - memset(cp, 0, size); - - (*list)[id] = (void*) cp; - } - - if (id >= *max) { - *max = id + 1; - } - return id; -} - -/******************************************************************************/ - diff --git a/cpukit/httpd/handler.c b/cpukit/httpd/handler.c deleted file mode 100644 index 88693bf9a6..0000000000 --- a/cpukit/httpd/handler.c +++ /dev/null @@ -1,361 +0,0 @@ -/* - * handler.c -- URL handler support - * - * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved. - * - * See the file "license.txt" for usage and redistribution license requirements - */ - -/******************************** Description *********************************/ - -/* - * This module implements a URL handler interface and API to permit - * the addition of user definable URL processors. - */ - -/********************************* Includes ***********************************/ - -#include "wsIntrn.h" - -/*********************************** Locals ***********************************/ - -static websUrlHandlerType *websUrlHandler; /* URL handler list */ -static int websUrlHandlerMax; /* Number of entries */ -static int urlHandlerOpenCount = 0; /* count of apps */ - -/**************************** Forward Declarations ****************************/ - -static int websUrlHandlerSort(const void *p1, const void *p2); -static int websPublishHandler(webs_t wp, char_t *urlPrefix, char_t *webDir, - int sid, char_t *url, char_t *path, char_t *query); -static int websTidyUrl(webs_t wp); - -/*********************************** Code *************************************/ -/* - * Initialize the URL handler module - */ - -int websUrlHandlerOpen() -{ - if (++urlHandlerOpenCount == 1) { - websAspOpen(); - websUrlHandler = NULL; - websUrlHandlerMax = 0; - } - return 0; -} - -/******************************************************************************/ -/* - * Close the URL handler module - */ - -void websUrlHandlerClose() -{ - websUrlHandlerType *sp; - - if (--urlHandlerOpenCount <= 0) { - websAspClose(); - for (sp = websUrlHandler; sp < &websUrlHandler[websUrlHandlerMax]; - sp++) { - bfree(B_L, sp->urlPrefix); - if (sp->webDir) { - bfree(B_L, sp->webDir); - } - } - bfree(B_L, websUrlHandler); - websUrlHandlerMax = 0; - } -} - -/******************************************************************************/ -/* - * Define a new URL handler. urlPrefix is the URL prefix to match. webDir is - * an optional root directory path for a web directory. arg is an optional - * arg to pass to the URL handler. flags defines the matching order. Valid - * flags include WEBS_HANDLER_LAST, WEBS_HANDLER_FIRST. If multiple users - * specify last or first, their order is defined alphabetically by the - * urlPrefix. - */ - -int websUrlHandlerDefine(char_t *urlPrefix, char_t *webDir, int arg, - int (*handler)(webs_t wp, char_t *urlPrefix, char_t *webdir, int arg, - char_t *url, char_t *path, char_t *query), int flags) -{ - websUrlHandlerType *sp; - int len; - - a_assert(urlPrefix); - a_assert(handler); - -/* - * Grow the URL handler array to create a new slot - */ - len = (websUrlHandlerMax + 1) * sizeof(websUrlHandlerType); - if ((websUrlHandler = brealloc(B_L, websUrlHandler, len)) == NULL) { - return -1; - } - sp = &websUrlHandler[websUrlHandlerMax++]; - memset(sp, 0, sizeof(websUrlHandlerType)); - - sp->urlPrefix = bstrdup(B_L, urlPrefix); - sp->len = gstrlen(sp->urlPrefix); - if (webDir) { - sp->webDir = bstrdup(B_L, webDir); - } else { - sp->webDir = bstrdup(B_L, T("")); - } - sp->handler = handler; - sp->arg = arg; - sp->flags = flags; - -/* - * Sort in decreasing URL length order observing the flags for first and last - */ - qsort(websUrlHandler, websUrlHandlerMax, sizeof(websUrlHandlerType), - websUrlHandlerSort); - return 0; -} - -/******************************************************************************/ -/* - * Delete an existing URL handler. We don't reclaim the space of the old - * handler, just NULL the entry. Return -1 if handler is not found. - */ - -int websUrlHandlerDelete(int (*handler)(webs_t wp, char_t *urlPrefix, - char_t *webDir, int arg, char_t *url, char_t *path, char_t *query)) -{ - websUrlHandlerType *sp; - int i; - - for (i = 0; i < websUrlHandlerMax; i++) { - sp = &websUrlHandler[i]; - if (sp->handler == handler) { - sp->handler = NULL; - return 0; - } - } - return -1; -} - -/******************************************************************************/ -/* - * Sort in decreasing URL length order observing the flags for first and last - */ - -static int websUrlHandlerSort(const void *p1, const void *p2) -{ - websUrlHandlerType *s1, *s2; - int rc; - - a_assert(p1); - a_assert(p2); - - s1 = (websUrlHandlerType*) p1; - s2 = (websUrlHandlerType*) p2; - - if ((s1->flags & WEBS_HANDLER_FIRST) || (s2->flags & WEBS_HANDLER_LAST)) { - return -1; - } - - if ((s2->flags & WEBS_HANDLER_FIRST) || (s1->flags & WEBS_HANDLER_LAST)) { - return 1; - } - - if ((rc = gstrcmp(s1->urlPrefix, s2->urlPrefix)) == 0) { - if (s1->len < s2->len) { - return 1; - } else if (s1->len > s2->len) { - return -1; - } - } - return -rc; -} - -/******************************************************************************/ -/* - * Publish a new web directory (Use the default URL handler) - */ - -int websPublish(char_t *urlPrefix, char_t *path) -{ - return websUrlHandlerDefine(urlPrefix, path, 0, websPublishHandler, 0); -} - -/******************************************************************************/ -/* - * Return the directory for a given prefix. Ignore empty prefixes - */ - -char_t *websGetPublishDir(char_t *path, char_t **urlPrefix) -{ - websUrlHandlerType *sp; - int i; - - for (i = 0; i < websUrlHandlerMax; i++) { - sp = &websUrlHandler[i]; - if (sp->urlPrefix[0] == '\0') { - continue; - } - if (sp->handler && gstrncmp(sp->urlPrefix, path, sp->len) == 0) { - if (urlPrefix) { - *urlPrefix = sp->urlPrefix; - } - return sp->webDir; - } - } - return NULL; -} - -/******************************************************************************/ -/* - * Publish URL handler. We just patch the web page Directory and let the - * default handler do the rest. - */ - -static int websPublishHandler(webs_t wp, char_t *urlPrefix, char_t *webDir, - int sid, char_t *url, char_t *path, char_t *query) -{ - int len; - - a_assert(websValid(wp)); - a_assert(path); - -/* - * Trim the urlPrefix off the path and set the webdirectory. Add one to step - * over the trailing '/' - */ - len = gstrlen(urlPrefix) + 1; - websSetRequestPath(wp, webDir, &path[len]); - return 0; -} - -/******************************************************************************/ -/* - * See if any valid handlers are defined for this request. If so, call them - * and continue calling valid handlers until one accepts the request. - * Return true if a handler was invoked, else return FALSE. - */ - -int websUrlHandlerRequest(webs_t wp) -{ - websUrlHandlerType *sp; - int i, first; - - a_assert(websValid(wp)); - -/* - * Delete the socket handler as we don't want to start reading any - * data on the connection as it may be for the next pipelined HTTP/1.1 - * request if using Keep Alive - */ - socketDeleteHandler(wp->sid); - wp->state = WEBS_PROCESSING; - websStats.handlerHits++; - - websSetRequestPath(wp, websGetDefaultDir(), NULL); - - websTidyUrl(wp); - -/* - * We loop over each handler in order till one accepts the request. - * The security handler will handle the request if access is NOT allowed. - */ - first = 1; - for (i = 0; i < websUrlHandlerMax; i++) { - sp = &websUrlHandler[i]; - if (sp->handler && gstrncmp(sp->urlPrefix, wp->path, sp->len) == 0) { - if (first) { - websSetEnv(wp); - first = 0; - } - if ((*sp->handler)(wp, sp->urlPrefix, sp->webDir, sp->arg, - wp->url, wp->path, wp->query)) { - return 1; - } - if (!websValid(wp)) { - trace(0, - T("webs: handler %s called websDone, but didn't return 1\n"), - sp->urlPrefix); - return 1; - } - } - } -/* - * If no handler processed the request, then return an error. Note: It is - * the handlers responsibility to call websDone - */ - if (i >= websUrlHandlerMax) { - websError(wp, 200, T("No handler for this URL %s"), wp->url); - } - return 0; -} - - -/******************************************************************************/ -/* - * Tidy up the URL path. Return -1 if the URL is bad. - * Used to eliminate repeated directory delimiters ('/'). - */ - -static int websTidyUrl(webs_t wp) -{ - char_t *parts[64]; /* Array of ptr's to URL parts */ - char_t *token, *url, *tidyurl; - int i, len, npart; - - a_assert(websValid(wp)); - -/* - * Copy the string so we don't destroy the original (yet) - */ - url = bstrdup(B_L, wp->url); - websDecodeUrl(url, url, gstrlen(url)); - - len = npart = 0; - parts[0] = NULL; - token = gstrtok(url, T("/")); - -/* - * Look at each directory segment and process "." and ".." segments - * Don't allow the browser to pop outside the root web. - */ - while (token != NULL) { - if (gstrcmp(token, T("..")) == 0) { - if (npart > 0) { - npart--; - } - - } else if (gstrcmp(token, T(".")) != 0) { - parts[npart] = token; - len += gstrlen(token) + 1; - npart++; - } - token = gstrtok(NULL, T("/")); - } - -/* - * Re-construct URL. Need extra space all "/" and null. - */ - if (npart || (gstrcmp(url, T("/")) == 0) || (url[0] == '\0')) { - tidyurl = balloc(B_L, (len + 2) * sizeof(char_t)); - *tidyurl = '\0'; - - for (i = 0; i < npart; i++) { - gstrcat(tidyurl, T("/")); - gstrcat(tidyurl, parts[i]); - } - - bfree(B_L, url); - - bfree(B_L, wp->url); - wp->url = tidyurl; - return 0; - } else { - bfree(B_L, url); - return -1; - } -} - -/******************************************************************************/ diff --git a/cpukit/httpd/license.txt b/cpukit/httpd/license.txt deleted file mode 100644 index b10d3ddb1d..0000000000 --- a/cpukit/httpd/license.txt +++ /dev/null @@ -1,124 +0,0 @@ -License Agreement - -THIS LICENSE ALLOWS ONLY THE LIMITED USE OF GO AHEAD SOFTWARE, INC. PROPRIETARY CODE. PLEASE CAREFULLY READ THIS AGREEMENT AS IT PERTAINS TO THIS LICENSE, YOU CERTIFY THAT YOU WILL USE THE SOFTWARE ONLY IN THE MANNER PERMITTED HEREIN. - -1. Definitions. - -1.1 "Documentation" means any documentation GoAhead includes with the Original Code. - -1.2 "GoAhead" means Go Ahead Software, Inc. - -1.3 "Intellectual Property Rights" means all rights, whether now existing or hereinafter acquired, in and to trade secrets, patents, copyrights, trademarks, know-how, as well as moral rights and similar rights of any type under the laws of any governmental authority, domestic or foreign, including rights in and to all applications and registrations relating to any of the foregoing. - -1.4 "License" or "Agreement" means this document. - -1.5 "Modifications" means any addition to or deletion from the substance or structure of either the Original Code or any previous Modifications. - -1.6 "Original Code" means the Source Code to GoAhead’s proprietary computer software entitled GoAhead WebServer. - -1.7 "Response Header" means the first portion of the response message output by the GoAhead WebServer, containing but not limited to, header fields for date, content-type, server identification and cache control. - -1.8 "Server Identification Field" means the field in the Response Header which contains the text "Server: GoAhead-Webs". - -1.9 "You" means an individual or a legal entity exercising rights under, and complying with all of the terms of, this license or a future version of this license. For legal entities, "You" includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of fifty percent (50%) or more of the outstanding shares or beneficial ownership of such entity. - -2. Source Code License. - -2.1 Limited Source Code Grant. - -GoAhead hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims, to use, reproduce, modify, copy and distribute the Original Code. - -2.2 Binary Code. - -GoAhead hereby grants You a world-wide, royalty-free, non-exclusive license to copy and distribute the binary code versions of the Original Code together with Your Modifications. - -2.3 License Back to GoAhead. - -You hereby grant in both source code and binary code to GoAhead a world-wide, royalty-free, non-exclusive license to copy, modify, display, use and sublicense any Modifications You make that are distributed or planned for distribution. Within 30 days of either such event, You agree to ship to GoAhead a file containing the Modifications (in a media to be determined by the parties), including any programmers’ notes and other programmers’ materials. Additionally, You will provide to GoAhead a complete description of the product, the product code or model number, the date on which the product is initially shipped, and a contact name, phone number and e-mail address for future correspondence. GoAhead will keep confidential all data specifically marked as such. - -2.4 Restrictions on Use. - -You may sublicense Modifications to third parties such as subcontractors or OEM's provided that You enter into license agreements with such third parties that bind such third parties to all the obligations under this Agreement applicable to you and that are otherwise substantially similar in scope and application to this Agreement. - -3. Term. - -This Agreement and license are effective from the time You accept the terms of this Agreement until this Agreement is terminated. You may terminate this Agreement at any time by uninstalling or destroying all copies of the Original Code including any and all binary versions and removing any Modifications to the Original Code existing in any products. This Agreement will terminate immediately and without further notice if You fail to comply with any provision of this Agreement. All restrictions on use, and all other provisions that may reasonably be interpreted to survive termination of this Agreement, will survive termination of this Agreement for any reason. Upon termination, You agree to uninstall or destroy all copies of the Original Code, Modifications, and Documentation. - -4. Trademarks and Brand. - -4.1 License and Use. - -GoAhead hereby grants to You a limited world-wide, royalty-free, non-exclusive license to use the GoAhead trade names, trademarks, logos, service marks and product designations posted in Exhibit A (collectively, the "GoAhead Marks") in connection with the activities by You under this Agreement. Additionally, GoAhead grants You a license under the terms above to such GoAhead trademarks as shall be identified at a URL (the "URL") provided by GoAhead. The use by You of GoAhead Marks shall be in accordance with GoAhead’s trademark policies regarding trademark usage as established at the web site designated by the URL, or as otherwise communicated to You by GoAhead at its sole discretion. You understand and agree that any use of GoAhead Marks in connection with this Agreement shall not create any right, title or interest in or to such GoAhead Marks and that all such use and goodwill associated with GoAhead Marks will inure to the benefit of GoAhead. - -4.2 Promotion by You of GoAhead WebServer Mark. - -In consideration for the licenses granted by GoAhead to You herein, You agree to notify GoAhead when You incorporate the GoAhead WebServer in Your product and to inform GoAhead when such product begins to ship. You agree to promote the Original Code by prominently and visibly displaying a graphic of the GoAhead WebServer mark on the initial web page of Your product that is displayed each time a user connects to it. You also agree that GoAhead may identify your company as a user of the GoAhead WebServer in conjunction with its own marketing efforts. You may further promote the Original Code by displaying the GoAhead WebServer mark in marketing and promotional materials such as the home page of your web site or web pages promoting the product. - -4.3 Placement of Copyright Notice by You. - -You agree to include copies of the following notice (the "Notice") regarding proprietary rights in all copies of the products that You distribute, as follows: (i) embedded in the object code; and (ii) on the title pages of all documentation. Furthermore, You agree to use commercially reasonable efforts to cause any licensees of your products to embed the Notice in object code and on the title pages or relevant documentation. The Notice is as follows: Copyright (c) 20xx GoAhead Software, Inc. All Rights Reserved. Unless GoAhead otherwise instructs, the year 20xx is to be replaced with the year during which the release of the Original Code containing the notice is issued by GoAhead. If this year is not supplied with Documentation, GoAhead will supply it upon request. - -4.4 No Modifications to Server Identification Field. - -You agree not to remove or modify the Server identification Field contained in the Response Header as defined in Section 1.6 and 1.7. - -5. Warranty Disclaimers. - -THE ORIGINAL CODE, THE DOCUMENTATION AND THE MEDIA UPON WHICH THE ORIGINAL CODE IS RECORDED (IF ANY) ARE PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS, STATUTORY OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - -The entire risk as to the quality and performance of the Original Code (including any Modifications You make) and the Documentation is with You. Should the Original Code or the Documentation prove defective, You (and not GoAhead or its distributors, licensors or dealers) assume the entire cost of all necessary servicing or repair. GoAhead does not warrant that the functions contained in the Original Code will meet your requirements or operate in the combination that You may select for use, that the operation of the Original Code will be uninterrupted or error free, or that defects in the Original Code will be corrected. No oral or written statement by GoAhead or by a representative of GoAhead shall create a warranty or increase the scope of this warranty. - -GOAHEAD DOES NOT WARRANT THE ORIGINAL CODE AGAINST INFRINGEMENT OR THE LIKE WITH RESPECT TO ANY COPYRIGHT, PATENT, TRADE SECRET, TRADEMARK OR OTHER PROPRIETARY RIGHT OF ANY THIRD PARTY AND DOES NOT WARRANT THAT THE ORIGINAL CODE DOES NOT INCLUDE ANY VIRUS, SOFTWARE ROUTINE OR OTHER SOFTWARE DESIGNED TO PERMIT UNAUTHORIZED ACCESS, TO DISABLE, ERASE OR OTHERWISE HARM SOFTWARE, HARDWARE OR DATA, OR TO PERFORM ANY OTHER SUCH ACTIONS. - -Any warranties that by law survive the foregoing disclaimers shall terminate ninety (90) days from the date You received the Original Code. - -6. Limitation of Liability. - -YOUR SOLE REMEDIES AND GOAHEAD'S ENTIRE LIABILITY ARE SET FORTH ABOVE. IN NO EVENT WILL GOAHEAD OR ITS DISTRIBUTORS OR DEALERS BE LIABLE FOR DIRECT, INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES RESULTING FROM THE USE OF THE ORIGINAL CODE, THE INABILITY TO USE THE ORIGINAL CODE, OR ANY DEFECT IN THE ORIGINAL CODE, INCLUDING ANY LOST PROFITS, EVEN IF THEY HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -You agree that GoAhead and its distributors and dealers will not be LIABLE for defense or indemnity with respect to any claim against You by any third party arising from your possession or use of the Original Code or the Documentation. - -In no event will GoAhead’s total liability to You for all damages, losses, and causes of action (whether in contract, tort, including negligence, or otherwise) exceed the amount You paid for this product. - -SOME STATES DO NOT ALLOW LIMITATIONS ON HOW LONG AN IMPLIED WARRANTY LASTS, AND SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THE ABOVE LIMITATIONS OR EXCLUSIONS MAY NOT APPLY TO YOU. THIS WARRANTY GIVES YOU SPECIFIC LEGAL RIGHTS AND YOU MAY ALSO HAVE OTHER RIGHTS WHICH VARY FROM STATE TO STATE. - -7. Indemnification by You. - -You agree to indemnify and hold GoAhead harmless against any and all claims, losses, damages and costs (including legal expenses and reasonable counsel fees) arising out of any claim of a third party with respect to the contents of the Your products, and any intellectual property rights or other rights or interests related thereto. - -8. High Risk Activities. - -The Original Code is not fault-tolerant and is not designed , manufactured or intended for use or resale as online control equipment in hazardous environments requiring fail-safe performance, such as in the operation of nuclear facilities, aircraft navigation or communication systems, air traffic control, direct life support machines or weapons systems, in which the failure of the Original Code could lead directly to death, personal injury, or severe physical or environmental damage. GoAhead and its suppliers specifically disclaim any express or implied warranty of fitness for any high risk uses listed above. - -9. Government Restricted Rights. - -For units of the Department of Defense, use, duplication, or disclosure by the Government is subject to restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at DFARS 252.227-7013. Contractor/manufacturer is GoAhead Software, Inc., 10900 N.E. 8th Street, Suite 750, Bellevue, Washington 98004. - -If the Commercial Computer Software Restricted rights clause at FAR 52.227-19 or its successors apply, the Software and Documentation constitute restricted computer software as defined in that clause and the Government shall not have the license for published software set forth in subparagraph (c)(3) of that clause. - -The Original Code (i) was developed at private expense, and no part of it was developed with governmental funds; (ii) is a trade secret of GoAhead (or its licensor(s)) for all purposes of the Freedom of Information Act; (iii) is "restricted computer software" subject to limited utilization as provided in the contract between the vendor and the governmental entity; and (iv) in all respects is proprietary data belonging solely to GoAhead (or its licensor(s)). - -10. Governing Law and Interpretation. - -This Agreement shall be interpreted under and governed by the laws of the State of Washington, without regard to its rules governing the conflict of laws. If any provision of this Agreement is held illegal or unenforceable by a court or tribunal of competent jurisdiction, the remaining provisions of this Agreement shall remain in effect and the invalid provision deemed modified to the least degree necessary to remedy such invalidity. - -11. Entire Agreement. - -This Agreement is the complete agreement between GoAhead and You and supersedes all prior agreements, oral or written, with respect to the subject matter hereof. - -If You have any questions concerning this Agreement, You may write to GoAhead Software, Inc., 10900 N.E. 8th Street, Suite 750, Bellevue, Washington 98004 or send e-mail to info@goahead.com. - -BY CLICKING ON THE "Register" BUTTON ON THE REGISTRATION FORM, YOU ACCEPT AND AGREE TO BE BOUND BY ALL OF THE TERMS AND CONDITIONS SET FORTH IN THIS AGREEMENT. IF YOU DO NOT WISH TO ACCEPT THIS LICENSE OR YOU DO NOT QUALIFY FOR A LICENSE BASED ON THE TERMS SET FORTH ABOVE, YOU MUST NOT CLICK THE "Register" BUTTON. - -Exhibit A - -GoAhead Trademarks, Logos, and Product Designation Information - - - - -01/28/00 - - - - diff --git a/cpukit/httpd/md5.h b/cpukit/httpd/md5.h deleted file mode 100644 index 5a782fba2e..0000000000 --- a/cpukit/httpd/md5.h +++ /dev/null @@ -1,48 +0,0 @@ -/* MD5.H - header file for MD5C.C - */ - -/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All -rights reserved. - -License to copy and use this software is granted provided that it -is identified as the "RSA Data Security, Inc. MD5 Message-Digest -Algorithm" in all material mentioning or referencing this software -or this function. - -License is also granted to make and use derivative works provided -that such works are identified as "derived from the RSA Data -Security, Inc. MD5 Message-Digest Algorithm" in all material -mentioning or referencing the derived work. - -RSA Data Security, Inc. makes no representations concerning either -the merchantability of this software or the suitability of this -software for any particular purpose. It is provided "as is" -without express or implied warranty of any kind. - -These notices must be retained in any copies of any part of this -documentation and/or software. - */ - -#ifndef _h_MD5 -#define _h_MD5 1 - -#ifndef UINT4 -#define UINT4 unsigned long -#endif - -#ifndef POINTER -#define POINTER unsigned char * -#endif - -/* MD5 context. */ -typedef struct { - UINT4 state[4]; /* state (ABCD) */ - UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */ - unsigned char buffer[64]; /* input buffer */ -} MD5_CONTEXT; - -extern void MD5Init (MD5_CONTEXT *); -extern void MD5Update (MD5_CONTEXT *, unsigned char *, unsigned int); -extern void MD5Final (unsigned char [16], MD5_CONTEXT *); - -#endif /* _h_MD5 */ diff --git a/cpukit/httpd/md5c.c b/cpukit/httpd/md5c.c deleted file mode 100644 index 90142cf785..0000000000 --- a/cpukit/httpd/md5c.c +++ /dev/null @@ -1,335 +0,0 @@ -/* MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm - */ - -/* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All -rights reserved. - -License to copy and use this software is granted provided that it -is identified as the "RSA Data Security, Inc. MD5 Message-Digest -Algorithm" in all material mentioning or referencing this software -or this function. - -License is also granted to make and use derivative works provided -that such works are identified as "derived from the RSA Data -Security, Inc. MD5 Message-Digest Algorithm" in all material -mentioning or referencing the derived work. - -RSA Data Security, Inc. makes no representations concerning either -the merchantability of this software or the suitability of this -software for any particular purpose. It is provided "as is" -without express or implied warranty of any kind. - -These notices must be retained in any copies of any part of this -documentation and/or software. - */ - -#include "md5.h" - -/* Constants for MD5Transform routine. - */ -#define S11 7 -#define S12 12 -#define S13 17 -#define S14 22 -#define S21 5 -#define S22 9 -#define S23 14 -#define S24 20 -#define S31 4 -#define S32 11 -#define S33 16 -#define S34 23 -#define S41 6 -#define S42 10 -#define S43 15 -#define S44 21 - -static void MD5Transform (UINT4 [4], unsigned char [64]); -static void Encode (unsigned char *, UINT4 *, unsigned int); -static void Decode (UINT4 *, unsigned char *, unsigned int); -static void MD5_memcpy (POINTER, POINTER, unsigned int); -static void MD5_memset (POINTER, int, unsigned int); - -static unsigned char PADDING[64] = { - 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -/* - * Note: The following MD5 macros can be implemented as functions - * for code compactness, (at the expense of execution speed). - */ - -/* F, G, H and I are basic MD5 functions. - */ -#define F(x, y, z) (((x) & (y)) | ((~x) & (z))) -#define G(x, y, z) (((x) & (z)) | ((y) & (~z))) -#define H(x, y, z) ((x) ^ (y) ^ (z)) -#define I(x, y, z) ((y) ^ ((x) | (~z))) - -/* ROTATE_LEFT rotates x left n bits. - */ -#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) - -/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4. -Rotation is separate from addition to prevent recomputation. - */ -#define FF(a, b, c, d, x, s, ac) { \ - (a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ - } -#define GG(a, b, c, d, x, s, ac) { \ - (a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ - } -#define HH(a, b, c, d, x, s, ac) { \ - (a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ - } -#define II(a, b, c, d, x, s, ac) { \ - (a) += I ((b), (c), (d)) + (x) + (UINT4)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ - } - -/* MD5 initialization. Begins an MD5 operation, writing a new context. - */ -void MD5Init (context) -MD5_CONTEXT *context; /* context */ -{ - context->count[0] = context->count[1] = 0; - /* Load magic initialization constants. -*/ - context->state[0] = 0x67452301; - context->state[1] = 0xefcdab89; - context->state[2] = 0x98badcfe; - context->state[3] = 0x10325476; -} - -/* MD5 block update operation. Continues an MD5 message-digest - operation, processing another message block, and updating the - context. - */ -void MD5Update (context, input, inputLen) -MD5_CONTEXT *context; /* context */ -unsigned char *input; /* input block */ -unsigned int inputLen; /* length of input block */ -{ - unsigned int i, index, partLen; - - /* Compute number of bytes mod 64 */ - index = (unsigned int)((context->count[0] >> 3) & 0x3F); - - /* Update number of bits */ - if ((context->count[0] += ((UINT4)inputLen << 3)) - < ((UINT4)inputLen << 3)) - context->count[1]++; - context->count[1] += ((UINT4)inputLen >> 29); - - partLen = 64 - index; - - /* Transform as many times as possible. -*/ - if (inputLen >= partLen) { - MD5_memcpy - ((POINTER)&context->buffer[index], (POINTER)input, partLen); - MD5Transform (context->state, context->buffer); - - for (i = partLen; i + 63 < inputLen; i += 64) - MD5Transform (context->state, &input[i]); - - index = 0; - } - else - i = 0; - - /* Buffer remaining input */ - MD5_memcpy - ((POINTER)&context->buffer[index], (POINTER)&input[i], - inputLen-i); -} - -/* MD5 finalization. Ends an MD5 message-digest operation, writing the - the message digest and zeroizing the context. - */ -void MD5Final (digest, context) -unsigned char digest[16]; /* message digest */ -MD5_CONTEXT *context; /* context */ -{ - unsigned char bits[8]; - unsigned int index, padLen; - - /* Save number of bits */ - Encode (bits, context->count, 8); - - /* Pad out to 56 mod 64. -*/ - index = (unsigned int)((context->count[0] >> 3) & 0x3f); - padLen = (index < 56) ? (56 - index) : (120 - index); - MD5Update (context, PADDING, padLen); - - /* Append length (before padding) */ - MD5Update (context, bits, 8); - /* Store state in digest */ - Encode (digest, context->state, 16); - - /* Zeroize sensitive information. -*/ - MD5_memset ((POINTER)context, 0, sizeof (*context)); -} - -/* MD5 basic transformation. Transforms state based on block. - */ -static void MD5Transform (state, block) -UINT4 state[4]; -unsigned char block[64]; -{ - UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16]; - - Decode (x, block, 64); - - /* Round 1 */ - FF (a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */ - FF (d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */ - FF (c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */ - FF (b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */ - FF (a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */ - FF (d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */ - FF (c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */ - FF (b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */ - FF (a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */ - FF (d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */ - FF (c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */ - FF (b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */ - FF (a, b, c, d, x[12], S11, 0x6b901122); /* 13 */ - FF (d, a, b, c, x[13], S12, 0xfd987193); /* 14 */ - FF (c, d, a, b, x[14], S13, 0xa679438e); /* 15 */ - FF (b, c, d, a, x[15], S14, 0x49b40821); /* 16 */ - - /* Round 2 */ - GG (a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */ - GG (d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */ - GG (c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */ - GG (b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */ - GG (a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */ - GG (d, a, b, c, x[10], S22, 0x2441453); /* 22 */ - GG (c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */ - GG (b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */ - GG (a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */ - GG (d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */ - GG (c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */ - GG (b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */ - GG (a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */ - GG (d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */ - GG (c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */ - GG (b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */ - - /* Round 3 */ - HH (a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */ - HH (d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */ - HH (c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */ - HH (b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */ - HH (a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */ - HH (d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */ - HH (c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */ - HH (b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */ - HH (a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */ - HH (d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */ - HH (c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */ - HH (b, c, d, a, x[ 6], S34, 0x4881d05); /* 44 */ - HH (a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */ - HH (d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */ - HH (c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */ - HH (b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */ - - /* Round 4 */ - II (a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */ - II (d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */ - II (c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */ - II (b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */ - II (a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */ - II (d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */ - II (c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */ - II (b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */ - II (a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */ - II (d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */ - II (c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */ - II (b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */ - II (a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */ - II (d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */ - II (c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */ - II (b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */ - - state[0] += a; - state[1] += b; - state[2] += c; - state[3] += d; - - /* Zeroize sensitive information. -*/ - MD5_memset ((POINTER)x, 0, sizeof (x)); -} - -/* Encodes input (UINT4) into output (unsigned char). Assumes len is - a multiple of 4. - */ -static void Encode (output, input, len) -unsigned char *output; -UINT4 *input; -unsigned int len; -{ - unsigned int i, j; - - for (i = 0, j = 0; j < len; i++, j += 4) { - output[j] = (unsigned char)(input[i] & 0xff); - output[j+1] = (unsigned char)((input[i] >> 8) & 0xff); - output[j+2] = (unsigned char)((input[i] >> 16) & 0xff); - output[j+3] = (unsigned char)((input[i] >> 24) & 0xff); - } -} - -/* Decodes input (unsigned char) into output (UINT4). Assumes len is - a multiple of 4. - */ -static void Decode (output, input, len) -UINT4 *output; -unsigned char *input; -unsigned int len; -{ - unsigned int i, j; - - for (i = 0, j = 0; j < len; i++, j += 4) - output[i] = ((UINT4)input[j]) | (((UINT4)input[j+1]) << 8) | - (((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24); -} - -/* Note: Replace "for loop" with standard memcpy if possible. - */ - -static void MD5_memcpy (output, input, len) -POINTER output; -POINTER input; -unsigned int len; -{ - unsigned int i; - - for (i = 0; i < len; i++) - output[i] = input[i]; -} - -/* Note: Replace "for loop" with standard memset if possible. - */ -static void MD5_memset (output, value, len) -POINTER output; -int value; -unsigned int len; -{ - unsigned int i; - - for (i = 0; i < len; i++) - ((char *)output)[i] = (char)value; -} diff --git a/cpukit/httpd/mime.c b/cpukit/httpd/mime.c deleted file mode 100644 index daa467f9cc..0000000000 --- a/cpukit/httpd/mime.c +++ /dev/null @@ -1,112 +0,0 @@ -/* - * mime.c -- Web server mime types - * - * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved. - * - * See the file "license.txt" for usage and redistribution license requirements - */ - -/******************************** Description *********************************/ - -/* - * Mime types and file extensions. This module maps URL extensions to - * content types. - */ - -/********************************* Includes ***********************************/ - -#include "wsIntrn.h" - -/******************************** Global Data *********************************/ -/* - * Addd entries to the MimeList as required for your content - */ - -websMimeType websMimeList[] = { - { T("application/java"), T(".class") }, - { T("application/java"), T(".jar") }, - { T("text/html"), T(".asp") }, - { T("text/html"), T(".htm") }, - { T("text/html"), T(".html") }, - { T("image/gif"), T(".gif") }, - { T("image/jpeg"), T(".jpg") }, - { T("text/css"), T(".css") }, - { T("text/plain"), T(".txt") }, - -#if MORE_MIME_TYPES - { T("application/binary"), T(".exe") }, - { T("application/compress"), T(".z") }, - { T("application/gzip"), T(".gz") }, - { T("application/octet-stream"), T(".bin") }, - { T("application/oda"), T(".oda") }, - { T("application/pdf"), T(".pdf") }, - { T("application/postscript"), T(".ai") }, - { T("application/postscript"), T(".eps") }, - { T("application/postscript"), T(".ps") }, - { T("application/rtf"), T(".rtf") }, - { T("application/x-bcpio"), T(".bcpio") }, - { T("application/x-cpio"), T(".cpio") }, - { T("application/x-csh"), T(".csh") }, - { T("application/x-dvi"), T(".dvi") }, - { T("application/x-gtar"), T(".gtar") }, - { T("application/x-hdf"), T(".hdf") }, - { T("application/x-latex"), T(".latex") }, - { T("application/x-mif"), T(".mif") }, - { T("application/x-netcdf"), T(".nc") }, - { T("application/x-netcdf"), T(".cdf") }, - { T("application/x-ns-proxy-autoconfig"), T(".pac") }, - { T("application/x-patch"), T(".patch") }, - { T("application/x-sh"), T(".sh") }, - { T("application/x-shar"), T(".shar") }, - { T("application/x-sv4cpio"), T(".sv4cpio") }, - { T("application/x-sv4crc"), T(".sv4crc") }, - { T("application/x-tar"), T(".tar") }, - { T("application/x-tcl"), T(".tcl") }, - { T("application/x-tex"), T(".tex") }, - { T("application/x-texinfo"), T(".texinfo") }, - { T("application/x-texinfo"), T(".texi") }, - { T("application/x-troff"), T(".t") }, - { T("application/x-troff"), T(".tr") }, - { T("application/x-troff"), T(".roff") }, - { T("application/x-troff-man"), T(".man") }, - { T("application/x-troff-me"), T(".me") }, - { T("application/x-troff-ms"), T(".ms") }, - { T("application/x-ustar"), T(".ustar") }, - { T("application/x-wais-source"), T(".src") }, - { T("application/zip"), T(".zip") }, - { T("audio/basic"), T(".au snd") }, - { T("audio/x-aiff"), T(".aif") }, - { T("audio/x-aiff"), T(".aiff") }, - { T("audio/x-aiff"), T(".aifc") }, - { T("audio/x-wav"), T(".wav") }, - { T("audio/x-wav"), T(".ram") }, - { T("image/ief"), T(".ief") }, - { T("image/jpeg"), T(".jpeg") }, - { T("image/jpeg"), T(".jpe") }, - { T("image/tiff"), T(".tiff") }, - { T("image/tiff"), T(".tif") }, - { T("image/x-cmu-raster"), T(".ras") }, - { T("image/x-portable-anymap"), T(".pnm") }, - { T("image/x-portable-bitmap"), T(".pbm") }, - { T("image/x-portable-graymap"), T(".pgm") }, - { T("image/x-portable-pixmap"), T(".ppm") }, - { T("image/x-rgb"), T(".rgb") }, - { T("image/x-xbitmap"), T(".xbm") }, - { T("image/x-xpixmap"), T(".xpm") }, - { T("image/x-xwindowdump"), T(".xwd") }, - { T("text/html"), T(".cfm") }, - { T("text/html"), T(".shtm") }, - { T("text/html"), T(".shtml") }, - { T("text/richtext"), T(".rtx") }, - { T("text/tab-separated-values"), T(".tsv") }, - { T("text/x-setext"), T(".etx") }, - { T("video/mpeg"), T(".mpeg mpg mpe") }, - { T("video/quicktime"), T(".qt") }, - { T("video/quicktime"), T(".mov") }, - { T("video/x-msvideo"), T(".avi") }, - { T("video/x-sgi-movie"), T(".movie") }, -#endif - { NULL, NULL}, -}; - -/*****************************************************************************/ diff --git a/cpukit/httpd/misc.c b/cpukit/httpd/misc.c deleted file mode 100644 index 58cee6ab84..0000000000 --- a/cpukit/httpd/misc.c +++ /dev/null @@ -1,652 +0,0 @@ -/* - * misc.c -- Miscellaneous routines. - * - * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved. - * - * See the file "license.txt" for usage and redistribution license requirements - */ - -/********************************* Includes ***********************************/ - -#if UEMF - #include "uemf.h" -#else - #include "basic/basicInternal.h" -#endif - -/********************************* Defines ************************************/ -/* - * Sprintf buffer structure. Make the increment 64 so that - * a balloc can use a 64 byte block. - */ - -#define STR_REALLOC 0x1 /* Reallocate the buffer as required */ -#define STR_INC 64 /* Growth increment */ - -typedef struct { - char_t *s; /* Pointer to buffer */ - int size; /* Current buffer size */ - int max; /* Maximum buffer size */ - int count; /* Buffer count */ - int flags; /* Allocation flags */ -} strbuf_t; - -/* - * Sprintf formatting flags - */ -enum flag { - flag_none = 0, - flag_minus = 1, - flag_plus = 2, - flag_space = 4, - flag_hash = 8, - flag_zero = 16, - flag_short = 32, - flag_long = 64 -}; - -/************************** Forward Declarations ******************************/ - -static int dsnprintf(char_t **s, int size, char_t *fmt, va_list arg, - int msize); -static void put_char(strbuf_t *buf, char_t c); -static void put_string(strbuf_t *buf, char_t *s, int len, - int width, int prec, enum flag f); -static void put_ulong(strbuf_t *buf, unsigned long int value, int base, - int upper, char_t *prefix, int width, int prec, enum flag f); - -/************************************ Code ************************************/ -/* - * "basename" returns a pointer to the last component of a pathname - * LINUX and LynxOS have their own basename function - */ - -#if ! LINUX && ! LYNX && ! __rtems__ -char_t *basename(char_t *name) -{ - char_t *cp; - -#if NW || WIN - if (((cp = gstrrchr(name, '\\')) == NULL) && - ((cp = gstrrchr(name, '/')) == NULL)) { - return name; -#else - if ((cp = gstrrchr(name, '/')) == NULL) { - return name; -#endif - } else if (*(cp + 1) == '\0' && cp == name) { - return name; - } else if (*(cp + 1) == '\0' && cp != name) { - return T(""); - } else { - return ++cp; - } -} -#endif /* ! LINUX & ! LYNX */ - -/******************************************************************************/ -/* - * Returns a pointer to the directory component of a pathname. bufsize is - * the size of the buffer in BYTES! - */ - -char_t *dirname(char_t *buf, char_t *name, int bufsize) -{ - char_t *cp; - int len; - - a_assert(name); - a_assert(buf); - a_assert(bufsize > 0); - -#if WIN || NW - if ((cp = gstrrchr(name, '/')) == NULL && - (cp = gstrrchr(name, '\\')) == NULL) -#else - if ((cp = gstrrchr(name, '/')) == NULL) -#endif - { - gstrcpy(buf, T(".")); - return buf; - } - - if ((*(cp + 1) == '\0' && cp == name)) { - gstrncpy(buf, T("."), TSZ(bufsize)); - gstrcpy(buf, T(".")); - return buf; - } - - len = cp - name; - - if (len < bufsize) { - gstrncpy(buf, name, len); - buf[len] = '\0'; - } else { - gstrncpy(buf, name, TSZ(bufsize)); - buf[bufsize - 1] = '\0'; - } - - return buf; -} - - -/******************************************************************************/ -/* - * sprintf and vsprintf are bad, ok. You can easily clobber memory. Use - * fmtAlloc and fmtValloc instead! These functions do _not_ support floating - * point, like %e, %f, %g... - */ - -int fmtAlloc(char_t **s, int n, char_t *fmt, ...) -{ - va_list ap; - int result; - - a_assert(s); - a_assert(fmt); - - *s = NULL; - va_start(ap, fmt); - result = dsnprintf(s, n, fmt, ap, 0); - va_end(ap); - return result; -} - -/******************************************************************************/ -/* - * Support a static buffer version for small buffers only! - */ - -int fmtStatic(char_t *s, int n, char_t *fmt, ...) -{ - va_list ap; - int result; - - a_assert(s); - a_assert(fmt); - a_assert(n <= 256); - - if (n <= 0) { - return -1; - } - va_start(ap, fmt); - result = dsnprintf(&s, n, fmt, ap, 0); - va_end(ap); - return result; -} - -/******************************************************************************/ -/* - * This function appends the formatted string to the supplied string, - * reallocing if required. - */ - -int fmtRealloc(char_t **s, int n, int msize, char_t *fmt, ...) -{ - va_list ap; - int result; - - a_assert(s); - a_assert(fmt); - - if (msize == -1) { - *s = NULL; - } - va_start(ap, fmt); - result = dsnprintf(s, n, fmt, ap, msize); - va_end(ap); - return result; -} - -/******************************************************************************/ -/* - * A vsprintf replacement. - */ - -int fmtValloc(char_t **s, int n, char_t *fmt, va_list arg) -{ - a_assert(s); - a_assert(fmt); - - *s = NULL; - return dsnprintf(s, n, fmt, arg, 0); -} - -/******************************************************************************/ -/* - * Dynamic sprintf implementation. Supports dynamic buffer allocation. - * This function can be called multiple times to grow an existing allocated - * buffer. In this case, msize is set to the size of the previously allocated - * buffer. The buffer will be realloced, as required. If msize is set, we - * return the size of the allocated buffer for use with the next call. For - * the first call, msize can be set to -1. - */ - -static int dsnprintf(char_t **s, int size, char_t *fmt, va_list arg, int msize) -{ - strbuf_t buf; - char_t c; - - a_assert(s); - a_assert(fmt); - - memset(&buf, 0, sizeof(buf)); - buf.s = *s; - - if (*s == NULL || msize != 0) { - buf.max = size; - buf.flags |= STR_REALLOC; - if (msize != 0) { - buf.size = max(msize, 0); - } - if (*s != NULL && msize != 0) { - buf.count = gstrlen(*s); - } - } else { - buf.size = size; - } - - while ((c = *fmt++) != '\0') { - if (c != '%' || (c = *fmt++) == '%') { - put_char(&buf, c); - } else { - enum flag f = flag_none; - int width = 0; - int prec = -1; - for ( ; c != '\0'; c = *fmt++) { - if (c == '-') { - f |= flag_minus; - } else if (c == '+') { - f |= flag_plus; - } else if (c == ' ') { - f |= flag_space; - } else if (c == '#') { - f |= flag_hash; - } else if (c == '0') { - f |= flag_zero; - } else { - break; - } - } - if (c == '*') { - width = va_arg(arg, int); - if (width < 0) { - f |= flag_minus; - width = -width; - } - c = *fmt++; - } else { - for ( ; gisdigit((int)c); c = *fmt++) { - width = width * 10 + (c - '0'); - } - } - if (c == '.') { - f &= ~flag_zero; - c = *fmt++; - if (c == '*') { - prec = va_arg(arg, int); - c = *fmt++; - } else { - for (prec = 0; gisdigit((int)c); c = *fmt++) { - prec = prec * 10 + (c - '0'); - } - } - } - if (c == 'h' || c == 'l') { - f |= (c == 'h' ? flag_short : flag_long); - c = *fmt++; - } - if (c == 'd' || c == 'i') { - long int value; - if (f & flag_short) { - value = (short int) va_arg(arg, int); - } else if (f & flag_long) { - value = va_arg(arg, long int); - } else { - value = va_arg(arg, int); - } - if (value >= 0) { - if (f & flag_plus) { - put_ulong(&buf, value, 10, 0, T("+"), width, prec, f); - } else if (f & flag_space) { - put_ulong(&buf, value, 10, 0, T(" "), width, prec, f); - } else { - put_ulong(&buf, value, 10, 0, NULL, width, prec, f); - } - } else { - put_ulong(&buf, -value, 10, 0, T("-"), width, prec, f); - } - } else if (c == 'o' || c == 'u' || c == 'x' || c == 'X') { - unsigned long int value; - if (f & flag_short) { - value = (unsigned short int) va_arg(arg, unsigned int); - } else if (f & flag_long) { - value = va_arg(arg, unsigned long int); - } else { - value = va_arg(arg, unsigned int); - } - if (c == 'o') { - if (f & flag_hash && value != 0) { - put_ulong(&buf, value, 8, 0, T("0"), width, prec, f); - } else { - put_ulong(&buf, value, 8, 0, NULL, width, prec, f); - } - } else if (c == 'u') { - put_ulong(&buf, value, 10, 0, NULL, width, prec, f); - } else { - if (f & flag_hash && value != 0) { - if (c == 'x') { - put_ulong(&buf, value, 16, 0, T("0x"), width, - prec, f); - } else { - put_ulong(&buf, value, 16, 1, T("0X"), width, - prec, f); - } - } else { - put_ulong(&buf, value, 16, 0, NULL, width, prec, f); - } - } - - } else if (c == 'c') { - char_t value = va_arg(arg, int); - put_char(&buf, value); - - } else if (c == 's' || c == 'S') { - char_t *value = va_arg(arg, char_t *); - if (value == NULL) { - put_string(&buf, T("(null)"), -1, width, prec, f); - } else if (f & flag_hash) { - put_string(&buf, - value + 1, (char_t) *value, width, prec, f); - } else { - put_string(&buf, value, -1, width, prec, f); - } - } else if (c == 'p') { - void *value = va_arg(arg, void *); - put_ulong(&buf, - (unsigned long int) value, 16, 0, T("0x"), width, prec, f); - } else if (c == 'n') { - if (f & flag_short) { - short int *value = va_arg(arg, short int *); - *value = buf.count; - } else if (f & flag_long) { - long int *value = va_arg(arg, long int *); - *value = buf.count; - } else { - int *value = va_arg(arg, int *); - *value = buf.count; - } - } else { - put_char(&buf, c); - } - } - } - if (buf.s == NULL) { - put_char(&buf, '\0'); - } - -/* - * If the user requested a dynamic buffer (*s == NULL), ensure it is returned. - */ - if (*s == NULL || msize != 0) { - *s = buf.s; - } - - if (*s != NULL && size > 0) { - if (buf.count < size) { - (*s)[buf.count] = '\0'; - } else { - (*s)[buf.size - 1] = '\0'; - } - } - - if (msize != 0) { - return buf.size; - } - return buf.count; -} - -/******************************************************************************/ -/* - * Add a character to a string buffer - */ - -static void put_char(strbuf_t *buf, char_t c) -{ - if (buf->count >= (buf->size - 1)) { - if (! (buf->flags & STR_REALLOC)) { - return; - } - buf->size += STR_INC; - if (buf->size > buf->max && buf->size > STR_INC) { -/* - * Caller should increase the size of the calling buffer - */ - buf->size -= STR_INC; - return; - } - if (buf->s == NULL) { - buf->s = balloc(B_L, buf->size * sizeof(char_t)); - } else { - buf->s = brealloc(B_L, buf->s, buf->size * sizeof(char_t)); - } - } - buf->s[buf->count] = c; - if (c != '\0') { - ++buf->count; - } -} - -/******************************************************************************/ -/* - * Add a string to a string buffer - */ - -static void put_string(strbuf_t *buf, char_t *s, int len, int width, - int prec, enum flag f) -{ - int i; - - if (len < 0) { - len = strnlen(s, prec >= 0 ? prec : ULONG_MAX); - } else if (prec >= 0 && prec < len) { - len = prec; - } - if (width > len && !(f & flag_minus)) { - for (i = len; i < width; ++i) { - put_char(buf, ' '); - } - } - for (i = 0; i < len; ++i) { - put_char(buf, s[i]); - } - if (width > len && f & flag_minus) { - for (i = len; i < width; ++i) { - put_char(buf, ' '); - } - } -} - -/******************************************************************************/ -/* - * Add a long to a string buffer - */ - -static void put_ulong(strbuf_t *buf, unsigned long int value, int base, - int upper, char_t *prefix, int width, int prec, enum flag f) -{ - unsigned long x, x2; - int len, zeros, i; - - for (len = 1, x = 1; x < ULONG_MAX / base; ++len, x = x2) { - x2 = x * base; - if (x2 > value) { - break; - } - } - zeros = (prec > len) ? prec - len : 0; - width -= zeros + len; - if (prefix != NULL) { - width -= strnlen(prefix, ULONG_MAX); - } - if (!(f & flag_minus)) { - if (f & flag_zero) { - for (i = 0; i < width; ++i) { - put_char(buf, '0'); - } - } else { - for (i = 0; i < width; ++i) { - put_char(buf, ' '); - } - } - } - if (prefix != NULL) { - put_string(buf, prefix, -1, 0, -1, flag_none); - } - for (i = 0; i < zeros; ++i) { - put_char(buf, '0'); - } - for ( ; x > 0; x /= base) { - int digit = (value / x) % base; - put_char(buf, (char) ((digit < 10 ? '0' : (upper ? 'A' : 'a') - 10) + - digit)); - } - if (f & flag_minus) { - for (i = 0; i < width; ++i) { - put_char(buf, ' '); - } - } -} - -/******************************************************************************/ -/* - * Convert an ansi string to a unicode string. On an error, we return the - * original ansi string which is better than returning NULL. nBytes is the - * size of the destination buffer (ubuf) in _bytes_. - */ - -char_t *ascToUni(char_t *ubuf, char *str, int nBytes) -{ -#if UNICODE - if (MultiByteToWideChar(CP_ACP, 0, str, nBytes / sizeof(char_t), ubuf, - nBytes / sizeof(char_t)) < 0) { - return (char_t*) str; - } -#else - memcpy(ubuf, str, nBytes); -#endif - return ubuf; -} - -/******************************************************************************/ -/* - * Convert a unicode string to an ansi string. On an error, return the - * original unicode string which is better than returning NULL. - * N.B. nBytes is the number of _bytes_ in the destination buffer, buf. - */ - -char *uniToAsc(char *buf, char_t *ustr, int nBytes) -{ -#if UNICODE - if (WideCharToMultiByte(CP_ACP, 0, ustr, nBytes, buf, nBytes, NULL, - NULL) < 0) { - return (char*) ustr; - } -#else - memcpy(buf, ustr, nBytes); -#endif - return (char*) buf; -} - -/******************************************************************************/ -/* - * allocate (balloc) a buffer and do ascii to unicode conversion into it. - * cp points to the ascii buffer. alen is the length of the buffer to be - * converted not including a terminating NULL. Return a pointer to the - * unicode buffer which must be bfree'd later. Return NULL on failure to - * get buffer. The buffer returned is NULL terminated. - */ - -char_t *ballocAscToUni(char *cp, int alen) -{ - char_t *unip; - int ulen; - - ulen = (alen + 1) * sizeof(char_t); - if ((unip = balloc(B_L, ulen)) == NULL) { - return NULL; - } - ascToUni(unip, cp, ulen); - unip[alen] = 0; - return unip; -} - -/******************************************************************************/ -/* - * allocate (balloc) a buffer and do unicode to ascii conversion into it. - * unip points to the unicoded string. ulen is the number of characters - * in the unicode string not including a teminating null. Return a pointer - * to the ascii buffer which must be bfree'd later. Return NULL on failure - * to get buffer. The buffer returned is NULL terminated. - */ - -char *ballocUniToAsc(char_t *unip, int ulen) -{ - char * cp; - - if ((cp = balloc(B_L, ulen+1)) == NULL) { - return NULL; - } - uniToAsc(cp, unip, ulen); - cp[ulen] = '\0'; - return cp; -} - -/******************************************************************************/ -/* - * convert a hex string to an integer. The end of the string or a non-hex - * character will indicate the end of the hex specification. - */ - -unsigned int hextoi(char_t *hexstring) -{ - register char_t *h; - register unsigned int c, v; - - v = 0; - h = hexstring; - if (*h == '0' && (*(h+1) == 'x' || *(h+1) == 'X')) { - h += 2; - } - while ((c = (unsigned int)*h++) != 0) { - if (c >= '0' && c <= '9') { - c -= '0'; - } else if (c >= 'a' && c <= 'f') { - c = (c - 'a') + 10; - } else if (c >= 'A' && c <= 'F') { - c = (c - 'A') + 10; - } else { - break; - } - v = (v * 0x10) + c; - } - return v; -} - -/******************************************************************************/ -/* - * convert a string to an integer. If the string starts with "0x" or "0X" - * a hexidecimal conversion is done. - */ - -unsigned int gstrtoi(char_t *s) -{ - if (*s == '0' && (*(s+1) == 'x' || *(s+1) == 'X')) { - s += 2; - return hextoi(s); - } - return gatoi(s); -} - -/******************************************************************************/ - diff --git a/cpukit/httpd/ringq.c b/cpukit/httpd/ringq.c deleted file mode 100644 index cd483ae007..0000000000 --- a/cpukit/httpd/ringq.c +++ /dev/null @@ -1,582 +0,0 @@ -/* - * ringq.c -- Ring queue buffering module - * - * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved. - * - * See the file "license.txt" for usage and redistribution license requirements - */ - -/******************************** Description *********************************/ - -/* - * A ring queue allows maximum utilization of memory for data storage and is - * ideal for input/output buffering. This module provides a highly efficient - * implementation and a vehicle for dynamic strings. - * - * WARNING: This is a public implementation and callers have full access to - * the queue structure and pointers. Change this module very carefully. - * - * This module follows the open/close model. - * - * Operation of a ringq where rq is a pointer to a ringq : - * - * rq->buflen contains the size of the buffer. - * rq->buf will point to the start of the buffer. - * rq->servp will point to the first (un-consumed) data byte. - * rq->endp will point to the next free location to which new data is added - * rq->endbuf will point to one past the end of the buffer. - * - * Eg. If the ringq contains the data "abcdef", it might look like : - * - * +-------------------------------------------------------------------+ - * | | | | | | | | a | b | c | d | e | f | | | | | - * +-------------------------------------------------------------------+ - * ^ ^ ^ ^ - * | | | | - * rq->buf rq->servp rq->endp rq->enduf - * - * The queue is empty when servp == endp. This means that the queue will hold - * at most rq->buflen -1 bytes. It is the filler's responsibility to ensure - * the ringq is never filled such that servp == endp. - * - * It is the filler's responsibility to "wrap" the endp back to point to - * rq->buf when the pointer steps past the end. Correspondingly it is the - * consumers responsibility to "wrap" the servp when it steps to rq->endbuf. - * The ringqPutc and ringqGetc routines will do this automatically. - */ - -/********************************* Includes ***********************************/ - -#if UEMF - #include "uemf.h" -#else - #include "basic/basicInternal.h" -#endif - -/*********************************** Defines **********************************/ -/* - * Faster than a function call - */ - -#define RINGQ_LEN(rq) \ - ((rq->servp > rq->endp) ? \ - (rq->buflen + (rq->endp - rq->servp)) : \ - (rq->endp - rq->servp)) - -/***************************** Forward Declarations ***************************/ - -static int ringqGrow(ringq_t *rq); -static int getBinBlockSize(int size); - -int ringqGrowCalls = 0; - -/*********************************** Code *************************************/ -/* - * Create a new ringq. "increment" is the amount to increase the size of the - * ringq should it need to grow to accomodate data being added. "maxsize" is - * an upper limit (sanity level) beyond which the q must not grow. Set maxsize - * to -1 to imply no upper limit. The buffer for the ringq is always - * dynamically allocated. Set maxsize - */ - -int ringqOpen(ringq_t *rq, int initSize, int maxsize) -{ - int increment; - - a_assert(rq); - a_assert(initSize >= 0); - - increment = getBinBlockSize(initSize); - if ((rq->buf = balloc(B_L, (increment))) == NULL) { - return -1; - } - rq->maxsize = maxsize; - rq->buflen = increment; - rq->increment = increment; - rq->endbuf = &rq->buf[rq->buflen]; - rq->servp = rq->buf; - rq->endp = rq->buf; - *rq->servp = '\0'; - return 0; -} - -/******************************************************************************/ -/* - * Delete a ringq and free the ringq buffer. - */ - -void ringqClose(ringq_t *rq) -{ - a_assert(rq); - a_assert(rq->buflen == (rq->endbuf - rq->buf)); - - if (rq == NULL) { - return; - } - - ringqFlush(rq); - bfree(B_L, (char*) rq->buf); - rq->buf = NULL; -} - -/******************************************************************************/ -/* - * Return the length of the data in the ringq. Users must fill the queue to - * a high water mark of at most one less than the queue size. - */ - -int ringqLen(ringq_t *rq) -{ - a_assert(rq); - a_assert(rq->buflen == (rq->endbuf - rq->buf)); - - if (rq->servp > rq->endp) { - return rq->buflen + rq->endp - rq->servp; - } else { - return rq->endp - rq->servp; - } -} - -/******************************************************************************/ -/* - * Get a byte from the queue - */ - -int ringqGetc(ringq_t *rq) -{ - char_t c; - char_t* cp; - - a_assert(rq); - a_assert(rq->buflen == (rq->endbuf - rq->buf)); - - if (rq->servp == rq->endp) { - return -1; - } - - cp = (char_t*) rq->servp; - c = *cp++; - rq->servp = (unsigned char *) cp; - if (rq->servp >= rq->endbuf) { - rq->servp = rq->buf; - } - return c; -} - -/******************************************************************************/ -/* - * Add a char to the queue. Note if being used to store wide strings - * this does not add a trailing '\0'. Grow the q as required. - */ - -int ringqPutc(ringq_t *rq, char_t c) -{ - char_t *cp; - - a_assert(rq); - a_assert(rq->buflen == (rq->endbuf - rq->buf)); - - if ((ringqPutBlkMax(rq) < (int) sizeof(char_t)) && !ringqGrow(rq)) { - return -1; - } - - cp = (char_t*) rq->endp; - *cp++ = (char_t) c; - rq->endp = (unsigned char *) cp; - if (rq->endp >= rq->endbuf) { - rq->endp = rq->buf; - } - return 0; -} - -/******************************************************************************/ -/* - * Insert a wide character at the front of the queue - */ - -int ringqInsertc(ringq_t *rq, char_t c) -{ - char_t *cp; - - a_assert(rq); - a_assert(rq->buflen == (rq->endbuf - rq->buf)); - - if (ringqPutBlkMax(rq) < (int) sizeof(char_t) && !ringqGrow(rq)) { - return -1; - } - if (rq->servp <= rq->buf) { - rq->servp = rq->endbuf; - } - cp = (char_t*) rq->servp; - *--cp = (char_t) c; - rq->servp = (unsigned char *) cp; - return 0; -} - -/******************************************************************************/ -/* - * Add a string to the queue. Add a trailing null (maybe two nulls) - */ - -int ringqPutStr(ringq_t *rq, char_t *str) -{ - int rc; - - a_assert(rq); - a_assert(str); - a_assert(rq->buflen == (rq->endbuf - rq->buf)); - - rc = ringqPutBlk(rq, (unsigned char*) str, gstrlen(str) * sizeof(char_t)); - *((char_t*) rq->endp) = (char_t) '\0'; - return rc; -} - -/******************************************************************************/ -/* - * Add a null terminator. This does NOT increase the size of the queue - */ - -void ringqAddNull(ringq_t *rq) -{ - a_assert(rq); - a_assert(rq->buflen == (rq->endbuf - rq->buf)); - - *((char_t*) rq->endp) = (char_t) '\0'; -} - -/******************************************************************************/ -#if UNICODE -/* - * Get a byte from the queue - */ - -int ringqGetcA(ringq_t *rq) -{ - unsigned char c; - - a_assert(rq); - a_assert(rq->buflen == (rq->endbuf - rq->buf)); - - if (rq->servp == rq->endp) { - return -1; - } - - c = *rq->servp++; - if (rq->servp >= rq->endbuf) { - rq->servp = rq->buf; - } - return c; -} - -/******************************************************************************/ -/* - * Add a byte to the queue. Note if being used to store strings this does not - * add a trailing '\0'. Grow the q as required. - */ - -int ringqPutcA(ringq_t *rq, char c) -{ - a_assert(rq); - a_assert(rq->buflen == (rq->endbuf - rq->buf)); - - if (ringqPutBlkMax(rq) == 0 && !ringqGrow(rq)) { - return -1; - } - - *rq->endp++ = (unsigned char) c; - if (rq->endp >= rq->endbuf) { - rq->endp = rq->buf; - } - return 0; -} - -/******************************************************************************/ -/* - * Insert a byte at the front of the queue - */ - -int ringqInsertcA(ringq_t *rq, char c) -{ - a_assert(rq); - a_assert(rq->buflen == (rq->endbuf - rq->buf)); - - if (ringqPutBlkMax(rq) == 0 && !ringqGrow(rq)) { - return -1; - } - if (rq->servp <= rq->buf) { - rq->servp = rq->endbuf; - } - *--rq->servp = (unsigned char) c; - return 0; -} - -/******************************************************************************/ -/* - * Add a string to the queue. Add a trailing null (not really in the q). - * ie. beyond the last valid byte. - */ - -int ringqPutStrA(ringq_t *rq, char *str) -{ - int rc; - - a_assert(rq); - a_assert(str); - a_assert(rq->buflen == (rq->endbuf - rq->buf)); - - rc = ringqPutBlk(rq, (unsigned char*) str, strlen(str)); - rq->endp[0] = '\0'; - return rc; -} - -#endif /* UNICODE */ -/******************************************************************************/ -/* - * Add a block of data to the ringq. Return the number of bytes added. - * Grow the q as required. - */ - -int ringqPutBlk(ringq_t *rq, unsigned char *buf, int size) -{ - int this, bytes_put; - - a_assert(rq); - a_assert(rq->buflen == (rq->endbuf - rq->buf)); - a_assert(buf); - a_assert(0 <= size); - -/* - * Loop adding the maximum bytes we can add in a single straight line copy - */ - bytes_put = 0; - while (size > 0) { - this = min(ringqPutBlkMax(rq), size); - if (this <= 0) { - if (! ringqGrow(rq)) { - break; - } - this = min(ringqPutBlkMax(rq), size); - } - - memcpy(rq->endp, buf, this); - buf += this; - rq->endp += this; - size -= this; - bytes_put += this; - - if (rq->endp >= rq->endbuf) { - rq->endp = rq->buf; - } - } - return bytes_put; -} - -/******************************************************************************/ -/* - * Get a block of data from the ringq. Return the number of bytes returned. - */ - -int ringqGetBlk(ringq_t *rq, unsigned char *buf, int size) -{ - int this, bytes_read; - - a_assert(rq); - a_assert(rq->buflen == (rq->endbuf - rq->buf)); - a_assert(buf); - a_assert(0 <= size && size < rq->buflen); - -/* - * Loop getting the maximum bytes we can get in a single straight line copy - */ - bytes_read = 0; - while (size > 0) { - this = ringqGetBlkMax(rq); - this = min(this, size); - if (this <= 0) { - break; - } - - memcpy(buf, rq->servp, this); - buf += this; - rq->servp += this; - size -= this; - bytes_read += this; - - if (rq->servp >= rq->endbuf) { - rq->servp = rq->buf; - } - } - return bytes_read; -} - -/******************************************************************************/ -/* - * Return the maximum number of bytes the ring q can accept via a single - * block copy. Useful if the user is doing their own data insertion. - */ - -int ringqPutBlkMax(ringq_t *rq) -{ - int space, in_a_line; - - a_assert(rq); - a_assert(rq->buflen == (rq->endbuf - rq->buf)); - - space = rq->buflen - RINGQ_LEN(rq) - 1; - in_a_line = rq->endbuf - rq->endp; - - return min(in_a_line, space); -} - -/******************************************************************************/ -/* - * Return the maximum number of bytes the ring q can provide via a single - * block copy. Useful if the user is doing their own data retrieval. - */ - -int ringqGetBlkMax(ringq_t *rq) -{ - int len, in_a_line; - - a_assert(rq); - a_assert(rq->buflen == (rq->endbuf - rq->buf)); - - len = RINGQ_LEN(rq); - in_a_line = rq->endbuf - rq->servp; - - return min(in_a_line, len); -} - -/******************************************************************************/ -/* - * Adjust the endp pointer after the user has copied data into the queue. - */ - -void ringqPutBlkAdj(ringq_t *rq, int size) -{ - a_assert(rq); - a_assert(rq->buflen == (rq->endbuf - rq->buf)); - a_assert(0 <= size && size < rq->buflen); - - rq->endp += size; - if (rq->endp >= rq->endbuf) { - rq->endp -= rq->buflen; - } -/* - * Flush the queue if the endp pointer is corrupted via a bad size - */ - if (rq->endp >= rq->endbuf) { - error(E_L, E_LOG, T("Bad end pointer")); - ringqFlush(rq); - } -} - -/******************************************************************************/ -/* - * Adjust the servp pointer after the user has copied data from the queue. - */ - -void ringqGetBlkAdj(ringq_t *rq, int size) -{ - a_assert(rq); - a_assert(rq->buflen == (rq->endbuf - rq->buf)); - a_assert(0 < size && size < rq->buflen); - - rq->servp += size; - if (rq->servp >= rq->endbuf) { - rq->servp -= rq->buflen; - } -/* - * Flush the queue if the servp pointer is corrupted via a bad size - */ - if (rq->servp >= rq->endbuf) { - error(E_L, E_LOG, T("Bad serv pointer")); - ringqFlush(rq); - } -} - -/******************************************************************************/ -/* - * Flush all data in a ring q. Reset the pointers. - */ - -void ringqFlush(ringq_t *rq) -{ - a_assert(rq); - a_assert(rq->servp); - - rq->servp = rq->buf; - rq->endp = rq->buf; - if (rq->servp) { - *rq->servp = '\0'; - } -} - -/******************************************************************************/ -/* - * Grow the buffer. Return true if the buffer can be grown. Grow using - * the increment size specified when opening the ringq. Don't grow beyond - * the maximum possible size. - */ - -static int ringqGrow(ringq_t *rq) -{ - unsigned char *newbuf; - int len; - - a_assert(rq); - - if (rq->maxsize >= 0 && rq->buflen >= rq->maxsize) { - return 0; - } - - len = ringqLen(rq); - - if ((newbuf = balloc(B_L, rq->buflen + rq->increment)) == NULL) { - return 0; - } - ringqGetBlk(rq, newbuf, ringqLen(rq)); - bfree(B_L, (char*) rq->buf); - -#if OLD - rq->endp = &newbuf[endp]; - rq->servp = &newbuf[servp]; - rq->endbuf = &newbuf[rq->buflen]; - rq->buf = newbuf; -#endif - - rq->buflen += rq->increment; - rq->endp = newbuf; - rq->servp = newbuf; - rq->buf = newbuf; - rq->endbuf = &rq->buf[rq->buflen]; - - ringqPutBlk(rq, newbuf, len); - -/* - * Double the increment so the next grow will line up with balloc'ed memory - */ - rq->increment = getBinBlockSize(2 * rq->increment); - - return 1; -} - -/******************************************************************************/ -/* - * Find the smallest binary memory size that "size" will fit into. This - * makes the ringq and ringqGrow routines much more efficient. The balloc - * routine likes powers of 2 minus 1. - */ - -static int getBinBlockSize(int size) -{ - int q; - - size = size >> B_SHIFT; - for (q = 0; size; size >>= 1) { - q++; - } - return (1 << (B_SHIFT + q)); -} - -/******************************************************************************/ diff --git a/cpukit/httpd/rom.c b/cpukit/httpd/rom.c deleted file mode 100644 index 6bb8a8da99..0000000000 --- a/cpukit/httpd/rom.c +++ /dev/null @@ -1,191 +0,0 @@ -/* - * rom.c -- Support for ROMed page retrieval. - * - * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved. - * - * See the file "license.txt" for usage and redistribution license requirements - */ - -/******************************** Description *********************************/ - -/* - * This module provides web page retrieval from compiled web pages. Use the - * webcomp program to compile web pages and link into the GoAhead WebServer. - * This module uses a hashed symbol table for fast page lookup. - * - * Usage: webcomp -f webPageFileList -p Prefix >webrom.c - */ - -/********************************* Includes ***********************************/ - -#include - -#include "wsIntrn.h" - -/******************************** Local Data **********************************/ - -#if WEBS_PAGE_ROM - -sym_fd_t romTab; /* Symbol table for web pages */ - -/*********************************** Code *************************************/ -/* - * Open the ROM module - */ - -int websRomOpen() -{ - websRomPageIndexType *wip; - int nchars; - char_t name[SYM_MAX]; - - romTab = symOpen(WEBS_SYM_INIT); - - for (wip = websRomPageIndex; wip->path; wip++) { - gstrncpy(name, wip->path, SYM_MAX); - nchars = gstrlen(name) - 1; - if (nchars > 0 && - (name[nchars] == '/' || name[nchars] == '\\')) { - name[nchars] = '\0'; - } - symEnter(romTab, name, valueInteger((int) wip), 0); - } - return 0; -} - -/******************************************************************************/ -/* - * Close the ROM module - */ - -void websRomClose() -{ - symClose(romTab); -} - -/******************************************************************************/ -/* - * Open a web page - */ - -int websRomPageOpen(webs_t wp, char_t *path, int mode, int perm) -{ - websRomPageIndexType *wip; - sym_t *sp; - - a_assert(websValid(wp)); - a_assert(path && *path); - - if ((sp = symLookup(romTab, path)) == NULL) { - return -1; - } - wip = (websRomPageIndexType*) sp->content.value.integer; - wip->pos = 0; - return (wp->docfd = wip - websRomPageIndex); -} - -/******************************************************************************/ -/* - * Close a web page - */ - -void websRomPageClose(int fd) -{ -} - -/******************************************************************************/ -/* - * Stat a web page - */ - -int websRomPageStat(char_t *path, websStatType *sbuf) -{ - websRomPageIndexType *wip; - sym_t *sp; - - a_assert(path && *path); - - if ((sp = symLookup(romTab, path)) == NULL) { - return -1; - } - wip = (websRomPageIndexType*) sp->content.value.integer; - - memset(sbuf, 0, sizeof(websStatType)); - sbuf->size = wip->size; - if (wip->page == NULL) { - sbuf->isDir = 1; - } - return 0; -} - -/******************************************************************************/ -/* - * Read a web page - */ - -int websRomPageReadData(webs_t wp, char *buf, int nBytes) -{ - websRomPageIndexType *wip; - int len; - - a_assert(websValid(wp)); - a_assert(buf); - a_assert(wp->docfd >= 0); - - wip = &websRomPageIndex[wp->docfd]; - - len = min(wip->size - wip->pos, nBytes); - memcpy(buf, &wip->page[wip->pos], len); - wip->pos += len; - return len; -} - -/******************************************************************************/ -/* - * Position a web page - */ - -long websRomPageSeek(webs_t wp, long offset, int origin) -{ - websRomPageIndexType *wip; - long pos; - - a_assert(websValid(wp)); - a_assert(origin == SEEK_SET || origin == SEEK_CUR || origin == SEEK_END); - a_assert(wp->docfd >= 0); - - wip = &websRomPageIndex[wp->docfd]; - - if (origin != SEEK_SET && origin != SEEK_CUR && origin != SEEK_END) { - errno = EINVAL; - return -1; - } - - if (wp->docfd < 0) { - errno = EBADF; - return -1; - } - - pos = offset; - switch (origin) { - case SEEK_CUR: - pos = wip->pos + offset; - break; - case SEEK_END: - pos = wip->size + offset; - break; - default: - break; - } - - if (pos < 0) { - errno = EBADF; - return -1; - } - - return (wip->pos = pos); -} - -#endif /* WEBS_PAGE_ROM */ - -/******************************************************************************/ diff --git a/cpukit/httpd/rtems_webserver.h b/cpukit/httpd/rtems_webserver.h deleted file mode 100644 index f1e4046ef5..0000000000 --- a/cpukit/httpd/rtems_webserver.h +++ /dev/null @@ -1,7 +0,0 @@ -/* - * rtems_webserver.h -- - * - */ - -int rtems_initialize_webserver(); - diff --git a/cpukit/httpd/security.c b/cpukit/httpd/security.c deleted file mode 100644 index f4579ad41e..0000000000 --- a/cpukit/httpd/security.c +++ /dev/null @@ -1,230 +0,0 @@ -/* - * security.c -- Security handler - * - * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved. - * - * See the file "license.txt" for usage and redistribution license requirements - */ - -/******************************** Description *********************************/ - -/* - * This module provides a basic security policy. - */ - -/********************************* Includes ***********************************/ - -#include "wsIntrn.h" -#include "um.h" -#ifdef DIGEST_ACCESS_SUPPORT -#include "websda.h" -#endif - -/********************************** Defines ***********************************/ -/* - * The following #defines change the behaviour of security in the absence - * of User Management. - * Note that use of User management functions require prior calling of - * umInit() to behave correctly - */ - -#ifndef USER_MANAGEMENT_SUPPORT -#define umGetAccessMethodForURL(url) AM_FULL -#define umUserExists(userid) 0 -#define umUserCanAccessURL(userid, url) 1 -#define umGetUserPassword(userid) websGetPassword() -#define umGetAccessLimitSecure(accessLimit) 0 -#define umGetAccessLimit(url) NULL -#endif - -/******************************** Local Data **********************************/ - -static char_t websPassword[WEBS_MAX_PASS]; /* Access password (decoded) */ -#ifdef _DEBUG -static int debugSecurity = 1; -#else -static int debugSecurity = 0; -#endif - -/*********************************** Code *************************************/ -/* - * Determine if this request should be honored - */ - -int websSecurityHandler(webs_t wp, char_t *urlPrefix, char_t *webDir, int arg, - char_t *url, char_t *path, char_t *query) -{ - char_t *type, *userid, *password, *accessLimit; - int flags, nRet; - accessMeth_t am; - - a_assert(websValid(wp)); - a_assert(url && *url); - a_assert(path && *path); -/* - * Get the critical request details - */ - type = websGetRequestType(wp); - password = websGetRequestPassword(wp); - userid = websGetRequestUserName(wp); - flags = websGetRequestFlags(wp); -/* - * Get the access limit for the URL. Exit if none found. - */ - accessLimit = umGetAccessLimit(path); - if (accessLimit == NULL) { - return 0; - } - -/* - * Check to see if URL must be encrypted - */ -#ifdef WEBS_SSL_SUPPORT - nRet = umGetAccessLimitSecure(accessLimit); - if (nRet && ((flags | WEBS_SECURE) == 0)) { - websStats.access++; - websError(wp, 200, T("Access Denied\nSecure access is required.")); - trace(3, T("SEC: Non-secure access attempted on <%s>\n"), path); - return 1; - } -#endif - -/* - * Get the access limit for the URL - */ - am = umGetAccessMethodForURL(accessLimit); - - nRet = 0; - if ((flags & WEBS_LOCAL_REQUEST) && (debugSecurity == 0)) { -/* - * Local access is always allowed (defeat when debugging) - */ - } else if (am == AM_NONE) { -/* - * URL is supposed to be hidden! Make like it wasn't found. - */ - websStats.access++; - websError(wp, 400, T("Page Not Found")); - nRet = 1; - } else if (userid && *userid) { - if (!umUserExists(userid)) { - websStats.access++; - websError(wp, 200, T("Access Denied\nUnknown User")); - trace(3, T("SEC: Unknown user <%s> attempted to access <%s>\n"), - userid, path); - nRet = 1; - } else if (!umUserCanAccessURL(userid, accessLimit)) { - websStats.access++; - websError(wp, 403, T("Access Denied\nProhibited User")); - nRet = 1; - } else if (password && * password) { - char_t * userpass = umGetUserPassword(userid); - if (userpass) { - if (gstrcmp(password, userpass) != 0) { - websStats.access++; - websError(wp, 200, T("Access Denied\nWrong Password")); - trace(3, T("SEC: Password fail for user <%s>") - T("attempt to access <%s>\n"), userid, path); - nRet = 1; - } else { -/* - * User and password check out. - */ - } - - bfree (B_L, userpass); - } -#ifdef DIGEST_ACCESS_SUPPORT - } else if (flags & WEBS_AUTH_DIGEST) { - - char_t *digestCalc; - -/* - * Check digest for equivalence - */ - wp->password = umGetUserPassword(userid); - - a_assert(wp->digest); - a_assert(wp->nonce); - a_assert(wp->password); - - digestCalc = websCalcDigest(wp); - a_assert(digestCalc); - - if (gstrcmp(wp->digest, digestCalc) != 0) { - websStats.access++; - websError(wp, 200, T("Access Denied\nWrong Password")); - nRet = 1; - } - - bfree (B_L, digestCalc); -#endif - } else { -/* - * No password has been specified - */ -#ifdef DIGEST_ACCESS_SUPPORT - if (am == AM_DIGEST) { - wp->flags |= WEBS_AUTH_DIGEST; - } -#endif - websStats.errors++; - websError(wp, 401, - T("Access to this document requires a password")); - nRet = 1; - } - } else if (am != AM_FULL) { -/* - * This will cause the browser to display a password / username - * dialog - */ -#ifdef DIGEST_ACCESS_SUPPORT - if (am == AM_DIGEST) { - wp->flags |= WEBS_AUTH_DIGEST; - } -#endif - websStats.errors++; - websError(wp, 401, T("Access to this document requires a User ID")); - nRet = 1; - } - - bfree(B_L, accessLimit); - - return nRet; -} - -/******************************************************************************/ -/* - * Delete the default security handler - */ - -void websSecurityDelete() -{ - websUrlHandlerDelete(websSecurityHandler); -} - -/******************************************************************************/ -/* - * Store the new password, expect a decoded password. Store in websPassword in - * the decoded form. - */ - -void websSetPassword(char_t *password) -{ - a_assert(password); - - gstrncpy(websPassword, password, TSZ(websPassword)); -} - -/******************************************************************************/ -/* - * Get password, return the decoded form - */ - -char_t *websGetPassword() -{ - return bstrdup(B_L, websPassword); -} - -/******************************************************************************/ - diff --git a/cpukit/httpd/sock.c b/cpukit/httpd/sock.c deleted file mode 100644 index f23a63984f..0000000000 --- a/cpukit/httpd/sock.c +++ /dev/null @@ -1,789 +0,0 @@ -/* - * sock.c -- Posix Socket upper layer support module for general posix use - * - * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved. - */ - -/******************************** Description *********************************/ - -/* - * Posix Socket Module. This supports blocking and non-blocking buffered - * socket I/O. - */ - -/********************************** Includes **********************************/ - -#include -#include - -#if UEMF - #include "uemf.h" -#else - #include - #include - #include - #include "emfInternal.h" -#endif - -/************************************ Locals **********************************/ - -socket_t **socketList; /* List of open sockets */ -int socketMax; /* Maximum size of socket */ -int socketHighestFd = -1; /* Highest socket fd opened */ - -/***************************** Forward Declarations ***************************/ - -static int socketDoOutput(socket_t *sp, char *buf, int toWrite, int *errCode); -static int tryAlternateSendTo(int sock, char *buf, int toWrite, int i, - struct sockaddr *server); - -/*********************************** Code *************************************/ -/* - * Write to a socket. Absorb as much data as the socket can buffer. Block if - * the socket is in blocking mode. Returns -1 on error, otherwise the number - * of bytes written. - */ - -int socketWrite(int sid, char *buf, int bufsize) -{ - socket_t *sp; - ringq_t *rq; - int len, bytesWritten, room; - - a_assert(buf); - a_assert(bufsize >= 0); - - if ((sp = socketPtr(sid)) == NULL) { - return -1; - } - -/* - * Loop adding as much data to the output ringq as we can absorb. Initiate a - * flush when the ringq is too full and continue. Block in socketFlush if the - * socket is in blocking mode. - */ - rq = &sp->outBuf; - for (bytesWritten = 0; bufsize > 0; ) { - if ((room = ringqPutBlkMax(rq)) == 0) { - if (socketFlush(sid) < 0) { - return -1; - } - if ((room = ringqPutBlkMax(rq)) == 0) { - if (sp->flags & SOCKET_BLOCK) { -#if WIN || CE - int errCode; - if (! socketWaitForEvent(sp, FD_WRITE | SOCKET_WRITABLE, - &errCode)) { - return -1; - } -#endif - continue; - } - break; - } - continue; - } - len = min(room, bufsize); - ringqPutBlk(rq, (unsigned char *) buf, len); - bytesWritten += len; - bufsize -= len; - buf += len; - } - return bytesWritten; -} - -/******************************************************************************/ -/* - * Write a string to a socket - */ - -int socketWriteString(int sid, char_t *buf) -{ - #if UNICODE - char *byteBuf; - int r, len; - - len = gstrlen(buf); - byteBuf = ballocUniToAsc(buf, len); - r = socketWrite(sid, byteBuf, len); - bfreeSafe(B_L, byteBuf); - return r; - #else - return socketWrite(sid, buf, strlen(buf)); - #endif /* UNICODE */ -} - -/******************************************************************************/ -/* - * Read from a socket. Return the number of bytes read if successful. This - * may be less than the requested "bufsize" and may be zero. Return -1 for - * errors. Return 0 for EOF. Otherwise return the number of bytes read. - * If this routine returns zero it indicates an EOF condition. - * which can be verified with socketEof() - - * Note: this ignores the line buffer, so a previous socketGets - * which read a partial line may cause a subsequent socketRead to miss some - * data. This routine may block if the socket is in blocking mode. - * - */ - -int socketRead(int sid, char *buf, int bufsize) -{ - socket_t *sp; - ringq_t *rq; - int len, room, errCode, bytesRead; - - a_assert(buf); - a_assert(bufsize > 0); - - if ((sp = socketPtr(sid)) == NULL) { - return -1; - } - - if (sp->flags & SOCKET_EOF) { - return 0; - } - - rq = &sp->inBuf; - for (bytesRead = 0; bufsize > 0; ) { - len = min(ringqLen(rq), bufsize); - if (len <= 0) { -/* - * if blocking mode and already have data, exit now or it may block - * forever. - */ - if ((sp->flags & SOCKET_BLOCK) && - (bytesRead > 0)) { - break; - } -/* - * This flush is critical for readers of datagram packets. If the - * buffer is not big enough to read the whole datagram in one hit, - * the recvfrom call will fail. - */ - ringqFlush(rq); - room = ringqPutBlkMax(rq); - len = socketGetInput(sid, (char *) rq->endp, room, &errCode); - if (len < 0) { - if (errCode == EWOULDBLOCK) { - if ((sp->flags & SOCKET_BLOCK) && - (bytesRead == 0)) { - continue; - } - if (bytesRead >= 0) { - return bytesRead; - } - } - return -1; - - } else if (len == 0) { -/* - * If bytesRead is 0, this is EOF since socketRead should never - * be called unless there is data yet to be read. Set the flag. - * Then pass back the number of bytes read. - */ - if (bytesRead == 0) { - sp->flags |= SOCKET_EOF; - } - return bytesRead; - } - ringqPutBlkAdj(rq, len); - len = min(len, bufsize); - } - memcpy(&buf[bytesRead], rq->servp, len); - ringqGetBlkAdj(rq, len); - bufsize -= len; - bytesRead += len; - } - return bytesRead; -} - -/******************************************************************************/ -/* - * Get a string from a socket. This returns data in *buf in a malloced string - * after trimming the '\n'. If there is zero bytes returned, *buf will be set - * to NULL. If doing non-blocking I/O, it returns -1 for error, EOF or when - * no complete line yet read. If doing blocking I/O, it will block until an - * entire line is read. If a partial line is read socketInputBuffered or - * socketEof can be used to distinguish between EOF and partial line still - * buffered. This routine eats and ignores carriage returns. - */ - -int socketGets(int sid, char_t **buf) -{ - socket_t *sp; - ringq_t *lq; - char c; - int rc, len; - - a_assert(buf); - *buf = NULL; - - if ((sp = socketPtr(sid)) == NULL) { - return -1; - } - lq = &sp->lineBuf; - - while (1) { - - if ((rc = socketRead(sid, &c, 1)) < 0) { - return rc; - } - - if (rc == 0) { -/* - * If there is a partial line and we are at EOF, pretend we saw a '\n' - */ - if (ringqLen(lq) > 0 && (sp->flags & SOCKET_EOF)) { - c = '\n'; - } else { - return -1; - } - } -/* - * If a newline is seen, return the data excluding the new line to the - * caller. If carriage return is seen, just eat it. - */ - if (c == '\n') { - len = ringqLen(lq); - if (len > 0) { - *buf = ballocAscToUni(lq->servp, len); - } else { - *buf = NULL; - } - ringqFlush(lq); - return len; - - } else if (c == '\r') { - continue; - } - ringqPutcA(lq, c); - } - return 0; -} - -/******************************************************************************/ -/* - * Flush the socket. Block if the socket is in blocking mode. - * This will return -1 on errors and 0 if successful. - */ - -int socketFlush(int sid) -{ - socket_t *sp; - ringq_t *rq; - int len, bytesWritten, errCode; - - if ((sp = socketPtr(sid)) == NULL) { - return -1; - } - rq = &sp->outBuf; - -/* - * Set the background flushing flag which socketEventProc will check to - * continue the flush. - */ - if (! (sp->flags & SOCKET_BLOCK)) { - sp->flags |= SOCKET_FLUSHING; - } - -/* - * Break from loop if not blocking after initiating output. If we are blocking - * we wait for a write event. - */ - while (ringqLen(rq) > 0) { - len = ringqGetBlkMax(&sp->outBuf); - bytesWritten = socketDoOutput(sp, (char*) rq->servp, len, &errCode); - if (bytesWritten < 0) { - if (errCode == EINTR) { - continue; - } else if (errCode == EWOULDBLOCK || errCode == EAGAIN) { -#if WIN || CE - if (sp->flags & SOCKET_BLOCK) { - int errCode; - if (! socketWaitForEvent(sp, FD_WRITE | SOCKET_WRITABLE, - &errCode)) { - return -1; - } - continue; - } -#endif -/* - * Ensure we get a FD_WRITE message when the socket can absorb - * more data (non-blocking only.) Store the user's mask if we - * haven't done it already. - */ - if (sp->saveMask < 0 ) { - sp->saveMask = sp->handlerMask; - socketRegisterInterest(sp, - sp->handlerMask | SOCKET_WRITABLE); - } - return 0; - } - return -1; - } - ringqGetBlkAdj(rq, bytesWritten); - } -/* - * If the buffer is empty, reset the ringq pointers to point to the start - * of the buffer. This is essential to ensure that datagrams get written - * in one single I/O operation. - */ - if (ringqLen(rq) == 0) { - ringqFlush(rq); - } -/* - * Restore the users mask if it was saved by the non-blocking code above. - * Note: saveMask = -1 if empty. socketRegisterInterest will set handlerMask - */ - if (sp->saveMask >= 0) { - socketRegisterInterest(sp, sp->saveMask); - sp->saveMask = -1; - } - sp->flags &= ~SOCKET_FLUSHING; - return 0; -} - -/******************************************************************************/ -/* - * Return the count of input characters buffered. We look at both the line - * buffer and the input (raw) buffer. Return -1 on error or EOF. - */ - -int socketInputBuffered(int sid) -{ - socket_t *sp; - - if ((sp = socketPtr(sid)) == NULL) { - return -1; - } - if (socketEof(sid)) { - return -1; - } - return ringqLen(&sp->lineBuf) + ringqLen(&sp->inBuf); -} - -/******************************************************************************/ -/* - * Return true if EOF - */ - -int socketEof(int sid) -{ - socket_t *sp; - - if ((sp = socketPtr(sid)) == NULL) { - return -1; - } - return sp->flags & SOCKET_EOF; -} - -/******************************************************************************/ -/* - * Return the number of bytes the socket can absorb without blocking - */ - -int socketCanWrite(int sid) -{ - socket_t *sp; - - if ((sp = socketPtr(sid)) == NULL) { - return -1; - } - return sp->outBuf.buflen - ringqLen(&sp->outBuf) - 1; -} - -/******************************************************************************/ -/* - * Add one to allow the user to write exactly SOCKET_BUFSIZ - */ - -void socketSetBufferSize(int sid, int in, int line, int out) -{ - socket_t *sp; - - if ((sp = socketPtr(sid)) == NULL) { - return; - } - - if (in >= 0) { - ringqClose(&sp->inBuf); - in++; - ringqOpen(&sp->inBuf, in, in); - } - - if (line >= 0) { - ringqClose(&sp->lineBuf); - line++; - ringqOpen(&sp->lineBuf, line, line); - } - - if (out >= 0) { - ringqClose(&sp->outBuf); - out++; - ringqOpen(&sp->outBuf, out, out); - } -} - -/******************************************************************************/ -/* - * Create a user handler for this socket. The handler called whenever there - * is an event of interest as defined by handlerMask (SOCKET_READABLE, ...) - */ - -void socketCreateHandler(int sid, int handlerMask, socketHandler_t handler, - int data) -{ - socket_t *sp; - - if ((sp = socketPtr(sid)) == NULL) { - return; - } - sp->handler = handler; - sp->handler_data = data; - socketRegisterInterest(sp, handlerMask); -} - -/******************************************************************************/ -/* - * Delete a handler - */ - -void socketDeleteHandler(int sid) -{ - socket_t *sp; - - if ((sp = socketPtr(sid)) == NULL) { - return; - } - sp->handler = NULL; - socketRegisterInterest(sp, 0); -} - -/******************************************************************************/ -/* - * Socket output procedure. Return -1 on errors otherwise return the number - * of bytes written. - */ - -static int socketDoOutput(socket_t *sp, char *buf, int toWrite, int *errCode) -{ - struct sockaddr_in server; - int bytes; - - a_assert(sp); - a_assert(buf); - a_assert(toWrite > 0); - a_assert(errCode); - - *errCode = 0; - -#if WIN || CE - if ((sp->flags & SOCKET_ASYNC) - && ! socketWaitForEvent(sp, FD_CONNECT, errCode)) { - return -1; - } -#endif - -/* - * Write the data - */ - if (sp->flags & SOCKET_BROADCAST) { - server.sin_family = AF_INET; -#if UEMF || LITTLEFOOT - server.sin_addr.s_addr = INADDR_BROADCAST; -#else - server.sin_addr.s_addr = inet_addr(basicGetBroadcastAddress()); -#endif - server.sin_port = htons((short)(sp->port & 0xFFFF)); - if ((bytes = sendto(sp->sock, buf, toWrite, 0, - (struct sockaddr *) &server, sizeof(server))) < 0) { - bytes = tryAlternateSendTo(sp->sock, buf, toWrite, 0, - (struct sockaddr *) &server); - } - } else if (sp->flags & SOCKET_DATAGRAM) { - server.sin_family = AF_INET; - server.sin_addr.s_addr = inet_addr(sp->host); - server.sin_port = htons((short)(sp->port & 0xFFFF)); - bytes = sendto(sp->sock, buf, toWrite, 0, - (struct sockaddr *) &server, sizeof(server)); - - } else { - bytes = send(sp->sock, buf, toWrite, 0); - } - - if (bytes < 0) { - *errCode = socketGetError(); -#if WIN || CE - sp->currentEvents &= ~FD_WRITE; -#endif - - return -1; - - } else if (bytes == 0 && bytes != toWrite) { - *errCode = EWOULDBLOCK; -#if WIN || CE - sp->currentEvents &= ~FD_WRITE; -#endif - return -1; - } - -/* - * Ensure we get to write some more data real soon if the socket can absorb - * more data - */ -#if !UEMF -#if WIN - if (sp->interestEvents & FD_WRITE) { - emfTime_t blockTime = { 0, 0 }; - emfSetMaxBlockTime(&blockTime); - } -#endif /* WIN */ -#endif - return bytes; -} - -/******************************************************************************/ -/* - * If the sendto failed, swap the first two bytes in the - * sockaddr structure. This is a kludge due to a change in - * VxWorks between versions 5.3 and 5.4, but we want the - * product to run on either. - */ -static int tryAlternateSendTo(int sock, char *buf, int toWrite, int i, - struct sockaddr *server) -{ -#if VXWORKS - char *ptr; - - ptr = (char *)server; - *ptr = *(ptr+1); - *(ptr+1) = 0; - return sendto(sock, buf, toWrite, i, server, sizeof(struct sockaddr)); -#else - return -1; -#endif /* VXWORKS */ -} - -/******************************************************************************/ -/* - * Allocate a new socket structure - */ - -int socketAlloc(char *host, int port, socketAccept_t accept, int flags) -{ - socket_t *sp; - int sid; - - if ((sid = hAllocEntry((void***) &socketList, &socketMax, - sizeof(socket_t))) < 0) { - return -1; - } - sp = socketList[sid]; - - sp->sid = sid; - sp->accept = accept; - sp->port = port; - sp->fileHandle = -1; - sp->saveMask = -1; - - if (host) { - strncpy(sp->host, host, sizeof(sp->host)); - } - -/* - * Preserve only specified flags from the callers open - */ - a_assert((flags & ~(SOCKET_BROADCAST|SOCKET_DATAGRAM|SOCKET_BLOCK| - SOCKET_LISTENING)) == 0); - sp->flags = flags & (SOCKET_BROADCAST | SOCKET_DATAGRAM | SOCKET_BLOCK| - SOCKET_LISTENING); - -/* - * Add one to allow the user to write exactly SOCKET_BUFSIZ - */ - ringqOpen(&sp->inBuf, SOCKET_BUFSIZ, SOCKET_BUFSIZ); - ringqOpen(&sp->outBuf, SOCKET_BUFSIZ + 1, SOCKET_BUFSIZ + 1); - ringqOpen(&sp->lineBuf, SOCKET_BUFSIZ, -1); - - return sid; -} - -/******************************************************************************/ -/* - * Free a socket structure - */ - -void socketFree(int sid) -{ - socket_t *sp; - char_t buf[256]; - int i; - - if ((sp = socketPtr(sid)) == NULL) { - return; - } - -/* - * To close a socket, remove any registered interests, set it to - * non-blocking so that the recv which follows won't block, do a - * shutdown on it so peers on the other end will receive a FIN, - * then read any data not yet retrieved from the receive buffer, - * and finally close it. If these steps are not all performed - * RESETs may be sent to the other end causing problems. - */ - socketRegisterInterest(sp, 0); - if (sp->sock >= 0) { - socketSetBlock(sid, 0); - if (shutdown(sp->sock, 1) >= 0) { - recv(sp->sock, buf, sizeof(buf), 0); - } -#if WIN || CE - closesocket(sp->sock); -#else - close(sp->sock); -#endif - } - - ringqClose(&sp->inBuf); - ringqClose(&sp->outBuf); - ringqClose(&sp->lineBuf); - - bfree(B_L, sp); - socketMax = hFree((void***) &socketList, sid); - -/* - * Calculate the new highest socket number - */ - socketHighestFd = -1; - for (i = 0; i < socketMax; i++) { - if ((sp = socketList[i]) == NULL) { - continue; - } - socketHighestFd = max(socketHighestFd, sp->sock); - } -} - -/******************************************************************************/ -/* - * Validate a socket handle - */ - -socket_t *socketPtr(int sid) -{ - if (sid < 0 || sid >= socketMax || socketList[sid] == NULL) { - a_assert(NULL); - errno = EBADF; - return NULL; - } - - a_assert(socketList[sid]); - return socketList[sid]; -} - -/******************************************************************************/ -/* - * Get the operating system error code - */ - -int socketGetError() -{ -#if WIN || CE - switch (WSAGetLastError()) { - case WSAEWOULDBLOCK: - return EWOULDBLOCK; - case WSAECONNRESET: - return ECONNRESET; - case WSAENETDOWN: - return ENETDOWN; - case WSAEPROCLIM: - return EAGAIN; - case WSAEINTR: - return EINTR; - default: - return EINVAL; - } -#else - return errno; -#endif -} - -/******************************************************************************/ -/* - * Return the underlying socket handle - */ - -int socketGetHandle(int sid) -{ - socket_t *sp; - - if ((sp = socketPtr(sid)) == NULL) { - return -1; - } - return sp->sock; -} - -/******************************************************************************/ -/* - * Get blocking mode - */ - -int socketGetBlock(int sid) -{ - socket_t *sp; - - if ((sp = socketPtr(sid)) == NULL) { - a_assert(0); - return 0; - } - return (sp->flags & SOCKET_BLOCK); -} - -/******************************************************************************/ -/* - * Get mode - */ - -int socketGetMode(int sid) -{ - socket_t *sp; - - if ((sp = socketPtr(sid)) == NULL) { - a_assert(0); - return 0; - } - return sp->flags; -} - -/******************************************************************************/ -/* - * Set mode - */ - -void socketSetMode(int sid, int mode) -{ - socket_t *sp; - - if ((sp = socketPtr(sid)) == NULL) { - a_assert(0); - return; - } - sp->flags = mode; -} - -/******************************************************************************/ -/* - * Get port. - */ - -int socketGetPort(int sid) -{ - socket_t *sp; - - if ((sp = socketPtr(sid)) == NULL) { - return -1; - } - return sp->port; -} - -/******************************************************************************/ diff --git a/cpukit/httpd/socket.c b/cpukit/httpd/socket.c deleted file mode 100644 index 8a145fe520..0000000000 --- a/cpukit/httpd/socket.c +++ /dev/null @@ -1,1018 +0,0 @@ - -/* - * sockGen.c -- Posix Socket support module for general posix use - * - * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved. - */ - -/******************************** Description *********************************/ - -/* - * Posix Socket Module. This supports blocking and non-blocking buffered - * socket I/O. - */ - -#if (!WIN) || LITTLEFOOT || WEBS - -/********************************** Includes **********************************/ - -#include -#include - -#if UEMF - #include "uemf.h" -#else - #include - #include - #include - #include "emfInternal.h" -#endif - -#if VXWORKS - #include -#endif - -#if __rtems__ - #include -#endif - -/************************************ Locals **********************************/ - -extern socket_t **socketList; /* List of open sockets */ -extern int socketMax; /* Maximum size of socket */ -extern int socketHighestFd; /* Highest socket fd opened */ -static int socketOpenCount = 0; /* Number of task using sockets */ - -/***************************** Forward Declarations ***************************/ - -static void socketAccept(socket_t *sp); -static int socketDoEvent(socket_t *sp); -static int tryAlternateConnect(int sock, struct sockaddr *sockaddr); - -/*********************************** Code *************************************/ -/* - * Open socket module - */ - -int socketOpen() -{ -#if CE || WIN - WSADATA wsaData; -#endif - - if (++socketOpenCount > 1) { - return 0; - } - -#if CE || WIN - if (WSAStartup(MAKEWORD(1,1), &wsaData) != 0) { - return -1; - } - if (wsaData.wVersion != MAKEWORD(1,1)) { - WSACleanup(); - return -1; - } -#endif - socketList = NULL; - socketMax = 0; - socketHighestFd = -1; - - return 0; -} - -/******************************************************************************/ -/* - * Close the socket module, by closing all open connections - */ - -void socketClose() -{ - int i; - - if (--socketOpenCount <= 0) { - for (i = socketMax; i >= 0; i--) { - if (socketList && socketList[i]) { - socketCloseConnection(i); - } - } - socketOpenCount = 0; - } -} - -/******************************************************************************/ -/* - * Open a client or server socket. Host is NULL if we want server capability. - */ - -int socketOpenConnection(char *host, int port, socketAccept_t accept, int flags) -{ -#if ! (NO_GETHOSTBYNAME || VXWORKS) - struct hostent *hostent; /* Host database entry */ -#endif /* ! (NO_GETHOSTBYNAME || VXWORKS) */ - socket_t *sp; - struct sockaddr_in sockaddr; - int sid, bcast, dgram, rc; - - if (port > SOCKET_PORT_MAX) { - return -1; - } -/* - * Allocate a socket structure - */ - if ((sid = socketAlloc(host, port, accept, flags)) < 0) { - return -1; - } - sp = socketList[sid]; - a_assert(sp); - -/* - * Create the socket address structure - */ - memset((char *) &sockaddr, '\0', sizeof(struct sockaddr_in)); - sockaddr.sin_family = AF_INET; - sockaddr.sin_port = htons((short) (port & 0xFFFF)); - - if (host == NULL) { - sockaddr.sin_addr.s_addr = INADDR_ANY; - } else { - sockaddr.sin_addr.s_addr = inet_addr(host); - if (sockaddr.sin_addr.s_addr == INADDR_NONE) { -/* - * If the OS does not support gethostbyname functionality, the macro: - * NO_GETHOSTBYNAME should be defined to skip the use of gethostbyname. - * Unfortunatly there is no easy way to recover, the following code - * simply uses the basicGetHost IP for the sockaddr. - */ - -#if NO_GETHOSTBYNAME - if (strcmp(host, basicGetHost()) == 0) { - sockaddr.sin_addr.s_addr = inet_addr(basicGetAddress()); - } - if (sockaddr.sin_addr.s_addr == INADDR_NONE) { - socketFree(sid); - return -1; - } -#elif VXWORKS - sockaddr.sin_addr.s_addr = (unsigned long) hostGetByName(host); - if (sockaddr.sin_addr.s_addr == NULL) { - errno = ENXIO; - socketFree(sid); - return -1; - } -#else - hostent = gethostbyname(host); - if (hostent != NULL) { - memcpy((char *) &sockaddr.sin_addr, - (char *) hostent->h_addr_list[0], - (size_t) hostent->h_length); - } else { - char *asciiAddress; - char_t *address; - - address = basicGetAddress(); - asciiAddress = ballocUniToAsc(address, gstrlen(address)); - sockaddr.sin_addr.s_addr = inet_addr(asciiAddress); - bfree(B_L, asciiAddress); - if (sockaddr.sin_addr.s_addr == INADDR_NONE) { - errno = ENXIO; - socketFree(sid); - return -1; - } - } -#endif /* (NO_GETHOSTBYNAME || VXWORKS) */ - } - } - - bcast = sp->flags & SOCKET_BROADCAST; - if (bcast) { - sp->flags |= SOCKET_DATAGRAM; - } - dgram = sp->flags & SOCKET_DATAGRAM; - -/* - * Create the socket. Support for datagram sockets. Set the close on - * exec flag so children don't inherit the socket. - */ - sp->sock = socket(AF_INET, dgram ? SOCK_DGRAM: SOCK_STREAM, 0); - if (sp->sock < 0) { - socketFree(sid); - return -1; - } -#ifndef __NO_FCNTL - fcntl(sp->sock, F_SETFD, FD_CLOEXEC); -#endif - socketHighestFd = max(socketHighestFd, sp->sock); - -/* - * If broadcast, we need to turn on broadcast capability. - */ - if (bcast) { - int broadcastFlag = 1; - if (setsockopt(sp->sock, SOL_SOCKET, SO_BROADCAST, - (char *) &broadcastFlag, sizeof(broadcastFlag)) < 0) { - socketFree(sid); - return -1; - } - } - -/* - * Host is set if we are the client - */ - if (host) { -/* - * Connect to the remote server in blocking mode, then go into - * non-blocking mode if desired. - */ - if (!dgram) { - if (! (sp->flags & SOCKET_BLOCK)) { -/* - * sockGen.c is only used for Windows products when blocking - * connects are expected. This applies to FieldUpgrader - * agents and open source webserver connectws. Therefore the - * asynchronous connect code here is not compiled. - */ -#if (WIN || CE) && !(LITTLEFOOT || WEBS) - int flag; - - sp->flags |= SOCKET_ASYNC; -/* - * Set to non-blocking for an async connect - */ - flag = 1; - if (ioctlsocket(sp->sock, FIONBIO, &flag) == SOCKET_ERROR) { - socketFree(sid); - return -1; - } -#else - socketSetBlock(sid, 1); -#endif /* #if (WIN || CE) && !(LITTLEFOOT || WEBS) */ - - } - if ((rc = connect(sp->sock, (struct sockaddr *) &sockaddr, - sizeof(sockaddr))) < 0 && - (rc = tryAlternateConnect(sp->sock, - (struct sockaddr *) &sockaddr)) < 0) { -#if WIN || CE - if (socketGetError() != EWOULDBLOCK) { - socketFree(sid); - return -1; - } -#else - socketFree(sid); - return -1; - -#endif /* WIN || CE */ - - } - } - } else { -/* - * Bind to the socket endpoint and the call listen() to start listening - */ - rc = 1; - setsockopt(sp->sock, SOL_SOCKET, SO_REUSEADDR, (char *)&rc, sizeof(rc)); - if (bind(sp->sock, (struct sockaddr *) &sockaddr, - sizeof(sockaddr)) < 0) { - socketFree(sid); - return -1; - } - - if (! dgram) { - if (listen(sp->sock, SOMAXCONN) < 0) { - socketFree(sid); - return -1; - } -#if !UEMF - sp->fileHandle = emfCreateFileHandler(sp->sock, SOCKET_READABLE, - (emfFileProc *) socketAccept, (void *) sp); -#else - sp->flags |= SOCKET_LISTENING; -#endif - } - sp->handlerMask |= SOCKET_READABLE; - } - -/* - * Set the blocking mode - */ - - if (flags & SOCKET_BLOCK) { - socketSetBlock(sid, 1); - } else { - socketSetBlock(sid, 0); - } - return sid; -} - -/******************************************************************************/ -/* - * If the connection failed, swap the first two bytes in the - * sockaddr structure. This is a kludge due to a change in - * VxWorks between versions 5.3 and 5.4, but we want the - * product to run on either. - */ - -static int tryAlternateConnect(int sock, struct sockaddr *sockaddr) -{ -#if VXWORKS - char *ptr; - - ptr = (char *)sockaddr; - *ptr = *(ptr+1); - *(ptr+1) = 0; - return connect(sock, sockaddr, sizeof(struct sockaddr)); -#else - return -1; -#endif /* VXWORKS */ -} - -/******************************************************************************/ -/* - * Close a socket - */ - -void socketCloseConnection(int sid) -{ - socket_t *sp; - - if ((sp = socketPtr(sid)) == NULL) { - return; - } - socketFree(sid); -} - -/******************************************************************************/ -/* - * Accept a connection. Called as a callback on incoming connection. - */ - -static void socketAccept(socket_t *sp) -{ - struct sockaddr_in addr; - socket_t *nsp; - size_t len; - char *pString; - int newSock, nid; - - a_assert(sp); - -/* - * Accept the connection and prevent inheriting by children (F_SETFD) - */ - len = sizeof(struct sockaddr_in); - if ((newSock = accept(sp->sock, (struct sockaddr *) &addr, (int *)&len)) < 0) { - return; - } -#ifndef __NO_FCNTL - fcntl(newSock, F_SETFD, FD_CLOEXEC); -#endif - socketHighestFd = max(socketHighestFd, newSock); - -/* - * Create a socket structure and insert into the socket list - */ - nid = socketAlloc(sp->host, sp->port, sp->accept, sp->flags); - nsp = socketList[nid]; - a_assert(nsp); - nsp->sock = newSock; - nsp->flags &= ~SOCKET_LISTENING; - - if (nsp == NULL) { - return; - } -/* - * Set the blocking mode before calling the accept callback. - */ - - socketSetBlock(nid, (nsp->flags & SOCKET_BLOCK) ? 1: 0); -/* - * Call the user accept callback. The user must call socketCreateHandler - * to register for further events of interest. - */ - if (sp->accept != NULL) { - pString = inet_ntoa(addr.sin_addr); - if ((sp->accept)(nid, pString, ntohs(addr.sin_port), sp->sid) < 0) { - socketFree(nid); - } -#if VXWORKS - free(pString); -#endif - } -} - -/******************************************************************************/ -/* - * Get more input from the socket and return in buf. - * Returns 0 for EOF, -1 for errors and otherwise the number of bytes read. - */ - -int socketGetInput(int sid, char *buf, int toRead, int *errCode) -{ - struct sockaddr_in server; - socket_t *sp; - int len, bytesRead; - - a_assert(buf); - a_assert(errCode); - - *errCode = 0; - - if ((sp = socketPtr(sid)) == NULL) { - return -1; - } - -/* - * If we have previously seen an EOF condition, then just return - */ - if (sp->flags & SOCKET_EOF) { - return 0; - } -#if (WIN || CE) && !(LITTLEFOOT || WEBS) - if ( !(sp->flags & SOCKET_BLOCK) - && ! socketWaitForEvent(sp, FD_CONNECT, errCode)) { - return -1; - } -#endif - -/* - * Read the data - */ - if (sp->flags & SOCKET_DATAGRAM) { - len = sizeof(server); - bytesRead = recvfrom(sp->sock, buf, toRead, 0, - (struct sockaddr *) &server, &len); - } else { - bytesRead = recv(sp->sock, buf, toRead, 0); - } - if (bytesRead < 0) { - if (errno == ECONNRESET) { - return 0; - } - *errCode = socketGetError(); - return -1; - } - return bytesRead; -} - -/******************************************************************************/ -/* - * Process an event on the event queue - */ - -#ifndef UEMF - -static int socketEventProc(void *data, int mask) -{ - socket_t *sp; - ringq_t *rq; - int sid; - - sid = (int) data; - - a_assert(sid >= 0 && sid < socketMax); - a_assert(socketList[sid]); - - if ((sp = socketPtr(sid)) == NULL) { - return 1; - } - -/* - * If now writable and flushing in the background, continue flushing - */ - if (mask & SOCKET_WRITABLE) { - if (sp->flags & SOCKET_FLUSHING) { - rq = &sp->outBuf; - if (ringqLen(rq) > 0) { - socketFlush(sp->sid); - } else { - sp->flags &= ~SOCKET_FLUSHING; - } - } - } - -/* - * Now invoke the users socket handler. NOTE: the handler may delete the - * socket, so we must be very careful after calling the handler. - */ - if (sp->handler && (sp->handlerMask & mask)) { - (sp->handler)(sid, mask & sp->handlerMask, sp->handler_data); - } - if (socketList && sid < socketMax && socketList[sid] == sp) { - socketRegisterInterest(sp, sp->handlerMask); - } - return 1; -} -#endif /* ! UEMF */ - -/******************************************************************************/ -/* - * Define the events of interest - */ - -void socketRegisterInterest(socket_t *sp, int handlerMask) -{ - a_assert(sp); - - sp->handlerMask = handlerMask; -#if !UEMF - if (handlerMask) { - sp->fileHandle = emfCreateFileHandler(sp->sock, handlerMask, - (emfFileProc *) socketEventProc, (void *) sp->sid); - } else { - emfDeleteFileHandler(sp->fileHandle); - } -#endif /* ! UEMF */ -} - -/******************************************************************************/ -/* - * Wait until an event occurs on a socket. Return 1 on success, 0 on failure. - * or -1 on exception (UEMF only) - */ - -int socketWaitForEvent(socket_t *sp, int handlerMask, int *errCode) -{ - int mask; - - a_assert(sp); - - mask = sp->handlerMask; - sp->handlerMask |= handlerMask; - while (socketSelect(sp->sid, 1000)) { - if (sp->currentEvents & (handlerMask | SOCKET_EXCEPTION)) { - break; - } - } - sp->handlerMask = mask; - if (sp->currentEvents & SOCKET_EXCEPTION) { - return -1; - } else if (sp->currentEvents & handlerMask) { - return 1; - } - if (errCode) { - *errCode = errno = EWOULDBLOCK; - } - return 0; -} - -/******************************************************************************/ -/* - * Return TRUE if there is a socket with an event ready to process, - */ - -int socketReady(int sid) -{ - socket_t *sp; - int all; - - all = 0; - if (sid < 0) { - sid = 0; - all = 1; - } - - for (; sid < socketMax; sid++) { - if ((sp = socketList[sid]) == NULL) { - if (! all) { - break; - } else { - continue; - } - } - if (sp->currentEvents & sp->handlerMask) { - return 1; - } -/* - * If there is input data, also call select to test for new events - */ - if (sp->handlerMask & SOCKET_READABLE && socketInputBuffered(sid)) { - socketSelect(sid, 0); - return 1; - } - if (! all) { - break; - } - } - return 0; -} - -/******************************************************************************/ -/* - * Wait for a handle to become readable or writable and return a number of - * noticed events. Timeout is in milliseconds. - */ - -#if WIN || CE - -int socketSelect(int sid, int timeout) -{ - struct timeval tv; - socket_t *sp; - fd_set readFds, writeFds, exceptFds; - int nEvents; - int all, socketHighestFd; /* Highest socket fd opened */ - - FD_ZERO(&readFds); - FD_ZERO(&writeFds); - FD_ZERO(&exceptFds); - socketHighestFd = -1; - - tv.tv_sec = timeout / 1000; - tv.tv_usec = (timeout % 1000) * 1000; - -/* - * Set the select event masks for events to watch - */ - all = nEvents = 0; - - if (sid < 0) { - all++; - sid = 0; - } - - for (; sid < socketMax; sid++) { - if ((sp = socketList[sid]) == NULL) { - continue; - } - a_assert(sp); -/* - * Set the appropriate bit in the ready masks for the sp->sock. - */ - if (sp->handlerMask & SOCKET_READABLE) { - FD_SET(sp->sock, &readFds); - nEvents++; - if (socketInputBuffered(sid) > 0) { - tv.tv_sec = 0; - tv.tv_usec = 0; - } - } - if (sp->handlerMask & SOCKET_WRITABLE) { - FD_SET(sp->sock, &writeFds); - nEvents++; - } - if (sp->handlerMask & SOCKET_EXCEPTION) { - FD_SET(sp->sock, &exceptFds); - nEvents++; - } - if (! all) { - break; - } - } - -/* - * Windows select() fails if no descriptors are set, instead of just sleeping - * like other, nice select() calls. So, if WIN, sleep. - */ - if (nEvents == 0) { - Sleep(timeout); - return 0; - } - -/* - * Wait for the event or a timeout. - */ - nEvents = select(socketHighestFd+1, &readFds, &writeFds, &exceptFds, &tv); - - if (all) { - sid = 0; - } - for (; sid < socketMax; sid++) { - if ((sp = socketList[sid]) == NULL) { - continue; - } - - if (FD_ISSET(sp->sock, &readFds) || socketInputBuffered(sid) > 0) { - sp->currentEvents |= SOCKET_READABLE; - } - if (FD_ISSET(sp->sock, &writeFds)) { - sp->currentEvents |= SOCKET_WRITABLE; - } - if (FD_ISSET(sp->sock, &exceptFds)) { - sp->currentEvents |= SOCKET_EXCEPTION; - } - if (! all) { - break; - } - } - - return nEvents; -} - -#else /* not WIN || CE */ - -int socketSelect(int sid, int timeout) -{ - socket_t *sp; - struct timeval tv; - fd_mask *readFds, *writeFds, *exceptFds; - int all, len, nwords, index, bit, nEvents; - -/* - * Allocate and zero the select masks - */ - nwords = (socketHighestFd + NFDBITS) / NFDBITS; - len = nwords * sizeof(int); - - readFds = balloc(B_L, len); - memset(readFds, 0, len); - writeFds = balloc(B_L, len); - memset(writeFds, 0, len); - exceptFds = balloc(B_L, len); - memset(exceptFds, 0, len); - - tv.tv_sec = timeout / 1000; - tv.tv_usec = (timeout % 1000) * 1000; - -/* - * Set the select event masks for events to watch - */ - all = nEvents = 0; - - if (sid < 0) { - all++; - sid = 0; - } - - for (; sid < socketMax; sid++) { - if ((sp = socketList[sid]) == NULL) { - if (all == 0) { - break; - } else { - continue; - } - } - a_assert(sp); - -/* - * Initialize the ready masks and compute the mask offsets. - */ - index = sp->sock / (NBBY * sizeof(fd_mask)); - bit = 1 << (sp->sock % (NBBY * sizeof(fd_mask))); - -/* - * Set the appropriate bit in the ready masks for the sp->sock. - */ - if (sp->handlerMask & SOCKET_READABLE) { - readFds[index] |= bit; - nEvents++; - if (socketInputBuffered(sid) > 0) { - tv.tv_sec = 0; - tv.tv_usec = 0; - } - } - if (sp->handlerMask & SOCKET_WRITABLE) { - writeFds[index] |= bit; - nEvents++; - } - if (sp->handlerMask & SOCKET_EXCEPTION) { - exceptFds[index] |= bit; - nEvents++; - } - if (! all) { - break; - } - } - -/* - * Wait for the event or a timeout. Reset nEvents to be the number of actual - * events now. - */ - nEvents = select(socketHighestFd + 1, (fd_set *) readFds, - (fd_set *) writeFds, (fd_set *) exceptFds, &tv); - - if (nEvents > 0) { - if (all) { - sid = 0; - } - for (; sid < socketMax; sid++) { - if ((sp = socketList[sid]) == NULL) { - if (all == 0) { - break; - } else { - continue; - } - } - - index = sp->sock / (NBBY * sizeof(fd_mask)); - bit = 1 << (sp->sock % (NBBY * sizeof(fd_mask))); - - if (readFds[index] & bit || socketInputBuffered(sid) > 0) { - sp->currentEvents |= SOCKET_READABLE; - } - if (writeFds[index] & bit) { - sp->currentEvents |= SOCKET_WRITABLE; - } - if (exceptFds[index] & bit) { - sp->currentEvents |= SOCKET_EXCEPTION; - } - if (! all) { - break; - } - } - } - - bfree(B_L, readFds); - bfree(B_L, writeFds); - bfree(B_L, exceptFds); - - return nEvents; -} -#endif /* WIN || CE */ - -/******************************************************************************/ -/* - * Process socket events - */ - -void socketProcess(int sid) -{ - socket_t *sp; - int all; - - all = 0; - if (sid < 0) { - all = 1; - sid = 0; - } -/* - * Process each socket - */ - for (; sid < socketMax; sid++) { - if ((sp = socketList[sid]) == NULL) { - if (! all) { - break; - } else { - continue; - } - } - if (socketReady(sid)) { - socketDoEvent(sp); - } - if (! all) { - break; - } - } -} - -/******************************************************************************/ -/* - * Process an event on the event queue - */ - -static int socketDoEvent(socket_t *sp) -{ - ringq_t *rq; - int sid; - - a_assert(sp); - - sid = sp->sid; - if (sp->currentEvents & SOCKET_READABLE) { - if (sp->flags & SOCKET_LISTENING) { - socketAccept(sp); - sp->currentEvents = 0; - return 1; - } - - } else { -/* - * If there is still read data in the buffers, trigger the read handler - * NOTE: this may busy spin if the read handler doesn't read the data - */ - if (sp->handlerMask & SOCKET_READABLE && socketInputBuffered(sid)) { - sp->currentEvents |= SOCKET_READABLE; - } - } - - -/* - * If now writable and flushing in the background, continue flushing - */ - if (sp->currentEvents & SOCKET_WRITABLE) { - if (sp->flags & SOCKET_FLUSHING) { - rq = &sp->outBuf; - if (ringqLen(rq) > 0) { - socketFlush(sp->sid); - } else { - sp->flags &= ~SOCKET_FLUSHING; - } - } - } - -/* - * Now invoke the users socket handler. NOTE: the handler may delete the - * socket, so we must be very careful after calling the handler. - */ - if (sp->handler && (sp->handlerMask & sp->currentEvents)) { - (sp->handler)(sid, sp->handlerMask & sp->currentEvents, - sp->handler_data); -/* - * Make sure socket pointer is still valid, then reset the currentEvents. - */ - if (socketList && sid < socketMax && socketList[sid] == sp) { - sp->currentEvents = 0; - } - } - return 1; -} - -/******************************************************************************/ -/* - * Set the socket blocking mode - */ - -int socketSetBlock(int sid, int on) -{ - socket_t *sp; - unsigned long flag; - int iflag; - int oldBlock; - - flag = iflag = !on; - - if ((sp = socketPtr(sid)) == NULL) { - a_assert(0); - return 0; - } - oldBlock = (sp->flags & SOCKET_BLOCK); - sp->flags &= ~(SOCKET_BLOCK); - if (on) { - sp->flags |= SOCKET_BLOCK; - } - -/* - * Put the socket into block / non-blocking mode - */ - if (sp->flags & SOCKET_BLOCK) { -#if CE || WIN - ioctlsocket(sp->sock, FIONBIO, &flag); -#elif ECOS - int off; - off = 0; - ioctl(sp->sock, FIONBIO, &off); -#elif VXWORKS - ioctl(sp->sock, FIONBIO, (int)&iflag); -#else - fcntl(sp->sock, F_SETFL, fcntl(sp->sock, F_GETFL) & ~O_NONBLOCK); -#endif - - } else { -#if CE || WIN - ioctlsocket(sp->sock, FIONBIO, &flag); -#elif ECOS - int on; - on = 1; - ioctl(sp->sock, FIONBIO, &on); -#elif VXWORKS - ioctl(sp->sock, FIONBIO, (int)&iflag); -#else - fcntl(sp->sock, F_SETFL, fcntl(sp->sock, F_GETFL) | O_NONBLOCK); -#endif - } - return oldBlock; -} - -/******************************************************************************/ -/* - * Return true if a readable socket has buffered data. - not public - */ - -int socketDontBlock() -{ - socket_t *sp; - int i; - - for (i = 0; i < socketMax; i++) { - if ((sp = socketList[i]) == NULL || - (sp->handlerMask & SOCKET_READABLE) == 0) { - continue; - } - if (socketInputBuffered(i) > 0) { - return 1; - } - } - return 0; -} - -/******************************************************************************/ -/* - * Return true if a particular socket buffered data. - not public - */ - -int socketSockBuffered(int sock) -{ - socket_t *sp; - int i; - - for (i = 0; i < socketMax; i++) { - if ((sp = socketList[i]) == NULL || sp->sock != sock) { - continue; - } - return socketInputBuffered(i); - } - return 0; -} - -#endif /* (!WIN) | LITTLEFOOT | WEBS */ - -/******************************************************************************/ diff --git a/cpukit/httpd/sym.c b/cpukit/httpd/sym.c deleted file mode 100644 index cc06cffe2a..0000000000 --- a/cpukit/httpd/sym.c +++ /dev/null @@ -1,473 +0,0 @@ -/* - * sym.c -- Symbol Table module - * - * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved. - * - * See the file "license.txt" for usage and redistribution license requirements - */ - -/******************************** Description *********************************/ -/* - * This module implements a highly efficient generic symbol table with - * update and access routines. Symbols are simple character strings and - * the values they take can be flexible types as defined by value_t. - * This modules allows multiple symbol tables to be created. - */ - -/********************************* Includes ***********************************/ - -#if UEMF - #include "uemf.h" -#else - #include "basic/basicInternal.h" -#endif - -/********************************* Defines ************************************/ - -typedef struct { /* Symbol table descriptor */ - int inuse; /* Is this entry in use */ - int hash_size; /* Size of the table below */ - sym_t **hash_table; /* Allocated at run time */ -} sym_tabent_t; - -/********************************* Globals ************************************/ - -static sym_tabent_t **sym; /* List of symbol tables */ -static int symMax; /* One past the max symbol table */ -static int symOpenCount = 0; /* Count of apps using sym */ - -static int htIndex; /* Current location in table */ -static sym_t* next; /* Next symbol in iteration */ - -/**************************** Forward Declarations ****************************/ - -static int hashIndex(sym_tabent_t *tp, char_t *name); -static sym_t *hash(sym_tabent_t *tp, char_t *name); -static int calcPrime(int size); - -/*********************************** Code *************************************/ -/* - * Open the symbol table subSystem. - */ - -int symSubOpen() -{ - if (++symOpenCount == 1) { - symMax = 0; - sym = NULL; - } - return 0; -} - -/******************************************************************************/ -/* - * Close the symbol table subSystem. - */ - -void symSubClose() -{ - if (--symOpenCount <= 0) { - symOpenCount = 0; - } -} - -/******************************************************************************/ -/* - * Create a symbol table. - */ - -sym_fd_t symOpen(int hash_size) -{ - sym_fd_t sd; - sym_tabent_t *tp; - - a_assert(hash_size > 2); - -/* - * Create a new handle for this symbol table - */ - if ((sd = hAlloc((void***) &sym)) < 0) { - return -1; - } - -/* - * Create a new symbol table structure and zero - */ - if ((tp = (sym_tabent_t*) balloc(B_L, sizeof(sym_tabent_t))) == NULL) { - symMax = hFree((void***) &sym, sd); - return -1; - } - memset(tp, 0, sizeof(sym_tabent_t)); - if (sd >= symMax) { - symMax = sd + 1; - } - a_assert(0 <= sd && sd < symMax); - sym[sd] = tp; - -/* - * Now create the hash table for fast indexing. - */ - tp->hash_size = calcPrime(hash_size); - tp->hash_table = (sym_t**) balloc(B_L, tp->hash_size * sizeof(sym_t*)); - a_assert(tp->hash_table); - memset(tp->hash_table, 0, tp->hash_size * sizeof(sym_t*)); - - return sd; -} - -/******************************************************************************/ -/* - * Close this symbol table. Call a cleanup function to allow the caller - * to free resources associated with each symbol table entry. - */ - -void symClose(sym_fd_t sd) -{ - sym_tabent_t *tp; - sym_t *sp, *forw; - int i; - - a_assert(0 <= sd && sd < symMax); - tp = sym[sd]; - a_assert(tp); - -/* - * Free all symbols in the hash table, then the hash table itself. - */ - for (i = 0; i < tp->hash_size; i++) { - for (sp = tp->hash_table[i]; sp; sp = forw) { - forw = sp->forw; - valueFree(&sp->name); - valueFree(&sp->content); - bfree(B_L, (void*) sp); - sp = forw; - } - } - bfree(B_L, (void*) tp->hash_table); - - symMax = hFree((void***) &sym, sd); - bfree(B_L, (void*) tp); -} - -/******************************************************************************/ -/* - * Return the first symbol in the hashtable if there is one. This call is used - * as the first step in traversing the table. A call to symFirst should be - * followed by calls to symNext to get all the rest of the entries. - */ - -sym_t* symFirst(sym_fd_t sd) -{ - sym_tabent_t *tp; - sym_t *sp, *forw; - int i; - - a_assert(0 <= sd && sd < symMax); - tp = sym[sd]; - a_assert(tp); - -/* - * Find the first symbol in the hashtable and return a pointer to it. - */ - for (i = 0; i < tp->hash_size; i++) { - for (sp = tp->hash_table[i]; sp; sp = forw) { - forw = sp->forw; - - if (forw == NULL) { - htIndex = i + 1; - next = tp->hash_table[htIndex]; - } else { - htIndex = i; - next = forw; - } - return sp; - } - } - return NULL; -} - -/******************************************************************************/ -/* - * Return the next symbol in the hashtable if there is one. See symFirst. - */ - -sym_t* symNext(sym_fd_t sd) -{ - sym_tabent_t *tp; - sym_t *sp, *forw; - int i; - - a_assert(0 <= sd && sd < symMax); - tp = sym[sd]; - a_assert(tp); - -/* - * Find the first symbol in the hashtable and return a pointer to it. - */ - for (i = htIndex; i < tp->hash_size; i++) { - for (sp = next; sp; sp = forw) { - forw = sp->forw; - - if (forw == NULL) { - htIndex = i + 1; - next = tp->hash_table[htIndex]; - } else { - htIndex = i; - next = forw; - } - return sp; - } - next = tp->hash_table[i + 1]; - } - return NULL; -} - -/******************************************************************************/ -/* - * Lookup a symbol and return a pointer to the symbol entry. If not present - * then return a NULL. - */ - -sym_t *symLookup(sym_fd_t sd, char_t *name) -{ - sym_tabent_t *tp; - sym_t *sp; - char_t *cp; - - a_assert(0 <= sd && sd < symMax); - if ((tp = sym[sd]) == NULL) { - return NULL; - } - - if (name == NULL || *name == '\0') { - return NULL; - } - -/* - * Do an initial hash and then follow the link chain to find the right entry - */ - for (sp = hash(tp, name); sp; sp = sp->forw) { - cp = sp->name.value.string; - if (cp[0] == name[0] && gstrcmp(cp, name) == 0) { - break; - } - } - return sp; -} - -/******************************************************************************/ -/* - * Enter a symbol into the table. If already there, update its value. - * Always succeeds if memory available. We allocate a copy of "name" here - * so it can be a volatile variable. The value "v" is just a copy of the - * passed in value, so it MUST be persistent. - */ - -sym_t *symEnter(sym_fd_t sd, char_t *name, value_t v, int arg) -{ - sym_tabent_t *tp; - sym_t *sp, *last; - char_t *cp; - int hindex; - - a_assert(name); - a_assert(0 <= sd && sd < symMax); - tp = sym[sd]; - a_assert(tp); - -/* - * Calculate the first daisy-chain from the hash table. If non-zero, then - * we have daisy-chain, so scan it and look for the symbol. - */ - last = NULL; - hindex = hashIndex(tp, name); - if ((sp = tp->hash_table[hindex]) != NULL) { - for (; sp; sp = sp->forw) { - cp = sp->name.value.string; - if (cp[0] == name[0] && gstrcmp(cp, name) == 0) { - break; - } - last = sp; - } - if (sp) { -/* - * Found, so update the value - * If the caller stores handles which require freeing, they - * will be lost here. It is the callers responsibility to free - * resources before overwriting existing contents. We will here - * free allocated strings which occur due to value_instring(). - * We should consider providing the cleanup function on the open rather - * than the close and then we could call it here and solve the problem. - */ - if (sp->content.valid) { - valueFree(&sp->content); - } - sp->content = v; - sp->arg = arg; - return sp; - } -/* - * Not found so allocate and append to the daisy-chain - */ - sp = (sym_t*) balloc(B_L, sizeof(sym_t)); - if (sp == NULL) { - return NULL; - } - sp->name = valueString(name, VALUE_ALLOCATE); - sp->content = v; - sp->forw = (sym_t*) NULL; - sp->arg = arg; - last->forw = sp; - - } else { -/* - * Daisy chain is empty so we need to start the chain - */ - sp = (sym_t*) balloc(B_L, sizeof(sym_t)); - if (sp == NULL) { - return NULL; - } - tp->hash_table[hindex] = sp; - tp->hash_table[hashIndex(tp, name)] = sp; - - sp->forw = (sym_t*) NULL; - sp->content = v; - sp->arg = arg; - sp->name = valueString(name, VALUE_ALLOCATE); - } - return sp; -} - -/******************************************************************************/ -/* - * Delete a symbol from a table - */ - -int symDelete(sym_fd_t sd, char_t *name) -{ - sym_tabent_t *tp; - sym_t *sp, *last; - char_t *cp; - int hindex; - - a_assert(name && *name); - a_assert(0 <= sd && sd < symMax); - tp = sym[sd]; - a_assert(tp); - -/* - * Calculate the first daisy-chain from the hash table. If non-zero, then - * we have daisy-chain, so scan it and look for the symbol. - */ - last = NULL; - hindex = hashIndex(tp, name); - if ((sp = tp->hash_table[hindex]) != NULL) { - for ( ; sp; sp = sp->forw) { - cp = sp->name.value.string; - if (cp[0] == name[0] && gstrcmp(cp, name) == 0) { - break; - } - last = sp; - } - } - if (sp == (sym_t*) NULL) { /* Not Found */ - return -1; - } - -/* - * Unlink and free the symbol. Last will be set if the element to be deleted - * is not first in the chain. - */ - if (last) { - last->forw = sp->forw; - } else { - tp->hash_table[hindex] = sp->forw; - } - valueFree(&sp->name); - valueFree(&sp->content); - bfree(B_L, (void*) sp); - - return 0; -} - -/******************************************************************************/ -/* - * Hash a symbol and return a pointer to the hash daisy-chain list - * All symbols reside on the chain (ie. none stored in the hash table itself) - */ - -static sym_t *hash(sym_tabent_t *tp, char_t *name) -{ - a_assert(tp); - - return tp->hash_table[hashIndex(tp, name)]; -} - -/******************************************************************************/ -/* - * Compute the hash function and return an index into the hash table - * We use a basic additive function that is then made modulo the size of the - * table. - */ - -static int hashIndex(sym_tabent_t *tp, char_t *name) -{ - unsigned int sum; - int i; - - a_assert(tp); -/* - * Add in each character shifted up progressively by 7 bits. The shift - * amount is rounded so as to not shift too far. It thus cycles with each - * new cycle placing character shifted up by one bit. - */ - i = 0; - sum = 0; - while (*name) { - sum += (((int) *name++) << i); - i = (i + 7) % (BITS(int) - BITSPERBYTE); - } - return sum % tp->hash_size; -} - -/******************************************************************************/ -/* - * Check if this number is a prime - */ - -static int isPrime(int n) -{ - int i, max; - - a_assert(n > 0); - - max = n / 2; - for (i = 2; i <= max; i++) { - if (n % i == 0) { - return 0; - } - } - return 1; -} - -/******************************************************************************/ -/* - * Calculate the largest prime smaller than size. - */ - -static int calcPrime(int size) -{ - int count; - - a_assert(size > 0); - - for (count = size; count > 0; count--) { - if (isPrime(count)) { - return count; - } - } - return 1; -} - -/******************************************************************************/ - diff --git a/cpukit/httpd/uemf.c b/cpukit/httpd/uemf.c deleted file mode 100644 index aa177849a2..0000000000 --- a/cpukit/httpd/uemf.c +++ /dev/null @@ -1,281 +0,0 @@ -/* - * uemf.c -- GoAhead Micro Embedded Management Framework - * - * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved. - * - * See the file "license.txt" for usage and redistribution license requirements - */ - -/********************************** Description *******************************/ - -/* - * This module provides compatibility with the full GoAhead EMF. - * It is a collection of routines which permits the GoAhead WebServer to - * run stand-alone and to also load as a solution pack under the GoAhead EMF. - */ - -/*********************************** Includes *********************************/ - -#include "uemf.h" - -/********************************** Local Data ********************************/ - -int emfInst; /* Application instance handle */ - -/****************************** Forward Declarations **************************/ - -extern void defaultErrorHandler(int etype, char_t *buf); -static void (*errorHandler)(int etype, char_t *msg) = defaultErrorHandler; - -extern void defaultTraceHandler(int level, char_t *buf); -static void (*traceHandler)(int level, char_t *buf) = defaultTraceHandler; - -/************************************* Code ***********************************/ -/* - * Error message that doesn't need user attention. Customize this code - * to direct error messages to wherever the developer wishes - */ - -void error(E_ARGS_DEC, int etype, char_t *fmt, ...) -{ - va_list args; - char_t *fmtBuf, *buf; - - va_start(args, fmt); - fmtValloc(&fmtBuf, E_MAX_ERROR, fmt, args); - - if (etype == E_LOG) { - fmtAlloc(&buf, E_MAX_ERROR, T("%s\n"), fmtBuf); -#if DEV - } else if (etype == E_ASSERT) { - fmtAlloc(&buf, E_MAX_ERROR, - T("Assertion %s, failed at %s %d\n"), fmtBuf, E_ARGS); -#endif - } else if (etype == E_USER) { - fmtAlloc(&buf, E_MAX_ERROR, T("%s\n"), fmtBuf); - } - va_end(args); - - bfree(B_L, fmtBuf); - - if (errorHandler) { - errorHandler(etype, buf); - } - - bfreeSafe(B_L, buf); -} - -/******************************************************************************/ -/* - * Replace the default error handler. Return pointer to old error handler. - */ - -void (*errorSetHandler(void (*function)(int etype, char_t *msg))) \ - (int etype, char_t *msg) -{ - void (*oldHandler)(int etype, char_t *buf); - - oldHandler = errorHandler; - errorHandler = function; - return oldHandler; -} - -/******************************************************************************/ -/* - * Trace log. Customize this function to log trace output - */ - -void trace(int level, char_t *fmt, ...) -{ - va_list args; - char_t *buf; - - va_start(args, fmt); - fmtValloc(&buf, VALUE_MAX_STRING, fmt, args); - - if (traceHandler) { - traceHandler(level, buf); - } - bfreeSafe(B_L, buf); - va_end(args); -} - -/******************************************************************************/ -/* - * Trace log. Customize this function to log trace output - */ - -void traceRaw(char_t *buf) -{ - if (traceHandler) { - traceHandler(0, buf); - } -} - -/******************************************************************************/ -/* - * Replace the default trace handler. Return a pointer to the old handler. - */ - -void (*traceSetHandler(void (*function)(int level, char_t *buf))) - (int level, char *buf) -{ - void (*oldHandler)(int level, char_t *buf); - - oldHandler = traceHandler; - if (function) { - traceHandler = function; - } - return oldHandler; -} - -/******************************************************************************/ -/* - * Save the instance handle - */ - -void emfInstSet(int inst) -{ - emfInst = inst; -} - -/******************************************************************************/ -/* - * Get the instance handle - */ - -int emfInstGet() -{ - return emfInst; -} - -/******************************************************************************/ -/* - * Convert a string to lower case - */ - -char_t *strlower(char_t *string) -{ - char_t *s; - - a_assert(string); - - if (string == NULL) { - return NULL; - } - - s = string; - while (*s) { - if (gisupper(*s)) { - *s = (char_t) gtolower(*s); - } - s++; - } - *s = '\0'; - return string; -} - -/******************************************************************************/ -/* - * Convert a string to upper case - */ - -char_t *strupper(char_t *string) -{ - char_t *s; - - a_assert(string); - if (string == NULL) { - return NULL; - } - - s = string; - while (*s) { - if (gislower(*s)) { - *s = (char_t) gtoupper(*s); - } - s++; - } - *s = '\0'; - return string; -} - -/******************************************************************************/ -/* - * Convert integer to ascii string. Allow a NULL string in which case we - * allocate a dynamic buffer. - */ - -char_t *stritoa(int n, char_t *string, int width) -{ - char_t *cp, *lim, *s; - char_t buf[16]; /* Just temp to hold number */ - int next, minus; - - a_assert(string && width > 0); - - if (string == NULL) { - if (width == 0) { - width = 10; - } - if ((string = balloc(B_L, width + 1)) == NULL) { - return NULL; - } - } - if (n < 0) { - minus = 1; - n = -n; - width--; - } else { - minus = 0; - } - - cp = buf; - lim = &buf[width - 1]; - while (n > 9 && cp < lim) { - next = n; - n /= 10; - *cp++ = (char_t) (next - n * 10 + '0'); - } - if (cp < lim) { - *cp++ = (char_t) (n + '0'); - } - - s = string; - if (minus) { - *s++ = '-'; - } - - while (cp > buf) { - *s++ = *--cp; - } - - *s++ = '\0'; - return string; -} - -/******************************************************************************/ -/* - * Stubs - */ - -char_t *basicGetProduct() -{ - return T("uemf"); -} - -char_t *basicGetAddress() -{ - return T("localhost"); -} - -int errorOpen(char_t *pname) -{ - return 0; -} - -void errorClose() -{ -} - -/******************************************************************************/ diff --git a/cpukit/httpd/uemf.h b/cpukit/httpd/uemf.h deleted file mode 100644 index b695633ec3..0000000000 --- a/cpukit/httpd/uemf.h +++ /dev/null @@ -1,1044 +0,0 @@ -/* - * uemf.h -- GoAhead Micro Embedded Management Framework Header - * - * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved. - * - * See the file "license.txt" for usage and redistribution license requirements - */ - -#ifndef _h_UEMF -#define _h_UEMF 1 - -/******************************** Description *********************************/ - -/* - * GoAhead Web Server header. This defines the Web public APIs - */ - -/******************************* Per O/S Includes *****************************/ - -#if WIN - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -#endif /* WIN */ - -#if CE - #include - #include - #include - #include - #include "CE/wincompat.h" - #include -#endif /* CE */ - -#if NW - #include -#endif /* NW */ - -#if SCOV5 - #include - #include - #include "sys/socket.h" - #include "sys/select.h" - #include "netinet/in.h" - #include "arpa/inet.h" - #include "netdb.h" -#endif /* SCOV5 */ - -#if UNIX - #include -#endif /* UNIX */ - -#if LINUX || __rtems__ - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -#endif /* LINUX */ - -#if LYNX - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -#endif /* LYNX */ - -#if UW - #include -#endif /* UW */ - -#if VXWORKS - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -#endif /* VXWORKS */ - -#if SOLARIS - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -#endif /* SOLARIS */ - -#if QNX4 - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include -#endif /* QNX4 */ - -#if ECOS - #include - #include - #include - #include - #include - #include -#endif /* ECOS */ - -/********************************** Includes **********************************/ - -#include -#include -#include - -#if ! WEBS -#include "messages.h" -#endif /* ! WEBS */ - -/******************************* Per O/S Defines *****************************/ - -#if defined(__rtems__) -#define __NO_PACK 1 -#endif - -#if UW - #define __NO_PACK 1 -#endif /* UW */ - -#if SCOV5 || VXWORKS || LINUX || LYNX || __rtems__ -#ifndef O_BINARY -#define O_BINARY 0 -#endif /* O_BINARY */ -#define SOCKET_ERROR -1 -#endif /* SCOV5 || VXWORKS || LINUX || LYNX */ - -#if WIN || CE -/* - * __NO_FCNTL means can't access fcntl function. Fcntl.h is still available. - */ -#define __NO_FCNTL 1 - -#undef R_OK -#define R_OK 4 -#undef W_OK -#define W_OK 2 -#undef X_OK -#define X_OK 1 -#undef F_OK -#define F_OK 0 -#endif /* WIN || CE */ - -#if LINUX && !__rtems__ && ! _STRUCT_TIMEVAL -struct timeval -{ - time_t tv_sec; /* Seconds. */ - time_t tv_usec; /* Microseconds. */ -}; -#define _STRUCT_TIMEVAL 1 -#endif /* LINUX && ! _STRUCT_TIMEVAL */ - -#if ECOS - #define O_RDONLY 1 - #define O_BINARY 2 - - #define __NO_PACK 1 - #define __NO_EJ_FILE 1 - #define __NO_CGI_BIN 1 - #define __NO_FCNTL 1 - -/* - * #define LIBKERN_INLINE to avoid kernel inline functions - */ - #define LIBKERN_INLINE - -#endif /* ECOS */ - -#if QNX4 - typedef long fd_mask; - #define NFDBITS (sizeof (fd_mask) * NBBY) /* bits per mask */ -#endif /* QNX4 */ - -/********************************** Unicode ***********************************/ -/* - * Constants and limits. Also FNAMESIZE and PATHSIZE are currently defined - * in param.h to be 128 and 512 - */ -#define TRACE_MAX (4096 - 48) -#define VALUE_MAX_STRING (4096 - 48) -#define SYM_MAX (512) -#define XML_MAX 4096 /* Maximum size for tags/tokens */ -#define BUF_MAX 4096 /* General sanity check for bufs */ - -#if LITTLEFOOT || WEBS -#define LF_BUF_MAX (510) -#define LF_PATHSIZE LF_BUF_MAX -#else -#define LF_BUF_MAX BUF_MAX -#define LF_PATHSIZE PATHSIZE -#define UPPATHSIZE PATHSIZE -#endif /* LITTLEFOOT || WEBS */ - -#ifndef CHAR_T_DEFINED -#define CHAR_T_DEFINED 1 -#if UNICODE -/* - * To convert strings to UNICODE. We have a level of indirection so things - * like T(__FILE__) will expand properly. - */ -#define T(x) __TXT(x) -#define __TXT(s) L ## s -typedef unsigned short char_t; -typedef unsigned short uchar_t; - -/* - * Text size of buffer macro. A buffer bytes will hold (size / char size) - * characters. - */ -#define TSZ(x) (sizeof(x) / sizeof(char_t)) - -/* - * How many ASCII bytes are required to represent this UNICODE string? - */ -#define TASTRL(x) ((wcslen(x) + 1) * sizeof(char_t)) - -#else -#define T(s) s -typedef char char_t; -#define TSZ(x) (sizeof(x)) -#define TASTRL(x) (strlen(x) + 1) -#if WIN -typedef unsigned char uchar_t; -#endif /* WIN */ - -#endif /* UNICODE */ - -#endif /* ! CHAR_T_DEFINED */ - -/* - * "Boolean" constants - */ - -#ifndef TRUE -#define TRUE 1 -#endif - -#ifndef FALSE -#define FALSE 0 -#endif - -/* - * GoAhead Copyright. - */ -#define GOAHEAD_COPYRIGHT \ - T("Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved.") - -/* - * The following include has to be after the unicode defines. By putting it - * here, many modules in various parts of the tree are cleaner. - */ -#if LITTLEFOOT && INMEM - #include "lf/inmem.h" -#endif /* LITTLEFOOT && INMEM */ - -/* - * Type for unicode systems - */ -#if UNICODE - -#define gmain wmain - -#define gasctime _wasctime -#define gsprintf swprintf -#define gprintf wprintf -#define gfprintf fwprintf -#define gsscanf swscanf -#define gvsprintf vswprintf - -#define gstrcpy wcscpy -#define gstrncpy wcsncpy -#define gstrncat wcsncat -#define gstrlen wcslen -#define gstrcat wcscat -#define gstrcmp wcscmp -#define gstrncmp wcsncmp -#define gstricmp wcsicmp -#define gstrchr wcschr -#define gstrrchr wcsrchr -#define gstrtok wcstok -#define gstrnset wcsnset -#define gstrrchr wcsrchr -#define gstrstr wcsstr -#define gstrtol wcstol - -#define gfopen _wfopen -#define gopen _wopen -#define gclose close -#define gcreat _wcreat -#define gfgets fgetws -#define gfputs fputws -#define gfscanf fwscanf -#define ggets _getws -#define glseek lseek -#define gunlink _wunlink -#define gread read -#define grename _wrename -#define gwrite write -#define gtmpnam _wtmpnam -#define gtempnam _wtempnam -#define gfindfirst _wfindfirst -#define gfinddata_t _wfinddata_t -#define gfindnext _wfindnext -#define gfindclose _findclose -#define gstat _wstat -#define gaccess _waccess -#define gchmod _wchmod - -typedef struct _stat gstat_t; - -#define gmkdir _wmkdir -#define gchdir _wchdir -#define grmdir _wrmdir -#define ggetcwd _wgetcwd - -#define gtolower towlower -#define gtoupper towupper -#if CE -#define gisspace isspace -#define gisdigit isdigit -#define gisxdigit isxdigit -#define gisupper isupper -#define gislower islower -#define gisprint isprint -#else -#define gremove _wremove -#define gisspace iswspace -#define gisdigit iswdigit -#define gisxdigit iswxdigit -#define gisupper iswupper -#define gislower iswlower -#endif /* if CE */ -#define gisalnum iswalnum -#define gisalpha iswalpha -#define gatoi(s) wcstol(s, NULL, 10) - -#define gctime _wctime -#define ggetenv _wgetenv -#define gexecvp _wexecvp - -#else /* ! UNICODE */ - -#ifndef gopen -#if INMEM -#define gclose imClose -#define gclosedir imClosedir -#define gchdir imChdir -#define gchmod imChmod -#define ggetcwd imGetcwd -#define glseek imLseek -#define gloadModule imLoadModule -#define gmkdir imMkdir -#define gopen imOpen -#define gopendir imOpendir -#define gread imRead -#define greaddir imReaddir -#define grename imRename -#define grmdir imRmdir -#define gstat imStat -#define gunlink imUnlink -#define gwrite imWrite -#else -#define gclose close -#define gclosedir closedir -#if VXWORKS -#define gchdir vxchdir -#define gmkdir vxmkdir -#define grmdir vxrmdir -#else -#if LYNX || LINUX || SOLARIS -#define gmkdir(s) mkdir(s,0755) -#else -#define gmkdir mkdir -#endif /* LYNX || LINUX || SOLARIS */ -#define grmdir rmdir -#define gchdir chdir -#endif /* VXWORKS */ -#define gchmod chmod -#define ggetcwd getcwd -#define glseek lseek -#define gloadModule loadModule -#define gopen open -#define gopendir opendir -#define gread read -#define greaddir readdir -#define grename rename -#define gstat stat -#define gunlink unlink -#define gwrite write -#endif /* INMEM */ -#endif /* ! gopen */ - -#define gasctime asctime -#define gsprintf sprintf -#define gprintf printf -#define gfprintf fprintf -#define gsscanf sscanf -#define gvsprintf vsprintf - -#define gstrcpy strcpy -#define gstrncpy strncpy -#define gstrncat strncat -#define gstrlen strlen -#define gstrcat strcat -#define gstrcmp strcmp -#define gstrncmp strncmp -#define gstricmp strcmpci -#define gstrchr strchr -#define gstrrchr strrchr -#define gstrtok strtok -#define gstrnset strnset -#define gstrrchr strrchr -#define gstrstr strstr -#define gstrtol strtol - -#define gfopen fopen -#define gcreat creat -#define gfgets fgets -#define gfputs fputs -#define gfscanf fscanf -#define ggets gets -#define gtmpnam tmpnam -#define gtempnam tempnam -#define gfindfirst _findfirst -#define gfinddata_t _finddata_t -#define gfindnext _findnext -#define gfindclose _findclose -#define gaccess access - -typedef struct stat gstat_t; - -#define gremove remove - -#define gtolower tolower -#define gtoupper toupper -#define gisspace isspace -#define gisdigit isdigit -#define gisxdigit isxdigit -#define gisalnum isalnum -#define gisalpha isalpha -#define gisupper isupper -#define gislower islower -#define gatoi atoi - -#define gctime ctime -#define ggetenv getenv -#define gexecvp execvp -#ifndef VXWORKS -#define gmain main -#endif /* ! VXWORKS */ -#if VXWORKS -#define fcntl(a, b, c) -#endif /* VXWORKS */ -#endif /* ! UNICODE */ - -/********************************** Defines ***********************************/ - -#ifndef FNAMESIZE -#define FNAMESIZE 254 /* Max length of file names */ -#endif /* FNAMESIZE */ - -#define E_MAX_ERROR 4096 -#define URL_MAX 4096 - -/* - * Error types - */ -#define E_ASSERT 0x1 /* Assertion error */ -#define E_LOG 0x2 /* Log error to log file */ -#define E_USER 0x3 /* Error that must be displayed */ - -#define E_L T(__FILE__), __LINE__ -#define E_ARGS_DEC char_t *file, int line -#define E_ARGS file, line - -#if ASSERT || ASSERT_CE - #define a_assert(C) if (C) ; else error(E_L, E_ASSERT, T("%s"), T(#C)) -#else - #define a_assert(C) if (1) ; else -#endif /* ASSERT || ASSERT_CE */ - -/******************************************************************************/ -/* VALUE */ -/******************************************************************************/ -/* - * These values are not prefixed so as to aid code readability - */ - -typedef enum { - undefined = 0, - byteint = 1, - shortint = 2, - integer = 3, - hex = 4, - percent = 5, - octal = 6, - big = 7, - flag = 8, - floating = 9, - string = 10, - bytes = 11, - symbol = 12, - errmsg = 13 -} vtype_t; - -#ifndef __NO_PACK -#pragma pack(2) -#endif /* _NO_PACK */ - -typedef struct { - - union { - char flag; - char byteint; - short shortint; - char percent; - long integer; - long hex; - long octal; - long big[2]; -#if FLOATING_POINT_SUPPORT - double floating; -#endif /* FLOATING_POINT_SUPPORT */ - char_t *string; - char *bytes; - char_t *errmsg; - void *symbol; - } value; - - vtype_t type : 16; - unsigned int valid : 8; - unsigned int allocated : 8; /* String was balloced */ -} value_t; - -#ifndef __NO_PACK -#pragma pack() -#endif /* __NO_PACK */ - -/* - * Allocation flags - */ -#define VALUE_ALLOCATE 0x1 - -#define value_numeric(t) (t >= byteint && t <= big) -#define value_str(t) (t >= string && t <= bytes) -#define value_ok(t) (t > undefined && t <= symbol) - -#define VALUE_VALID { {0}, integer, 1 } -#define VALUE_INVALID { {0}, undefined, 0 } - -/******************************************************************************/ -/* - * A ring queue allows maximum utilization of memory for data storage and is - * ideal for input/output buffering. This module provides a highly effecient - * implementation and a vehicle for dynamic strings. - * - * WARNING: This is a public implementation and callers have full access to - * the queue structure and pointers. Change this module very carefully. - * - * This module follows the open/close model. - * - * Operation of a ringq where rq is a pointer to a ringq : - * - * rq->buflen contains the size of the buffer. - * rq->buf will point to the start of the buffer. - * rq->servp will point to the first (un-consumed) data byte. - * rq->endp will point to the next free location to which new data is added - * rq->endbuf will point to one past the end of the buffer. - * - * Eg. If the ringq contains the data "abcdef", it might look like : - * - * +-------------------------------------------------------------------+ - * | | | | | | | | a | b | c | d | e | f | | | | | - * +-------------------------------------------------------------------+ - * ^ ^ ^ ^ - * | | | | - * rq->buf rq->servp rq->endp rq->enduf - * - * The queue is empty when servp == endp. This means that the queue will hold - * at most rq->buflen -1 bytes. It is the fillers responsibility to ensure - * the ringq is never filled such that servp == endp. - * - * It is the fillers responsibility to "wrap" the endp back to point to - * rq->buf when the pointer steps past the end. Correspondingly it is the - * consumers responsibility to "wrap" the servp when it steps to rq->endbuf. - * The ringqPutc and ringqGetc routines will do this automatically. - */ - -/* - * Ring queue buffer structure - */ -typedef struct { - unsigned char *buf; /* Holding buffer for data */ - unsigned char *servp; /* Pointer to start of data */ - unsigned char *endp; /* Pointer to end of data */ - unsigned char *endbuf; /* Pointer to end of buffer */ - int buflen; /* Length of ring queue */ - int maxsize; /* Maximum size */ - int increment; /* Growth increment */ -} ringq_t; - -/* - * Block allocation (balloc) definitions - */ -#ifdef B_STATS -#ifndef B_L -#define B_L T(__FILE__), __LINE__ -#define B_ARGS_DEC char_t *file, int line -#define B_ARGS file, line -#endif /* B_L */ -#endif /* B_STATS */ - -/* - * Block classes are: 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, - * 16384, 32768, 65536 - */ -typedef struct { - union { - void *next; /* Pointer to next in q */ - int size; /* Actual requested size */ - } u; - int flags; /* Per block allocation flags */ -} bType; - -#define B_SHIFT 4 /* Convert size to class */ -#define B_ROUND ((1 << (B_SHIFT)) - 1) -#define B_MAX_CLASS 13 /* Maximum class number + 1 */ -#define B_MALLOCED 0x80000000 /* Block was malloced */ -#define B_DEFAULT_MEM (64 * 1024) /* Default memory allocation */ -#define B_MAX_FILES (512) /* Maximum number of files */ -#define B_FILL_CHAR (0x77) /* Fill byte for buffers */ -#define B_FILL_WORD (0x77777777) /* Fill word for buffers */ -#define B_MAX_BLOCKS (64 * 1024) /* Maximum allocated blocks */ - -/* - * Flags. The integrity value is used as an arbitrary value to fill the flags. - */ -#define B_INTEGRITY 0x8124000 /* Integrity value */ -#define B_INTEGRITY_MASK 0xFFFF000 /* Integrity mask */ -#define B_USE_MALLOC 0x1 /* Okay to use malloc if required */ -#define B_USER_BUF 0x2 /* User supplied buffer for mem */ - -/* - * The symbol table record for each symbol entry - */ - -typedef struct sym_t { - struct sym_t *forw; /* Pointer to next hash list */ - value_t name; /* Name of symbol */ - value_t content; /* Value of symbol */ - int arg; /* Parameter value */ -} sym_t; - -typedef int sym_fd_t; /* Returned by symOpen */ - -/* - * Script engines - */ -#define EMF_SCRIPT_JSCRIPT 0 /* javascript */ -#define EMF_SCRIPT_TCL 1 /* tcl */ -#define EMF_SCRIPT_EJSCRIPT 2 /* Ejscript */ -#define EMF_SCRIPT_MAX 3 - -#define MAXINT INT_MAX -#define BITSPERBYTE 8 -#define BITS(type) (BITSPERBYTE * (int) sizeof(type)) -#define STRSPACE T("\t \n\r\t") - -#ifndef max -#define max(a,b) (((a) > (b)) ? (a) : (b)) -#endif /* max */ - -#ifndef min -#define min(a,b) (((a) < (b)) ? (a) : (b)) -#endif /* min */ - -/******************************************************************************/ -/* CRON */ -/******************************************************************************/ - -typedef struct { - char_t *minute; - char_t *hour; - char_t *day; - char_t *month; - char_t *dayofweek; -} cron_t; - -extern long cronUntil(cron_t *cp, int period, time_t testTime); -extern int cronAlloc(cron_t *cp, char_t *str); -extern int cronFree(cron_t *cp); - -/******************************************************************************/ -/* SOCKET */ -/******************************************************************************/ -/* - * Socket flags - */ - -#if (WIN || CE) && WEBS -#define EWOULDBLOCK WSAEWOULDBLOCK -#define ENETDOWN WSAENETDOWN -#define ECONNRESET WSAECONNRESET -#endif /* (WIN || CE) && WEBS) */ - -#define SOCKET_EOF 0x1 /* Seen end of file */ -#define SOCKET_CONNECTING 0x2 /* Connect in progress */ -#define SOCKET_BROADCAST 0x4 /* Broadcast mode */ -#define SOCKET_PENDING 0x8 /* Message pending on this socket */ -#define SOCKET_FLUSHING 0x10 /* Background flushing */ -#define SOCKET_DATAGRAM 0x20 /* Use datagrams */ -#define SOCKET_ASYNC 0x40 /* Use async connect */ -#define SOCKET_BLOCK 0x80 /* Use blocking I/O */ -#define SOCKET_LISTENING 0x100 /* Socket is server listener */ -#define SOCKET_CLOSING 0x200 /* Socket is closing */ - -#define SOCKET_PORT_MAX 0xffff /* Max Port size */ - -/* - * Socket error values - */ -#define SOCKET_WOULDBLOCK 1 /* Socket would block on I/O */ -#define SOCKET_RESET 2 /* Socket has been reset */ -#define SOCKET_NETDOWN 3 /* Network is down */ -#define SOCKET_AGAIN 4 /* Issue the request again */ -#define SOCKET_INTR 5 /* Call was interrupted */ -#define SOCKET_INVAL 6 /* Invalid */ - -/* - * Handler event masks - */ -#define SOCKET_READABLE 0x2 /* Make socket readable */ -#define SOCKET_WRITABLE 0x4 /* Make socket writable */ -#define SOCKET_EXCEPTION 0x8 /* Interested in exceptions */ -#define EMF_SOCKET_MESSAGE (WM_USER+13) - -#if LITTLEFOOT -#define SOCKET_BUFSIZ 510 /* Underlying buffer size */ -#else -#define SOCKET_BUFSIZ 1024 /* Underlying buffer size */ -#endif /* LITTLEFOOT */ - -typedef void (*socketHandler_t)(int sid, int mask, int data); -typedef int (*socketAccept_t)(int sid, char *ipaddr, int port, - int listenSid); -typedef struct { - char host[64]; /* Host name */ - ringq_t inBuf; /* Input ring queue */ - ringq_t outBuf; /* Output ring queue */ - ringq_t lineBuf; /* Line ring queue */ - socketAccept_t accept; /* Accept handler */ - socketHandler_t handler; /* User I/O handler */ - int handler_data; /* User handler data */ - int handlerMask; /* Handler events of interest */ - int sid; /* Index into socket[] */ - int port; /* Port to listen on */ - int flags; /* Current state flags */ - int sock; /* Actual socket handle */ - int fileHandle; /* ID of the file handler */ - int interestEvents; /* Mask of events to watch for */ - int currentEvents; /* Mask of ready events (FD_xx) */ - int selectEvents; /* Events being selected */ - int saveMask; /* saved Mask for socketFlush */ - int error; /* Last error */ -} socket_t; - -/********************************* Prototypes *********************************/ -/* - * Balloc module - * - */ - -extern void bclose(); -extern int bopen(void *buf, int bufsize, int flags); - -/* - * Define NO_BALLOC to turn off our balloc module altogether - * #define NO_BALLOC 1 - */ - -#if NO_BALLOC -#define balloc(B_ARGS, num) malloc(num) -#define bfree(B_ARGS, p) free(p) -#define bfreeSafe(B_ARGS, p) \ - if (p) { free(p); } else -#define brealloc(B_ARGS, p, num) realloc(p, num) -extern char_t *bstrdupNoBalloc(char_t *s); -extern char *bstrdupANoBalloc(char *s); -#define bstrdup(B_ARGS, s) bstrdupNoBalloc(s) -#define bstrdupA(B_ARGS, s) bstrdupANoBalloc(s) -#define gstrdup(B_ARGS, s) bstrdupNoBalloc(s) - -#else /* BALLOC */ - -#ifndef B_STATS -#define balloc(B_ARGS, num) balloc(num) -#define bfree(B_ARGS, p) bfree(p) -#define bfreeSafe(B_ARGS, p) bfreeSafe(p) -#define brealloc(B_ARGS, p, size) brealloc(p, size) -#define bstrdup(B_ARGS, p) bstrdup(p) - -#if UNICODE -#define bstrdupA(B_ARGS, p) bstrdupA(p) -#else /* UNICODE */ -#define bstrdupA bstrdup -#endif /* UNICODE */ - -#endif /* B_STATS */ - -#define gstrdup bstrdup -extern void *balloc(B_ARGS_DEC, int size); -extern void bfree(B_ARGS_DEC, void *mp); -extern void bfreeSafe(B_ARGS_DEC, void *mp); -extern void *brealloc(B_ARGS_DEC, void *buf, int newsize); -extern char_t *bstrdup(B_ARGS_DEC, char_t *s); - -#if UNICODE -extern char *bstrdupA(B_ARGS_DEC, char *s); -#else /* UNICODE */ -#define bstrdupA bstrdup -#endif /* UNICODE */ -#endif /* BALLOC */ - -extern void bstats(int handle, void (*writefn)(int handle, char_t *fmt, ...)); - -/* - * Flags. The integrity value is used as an arbitrary value to fill the flags. - */ -#define B_USE_MALLOC 0x1 /* Okay to use malloc if required */ -#define B_USER_BUF 0x2 /* User supplied buffer for mem */ - -#if !LINUX && !__rtems__ -extern char_t *basename(char_t *name); -#endif /* !LINUX */ - -#if UEMF && WEBS -/* - * The open source webserver uses a different callback/timer mechanism - * than other emf derivative products such as FieldUpgrader agents - * so redefine those API for webserver so that they can coexist in the - * same address space as the others. - */ -#define emfSchedCallback websSchedCallBack -#define emfUnschedCallback websUnschedCallBack -#define emfReschedCallback websReschedCallBack -#endif /* UEMF && WEBS */ - -typedef void (emfSchedProc)(void *data, int id); -extern int emfSchedCallback(int delay, emfSchedProc *proc, void *arg); -extern void emfUnschedCallback(int id); -extern void emfReschedCallback(int id, int delay); -extern void emfSchedProcess(); -extern int emfInstGet(); -extern void emfInstSet(int inst); -extern void error(E_ARGS_DEC, int flags, char_t *fmt, ...); -extern void (*errorSetHandler(void (*function)(int etype, char_t *msg))) \ - (int etype, char_t *msg); - -#if B_STATS -#define hAlloc(x) HALLOC(B_L, x) -#define hAllocEntry(x, y, z) HALLOCENTRY(B_L, x, y, z) -extern int HALLOC(B_ARGS_DEC, void ***map); -extern int HALLOCENTRY(B_ARGS_DEC, void ***list, int *max, int size); -#else -extern int hAlloc(void ***map); -extern int hAllocEntry(void ***list, int *max, int size); -#endif /* B_STATS */ - -extern int hFree(void ***map, int handle); - -extern int ringqOpen(ringq_t *rq, int increment, int maxsize); -extern void ringqClose(ringq_t *rq); -extern int ringqLen(ringq_t *rq); - -extern int ringqPutc(ringq_t *rq, char_t c); -extern int ringqInsertc(ringq_t *rq, char_t c); -extern int ringqPutStr(ringq_t *rq, char_t *str); -extern int ringqGetc(ringq_t *rq); - -extern int fmtValloc(char_t **s, int n, char_t *fmt, va_list arg); -extern int fmtAlloc(char_t **s, int n, char_t *fmt, ...); -extern int fmtStatic(char_t *s, int n, char_t *fmt, ...); - -#if UNICODE -extern int ringqPutcA(ringq_t *rq, char c); -extern int ringqInsertcA(ringq_t *rq, char c); -extern int ringqPutStrA(ringq_t *rq, char *str); -extern int ringqGetcA(ringq_t *rq); -#else -#define ringqPutcA ringqPutc -#define ringqInsertcA ringqInsertc -#define ringqPutStrA ringqPutStr -#define ringqGetcA ringqGetc -#endif /* UNICODE */ - -extern int ringqPutBlk(ringq_t *rq, unsigned char *buf, int len); -extern int ringqPutBlkMax(ringq_t *rq); -extern void ringqPutBlkAdj(ringq_t *rq, int size); -extern int ringqGetBlk(ringq_t *rq, unsigned char *buf, int len); -extern int ringqGetBlkMax(ringq_t *rq); -extern void ringqGetBlkAdj(ringq_t *rq, int size); -extern void ringqFlush(ringq_t *rq); -extern void ringqAddNull(ringq_t *rq); - -extern int scriptSetVar(int engine, char_t *var, char_t *value); -extern int scriptEval(int engine, char_t *cmd, char_t **rslt, int chan); - -extern void socketClose(); -extern void socketCloseConnection(int sid); -extern void socketCreateHandler(int sid, int mask, socketHandler_t - handler, int arg); -extern void socketDeleteHandler(int sid); -extern int socketEof(int sid); -extern int socketCanWrite(int sid); -extern void socketSetBufferSize(int sid, int in, int line, int out); -extern int socketFlush(int sid); -extern int socketGets(int sid, char_t **buf); -extern int socketGetPort(int sid); -extern int socketInputBuffered(int sid); -extern int socketOpen(); -extern int socketOpenConnection(char *host, int port, - socketAccept_t accept, int flags); -extern void socketProcess(int hid); -extern int socketRead(int sid, char *buf, int len); -extern int socketReady(int hid); -extern int socketWrite(int sid, char *buf, int len); -extern int socketWriteString(int sid, char_t *buf); -extern int socketSelect(int hid, int timeout); -extern int socketGetHandle(int sid); -extern int socketSetBlock(int sid, int flags); -extern int socketGetBlock(int sid); -extern int socketAlloc(char *host, int port, socketAccept_t accept, - int flags); -extern void socketFree(int sid); -extern int socketGetError(); -extern socket_t *socketPtr(int sid); -extern int socketWaitForEvent(socket_t *sp, int events, int *errCode); -extern void socketRegisterInterest(socket_t *sp, int handlerMask); -extern int socketGetInput(int sid, char *buf, int toRead, int *errCode); - -extern char_t *strlower(char_t *string); -extern char_t *strupper(char_t *string); - -extern char_t *stritoa(int n, char_t *string, int width); - -extern sym_fd_t symOpen(int hash_size); -extern void symClose(sym_fd_t sd); -extern sym_t *symLookup(sym_fd_t sd, char_t *name); -extern sym_t *symEnter(sym_fd_t sd, char_t *name, value_t v, int arg); -extern int symDelete(sym_fd_t sd, char_t *name); -extern void symWalk(sym_fd_t sd, void (*fn)(sym_t *symp)); -extern sym_t *symFirst(sym_fd_t sd); -extern sym_t *symNext(sym_fd_t sd); -extern int symSubOpen(); -extern void symSubClose(); - -extern void trace(int lev, char_t *fmt, ...); -extern void traceRaw(char_t *buf); -extern void (*traceSetHandler(void (*function)(int level, char_t *buf))) - (int level, char_t *buf); - -extern value_t valueInteger(long value); -extern value_t valueString(char_t *value, int flags); -extern value_t valueErrmsg(char_t *value); -extern void valueFree(value_t *v); -extern int vxchdir(char *dirname); - -extern unsigned int hextoi(char_t *hexstring); -extern unsigned int gstrtoi(char_t *s); -extern time_t timeMsec(); - -extern char_t *ascToUni(char_t *ubuf, char *str, int nBytes); -extern char *uniToAsc(char *buf, char_t *ustr, int nBytes); -extern char_t *ballocAscToUni(char *cp, int alen); -extern char *ballocUniToAsc(char_t *unip, int ulen); - -extern char_t *basicGetHost(); -extern char_t *basicGetAddress(); -extern char_t *basicGetProduct(); -extern void basicSetHost(char_t *host); -extern void basicSetAddress(char_t *addr); - -extern int harnessOpen(char_t **argv); -extern void harnessClose(int status); -extern void harnessTesting(char_t *msg, ...); -extern void harnessPassed(); -extern void harnessFailed(int line); -extern int harnessLevel(); - -#endif /* _h_UEMF */ - -/******************************************************************************/ diff --git a/cpukit/httpd/um.c b/cpukit/httpd/um.c deleted file mode 100644 index ce9e171c01..0000000000 --- a/cpukit/httpd/um.c +++ /dev/null @@ -1,1415 +0,0 @@ -/* - * um.c -- User Management - * - * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved. - * - * See the file "license.txt" for usage and redistribution license requirements - * - * $Id$ - */ - -/******************************** Description *********************************/ -/* - * User Management routines for adding/deleting/changing users and groups - * Also, routines for determining user access - */ - -/********************************* Includes ***********************************/ - -#include "um.h" -#include "emfdb.h" -#include "webs.h" - -/********************************** Defines ***********************************/ - -#define UM_DB_FILENAME T("um.xml") -#define UM_TXT_FILENAME T("umconfig.txt") - -/* - * Table names - */ -#define UM_USER_TABLENAME T("users") -#define UM_GROUP_TABLENAME T("groups") -#define UM_ACCESS_TABLENAME T("access") - -/* - * Column names - */ -#define UM_NAME T("name") -#define UM_PASS T("password") -#define UM_GROUP T("group") -#define UM_PROT T("prot") -#define UM_DISABLE T("disable") -#define UM_METHOD T("method") -#define UM_PRIVILEGE T("priv") -#define UM_SECURE T("secure") - -/* - * XOR encryption mask - * Note: This string should be modified for individual sites - * in order to enhance user password security. - */ -#define UM_XOR_ENCRYPT T("*j7a(L#yZ98sSd5HfSgGjMj8;Ss;d)(*&^#@$a2s0i3g") - -/******************************** Local Data **********************************/ - -#ifdef UEMF -/* - * User table definition - */ -#define NUMBER_OF_USER_COLUMNS 5 - -char_t *userColumnNames[NUMBER_OF_USER_COLUMNS] = { - UM_NAME, UM_PASS, UM_GROUP, UM_PROT, UM_DISABLE -}; - -int userColumnTypes[NUMBER_OF_USER_COLUMNS] = { - T_STRING, T_STRING, T_STRING, T_INT, T_INT -}; - -dbTable_t userTable = { - UM_USER_TABLENAME, - NUMBER_OF_USER_COLUMNS, - userColumnNames, - userColumnTypes, - 0, - NULL -}; - -/* - * Group table definition - */ -#define NUMBER_OF_GROUP_COLUMNS 5 - -char_t *groupColumnNames[NUMBER_OF_GROUP_COLUMNS] = { - UM_NAME, UM_PRIVILEGE, UM_METHOD, UM_PROT, UM_DISABLE -}; - -int groupColumnTypes[NUMBER_OF_GROUP_COLUMNS] = { - T_STRING, T_INT, T_INT, T_INT, T_INT -}; - -dbTable_t groupTable = { - UM_GROUP_TABLENAME, - NUMBER_OF_GROUP_COLUMNS, - groupColumnNames, - groupColumnTypes, - 0, - NULL -}; - -/* - * Access Limit table definition - */ -#define NUMBER_OF_ACCESS_COLUMNS 4 - -char_t *accessColumnNames[NUMBER_OF_ACCESS_COLUMNS] = { - UM_NAME, UM_METHOD, UM_SECURE, UM_GROUP -}; - -int accessColumnTypes[NUMBER_OF_ACCESS_COLUMNS] = { - T_STRING, T_INT, T_INT, T_STRING -}; - -dbTable_t accessTable = { - UM_ACCESS_TABLENAME, - NUMBER_OF_ACCESS_COLUMNS, - accessColumnNames, - accessColumnTypes, - 0, - NULL -}; -#endif /* #ifdef UEMF */ - -/* - * Database Identifier returned from dbOpen() - */ -static int didUM = -1; - -/* - * Configuration database persist filename - */ -static char_t *saveFilename = NULL; - -static int umOpenCount = 0; /* count of apps using this module */ - -/*************************** Forward Declarations *****************************/ - -static bool_t umCheckName(char_t *name); - -/*********************************** Code *************************************/ -/* - * umOpen() registers the UM tables in the fake emf-database - */ - -int umOpen() -{ - if (++umOpenCount != 1) { - return didUM; - } -/* - * Do not initialize if intialization has already taken place - */ - if (didUM == -1) { - didUM = dbOpen(UM_USER_TABLENAME, UM_DB_FILENAME, NULL, 0); -#ifdef UEMF - dbRegisterDBSchema(&userTable); - dbRegisterDBSchema(&groupTable); - dbRegisterDBSchema(&accessTable); -#endif - } - - if (saveFilename == NULL) { - saveFilename = bstrdup(B_L, UM_TXT_FILENAME); - } - - return didUM; -} - -/******************************************************************************/ -/* - * umClose() frees up the UM tables in the fake emf-database - */ - -void umClose() -{ - if (--umOpenCount > 0) { - return; - } -/* - * Do not close if intialization has not taken place - */ - if (didUM != -1) { - dbClose(didUM); - didUM = -1; - } - - if (saveFilename != NULL) { - bfree(B_L, saveFilename); - saveFilename = NULL; - } -} - -/******************************************************************************/ -/* - * umCommit() persists all of the UM tables - */ - -int umCommit(char_t *filename) -{ - if (filename && *filename) { - if (saveFilename != NULL) { - bfree(B_L, saveFilename); - } - - saveFilename = bstrdup(B_L, filename); - } - - a_assert (saveFilename && *saveFilename); - trace(3, T("UM: Writing User Configuration to file <%s>\n"), - saveFilename); - - return dbSave(didUM, saveFilename, 0); -} - -/******************************************************************************/ -/* - * umRestore() loads up the UM tables with persisted data - */ - -int umRestore(char_t *filename) -{ - if (filename && *filename) { - if (saveFilename != NULL) { - bfree(B_L, saveFilename); - } - - saveFilename = bstrdup(B_L, filename); - } - - a_assert(saveFilename && *saveFilename); - - trace(3, T("UM: Loading User Configuration from file <%s>\n"), - saveFilename); - -/* - * First empty the database, otherwise we wind up with duplicates! - */ - dbZero(didUM); - return dbLoad(didUM, saveFilename, 0); -} - -/******************************************************************************/ -/* - * Encrypt/Decrypt a text string. - * Returns the number of characters encrypted. - */ - -static int umEncryptString(char_t *textString) -{ - char_t *enMask; - char_t enChar; - int numChars; - - a_assert(textString); - - enMask = UM_XOR_ENCRYPT; - numChars = 0; - - while (*textString) { - enChar = *textString ^ *enMask; -/* - * Do not produce encrypted text with embedded linefeeds or tabs. - * Simply use existing character. - */ - if (enChar && !gisspace(enChar)) - *textString = enChar; -/* - * Increment all pointers. - */ - enMask++; - textString++; - numChars++; -/* - * Wrap encryption mask pointer if at end of length. - */ - if (*enMask == '\0') { - enMask = UM_XOR_ENCRYPT; - } - } - - return numChars; -} - -/******************************************************************************/ -/* - * umGetFirstRowData() - return a pointer to the first non-blank key value - * in the given column for the given table. - */ - -static char_t *umGetFirstRowData(char_t *tableName, char_t *columnName) -{ - char_t *columnData; - int row; - int check; - - a_assert(tableName && *tableName); - a_assert(columnName && *columnName); - - row = 0; -/* - * Move through table until we retrieve the first row with non-null - * column data. - */ - columnData = NULL; - while ((check = dbReadStr(didUM, tableName, columnName, row++, - &columnData)) == 0 || (check == DB_ERR_ROW_DELETED)) { - if (columnData && *columnData) { - return columnData; - } - } - - return NULL; -} - -/******************************************************************************/ -/* - * umGetNextRowData() - return a pointer to the first non-blank - * key value following the given one. - */ - -static char_t *umGetNextRowData(char_t *tableName, char_t *columnName, - char_t *keyLast) -{ - char_t *key; - int row; - int check; - - a_assert(tableName && *tableName); - a_assert(columnName && *columnName); - a_assert(keyLast && *keyLast); -/* - * Position row counter to row where the given key value was found - */ - row = 0; - key = NULL; - - while ((((check = dbReadStr(didUM, tableName, columnName, row++, - &key)) == 0) || (check == DB_ERR_ROW_DELETED)) && - ((key == NULL) || (gstrcmp(key, keyLast) != 0))) { - } -/* - * If the last key value was not found, return NULL - */ - if (!key || gstrcmp(key, keyLast) != 0) { - return NULL; - } -/* - * Move through table until we retrieve the next row with a non-null key - */ - while (((check = dbReadStr(didUM, tableName, columnName, row++, &key)) - == 0) || (check == DB_ERR_ROW_DELETED)) { - if (key && *key && (gstrcmp(key, keyLast) != 0)) { - return key; - } - } - - return NULL; -} - -/******************************************************************************/ -/* - * umAddUser() - Adds a user to the "users" table. - */ - -int umAddUser(char_t *user, char_t *pass, char_t *group, - bool_t prot, bool_t disabled) -{ - int row; - char_t *password; - - a_assert(user && *user); - a_assert(pass && *pass); - a_assert(group && *group); - - trace(3, T("UM: Adding User <%s>\n"), user); - -/* - * Do not allow duplicates - */ - if (umUserExists(user)) { - return UM_ERR_DUPLICATE; - } - -/* - * Make sure user name and password contain valid characters - */ - if (!umCheckName(user)) { - return UM_ERR_BAD_NAME; - } - - if (!umCheckName(pass)) { - return UM_ERR_BAD_PASSWORD; - } - -/* - * Make sure group exists - */ - if (!umGroupExists(group)) { - return UM_ERR_NOT_FOUND; - } - -/* - * Now create the user record - */ - row = dbAddRow(didUM, UM_USER_TABLENAME); - - if (row < 0) { - return UM_ERR_GENERAL; - } - - if (dbWriteStr(didUM, UM_USER_TABLENAME, UM_NAME, row, user) != 0) { - return UM_ERR_GENERAL; - } - - password = bstrdup(B_L, pass); - umEncryptString(password); - dbWriteStr(didUM, UM_USER_TABLENAME, UM_PASS, row, password); - bfree(B_L, password); - dbWriteStr(didUM, UM_USER_TABLENAME, UM_GROUP, row, group); - dbWriteInt(didUM, UM_USER_TABLENAME, UM_PROT, row, prot); - dbWriteInt(didUM, UM_USER_TABLENAME, UM_DISABLE, row, disabled); - - return 0; -} - -/******************************************************************************/ -/* - * umDeleteUser() - remove a user from the "users" table - */ - -int umDeleteUser(char_t *user) -{ - int row; - - a_assert(user && *user); - trace(3, T("UM: Deleting User <%s>\n"), user); -/* - * Check to see if user is delete-protected - */ - if (umGetUserProtected(user)) { - return UM_ERR_PROTECTED; - } - -/* - * If found, delete the user from the database - */ - if ((row = dbSearchStr(didUM, UM_USER_TABLENAME, UM_NAME, user, 0)) >= 0) { - return dbDeleteRow(didUM, UM_USER_TABLENAME, row); - } - - return UM_ERR_NOT_FOUND; -} - -/******************************************************************************/ -/* - * umGetFirstUser() - Returns the user ID of the first user found in the - * "users" table. - */ - -char_t *umGetFirstUser() -{ - return umGetFirstRowData(UM_USER_TABLENAME, UM_NAME); -} - -/******************************************************************************/ -/* - * umGetNextUser() Returns the next user found in the "users" table after - * the given user. - */ - -char_t *umGetNextUser(char_t *userLast) -{ - return umGetNextRowData(UM_USER_TABLENAME, UM_NAME, userLast); -} - -/******************************************************************************/ -/* - * umUserExists() Returns TRUE if userid exists. - */ - -bool_t umUserExists(char_t *user) -{ - a_assert(user && *user); - - if (dbSearchStr(didUM, UM_USER_TABLENAME, UM_NAME, user, 0) >= 0) { - return TRUE; - } else { - return FALSE; - } -} - -/******************************************************************************/ -/* - * umGetUserPassword() returns a de-crypted copy of the user password - */ - -char_t *umGetUserPassword(char_t *user) -{ - char_t *password; - int row; - - a_assert(user && *user); - - password = NULL; - row = dbSearchStr(didUM, UM_USER_TABLENAME, UM_NAME, user, 0); - - if (row >= 0) { - char_t *pass = NULL; - dbReadStr(didUM, UM_USER_TABLENAME, UM_PASS, row, &pass); -/* - * Decrypt password - * Note, this function returns a copy of the password, which must - * be deleted at some time in the future. - */ - password = bstrdup(B_L, pass); - umEncryptString(password); - } - - return password; -} - -/******************************************************************************/ -/* - * umSetUserPassword() updates the user password in the user "table" after - * encrypting the given password - */ - -int umSetUserPassword(char_t *user, char_t *pass) -{ - int row, nRet; - char_t *password; - - a_assert(user && *user); - a_assert(pass && *pass); - trace(3, T("UM: Attempting to change the password for user <%s>\n"), user); -/* - * Find the row of the user - */ - if ((row = dbSearchStr(didUM, UM_USER_TABLENAME, UM_NAME, user, 0)) < 0) { - return UM_ERR_NOT_FOUND; - } - - password = bstrdup(B_L, pass); - umEncryptString(password); - nRet = dbWriteStr(didUM, UM_USER_TABLENAME, UM_PASS, row, password); - bfree(B_L, password); - - return nRet; -} - -/******************************************************************************/ -/* - * umGetUserGroup() returns the name of the user group - */ - -char_t *umGetUserGroup(char_t *user) -{ - char_t *group; - int row; - - a_assert(user && *user); - group = NULL; -/* - * Find the row of the user - */ - row = dbSearchStr(didUM, UM_USER_TABLENAME, UM_NAME, user, 0); - - if (row >= 0) { - dbReadStr(didUM, UM_USER_TABLENAME, UM_GROUP, row, &group); - } - - return group; -} - -/******************************************************************************/ -/* - * umSetUserGroup() Sets the name of the user group for the user - */ - -int umSetUserGroup(char_t *user, char_t *group) -{ - int row; - - a_assert(user && *user); - a_assert(group && *group); -/* - * Find the row of the user - */ - row = dbSearchStr(didUM, UM_USER_TABLENAME, UM_NAME, user, 0); - - if (row >= 0) { - return dbWriteStr(didUM, UM_USER_TABLENAME, UM_GROUP, row, group); - } else { - return UM_ERR_NOT_FOUND; - } -} - -/******************************************************************************/ -/* - * umGetUserEnabled() - returns if the user is enabled - * Returns FALSE if the user is not found. - */ - -bool_t umGetUserEnabled(char_t *user) -{ - int disabled, row; - - a_assert(user && *user); - - disabled = 1; -/* - * Find the row of the user - */ - row = dbSearchStr(didUM, UM_USER_TABLENAME, UM_NAME, user, 0); - - if (row >= 0) { - dbReadInt(didUM, UM_USER_TABLENAME, UM_DISABLE, row, &disabled); - } - - return (bool_t)!disabled; -} - -/******************************************************************************/ -/* - * umSetUserEnabled() Enables/disables the user - */ -int umSetUserEnabled(char_t *user, bool_t enabled) -{ - int row; - - a_assert(user && *user); -/* - * Find the row of the user - */ - row = dbSearchStr(didUM, UM_USER_TABLENAME, UM_NAME, user, 0); - if (row >= 0) { - return dbWriteInt(didUM, UM_USER_TABLENAME, UM_DISABLE, row, !enabled); - } else { - return UM_ERR_NOT_FOUND; - } -} - -/******************************************************************************/ -/* - * umGetUserProtected() - determine deletability of user - */ - -bool_t umGetUserProtected(char_t *user) -{ - int protect, row; - - a_assert(user && *user); -/* - * Find the row of the user - */ - row = dbSearchStr(didUM, UM_USER_TABLENAME, UM_NAME, user, 0); - protect = FALSE; - - if (row >= 0) { - dbReadInt(didUM, UM_USER_TABLENAME, UM_PROT, row, &protect); - } - - return (bool_t)protect; -} - -/******************************************************************************/ -/* - * umSetUserProtected() sets the delete protection for the user - */ -int umSetUserProtected(char_t *user, bool_t protect) -{ - int row; - - a_assert(user && *user); -/* - * Find the row of the user - */ - row = dbSearchStr(didUM, UM_USER_TABLENAME, UM_NAME, user, 0); - - if (row >= 0) { - return dbWriteInt(didUM, UM_USER_TABLENAME, UM_PROT, row, protect); - } else { - return UM_ERR_NOT_FOUND; - } -} - - -/******************************************************************************/ -/* - * umAddGroup() adds a group to the "Group" table - */ - -int umAddGroup(char_t *group, short priv, accessMeth_t am, - bool_t prot, bool_t disabled) -{ - int row; - - a_assert(group && *group); - trace(3, T("UM: Adding group <%s>\n"), group); - -/* - * Do not allow duplicates - */ - if (umGroupExists(group)) { - return UM_ERR_DUPLICATE; - } - -/* - * Only allow valid characters in key field - */ - if (!umCheckName(group)) { - return UM_ERR_BAD_NAME; - } - -/* - * Add a new row to the table - */ - if ((row = dbAddRow(didUM, UM_GROUP_TABLENAME)) < 0) { - return UM_ERR_GENERAL; - } - -/* - * Write the key field - */ - if (dbWriteStr(didUM, UM_GROUP_TABLENAME, UM_NAME, row, group) != 0) { - return UM_ERR_GENERAL; - } - -/* - * Write the remaining fields - */ - dbWriteInt(didUM, UM_GROUP_TABLENAME, UM_PRIVILEGE, row, priv); - dbWriteInt(didUM, UM_GROUP_TABLENAME, UM_METHOD, row, (int) am); - dbWriteInt(didUM, UM_GROUP_TABLENAME, UM_PROT, row, prot); - dbWriteInt(didUM, UM_GROUP_TABLENAME, UM_DISABLE, row, disabled); - - return 0; -} - -/******************************************************************************/ -/* - * umDeleteGroup() - Delete a user group, if not protected - */ - -int umDeleteGroup(char_t *group) -{ - int row; - - a_assert(group && *group); - trace(3, T("UM: Deleting Group <%s>\n"), group); - -/* - * Check to see if the group is in use - */ - if (umGetGroupInUse(group)) { - return UM_ERR_IN_USE; - } - -/* - * Check to see if the group is delete-protected - */ - if (umGetGroupProtected(group)) { - return UM_ERR_PROTECTED; - } - -/* - * Find the row of the group to delete - */ - if ((row = dbSearchStr(didUM, UM_GROUP_TABLENAME, UM_NAME, group, 0)) < 0) { - return UM_ERR_NOT_FOUND; - } - - return dbDeleteRow(didUM, UM_GROUP_TABLENAME, row); -} - -/******************************************************************************/ -/* - * umGroupExists() returns TRUE if group exists, FALSE otherwise - */ - -bool_t umGroupExists(char_t *group) -{ - a_assert(group && *group); - - if (dbSearchStr(didUM, UM_GROUP_TABLENAME, UM_NAME, group, 0) >= 0) { - return TRUE; - } else { - return FALSE; - } -} - - -/******************************************************************************/ -/* - * umGetGroupInUse() returns TRUE if the group is referenced by a user or by - * an access limit. - */ - -bool_t umGetGroupInUse(char_t *group) -{ - a_assert(group && *group); - -/* - * First, check the user table - */ - if (dbSearchStr(didUM, UM_USER_TABLENAME, UM_GROUP, group, 0) >= 0) { - return TRUE; - } - -/* - * Second, check the access limit table - */ - if (dbSearchStr(didUM, UM_ACCESS_TABLENAME, UM_GROUP, group, 0) >= 0) { - return TRUE; - } - - return FALSE; -} - - -/******************************************************************************/ -/* - * umGetFirstGroup() - return a pointer to the first non-blank group name - */ - -char_t *umGetFirstGroup() -{ - return umGetFirstRowData(UM_GROUP_TABLENAME, UM_NAME); -} - -/******************************************************************************/ -/* - * umGetNextGroup() - return a pointer to the first non-blank group name - * following the given group name - */ - -char_t *umGetNextGroup(char_t *groupLast) -{ - return umGetNextRowData(UM_GROUP_TABLENAME, UM_NAME, groupLast); -} - -/******************************************************************************/ -/* - * Returns the default access method to use for a given group - */ - -accessMeth_t umGetGroupAccessMethod(char_t *group) -{ - int am, row; - - a_assert(group && *group); - row = dbSearchStr(didUM, UM_GROUP_TABLENAME, UM_NAME, group, 0); - - if (row >= 0) { - dbReadInt(didUM, UM_GROUP_TABLENAME, UM_METHOD, row, (int *)&am); - } else { - am = AM_INVALID; - } - - return (accessMeth_t) am; -} - -/******************************************************************************/ -/* - * Set the default access method to use for a given group - */ - -int umSetGroupAccessMethod(char_t *group, accessMeth_t am) -{ - int row; - - a_assert(group && *group); - row = dbSearchStr(didUM, UM_GROUP_TABLENAME, UM_NAME, group, 0); - - if (row >= 0) { - return dbWriteInt(didUM, UM_GROUP_TABLENAME, UM_METHOD, row, (int) am); - } else { - return UM_ERR_NOT_FOUND; - } -} - -/******************************************************************************/ -/* - * Returns the privilege mask for a given group - */ - -short umGetGroupPrivilege(char_t *group) -{ - int privilege, row; - - a_assert(group && *group); - privilege = -1; - row = dbSearchStr(didUM, UM_GROUP_TABLENAME, UM_NAME, group, 0); - - if (row >= 0) { - dbReadInt(didUM, UM_GROUP_TABLENAME, UM_PRIVILEGE, row, &privilege); - } - - return (short) privilege; -} - -/******************************************************************************/ -/* - * Set the privilege mask for a given group - */ - -int umSetGroupPrivilege(char_t *group, short privilege) -{ - int row; - - a_assert(group && *group); - row = dbSearchStr(didUM, UM_GROUP_TABLENAME, UM_NAME, group, 0); - - if (row >= 0) { - return dbWriteInt(didUM, UM_GROUP_TABLENAME, UM_PRIVILEGE, row, - (int)privilege); - } else { - return UM_ERR_NOT_FOUND; - } -} - -/******************************************************************************/ -/* - * Returns the enabled setting for a given group. - * Returns FALSE if group is not found. - */ - -bool_t umGetGroupEnabled(char_t *group) -{ - int disabled, row; - - a_assert(group && *group); - row = dbSearchStr(didUM, UM_GROUP_TABLENAME, UM_NAME, group, 0); - disabled = 1; - - if (row >= 0) { - dbReadInt(didUM, UM_GROUP_TABLENAME, UM_DISABLE, row, &disabled); - } - - return (bool_t) !disabled; -} - -/******************************************************************************/ -/* - * Sets the enabled setting for a given group. - */ - -int umSetGroupEnabled(char_t *group, bool_t enabled) -{ - int row; - - a_assert(group && *group); - row = dbSearchStr(didUM, UM_GROUP_TABLENAME, UM_NAME, group, 0); - - if (row >= 0) { - return dbWriteInt(didUM, UM_GROUP_TABLENAME, UM_DISABLE, row, - (int) !enabled); - } else { - return UM_ERR_NOT_FOUND; - } -} - -/******************************************************************************/ -/* - * Returns the protected setting for a given group - * Returns FALSE if user is not found - */ - -bool_t umGetGroupProtected(char_t *group) -{ - int protect, row; - - a_assert(group && *group); - - protect = 0; - row = dbSearchStr(didUM, UM_GROUP_TABLENAME, UM_NAME, group, 0); - if (row >= 0) { - dbReadInt(didUM, UM_GROUP_TABLENAME, UM_PROT, row, &protect); - } - - return (bool_t) protect; -} - -/******************************************************************************/ -/* - * Sets the protected setting for a given group - */ - -int umSetGroupProtected(char_t *group, bool_t protect) -{ - int row; - - a_assert(group && *group); - row = dbSearchStr(didUM, UM_GROUP_TABLENAME, UM_NAME, group, 0); - - if (row >= 0) { - return dbWriteInt(didUM, UM_GROUP_TABLENAME, UM_PROT, row, - (int) protect); - } else { - return UM_ERR_NOT_FOUND; - } -} - - -/******************************************************************************/ -/* - * umAddAccessLimit() adds an access limit to the "access" table - */ - -int umAddAccessLimit(char_t *url, accessMeth_t am, short secure, char_t *group) -{ - int row; - - a_assert(url && *url); - trace(3, T("UM: Adding Access Limit for <%s>\n"), url); - -/* - * Do not allow duplicates - */ - if (umAccessLimitExists(url)) { - return UM_ERR_DUPLICATE; - } - -/* - * Add a new row to the table - */ - if ((row = dbAddRow(didUM, UM_ACCESS_TABLENAME)) < 0) { - return UM_ERR_GENERAL; - } - -/* - * Write the key field - */ - if(dbWriteStr(didUM, UM_ACCESS_TABLENAME, UM_NAME, row, url) < 0) { - return UM_ERR_GENERAL; - } - -/* - * Write the remaining fields - */ - dbWriteInt(didUM, UM_ACCESS_TABLENAME, UM_METHOD, row, (int)am); - dbWriteInt(didUM, UM_ACCESS_TABLENAME, UM_SECURE, row, (int)secure); - dbWriteStr(didUM, UM_ACCESS_TABLENAME, UM_GROUP, row, group); - - return 0; -} - -/******************************************************************************/ -/* - * umDeleteAccessLimit() - */ - -int umDeleteAccessLimit(char_t *url) -{ - int row; - - a_assert(url && *url); - trace(3, T("UM: Deleting Access Limit for <%s>\n"), url); -/* - * Find the row of the access limit to delete - */ - if ((row = dbSearchStr(didUM, UM_ACCESS_TABLENAME, UM_NAME, url, 0)) < 0) { - return UM_ERR_NOT_FOUND; - } - - return dbDeleteRow(didUM, UM_ACCESS_TABLENAME, row); -} - -/******************************************************************************/ -/* - * umGetFirstGroup() - return a pointer to the first non-blank access limit - */ - -char_t *umGetFirstAccessLimit() -{ - return umGetFirstRowData(UM_ACCESS_TABLENAME, UM_NAME); -} - -/******************************************************************************/ -/* - * umGetNextAccessLimit() - return a pointer to the first non-blank - * access limit following the given one - */ - -char_t *umGetNextAccessLimit(char_t *urlLast) -{ - return umGetNextRowData(UM_ACCESS_TABLENAME, UM_NAME, urlLast); -} - -/******************************************************************************/ -/* - * umAccessLimitExists() returns TRUE if this access limit exists - */ - -bool_t umAccessLimitExists(char_t *url) -{ - a_assert(url && *url); - - if (dbSearchStr(didUM, UM_ACCESS_TABLENAME, UM_NAME, url, 0) < 0) { - return FALSE; - } else { - return TRUE; - } -} - -/******************************************************************************/ -/* - * umGetAccessLimit() returns the Access Method for the URL - */ - -accessMeth_t umGetAccessLimitMethod(char_t *url) -{ - int am, row; - - am = (int) AM_INVALID; - row = dbSearchStr(didUM, UM_ACCESS_TABLENAME, UM_NAME, url, 0); - - if (row >= 0) { - dbReadInt(didUM, UM_ACCESS_TABLENAME, UM_METHOD, row, &am); - } - - return (accessMeth_t) am; -} - -/******************************************************************************/ -/* - * umSetAccessLimitMethod() - set Access Method for Access Limit - */ - -int umSetAccessLimitMethod(char_t *url, accessMeth_t am) -{ - int row; - - a_assert(url && *url); - row = dbSearchStr(didUM, UM_ACCESS_TABLENAME, UM_NAME, url, 0); - - if (row >= 0) { - return dbWriteInt(didUM, UM_ACCESS_TABLENAME, UM_METHOD, row, (int) am); - } else { - return UM_ERR_NOT_FOUND; - } -} - -/******************************************************************************/ -/* - * umGetAccessLimitSecure() - returns secure switch for access limit - */ - -short umGetAccessLimitSecure(char_t *url) -{ - int secure, row; - - a_assert(url && *url); - secure = -1; - row = dbSearchStr(didUM, UM_ACCESS_TABLENAME, UM_NAME, url, 0); - - if (row >= 0) { - dbReadInt(didUM, UM_ACCESS_TABLENAME, UM_SECURE, row, &secure); - } - - return (short)secure; -} - -/******************************************************************************/ -/* - * umSetAccessLimitSecure() - sets the secure flag for the URL - */ - -int umSetAccessLimitSecure(char_t *url, short secure) -{ - int row; - - a_assert(url && *url); - row = dbSearchStr(didUM, UM_ACCESS_TABLENAME, UM_NAME, url, 0); - - if (row >= 0) { - return dbWriteInt(didUM, UM_ACCESS_TABLENAME, UM_SECURE, row, - (int)secure); - } else { - return UM_ERR_NOT_FOUND; - } -} - -/******************************************************************************/ -/* - * umGetAccessLimitGroup() - returns the user group of the access limit - */ - -char_t *umGetAccessLimitGroup(char_t *url) -{ - char_t *group; - int row; - - a_assert(url && *url); - group = NULL; - row = dbSearchStr(didUM, UM_ACCESS_TABLENAME, UM_NAME, url, 0); - - if (row >= 0) { - dbReadStr(didUM, UM_ACCESS_TABLENAME, UM_GROUP, row, &group); - } - - return group; -} - -/******************************************************************************/ -/* - * umSetAccessLimitGroup() - sets the user group for the access limit. - */ - -int umSetAccessLimitGroup(char_t *url, char_t *group) -{ - int row; - - a_assert(url && *url); - row = dbSearchStr(didUM, UM_ACCESS_TABLENAME, UM_NAME, url, 0); - - if (row >= 0) { - return dbWriteStr(didUM, UM_ACCESS_TABLENAME, UM_GROUP, row, group); - } else { - return UM_ERR_NOT_FOUND; - } -} - -/******************************************************************************/ -/* - * Returns the access limit to use for a given URL, by checking for URLs up - * the directory tree. Creates a new string that must be deleted. - */ - -char_t *umGetAccessLimit(char_t *url) -{ - char_t *urlRet, *urlCheck, *lastChar; - int len; - - a_assert(url && *url); - urlRet = NULL; - urlCheck = bstrdup(B_L, url); - a_assert(urlCheck); - len = gstrlen(urlCheck); -/* - * Scan back through URL to see if there is a "parent" access limit - */ - while (len && !urlRet) { - if (umAccessLimitExists(urlCheck)) { - urlRet = bstrdup(B_L, urlCheck); - } else { -/* - * Trim the end portion of the URL to the previous directory marker - */ - lastChar = urlCheck + len; - lastChar--; - - while ((lastChar >= urlCheck) && ((*lastChar == '/') || - (*lastChar == '\\'))) { - *lastChar = 0; - lastChar--; - } - - while ((lastChar >= urlCheck) && (*lastChar != '/') && - (*lastChar != '\\')) { - *lastChar = 0; - lastChar--; - } - - len = gstrlen(urlCheck); - } - } - bfree (B_L, urlCheck); - - return urlRet; -} - -/******************************************************************************/ -/* - * Returns the access method to use for a given URL - */ - -accessMeth_t umGetAccessMethodForURL(char_t *url) -{ - accessMeth_t amRet; - char_t *urlHavingLimit, *group; - - urlHavingLimit = umGetAccessLimit(url); - if (urlHavingLimit) { - group = umGetAccessLimitGroup(urlHavingLimit); - - if (group && *group) { - amRet = umGetGroupAccessMethod(group); - } else { - amRet = umGetAccessLimitMethod(urlHavingLimit); - } - - bfree(B_L, urlHavingLimit); - } else { - amRet = AM_FULL; - } - - return amRet; -} - -/******************************************************************************/ -/* - * Returns TRUE if user can access URL - */ - -bool_t umUserCanAccessURL(char_t *user, char_t *url) -{ - accessMeth_t amURL; - char_t *group, *usergroup, *urlHavingLimit; - short priv; - - a_assert(user && *user); - a_assert(url && *url); - -/* - * Make sure user exists - */ - if (!umUserExists(user)) { - return FALSE; - } - -/* - * Make sure user is enabled - */ - if (!umGetUserEnabled(user)) { - return FALSE; - } - -/* - * Make sure user has sufficient privileges (any will do) - */ - usergroup = umGetUserGroup(user); - priv = umGetGroupPrivilege(usergroup); - if (priv == 0) { - return FALSE; - } - -/* - * Make sure user's group is enabled - */ - if (!umGetGroupEnabled(usergroup)) { - return FALSE; - } - -/* - * The access method of the user group must not be AM_NONE - */ - if (umGetGroupAccessMethod(usergroup) == AM_NONE) { - return FALSE; - } - -/* - * Check to see if there is an Access Limit for this URL - */ - urlHavingLimit = umGetAccessLimit(url); - if (urlHavingLimit) { - amURL = umGetAccessLimitMethod(urlHavingLimit); - group = umGetAccessLimitGroup(urlHavingLimit); - bfree(B_L, urlHavingLimit); - } else { -/* - * If there isn't an access limit for the URL, user has full access - */ - return TRUE; - } - -/* - * If the access method for the URL is AM_NONE then - * the file "doesn't exist". - */ - if (amURL == AM_NONE) { - return FALSE; - } - -/* - * If Access Limit has a group specified, then the user must be a - * member of that group - */ - if (group && *group) { - if (usergroup && (gstrcmp(group, usergroup) != 0)) { - return FALSE; - } - } - -/* - * Otherwise, user can access the URL - */ - return TRUE; -} - -/******************************************************************************/ -/* - * Returns TRUE if given name has only valid chars - */ - -static bool_t umCheckName(char_t *name) -{ - a_assert(name && *name); - - if (name && *name) { - while (*name) { - if (gisspace(*name)) { - return FALSE; - } - - name++; - } - - return TRUE; - } - - return FALSE; -} - -/******************************************************************************/ diff --git a/cpukit/httpd/um.h b/cpukit/httpd/um.h deleted file mode 100644 index d44fa28e91..0000000000 --- a/cpukit/httpd/um.h +++ /dev/null @@ -1,184 +0,0 @@ -/* - * um.h -- GoAhead User Management public header - * - * Copyright (c) GoAhead Software Inc., 1992-2000. All Rights Reserved. - * - * See the file "license.txt" for information on usage and redistribution - * - * $Id$ - */ - -#ifndef _h_UM -#define _h_UM 1 - -/******************************** Description *********************************/ - -/* - * GoAhead User Management header. This defines the User Management - * public APIs. Include this header for files that contain access to - * user inquiry or management. - */ - -/********************************* Includes ***********************************/ - -#if ! UEMF - #include "basic/basic.h" - #include "emf/emf.h" -#else - #include "uemf.h" -#endif - -/********************************** Defines ***********************************/ - -/* - * Error Return Flags - */ -#define UM_OK 0 -#define UM_ERR_GENERAL -1 -#define UM_ERR_NOT_FOUND -2 -#define UM_ERR_PROTECTED -3 -#define UM_ERR_DUPLICATE -4 -#define UM_ERR_IN_USE -5 -#define UM_ERR_BAD_NAME -6 -#define UM_ERR_BAD_PASSWORD -7 - -/* - * Privilege Masks - */ -#define PRIV_NONE 0x00 -#define PRIV_READ 0x01 -#define PRIV_WRITE 0x02 -#define PRIV_ADMIN 0x04 - -/* - * User classes - */ -typedef short bool_t; - -#ifndef TRUE -#define TRUE 1 -#endif - -#ifndef FALSE -#define FALSE 0 -#endif - -typedef enum { - AM_NONE = 0, - AM_FULL, - AM_BASIC, - AM_DIGEST, - AM_INVALID -} accessMeth_t; - -/********************************** Prototypes ********************************/ - -/* - * umOpen() must be called before accessing User Management functions - */ -extern int umOpen(); - -/* - * umClose() should be called before shutdown to free memory - */ -extern void umClose(); - -/* - * umCommit() persists the user management database - */ -extern int umCommit(char_t *filename); - -/* - * umRestore() loads the user management database - */ -extern int umRestore(char_t *filename); - -/* - * umUser functions use a user ID for a key - */ -extern int umAddUser(char_t *user, char_t *password, - char_t *group, bool_t protect, bool_t disabled); - -extern int umDeleteUser(char_t *user); - -extern char_t *umGetFirstUser(); -extern char_t *umGetNextUser(char_t *lastUser); - -extern bool_t umUserExists(char_t *user); - -extern char_t *umGetUserPassword(char_t *user); -extern int umSetUserPassword(char_t *user, char_t *password); - -extern char_t *umGetUserGroup(char_t *user); -extern int umSetUserGroup(char_t *user, char_t *password); - -extern bool_t umGetUserEnabled(char_t *user); -extern int umSetUserEnabled(char_t *user, bool_t enabled); - -extern bool_t umGetUserProtected(char_t *user); -extern int umSetUserProtected(char_t *user, bool_t protect); - -/* - * umGroup functions use a group name for a key - */ -extern int umAddGroup(char_t *group, short privilege, - accessMeth_t am, bool_t protect, bool_t disabled); - -extern int umDeleteGroup(char_t *group); - -extern char_t *umGetFirstGroup(); -extern char_t *umGetNextGroup(char_t *lastUser); - -extern bool_t umGroupExists(char_t *group); -extern bool_t umGetGroupInUse(char_t *group); - -extern accessMeth_t umGetGroupAccessMethod(char_t *group); -extern int umSetGroupAccessMethod(char_t *group, accessMeth_t am); - -extern bool_t umGetGroupEnabled(char_t *group); -extern int umSetGroupEnabled(char_t *group, bool_t enabled); - -extern short umGetGroupPrivilege(char_t *group); -extern int umSetGroupPrivilege(char_t *group, short privileges); - -extern bool_t umGetGroupProtected(char_t *group); -extern int umSetGroupProtected(char_t *group, bool_t protect); - -/* - * umAccessLimit functions use a URL as a key - */ -extern int umAddAccessLimit(char_t *url, accessMeth_t am, - short secure, char_t *group); - -extern int umDeleteAccessLimit(char_t *url); - -extern char_t *umGetFirstAccessLimit(); -extern char_t *umGetNextAccessLimit(char_t *lastUser); - -/* - * Returns the name of an ancestor access limit if - */ -extern char_t *umGetAccessLimit(char_t *url); - -extern bool_t umAccessLimitExists(char_t *url); - -extern accessMeth_t umGetAccessLimitMethod(char_t *url); -extern int umSetAccessLimitMethod(char_t *url, accessMeth_t am); - -extern short umGetAccessLimitSecure(char_t *url); -extern int umSetAccessLimitSecure(char_t *url, short secure); - -extern char_t *umGetAccessLimitGroup(char_t *url); -extern int umSetAccessLimitGroup(char_t *url, char_t *group); - -/* - * Convenience Functions - */ - -extern accessMeth_t umGetAccessMethodForURL(char_t *url); -extern bool_t umUserCanAccessURL(char_t *user, char_t *url); - -#endif /* _h_UM */ - -/******************************************************************************/ - diff --git a/cpukit/httpd/url.c b/cpukit/httpd/url.c deleted file mode 100644 index 0258387c59..0000000000 --- a/cpukit/httpd/url.c +++ /dev/null @@ -1,210 +0,0 @@ -/* - * url.c -- Parse URLs - * - * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved. - * - * See the file "license.txt" for usage and redistribution license requirements - */ - -/******************************** Description *********************************/ - -/* - * This module parses URLs into their components. - */ - -/********************************* Includes ***********************************/ - -#include "wsIntrn.h" - -/********************************* Statics ************************************/ -/* - * htmExt is declared in this way to avoid a Linux and Solaris segmentation - * fault when a constant string is passed to strlower which could change its - * argument. - */ - -char_t htmExt[] = T(".htm"); - - -/*********************************** Code *************************************/ -/* - * Return the mime type for the given URL given a URL. - * The caller supplies the buffer to hold the result. - * charCnt is the number of characters the buffer will hold, ascii or UNICODE. - */ - -char_t *websUrlType(char_t *url, char_t *buf, int charCnt) -{ - sym_t *sp; - char_t *ext, *parsebuf; - - a_assert(url && *url); - a_assert(buf && charCnt > 0); - - if (url == NULL || *url == '\0') { - gstrcpy(buf, T("text/plain")); - return buf; - } - if (websUrlParse(url, &parsebuf, NULL, NULL, NULL, NULL, NULL, - NULL, &ext) < 0) { - gstrcpy(buf, T("text/plain")); - return buf; - } - strlower(ext); - -/* - * Lookup the mime type symbol table to find the relevant content type - */ - if ((sp = symLookup(websMime, ext)) != NULL) { - gstrncpy(buf, sp->content.value.string, charCnt); - } else { - gstrcpy(buf, T("text/plain")); - } - bfree(B_L, parsebuf); - return buf; -} - -/******************************************************************************/ -/* - * Parse the URL. A buffer is allocated to store the parsed URL in *pbuf. - * This must be freed by the caller. NOTE: tag is not yet fully supported. - */ - -int websUrlParse(char_t *url, char_t **pbuf, char_t **phost, char_t **ppath, - char_t **pport, char_t **pquery, char_t **pproto, char_t **ptag, - char_t **pext) -{ - char_t *tok, *cp, *host, *path, *port, *proto, *tag, *query, *ext; - char_t *last_delim, *hostbuf, *portbuf, *buf; - int c, len, ulen; - - a_assert(url); - a_assert(pbuf); - - ulen = gstrlen(url); -/* - * We allocate enough to store separate hostname and port number fields. - * As there are 3 strings in the one buffer, we need room for 3 null chars. - * We allocate MAX_PORT_LEN char_t's for the port number. - */ - len = ulen * 2 + MAX_PORT_LEN + 3; - if ((buf = balloc(B_L, len * sizeof(char_t))) == NULL) { - return -1; - } - portbuf = &buf[len - MAX_PORT_LEN - 1]; - hostbuf = &buf[ulen+1]; - gstrcpy(buf, url); - url = buf; - -/* - * Convert the current listen port to a string. We use this if the URL has - * no explicit port setting - */ - stritoa(websGetPort(), portbuf, MAX_PORT_LEN); - port = portbuf; - path = T("/"); - proto = T("http"); - host = T("localhost"); - query = T(""); - ext = htmExt; - tag = T(""); - - if (gstrncmp(url, T("http://"), 7) == 0) { - tok = &url[7]; - tok[-3] = '\0'; - proto = url; - host = tok; - for (cp = tok; *cp; cp++) { - if (*cp == '/') { - break; - } - if (*cp == ':') { - *cp++ = '\0'; - port = cp; - tok = cp; - } - } - if ((cp = gstrchr(tok, '/')) != NULL) { -/* - * If a full URL is supplied, we need to copy the host and port - * portions into static buffers. - */ - c = *cp; - *cp = '\0'; - gstrncpy(hostbuf, host, ulen); - gstrncpy(portbuf, port, MAX_PORT_LEN); - *cp = c; - host = hostbuf; - port = portbuf; - path = cp; - tok = cp; - } - - } else { - path = url; - tok = url; - } - -/* - * Parse the query string - */ - if ((cp = gstrchr(tok, '?')) != NULL) { - *cp++ = '\0'; - query = cp; - path = tok; - tok = query; - } - -/* - * Parse the fragment identifier - */ - if ((cp = gstrchr(tok, '#')) != NULL) { - *cp++ = '\0'; - if (*query == 0) { - path = tok; - } - } - -/* - * Only do the following if asked for the extension - */ - if (pext) { - if ((cp = gstrrchr(path, '.')) != NULL) { - if ((last_delim = gstrrchr(path, '/')) != NULL) { - if (last_delim > cp) { - ext = htmExt; - } else { - ext = cp; - } - } else { - ext = cp; - } - } else { - if (path[gstrlen(path) - 1] == '/') { - ext = htmExt; - } - } - } - -/* - * Pass back the fields requested (if not NULL) - */ - if (phost) - *phost = host; - if (ppath) - *ppath = path; - if (pport) - *pport = port; - if (pproto) - *pproto = proto; - if (pquery) - *pquery = query; - if (ptag) - *ptag = tag; - if (pext) - *pext = ext; - *pbuf = buf; - return 0; -} - -/******************************************************************************/ diff --git a/cpukit/httpd/value.c b/cpukit/httpd/value.c deleted file mode 100644 index 97dba81633..0000000000 --- a/cpukit/httpd/value.c +++ /dev/null @@ -1,1211 +0,0 @@ -/* - * value.c -- Generic type (holds all types) - * - * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved. - */ - -/******************************** Description *********************************/ - -/* - * This module provides a generic type that can hold all possible types. - * It is designed to provide maximum effeciency. - */ - -/********************************* Includes ***********************************/ - -#if UEMF - #include "uemf.h" -#else - #include "basic/basicInternal.h" -#endif - -/*********************************** Locals ***********************************/ -#if !UEMF -static value_t value_null; /* All zeros */ - -/***************************** Forward Declarations ***************************/ - -static void coerce_types(value_t* v1, value_t* v2); -static int value_to_integer(value_t* vp); -#endif /*!UEMF*/ -/*********************************** Code *************************************/ -/* - * Initialize a integer value. - */ - -value_t valueInteger(long value) -{ - value_t v; - - memset(&v, 0x0, sizeof(v)); - v.valid = 1; - v.type = integer; - v.value.integer = value; - return v; -} - -/******************************************************************************/ -/* - * Initialize a string value. - */ - -value_t valueString(char_t* value, int flags) -{ - value_t v; - - memset(&v, 0x0, sizeof(v)); - v.valid = 1; - v.type = string; - if (flags & VALUE_ALLOCATE) { - v.allocated = 1; - v.value.string = gstrdup(B_L, value); - } else { - v.allocated = 0; - v.value.string = value; - } - return v; -} - -/******************************************************************************/ -/* - * Free any storage allocated for a value. - */ - -void valueFree(value_t* v) -{ - if (v->valid && v->allocated && v->type == string && - v->value.string != NULL) { - bfree(B_L, v->value.string); - } -#if !UEMF - if (v->valid && v->type == symbol && v->value.symbol.data != NULL && - v->value.symbol.freeCb !=NULL) { - v->value.symbol.freeCb(v->value.symbol.data); - } -#endif - v->type = undefined; - v->valid = 0; - v->allocated = 0; -} - -#if !UEMF - -/******************************************************************************/ -/* - * Initialize an invalid value. - */ - -value_t valueInvalid() -{ - value_t v; - v.valid = 0; - v.type = undefined; - return v; -} - -/******************************************************************************/ -/* - * Initialize a flag value. - */ - -value_t valueBool(int value) -{ - value_t v; - - memset(&v, 0x0, sizeof(v)); - v.type = flag; - v.valid = 1; - v.value.flag = (char) value; - return v; -} - -/******************************************************************************/ -/* - * Initialize a byteint value. - */ - -value_t valueByteint(char value) -{ - value_t v; - - memset(&v, 0x0, sizeof(v)); - v.valid = 1; - v.type = byteint; - v.value.byteint = value; - return v; -} - -/******************************************************************************/ -/* - * Initialize a shortint value. - */ - -value_t valueShortint(short value) -{ - value_t v; - - memset(&v, 0x0, sizeof(v)); - v.valid = 1; - v.type = shortint; - v.value.shortint = value; - return v; -} - -#if FLOATING_POINT_SUPPORT -/******************************************************************************/ -/* - * Initialize a floating value. - */ - -value_t valueFloating(double value) -{ - value_t v; - - memset(&v, 0x0, sizeof(v)); - v.valid = 1; - v.type = floating; - v.value.floating = value; - return v; -} -#endif /* FLOATING_POINT_SUPPORT */ - -/******************************************************************************/ -/* - * Initialize a big value. - */ - -value_t valueBig(long high_word, long low_word) -{ - value_t v; - - memset(&v, 0x0, sizeof(v)); - v.valid = 1; - v.type = big; - v.value.big[BLOW] = low_word; - v.value.big[BHIGH] = high_word; - return v; -} - -/******************************************************************************/ -/* - * Initialize a hex value. - */ - -value_t valueHex(int value) -{ - value_t v; - - memset(&v, 0x0, sizeof(v)); - v.valid = 1; - v.type = hex; - v.value.integer = value; - return v; -} - -/******************************************************************************/ -/* - * Initialize a octal value. - */ - -value_t valueOctal(int value) -{ - value_t v; - - memset(&v, 0x0, sizeof(v)); - v.valid = 1; - v.type = octal; - v.value.integer = value; - return v; -} - -/******************************************************************************/ -/* - * Initialize a percent value. - */ - -value_t valuePercent(int value) -{ - value_t v; - - memset(&v, 0x0, sizeof(v)); - v.valid = 1; - v.type = percent; - v.value.percent = (char) value; - return v; -} - -/******************************************************************************/ -/* - * Initialize an byte array. Note: no allocation, just store the ptr - */ - -value_t valueBytes(char* value, int flags) -{ - value_t v; - - memset(&v, 0x0, sizeof(v)); - v.valid = 1; - v.type = bytes; - if (flags & VALUE_ALLOCATE) { - v.allocated = 1; - v.value.bytes = bstrdupA(B_L, value); - } else { - v.allocated = 0; - v.value.bytes = value; - } - return v; -} - -/******************************************************************************/ -/* - * Initialize a symbol value. - * Value parameter can hold a pointer to any type of value - * Free parameter can be NULL, or a function pointer to a function that will - * free the value - */ - -value_t valueSymbol(void *value, freeCallback freeCb) -{ - value_t v; - - memset(&v, 0x0, sizeof(v)); - v.valid = 1; - v.type = symbol; - v.value.symbol.data = value; - v.value.symbol.freeCb = freeCb; - return v; -} - -/******************************************************************************/ -/* - * Initialize an error message value. - */ - -value_t valueErrmsg(char_t* value) -{ - value_t v; - - memset(&v, 0x0, sizeof(v)); - v.valid = 1; - v.type = errmsg; - v.value.errmsg = value; - return v; -} - -/******************************************************************************/ -/* - * Copy a value. If the type is 'string' then allocate another string. - * Note: we allow the copy of a null value. - */ - -value_t valueCopy(value_t v2) -{ - value_t v1; - - v1 = v2; - if (v2.valid && v2.type == string && v2.value.string != NULL) { - v1.value.string = gstrdup(B_L, v2.value.string); - v1.allocated = 1; - } - return v1; -} - - -/******************************************************************************/ -/* - * Add a value. - */ - -value_t valueAdd(value_t v1, value_t v2) -{ - value_t v; - - a_assert(v1.valid); - a_assert(v2.valid); - - memset(&v, 0x0, sizeof(v)); - v.valid = 1; - - if (v1.type != v2.type) - coerce_types(&v1, &v2); - - switch (v1.type) { - default: - case string: - case bytes: - a_assert(0); - break; - -#if FLOATING_POINT_SUPPORT - case floating: - v1.value.floating += v2.value.floating; - return v1; -#endif - - case flag: - v1.value.bool |= v2.value.flag; - return v1; - - case byteint: - case percent: - v1.value.byteint += v2.value.byteint; - return v1; - - case shortint: - v1.value.shortint += v2.value.shortint; - return v1; - - case hex: - case integer: - case octal: - v1.value.integer += v2.value.integer; - return v1; - - case big: - v.type = big; - badd(v.value.big, v1.value.big, v2.value.big); - return v; - } - - return v1; -} - - -/******************************************************************************/ -/* - * Subtract a value. - */ - -value_t valueSub(value_t v1, value_t v2) -{ - value_t v; - - a_assert(v1.valid); - a_assert(v2.valid); - - memset(&v, 0x0, sizeof(v)); - v.valid = 1; - - if (v1.type != v2.type) - coerce_types(&v1, &v2); - switch (v1.type) { - default: - a_assert(0); - break; - -#if FLOATING_POINT_SUPPORT - case floating: - v1.value.floating -= v2.value.floating; - return v1; -#endif - - case flag: - v1.value.flag &= v2.value.flag; - return v1; - - case byteint: - case percent: - v1.value.byteint -= v2.value.byteint; - return v1; - - case shortint: - v1.value.shortint -= v2.value.shortint; - return v1; - - case hex: - case integer: - case octal: - v1.value.integer -= v2.value.integer; - return v1; - - case big: - v.type = big; - bsub(v.value.big, v1.value.big, v2.value.big); - return v; - } - - return v1; -} - - -/******************************************************************************/ -/* - * Multiply a value. - */ - -value_t valueMul(value_t v1, value_t v2) -{ - value_t v; - - a_assert(v1.valid); - a_assert(v2.valid); - - memset(&v, 0x0, sizeof(v)); - v.valid = 1; - - if (v1.type != v2.type) - coerce_types(&v1, &v2); - switch (v1.type) { - default: - a_assert(0); - break; - - case flag: - a_assert(v1.type != flag); - break; - -#if FLOATING_POINT_SUPPORT - case floating: - v1.value.floating *= v2.value.floating; - return v1; -#endif - - case byteint: - case percent: - v1.value.byteint *= v2.value.byteint; - return v1; - - case shortint: - v1.value.shortint *= v2.value.shortint; - return v1; - - case hex: - case integer: - case octal: - v1.value.integer *= v2.value.integer; - return v1; - - case big: - v.type = big; - bmul(v.value.big, v1.value.big, v2.value.big); - return v; - } - - return v1; -} - - -/******************************************************************************/ -/* - * Divide a value. - */ - -value_t valueDiv(value_t v1, value_t v2) -{ - value_t v; - - a_assert(v1.valid); - a_assert(v2.valid); - - memset(&v, 0x0, sizeof(v)); - v.valid = 1; - - if (v1.type != v2.type) - coerce_types(&v1, &v2); - switch (v1.type) { - default: - a_assert(0); - break; - - case flag: - a_assert(v1.type != flag); - break; - -#if FLOATING_POINT_SUPPORT - case floating: - v1.value.floating /= v2.value.floating; - return v1; -#endif - - case byteint: - case percent: - v1.value.byteint /= v2.value.byteint; - return v1; - - case shortint: - v1.value.shortint /= v2.value.shortint; - return v1; - - case hex: - case integer: - case octal: - v1.value.integer /= v2.value.integer; - return v1; - - case big: - v.type = big; - bdiv(v.value.big, v1.value.big, v2.value.big); - return v; - } - - return v1; -} - - -/******************************************************************************/ -/* - * Compare a value. - */ - -int valueCmp(value_t v1, value_t v2) -{ - a_assert(v1.valid); - a_assert(v2.valid); - - if (v1.type != v2.type) - coerce_types(&v1, &v2); - if (v1.type != v2.type) { -/* - * Make v2 == v1 - */ - a_assert(v1.type == v2.type); - v2 = v1; - return 0; - } - switch (v1.type) { - case string: - if (v1.value.string == NULL && v2.value.string == NULL) { - return 0; - } else if (v1.value.string == NULL) { - return -1; - } else if (v2.value.string == NULL) { - return 1; - } else { - return gstrcmp(v1.value.string, v2.value.string); - } - /* Nobody here */ - - case flag: - if (v1.value.flag < v2.value.flag) - return -1; - else if (v1.value.flag == v2.value.flag) - return 0; - else return 1; - -#if FLOATING_POINT_SUPPORT - case floating: - if (v1.value.floating < v2.value.floating) - return -1; - else if (v1.value.floating == v2.value.floating) - return 0; - else return 1; -#endif - - case byteint: - case percent: - if (v1.value.byteint < v2.value.byteint) - return -1; - else if (v1.value.byteint == v2.value.byteint) - return 0; - else return 1; - - case shortint: - if (v1.value.shortint < v2.value.shortint) - return -1; - else if (v1.value.shortint == v2.value.shortint) - return 0; - else return 1; - - case hex: - case integer: - case octal: - if (v1.value.integer < v2.value.integer) - return -1; - else if (v1.value.integer == v2.value.integer) - return 0; - else return 1; - - case big: - return bcompare(v1.value.big, v2.value.big); - - default: - a_assert(0); - return 0; - } -} - - -/******************************************************************************/ -/* - * If type mismatch, then coerce types to big. - * Note: Known bug, casting of negative bigs to floats doesn't work. - */ - -static void coerce_types(register value_t* v1, register value_t* v2) -{ -#if FLOATING_POINT_SUPPORT - if (v1->type == floating) { - v2->type = floating; - v2->value.floating = (double) v2->value.integer; - if (v2->type == big) - v2->value.floating = (double) v2->value.big[BLOW] + - (double) v2->value.big[BHIGH] * (double) MAXINT; - - } else if (v2->type == floating) { - v1->type = floating; - v1->value.floating = (double) v1->value.integer; - if (v1->type == big) - v1->value.floating = (double) v1->value.big[BLOW] + - (double) v1->value.big[BHIGH] * (double) MAXINT; - - } else if (v1->type == big) { -#else - if (v1->type == big) { -#endif /* FLOATING_POINT_SUPPORT */ - v2->value.big[BLOW] = value_to_integer(v2); - if (valueNegative(v2)) - v2->value.big[BHIGH] = -1; - else - v2->value.big[BHIGH] = 0; - v2->type = big; - - } else if (v2->type == big) { - if (valueNegative(v1)) - v1->value.big[BHIGH] = -1; - else - v1->value.big[BHIGH] = 0; - v1->value.big[BLOW] = value_to_integer(v1); - v1->type = big; - - - } else if (v1->type == integer) { - v2->value.integer = value_to_integer(v2); - v2->type = integer; - - } else if (v2->type == integer) { - v1->value.integer = value_to_integer(v1); - v1->type = integer; - - } else if (v1->type != integer) { - v2->type = v1->type; - - } else if (v2->type != integer) { - v1->type = v2->type; - - } - a_assert(v1->type == v2->type); -} - - -/******************************************************************************/ -/* - * Return true if the value is numeric and negative. Otherwise return 0. - */ - -int valueNegative(value_t* vp) -{ - switch (vp->type) { - default: - case string: - case bytes: - return 0; - -#if FLOATING_POINT_SUPPORT - case floating: - if (vp->value.floating < 0) - return 1; - return 0; -#endif - - case flag: - if ((signed char)vp->value.flag < 0) - return 1; - return 0; - - case byteint: - case percent: - if ((signed char)vp->value.byteint < 0) - return 1; - return 0; - - case shortint: - if (vp->value.shortint < 0) - return 1; - return 0; - - case hex: - case integer: - case octal: - if (vp->value.integer < 0) - return 1; - return 0; - - case big: - if (vp->value.big[BHIGH] < 0) - return 1; - return 0; - } -} - -/******************************************************************************/ -/* - * Return true if the value is numeric and zero. Otherwise return 0. - */ - -int valueZero(value_t* vp) -{ - switch (vp->type) { - default: - case string: - case bytes: - return 0; - -#if FLOATING_POINT_SUPPORT - case floating: - if (vp->value.floating == 0) - return 1; - return 0; -#endif - - case flag: - if (vp->value.flag == 0) - return 1; - return 0; - - case byteint: - case percent: - if (vp->value.byteint == 0) - return 1; - return 0; - - case shortint: - if (vp->value.shortint == 0) - return 1; - return 0; - - case hex: - case integer: - case octal: - if (vp->value.integer == 0) - return 1; - return 0; - - case big: - if (vp->value.big[BHIGH] == 0 && vp->value.big[BLOW] == 0) - return 1; - return 0; - } -} - - -/******************************************************************************/ -/* - * Cast a value to an integer. Cannot be called for floating, non-numerics - * or bigs. - */ - -static int value_to_integer(value_t* vp) -{ - switch (vp->type) { - default: - case string: - case bytes: - case big: -#if FLOATING_POINT_SUPPORT - case floating: - a_assert(0); - return -1; -#endif - - case flag: - return (int) vp->value.flag; - - case byteint: - case percent: - return (int) vp->value.byteint; - - case shortint: - return (int) vp->value.shortint; - - case hex: - case integer: - case octal: - return (int) vp->value.integer; - } -} - - -/******************************************************************************/ -/* - * Convert a value to a text based representation of its value - */ - -void valueSprintf(char_t** out, int size, char_t* fmt, value_t vp) -{ - char_t *src, *dst, *tmp, *dst_start; - - a_assert(out); - - *out = NULL; - - if (! vp.valid) { - *out = bstrdup(B_L, T("Invalid")); - return; - } - - switch (vp.type) { - case flag: - if (fmt == NULL || *fmt == '\0') { - *out = bstrdup(B_L, (vp.value.flag) ? T("true") : T("false")); - } else { - fmtAlloc(out, size, fmt, (vp.value.flag) ? T("true") : T("false")); - } - break; - -#if FLOATING_POINT_SUPPORT - case floating: - if (fmt == NULL || *fmt == '\0') { - fmtAlloc(out, size, T("%f"), vp.value.floating); - } else { - fmtAlloc(out, size, fmt, vp.value.floating); - } - break; -#endif - - case hex: - if (fmt == NULL || *fmt == '\0') { - fmtAlloc(out, size, T("0x%lx"), vp.value.hex); - } else { - fmtAlloc(out, size, fmt, vp.value.hex); - } - break; - - case big: - if (*out == NULL) { - *out = btoa(vp.value.big, NULL, 0); - } else { - btoa(vp.value.big, *out, size); - } - break; - - case integer: - if (fmt == NULL || *fmt == '\0') { - fmtAlloc(out, size, T("%ld"), vp.value.integer); - } else { - fmtAlloc(out, size, fmt, vp.value.integer); - } - break; - - case octal: - if (fmt == NULL || *fmt == '\0') { - fmtAlloc(out, size, T("0%lo"), vp.value.octal); - } else { - fmtAlloc(out, size, fmt, vp.value.octal); - } - break; - - case percent: - if (fmt == NULL || *fmt == '\0') { - fmtAlloc(out, size, T("%d%%"), vp.value.percent); - } else { - fmtAlloc(out, size, fmt, vp.value.percent); - } - break; - - case byteint: - if (fmt == NULL || *fmt == '\0') { - fmtAlloc(out, size, T("%d"), (int) vp.value.byteint); - } else { - fmtAlloc(out, size, fmt, (int) vp.value.byteint); - } - break; - - case shortint: - if (fmt == NULL || *fmt == '\0') { - fmtAlloc(out, size, T("%d"), (int) vp.value.shortint); - } else { - fmtAlloc(out, size, fmt, (int) vp.value.shortint); - } - break; - - case string: - case errmsg: - src = vp.value.string; - - if (src == NULL) { - *out = bstrdup(B_L, T("NULL")); - } else if (fmt && *fmt) { - fmtAlloc(out, size, fmt, src); - - } else { - - *out = balloc(B_L, size); - dst_start = dst = *out; - for (; *src != '\0'; src++) { - if (dst >= &dst_start[VALUE_MAX_STRING - 5]) - break; - switch (*src) { - case '\a': *dst++ = '\\'; *dst++ = 'a'; break; - case '\b': *dst++ = '\\'; *dst++ = 'b'; break; - case '\f': *dst++ = '\\'; *dst++ = 'f'; break; - case '\n': *dst++ = '\\'; *dst++ = 'n'; break; - case '\r': *dst++ = '\\'; *dst++ = 'r'; break; - case '\t': *dst++ = '\\'; *dst++ = 't'; break; - case '\v': *dst++ = '\\'; *dst++ = 'v'; break; - case '\\': *dst++ = '\\'; *dst++ = '\\'; break; - case '"': *dst++ = '\\'; *dst++ = '\"'; break; - default: - if (gisprint(*src)) { - *dst++ = *src; - } else { - fmtAlloc(&tmp, size, T("\\x%02x"), - (unsigned int) *src); - gstrcpy(dst, tmp); - bfreeSafe(B_L, tmp); - dst += 4; - } - break; - } - } - *dst++ = '\0'; - } - break; - -#if UNUSED - case bytes: - asrc = vp.value.bytes; - - if (asrc == NULL) { - *out = bstrdup(B_L, T("NULL")); - - } else if (fmt && *fmt) { - fmtAlloc(out, size, fmt, asrc); - - } else { - - dst_start = dst; - for (; *asrc != '\0'; asrc++) { - if (dst >= &dst_start[VALUE_MAX_STRING - 5]) - break; - switch (*asrc) { - case '\a': *dst++ = '\\'; *dst++ = 'a'; break; - case '\b': *dst++ = '\\'; *dst++ = 'b'; break; - case '\f': *dst++ = '\\'; *dst++ = 'f'; break; - case '\n': *dst++ = '\\'; *dst++ = 'n'; break; - case '\r': *dst++ = '\\'; *dst++ = 'r'; break; - case '\t': *dst++ = '\\'; *dst++ = 't'; break; - case '\v': *dst++ = '\\'; *dst++ = 'v'; break; - case '\\': *dst++ = '\\'; *dst++ = '\\'; break; - case '"': *dst++ = '\\'; *dst++ = '\"'; break; - default: - if (gisprint(*asrc)) { - *dst++ = *asrc; - } else { - fmtAlloc(dst, size, - T("\\x%02x"), (unsigned int) *asrc); - dst += 4; - } - break; - } - } - *dst++ = '\0'; - } - break; -#endif - - default: - a_assert(0); - } -} - -/******************************************************************************/ -/* - * Print a value to the named file descriptor - */ - -void valueFprintf(FILE* fp, char_t* fmt, value_t vp) -{ - char_t *buf; - - buf = NULL; - valueSprintf(&buf, VALUE_MAX_STRING, fmt, vp); - gfputs(buf, fp); - bfreeSafe(B_L, buf); - fflush(fp); -} - -/******************************************************************************/ -/* - * Ascii to value conversion - */ - -value_t valueAtov(char_t* s, int pref_type) -{ - vtype_t type; - value_t v; - long tmp[2], tmp2[2], base[2]; - int i, len, num; - - a_assert(0 <= pref_type && pref_type < 99); /* Sanity check */ - a_assert(s); - - v = value_null; - if (s == NULL) { - return value_null; - } - - base[BLOW] = 10; - base[BHIGH] = 0; - len = gstrlen(s); - -/* - * Determine the value type - */ - type = undefined; - if (pref_type <= 0) { - if (gisdigit(*s)) { - base[BHIGH] = 0; - if (s[len - 1] == '%') { - type = percent; - len --; - base[BLOW] = 10; - } else if (*s == '0') { - if (s[1] == 'x') { - type = hex; - s += 2; - len -= 2; - base[BLOW] = 16; - } else if (s[1] == '\0') { - type = integer; - base[BLOW] = 10; - } else { - type = octal; - s++; - len--; - base[BLOW] = 8; - } - } else { - type = integer; - base[BLOW] = 10; - } - - } else { - if (gstrcmp(s, T("true")) == 0 || gstrcmp(s, T("false")) == 0) { - type = flag; - } else if (*s == '\'' && s[len - 1] == '\'') { - type = string; - s++; - len -= 2; - } else if (*s == '\"' && s[len - 1] == '\"') { - type = string; - s++; - len -= 2; - } else { - type = string; - } - } - v.type = type; - - } else - v.type = pref_type; - v.valid = 1; - -/* - * Do the conversion. Always use big arithmetic - */ - switch (v.type) { - case hex: - if (!isdigit(s[0])) { - if (gtolower(s[0]) >= 'a' || gtolower(s[0]) <= 'f') { - v.value.big[BLOW] = 10 + gtolower(s[0]) - 'a'; - } else { - v.value.big[BLOW] = 0; - } - } else { - v.value.big[BLOW] = s[0] - '0'; - } - v.value.big[BHIGH] = 0; - for (i = 1; i < len; i++) { - if (!isdigit(s[i])) { - if (gtolower(s[i]) < 'a' || gtolower(s[i]) > 'f') { - break; - } - num = 10 + gtolower(s[i]) - 'a'; - } else { - num = s[i] - '0'; - } - bmul(tmp, v.value.big, base); - binit(tmp2, 0, num); - badd(v.value.big, tmp, tmp2); - } - v.value.hex = v.value.big[BLOW]; - break; - - case shortint: - case byteint: - case integer: - case percent: - case octal: - case big: - v.value.big[BHIGH] = 0; - if (gisdigit(s[0])) - v.value.big[BLOW] = s[0] - '0'; - else - v.value.big[BLOW] = 0; - for (i = 1; i < len && gisdigit(s[i]); i++) { - bmul(tmp, v.value.big, base); - binit(tmp2, 0, s[i] - '0'); - badd(v.value.big, tmp, tmp2); - } - switch (v.type) { - case shortint: - v.value.shortint = (short) v.value.big[BLOW]; - break; - case byteint: - v.value.byteint = (char) v.value.big[BLOW]; - break; - case integer: - v.value.integer = (int) v.value.big[BLOW]; - break; - case percent: - v.value.percent = (char) v.value.big[BLOW]; - break; - case octal: - v.value.octal = (int) v.value.big[BLOW]; - break; - default: - break; - } - break; - -#if FLOATING_POINT_SUPPORT - case floating: - gsscanf(s, T("%f"), &v.value.floating); - break; -#endif - - case flag: - if (*s == 't') - v.value.flag = 1; - else v.value.flag = 0; - break; - - case string: -/* - * Note this always ballocs a string - */ - v = valueString(s, VALUE_ALLOCATE); - break; - - case bytes: - v = valueBytes((char*) s, VALUE_ALLOCATE); - break; - -#if UNUSED - case literal: - v = value_literal(bstrdup(B_L, s)); - v.value.literal[len] = '\0'; - break; -#endif - - case undefined: - case symbol: - default: - v.valid = 0; - a_assert(0); - } - return v; -} - -#endif /* !UEMF */ -/******************************************************************************/ diff --git a/cpukit/httpd/wbase64.c b/cpukit/httpd/wbase64.c deleted file mode 100644 index b1eb6b01c5..0000000000 --- a/cpukit/httpd/wbase64.c +++ /dev/null @@ -1,147 +0,0 @@ -/* - * base64.c -- Base64 Mime encoding - * - * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved. - * - * See the file "license.txt" for usage and redistribution license requirements - */ - -/******************************** Description *********************************/ - -/* - * The base64 command encodes and decodes a string in mime base64 format - */ - -/********************************* Includes ***********************************/ - -#include "wsIntrn.h" - -/******************************** Local Data **********************************/ -/* - * Mapping of ANSI chars to base64 Mime encoding alphabet (see below) - */ - -static char_t map64[] = { - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, - -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, - -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -}; - -static char_t alphabet64[] = { - 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', - 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', - 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', - 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', - 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', - 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', - 'w', 'x', 'y', 'z', '0', '1', '2', '3', - '4', '5', '6', '7', '8', '9', '+', '/', -}; - -/*********************************** Code *************************************/ -/* - * Decode a buffer from "string" and into "outbuf" - */ - -int websDecode64(char_t *outbuf, char_t *string, int outlen) -{ - unsigned long shiftbuf; - char_t *cp, *op; - int c, i, j, shift; - - op = outbuf; - *op = '\0'; - cp = string; - while (*cp && *cp != '=') { -/* - * Map 4 (6bit) input bytes and store in a single long (shiftbuf) - */ - shiftbuf = 0; - shift = 18; - for (i = 0; i < 4 && *cp && *cp != '='; i++, cp++) { - c = map64[*cp & 0xff]; - if (c == -1) { - error(E_L, E_LOG, T("Bad string: %s at %c index %d"), string, - c, i); - return -1; - } - shiftbuf = shiftbuf | (c << shift); - shift -= 6; - } -/* - * Interpret as 3 normal 8 bit bytes (fill in reverse order). - * Check for potential buffer overflow before filling. - */ - --i; - if ((op + i) >= &outbuf[outlen]) { - gstrcpy(outbuf, T("String too big")); - return -1; - } - for (j = 0; j < i; j++) { - *op++ = (char_t) ((shiftbuf >> (8 * (2 - j))) & 0xff); - } - *op = '\0'; - } - return 0; -} - - -/******************************************************************************/ -/* - * Encode a buffer from "string" into "outbuf" - */ - -void websEncode64(char_t *outbuf, char_t *string, int outlen) -{ - unsigned long shiftbuf; - char_t *cp, *op; - int x, i, j, shift; - - op = outbuf; - *op = '\0'; - cp = string; - while (*cp) { -/* - * Take three characters and create a 24 bit number in shiftbuf - */ - shiftbuf = 0; - for (j = 2; j >= 0 && *cp; j--, cp++) { - shiftbuf |= ((*cp & 0xff) << (j * 8)); - } -/* - * Now convert shiftbuf to 4 base64 letters. The i,j magic calculates - * how many letters need to be output. - */ - shift = 18; - for (i = ++j; i < 4 && op < &outbuf[outlen] ; i++) { - x = (shiftbuf >> shift) & 0x3f; - *op++ = alphabet64[(shiftbuf >> shift) & 0x3f]; - shift -= 6; - } -/* - * Pad at the end with '=' - */ - while (j-- > 0) { - *op++ = '='; - } - *op = '\0'; - } -} -/******************************************************************************/ diff --git a/cpukit/httpd/webcomp.c b/cpukit/httpd/webcomp.c deleted file mode 100644 index 575f4be46b..0000000000 --- a/cpukit/httpd/webcomp.c +++ /dev/null @@ -1,186 +0,0 @@ -/* - * webcomp -- Compile web pages into C source - * - * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved. - * - * See the file "license.txt" for usage and redistribution license requirements - */ - -/******************************** Description *********************************/ - -/* - * Usage: webcomp prefix filelist >webrom.c - * - * filelist is a file containing the pathnames of all web pages - * prefix is a path prefix to remove from all the web page pathnames - * webrom.c is the resulting C source file to compile and link. - */ - -/********************************* Includes ***********************************/ - -#include "wsIntrn.h" - -/**************************** Forward Declarations ****************************/ - -static int compile(char_t *fileList, char_t *prefix); -static void usage(); - -/*********************************** Code *************************************/ -/* - * Main program for webpack test harness - */ - -int gmain(int argc, char_t* argv[]) -{ - char_t *fileList, *prefix; - - fileList = NULL; - - if (argc != 3) { - usage(); - } - - prefix = argv[1]; - fileList = argv[2]; - - if (compile(fileList, prefix) < 0) { - return -1; - } - return 0; -} - -/******************************************************************************/ -/* - * Output usage message - */ - -static void usage() -{ - fprintf(stderr, "usage: webcomp prefix filelist >output.c\n"); - exit(2); -} - -/******************************************************************************/ -/* - * Compile the web pages - */ - -static int compile(char_t *fileList, char_t *prefix) -{ - gstat_t sbuf; - FILE *lp; - time_t now; - char_t file[FNAMESIZE]; - char_t *cp, *sl; - char buf[512]; - unsigned char *p; - int j, i, len, fd, nFile; - -/* - * Open list of files - */ - if ((lp = fopen(fileList, "r")) == NULL) { - fprintf(stderr, "Can't open file list %s\n", fileList); - return -1; - } - - time(&now); - fprintf(stdout, "/*\n * webrom.c -- Compiled Web Pages\n *\n"); - fprintf(stdout, " * Compiled by GoAhead WebCompile: %s */\n\n", - gctime(&now)); - fprintf(stdout, "#include \"wsIntrn.h\"\n\n"); - fprintf(stdout, "#ifndef WEBS_PAGE_ROM\n"); - fprintf(stdout, "websRomPageIndexType websRomPageIndex[] = {\n"); - fprintf(stdout, " { 0, 0, 0 },\n};\n"); - fprintf(stdout, "#else\n"); - -/* - * Open each input file and compile each web page - */ - nFile = 0; - while (fgets(file, sizeof(file), lp) != NULL) { - if ((p = strchr(file, '\n')) || (p = strchr(file, '\r'))) { - *p = '\0'; - } - if (*file == '\0') { - continue; - } - if (gstat(file, &sbuf) == 0 && sbuf.st_mode & S_IFDIR) { - continue; - } - if ((fd = gopen(file, O_RDONLY | O_BINARY)) < 0) { - fprintf(stderr, "Can't open file %s\n", file); - return -1; - } - fprintf(stdout, "static const unsigned char page_%d[] = {\n", nFile); - - while ((len = read(fd, buf, sizeof(buf))) > 0) { - p = buf; - for (i = 0; i < len; ) { - fprintf(stdout, " "); - for (j = 0; p < &buf[len] && j < 16; j++, p++) { - fprintf(stdout, "%3d,", *p); - } - i += j; - fprintf(stdout, "\n"); - } - } - fprintf(stdout, " 0 };\n\n"); - - close(fd); - nFile++; - } - fclose(lp); - -/* - * Now output the page index - */ - fprintf(stdout, "websRomPageIndexType websRomPageIndex[] = {\n"); - - if ((lp = fopen(fileList, "r")) == NULL) { - fprintf(stderr, "Can't open file list %s\n", fileList); - return -1; - } - nFile = 0; - while (fgets(file, sizeof(file), lp) != NULL) { - if ((p = strchr(file, '\n')) || (p = strchr(file, '\r'))) { - *p = '\0'; - } - if (*file == '\0') { - continue; - } -/* - * Remove the prefix and add a leading "/" when we print the path - */ - if (strncmp(file, prefix, gstrlen(prefix)) == 0) { - cp = &file[gstrlen(prefix)]; - } else { - cp = file; - } - while((sl = strchr(file, '\\')) != NULL) { - *sl = '/'; - } - if (*cp == '/') { - cp++; - } - - if (gstat(file, &sbuf) == 0 && sbuf.st_mode & S_IFDIR) { - fprintf(stdout, " { T(\"/%s\"), 0, 0 },\n", cp); - continue; - } - fprintf(stdout, " { T(\"/%s\"), page_%d, %d },\n", cp, nFile, - sbuf.st_size); - nFile++; - } - fclose(lp); - - fprintf(stdout, " { 0, 0, 0 },\n"); - fprintf(stdout, "};\n"); - fprintf(stdout, "#endif /* WEBS_PAGE_ROM */\n"); - - fclose(lp); - fflush(stdout); - return 0; -} - -/******************************************************************************/ diff --git a/cpukit/httpd/webmain.c b/cpukit/httpd/webmain.c deleted file mode 100644 index c9c0b9cc15..0000000000 --- a/cpukit/httpd/webmain.c +++ /dev/null @@ -1,499 +0,0 @@ -/* - * main.c -- Main program for the GoAhead WebServer (RTEMS version) - * - * Copyright (c) Go Ahead Software Inc., 1995-1999. All Rights Reserved. - * - * See the file "license.txt" for usage and redistribution license requirements - * - * $Id$ - */ - -/******************************** Description *********************************/ - -/* - * Main program for for the GoAhead WebServer. This is a demonstration - * main program to initialize and configure the web server. - */ - -/********************************* Includes ***********************************/ - -#include "uemf.h" -#include "wsIntrn.h" -#include -#include -#include - -#include -#include - -#ifdef WEBS_SSL_SUPPORT -#include "websSSL.h" -#endif - -#ifdef USER_MANAGEMENT_SUPPORT -#include "um.h" -void formDefineUserMgmt(void); -#endif - -/*********************************** Locals ***********************************/ -/* - * Change configuration here - */ - -extern const char *tftpServer; -/* static char_t *rootWeb = T("goahead"); * Root web directory */ -static char_t *password = T(""); /* Security password */ -static int port = 80; /* Server port */ -static int retries = 5; /* Server port retries */ -static int finished; /* Finished flag */ - -/* - * Structure to hold timer events - */ -typedef struct { - void (*routine)(long arg); /* Timer routine */ - long arg; /* Argument to routine */ -} websTimer_t; - -/* The following holds the pointer to an allocated websTimer_t structure . - * Using this method only one timer can be active at a time, but - * for the WebServer, this should be OK. - */ -websTimer_t *tp; - -/****************************** Forward Declarations **************************/ - -static int initWebs(); -static int aspTest(int eid, webs_t wp, int argc, char_t **argv); -static void formTest(webs_t wp, char_t *path, char_t *query); -static int websHomePageHandler(webs_t wp, char_t *urlPrefix, char_t *webDir, - int arg, char_t* url, char_t* path, char_t* query); -static void timerProc(int signo); -#if B_STATS -static void printMemStats(int handle, char_t *fmt, ...); -static void memLeaks(); -#endif -static timer_t timer_id; -static void rtems_httpd_daemon(); - -/*********************************** Code *************************************/ -/* - * Main -- entry point from RTEMS - */ -int rtems_initialize_webserver() -{ - rtems_status_code sc; - rtems_id tid; - int priority; - - /*********************************************************************** - * Default HTTPD priority. - **********************************************************************/ - priority = 40; - - sc = rtems_task_create(rtems_build_name('H', 'T', 'P', 'D'), - priority, 8*1024, - RTEMS_PREEMPT | RTEMS_NO_TIMESLICE | RTEMS_NO_ASR | - RTEMS_INTERRUPT_LEVEL(0), - RTEMS_NO_FLOATING_POINT | RTEMS_LOCAL, - &tid); - if (sc != RTEMS_SUCCESSFUL) - { - return(RTEMS_UNSATISFIED); - } - - sc = rtems_task_start(tid, rtems_httpd_daemon, 0); - if (sc != RTEMS_SUCCESSFUL) - { - return(RTEMS_UNSATISFIED); - } - - return(RTEMS_SUCCESSFUL); - -} - -static void -rtems_httpd_daemon() -{ -/* - * Initialize the memory allocator. Allow use of malloc and start with a - * 10K heap. - */ - bopen(NULL, (10 * 1024), B_USE_MALLOC); - -/* - * Initialize the web server - */ - if (initWebs() < 0) { - rtems_panic("Unable to initialize Web server !!\n"); - } - -#ifdef WEBS_SSL_SUPPORT - websSSLOpen(); -#endif - -/* - * Basic event loop. SocketReady returns true when a socket is ready for - * service. SocketSelect will block until an event occurs. SocketProcess - * will actually do the servicing. - */ - while (!finished) { - if (socketReady(-1) || socketSelect(-1, 2000)) { - socketProcess(-1); - } - /*websCgiCleanup();*/ - emfSchedProcess(); - } - -#ifdef WEBS_SSL_SUPPORT - websSSLClose(); -#endif - -#ifdef USER_MANAGEMENT_SUPPORT - umClose(); -#endif - -/* - * Close the socket module, report memory leaks and close the memory allocator - */ - websCloseServer(); - websDefaultClose(); - socketClose(); - symSubClose(); -#if B_STATS - memLeaks(); -#endif - bclose(); - rtems_task_delete( RTEMS_SELF ); -} - -/******************************************************************************/ -/* - * Initialize the web server. - */ - -static int initWebs() -{ - struct hostent* hp; - struct in_addr intaddr; - char host[128], webdir[128]; - char_t wbuf[128]; - -/* - * Initialize the socket subsystem - */ - socketOpen(); - -/* - * Define the local Ip address, host name, default home page and the - * root web directory. - */ - if (gethostname(host, sizeof(host)) < 0) { - error(E_L, E_LOG, T("Can't get hostname")); - return -1; - } - -/* intaddr.s_addr = (unsigned long) hostGetByName(host); */ - if ((hp = gethostbyname(host)) == NULL) { - error(E_L, E_LOG, T("Can't get host address")); - return -1; - } - memcpy((char *) &intaddr, (char *) hp->h_addr_list[0], - (size_t) hp->h_length); - -#if 0 -/* - * Set /TFTP/x.y.z.w/goahead as the root web. Modify to suit your needs - */ - sprintf(webdir, "/TFTP/%s/%s", tftpServer, rootWeb); -#else - sprintf(webdir, "/"); -#endif -/* - * Configure the web server options before opening the web server - */ - websSetDefaultDir(webdir); - ascToUni(wbuf, inet_ntoa(intaddr), sizeof(wbuf)); - websSetIpaddr(wbuf); - ascToUni(wbuf, host, sizeof(wbuf)); - websSetHost(wbuf); - -/* - * Configure the web server options before opening the web server - */ -#if 0 - websSetDefaultPage(T("default.asp")); -#else - websSetDefaultPage(T("index.html")); -#endif - websSetPassword(password); - -/* - * Open the web server on the given port. If that port is taken, try - * the next sequential port for up to "retries" attempts. - */ - websOpenServer(port, retries); - -/* - * First create the URL handlers. Note: handlers are called in sorted order - * with the longest path handler examined first. Here we define the security - * handler, forms handler and the default web page handler. - */ - websUrlHandlerDefine(T(""), NULL, 0, websSecurityHandler, - WEBS_HANDLER_FIRST); - websUrlHandlerDefine(T("/goform"), NULL, 0, websFormHandler, 0); - websUrlHandlerDefine(T(""), NULL, 0, websDefaultHandler, - WEBS_HANDLER_LAST); - -/* - * Now define two test procedures. Replace these with your application - * relevant ASP script procedures and form functions. - */ - websAspDefine(T("aspTest"), aspTest); - websFormDefine(T("formTest"), formTest); - -/* - * Create a handler for the default home page - */ - websUrlHandlerDefine(T("/"), NULL, 0, websHomePageHandler, 0); - return 0; -} - -/******************************************************************************/ -/* - * Test Javascript binding for ASP. This will be invoked when "aspTest" is - * embedded in an ASP page. See web/asp.asp for usage. Set browser to - * "localhost/asp.asp" to test. - */ - -static int aspTest(int eid, webs_t wp, int argc, char_t **argv) -{ - char_t *name, *address; - - if (ejArgs(argc, argv, T("%s %s"), &name, &address) < 2) { - websError(wp, 400, T("Insufficient args\n")); - return -1; - } - return websWrite(wp, T("Name: %s, Address %s"), name, address); -} -/******************************************************************************/ -/* - * Test form for posted data (in-memory CGI). This will be called when the - * form in web/asp.asp is invoked. Set browser to "localhost/asp.asp" to test. - */ - -static void formTest(webs_t wp, char_t *path, char_t *query) -{ - char_t *name, *address; - - name = websGetVar(wp, T("name"), T("Joe Smith")); - address = websGetVar(wp, T("address"), T("1212 Milky Way Ave.")); - - websHeader(wp); - websWrite(wp, T("

Name: %s, Address: %s

\n"), name, address); - websFooter(wp); - websDone(wp, 200); -} - -/******************************************************************************/ -/* - * Create a timer to invoke the routine in "delay" milliseconds. - */ - -void *emfCreateTimer(int delay, void (*routine)(long arg), long arg) -{ -/* this variable is only used in the if'ed 0 section below */ -#if 0 - struct sigaction act; -#endif - struct itimerspec its = { {0,0}, {0,0} }; - struct sigevent se; - int status; - - if ((tp = balloc(B_L, sizeof(websTimer_t)))) { - tp->routine = routine; - tp->arg = arg; - } - else { - return NULL; - } - - se.sigev_notify = SIGEV_THREAD; - se.sigev_value.sival_ptr = tp; - se.sigev_notify_function = (void (*)(union sigval)) timerProc; - - /* - * NOT POSIX? - * se.sigev_notify_attributes = NULL; - */ - - - status = timer_create(CLOCK_REALTIME, &se, &timer_id); - if (status != 0) { - bfree(B_L, tp); - return NULL; - } - /* convert delay millisecs to secs and usecs required by struct */ - its.it_value.tv_sec = delay / 1000; - its.it_value.tv_nsec = (delay % 1000) * 1000000; - - status = timer_settime(timer_id, 0, &its, 0); - if (status != 0) { - bfree(B_L, tp); - return NULL; - } - -#if 0 - act.sa_flags = 0; - sigemptyset(&act.sa_mask); - act.sa_handler = timerProc; - sigaction(SIGALRM, &act, NULL); - - /* convert delay millisecs to secs and usecs required by struct */ - its.it_value.tv_sec = delay / 1000; - its.it_value.tv_usec = (delay % 1000) * 1000; - - if (setitimer(ITIMER_REAL, &its, NULL) == -1) { - bfree(B_L, tp); - return NULL; - } -#endif - return tp; -} - -/******************************************************************************/ -/* - * Delete a timer - */ - -void emfDeleteTimer(void * id) -{ - websTimer_t *wtp; - /*struct itimerval its = { {0,0}, {0,0} };*/ - - wtp = (websTimer_t *)id; - /* setitimer(ITIMER_REAL, &its, NULL);*/ - timer_delete(timer_id); - bfree(B_L, wtp); -} - -/******************************************************************************/ -/* - * Timer handler - */ - -static void timerProc(int signo) -{ - websTimer_t wtp = *tp; - -/* Copy the timer structure to a local first and delete it before calling - * the function, since the function could create another timer. In this - * implementation, only one timer can be allocated at a time. - */ - - bfree(B_L, tp); - (wtp.routine)(wtp.arg); -} - -/******************************************************************************/ -/* - * Home page handler - */ - -static int websHomePageHandler(webs_t wp, char_t *urlPrefix, char_t *webDir, - int arg, char_t* url, char_t* path, char_t* query) -{ -/* - * If the empty or "/" URL is invoked, redirect default URLs to the home page - */ - if (*url == '\0' || gstrcmp(url, T("/")) == 0) { -#if 0 - websRedirect(wp, T("home.asp")); -#else - websRedirect(wp, T("index.html")); -#endif - return 1; - } - return 0; -} - -/******************************************************************************/ - -#if B_STATS -static void memLeaks() -{ - int fd=1; - - /* if ((fd = gopen(T("leak.txt"), O_CREAT | O_TRUNC | O_WRONLY)) >= 0) { */ - bstats(fd, printMemStats); - /* - close(fd); - } - */ -} - -/******************************************************************************/ -/* - * Print memory usage / leaks - */ - -static void printMemStats(int handle, char_t *fmt, ...) -{ - va_list args; - char_t buf[256]; - - va_start(args, fmt); - vsprintf(buf, fmt, args); - va_end(args); - write(handle, buf, strlen(buf)); -} -#endif - -/*****************************************************************************/ - -/*****************************************************************************/ -/* - * Default error handler. The developer should insert code to handle - * error messages in the desired manner. - */ - -void defaultErrorHandler(int etype, char_t *msg) -{ -#if 1 - write(1, msg, gstrlen(msg)); -#endif -} - -/*****************************************************************************/ -/* - * Trace log. Customize this function to log trace output - */ - -void defaultTraceHandler(int level, char_t *buf) -{ -/* - * The following code would write all trace regardless of level - * to stdout. - */ -#if 1 - if (buf) { - write(1, buf, gstrlen(buf)); - } -#endif -} - -/*****************************************************************************/ -/* - * Returns a pointer to an allocated qualified unique temporary file name. - * This filename must eventually be deleted with bfree(); - */ - -char_t *websGetCgiCommName() -{ - char_t *pname1, *pname2; - - pname1 = tempnam(NULL, T("cgi")); - pname2 = bstrdup(B_L, pname1); - free(pname1); - return pname2; -} diff --git a/cpukit/httpd/webpage.c b/cpukit/httpd/webpage.c deleted file mode 100644 index efac13f508..0000000000 --- a/cpukit/httpd/webpage.c +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Page.c -- Support for page retrieval. - * - * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved. - * - * See the file "license.txt" for usage and redistribution license requirements - */ - -/******************************** Description *********************************/ - -/* - * This module provides page retrieval handling. It provides support for - * reading web pages from file systems and has expansion for ROMed web - * pages. - */ - -/********************************* Includes ***********************************/ - -#include "wsIntrn.h" - -/*********************************** Code *************************************/ -/* - * Open a web page. lpath is the local filename. path is the URL path name. - */ - -int websPageOpen(webs_t wp, char_t *lpath, char_t *path, int mode, int perm) -{ - a_assert(websValid(wp)); - -#if WEBS_PAGE_ROM - return websRomPageOpen(wp, path, mode, perm); -#else - return (wp->docfd = gopen(lpath, mode, perm)); -#endif /* WEBS_PAGE_ROM */ -} - -/******************************************************************************/ -/* - * Close a web page - */ - -void websPageClose(webs_t wp) -{ - a_assert(websValid(wp)); - -#if WEBS_PAGE_ROM - websRomPageClose(wp->docfd); -#else - if (wp->docfd >= 0) { - close(wp->docfd); - wp->docfd = -1; - } -#endif -} - -/******************************************************************************/ -/* - * Stat a web page lpath is the local filename. path is the URL path name. - */ - -int websPageStat(webs_t wp, char_t *lpath, char_t *path, websStatType* sbuf) -{ -#if WEBS_PAGE_ROM - return websRomPageStat(path, sbuf); -#else - gstat_t s; - - if (gstat(lpath, &s) < 0) { - return -1; - } - sbuf->size = s.st_size; - sbuf->mtime = s.st_mtime; - sbuf->isDir = s.st_mode & S_IFDIR; - return 0; -#endif -} - -/******************************************************************************/ -/* - * Is this file a directory? - */ - -int websPageIsDirectory(char_t *lpath) -{ -#if WEBS_PAGE_ROM - websStatType sbuf; - - if (websRomPageStat(lpath, &sbuf) >= 0) { - return(sbuf.isDir); - } else { - return 0; - } -#else - gstat_t sbuf; - - if (gstat(lpath, &sbuf) >= 0) { - return(sbuf.st_mode & S_IFDIR); - } else { - return 0; - } -#endif -} - - -/******************************************************************************/ -/* - * Read a web page. Returns the number of _bytes_ read. - * len is the size of buf, in bytes. - */ - -int websPageReadData(webs_t wp, char *buf, int nBytes) -{ - -#if WEBS_PAGE_ROM - a_assert(websValid(wp)); - return websRomPageReadData(wp, buf, nBytes); -#else - a_assert(websValid(wp)); - return read(wp->docfd, buf, nBytes); -#endif -} - -/******************************************************************************/ -/* - * Move file pointer offset bytes. - */ - -void websPageSeek(webs_t wp, long offset) -{ - a_assert(websValid(wp)); - -#if WEBS_PAGE_ROM - websRomPageSeek(wp, offset, SEEK_CUR); -#else - lseek(wp->docfd, offset, SEEK_CUR); -#endif -} - -/******************************************************************************/ - diff --git a/cpukit/httpd/webrom.c b/cpukit/httpd/webrom.c deleted file mode 100644 index 61d795949e..0000000000 --- a/cpukit/httpd/webrom.c +++ /dev/null @@ -1,13 +0,0 @@ -/* - * webrom.c -- Compiled Web Pages - * - * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved. - * - * See the file "license.txt" for usage and redistribution license requirements - */ - -#include "wsIntrn.h" - -websRomPageIndexType websRomPageIndex[] = { - { 0, 0, 0 }, -}; diff --git a/cpukit/httpd/webs.c b/cpukit/httpd/webs.c deleted file mode 100644 index 3181c602ec..0000000000 --- a/cpukit/httpd/webs.c +++ /dev/null @@ -1,2838 +0,0 @@ -/* - * webs.c -- GoAhead Embedded HTTP webs server - * - * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved. - * - * See the file "license.txt" for usage and redistribution license requirements - * - * $Id$ - */ - -/******************************** Description *********************************/ - -/* - * This module implements an embedded HTTP/1.1 web server. It supports - * loadable URL handlers that define the nature of URL processing performed. - */ - -/********************************* Includes ***********************************/ - -#include "wsIntrn.h" -#ifdef DIGEST_ACCESS_SUPPORT -#include "websda.h" -#endif - -/******************************** Global Data *********************************/ - -websStatsType websStats; /* Web access stats */ -webs_t *webs; /* Open connection list head */ -sym_fd_t websMime; /* Set of mime types */ -int websMax; /* List size */ -int websPort; /* Listen port for server */ -char_t websHost[64]; /* Host name for the server */ -char_t websIpaddr[64]; /* IP address for the server */ -char_t *websHostUrl = NULL; /* URL to access server */ -char_t *websIpaddrUrl = NULL; /* URL to access server */ - -/*********************************** Locals ***********************************/ -/* - * Standard HTTP error codes - */ - -websErrorType websErrors[] = { - { 200, T("Data follows") }, - { 204, T("No Content") }, - { 301, T("Redirect") }, - { 302, T("Redirect") }, - { 304, T("User local copy") }, - { 400, T("Page not found") }, - { 401, T("Unauthorized") }, - { 403, T("Forbidden") }, - { 404, T("Site or Page Not Found") }, - { 405, T("Access Denied") }, - { 500, T("Web Error") }, - { 501, T("Not Implemented") }, - { 503, T("Site Temporarily Unavailable. Try again.") }, - { 0, NULL } -}; - -#if WEBS_LOG_SUPPORT -static char_t websLogname[64] = T("log.txt"); /* Log filename */ -static int websLogFd; /* Log file handle */ -#endif - -static int websListenSock; /* Listen socket */ -static char_t websRealm[64] = T("GoAhead"); /* Realm name */ - -static int websOpenCount = 0; /* count of apps using this module */ - -/**************************** Forward Declarations ****************************/ - - -static char_t *websErrorMsg(int code); -static int websGetInput(webs_t wp, char_t **ptext, int *nbytes); -static int websParseFirst(webs_t wp, char_t *text); -static void websParseRequest(webs_t wp); -static void websSocketEvent(int sid, int mask, int data); -static int websGetTimeSinceMark(webs_t wp); - -#if WEBS_LOG_SUPPORT -static void websLog(webs_t wp, int code); -#endif -#if WEBS_IF_MODIFIED_SUPPORT -static time_t dateParse(time_t tip, char_t *cmd); -#endif - -/*********************************** Code *************************************/ -/* - * Open the GoAhead WebServer - */ - -int websOpenServer(int port, int retries) -{ - websMimeType *mt; - - if (++websOpenCount != 1) { - return websPort; - } - - a_assert(port > 0); - a_assert(retries >= 0); - -#if WEBS_PAGE_ROM - websRomOpen(); -#endif - - webs = NULL; - websMax = 0; -/* - * Create a mime type lookup table for quickly determining the content type - */ - websMime = symOpen(WEBS_SYM_INIT * 4); - a_assert(websMime >= 0); - for (mt = websMimeList; mt->type; mt++) { - symEnter(websMime, mt->ext, valueString(mt->type, 0), 0); - } - -/* - * Open the URL handler module. The caller should create the required - * URL handlers after calling this function. - */ - if (websUrlHandlerOpen() < 0) { - return -1; - } - websFormOpen(); - -#if WEBS_LOG_SUPPORT -/* - * Optional request log support - */ - websLogFd = gopen(websLogname, O_CREAT | O_TRUNC | O_APPEND | O_WRONLY, - 0666); - a_assert(websLogFd >= 0); -#endif - - return websOpenListen(port, retries); -} - -/******************************************************************************/ -/* - * Close the GoAhead WebServer - */ - -void websCloseServer() -{ - webs_t wp; - int wid; - - if (--websOpenCount > 0) { - return; - } - -/* - * Close the listen handle first then all open connections. - */ - websCloseListen(); - -/* - * Close each open browser connection and free all resources - */ - for (wid = websMax; webs && wid >= 0; wid--) { - if ((wp = webs[wid]) == NULL) { - continue; - } - socketCloseConnection(wp->sid); - websFree(wp); - } - -#if WEBS_LOG_SUPPORT - if (websLogFd >= 0) { - close(websLogFd); - websLogFd = -1; - } -#endif - -#if WEBS_PAGE_ROM - websRomClose(); -#endif - symClose(websMime); - websFormClose(); - websUrlHandlerClose(); -} - -/******************************************************************************/ -/* - * Open the GoAhead WebServer listen port - */ - -int websOpenListen(int port, int retries) -{ - int i, orig; - - a_assert(port > 0); - a_assert(retries >= 0); - - orig = port; -/* - * Open the webs webs listen port. If we fail, try the next port. - */ - for (i = 0; i <= retries; i++) { - websListenSock = socketOpenConnection(NULL, port, websAccept, 0); - if (websListenSock >= 0) { - break; - } - port++; - } - if (i > retries) { - error(E_L, E_USER, T("Couldn't open a socket on ports %d - %d"), - orig, port - 1); - return -1; - } - -/* - * Determine the full URL address to access the home page for this web server - */ - websPort = port; - bfreeSafe(B_L, websHostUrl); - bfreeSafe(B_L, websIpaddrUrl); - websIpaddrUrl = websHostUrl = NULL; - - if (port == 80) { - websHostUrl = bstrdup(B_L, websHost); - websIpaddrUrl = bstrdup(B_L, websIpaddr); - } else { - fmtAlloc(&websHostUrl, WEBS_MAX_URL + 80, T("%s:%d"), websHost, port); - fmtAlloc(&websIpaddrUrl, WEBS_MAX_URL + 80, T("%s:%d"), - websIpaddr, port); - } - trace(0, T("webs: Listening for HTTP requests at address %s\n"), - websIpaddrUrl); - - return port; -} - -/******************************************************************************/ -/* - * Close webs listen port - */ - -void websCloseListen() -{ - if (websListenSock >= 0) { - socketCloseConnection(websListenSock); - websListenSock = -1; - } - bfreeSafe(B_L, websHostUrl); - bfreeSafe(B_L, websIpaddrUrl); - websIpaddrUrl = websHostUrl = NULL; -} - -/******************************************************************************/ -/* - * Accept a connection - */ - -int websAccept(int sid, char *ipaddr, int port, int listenSid) -{ - webs_t wp; - int wid; - - a_assert(ipaddr && *ipaddr); - a_assert(sid >= 0); - a_assert(port >= 0); - -/* - * Allocate a new handle for this accepted connection. This will allocate - * a webs_t structure in the webs[] list - */ - if ((wid = websAlloc(sid)) < 0) { - return -1; - } - wp = webs[wid]; - a_assert(wp); - wp->listenSid = listenSid; - - ascToUni(wp->ipaddr, ipaddr, sizeof(wp->ipaddr)); - -/* - * Check if this is a request from a browser on this system. This is useful - * to know for permitting administrative operations only for local access - */ - if (gstrcmp(wp->ipaddr, T("127.0.0.1")) == 0 || - gstrcmp(wp->ipaddr, websIpaddr) == 0 || - gstrcmp(wp->ipaddr, websHost) == 0) { - wp->flags |= WEBS_LOCAL_REQUEST; - } - -/* - * Arrange for websSocketEvent to be called when read data is available - */ - socketCreateHandler(sid, SOCKET_READABLE, websSocketEvent, (int) wp); - -/* - * Arrange for a timeout to kill hung requests - */ - wp->timeout = emfSchedCallback(WEBS_TIMEOUT, websTimeout, (void *) wp); - trace(8, T("webs: accept request\n")); - return 0; -} - -/******************************************************************************/ -/* - * The webs socket handler. Called in response to I/O. We just pass control - * to the relevant read or write handler. A pointer to the webs structure - * is passed as an (int) in iwp. - */ - -static void websSocketEvent(int sid, int mask, int iwp) -{ - webs_t wp; - - wp = (webs_t) iwp; - a_assert(wp); - - if (! websValid(wp)) { - return; - } - - if (mask & SOCKET_READABLE) { - websReadEvent(wp); - } - if (mask & SOCKET_WRITABLE) { - if (wp->writeSocket) { - (*wp->writeSocket)(wp); - } - } -} - -/******************************************************************************/ -/* - * The webs read handler. This is the primary read event loop. It uses a - * state machine to track progress while parsing the HTTP request. - * Note: we never block as the socket is always in non-blocking mode. - */ - -void websReadEvent(webs_t wp) -{ - char_t *text; - int rc, nbytes, len, done, fd; - - a_assert(wp); - a_assert(websValid(wp)); - - websMarkTime(wp); - -/* - * Read as many lines as possible. socketGets is called to read the header - * and socketRead is called to read posted data. - */ - text = NULL; - fd = -1; - for (done = 0; !done; ) { - if (text) { - bfree(B_L, text); - text = NULL; - } - -/* - * Get more input into "text". Returns 0, if more data is needed - * to continue, -1 if finished with the request, or 1 if all - * required data is available for current state. - */ - while ((rc = websGetInput(wp, &text, &nbytes)) == 0) { - ; - } - -/* - * websGetInput returns -1 if it finishes with the request - */ - if (rc < 0) { - break; - } - -/* - * This is the state machine for the web server. - */ - switch(wp->state) { - case WEBS_BEGIN: -/* - * Parse the first line of the Http header - */ - if (websParseFirst(wp, text) < 0) { - done++; - break; - } - wp->state = WEBS_HEADER; - break; - - case WEBS_HEADER: -/* - * Store more of the HTTP header. As we are doing line reads, we - * need to separate the lines with '\n' - */ - if (ringqLen(&wp->header) > 0) { - ringqPutStr(&wp->header, T("\n")); - } - ringqPutStr(&wp->header, text); - break; - - case WEBS_POST_CLEN: -/* - * POST request with content specified by a content length. - * If this is a CGI request, write the data to the cgi stdin. - * socketGets was used to get the data and it strips \n's so - * add them back in here. - */ -#ifndef __NO_CGI_BIN - if (wp->flags & WEBS_CGI_REQUEST) { - if (fd == -1) { - fd = gopen(wp->cgiStdin, O_CREAT | O_WRONLY | O_BINARY, - 0666); - } - gwrite(fd, text, gstrlen(text)); - gwrite(fd, T("\n"), sizeof(char_t)); - nbytes += 1; - } else -#endif - if (wp->query) { - if (wp->query[0] && !(wp->flags & WEBS_POST_DATA)) { -/* - * Special case where the POST request also had query data - * specified in the URL, ie. url?query_data. In this case - * the URL query data is separated by a '&' from the posted - * query data. - */ - len = gstrlen(wp->query); - wp->query = brealloc(B_L, wp->query, (len + gstrlen(text) + - 2) * sizeof(char_t)); - wp->query[len++] = '&'; - gstrcpy(&wp->query[len], text); - - } else { -/* - * The existing query data came from the POST request so just - * append it. - */ - len = gstrlen(wp->query); - wp->query = brealloc(B_L, wp->query, (len + gstrlen(text) + - 1) * sizeof(char_t)); - if (wp->query) { - gstrcpy(&wp->query[len], text); - } - } - - } else { - wp->query = bstrdup(B_L, text); - } -/* - * Calculate how much more post data is to be read. - */ - wp->flags |= WEBS_POST_DATA; - wp->clen -= nbytes; - if (wp->clen > 0) { - if (nbytes > 0) { - break; - } - done++; - break; - } -/* - * No more data so process the request - */ - websUrlHandlerRequest(wp); - done++; - break; - - case WEBS_POST: -/* - * POST without content-length specification - * If this is a CGI request, write the data to the cgi stdin. - * socketGets was used to get the data and it strips \n's so - * add them back in here. - */ - -#ifndef __NO_CGI_BIN - if (wp->flags & WEBS_CGI_REQUEST) { - if (fd == -1) { - fd = gopen(wp->cgiStdin, O_CREAT | O_WRONLY | O_BINARY, - 0666); - } - gwrite(fd, text, gstrlen(text)); - gwrite(fd, T("\n"), sizeof(char_t)); - } else -#endif - if (wp->query && *wp->query && !(wp->flags & WEBS_POST_DATA)) { - len = gstrlen(wp->query); - wp->query = brealloc(B_L, wp->query, (len + gstrlen(text) + - 2) * sizeof(char_t)); - if (wp->query) { - wp->query[len++] = '&'; - gstrcpy(&wp->query[len], text); - } - - } else { - wp->query = bstrdup(B_L, text); - } - wp->flags |= WEBS_POST_DATA; - done++; - break; - - default: - websError(wp, 404, T("Bad state")); - done++; - break; - } - } - - if (fd != -1) { - fd = gclose (fd); - } - - if (text) { - bfree(B_L, text); - } -} - -/******************************************************************************/ -/* - * Get input from the browser. Return TRUE (!0) if the request has been - * handled. Return -1 on errors or if the request has been processed, - * 1 if input read, and 0 to instruct the caller to call again for more input. - * - * Note: socketRead will Return the number of bytes read if successful. This - * may be less than the requested "bufsize" and may be zero. It returns -1 for - * errors. It returns 0 for EOF. Otherwise it returns the number of bytes - * read. Since this may be zero, callers should use socketEof() to - * distinguish between this and EOF. - */ - -static int websGetInput(webs_t wp, char_t **ptext, int *pnbytes) -{ - char_t *text; - char buf[WEBS_SOCKET_BUFSIZ+1]; - int nbytes, len, clen; - - a_assert(websValid(wp)); - a_assert(ptext); - a_assert(pnbytes); - - *ptext = text = NULL; - *pnbytes = 0; - -/* - * If this request is a POST with a content length, we know the number - * of bytes to read so we use socketRead(). - */ - if (wp->state == WEBS_POST_CLEN) { - len = (wp->clen > WEBS_SOCKET_BUFSIZ) ? WEBS_SOCKET_BUFSIZ : wp->clen; - } else { - len = 0; - } - - if (len > 0) { - -#ifdef WEBS_SSL_SUPPORT - if (wp->flags & WEBS_SECURE) { - nbytes = websSSLRead(wp->wsp, buf, len); - } else { - nbytes = socketRead(wp->sid, buf, len); - } -#else - nbytes = socketRead(wp->sid, buf, len); -#endif - if (nbytes < 0) { /* Error */ - websDone(wp, 0); - return -1; - - } else if (nbytes == 0) { /* EOF or No data available */ - return -1; - - } else { /* Valid data */ -/* - * Convert to UNICODE if necessary. First be sure the string - * is NULL terminated. - */ - buf[nbytes] = '\0'; - if ((text = ballocAscToUni(buf, nbytes)) == NULL) { - websError(wp, 503, T("Insufficient memory")); - return -1; - } - } - - } else { -#ifdef WEBS_SSL_SUPPORT - if (wp->flags & WEBS_SECURE) { - nbytes = websSSLGets(wp->wsp, &text); - } else { - nbytes = socketGets(wp->sid, &text); - } -#else - nbytes = socketGets(wp->sid, &text); -#endif - - if (nbytes < 0) { - int eof; -/* - * Error, EOF or incomplete - */ -#ifdef WEBS_SSL_SUPPORT - if (wp->flags & WEBS_SECURE) { -/* - * If state is WEBS_BEGIN and the request is secure, a -1 will - * usually indicate SSL negotiation - */ - if (wp->state == WEBS_BEGIN) { - eof = 1; - } else { - eof = websSSLEof(wp->wsp); - } - } else { - eof = socketEof(wp->sid); - } -#else - eof = socketEof(wp->sid); -#endif - - if (eof) { -/* - * If this is a post request without content length, process - * the request as we now have all the data. Otherwise just - * close the connection. - */ - if (wp->state == WEBS_POST) { - websUrlHandlerRequest(wp); - } else { - websDone(wp, 0); - } - } -/* - * If state is WEBS_HEADER and the ringq is empty, then this is a - * simple request with no additional header fields to process and - * no empty line terminator. - */ - if (wp->state == WEBS_HEADER && ringqLen(&wp->header) <= 0) { - websParseRequest(wp); - websUrlHandlerRequest(wp); - } - return -1; - - } else if (nbytes == 0) { - if (wp->state == WEBS_HEADER) { -/* - * Valid empty line, now finished with header - */ - websParseRequest(wp); - if (wp->flags & WEBS_POST_REQUEST) { - if (wp->flags & WEBS_CLEN) { - wp->state = WEBS_POST_CLEN; - clen = wp->clen; - } else { - wp->state = WEBS_POST; - clen = 1; - } - if (clen > 0) { -/* - * Return 0 to get more data. - */ - return 0; - } - return 1; - } -/* - * We've read the header so go and handle the request - */ - websUrlHandlerRequest(wp); - } - return -1; - } - } - a_assert(text); - a_assert(nbytes > 0); - *ptext = text; - *pnbytes = nbytes; - return 1; -} - -/******************************************************************************/ -/* - * Parse the first line of a HTTP request - */ - -static int websParseFirst(webs_t wp, char_t *text) -{ - char_t *op, *proto, *protoVer, *url, *host, *query, *path, *port, *ext; - char_t *buf; - int testPort; - - a_assert(websValid(wp)); - a_assert(text && *text); - -/* - * Determine the request type: GET, HEAD or POST - */ - op = gstrtok(text, T(" \t")); - if (op == NULL || *op == '\0') { - websError(wp, 400, T("Bad HTTP request")); - return -1; - } - if (gstrcmp(op, T("GET")) != 0) { - if (gstrcmp(op, T("POST")) == 0) { - wp->flags |= WEBS_POST_REQUEST; - } else if (gstrcmp(op, T("HEAD")) == 0) { - wp->flags |= WEBS_HEAD_REQUEST; - } else { - websError(wp, 400, T("Bad request type")); - return -1; - } - } - -/* - * Store result in the form (CGI) variable store - */ - websSetVar(wp, T("REQUEST_METHOD"), op); - - url = gstrtok(NULL, T(" \t\n")); - if (url == NULL || *url == '\0') { - websError(wp, 400, T("Bad HTTP request")); - return -1; - } - protoVer = gstrtok(NULL, T(" \t\n")); - -/* - * Parse the URL and store all the various URL components. websUrlParse - * returns an allocated buffer in buf which we must free. We support both - * proxied and non-proxied requests. Proxied requests will have http://host/ - * at the start of the URL. Non-proxied will just be local path names. - */ - host = path = port = proto = query = ext = NULL; - if (websUrlParse(url, &buf, &host, &path, &port, &query, &proto, - NULL, &ext) < 0) { - websError(wp, 400, T("Bad URL format")); - return -1; - } - - wp->url = bstrdup(B_L, url); - -#ifndef __NO_CGI_BIN - if (gstrstr(url, CGI_BIN) != NULL) { - wp->flags |= WEBS_CGI_REQUEST; - if (wp->flags & WEBS_POST_REQUEST) { - wp->cgiStdin = websGetCgiCommName(); - } - } -#endif - - wp->query = bstrdup(B_L, query); - wp->host = bstrdup(B_L, host); - wp->path = bstrdup(B_L, path); - wp->protocol = bstrdup(B_L, proto); - wp->protoVersion = bstrdup(B_L, protoVer); - - if ((testPort = socketGetPort(wp->listenSid)) >= 0) { - wp->port = testPort; - } else { - wp->port = gatoi(port); - } - - if (gstrcmp(ext, T(".asp")) == 0) { - wp->flags |= WEBS_ASP; - } - bfree(B_L, buf); - - websUrlType(url, wp->type, TSZ(wp->type)); - -#if WEBS_PROXY_SUPPORT -/* - * Determine if this is a request for local webs data. If it is not a proxied - * request from the browser, we won't see the "http://" or the system name, so - * we assume it must be talking to us directly for local webs data. - * Note: not fully implemented yet. - */ - if (gstrstr(wp->url, T("http://")) == NULL || - ((gstrcmp(wp->host, T("localhost")) == 0 || - gstrcmp(wp->host, websHost) == 0) && (wp->port == websPort))) { - wp->flags |= WEBS_LOCAL_PAGE; - if (gstrcmp(wp->path, T("/")) == 0) { - wp->flags |= WEBS_HOME_PAGE; - } - } -#endif - - ringqFlush(&wp->header); - return 0; -} - -/******************************************************************************/ -/* - * Parse a full request - */ - -#define isgoodchar(s) (gisalnum((s)) || ((s) == '/') || ((s) == '_') || \ - ((s) == '.') || ((s) == '-') ) - -static void websParseRequest(webs_t wp) -{ - char_t *authType, *upperKey, *cp, *browser, *lp, *key, *value; - - a_assert(websValid(wp)); - -/* - * Define default CGI values - */ - websSetVar(wp, T("HTTP_AUTHORIZATION"), T("")); - -/* - * Parse the header and create the Http header keyword variables - * We rewrite the header as we go for non-local requests. NOTE: this - * modifies the header string directly and tokenizes each line with '\0'. - */ - browser = NULL; - for (lp = (char_t*) wp->header.servp; lp && *lp; ) { - cp = lp; - if ((lp = gstrchr(lp, '\n')) != NULL) { - lp++; - } - - if ((key = gstrtok(cp, T(": \t\n"))) == NULL) { - continue; - } - - if ((value = gstrtok(NULL, T("\n"))) == NULL) { - value = T(""); - } - - while (gisspace(*value)) { - value++; - } - strlower(key); - -/* - * Create a variable (CGI) for each line in the header - */ - fmtAlloc(&upperKey, (gstrlen(key) + 6), T("HTTP_%s"), key); - for (cp = upperKey; *cp; cp++) { - if (*cp == '-') - *cp = '_'; - } - strupper(upperKey); - websSetVar(wp, upperKey, value); - bfree(B_L, upperKey); - -/* - * Track the requesting agent (browser) type - */ - if (gstrcmp(key, T("user-agent")) == 0) { - wp->userAgent = bstrdup(B_L, value); - -/* - * Parse the user authorization. ie. password - */ - } else if (gstricmp(key, T("authorization")) == 0) { -/* - * Determine the type of Authorization Request - */ - authType = bstrdup (B_L, value); - a_assert (authType); -/* - * Truncate authType at the next non-alpha character - */ - cp = authType; - while (gisalpha(*cp)) { - cp++; - } - *cp = '\0'; - - wp->authType = bstrdup(B_L, authType); - bfree(B_L, authType); - - if (gstricmp(wp->authType, T("basic")) == 0) { - char_t userAuth[FNAMESIZE]; -/* - * The incoming value is username:password (Basic authentication) - */ - if ((cp = gstrchr(value, ' ')) != NULL) { - *cp = '\0'; - wp->authType = bstrdup(B_L, value); - websDecode64(userAuth, ++cp, sizeof(userAuth)); - } else { - websDecode64(userAuth, value, sizeof(userAuth)); - } -/* - * Split userAuth into userid and password - */ - if ((cp = gstrchr(userAuth, ':')) != NULL) { - *cp++ = '\0'; - } - if (cp) { - wp->userName = bstrdup(B_L, userAuth); - wp->password = bstrdup(B_L, cp); - } else { - wp->userName = bstrdup(B_L, T("")); - wp->password = bstrdup(B_L, T("")); - } -/* - * Set the flags to indicate digest authentication - */ - wp->flags |= WEBS_AUTH_BASIC; - } else { -#ifdef DIGEST_ACCESS_SUPPORT -/* - * The incoming value is slightly more complicated (Digest) - */ - char_t *np; /* pointer to end of tag name */ - char_t tp; /* temporary character holding space */ - char_t *vp; /* pointer to value */ - char_t *npv; /* pointer to end of value, "next" pointer */ - char_t tpv; /* temporary character holding space */ -/* - * Set the flags to indicate digest authentication - */ - wp->flags |= WEBS_AUTH_DIGEST; -/* - * Move cp to Next word beyond "Digest", - * vp to first char after '='. - */ - cp = value; - while (isgoodchar(*cp)) { - cp++; - } - while (!isgoodchar(*cp)) { - cp++; - } - -/* - * Find beginning of value - */ - vp = gstrchr(cp, '='); - while (vp) { -/* - * Zero-terminate tag name - */ - np = cp; - while (isgoodchar(*np)) { - np++; - } - tp = *np; - *np = 0; -/* - * Advance value pointer to first legit character - */ - vp++; - while (!isgoodchar(*vp)) { - vp++; - } -/* - * Zero-terminate value - */ - npv = vp; - while (isgoodchar(*npv)) { - npv++; - } - tpv = *npv; - *npv = 0; -/* - * Extract the fields - */ - if (gstricmp(cp, T("username")) == 0) { - wp->userName = bstrdup(B_L, vp); - } else if (gstricmp(cp, T("response")) == 0) { - wp->digest = bstrdup(B_L, vp); - } else if (gstricmp(cp, T("opaque")) == 0) { - wp->opaque = bstrdup(B_L, vp); - } else if (gstricmp(cp, T("uri")) == 0) { - wp->uri = bstrdup(B_L, vp); - } else if (gstricmp(cp, T("realm")) == 0) { - wp->realm = bstrdup(B_L, vp); - } else if (gstricmp(cp, T("nonce")) == 0) { - wp->nonce = bstrdup(B_L, vp); - } else if (gstricmp(cp, T("nc")) == 0) { - wp->nc = bstrdup(B_L, vp); - } else if (gstricmp(cp, T("cnonce")) == 0) { - wp->cnonce = bstrdup(B_L, vp); - } else if (gstricmp(cp, T("qop")) == 0) { - wp->qop = bstrdup(B_L, vp); - } -/* - * Restore tag name and value zero-terminations - */ - *np = tp; - *npv = tpv; -/* - * Advance tag name and value pointers - */ - cp = npv; - while (*cp && isgoodchar(*cp)) { - cp++; - } - while (*cp && !isgoodchar(*cp)) { - cp++; - } - - if (*cp) { - vp = gstrchr(cp, '='); - } else { - vp = NULL; - } - } -#endif /* DIGEST_ACCESS_SUPPORT */ - } /* if (gstrcmp(wp->authType)) */ -/* - * Parse the content length - */ - } else if (gstrcmp(key, T("content-length")) == 0) { - wp->flags |= WEBS_CLEN; - wp->clen = gatoi(value); - websSetVar(wp, T("CONTENT_LENGTH"), value); - -/* - * Parse the content type - */ - } else if (gstrcmp(key, T("content-type")) == 0) { - websSetVar(wp, T("CONTENT_TYPE"), value); - -#if WEBS_KEEP_ALIVE_SUPPORT - } else if (gstrcmp(key, T("connection")) == 0) { - strlower(value); - if (gstrcmp(value, T("keep-alive")) == 0) { - wp->flags |= WEBS_KEEP_ALIVE; - } -#endif - -#if WEBS_PROXY_SUPPORT -/* - * This may be useful if you wish to keep a local cache of web pages - * for proxied requests. - */ - } else if (gstrcmp(key, T("pragma")) == 0) { - char_t tmp[256]; - gstrncpy(tmp, value, TSZ(tmp)); - strlower(tmp); - if (gstrstr(tmp, T("no-cache"))) { - wp->flags |= WEBS_DONT_USE_CACHE; - } -#endif /* WEBS_PROXY_SUPPORT */ - -/* - * Store the cookie - */ - } else if (gstrcmp(key, T("cookie")) == 0) { - wp->flags |= WEBS_COOKIE; - wp->cookie = bstrdup(B_L, value); - -#if WEBS_IF_MODIFIED_SUPPORT -/* - * See if the local page has been modified since the browser last - * requested this document. If not, just return a 302 - */ - } else if (gstrcmp(key, T("if-modified-since")) == 0) { - char_t *cmd; - time_t tip = 0; - - if ((cp = gstrchr(value, ';')) != NULL) { - *cp = '\0'; - } - - fmtAlloc(&cmd, 64, T("%s"), value); - - if ((wp->since = dateParse(tip, cmd)) != 0) { - wp->flags |= WEBS_IF_MODIFIED; - } - - bfreeSafe(B_L, cmd); -#endif /* WEBS_IF_MODIFIED_SUPPORT */ - } - } -} - -/******************************************************************************/ -/* - * Set the variable (CGI) environment for this request. Create variables - * for all standard CGI variables. Also decode the query string and create - * a variable for each name=value pair. - */ - -void websSetEnv(webs_t wp) -{ - char_t portBuf[8]; - char_t *keyword, *value, *valCheck, *valNew; - - a_assert(websValid(wp)); - - websSetVar(wp, T("QUERY_STRING"), wp->query); - websSetVar(wp, T("GATEWAY_INTERFACE"), T("CGI/1.1")); - websSetVar(wp, T("SERVER_HOST"), websHost); - websSetVar(wp, T("SERVER_NAME"), websHost); - websSetVar(wp, T("SERVER_URL"), websHostUrl); - websSetVar(wp, T("REMOTE_HOST"), wp->ipaddr); - websSetVar(wp, T("REMOTE_ADDR"), wp->ipaddr); - websSetVar(wp, T("PATH_INFO"), wp->path); - stritoa(websPort, portBuf, sizeof(portBuf)); - websSetVar(wp, T("SERVER_PORT"), portBuf); - websSetVar(wp, T("SERVER_ADDR"), websIpaddr); - fmtAlloc(&value, FNAMESIZE, T("%s/%s"), WEBS_NAME, WEBS_VERSION); - websSetVar(wp, T("SERVER_SOFTWARE"), value); - bfreeSafe(B_L, value); - websSetVar(wp, T("SERVER_PROTOCOL"), wp->protoVersion); - -/* - * Decode and create an environment query variable for each query keyword. - * We split into pairs at each '&', then split pairs at the '='. - * Note: we rely on wp->decodedQuery preserving the decoded values in the - * symbol table. - */ - wp->decodedQuery = bstrdup(B_L, wp->query); - keyword = gstrtok(wp->decodedQuery, T("&")); - while (keyword != NULL) { - if ((value = gstrchr(keyword, '=')) != NULL) { - *value++ = '\0'; - websDecodeUrl(keyword, keyword, gstrlen(keyword)); - websDecodeUrl(value, value, gstrlen(value)); - } else { - value = T(""); - } - - if (*keyword) { -/* - * If keyword has already been set, append the new value to what has - * been stored. - */ - if ((valCheck = websGetVar(wp, keyword, NULL)) != 0) { - fmtAlloc(&valNew, 256, T("%s %s"), valCheck, value); - websSetVar(wp, keyword, valNew); - bfreeSafe(B_L, valNew); - } else { - websSetVar(wp, keyword, value); - } - } - keyword = gstrtok(NULL, T("&")); - } - -#if EMF -/* - * Add GoAhead Embedded Management Framework defines - */ - websSetEmfEnvironment(wp); -#endif -} - -/******************************************************************************/ -/* - * Define a webs (CGI) variable for this connection. Also create in relevant - * scripting engines. Note: the incoming value may be volatile. - */ - -void websSetVar(webs_t wp, char_t *var, char_t *value) -{ - value_t v; - - a_assert(websValid(wp)); - -/* - * value_instring will allocate the string if required. - */ - if (value) { - v = valueString(value, VALUE_ALLOCATE); - } else { - v = valueString(T(""), VALUE_ALLOCATE); - } - symEnter(wp->cgiVars, var, v, 0); -} - -/******************************************************************************/ -/* - * Return TRUE if a webs variable exists for this connection. - */ - -int websTestVar(webs_t wp, char_t *var) -{ - sym_t *sp; - - a_assert(websValid(wp)); - - if (var == NULL || *var == '\0') { - return 0; - } - - if ((sp = symLookup(wp->cgiVars, var)) == NULL) { - return 0; - } - return 1; -} - -/******************************************************************************/ -/* - * Get a webs variable but return a default value if string not found. - * Note, defaultGetValue can be NULL to permit testing existence. - */ - -char_t *websGetVar(webs_t wp, char_t *var, char_t *defaultGetValue) -{ - sym_t *sp; - - a_assert(websValid(wp)); - a_assert(var && *var); - - if ((sp = symLookup(wp->cgiVars, var)) != NULL) { - a_assert(sp->content.type == string); - if (sp->content.value.string) { - return sp->content.value.string; - } else { - return T(""); - } - } - return defaultGetValue; -} - -/******************************************************************************/ -/* - * Return TRUE if a webs variable is set to a given value - */ - -int websCompareVar(webs_t wp, char_t *var, char_t *value) -{ - a_assert(websValid(wp)); - a_assert(var && *var); - - if (gstrcmp(value, websGetVar(wp, var, T(" __UNDEF__ "))) == 0) { - return 1; - } - return 0; -} - -/******************************************************************************/ -/* - * Cancel the request timeout. Note may be called multiple times. - */ - -void websTimeoutCancel(webs_t wp) -{ - a_assert(websValid(wp)); - - if (wp->timeout >= 0) { - emfUnschedCallback(wp->timeout); - wp->timeout = -1; - } -} - -/******************************************************************************/ -/* - * Output a HTTP response back to the browser. If redirect is set to a - * URL, the browser will be sent to this location. - */ - -void websResponse(webs_t wp, int code, char_t *message, char_t *redirect) -{ - char_t *date; - - a_assert(websValid(wp)); - -/* - * IE3.0 needs no Keep Alive for some return codes. - */ - wp->flags &= ~WEBS_KEEP_ALIVE; - -/* - * Only output the header if a header has not already been output. - */ - if ( !(wp->flags & WEBS_HEADER_DONE)) { - wp->flags |= WEBS_HEADER_DONE; - websWrite(wp, T("HTTP/1.1 %d %s\r\n"), code, websErrorMsg(code)); -/* - * By license terms the following line of code must not be modified. - */ - websWrite(wp, T("Server: %s\r\n"), WEBS_NAME); - -/* - * Timestamp/Date is usually the next to go - */ - if ((date = websGetDateString(NULL)) != NULL) { - websWrite(wp, T("Date: %s\r\n"), date); - bfree(B_L, date); - } -/* - * If authentication is required, send the auth header info - */ - if (code == 401) { - if (!(wp->flags & WEBS_AUTH_DIGEST)) { - websWrite(wp, T("WWW-Authenticate: Basic realm=\"%s\"\r\n"), - websGetRealm()); -#ifdef DIGEST_ACCESS_SUPPORT - } else { - char_t *nonce, *opaque; - - nonce = websCalcNonce(wp), - opaque = websCalcOpaque(wp), - websWrite(wp, - T("WWW-Authenticate: Digest realm=\"%s\", domain=\"%s\",") - T("qop=\"%s\", nonce=\"%s\", opaque=\"%s\",") - T("algorithm=\"%s\", stale=\"%s\"\r\n"), - websGetRealm(), - websGetHostUrl(), - T("auth"), - nonce, - opaque, T("MD5"), T("FALSE")); - bfree(B_L, nonce); - bfree(B_L, opaque); -#endif - } - } - - if (wp->flags & WEBS_KEEP_ALIVE) { - websWrite(wp, T("Connection: keep-alive\r\n")); - } - - websWrite(wp, T("Pragma: no-cache\r\nCache-Control: no-cache\r\n")); - websWrite(wp, T("Content-Type: text/html\r\n")); -/* - * We don't do a string length here as the message may be multi-line. - * Ie. will count as only one and we will have a content-length - * that is too short. - * - * websWrite(wp, T("Content-Length: %s\r\n"), message); - */ - if (redirect) { - websWrite(wp, T("Location: %s\r\n"), redirect); - } - websWrite(wp, T("\r\n")); - } - -/* - * If the browser didn't do a HEAD only request, send the message as well. - */ - if ((wp->flags & WEBS_HEAD_REQUEST) == 0 && message && *message) { - websWrite(wp, T("%s\r\n"), message); - } - websDone(wp, code); -} - -/******************************************************************************/ -/* - * Redirect the user to another webs page - */ - -void websRedirect(webs_t wp, char_t *url) -{ - char_t *msgbuf, *urlbuf, *redirectFmt; - - a_assert(websValid(wp)); - a_assert(url); - - websStats.redirects++; - msgbuf = urlbuf = NULL; - -/* - * Some browsers require a http://host qualified URL for redirection - */ - if (gstrstr(url, T("http://")) == NULL) { - if (*url == '/') { - url++; - } - - redirectFmt = T("http://%s/%s"); - -#ifdef WEBS_SSL_SUPPORT - if (wp->flags & WEBS_SECURE) { - redirectFmt = T("https://%s/%s"); - } -#endif - - fmtAlloc(&urlbuf, WEBS_MAX_URL + 80, redirectFmt, - websGetVar(wp, T("HTTP_HOST"), websHostUrl), url); - url = urlbuf; - } - -/* - * Add human readable message for completeness. Should not be required. - */ - fmtAlloc(&msgbuf, WEBS_MAX_URL + 80, - T("\r\n\ - This document has moved to a new location.\r\n\ - Please update your documents to reflect the new location.\r\n\ - \r\n"), url); - - websResponse(wp, 302, msgbuf, url); - - bfreeSafe(B_L, msgbuf); - bfreeSafe(B_L, urlbuf); -} - -/******************************************************************************/ -/* - * Output an error message and cleanup - */ - -void websError(webs_t wp, int code, char_t *fmt, ...) -{ - va_list args; - char_t *msg, *userMsg, *buf; - - a_assert(websValid(wp)); - a_assert(fmt); - - websStats.errors++; - - va_start(args, fmt); - userMsg = NULL; - fmtValloc(&userMsg, WEBS_BUFSIZE, fmt, args); - va_end(args); - - msg = T("Document Error: %s\r\n\ -

Access Error: %s

\r\n\ - when trying to obtain %s

%s

\r\n"); -/* - * Ensure we have plenty of room - */ - buf = NULL; - fmtAlloc(&buf, WEBS_BUFSIZE, msg, websErrorMsg(code), - websErrorMsg(code), wp->url, userMsg); - - websResponse(wp, code, buf, NULL); - bfreeSafe(B_L, buf); - bfreeSafe(B_L, userMsg); -} - -/******************************************************************************/ -/* - * Return the error message for a given code - */ - -static char_t *websErrorMsg(int code) -{ - websErrorType *ep; - - for (ep = websErrors; ep->code; ep++) { - if (code == ep->code) { - return ep->msg; - } - } - a_assert(0); - return T(""); -} - -/******************************************************************************/ -/* - * Do formatted output to the browser. This is the public ASP and form - * write procedure. - */ - -int websWrite(webs_t wp, char_t *fmt, ...) -{ - va_list vargs; - char_t *buf; - int rc; - - a_assert(websValid(wp)); - - va_start(vargs, fmt); - - buf = NULL; - rc = 0; - if (fmtValloc(&buf, WEBS_BUFSIZE, fmt, vargs) >= WEBS_BUFSIZE) { - trace(0, T("webs: websWrite lost data, buffer overflow\n")); - } - va_end(vargs); - a_assert(buf); - if (buf) { - rc = websWriteBlock(wp, buf, gstrlen(buf)); - bfree(B_L, buf); - } - return rc; -} - -/******************************************************************************/ -/* - * Write a block of data of length "nChars" to the user's browser. Public - * write block procedure. If unicode is turned on this function expects - * buf to be a unicode string and it converts it to ASCII before writing. - * See websWriteDataNonBlock to always write binary or ASCII data with no - * unicode conversion. This returns the number of char_t's processed. - * It spins until nChars are flushed to the socket. For non-blocking - * behavior, use websWriteDataNonBlock. - */ - -int websWriteBlock(webs_t wp, char_t *buf, int nChars) -{ - int len, done; - char *asciiBuf, *pBuf; - - a_assert(wp); - a_assert(websValid(wp)); - a_assert(buf); - a_assert(nChars >= 0); - - done = len = 0; - -/* - * ballocUniToAsc will convert Unicode to strings to Ascii. If Unicode is - * not turned on then ballocUniToAsc will not do the conversion. - */ - pBuf = asciiBuf = ballocUniToAsc(buf, nChars); - - while (nChars > 0) { -#ifdef WEBS_SSL_SUPPORT - if (wp->flags & WEBS_SECURE) { - if ((len = websSSLWrite(wp->wsp, pBuf, nChars)) < 0) { - bfree(B_L, asciiBuf); - return -1; - } - websSSLFlush(wp->wsp); - } else { - if ((len = socketWrite(wp->sid, pBuf, nChars)) < 0) { - bfree(B_L, asciiBuf); - return -1; - } - socketFlush(wp->sid); - } -#else /* ! WEBS_SSL_SUPPORT */ - if ((len = socketWrite(wp->sid, pBuf, nChars)) < 0) { - bfree(B_L, asciiBuf); - return -1; - } - socketFlush(wp->sid); -#endif /* WEBS_SSL_SUPPORT */ - nChars -= len; - pBuf += len; - done += len; - } - - bfree(B_L, asciiBuf); - return done; -} - -/******************************************************************************/ -/* - * Write a block of data of length "nChars" to the user's browser. Same as - * websWriteBlock except that it expects straight ASCII or binary and does no - * unicode conversion before writing the data. If the socket cannot hold all - * the data, it will return the number of bytes flushed to the socket before - * it would have blocked. This returns the number of chars processed or -1 - * if socketWrite fails. - */ - -int websWriteDataNonBlock(webs_t wp, char *buf, int nChars) -{ - int r; - - a_assert(wp); - a_assert(websValid(wp)); - a_assert(buf); - a_assert(nChars >= 0); - -#ifdef WEBS_SSL_SUPPORT - if (wp->flags & WEBS_SECURE) { - r = websSSLWrite(wp->wsp, buf, nChars); - websSSLFlush(wp->wsp); - } else { - r = socketWrite(wp->sid, buf, nChars); - socketFlush(wp->sid); - } -#else - r = socketWrite(wp->sid, buf, nChars); - socketFlush(wp->sid); -#endif - - return r; -} - -/******************************************************************************/ -/* - * Decode a URL (or part thereof). Allows insitu decoding. - */ - -void websDecodeUrl(char_t *decoded, char_t *token, int len) -{ - char_t *ip, *op; - int num, i, c; - - a_assert(decoded); - a_assert(token); - - op = decoded; - for (ip = token; *ip && len > 0; ip++, op++) { - if (*ip == '+') { - *op = ' '; - } else if (*ip == '%' && gisxdigit(ip[1]) && gisxdigit(ip[2])) { - -/* - * Convert %nn to a single character - */ - ip++; - for (i = 0, num = 0; i < 2; i++, ip++) { - c = tolower(*ip); - if (c >= 'a' && c <= 'f') { - num = (num * 16) + 10 + c - 'a'; - } else { - num = (num * 16) + c - '0'; - } - } - *op = (char_t) num; - ip--; - - } else { - *op = *ip; - } - len--; - } - *op = '\0'; -} - -/******************************************************************************/ -#if WEBS_LOG_SUPPORT -/* - * Output a log message - */ - -static void websLog(webs_t wp, int code) -{ - char_t *buf; - char *abuf; - int len; - - a_assert(websValid(wp)); - - buf = NULL; - fmtAlloc(&buf, WEBS_MAX_URL + 80, T("%d %s %d %d\n"), time(0), - wp->url, code, wp->written); - len = gstrlen(buf); - abuf = ballocUniToAsc(buf, len+1); - write(websLogFd, abuf, len); - bfreeSafe(B_L, buf); - bfreeSafe(B_L, abuf); -} - -#endif /* WEBS_LOG_SUPPORT */ - -/******************************************************************************/ -/* - * Request timeout. The timeout triggers if we have not read any data from - * the users browser in the last WEBS_TIMEOUT period. If we have heard from - * the browser, simply re-issue the timeout. - */ - -void websTimeout(void *arg, int id) -{ - webs_t wp; - int delay, tm; - - wp = (webs_t) arg; - a_assert(websValid(wp)); - - tm = websGetTimeSinceMark(wp) * 1000; - if (tm >= WEBS_TIMEOUT) { - websStats.timeouts++; - emfUnschedCallback(id); - -/* - * Clear the timeout id - */ - wp->timeout = -1; - websDone(wp, 404); - - } else { - delay = WEBS_TIMEOUT - tm; - a_assert(delay > 0); - emfReschedCallback(id, delay); - } -} - -/******************************************************************************/ -/* - * Called when the request is done. - */ - -void websDone(webs_t wp, int code) -{ - a_assert(websValid(wp)); - -/* - * Disable socket handler in case keep alive set. - */ - socketDeleteHandler(wp->sid); - - if (code != 200) { - wp->flags &= ~WEBS_KEEP_ALIVE; - } - -#if WEBS_PROXY_SUPPORT - if (! (wp->flags & WEBS_LOCAL_PAGE)) { - websStats.activeNetRequests--; - } -#endif - -#if WEBS_LOG_SUPPORT - if (! (wp->flags & WEBS_REQUEST_DONE)) { - websLog(wp, code); - } -#endif - -/* - * Close any opened document by a handler - */ - websPageClose(wp); - -/* - * Exit if secure. - */ -#ifdef WEBS_SSL_SUPPORT - if (wp->flags & WEBS_SECURE) { - websTimeoutCancel(wp); - websSSLFlush(wp->wsp); - socketCloseConnection(wp->sid); - websFree(wp); - return; - } -#endif - -/* - * If using Keep Alive (HTTP/1.1) we keep the socket open for a period - * while waiting for another request on the socket. - */ - if (wp->flags & WEBS_KEEP_ALIVE) { - if (socketFlush(wp->sid) == 0) { - wp->state = WEBS_BEGIN; - wp->flags |= WEBS_REQUEST_DONE; - if (wp->header.buf) { - ringqFlush(&wp->header); - } - socketCreateHandler(wp->sid, SOCKET_READABLE, websSocketEvent, - (int) wp); - websTimeoutCancel(wp); - wp->timeout = emfSchedCallback(WEBS_TIMEOUT, websTimeout, - (void *) wp); - return; - } - } else { - websTimeoutCancel(wp); - socketSetBlock(wp->sid, 1); - socketFlush(wp->sid); - socketCloseConnection(wp->sid); - } - websFree(wp); -} - -/******************************************************************************/ -/* - * Allocate a new webs structure - */ - -int websAlloc(int sid) -{ - webs_t wp; - int wid; - -/* - * Allocate a new handle for this connection - */ - if ((wid = hAllocEntry((void***) &webs, &websMax, - sizeof(struct websRec))) < 0) { - return -1; - } - wp = webs[wid]; - - wp->wid = wid; - wp->sid = sid; - wp->state = WEBS_BEGIN; - wp->docfd = -1; - wp->timeout = -1; - wp->dir = NULL; - wp->authType = NULL; - wp->protocol = NULL; - wp->protoVersion = NULL; - wp->password = NULL; - wp->userName = NULL; -#ifdef DIGEST_ACCESS_SUPPORT - wp->realm = NULL; - wp->nonce = NULL; - wp->digest = NULL; - wp->uri = NULL; - wp->opaque = NULL; - wp->nc = NULL; - wp->cnonce = NULL; - wp->qop = NULL; -#endif -#ifdef WEBS_SSL_SUPPORT - wp->wsp = NULL; -#endif - - ringqOpen(&wp->header, WEBS_HEADER_BUFINC, WEBS_MAX_HEADER); - -/* - * Create storage for the CGI variables. We supply the symbol tables for - * both the CGI variables and for the global functions. The function table - * is common to all webs instances (ie. all browsers) - */ - wp->cgiVars = symOpen(WEBS_SYM_INIT); - - return wid; -} - -/******************************************************************************/ -/* - * Free a webs structure - */ - -void websFree(webs_t wp) -{ - a_assert(websValid(wp)); - - if (wp->path) - bfree(B_L, wp->path); - if (wp->url) - bfree(B_L, wp->url); - if (wp->host) - bfree(B_L, wp->host); - if (wp->lpath) - bfree(B_L, wp->lpath); - if (wp->query) - bfree(B_L, wp->query); - if (wp->decodedQuery) - bfree(B_L, wp->decodedQuery); - if (wp->authType) - bfree(B_L, wp->authType); - if (wp->password) - bfree(B_L, wp->password); - if (wp->userName) - bfree(B_L, wp->userName); - if (wp->cookie) - bfree(B_L, wp->cookie); - if (wp->userAgent) - bfree(B_L, wp->userAgent); - if (wp->dir) - bfree(B_L, wp->dir); - if (wp->protocol) - bfree(B_L, wp->protocol); - if (wp->protoVersion) - bfree(B_L, wp->protoVersion); - if (wp->cgiStdin) - bfree(B_L, wp->cgiStdin); - - -#ifdef DIGEST_ACCESS_SUPPORT - if (wp->realm) - bfree(B_L, wp->realm); - if (wp->uri) - bfree(B_L, wp->uri); - if (wp->digest) - bfree(B_L, wp->digest); - if (wp->opaque) - bfree(B_L, wp->opaque); - if (wp->nonce) - bfree(B_L, wp->nonce); - if (wp->nc) - bfree(B_L, wp->nc); - if (wp->cnonce) - bfree(B_L, wp->cnonce); - if (wp->qop) - bfree(B_L, wp->qop); -#endif -#ifdef WEBS_SSL_SUPPORT - websSSLFree(wp->wsp); -#endif - symClose(wp->cgiVars); - - if (wp->header.buf) { - ringqClose(&wp->header); - } - - websMax = hFree((void***) &webs, wp->wid); - bfree(B_L, wp); - a_assert(websMax >= 0); -} - -/******************************************************************************/ -/* - * Return the server address - */ - -char_t *websGetHost() -{ - return websHost; -} - -/******************************************************************************/ -/* - * Return the the url to access the server. (ip address) - */ - -char_t *websGetIpaddrUrl() -{ - return websIpaddrUrl; -} - -/******************************************************************************/ -/* - * Return the server address - */ - -char_t *websGetHostUrl() -{ - return websHostUrl; -} - -/******************************************************************************/ -/* - * Return the listen port - */ - -int websGetPort() -{ - return websPort; -} - -/******************************************************************************/ -/* - * Get the number of bytes to write - */ - -int websGetRequestBytes(webs_t wp) -{ - a_assert(websValid(wp)); - - return wp->numbytes; -} - -/******************************************************************************/ -/* - * Get the directory for this request - */ - -char_t *websGetRequestDir(webs_t wp) -{ - a_assert(websValid(wp)); - - if (wp->dir == NULL) { - return T(""); - } - - return wp->dir; -} - -/******************************************************************************/ -/* - * Get the flags for this request - */ - -int websGetRequestFlags(webs_t wp) -{ - a_assert(websValid(wp)); - - return wp->flags; -} - -/******************************************************************************/ -/* - * Return the IP address - */ - -char_t *websGetRequestIpaddr(webs_t wp) -{ - a_assert(websValid(wp)); - - return wp->ipaddr; -} - -/******************************************************************************/ -/* - * Set the local path for the request - */ - -char_t *websGetRequestLpath(webs_t wp) -{ - a_assert(websValid(wp)); - -#if WEBS_PAGE_ROM - return wp->path; -#else - return wp->lpath; -#endif -} - -/******************************************************************************/ -/* - * Get the path for this request - */ - -char_t *websGetRequestPath(webs_t wp) -{ - a_assert(websValid(wp)); - - if (wp->path == NULL) { - return T(""); - } - - return wp->path; -} - -/******************************************************************************/ -/* - * Return the password - */ - -char_t *websGetRequestPassword(webs_t wp) -{ - a_assert(websValid(wp)); - - return wp->password; -} - -/******************************************************************************/ -/* - * Return the request type - */ - -char_t *websGetRequestType(webs_t wp) -{ - a_assert(websValid(wp)); - - return wp->type; -} - -/******************************************************************************/ -/* - * Return the username - */ - -char_t *websGetRequestUserName(webs_t wp) -{ - a_assert(websValid(wp)); - - return wp->userName; -} - -/******************************************************************************/ -/* - * Get the number of bytes written - */ - -int websGetRequestWritten(webs_t wp) -{ - a_assert(websValid(wp)); - - return wp->written; -} - -/******************************************************************************/ -/* - * Set the hostname - */ - -void websSetHost(char_t *host) -{ - gstrncpy(websHost, host, TSZ(websHost)); -} - -/******************************************************************************/ -/* - * Set the host URL - */ - -void websSetHostUrl(char_t *url) -{ - a_assert(url && *url); - - bfreeSafe(B_L, websHostUrl); - websHostUrl = gstrdup(B_L, url); -} - -/******************************************************************************/ -/* - * Set the IP address - */ - -void websSetIpaddr(char_t *ipaddr) -{ - a_assert(ipaddr && *ipaddr); - - gstrncpy(websIpaddr, ipaddr, TSZ(websIpaddr)); -} - -/******************************************************************************/ -/* - * Set the number of bytes to write - */ - -void websSetRequestBytes(webs_t wp, int bytes) -{ - a_assert(websValid(wp)); - a_assert(bytes >= 0); - - wp->numbytes = bytes; -} - -/******************************************************************************/ -/* - * Set the flags for this request - */ - -void websSetRequestFlags(webs_t wp, int flags) -{ - a_assert(websValid(wp)); - - wp->flags = flags; -} - -/******************************************************************************/ -/* - * Set the local path for the request - */ - -void websSetRequestLpath(webs_t wp, char_t *lpath) -{ - a_assert(websValid(wp)); - a_assert(lpath && *lpath); - - if (wp->lpath) { - bfree(B_L, wp->lpath); - } - wp->lpath = bstrdup(B_L, lpath); - websSetVar(wp, T("PATH_TRANSLATED"), wp->lpath); -} - -/******************************************************************************/ -/* - * Update the URL path and the directory containing the web page - */ - -void websSetRequestPath(webs_t wp, char_t *dir, char_t *path) -{ - char_t *tmp; - - a_assert(websValid(wp)); - - if (dir) { - tmp = wp->dir; - wp->dir = bstrdup(B_L, dir); - if (tmp) { - bfree(B_L, tmp); - } - } - if (path) { - tmp = wp->path; - wp->path = bstrdup(B_L, path); - websSetVar(wp, T("PATH_INFO"), wp->path); - if (tmp) { - bfree(B_L, tmp); - } - } -} - -/******************************************************************************/ -/* - * Set the Write handler for this socket - */ - -void websSetRequestSocketHandler(webs_t wp, int mask, void (*fn)(webs_t wp)) -{ - a_assert(websValid(wp)); - - wp->writeSocket = fn; - socketCreateHandler(wp->sid, SOCKET_WRITABLE, websSocketEvent, (int) wp); -} - -/******************************************************************************/ -/* - * Set the number of bytes written - */ - -void websSetRequestWritten(webs_t wp, int written) -{ - a_assert(websValid(wp)); - - wp->written = written; -} - -/******************************************************************************/ -/* - * Reurn true if the webs handle is valid - */ - -int websValid(webs_t wp) -{ - int wid; - - for (wid = 0; wid < websMax; wid++) { - if (wp == webs[wid]) { - return 1; - } - } - return 0; -} - -/******************************************************************************/ -/* - * Build an ASCII time string. If sbuf is NULL we use the current time, - * else we use the last modified time of sbuf; - */ - -char_t *websGetDateString(websStatType *sbuf) -{ - char_t* cp, *r; - time_t now; - - if (sbuf == NULL) { - time(&now); - } else { - now = sbuf->mtime; - } - if ((cp = gctime(&now)) != NULL) { - cp[gstrlen(cp) - 1] = '\0'; - r = bstrdup(B_L, cp); - return r; - } - return NULL; -} - -/******************************************************************************/ -/* - * Mark time. Set a timestamp so that, later, we can return the number of - * seconds since we made the mark. Note that the mark my not be a - * "real" time, but rather a relative marker. - */ - -void websMarkTime(webs_t wp) -{ - wp->timestamp = time(0); -} - -/******************************************************************************/ -/* - * Get the number of seconds since the last mark. - */ - -static int websGetTimeSinceMark(webs_t wp) -{ - return time(0) - wp->timestamp; -} - -/******************************************************************************/ -/* - * Store the new realm name - */ - -void websSetRealm(char_t *realmName) -{ - a_assert(realmName); - - gstrncpy(websRealm, realmName, TSZ(websRealm)); -} - -/******************************************************************************/ -/* - * Return the realm name (used for authorization) - */ - -char_t *websGetRealm() -{ - return websRealm; -} - - -#if WEBS_IF_MODIFIED_SUPPORT -/******************************************************************************/ -/* - * These functions are intended to closely mirror the syntax for HTTP-date - * from RFC 2616 (HTTP/1.1 spec). This code was submitted by Pete Bergstrom. - */ - -/* - * RFC1123Date = wkday "," SP date1 SP time SP "GMT" - * RFC850Date = weekday "," SP date2 SP time SP "GMT" - * ASCTimeDate = wkday SP date3 SP time SP 4DIGIT - * - * Each of these functions tries to parse the value and update the index to - * the point it leaves off parsing. - */ - -typedef enum { JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC } MonthEnumeration; -typedef enum { SUN, MON, TUE, WED, THU, FRI, SAT } WeekdayEnumeration; - -/******************************************************************************/ -/* - * Parse an N-digit value - */ - -static int parseNDIGIT(char_t *buf, int digits, int *index) -{ - int tmpIndex, returnValue; - - returnValue = 0; - - for (tmpIndex = *index; tmpIndex < *index+digits; tmpIndex++) { - if (gisdigit(buf[tmpIndex])) { - returnValue = returnValue * 10 + (buf[tmpIndex] - T('0')); - } - } - *index = tmpIndex; - - return returnValue; -} - -/******************************************************************************/ -/* - * Return an index into the month array - */ - -static int parseMonth(char_t *buf, int *index) -{ -/* - * "Jan" | "Feb" | "Mar" | "Apr" | "May" | "Jun" | - * "Jul" | "Aug" | "Sep" | "Oct" | "Nov" | "Dec" - */ - int tmpIndex, returnValue; - - returnValue = -1; - tmpIndex = *index; - - switch (buf[tmpIndex]) { - case 'A': - switch (buf[tmpIndex+1]) { - case 'p': - returnValue = APR; - break; - case 'u': - returnValue = AUG; - break; - } - break; - case 'D': - returnValue = DEC; - break; - case 'F': - returnValue = FEB; - break; - case 'J': - switch (buf[tmpIndex+1]) { - case 'a': - returnValue = JAN; - break; - case 'u': - switch (buf[tmpIndex+2]) { - case 'l': - returnValue = JUL; - break; - case 'n': - returnValue = JUN; - break; - } - break; - } - break; - case 'M': - switch (buf[tmpIndex+1]) { - case 'a': - switch (buf[tmpIndex+2]) { - case 'r': - returnValue = MAR; - break; - case 'y': - returnValue = MAY; - break; - } - break; - } - break; - case 'N': - returnValue = NOV; - break; - case 'O': - returnValue = OCT; - break; - case 'S': - returnValue = SEP; - break; - } - - if (returnValue >= 0) { - *index += 3; - } - - return returnValue; -} - -/******************************************************************************/ -/* - * Parse a year value (either 2 or 4 digits) - */ - -static int parseYear(char_t *buf, int *index) -{ - int tmpIndex, returnValue; - - tmpIndex = *index; - returnValue = parseNDIGIT(buf, 4, &tmpIndex); - - if (returnValue >= 0) { - *index = tmpIndex; - } else { - returnValue = parseNDIGIT(buf, 2, &tmpIndex); - if (returnValue >= 0) { -/* - * Assume that any year earlier than the start of the - * epoch for time_t (1970) specifies 20xx - */ - if (returnValue < 70) { - returnValue += 2000; - } else { - returnValue += 1900; - } - - *index = tmpIndex; - } - } - - return returnValue; -} - -/******************************************************************************/ -/* - * The formulas used to build these functions are from "Calendrical Calculations", - * by Nachum Dershowitz, Edward M. Reingold, Cambridge University Press, 1997. - */ - -#include - -const int GregorianEpoch = 1; - -/******************************************************************************/ -/* - * Determine if year is a leap year - */ - -int GregorianLeapYearP(long year) -{ - int result; - long tmp; - - tmp = year % 400; - - if ((year % 4 == 0) && - (tmp != 100) && - (tmp != 200) && - (tmp != 300)) { - result = TRUE; - } else { - result = FALSE; - } - - return result; -} - -/******************************************************************************/ -/* - * Return the fixed date from the gregorian date - */ - -long FixedFromGregorian(long month, long day, long year) -{ - long fixedDate; - - fixedDate = (long)(GregorianEpoch - 1 + 365 * (year - 1) + - floor((year - 1) / 4.0) - - floor((double)(year - 1) / 100.0) + - floor((double)(year - 1) / 400.0) + - floor((367.0 * ((double)month) - 362.0) / 12.0)); - - if (month <= 2) { - fixedDate += 0; - } else if (TRUE == GregorianLeapYearP(year)) { - fixedDate += -1; - } else { - fixedDate += -2; - } - - fixedDate += day; - - return fixedDate; -} - -/******************************************************************************/ -/* - * Return the gregorian year from a fixed date - */ - -long GregorianYearFromFixed(long fixedDate) -{ - long result, d0, n400, d1, n100, d2, n4, d3, n1, d4, year; - - d0 = fixedDate - GregorianEpoch; - n400 = (long)(floor((double)d0 / (double)146097)); - d1 = d0 % 146097; - n100 = (long)(floor((double)d1 / (double)36524)); - d2 = d1 % 36524; - n4 = (long)(floor((double)d2 / (double)1461)); - d3 = d2 % 1461; - n1 = (long)(floor((double)d3 / (double)365)); - d4 = (d3 % 365) + 1; - year = 400 * n400 + 100 * n100 + 4 * n4 + n1; - - if ((n100 == 4) || (n1 == 4)) { - result = year; - } else { - result = year + 1; - } - - return result; -} - -/******************************************************************************/ -/* - * Returns the Gregorian date from a fixed date - * (not needed for this use, but included for completeness - */ - -#if 0 -GregorianFromFixed(long fixedDate, long *month, long *day, long *year) -{ - long priorDays, correction; - - *year = GregorianYearFromFixed(fixedDate); - priorDays = fixedDate - FixedFromGregorian(1, 1, *year); - - if (fixedDate < FixedFromGregorian(3,1,*year)) { - correction = 0; - } else if (true == GregorianLeapYearP(*year)) { - correction = 1; - } else { - correction = 2; - } - - *month = (long)(floor((12.0 * (double)(priorDays + correction) + 373.0) / 367.0)); - *day = fixedDate - FixedFromGregorian(*month, 1, *year); -} -#endif - -/******************************************************************************/ -/* - * Returns the difference between two Gregorian dates - */ - -long GregorianDateDifference( long month1, long day1, long year1, - long month2, long day2, long year2) -{ - return FixedFromGregorian(month2, day2, year2) - - FixedFromGregorian(month1, day1, year1); -} - - -/******************************************************************************/ -/* - * Return the number of seconds into the current day - */ - -#define SECONDS_PER_DAY 24*60*60 - -static int parseTime(char_t *buf, int *index) -{ -/* - * Format of buf is - 2DIGIT ":" 2DIGIT ":" 2DIGIT - */ - int returnValue, tmpIndex, hourValue, minuteValue, secondValue; - - hourValue = minuteValue = secondValue = -1; - returnValue = -1; - tmpIndex = *index; - - hourValue = parseNDIGIT(buf, 2, &tmpIndex); - - if (hourValue >= 0) { - tmpIndex++; - minuteValue = parseNDIGIT(buf, 2, &tmpIndex); - if (minuteValue >= 0) { - tmpIndex++; - secondValue = parseNDIGIT(buf, 2, &tmpIndex); - } - } - - if ((hourValue >= 0) && - (minuteValue >= 0) && - (secondValue >= 0)) { - returnValue = (((hourValue * 60) + minuteValue) * 60) + secondValue; - *index = tmpIndex; - } - - return returnValue; -} - -/******************************************************************************/ -/* - * Return the equivalent of time() given a gregorian date - */ - -static time_t dateToTimet(int year, int month, int day) -{ - long dayDifference; - - dayDifference = FixedFromGregorian(month, day, year) - - FixedFromGregorian(1, 1, 1970); - - return dayDifference * SECONDS_PER_DAY; -} - -/******************************************************************************/ -/* - * Return the number of seconds between Jan 1, 1970 and the parsed date - * (corresponds to documentation for time() function) - */ - -static time_t parseDate1or2(char_t *buf, int *index) -{ -/* - * Format of buf is either - * 2DIGIT SP month SP 4DIGIT - * or - * 2DIGIT "-" month "-" 2DIGIT - */ - int dayValue, monthValue, yearValue, tmpIndex; - time_t returnValue; - - returnValue = (time_t) -1; - tmpIndex = *index; - - dayValue = monthValue = yearValue = -1; - - if (buf[tmpIndex] == T(',')) { -/* - * Skip over the ", " - */ - tmpIndex += 2; - - dayValue = parseNDIGIT(buf, 2, &tmpIndex); - if (dayValue >= 0) { -/* - * Skip over the space or hyphen - */ - tmpIndex++; - monthValue = parseMonth(buf, &tmpIndex); - if (monthValue >= 0) { -/* - * Skip over the space or hyphen - */ - tmpIndex++; - yearValue = parseYear(buf, &tmpIndex); - } - } - - if ((dayValue >= 0) && - (monthValue >= 0) && - (yearValue >= 0)) { - if (yearValue < 1970) { -/* - * Allow for Microsoft IE's year 1601 dates - */ - returnValue = 0; - } else { - returnValue = dateToTimet(yearValue, monthValue, dayValue); - } - *index = tmpIndex; - } - } - - return returnValue; -} - -/******************************************************************************/ -/* - * Return the number of seconds between Jan 1, 1970 and the parsed date - */ - -static time_t parseDate3Time(char_t *buf, int *index) -{ -/* - * Format of buf is month SP ( 2DIGIT | ( SP 1DIGIT )) - */ - int dayValue, monthValue, yearValue, timeValue, tmpIndex; - time_t returnValue; - - returnValue = (time_t) -1; - tmpIndex = *index; - - dayValue = monthValue = yearValue = timeValue = -1; - - monthValue = parseMonth(buf, &tmpIndex); - if (monthValue >= 0) { -/* - * Skip over the space - */ - tmpIndex++; - if (buf[tmpIndex] == T(' ')) { -/* - * Skip over this space too - */ - tmpIndex++; - dayValue = parseNDIGIT(buf, 1, &tmpIndex); - } else { - dayValue = parseNDIGIT(buf, 2, &tmpIndex); - } -/* - * Now get the time and time SP 4DIGIT - */ - timeValue = parseTime(buf, &tmpIndex); - if (timeValue >= 0) { -/* - * Now grab the 4DIGIT year value - */ - yearValue = parseYear(buf, &tmpIndex); - } - } - - if ((dayValue >= 0) && - (monthValue >= 0) && - (yearValue >= 0)) { - returnValue = dateToTimet(yearValue, monthValue, dayValue); - returnValue += timeValue; - *index = tmpIndex; - } - - return returnValue; -} - - -/******************************************************************************/ -/* - * Although this looks like a trivial function, I found I was replicating the implementation - * seven times in the parseWeekday function. In the interests of minimizing code size - * and redundancy, it is broken out into a separate function. The cost of an extra - * function call I can live with given that it should only be called once per HTTP request. - */ - -static int bufferIndexIncrementGivenNTest(char_t *buf, int testIndex, char_t testChar, - int foundIncrement, int notfoundIncrement) -{ - if (buf[testIndex] == testChar) { - return foundIncrement; - } - - return notfoundIncrement; -} - -/******************************************************************************/ -/* - * Return an index into a logical weekday array - */ - -static int parseWeekday(char_t *buf, int *index) -{ -/* - * Format of buf is either - * "Mon" | "Tue" | "Wed" | "Thu" | "Fri" | "Sat" | "Sun" - * or - * "Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday" | "Sunday" - */ - int tmpIndex, returnValue; - - returnValue = -1; - tmpIndex = *index; - - switch (buf[tmpIndex]) { - case 'F': - returnValue = FRI; - *index += bufferIndexIncrementGivenNTest(buf, tmpIndex+3, 'd', sizeof("Friday"), 3); - break; - case 'M': - returnValue = MON; - *index += bufferIndexIncrementGivenNTest(buf, tmpIndex+3, 'd', sizeof("Monday"), 3); - break; - case 'S': - switch (buf[tmpIndex+1]) { - case 'a': - returnValue = SAT; - *index += bufferIndexIncrementGivenNTest(buf, tmpIndex+3, 'u', sizeof("Saturday"), 3); - break; - case 'u': - returnValue = SUN; - *index += bufferIndexIncrementGivenNTest(buf, tmpIndex+3, 'd', sizeof("Sunday"), 3); - break; - } - break; - case 'T': - switch (buf[tmpIndex+1]) { - case 'h': - returnValue = THU; - *index += bufferIndexIncrementGivenNTest(buf, tmpIndex+3, 'r', sizeof("Thursday"), 3); - break; - case 'u': - returnValue = TUE; - *index += bufferIndexIncrementGivenNTest(buf, tmpIndex+3, 's', sizeof("Tuesday"), 3); - break; - } - break; - case 'W': - returnValue = WED; - *index += bufferIndexIncrementGivenNTest(buf, tmpIndex+3, 'n', sizeof("Wednesday"), 3); - break; - } - return returnValue; -} - -/******************************************************************************/ -/* - * Parse the date and time string. - */ - -static time_t dateParse(time_t tip, char_t *cmd) -{ - int index, tmpIndex, weekday, timeValue; - time_t parsedValue, dateValue; - - parsedValue = (time_t) 0; - index = timeValue = 0; - weekday = parseWeekday(cmd, &index); - - if (weekday >= 0) { - tmpIndex = index; - dateValue = parseDate1or2(cmd, &tmpIndex); - if (dateValue >= 0) { - index = tmpIndex + 1; -/* - * One of these two forms is being used - * wkday "," SP date1 SP time SP "GMT" - * weekday "," SP date2 SP time SP "GMT" - */ - timeValue = parseTime(cmd, &index); - if (timeValue >= 0) { -/* - * Now match up that "GMT" string for completeness - * Compute the final value if there were no problems in the parse - */ - if ((weekday >= 0) && - (dateValue >= 0) && - (timeValue >= 0)) { - parsedValue = dateValue + timeValue; - } - } - } else { -/* - * Try the other form - wkday SP date3 SP time SP 4DIGIT - */ - tmpIndex = index; - parsedValue = parseDate3Time(cmd, &tmpIndex); - } - } - - return parsedValue; -} - -#endif /* WEBS_IF_MODIFIED_SUPPORT */ - - -/******************************************************************************/ diff --git a/cpukit/httpd/webs.h b/cpukit/httpd/webs.h deleted file mode 100644 index 4b847502a5..0000000000 --- a/cpukit/httpd/webs.h +++ /dev/null @@ -1,229 +0,0 @@ -/* - * webs.h -- GoAhead Web public header - * - * Copyright (c) GoAhead Software Inc., 1992-2000. All Rights Reserved. - * - * See the file "license.txt" for information on usage and redistribution - */ - -#ifndef _h_WEBS -#define _h_WEBS 1 - -/******************************** Description *********************************/ - -/* - * GoAhead Web Server header. This defines the Web public APIs. - * Include this header for files that contain ASP or Form procedures. - * Include wsIntrn.h when creating URL handlers. - */ - -/********************************* Includes ***********************************/ - -#include "ej.h" -#ifdef WEBS_SSL_SUPPORT -#include "websSSL.h" -#endif - -/********************************** Defines ***********************************/ -/* - * By license terms the server software name defined in the following line of - * code must not be modified. - */ -#define WEBS_NAME T("GoAhead-Webs") -#define WEBS_VERSION T("2.1") - -#define WEBS_HEADER_BUFINC 512 /* Header buffer size */ -#define WEBS_ASP_BUFINC 512 /* Asp expansion increment */ -#define WEBS_MAX_PASS 32 /* Size of password */ -#define WEBS_BUFSIZE 1000 /* websWrite max output string */ -#define WEBS_MAX_HEADER (5 * 1024) /* Sanity check header */ -#define WEBS_MAX_URL 4096 /* Maximum URL size for sanity */ -#define WEBS_SOCKET_BUFSIZ 256 /* Bytes read from socket */ - -#define WEBS_HTTP_PORT T("httpPort") -#define CGI_BIN T("cgi-bin") - -/* - * Request flags. Also returned by websGetRequestFlags(). - */ -#define WEBS_LOCAL_PAGE 0x1 /* Request for local webs page */ -#define WEBS_KEEP_ALIVE 0x2 /* HTTP/1.1 keep alive */ -#define WEBS_DONT_USE_CACHE 0x4 /* Not implemented cache support */ -#define WEBS_COOKIE 0x8 /* Cookie supplied in request */ -#define WEBS_IF_MODIFIED 0x10 /* If-modified-since in request */ -#define WEBS_POST_REQUEST 0x20 /* Post request operation */ -#define WEBS_LOCAL_REQUEST 0x40 /* Request from this system */ -#define WEBS_HOME_PAGE 0x80 /* Request for the home page */ -#define WEBS_ASP 0x100 /* ASP request */ -#define WEBS_HEAD_REQUEST 0x200 /* Head request */ -#define WEBS_CLEN 0x400 /* Request had a content length */ -#define WEBS_FORM 0x800 /* Request is a form */ -#define WEBS_REQUEST_DONE 0x1000 /* Request complete */ -#define WEBS_POST_DATA 0x2000 /* Already appended post data */ -#define WEBS_CGI_REQUEST 0x4000 /* cgi-bin request */ -#define WEBS_SECURE 0x8000 /* connection uses SSL */ -#define WEBS_AUTH_BASIC 0x10000 /* Basic authentication request */ -#define WEBS_AUTH_DIGEST 0x20000 /* Digest authentication request */ -#define WEBS_HEADER_DONE 0x40000 /* Already output the HTTP header */ - -/* - * URL handler flags - */ -#define WEBS_HANDLER_FIRST 0x1 /* Process this handler first */ -#define WEBS_HANDLER_LAST 0x2 /* Process this handler last */ - -/* - * Per socket connection webs structure - */ -typedef struct websRec { - ringq_t header; /* Header dynamic string */ - time_t since; /* Parsed if-modified-since time */ - sym_fd_t cgiVars; /* CGI standard variables */ - sym_fd_t cgiQuery; /* CGI decoded query string */ - time_t timestamp; /* Last transaction with browser */ - int timeout; /* Timeout handle */ - char_t ipaddr[32]; /* Connecting ipaddress */ - char_t type[64]; /* Mime type */ - char_t *dir; /* Directory containing the page */ - char_t *path; /* Path name without query */ - char_t *url; /* Full request url */ - char_t *host; /* Requested host */ - char_t *lpath; /* Cache local path name */ - char_t *query; /* Request query */ - char_t *decodedQuery; /* Decoded request query */ - char_t *authType; /* Authorization type (Basic/DAA) */ - char_t *password; /* Authorization password */ - char_t *userName; /* Authorization username */ - char_t *cookie; /* Cookie string */ - char_t *userAgent; /* User agent (browser) */ - char_t *protocol; /* Protocol (normally HTTP) */ - char_t *protoVersion; /* Protocol version */ - int sid; /* Socket id (handler) */ - int listenSid; /* Listen Socket id */ - int port; /* Request port number */ - int state; /* Current state */ - int flags; /* Current flags -- see above */ - int code; /* Request result code */ - int clen; /* Content length */ - int wid; /* Index into webs */ - char_t *cgiStdin; /* filename for CGI stdin */ - int docfd; /* Document file descriptor */ - int numbytes; /* Bytes to transfer to browser */ - int written; /* Bytes actually transferred */ - void (*writeSocket)(struct websRec *wp); -#ifdef DIGEST_ACCESS_SUPPORT - char_t *realm; /* usually the same as "host" from websRec */ - char_t *nonce; /* opaque-to-client string sent by server */ - char_t *digest; /* digest form of user password */ - char_t *uri; /* URI found in DAA header */ - char_t *opaque; /* opaque value passed from server */ - char_t *nc; /* nonce count */ - char_t *cnonce; /* check nonce */ - char_t *qop; /* quality operator */ -#endif -#ifdef WEBS_SSL_SUPPORT - websSSL_t *wsp; /* SSL data structure */ -#endif -} websRec; - -typedef websRec *webs_t; -typedef websRec websType; - -/******************************** Prototypes **********************************/ -extern int websAccept(int sid, char *ipaddr, int port, int listenSid); -extern int websAspDefine(char_t *name, - int (*fn)(int ejid, webs_t wp, int argc, char_t **argv)); -extern int websAspRequest(webs_t wp, char_t *lpath); -extern void websCloseListen(); -extern int websDecode64(char_t *outbuf, char_t *string, int buflen); -extern void websDecodeUrl(char_t *token, char_t *decoded, int len); -extern void websDone(webs_t wp, int code); -extern void websEncode64(char_t *outbuf, char_t *string, int buflen); -extern void websError(webs_t wp, int code, char_t *msg, ...); -extern void websFooter(webs_t wp); -extern int websFormDefine(char_t *name, void (*fn)(webs_t wp, - char_t *path, char_t *query)); -extern char_t *websGetDefaultDir(); -extern char_t *websGetDefaultPage(); -extern char_t *websGetHostUrl(); -extern char_t *websGetIpaddrUrl(); -extern char_t *websGetPassword(); -extern int websGetPort(); -extern char_t *websGetPublishDir(char_t *path, char_t **urlPrefix); -extern char_t *websGetRealm(); -extern int websGetRequestBytes(webs_t wp); -extern char_t *websGetRequestDir(webs_t wp); -extern int websGetRequestFlags(webs_t wp); -extern char_t *websGetRequestIpaddr(webs_t wp); -extern char_t *websGetRequestLpath(webs_t wp); -extern char_t *websGetRequestPath(webs_t wp); -extern char_t *websGetRequestPassword(webs_t wp); -extern char_t *websGetRequestType(webs_t wp); -extern int websGetRequestWritten(webs_t wp); -extern char_t *websGetVar(webs_t wp, char_t *var, char_t *def); -extern int websCompareVar(webs_t wp, char_t *var, char_t *value); -extern void websHeader(webs_t wp); -extern int websOpenListen(int port, int retries); -extern int websPageOpen(webs_t wp, char_t *lpath, char_t *path, - int mode, int perm); -extern void websPageClose(webs_t wp); -extern int websPublish(char_t *urlPrefix, char_t *path); -extern void websRedirect(webs_t wp, char_t *url); -extern void websSecurityDelete(); -extern int websSecurityHandler(webs_t wp, char_t *urlPrefix, - char_t *webDir, int arg, char_t *url, char_t *path, - char_t *query); -extern void websSetDefaultDir(char_t *dir); -extern void websSetDefaultPage(char_t *page); -extern void websSetEnv(webs_t wp); -extern void websSetHost(char_t *host); -extern void websSetIpaddr(char_t *ipaddr); -extern void websSetPassword(char_t *password); -extern void websSetRealm(char_t *realmName); -extern void websSetRequestBytes(webs_t wp, int bytes); -extern void websSetRequestFlags(webs_t wp, int flags); -extern void websSetRequestLpath(webs_t wp, char_t *lpath); -extern void websSetRequestPath(webs_t wp, char_t *dir, char_t *path); -extern char_t *websGetRequestUserName(webs_t wp); -extern void websSetRequestWritten(webs_t wp, int written); -extern void websSetVar(webs_t wp, char_t *var, char_t *value); -extern int websTestVar(webs_t wp, char_t *var); -extern void websTimeoutCancel(webs_t wp); -extern int websUrlHandlerDefine(char_t *urlPrefix, char_t *webDir, - int arg, int (*fn)(webs_t wp, char_t *urlPrefix, - char_t *webDir, int arg, char_t *url, char_t *path, - char_t *query), int flags); -extern int websUrlHandlerDelete(int (*fn)(webs_t wp, char_t *urlPrefix, - char_t *webDir, int arg, char_t *url, char_t *path, - char_t *query)); -extern int websUrlHandlerRequest(webs_t wp); -extern int websUrlParse(char_t *url, char_t **buf, char_t **host, - char_t **path, char_t **port, char_t **query, - char_t **proto, char_t **tag, char_t **ext); -extern char_t *websUrlType(char_t *webs, char_t *buf, int charCnt); -extern int websWrite(webs_t wp, char_t* fmt, ...); -extern int websWriteBlock(webs_t wp, char_t *buf, int nChars); -extern int websWriteDataNonBlock(webs_t wp, char *buf, int nChars); -extern int websValid(webs_t wp); -extern int websValidateUrl(webs_t wp, char_t *path); -extern void websMarkTime(webs_t wp); - -/* - * The following prototypes are used by the SSL patch found in websSSL.c - */ -extern int websAlloc(int sid); -extern void websFree(webs_t wp); -extern void websTimeout(void *arg, int id); -extern void websReadEvent(webs_t wp); - -/* - * Prototypes for functions available when running as part of the - * GoAhead Embedded Management Framework (EMF) - */ -#if EMF -extern void websFormExplain(webs_t wp, char_t *path, char_t *query); -#endif - -#endif /* _h_WEBS */ - -/******************************************************************************/ diff --git a/cpukit/httpd/websuemf.c b/cpukit/httpd/websuemf.c deleted file mode 100644 index 2315d9d234..0000000000 --- a/cpukit/httpd/websuemf.c +++ /dev/null @@ -1,210 +0,0 @@ -/* - * websuemf.c -- GoAhead Micro Embedded Management Framework - * - * Copyright (c) GoAhead Software Inc., 1995-2000. All Rights Reserved. - * - * See the file "license.txt" for usage and redistribution license requirements - */ - -/********************************** Description *******************************/ - -/* - * This modules provides compatibility with the full GoAhead EMF. - */ - -/*********************************** Includes *********************************/ - -#include "ejIntrn.h" -#include "wsIntrn.h" - -/*********************************** Defines **********************************/ - -/* - * This structure stores scheduled events. - */ -typedef struct { - void (*routine)(void *arg, int id); - void *arg; - time_t at; - int schedid; -} sched_t; - -/*********************************** Locals ***********************************/ - -static sched_t **sched; -static int schedMax; - -/************************************* Code ***********************************/ -/* - * Evaluate a script - */ - -int scriptEval(int engine, char_t *cmd, char_t **result, int chan) -{ - int ejid; - - if (engine == EMF_SCRIPT_EJSCRIPT) { - ejid = (int) chan; - if (ejEval(ejid, cmd, NULL) ) { - return 0; - } else { - return -1; - } - } - return -1; -} - -/******************************************************************************/ -/* - * Compare strings, ignoring case: normal strcmp return codes. - * - * WARNING: It is not good form to increment or decrement pointers inside a - * "call" to tolower et al. These can be MACROS, and have undesired side - * effects. - */ - -int strcmpci(char_t *s1, char_t *s2) -{ - int rc; - - a_assert(s1 && s2); - if (s1 == NULL || s2 == NULL) { - return 0; - } - - if (s1 == s2) { - return 0; - } - - do { - rc = gtolower(*s1) - gtolower(*s2); - if (*s1 == '\0') { - break; - } - s1++; - s2++; - } while (rc == 0); - return rc; -} - -/******************************************************************************/ -/* - * This function is called when a scheduled process time has come. - */ - -void TimerProc(int schedid) -{ - sched_t *s; - - a_assert(0 <= schedid && schedid < schedMax); - s = sched[schedid]; - a_assert(s); - - (s->routine)(s->arg, s->schedid); -} - -/******************************************************************************/ -/* - * Schedule an event in delay milliseconds time. We will use 1 second - * granularity for webServer. - */ - -int emfSchedCallback(int delay, emfSchedProc *proc, void *arg) -{ - sched_t *s; - int schedid; - - if ((schedid = hAllocEntry((void***) &sched, &schedMax, - sizeof(sched_t))) < 0) { - return -1; - } - s = sched[schedid]; - s->routine = proc; - s->arg = arg; - s->schedid = schedid; - -/* - * Round the delay up to seconds. - */ - s->at = ((delay + 500) / 1000) + time(0); - - return schedid; -} - -/******************************************************************************/ -/* - * Reschedule to a new delay. - */ - -void emfReschedCallback(int schedid, int delay) -{ - sched_t *s; - - if (sched == NULL || schedid == -1 || schedid >= schedMax || - (s = sched[schedid]) == NULL) { - return; - } - s->at = ((delay + 500) / 1000) + time(0); -} - -/******************************************************************************/ - -void emfUnschedCallback(int schedid) -{ - sched_t *s; - - if (sched == NULL || schedid == -1 || schedid >= schedMax || - (s = sched[schedid]) == NULL) { - return; - } - bfree(B_L, s); - schedMax = hFree((void***) &sched, schedid); -} - -/******************************************************************************/ -/* - * Take the tasks off the queue in a round robin fashion. - */ - -void emfSchedProcess() -{ - sched_t *s; - int schedid; - static int next = 0; - -/* - * If schedMax is 0, there are no tasks scheduled, so just return. - */ - if (schedMax <= 0) { - return; - } - -/* - * If next >= schedMax, the schedule queue was reduced in our absence - * so reset next to 0 to start from the begining of the queue again. - */ - if (next >= schedMax) { - next = 0; - } - - schedid = next; - for (;;) { - if ((s = sched[schedid]) != NULL && (int)s->at <= (int)time(0)) { - TimerProc(schedid); - next = schedid + 1; - return; - } - if (++schedid >= schedMax) { - schedid = 0; - } - if (schedid == next) { -/* - * We've gone all the way through the queue without finding - * anything to do so just return. - */ - return; - } - } -} - -/******************************************************************************/ diff --git a/cpukit/httpd/wsIntrn.h b/cpukit/httpd/wsIntrn.h deleted file mode 100644 index 8f230d6fbe..0000000000 --- a/cpukit/httpd/wsIntrn.h +++ /dev/null @@ -1,301 +0,0 @@ -/* - * wsIntrn.h -- Internal GoAhead Web server header - * - * Copyright (c) GoAhead Software Inc., 1992-2000. All Rights Reserved. - * - * See the file "license.txt" for information on usage and redistribution - */ - -#ifndef _h_WEBS_INTERNAL -#define _h_WEBS_INTERNAL 1 - -/******************************** Description *********************************/ - -/* - * Internal GoAhead Web Server header. This defines the Web private APIs - * Include this header when you want to create URL handlers. - */ - -/*********************************** Defines **********************************/ - -/* - * Define this to enable login of web accesses to a file - * #define WEBS_LOG_SUPPORT 1 - * - * Define this to enable HTTP/1.1 keep alive support - * #define WEBS_KEEP_ALIVE_SUPPORT 1 - * - * Define this to enable if-modified-since support - * #define WEBS_IF_MODIFIED_SUPPORT 1 - * - * Define this to support proxy capability and track local vs remote request - * Note: this is not yet fully implemented. - * #define WEBS_PROXY_SUPPORT 1 - * - * Define this to support reading pages from ROM - * #define WEBS_PAGE_ROM 1 - * - * Define this to enable memory allocation and stack usage tracking - * #define B_STATS 1 - */ - -/********************************** Includes **********************************/ - -#include -#include -#include -#include - -#if WIN - #include - #include - #include -#endif - -#if CE -#if ! UEMF - #include -#endif -#endif - -#if NW - #include - #include -#endif - -#if SCOV5 - #include - #include - #include - #include -#endif - -#if LYNX - #include - #include - #include - #include -#endif - -#if UNIX - #include - #include - #include - #include -#endif - -#if QNX4 - #include - #include - #include - #include - #include -#endif - -#if UW - #include - #include -#endif - -#if VXWORKS - #include - #include - #include -#endif - -#if SOLARIS - #include - #include - #include -#endif - -#if UEMF - #include "uemf.h" - #include "ejIntrn.h" -#else - #include "emf/emfInternal.h" - #include "ej/ejIntrn.h" -#endif - -#include "webs.h" - -/********************************** Defines ***********************************/ -/* - * Read handler flags and state - */ -#define WEBS_BEGIN 0x1 /* Beginning state */ -#define WEBS_HEADER 0x2 /* Ready to read first line */ -#define WEBS_POST 0x4 /* POST without content */ -#define WEBS_POST_CLEN 0x8 /* Ready to read content for POST */ -#define WEBS_PROCESSING 0x10 /* Processing request */ -#define WEBS_KEEP_TIMEOUT 15000 /* Keep-alive timeout (15 secs) */ -#define WEBS_TIMEOUT 60000 /* General request timeout (60) */ - -#define PAGE_READ_BUFSIZE 512 /* bytes read from page files */ -#define MAX_PORT_LEN 10 /* max digits in port number */ -#define WEBS_SYM_INIT 64 /* initial # of sym table entries */ -#define WEBS_VERSION_STR T("2.1.3") /* version of web server s/w */ - -/* - * URL handler structure. Stores the leading URL path and the handler - * function to call when the URL path is seen. - */ -typedef struct { - int (*handler)(webs_t wp, char_t *urlPrefix, char_t *webDir, int arg, - char_t *url, char_t *path, - char_t *query); /* Callback URL handler function */ - char_t *webDir; /* Web directory if required */ - char_t *urlPrefix; /* URL leading prefix */ - int len; /* Length of urlPrefix for speed */ - int arg; /* Argument to provide to handler */ - int flags; /* Flags */ -} websUrlHandlerType; - -/* - * Webs statistics - */ -typedef struct { - long errors; /* General errors */ - long redirects; - long net_requests; - long activeNetRequests; - long activeBrowserRequests; - long timeouts; - long access; /* Access violations */ - long localHits; - long remoteHits; - long formHits; - long cgiHits; - long handlerHits; -} websStatsType; - -extern websStatsType websStats; /* Web access stats */ - -/* - * Error code list - */ -typedef struct { - int code; /* HTTP error code */ - char_t *msg; /* HTTP error message */ -} websErrorType; - -/* - * Mime type list - */ -typedef struct { - char_t *type; /* Mime type */ - char_t *ext; /* File extension */ -} websMimeType; - -/* - * File information structure. - */ -typedef struct { - unsigned long size; /* File length */ - int isDir; /* Set if directory */ - time_t mtime; /* Modified time */ -} websStatType; - -/* - * Compiled Rom Page Index - */ -typedef struct { - char_t *path; /* Web page URL path */ - const unsigned char *page; /* Web page data */ - int size; /* Size of web page in bytes */ - int pos; /* Current read position */ -} websRomPageIndexType; - -/* - * Defines for file open. - */ -#ifndef CE -#define SOCKET_RDONLY O_RDONLY -#define SOCKET_BINARY O_BINARY -#else /* CE */ -#define SOCKET_RDONLY 0x1 -#define SOCKET_BINARY 0x2 -#endif /* CE */ - -extern websRomPageIndexType websRomPageIndex[]; -extern websMimeType websMimeList[]; /* List of mime types */ -extern sym_fd_t websMime; /* Set of mime types */ -extern webs_t* webs; /* Session list head */ -extern int websMax; /* List size */ -extern char_t websHost[64]; /* Name of this host */ -extern char_t websIpaddr[64]; /* IP address of this host */ -extern char_t *websHostUrl; /* URL for this host */ -extern char_t *websIpaddrUrl; /* URL for this host */ -extern int websPort; /* Port number */ - -/******************************** Prototypes **********************************/ - -extern int websAspOpen(); -extern void websAspClose(); -extern void websFormOpen(); -extern void websFormClose(); -extern int websAspWrite(int ejid, webs_t wp, int argc, char_t **argv); -extern void websDefaultClose(); -extern int websDefaultHandler(webs_t wp, char_t *urlPrefix, - char_t *webDir, int arg, char_t *url, char_t *path, - char_t *query); -extern int websFormHandler(webs_t wp, char_t *urlPrefix, char_t *webDir, - int arg, char_t *url, char_t *path, char_t *query); -extern int websCgiHandler(webs_t wp, char_t *urlPrefix, char_t *webDir, - int arg, char_t *url, char_t *path, char_t *query); -extern void websCgiCleanup(); -extern int websCheckCgiProc(int handle); -extern char_t *websGetCgiCommName(); - -extern int websLaunchCgiProc(char_t *cgiPath, char_t **argp, - char_t **envp, char_t *stdIn, char_t *stdOut); -extern int websOpen(int sid); -extern void websResponse(webs_t wp, int code, char_t *msg, - char_t *redirect); -extern int websJavaScriptEval(webs_t wp, char_t *script); -extern int websPageReadData(webs_t wp, char *buf, int nBytes); -extern int websPageOpen(webs_t wp, char_t *lpath, char_t *path, int mode, - int perm); -extern void websPageClose(webs_t wp); -extern void websPageSeek(webs_t wp, long offset); -extern int websPageStat(webs_t wp, char_t *lpath, char_t *path, - websStatType *sbuf); -extern int websPageIsDirectory(char_t *lpath); -extern int websRomOpen(); -extern void websRomClose(); -extern int websRomPageOpen(webs_t wp, char_t *path, int mode, int perm); -extern void websRomPageClose(int fd); -extern int websRomPageReadData(webs_t wp, char *buf, int len); -extern int websRomPageStat(char_t *path, websStatType *sbuf); -extern long websRomPageSeek(webs_t wp, long offset, int origin); -extern void websSetRequestSocketHandler(webs_t wp, int mask, - void (*fn)(webs_t wp)); -extern int websSolutionHandler(webs_t wp, char_t *urlPrefix, - char_t *webDir, int arg, char_t *url, char_t *path, - char_t *query); -extern void websUrlHandlerClose(); -extern int websUrlHandlerOpen(); -extern int websOpenServer(int port, int retries); -extern void websCloseServer(); -extern char_t* websGetDateString(websStatType* sbuf); - -extern int strcmpci(char_t* s1, char_t* s2); - -/* - * Prototypes for functions available when running as part of the - * GoAhead Embedded Management Framework (EMF) - */ -#if EMF -extern int websEmfOpen(); -extern void websEmfClose(); -extern void websSetEmfEnvironment(webs_t wp); -#endif - -#if CE -extern int writeUniToAsc(int fid, void *buf, unsigned int len); -extern int readAscToUni(int fid, void **buf, unsigned int len); -#endif - -#endif /* _h_WEBS_INTERNAL */ - -/******************************************************************************/ diff --git a/cpukit/libnetworking/netinet/in_cksum_arm.h b/cpukit/libnetworking/netinet/in_cksum_arm.h deleted file mode 100644 index 10d21ab2a6..0000000000 --- a/cpukit/libnetworking/netinet/in_cksum_arm.h +++ /dev/null @@ -1,276 +0,0 @@ -/* $NetBSD: in_cksum_arm.c,v 1.3 2001/12/08 21:18:50 chris Exp $ */ - -/* - * ARM version: - * - * Copyright (c) 1997 Mark Brinicome - * Copyright (c) 1997 Causality Limited - * - * Based on the sparc version. - */ - -/* - * Sparc version: - * - * Copyright (c) 1995 Zubin Dittia. - * Copyright (c) 1995 Matthew R. Green. - * Copyright (c) 1994 Charles M. Hannum. - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)in_cksum.c 8.1 (Berkeley) 6/11/93 - */ - -#include -#include -#include -#include -#include -#include -#include - -/* - * Checksum routine for Internet Protocol family headers. - * - * This routine is very heavily used in the network - * code and should be modified for each CPU to be as fast as possible. - * - * ARM version. - */ - -#define ADD64 __asm __volatile(" \n\ - ldmia %0!, {%2, %3, %4, %5} \n\ - adds %1,%7,%2; adcs %1,%1,%3 \n\ - adcs %1,%1,%4; adcs %1,%1,%5 \n\ - ldmia %0!, {%2, %3, %4, %5} \n\ - adcs %1,%1,%2; adcs %1,%1,%3 \n\ - adcs %1,%1,%4; adcs %1,%1,%5 \n\ - ldmia %0!, {%2, %3, %4, %5} \n\ - adcs %1,%1,%2; adcs %1,%1,%3 \n\ - adcs %1,%1,%4; adcs %1,%1,%5 \n\ - ldmia %0!, {%2, %3, %4, %5} \n\ - adcs %1,%1,%2; adcs %1,%1,%3 \n\ - adcs %1,%1,%4; adcs %1,%1,%5 \n\ - adcs %1,%1,#0\n" \ - : "=r" (w), "=r" (sum), "=&r" (tmp1), "=&r" (tmp2), "=&r" (tmp3), "=&r" (tmp4) \ - : "0" (w), "r" (sum) \ - : "cc") - -#define ADD32 __asm __volatile(" \n\ - ldmia %0!, {%2, %3, %4, %5} \n\ - adds %1,%7,%2; adcs %1,%1,%3 \n\ - adcs %1,%1,%4; adcs %1,%1,%5 \n\ - ldmia %0!, {%2, %3, %4, %5} \n\ - adcs %1,%1,%2; adcs %1,%1,%3 \n\ - adcs %1,%1,%4; adcs %1,%1,%5 \n\ - adcs %1,%1,#0\n" \ - : "=r" (w), "=r" (sum), "=&r" (tmp1), "=&r" (tmp2), "=&r" (tmp3), "=&r" (tmp4) \ - : "0" (w), "r" (sum) \ - : "cc") - -#define ADD16 __asm __volatile(" \n\ - ldmia %0!, {%2, %3, %4, %5} \n\ - adds %1,%7,%2; adcs %1,%1,%3 \n\ - adcs %1,%1,%4; adcs %1,%1,%5 \n\ - adcs %1,%1,#0\n" \ - : "=r" (w), "=r" (sum), "=&r" (tmp1), "=&r" (tmp2), "=&r" (tmp3), "=&r" (tmp4) \ - : "0" (w), "r" (sum) \ - : "cc") - -#define ADD8 __asm __volatile(" \n\ - ldmia %0!, {%2, %3} \n\ - adds %1,%5,%2; adcs %1,%1,%3 \n\ - adcs %1,%1,#0\n" \ - : "=r" (w), "=r" (sum), "=&r" (tmp1), "=&r" (tmp2) \ - : "0" (w), "r" (sum) \ - : "cc" ) - -#define ADD4 __asm __volatile(" \n\ - ldr %2,[%0],#4 \n\ - adds %1,%4,%2 \n\ - adcs %1,%1,#0\n" \ - : "=r" (w), "=r" (sum), "=&r" (tmp1) \ - : "0" (w), "r" (sum) \ - : "cc") - -/*#define REDUCE {sum = (sum & 0xffff) + (sum >> 16);}*/ -#define REDUCE __asm __volatile(" \n\ - mov %2, #0x00ff \n\ - orr %2, %2, #0xff00 \n\ - and %2, %0, %2 \n\ - add %0, %2, %0, lsr #16\n" \ - : "=r" (sum) \ - : "0" (sum), "r" (tmp1)) - -#define ADDCARRY {if (sum > 0xffff) sum -= 0xffff;} -#define ROL {sum = sum << 8;} /* depends on recent REDUCE */ -#define ADDBYTE {ROL; sum += (*w << 8); byte_swapped ^= 1;} -#define ADDSHORT {sum += *(u_short *)w;} -#define ADVANCE(n) {w += n; mlen -= n;} -#define ADVANCEML(n) {mlen -= n;} - -static __inline__ int -in_cksum_internal(struct mbuf *m, int off, int len, u_int sum) -{ - u_char *w; - int mlen = 0; - int byte_swapped = 0; - - /* - * Declare four temporary registers for use by the asm code. We - * allow the compiler to pick which specific machine registers to - * use, instead of hard-coding this in the asm code above. - */ - register u_int tmp1=0, tmp2, tmp3, tmp4; - - for (; m && len; m = m->m_next) { - if (m->m_len == 0) - continue; - w = mtod(m, u_char *) + off; - mlen = m->m_len - off; - off = 0; - if (len < mlen) - mlen = len; - len -= mlen; - - /* - * Ensure that we're aligned on a word boundary here so - * that we can do 32 bit operations below. - */ - if ((3 & (long)w) != 0) { - REDUCE; - if ((1 & (long)w) != 0 && mlen >= 1) { - ADDBYTE; - ADVANCE(1); - } - if ((2 & (long)w) != 0 && mlen >= 2) { - ADDSHORT; - ADVANCE(2); - } - } - - /* - * Do as many 32 bit operations as possible using the - * 64/32/16/8/4 macro's above, using as many as possible of - * these. - */ - - while (mlen >= 64) { - ADD64; - ADVANCEML(64); - } - if (mlen >= 32) { - ADD32; - ADVANCEML(32); - } - if (mlen >= 16) { - ADD16; - ADVANCEML(16); - } - if (mlen >= 8) { - ADD8; - ADVANCEML(8); - } - if (mlen >= 4) { - ADD4; - ADVANCEML(4) - } - if (mlen == 0) - continue; - - REDUCE; - if (mlen >= 2) { - ADDSHORT; - ADVANCE(2); - } - if (mlen == 1) { - ADDBYTE; - } - } - if (byte_swapped) { - REDUCE; - ROL; - } - REDUCE; - ADDCARRY; - - return (0xffff ^ sum); -} - -int -in_cksum(m, len) - struct mbuf *m; - int len; -{ - int cksum; - cksum =in_cksum_internal(m, 0, len, 0); - return cksum; -} - -int -in4_cksum(m, nxt, off, len) - struct mbuf *m; - u_int8_t nxt; - int off, len; -{ - u_int sum = 0; - - if (nxt != 0) { - /* for ADD macros */ - register u_int tmp1, tmp2, tmp3, tmp4; - u_char *w; - struct ipovly ipov; - /* pseudo header */ - if (off < sizeof(struct ipovly)) - panic("in4_cksum: offset too short"); - if (m->m_len < sizeof(struct ip)) - panic("in4_cksum: bad mbuf chain"); - - bzero(&ipov, sizeof(ipov)); - ipov.ih_len = htons(len); - ipov.ih_pr = nxt; - ipov.ih_src = mtod(m, struct ip *)->ip_src; - ipov.ih_dst = mtod(m, struct ip *)->ip_dst; - w = (u_char *)&ipov; - - /* assumes sizeof(ipov) == 20 */ - ADD16; - ADD4; - } - /* skip unnecessary part */ - while (m && off > 0) { - if (m->m_len > off) - break; - off -= m->m_len; - m = m->m_next; - } - return (in_cksum_internal(m, off, len, sum)); -} diff --git a/cpukit/libnetworking/netinet/in_cksum_i386.h b/cpukit/libnetworking/netinet/in_cksum_i386.h deleted file mode 100644 index a64bd57832..0000000000 --- a/cpukit/libnetworking/netinet/in_cksum_i386.h +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Checksum routine for Internet Protocol family headers. - * - * This routine is very heavily used in the network - * code and should be modified for each CPU to be as fast as possible. - * - * This implementation is 386 version. - * - * $Id$ - */ - -#include /* for puts */ - -#undef ADDCARRY -#define ADDCARRY(x) if ((x) > 0xffff) (x) -= 0xffff -#define REDUCE {sum = (sum & 0xffff) + (sum >> 16); ADDCARRY(sum);} - -/* - * Thanks to gcc we don't have to guess - * which registers contain sum & w. - */ -#define ADD(n) __asm__ volatile \ - ("addl " #n "(%2), %0" : "=r" (sum) : "0" (sum), "r" (w)) -#define ADDC(n) __asm__ volatile \ - ("adcl " #n "(%2), %0" : "=r" (sum) : "0" (sum), "r" (w)) -#define LOAD(n) __asm__ volatile \ - ("movb " #n "(%1), %0" : "=r" (junk) : "r" (w)) -#define MOP __asm__ volatile \ - ("adcl $0, %0" : "=r" (sum) : "0" (sum)) - -int -in_cksum(m, len) - register struct mbuf *m; - register int len; -{ - register u_short *w; - register unsigned sum = 0; - register int mlen = 0; - int byte_swapped = 0; - union { char c[2]; u_short s; } su; - - for (;m && len; m = m->m_next) { - if (m->m_len == 0) - continue; - w = mtod(m, u_short *); - if (mlen == -1) { - /* - * The first byte of this mbuf is the continuation - * of a word spanning between this mbuf and the - * last mbuf. - */ - - /* su.c[0] is already saved when scanning previous - * mbuf. sum was REDUCEd when we found mlen == -1 - */ - su.c[1] = *(u_char *)w; - sum += su.s; - w = (u_short *)((char *)w + 1); - mlen = m->m_len - 1; - len--; - } else - mlen = m->m_len; - if (len < mlen) - mlen = len; - len -= mlen; - /* - * Force to long boundary so we do longword aligned - * memory operations - */ - if (3 & (int) w) { - REDUCE; - if ((1 & (int) w) && (mlen > 0)) { - sum <<= 8; - su.c[0] = *(char *)w; - w = (u_short *)((char *)w + 1); - mlen--; - byte_swapped = 1; - } - if ((2 & (int) w) && (mlen >= 2)) { - sum += *w++; - mlen -= 2; - } - } - /* - * Advance to a 486 cache line boundary. - */ - if (4 & (int) w && mlen >= 4) { - ADD(0); - MOP; - w += 2; - mlen -= 4; - } - if (8 & (int) w && mlen >= 8) { - ADD(0); - ADDC(4); - MOP; - w += 4; - mlen -= 8; - } - /* - * Do as much of the checksum as possible 32 bits at at time. - * In fact, this loop is unrolled to make overhead from - * branches &c small. - */ - mlen -= 1; - while ((mlen -= 32) >= 0) { - u_char junk; - /* - * Add with carry 16 words and fold in the last - * carry by adding a 0 with carry. - * - * The early ADD(16) and the LOAD(32) are to load - * the next 2 cache lines in advance on 486's. The - * 486 has a penalty of 2 clock cycles for loading - * a cache line, plus whatever time the external - * memory takes to load the first word(s) addressed. - * These penalties are unavoidable. Subsequent - * accesses to a cache line being loaded (and to - * other external memory?) are delayed until the - * whole load finishes. These penalties are mostly - * avoided by not accessing external memory for - * 8 cycles after the ADD(16) and 12 cycles after - * the LOAD(32). The loop terminates when mlen - * is initially 33 (not 32) to guaranteed that - * the LOAD(32) is within bounds. - */ - ADD(16); - ADDC(0); - ADDC(4); - ADDC(8); - ADDC(12); - LOAD(32); - ADDC(20); - ADDC(24); - ADDC(28); - MOP; - w += 16; - } - mlen += 32 + 1; - if (mlen >= 32) { - ADD(16); - ADDC(0); - ADDC(4); - ADDC(8); - ADDC(12); - ADDC(20); - ADDC(24); - ADDC(28); - MOP; - w += 16; - mlen -= 32; - } - if (mlen >= 16) { - ADD(0); - ADDC(4); - ADDC(8); - ADDC(12); - MOP; - w += 8; - mlen -= 16; - } - if (mlen >= 8) { - ADD(0); - ADDC(4); - MOP; - w += 4; - mlen -= 8; - } - if (mlen == 0 && byte_swapped == 0) - continue; /* worth 1% maybe ?? */ - REDUCE; - while ((mlen -= 2) >= 0) { - sum += *w++; - } - if (byte_swapped) { - sum <<= 8; - byte_swapped = 0; - if (mlen == -1) { - su.c[1] = *(char *)w; - sum += su.s; - mlen = 0; - } else - mlen = -1; - } else if (mlen == -1) - /* - * This mbuf has odd number of bytes. - * There could be a word split betwen - * this mbuf and the next mbuf. - * Save the last byte (to prepend to next mbuf). - */ - su.c[0] = *(char *)w; - } - - if (len) - puts("cksum: out of data"); - if (mlen == -1) { - /* The last mbuf has odd # of bytes. Follow the - standard (the odd byte is shifted left by 8 bits) */ - su.c[1] = 0; - sum += su.s; - } - REDUCE; - return (~sum & 0xffff); -} diff --git a/cpukit/libnetworking/netinet/in_cksum_m68k.h b/cpukit/libnetworking/netinet/in_cksum_m68k.h deleted file mode 100644 index 58199c3adf..0000000000 --- a/cpukit/libnetworking/netinet/in_cksum_m68k.h +++ /dev/null @@ -1,223 +0,0 @@ -/* - * Copyright (c) 1988, 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * @(#)in_cksum.c 8.1 (Berkeley) 6/10/93 - * $Id$ - */ - -#include -#include - -#if (defined (__mcf5200__)) -# define IS_COLDFIRE 1 -#else -# define IS_COLDFIRE 0 -#endif - -#define REDUCE { sum = (sum & 0xFFFF) + (sum >> 16); if (sum > 0xFFFF) sum -= 0xFFFF; } - -/* - * Motorola 68k version of Internet Protocol Checksum routine - * W. Eric Norum - * Saskatchewan Accelerator Laboratory - * August, 1998 - */ -int -in_cksum(m, len) - struct mbuf *m; - int len; -{ - unsigned short *w; - unsigned long sum = 0; - int mlen = 0; - int byte_swapped = 0; - union { - char c[2]; - u_short s; - } s_util; - - for ( ; m && len ; m = m->m_next) { - if (m->m_len == 0) - continue; - w = mtod(m, u_short *); - if (mlen == -1) { - /* - * The first byte of this mbuf is the continuation - * of a word spanning between this mbuf and the - * last mbuf. - * - * s_util.c[0] is already saved when scanning previous - * mbuf. - */ - s_util.c[1] = *(char *)w; - sum += s_util.s; - w = (u_short *)((char *)w + 1); - mlen = m->m_len - 1; - len--; - } else - mlen = m->m_len; - if (len < mlen) - mlen = len; - len -= mlen; - - /* - * Force to longword boundary. - */ - if (3 & (int)w) { - REDUCE; - if ((1 & (int) w) && (mlen > 0)) { - sum <<= 8; - s_util.c[0] = *(u_char *)w; - w = (u_short *)((char *)w + 1); - mlen--; - byte_swapped = 1; - } - if ((2 & (int) w) && (mlen >= 2)) { - sum += *w++; - mlen -= 2; - } - } - - /* - * Sum all the longwords in the buffer. - * See RFC 1071 -- Computing the Internet Checksum. - * It should work for all 68k family members. - */ - { - unsigned long tcnt = mlen, t1; - __asm__ volatile ( - "movel %2,%3\n\t" - "lsrl #6,%2 | count/64 = # loop traversals\n\t" - "andl #0x3c,%3 | Then find fractions of a chunk\n\t" - "negl %3\n\t | Each long uses 4 instruction bytes\n\t" -#if IS_COLDFIRE - "addql #1,%2 | Clear X (extended carry flag)\n\t" - "subql #1,%2 | \n\t" -#else - "andi #0xf,%%cc | Clear X (extended carry flag)\n\t" -#endif - "jmp %%pc@(lcsum2_lbl-.-2:b,%3) | Jump into loop\n" - "lcsum1_lbl: | Begin inner loop...\n\t" - "movel %1@+,%3 | 0: Fetch 32-bit word\n\t" - "addxl %3,%0 | Add word + previous carry\n\t" - "movel %1@+,%3 | 1: Fetch 32-bit word\n\t" - "addxl %3,%0 | Add word + previous carry\n\t" - "movel %1@+,%3 | 2: Fetch 32-bit word\n\t" - "addxl %3,%0 | Add word + previous carry\n\t" - "movel %1@+,%3 | 3: Fetch 32-bit word\n\t" - "addxl %3,%0 | Add word + previous carry\n\t" - "movel %1@+,%3 | 4: Fetch 32-bit word\n\t" - "addxl %3,%0 | Add word + previous carry\n\t" - "movel %1@+,%3 | 5: Fetch 32-bit word\n\t" - "addxl %3,%0 | Add word + previous carry\n\t" - "movel %1@+,%3 | 6: Fetch 32-bit word\n\t" - "addxl %3,%0 | Add word + previous carry\n\t" - "movel %1@+,%3 | 7: Fetch 32-bit word\n\t" - "addxl %3,%0 | Add word + previous carry\n\t" - "movel %1@+,%3 | 8: Fetch 32-bit word\n\t" - "addxl %3,%0 | Add word + previous carry\n\t" - "movel %1@+,%3 | 9: Fetch 32-bit word\n\t" - "addxl %3,%0 | Add word + previous carry\n\t" - "movel %1@+,%3 | A: Fetch 32-bit word\n\t" - "addxl %3,%0 | Add word + previous carry\n\t" - "movel %1@+,%3 | B: Fetch 32-bit word\n\t" - "addxl %3,%0 | Add word + previous carry\n\t" - "movel %1@+,%3 | C: Fetch 32-bit word\n\t" - "addxl %3,%0 | Add word + previous carry\n\t" - "movel %1@+,%3 | D: Fetch 32-bit word\n\t" - "addxl %3,%0 | Add word + previous carry\n\t" - "movel %1@+,%3 | E: Fetch 32-bit word\n\t" - "addxl %3,%0 | Add word + previous carry\n\t" - "movel %1@+,%3 | F: Fetch 32-bit word\n\t" - "addxl %3,%0 | Add word + previous carry\n" - "lcsum2_lbl: | End of unrolled loop\n\t" -#if IS_COLDFIRE - "moveq #0,%3 | Add in last carry\n\t" - "addxl %3,%0 |\n\t" - "subql #1,%2 | Update loop count\n\t" - "bplb lcsum1_lbl | Loop (with X clear) if not done\n\t" - "movel #0xffff,%2 | Get word mask\n\t" - "movel %0,%3 | Fold 32 bit sum to 16 bits\n\t" - "swap %3 |\n\t" - "andl %2,%0 | Mask to 16-bit sum\n\t" - "andl %2,%3 | Mask to 16-bit sum\n\t" - "addl %3,%0 |\n\t" - "movel %0,%3 | Add in last carry\n\t" - "swap %3 |\n\t" - "addl %3,%0 |\n\t" - "andl %2,%0 | Mask to 16-bit sum\n\t" -#else - "dbf %2,lcsum1_lbl | (NB- dbf doesn't affect X)\n\t" - "movel %0,%3 | Fold 32 bit sum to 16 bits\n\t" - "swap %3 | (NB- swap doesn't affect X)\n\t" - "addxw %3,%0 |\n\t" - "moveq #0,%3 | Add in last carry\n\t" - "addxw %3,%0 |\n\t" - "andl #0xffff,%0 | Mask to 16-bit sum\n" -#endif - : - "=d" (sum), "=a" (w), "=d" (tcnt) , "=d" (t1) : - "0" (sum), "1" (w), "2" (tcnt) : - "cc", "memory"); - } - mlen &= 3; - - /* - * Soak up the last 1, 2 or 3 bytes - */ - while ((mlen -= 2) >= 0) - sum += *w++; - if (byte_swapped) { - REDUCE; - sum <<= 8; - byte_swapped = 0; - if (mlen == -1) { - s_util.c[1] = *(char *)w; - sum += s_util.s; - mlen = 0; - } else - mlen = -1; - } else if (mlen == -1) - s_util.c[0] = *(char *)w; - } - if (len) - sum = 0xDEAD; - if (mlen == -1) { - /* The last mbuf has odd # of bytes. Follow the - standard (the odd byte may be shifted left by 8 bits - or not as determined by endian-ness of the machine) */ - s_util.c[1] = 0; - sum += s_util.s; - } - REDUCE; - return (~sum & 0xffff); -} diff --git a/cpukit/libnetworking/netinet/in_cksum_powerpc.h b/cpukit/libnetworking/netinet/in_cksum_powerpc.h deleted file mode 100644 index fe2f04e246..0000000000 --- a/cpukit/libnetworking/netinet/in_cksum_powerpc.h +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Checksum routine for Internet Protocol family headers. - * - * This routine is very heavily used in the network - * code and should be modified for each CPU to be as fast as possible. - * - * This implementation is the PowerPC version. - * - * $Id$ - */ - -#include /* for puts */ - -#undef ADDCARRY -#define ADDCARRY(x) if ((x) > 0xffff) (x) -= 0xffff -#define REDUCE {sum = (sum & 0xffff) + (sum >> 16); ADDCARRY(sum);} - -/* - * Thanks to gcc we don't have to guess - * which registers contain sum & w. - */ - -#define LDTMP(n) tmp = *((u_int *)((u_char *)w + n)) - -#define ADD(n) \ - LDTMP(n); \ - __asm__ volatile("addc %0,%0,%2" : "=r" (sum) : "0" (sum), "r" (tmp)) - -#define ADDC(n) \ - LDTMP(n); \ - __asm__ volatile("adde %0,%0,%2" : "=r" (sum) : "0" (sum), "r" (tmp)) - -#define MOP \ - tmp = 0; \ - __asm__ volatile("adde %0,%0,%2" : "=r" (sum) : "0" (sum), "r" (tmp)) - -#define LOAD(n) junk = (u_char) *((volatile u_char *) w + n) - - -int -in_cksum(m, len) - register struct mbuf *m; - register int len; -{ - u_char junk; - register u_short *w; - register unsigned sum = 0; - register unsigned tmp; - register int mlen = 0; - int byte_swapped = 0; - union { char c[2]; u_short s; } su; - - for (;m && len; m = m->m_next) { - if (m->m_len == 0) - continue; - w = mtod(m, u_short *); - if (mlen == -1) { - /* - * The first byte of this mbuf is the continuation - * of a word spanning between this mbuf and the - * last mbuf. - */ - - /* su.c[0] is already saved when scanning previous - * mbuf. sum was REDUCEd when we found mlen == -1 - */ - su.c[1] = *(u_char *)w; - sum += su.s; - w = (u_short *)((char *)w + 1); - mlen = m->m_len - 1; - len--; - } else - mlen = m->m_len; - if (len < mlen) - mlen = len; - len -= mlen; - /* - * Force to long boundary so we do longword aligned - * memory operations - */ - if (3 & (int) w) { - REDUCE; - if ((1 & (int) w) && (mlen > 0)) { - sum <<= 8; - su.c[0] = *(char *)w; - w = (u_short *)((char *)w + 1); - mlen--; - byte_swapped = 1; - } - if ((2 & (int) w) && (mlen >= 2)) { - sum += *w++; - mlen -= 2; - } - } - - /* - * Do as much of the checksum as possible 32 bits at at time. - * In fact, this loop is unrolled to keep overhead from - * branches small. - */ - while (mlen >= 32) { - /* - * Add with carry 16 words and fold in the last - * carry by adding a 0 with carry. - * - * The early ADD(16) and the LOAD(32) are intended - * to help get the data into the cache. - */ - ADD(16); - ADDC(0); - ADDC(4); - ADDC(8); - ADDC(12); - LOAD(32); - ADDC(20); - ADDC(24); - ADDC(28); - MOP; - w += 16; - mlen -= 32; - } - if (mlen >= 16) { - ADD(0); - ADDC(4); - ADDC(8); - ADDC(12); - MOP; - w += 8; - mlen -= 16; - } - if (mlen >= 8) { - ADD(0); - ADDC(4); - MOP; - w += 4; - mlen -= 8; - } - if (mlen == 0 && byte_swapped == 0) - continue; /* worth 1% maybe ?? */ - REDUCE; - while ((mlen -= 2) >= 0) { - sum += *w++; - } - if (byte_swapped) { - sum <<= 8; - byte_swapped = 0; - if (mlen == -1) { - su.c[1] = *(char *)w; - sum += su.s; - mlen = 0; - } else - mlen = -1; - } else if (mlen == -1) - /* - * This mbuf has odd number of bytes. - * There could be a word split betwen - * this mbuf and the next mbuf. - * Save the last byte (to prepend to next mbuf). - */ - su.c[0] = *(char *)w; - } - - if (len) - puts("cksum: out of data"); - if (mlen == -1) { - /* The last mbuf has odd # of bytes. Follow the - standard (the odd byte is shifted left by 8 bits) */ - su.c[1] = 0; - sum += su.s; - } - REDUCE; - return (~sum & 0xffff); -} diff --git a/cpukit/pppd/Makefile.am b/cpukit/pppd/Makefile.am deleted file mode 100644 index b77fe30e4a..0000000000 --- a/cpukit/pppd/Makefile.am +++ /dev/null @@ -1,41 +0,0 @@ -## -## $Id$ -## - -LIBNAME = lib.a -LIB = $(ARCH)/$(LIBNAME) - -C_FILES = auth.c ccp.c chap.c chap_ms.c chat.c demand.c fsm.c ipcp.c lcp.c \ - magic.c options.c upap.c md4.c md5.c utils.c sys-rtems.c rtemsmain.c \ - rtemspppd.c -OBJS = $(C_FILES:%.c=$(ARCH)/%.$(OBJEXT)) - -include $(top_srcdir)/../../../automake/compile.am -include $(top_srcdir)/../../../automake/lib.am - -# -# Add local stuff here using += -# - -$(LIB): $(OBJS) - $(make-library) - -all-local: $(PREINSTALL_FILES) $(ARCH) $(OBJS) $(LIB) - -.PRECIOUS: $(LIB) - -EXTRA_DIST = auth.c ccp.c ccp.h chap.c chap.h chap_ms.c chap_ms.h \ -chat.c demand.c fsm.c fsm.h ipcp.c ipcp.h ipxcp.c ipxcp.h \ -lcp.c lcp.h magic.c magic.h md4.c md4.h md5.c md5.h options.c \ -patchlevel.h pathnames.h pppd.h rtemsdialer.h rtemsmain.c rtemspppd.c \ -rtemspppd.h sys-rtems.c upap.c upap.h utils.c - -include_HEADERS = rtemspppd.h rtemsdialer.h - - -PREINSTALL_FILES = $(PROJECT_INCLUDE) $(include_HEADERS:%=$(PROJECT_INCLUDE)/%) - -$(PROJECT_INCLUDE)/%.h: %.h - $(INSTALL_DATA) $< $@ - -include $(top_srcdir)/../../../automake/local.am diff --git a/cpukit/pppd/README b/cpukit/pppd/README deleted file mode 100644 index 28c9f7ef5d..0000000000 --- a/cpukit/pppd/README +++ /dev/null @@ -1,29 +0,0 @@ -# -# $Id$ -# - -This directory contains a port of ppp-2.3.11. The official site for -the original source for this PPP implementation is: - -ftp://cs.anu.edu.au/pub/software/ppp - -================================================================ -History - -The original port was of 2.3.5 by Tomasz Domin of -ComArch SA and was initially only tested on the mpc823. He -provided the modem driver as well. - -The port was updated to 2.3.11 by Mike Siers -who added an example test. - -Updated the chat program to return the correct errors and support -the ABORT commands. Removed some dead code and did a lot of -testing on a new Coldfire BSP. Version seems to be very stable. - -Update code to use RTEMS pppd network drivers. Now the pppd -software is not dependent on using task driven mode. This -change improved stablity and performance. This was updated -by Mike Siers . -================================================================= - diff --git a/cpukit/pppd/STATUS b/cpukit/pppd/STATUS deleted file mode 100644 index 4c0d35d423..0000000000 --- a/cpukit/pppd/STATUS +++ /dev/null @@ -1,27 +0,0 @@ -# -# $Id$ -# - -The pppd application seems to very stable. It has been tested using -the example application with the i386/pc586 and m68k/sbc5206e BSPs. -The tests were executed using a null modem serial cable to connect -with a UNIX box running either the ppp or pppd application and with -an external modem to dial up a local ISP. - -If you have problems getting your target to make consistent connections -with an ISP, the problem is most likely with the ppp options. First -try using the "novj" and "noaccomp" options. If you have questions -about what other option values are available for the rtems_pppd_set_option -function, please look at the pppd.8 man page file or the the source code. -The majority of options that are documented in man page should work -with this function call. - -The pppd code had now been updated to use it's own RTEMS network -drivers. This removes the requirement for the task driven termios -support. This update has fixed the large packet ping problem. -Currently, I do not know of any problems with the port. - -If you find any other problems or fix some problems, please post your -changes to the RTEMS mailing list. - -Good Luck diff --git a/cpukit/pppd/auth.c b/cpukit/pppd/auth.c deleted file mode 100644 index 418ad7d58e..0000000000 --- a/cpukit/pppd/auth.c +++ /dev/null @@ -1,1121 +0,0 @@ -/* - * auth.c - PPP authentication and phase control. - * - * Copyright (c) 1993 The Australian National University. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the Australian National University. The name of the University - * may not be used to endorse or promote products derived from this - * software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * Copyright (c) 1989 Carnegie Mellon University. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by Carnegie Mellon University. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#define RCSID "$Id$" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#if defined(_PATH_LASTLOG) && defined(_linux_) -#include -#endif - -#include -#include -#include - -#ifdef USE_PAM -#include -#endif - -#ifdef HAS_SHADOW -#include -#ifndef PW_PPP -#define PW_PPP PW_LOGIN -#endif -#endif - -#include "pppd.h" -#include "fsm.h" -#include "lcp.h" -#include "ipcp.h" -#include "upap.h" -#include "chap.h" -#ifdef CBCP_SUPPORT -#include "cbcp.h" -#endif -#include "pathnames.h" - -static const char rcsid[] = RCSID; - -/* The name by which the peer authenticated itself to us. */ -char peer_authname[MAXNAMELEN]; - -/* Records which authentication operations haven't completed yet. */ -static int auth_pending[NUM_PPP]; - -/* List of addresses which the peer may use. */ -static struct permitted_ip *addresses[NUM_PPP]; - -/* Wordlist giving addresses which the peer may use - without authenticating itself. */ -static struct wordlist *noauth_addrs; - -/* Extra options to apply, from the secrets file entry for the peer. */ -static struct wordlist *extra_options; - -/* Number of network protocols which we have opened. */ -static int num_np_open; - -/* Number of network protocols which have come up. */ -static int num_np_up; - -/* Set if we got the contents of passwd[] from the pap-secrets file. */ -static int passwd_from_file; - -/* Set if we require authentication only because we have a default route. */ -static bool default_auth; - -/* Hook for a link status */ -void (*auth_linkup_hook)__P((void)) = NULL; -void (*auth_linkdown_hook)__P((void)) = NULL; - -/* Hook to enable a plugin to control the idle time limit */ -int (*idle_time_hook) __P((struct ppp_idle *)) = NULL; - -/* Hook for a plugin to say whether we can possibly authenticate any peer */ -int (*pap_check_hook) __P((void)) = NULL; - -/* Hook for a plugin to check the PAP user and password */ -int (*pap_auth_hook) __P((char *user, char *passwd/*, char **msgp, - struct wordlist **paddrs, - struct wordlist **popts*/)) = NULL; - -/* Hook for a plugin to know about the PAP user logout */ -void (*pap_logout_hook) __P((void)) = NULL; - -/* Hook for a plugin to get the PAP password for authenticating us */ -int (*pap_passwd_hook) __P((char *user, char *passwd)) = NULL; - -/* - * This is used to ensure that we don't start an auth-up/down - * script while one is already running. - */ -enum script_state { - s_down, - s_up -}; - -static enum script_state auth_state = s_down; -static enum script_state auth_script_state = s_down; - -/* - * Option variables. - */ -bool uselogin = 0; /* Use /etc/passwd for checking PAP */ -bool cryptpap = 0; /* Passwords in pap-secrets are encrypted */ -bool refuse_pap = 0; /* Don't wanna auth. ourselves with PAP */ -bool refuse_chap = 0; /* Don't wanna auth. ourselves with CHAP */ -bool usehostname = 0; /* Use hostname for our_name */ -bool auth_required = 0; /* Always require authentication from peer */ -bool allow_any_ip = 0; /* Allow peer to use any IP address */ -bool explicit_remote = 0; /* User specified explicit remote name */ -char remote_name[MAXNAMELEN]; /* Peer's name for authentication */ - -/* Bits in auth_pending[] */ -#define PAP_WITHPEER 1 -#define PAP_PEER 2 -#define CHAP_WITHPEER 4 -#define CHAP_PEER 8 - -extern char *crypt __P((const char *, const char *)); - -/* Prototypes for procedures local to this file. */ - -static void network_phase __P((int)); -static void check_idle __P((void *)); -static void connect_time_expired __P((void *)); -static int null_login __P((int)); -static int get_pap_passwd __P((char *)); -static int have_pap_secret __P((int *)); -static int have_chap_secret __P((char *, char *, int, int *)); -#if 0 -static int ip_addr_check __P((u_int32_t, struct permitted_ip *)); -#endif -static void free_wordlist __P((struct wordlist *)); -static void auth_script __P((enum script_state s)); -static void set_allowed_addrs __P((int, struct wordlist *, struct wordlist *)); - - -/* - * Authentication-related options. - */ -option_t auth_options[] = { - { "require-pap", o_bool, &lcp_wantoptions[0].neg_upap, - "Require PAP authentication from peer", 1, &auth_required }, - { "+pap", o_bool, &lcp_wantoptions[0].neg_upap, - "Require PAP authentication from peer", 1, &auth_required }, - { "refuse-pap", o_bool, &refuse_pap, - "Don't agree to auth to peer with PAP", 1 }, - { "-pap", o_bool, &refuse_pap, - "Don't allow PAP authentication with peer", 1 }, - { "require-chap", o_bool, &lcp_wantoptions[0].neg_chap, - "Require CHAP authentication from peer", 1, &auth_required }, - { "+chap", o_bool, &lcp_wantoptions[0].neg_chap, - "Require CHAP authentication from peer", 1, &auth_required }, - { "refuse-chap", o_bool, &refuse_chap, - "Don't agree to auth to peer with CHAP", 1 }, - { "-chap", o_bool, &refuse_chap, - "Don't allow CHAP authentication with peer", 1 }, - { "name", o_string, our_name, - "Set local name for authentication", - OPT_PRIV|OPT_STATIC, NULL, MAXNAMELEN }, - { "user", o_string, user, - "Set name for auth with peer", OPT_STATIC, NULL, MAXNAMELEN }, - { "usehostname", o_bool, &usehostname, - "Must use hostname for authentication", 1 }, - { "remotename", o_string, remote_name, - "Set remote name for authentication", OPT_STATIC, - &explicit_remote, MAXNAMELEN }, - { "auth", o_bool, &auth_required, - "Require authentication from peer", 1 }, - { "noauth", o_bool, &auth_required, - "Don't require peer to authenticate", OPT_PRIV, &allow_any_ip }, - { "login", o_bool, &uselogin, - "Use system password database for PAP", 1 }, - { "papcrypt", o_bool, &cryptpap, - "PAP passwords are encrypted", 1 }, -/* Removed for RTEMS PORT - { "+ua", o_special, setupapfile, - "Get PAP user and password from file" }, -*/ - { "password", o_string, passwd, - "Password for authenticating us to the peer", OPT_STATIC, - NULL, MAXSECRETLEN }, -/* Removed for RTEMS_PORT - { "privgroup", o_special, privgroup, - "Allow group members to use privileged options", OPT_PRIV }, - { "allow-ip", o_special, set_noauth_addr, - "Set IP address(es) which can be used without authentication", - OPT_PRIV }, -*/ - { NULL } -}; - -/* - * An Open on LCP has requested a change from Dead to Establish phase. - * Do what's necessary to bring the physical layer up. - */ -void -link_required(unit) - int unit; -{ -} - -/* - * LCP has terminated the link; go to the Dead phase and take the - * physical layer down. - */ -void -link_terminated(unit) - int unit; -{ - if (phase == PHASE_DEAD) - return; - if (pap_logout_hook) { - pap_logout_hook(); - } - new_phase(PHASE_DEAD); - notice("Connection terminated."); -} - -/* - * LCP has gone down; it will either die or try to re-establish. - */ -void -link_down(unit) - int unit; -{ - int i; - struct protent *protp; - - auth_state = s_down; - if (auth_script_state == s_up) { - update_link_stats(unit); - auth_script(s_down); - } - for (i = 0; (protp = protocols[i]) != NULL; ++i) { - if (!protp->enabled_flag) - continue; - if (protp->protocol != PPP_LCP && protp->lowerdown != NULL) - (*protp->lowerdown)(unit); - if (protp->protocol < 0xC000 && protp->close != NULL) - (*protp->close)(unit, "LCP down"); - } - num_np_open = 0; - num_np_up = 0; - if (phase != PHASE_DEAD) - new_phase(PHASE_TERMINATE); -} - -/* - * The link is established. - * Proceed to the Dead, Authenticate or Network phase as appropriate. - */ -void -link_established(unit) - int unit; -{ - int auth; - lcp_options *wo = &lcp_wantoptions[unit]; - lcp_options *go = &lcp_gotoptions[unit]; - lcp_options *ho = &lcp_hisoptions[unit]; - int i; - struct protent *protp; - - /* - * Tell higher-level protocols that LCP is up. - */ - for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->protocol != PPP_LCP && protp->enabled_flag - && protp->lowerup != NULL) - (*protp->lowerup)(unit); - - if (auth_required && !(go->neg_chap || go->neg_upap)) { - /* - * We wanted the peer to authenticate itself, and it refused: - * if we have some address(es) it can use without auth, fine, - * otherwise treat it as though it authenticated with PAP using - * a username * of "" and a password of "". If that's not OK, - * boot it out. - */ - if (noauth_addrs != NULL) { - set_allowed_addrs(unit, noauth_addrs, NULL); - } else if (!wo->neg_upap || !null_login(unit)) { - warn("peer refused to authenticate: terminating link"); - lcp_close(unit, "peer refused to authenticate"); - status = EXIT_PEER_AUTH_FAILED; - return; - } - } - - new_phase(PHASE_AUTHENTICATE); - auth = 0; - if (go->neg_chap) { - ChapAuthPeer(unit, our_name, go->chap_mdtype); - auth |= CHAP_PEER; - } else if (go->neg_upap) { - upap_authpeer(unit); - auth |= PAP_PEER; - } - if (ho->neg_chap) { - ChapAuthWithPeer(unit, user, ho->chap_mdtype); - auth |= CHAP_WITHPEER; - } else if (ho->neg_upap) { - if (passwd[0] == 0) { - passwd_from_file = 1; - if (!get_pap_passwd(passwd)) - error("No secret found for PAP login"); - } - upap_authwithpeer(unit, user, passwd); - auth |= PAP_WITHPEER; - } - auth_pending[unit] = auth; - - if (!auth) - network_phase(unit); -} - -/* - * Proceed to the network phase. - */ -static void -network_phase(unit) - int unit; -{ -#ifdef CBCP_SUPPORT - lcp_options *go = &lcp_gotoptions[unit]; -#endif - - /* always run the auth-up script */ - auth_state = s_up; - if (auth_script_state == s_down) { - auth_script(s_up); - } - -#ifdef CBCP_SUPPORT - /* - * If we negotiated callback, do it now. - */ - if (go->neg_cbcp) { - new_phase(PHASE_CALLBACK); - (*cbcp_protent.open)(unit); - return; - } -#endif - - /* - * Process extra options from the secrets file - */ - if (extra_options) { - options_from_list(extra_options, 1); - free_wordlist(extra_options); - extra_options = 0; - } - start_networks(); -} - -void -start_networks() -{ - int i; - struct protent *protp; - - new_phase(PHASE_NETWORK); - for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->protocol < 0xC000 && protp->enabled_flag - && protp->open != NULL) { - (*protp->open)(0); - if (protp->protocol != PPP_CCP) - ++num_np_open; - } - - if (num_np_open == 0) - /* nothing to do */ - lcp_close(0, "No network protocols running"); -} - -/* - * The peer has failed to authenticate himself using `protocol'. - */ -void -auth_peer_fail(unit, protocol) - int unit, protocol; -{ - /* - * Authentication failure: take the link down - */ - lcp_close(unit, "Authentication failed"); - status = EXIT_PEER_AUTH_FAILED; -} - -/* - * The peer has been successfully authenticated using `protocol'. - */ -void -auth_peer_success(unit, protocol, name, namelen) - int unit, protocol; - char *name; - int namelen; -{ - int bit; - - switch (protocol) { - case PPP_CHAP: - bit = CHAP_PEER; - break; - case PPP_PAP: - bit = PAP_PEER; - break; - default: - warn("auth_peer_success: unknown protocol %x", protocol); - return; - } - - /* - * Save the authenticated name of the peer for later. - */ - if (namelen > sizeof(peer_authname) - 1) - namelen = sizeof(peer_authname) - 1; - BCOPY(name, peer_authname, namelen); - peer_authname[namelen] = 0; - - /* - * If there is no more authentication still to be done, - * proceed to the network (or callback) phase. - */ - if ((auth_pending[unit] &= ~bit) == 0) - network_phase(unit); -} - -/* - * We have failed to authenticate ourselves to the peer using `protocol'. - */ -void -auth_withpeer_fail(unit, protocol) - int unit, protocol; -{ - if (passwd_from_file) - BZERO(passwd, MAXSECRETLEN); - /* - * We've failed to authenticate ourselves to our peer. - * Some servers keep sending CHAP challenges, but there - * is no point in persisting without any way to get updated - * authentication secrets. - */ - lcp_close(unit, "Failed to authenticate ourselves to peer"); - status = EXIT_AUTH_TOPEER_FAILED; -} - -/* - * We have successfully authenticated ourselves with the peer using `protocol'. - */ -void -auth_withpeer_success(unit, protocol) - int unit, protocol; -{ - int bit; - - switch (protocol) { - case PPP_CHAP: - bit = CHAP_WITHPEER; - break; - case PPP_PAP: - if (passwd_from_file) - BZERO(passwd, MAXSECRETLEN); - bit = PAP_WITHPEER; - break; - default: - warn("auth_withpeer_success: unknown protocol %x", protocol); - bit = 0; - } - - /* - * If there is no more authentication still being done, - * proceed to the network (or callback) phase. - */ - if ((auth_pending[unit] &= ~bit) == 0) - network_phase(unit); -} - - -/* - * np_up - a network protocol has come up. - */ -void -np_up(unit, proto) - int unit, proto; -{ - int tlim; - - if (num_np_up == 0) { - /* - * At this point we consider that the link has come up successfully. - */ - status = EXIT_OK; - unsuccess = 0; - new_phase(PHASE_RUNNING); - - if (idle_time_hook != 0) - tlim = (*idle_time_hook)(NULL); - else - tlim = idle_time_limit; - if (tlim > 0) - TIMEOUT(check_idle, NULL, tlim); - - /* - * Set a timeout to close the connection once the maximum - * connect time has expired. - */ - if (maxconnect > 0) - TIMEOUT(connect_time_expired, 0, maxconnect); - } - ++num_np_up; -} - -/* - * np_down - a network protocol has gone down. - */ -void -np_down(unit, proto) - int unit, proto; -{ - if (--num_np_up == 0) { - UNTIMEOUT(check_idle, NULL); - new_phase(PHASE_NETWORK); - } -} - -/* - * np_finished - a network protocol has finished using the link. - */ -void -np_finished(unit, proto) - int unit, proto; -{ - if (--num_np_open <= 0) { - /* no further use for the link: shut up shop. */ - lcp_close(0, "No network protocols running"); - } -} - -/* - * check_idle - check whether the link has been idle for long - * enough that we can shut it down. - */ -static void -check_idle(arg) - void *arg; -{ - struct ppp_idle idle; - time_t itime; - int tlim; - - if (!get_idle_time(0, &idle)) - return; - if (idle_time_hook != 0) { - tlim = idle_time_hook(&idle); - } else { - itime = MIN(idle.xmit_idle, idle.recv_idle); - tlim = idle_time_limit - itime; - } - if (tlim <= 0) { - /* link is idle: shut it down. */ - notice("Terminating connection due to lack of activity."); - lcp_close(0, "Link inactive"); - need_holdoff = 0; - status = EXIT_IDLE_TIMEOUT; - } else { - TIMEOUT(check_idle, NULL, tlim); - } -} - -/* - * connect_time_expired - log a message and close the connection. - */ -static void -connect_time_expired(arg) - void *arg; -{ - info("Connect time expired"); - lcp_close(0, "Connect time expired"); /* Close connection */ - status = EXIT_CONNECT_TIME; -} - -/* - * auth_check_options - called to check authentication options. - */ -int -auth_check_options() -{ - lcp_options *wo = &lcp_wantoptions[0]; - int status = 1; - int can_auth; - int lacks_ip; - - /* Default our_name to hostname, and user to our_name */ - if (our_name[0] == 0 || usehostname) - strlcpy(our_name, hostname, sizeof(our_name)); - if (user[0] == 0) - strlcpy(user, our_name, sizeof(user)); - - /* - * If we have a default route, require the peer to authenticate - * unless the noauth option was given or the real user is root. - */ - if (!auth_required && !allow_any_ip && have_route_to(0) && !privileged) { - printf("auth_check_options: turning on\n"); - auth_required = 1; - default_auth = 1; - } - - /* If authentication is required, ask peer for CHAP or PAP. */ - if (auth_required) { - if (!wo->neg_chap && !wo->neg_upap) { - wo->neg_chap = 1; - wo->neg_upap = 1; - } - } else { - wo->neg_chap = 0; - wo->neg_upap = 0; - } - - /* - * Check whether we have appropriate secrets to use - * to authenticate the peer. - */ - lacks_ip = 0; - can_auth = wo->neg_upap && (uselogin || have_pap_secret(&lacks_ip)); - if (!can_auth && wo->neg_chap) { - can_auth = have_chap_secret((explicit_remote? remote_name: NULL), - our_name, 1, &lacks_ip); - } - - if (auth_required && !can_auth && noauth_addrs == NULL) { - if (default_auth) { - option_error( -"By default the remote system is required to authenticate itself"); - option_error( -"(because this system has a default route to the internet)"); - } else if (explicit_remote) - option_error( -"The remote system (%s) is required to authenticate itself", - remote_name); - else - option_error( -"The remote system is required to authenticate itself"); - option_error( -"but I couldn't find any suitable secret (password) for it to use to do so."); - if (lacks_ip) - option_error( -"(None of the available passwords would let it use an IP address.)"); - - status = 0; - } - return ( status ); -} - -/* - * auth_reset - called when LCP is starting negotiations to recheck - * authentication options, i.e. whether we have appropriate secrets - * to use for authenticating ourselves and/or the peer. - */ -void -auth_reset(unit) - int unit; -{ - lcp_options *go = &lcp_gotoptions[unit]; - lcp_options *ao = &lcp_allowoptions[0]; - - ao->neg_upap = !refuse_pap && (passwd[0] != 0 || get_pap_passwd(NULL)); - ao->neg_chap = !refuse_chap - && (passwd[0] != 0 - || have_chap_secret(user, (explicit_remote? remote_name: NULL), - 0, NULL)); - - if (go->neg_upap && !uselogin && !have_pap_secret(NULL)) - go->neg_upap = 0; - if (go->neg_chap) { - if (!have_chap_secret((explicit_remote? remote_name: NULL), - our_name, 1, NULL)) - go->neg_chap = 0; - } -} - - -/* - * check_passwd - Check the user name and passwd against the PAP secrets - * file. If requested, also check against the system password database, - * and login the user if OK. - * - * returns: - * UPAP_AUTHNAK: Authentication failed. - * UPAP_AUTHACK: Authentication succeeded. - * In either case, msg points to an appropriate message. - */ -int -check_passwd(unit, auser, userlen, apasswd, passwdlen, msg) - int unit; - char *auser; - int userlen; - char *apasswd; - int passwdlen; - char **msg; -{ - char passwd[64], user[64]; - - if (pap_auth_hook) - { - slprintf(passwd, sizeof(passwd), "%.*v", passwdlen, apasswd); - slprintf(user, sizeof(user), "%.*v", userlen, auser); - - return (*pap_auth_hook)(user, passwd/*, NULL, NULL, NULL*/) ? - UPAP_AUTHACK : UPAP_AUTHNAK; - } - - return UPAP_AUTHACK; - -#if 0 - int ret = (int)UPAP_AUTHNAK; - - if (( userlen == 0 ) && ( passwdlen == 0 )) { - ret = (int)UPAP_AUTHACK; - } - printf("check_passwd: %d\n", ret); - - return ret; -#endif -} - -/* - * null_login - Check if a username of "" and a password of "" are - * acceptable, and iff so, set the list of acceptable IP addresses - * and return 1. - */ -static int -null_login(unit) - int unit; -{ - return 0; -} - - -/* - * get_pap_passwd - get a password for authenticating ourselves with - * our peer using PAP. Returns 1 on success, 0 if no suitable password - * could be found. - * Assumes passwd points to MAXSECRETLEN bytes of space (if non-null). - */ -static int -get_pap_passwd(passwd) - char *passwd; -{ - int ret = (int)0; - - /* - * Check whether a plugin wants to supply this. - */ - if (pap_passwd_hook) { - ret = (*pap_passwd_hook)(user, passwd); - } - - return ( ret ); -} - - -/* - * have_pap_secret - check whether we have a PAP file with any - * secrets that we could possibly use for authenticating the peer. - */ -static int -have_pap_secret(lacks_ipp) - int *lacks_ipp; -{ - return 1; - -#if 0 - int ret = (int)0; - - /* let the plugin decide, if there is one */ - printf("have_pap_secret:\n"); - if (pap_check_hook) { - ret = (*pap_check_hook)(); - } - - return ( ret ); -#endif -} - - -/* - * have_chap_secret - check whether we have a CHAP file with a - * secret that we could possibly use for authenticating `client' - * on `server'. Either can be the null string, meaning we don't - * know the identity yet. - */ -static int -have_chap_secret(client, server, need_ip, lacks_ipp) - char *client; - char *server; - int need_ip; - int *lacks_ipp; -{ - return 0; -} - - -/* - * get_secret - open the CHAP secret file and return the secret - * for authenticating the given client on the given server. - * (We could be either client or server). - */ -int -get_secret(unit, client, server, secret, secret_len, am_server) - int unit; - char *client; - char *server; - char *secret; - int *secret_len; - int am_server; -{ - int len; - char secbuf[MAXWORDLEN]; - - if (!am_server && passwd[0] != 0) { - strlcpy(secbuf, passwd, sizeof(secbuf)); - } else { - return 0; - } - - len = strlen(secbuf); - if (len > MAXSECRETLEN) { - error("Secret for %s on %s is too long", client, server); - len = MAXSECRETLEN; - } - BCOPY(secbuf, secret, len); - BZERO(secbuf, sizeof(secbuf)); - *secret_len = len; - - return 1; -} - -/* - * set_allowed_addrs() - set the list of allowed addresses. - * Also looks for `--' indicating options to apply for this peer - * and leaves the following words in extra_options. - */ -static void -set_allowed_addrs(unit, addrs, opts) - int unit; - struct wordlist *addrs; - struct wordlist *opts; -{ - int n; - struct wordlist *ap, **pap; - struct permitted_ip *ip; - char *ptr_word, *ptr_mask; - struct hostent *hp; - struct netent *np; - u_int32_t a, mask, ah, offset; - struct ipcp_options *wo = &ipcp_wantoptions[unit]; - u_int32_t suggested_ip = 0; - - if (addresses[unit] != NULL) - free(addresses[unit]); - addresses[unit] = NULL; - if (extra_options != NULL) - free_wordlist(extra_options); - extra_options = opts; - - /* - * Count the number of IP addresses given. - */ - for (n = 0, pap = &addrs; (ap = *pap) != NULL; pap = &ap->next) - ++n; - if (n == 0) - return; - ip = (struct permitted_ip *) malloc((n + 1) * sizeof(struct permitted_ip)); - if (ip == 0) - return; - - n = 0; - for (ap = addrs; ap != NULL; ap = ap->next) { - /* "-" means no addresses authorized, "*" means any address allowed */ - ptr_word = ap->word; - if (strcmp(ptr_word, "-") == 0) - break; - if (strcmp(ptr_word, "*") == 0) { - ip[n].permit = 1; - ip[n].base = ip[n].mask = 0; - ++n; - break; - } - - ip[n].permit = 1; - if (*ptr_word == '!') { - ip[n].permit = 0; - ++ptr_word; - } - - mask = ~ (u_int32_t) 0; - offset = 0; - ptr_mask = strchr (ptr_word, '/'); - if (ptr_mask != NULL) { - int bit_count; - char *endp; - - bit_count = (int) strtol (ptr_mask+1, &endp, 10); - if (bit_count <= 0 || bit_count > 32) { - warn("invalid address length %v in auth. address list", - ptr_mask+1); - continue; - } - bit_count = 32 - bit_count; /* # bits in host part */ - if (*endp == '+') { - offset = pppifunit + 1; - ++endp; - } - if (*endp != 0) { - warn("invalid address length syntax: %v", ptr_mask+1); - continue; - } - *ptr_mask = '\0'; - mask <<= bit_count; - } - - hp = gethostbyname(ptr_word); - if (hp != NULL && hp->h_addrtype == AF_INET) { - a = *(u_int32_t *)hp->h_addr; - } else { - np = getnetbyname (ptr_word); - if (np != NULL && np->n_addrtype == AF_INET) { - a = htonl (*(u_int32_t *)np->n_net); - if (ptr_mask == NULL) { - /* calculate appropriate mask for net */ - ah = ntohl(a); - if (IN_CLASSA(ah)) - mask = IN_CLASSA_NET; - else if (IN_CLASSB(ah)) - mask = IN_CLASSB_NET; - else if (IN_CLASSC(ah)) - mask = IN_CLASSC_NET; - } - } else { - a = inet_addr (ptr_word); - } - } - - if (ptr_mask != NULL) - *ptr_mask = '/'; - - if (a == (u_int32_t)-1L) { - warn("unknown host %s in auth. address list", ap->word); - continue; - } - if (offset != 0) { - if (offset >= ~mask) { - warn("interface unit %d too large for subnet %v", - pppifunit, ptr_word); - continue; - } - a = htonl((ntohl(a) & mask) + offset); - mask = ~(u_int32_t)0; - } - ip[n].mask = htonl(mask); - ip[n].base = a & ip[n].mask; - ++n; - if (~mask == 0 && suggested_ip == 0) - suggested_ip = a; - } - - ip[n].permit = 0; /* make the last entry forbid all addresses */ - ip[n].base = 0; /* to terminate the list */ - ip[n].mask = 0; - - addresses[unit] = ip; - - /* - * If the address given for the peer isn't authorized, or if - * the user hasn't given one, AND there is an authorized address - * which is a single host, then use that if we find one. - */ - if (suggested_ip != 0 - && (wo->hisaddr == 0 || !auth_ip_addr(unit, wo->hisaddr))) - wo->hisaddr = suggested_ip; -} - -/* - * auth_ip_addr - check whether the peer is authorized to use - * a given IP address. Returns 1 if authorized, 0 otherwise. - */ -int -auth_ip_addr(unit, addr) - int unit; - u_int32_t addr; -{ -#if 0 - int ok; -#endif - - /* don't allow loopback or multicast address */ - if (bad_ip_adrs(addr)) - return 0; - - return 1; - -#if 0 - if (addresses[unit] != NULL) { - ok = ip_addr_check(addr, addresses[unit]); - if (ok >= 0) - return ok; - } - if (auth_required) - return 0; /* no addresses authorized */ - return allow_any_ip || !have_route_to(addr); -#endif -} - -#if 0 -static int -ip_addr_check(addr, addrs) - u_int32_t addr; - struct permitted_ip *addrs; -{ - for (; ; ++addrs) - if ((addr & addrs->mask) == addrs->base) - return addrs->permit; -} -#endif - -/* - * bad_ip_adrs - return 1 if the IP address is one we don't want - * to use, such as an address in the loopback net or a multicast address. - * addr is in network byte order. - */ -int -bad_ip_adrs(addr) - u_int32_t addr; -{ - addr = ntohl(addr); - return (addr >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET - || IN_MULTICAST(addr) || IN_BADCLASS(addr); -} - -/* - * free_wordlist - release memory allocated for a wordlist. - */ -static void -free_wordlist(wp) - struct wordlist *wp; -{ - struct wordlist *next; - - while (wp != NULL) { - next = wp->next; - free(wp); - wp = next; - } -} - -/* - * auth_script - execute a script with arguments - * interface-name peer-name real-user tty speed - */ -static void -auth_script(s) - enum script_state s; -{ - switch (s) { - case s_up: - auth_script_state = s_up; - if ( auth_linkup_hook ) { - (*auth_linkup_hook)(); - } - break; - case s_down: - auth_script_state = s_down; - if ( auth_linkdown_hook ) { - (*auth_linkdown_hook)(); - } - break; - } -} diff --git a/cpukit/pppd/cbcp.c b/cpukit/pppd/cbcp.c deleted file mode 100644 index eb60a8e249..0000000000 --- a/cpukit/pppd/cbcp.c +++ /dev/null @@ -1,456 +0,0 @@ -/* - * cbcp - Call Back Configuration Protocol. - * - * Copyright (c) 1995 Pedro Roque Marques - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by Pedro Roque Marques. The name of the author may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#define RCSID "$Id$" - -#include -#include -#include -#include - -#include "pppd.h" -#include "cbcp.h" -#include "fsm.h" -#include "lcp.h" - -static const char rcsid[] = RCSID; - -/* - * Options. - */ -static int setcbcp __P((char **)); - -static option_t cbcp_option_list[] = { - { "callback", o_special, setcbcp, - "Ask for callback" }, - { NULL } -}; - -/* - * Protocol entry points. - */ -static void cbcp_init __P((int unit)); -static void cbcp_open __P((int unit)); -static void cbcp_lowerup __P((int unit)); -static void cbcp_input __P((int unit, u_char *pkt, int len)); -static void cbcp_protrej __P((int unit)); -static int cbcp_printpkt __P((u_char *pkt, int len, - void (*printer) __P((void *, char *, ...)), - void *arg)); - -struct protent cbcp_protent = { - PPP_CBCP, - cbcp_init, - cbcp_input, - cbcp_protrej, - cbcp_lowerup, - NULL, - cbcp_open, - NULL, - cbcp_printpkt, - NULL, - 0, - "CBCP", - NULL, - cbcp_option_list, - NULL, - NULL, - NULL -}; - -cbcp_state cbcp[NUM_PPP]; - -/* internal prototypes */ - -static void cbcp_recvreq __P((cbcp_state *us, char *pckt, int len)); -static void cbcp_resp __P((cbcp_state *us)); -static void cbcp_up __P((cbcp_state *us)); -static void cbcp_recvack __P((cbcp_state *us, char *pckt, int len)); -static void cbcp_send __P((cbcp_state *us, u_char code, u_char *buf, int len)); - -/* option processing */ -static int -setcbcp(argv) - char **argv; -{ - lcp_wantoptions[0].neg_cbcp = 1; - cbcp_protent.enabled_flag = 1; - cbcp[0].us_number = strdup(*argv); - if (cbcp[0].us_number == 0) - novm("callback number"); - cbcp[0].us_type |= (1 << CB_CONF_USER); - cbcp[0].us_type |= (1 << CB_CONF_ADMIN); - return (1); -} - -/* init state */ -static void -cbcp_init(iface) - int iface; -{ - cbcp_state *us; - - us = &cbcp[iface]; - memset(us, 0, sizeof(cbcp_state)); - us->us_unit = iface; - us->us_type |= (1 << CB_CONF_NO); -} - -/* lower layer is up */ -static void -cbcp_lowerup(iface) - int iface; -{ - cbcp_state *us = &cbcp[iface]; - - dbglog("cbcp_lowerup"); - dbglog("want: %d", us->us_type); - - if (us->us_type == CB_CONF_USER) - dbglog("phone no: %s", us->us_number); -} - -static void -cbcp_open(unit) - int unit; -{ - dbglog("cbcp_open"); -} - -/* process an incomming packet */ -static void -cbcp_input(unit, inpacket, pktlen) - int unit; - u_char *inpacket; - int pktlen; -{ - u_char *inp; - u_char code, id; - u_short len; - - cbcp_state *us = &cbcp[unit]; - - inp = inpacket; - - if (pktlen < CBCP_MINLEN) { - error("CBCP packet is too small"); - return; - } - - GETCHAR(code, inp); - GETCHAR(id, inp); - GETSHORT(len, inp); - -#if 0 - if (len > pktlen) { - error("CBCP packet: invalid length"); - return; - } -#endif - - len -= CBCP_MINLEN; - - switch(code) { - case CBCP_REQ: - us->us_id = id; - cbcp_recvreq(us, inp, len); - break; - - case CBCP_RESP: - dbglog("CBCP_RESP received"); - break; - - case CBCP_ACK: - if (id != us->us_id) - dbglog("id doesn't match: expected %d recv %d", - us->us_id, id); - - cbcp_recvack(us, inp, len); - break; - - default: - break; - } -} - -/* protocol was rejected by foe */ -void cbcp_protrej(int iface) -{ -} - -char *cbcp_codenames[] = { - "Request", "Response", "Ack" -}; - -char *cbcp_optionnames[] = { - "NoCallback", - "UserDefined", - "AdminDefined", - "List" -}; - -/* pretty print a packet */ -static int -cbcp_printpkt(p, plen, printer, arg) - u_char *p; - int plen; - void (*printer) __P((void *, char *, ...)); - void *arg; -{ - int code, opt, id, len, olen, delay; - u_char *pstart; - - if (plen < HEADERLEN) - return 0; - pstart = p; - GETCHAR(code, p); - GETCHAR(id, p); - GETSHORT(len, p); - if (len < HEADERLEN || len > plen) - return 0; - - if (code >= 1 && code <= sizeof(cbcp_codenames) / sizeof(char *)) - printer(arg, " %s", cbcp_codenames[code-1]); - else - printer(arg, " code=0x%x", code); - - printer(arg, " id=0x%x", id); - len -= HEADERLEN; - - switch (code) { - case CBCP_REQ: - case CBCP_RESP: - case CBCP_ACK: - while(len >= 2) { - GETCHAR(opt, p); - GETCHAR(olen, p); - - if (olen < 2 || olen > len) { - break; - } - - printer(arg, " <"); - len -= olen; - - if (opt >= 1 && opt <= sizeof(cbcp_optionnames) / sizeof(char *)) - printer(arg, " %s", cbcp_optionnames[opt-1]); - else - printer(arg, " option=0x%x", opt); - - if (olen > 2) { - GETCHAR(delay, p); - printer(arg, " delay = %d", delay); - } - - if (olen > 3) { - int addrt; - char str[256]; - - GETCHAR(addrt, p); - memcpy(str, p, olen - 4); - str[olen - 4] = 0; - printer(arg, " number = %s", str); - } - printer(arg, ">"); - break; - } - - default: - break; - } - - for (; len > 0; --len) { - GETCHAR(code, p); - printer(arg, " %.2x", code); - } - - return p - pstart; -} - -/* received CBCP request */ -static void -cbcp_recvreq(us, pckt, pcktlen) - cbcp_state *us; - char *pckt; - int pcktlen; -{ - u_char type, opt_len, delay, addr_type; - char address[256]; - int len = pcktlen; - - address[0] = 0; - - while (len) { - dbglog("length: %d", len); - - GETCHAR(type, pckt); - GETCHAR(opt_len, pckt); - - if (opt_len > 2) - GETCHAR(delay, pckt); - - us->us_allowed |= (1 << type); - - switch(type) { - case CB_CONF_NO: - dbglog("no callback allowed"); - break; - - case CB_CONF_USER: - dbglog("user callback allowed"); - if (opt_len > 4) { - GETCHAR(addr_type, pckt); - memcpy(address, pckt, opt_len - 4); - address[opt_len - 4] = 0; - if (address[0]) - dbglog("address: %s", address); - } - break; - - case CB_CONF_ADMIN: - dbglog("user admin defined allowed"); - break; - - case CB_CONF_LIST: - break; - } - len -= opt_len; - } - - cbcp_resp(us); -} - -static void -cbcp_resp(us) - cbcp_state *us; -{ - u_char cb_type; - u_char buf[256]; - u_char *bufp = buf; - int len = 0; - - cb_type = us->us_allowed & us->us_type; - dbglog("cbcp_resp cb_type=%d", cb_type); - -#if 0 - if (!cb_type) - lcp_down(us->us_unit); -#endif - - if (cb_type & ( 1 << CB_CONF_USER ) ) { - dbglog("cbcp_resp CONF_USER"); - PUTCHAR(CB_CONF_USER, bufp); - len = 3 + 1 + strlen(us->us_number) + 1; - PUTCHAR(len , bufp); - PUTCHAR(5, bufp); /* delay */ - PUTCHAR(1, bufp); - BCOPY(us->us_number, bufp, strlen(us->us_number) + 1); - cbcp_send(us, CBCP_RESP, buf, len); - return; - } - - if (cb_type & ( 1 << CB_CONF_ADMIN ) ) { - dbglog("cbcp_resp CONF_ADMIN"); - PUTCHAR(CB_CONF_ADMIN, bufp); - len = 3; - PUTCHAR(len, bufp); - PUTCHAR(5, bufp); /* delay */ - cbcp_send(us, CBCP_RESP, buf, len); - return; - } - - if (cb_type & ( 1 << CB_CONF_NO ) ) { - dbglog("cbcp_resp CONF_NO"); - PUTCHAR(CB_CONF_NO, bufp); - len = 3; - PUTCHAR(len , bufp); - PUTCHAR(0, bufp); - cbcp_send(us, CBCP_RESP, buf, len); - start_networks(); - return; - } -} - -static void -cbcp_send(us, code, buf, len) - cbcp_state *us; - u_char code; - u_char *buf; - int len; -{ - u_char *outp; - int outlen; - - outp = outpacket_buf; - - outlen = 4 + len; - - MAKEHEADER(outp, PPP_CBCP); - - PUTCHAR(code, outp); - PUTCHAR(us->us_id, outp); - PUTSHORT(outlen, outp); - - if (len) - BCOPY(buf, outp, len); - - output(us->us_unit, outpacket_buf, outlen + PPP_HDRLEN); -} - -static void -cbcp_recvack(us, pckt, len) - cbcp_state *us; - char *pckt; - int len; -{ - u_char type, delay, addr_type; - int opt_len; - char address[256]; - - if (len) { - GETCHAR(type, pckt); - GETCHAR(opt_len, pckt); - - if (opt_len > 2) - GETCHAR(delay, pckt); - - if (opt_len > 4) { - GETCHAR(addr_type, pckt); - memcpy(address, pckt, opt_len - 4); - address[opt_len - 4] = 0; - if (address[0]) - dbglog("peer will call: %s", address); - } - if (type == CB_CONF_NO) - return; - } - - cbcp_up(us); -} - -/* ok peer will do callback */ -static void -cbcp_up(us) - cbcp_state *us; -{ - persist = 0; - lcp_close(0, "Call me back, please"); - status = EXIT_CALLBACK; -} diff --git a/cpukit/pppd/cbcp.h b/cpukit/pppd/cbcp.h deleted file mode 100644 index c2ab3f6899..0000000000 --- a/cpukit/pppd/cbcp.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef CBCP_H -#define CBCP_H - -typedef struct cbcp_state { - int us_unit; /* Interface unit number */ - u_char us_id; /* Current id */ - u_char us_allowed; - int us_type; - char *us_number; /* Telefone Number */ -} cbcp_state; - -extern cbcp_state cbcp[]; - -extern struct protent cbcp_protent; - -#define CBCP_MINLEN 4 - -#define CBCP_REQ 1 -#define CBCP_RESP 2 -#define CBCP_ACK 3 - -#define CB_CONF_NO 1 -#define CB_CONF_USER 2 -#define CB_CONF_ADMIN 3 -#define CB_CONF_LIST 4 -#endif diff --git a/cpukit/pppd/ccp.c b/cpukit/pppd/ccp.c deleted file mode 100644 index 094a96d8f5..0000000000 --- a/cpukit/pppd/ccp.c +++ /dev/null @@ -1,1227 +0,0 @@ -/* - * ccp.c - PPP Compression Control Protocol. - * - * Copyright (c) 1994 The Australian National University. - * All rights reserved. - * - * Permission to use, copy, modify, and distribute this software and its - * documentation is hereby granted, provided that the above copyright - * notice appears in all copies. This software is provided without any - * warranty, express or implied. The Australian National University - * makes no representations about the suitability of this software for - * any purpose. - * - * IN NO EVENT SHALL THE AUSTRALIAN NATIONAL UNIVERSITY BE LIABLE TO ANY - * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES - * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF - * THE AUSTRALIAN NATIONAL UNIVERSITY HAVE BEEN ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * THE AUSTRALIAN NATIONAL UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS - * ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO - * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, - * OR MODIFICATIONS. - */ - -#define RCSID "$Id$" - -#include -#include - -#include "pppd.h" -#include "fsm.h" -#include "ccp.h" -#include - -static const char rcsid[] = RCSID; - -/* - * Command-line options. - */ -static int setbsdcomp __P((char **)); -static int setdeflate __P((char **)); - -static option_t ccp_option_list[] = { - { "noccp", o_bool, &ccp_protent.enabled_flag, - "Disable CCP negotiation" }, - { "-ccp", o_bool, &ccp_protent.enabled_flag, - "Disable CCP negotiation" }, - { "bsdcomp", o_special, setbsdcomp, - "Request BSD-Compress packet compression" }, - { "nobsdcomp", o_bool, &ccp_wantoptions[0].bsd_compress, - "don't allow BSD-Compress", OPT_A2COPY, - &ccp_allowoptions[0].bsd_compress }, - { "-bsdcomp", o_bool, &ccp_wantoptions[0].bsd_compress, - "don't allow BSD-Compress", OPT_A2COPY, - &ccp_allowoptions[0].bsd_compress }, - { "deflate", 1, setdeflate, - "request Deflate compression" }, - { "nodeflate", o_bool, &ccp_wantoptions[0].deflate, - "don't allow Deflate compression", OPT_A2COPY, - &ccp_allowoptions[0].deflate }, - { "-deflate", o_bool, &ccp_wantoptions[0].deflate, - "don't allow Deflate compression", OPT_A2COPY, - &ccp_allowoptions[0].deflate }, - { "nodeflatedraft", o_bool, &ccp_wantoptions[0].deflate_draft, - "don't use draft deflate #", OPT_A2COPY, - &ccp_allowoptions[0].deflate_draft }, - { "predictor1", o_bool, &ccp_wantoptions[0].predictor_1, - "request Predictor-1", 1, &ccp_allowoptions[0].predictor_1 }, - { "nopredictor1", o_bool, &ccp_wantoptions[0].predictor_1, - "don't allow Predictor-1", OPT_A2COPY, - &ccp_allowoptions[0].predictor_1 }, - { "-predictor1", o_bool, &ccp_wantoptions[0].predictor_1, - "don't allow Predictor-1", OPT_A2COPY, - &ccp_allowoptions[0].predictor_1 }, - - { NULL } -}; - -/* - * Protocol entry points from main code. - */ -static void ccp_init __P((int unit)); -static void ccp_open __P((int unit)); -static void ccp_close __P((int unit, char *)); -static void ccp_lowerup __P((int unit)); -static void ccp_lowerdown __P((int)); -static void ccp_input __P((int unit, u_char *pkt, int len)); -static void ccp_protrej __P((int unit)); -static int ccp_printpkt __P((u_char *pkt, int len, - void (*printer) __P((void *, char *, ...)), - void *arg)); -static void ccp_datainput __P((int unit, u_char *pkt, int len)); - -struct protent ccp_protent = { - PPP_CCP, - ccp_init, - ccp_input, - ccp_protrej, - ccp_lowerup, - ccp_lowerdown, - ccp_open, - ccp_close, - ccp_printpkt, - ccp_datainput, - 1, - "CCP", - "Compressed", - ccp_option_list, - NULL, - NULL, - NULL -}; - -fsm ccp_fsm[NUM_PPP]; -ccp_options ccp_wantoptions[NUM_PPP]; /* what to request the peer to use */ -ccp_options ccp_gotoptions[NUM_PPP]; /* what the peer agreed to do */ -ccp_options ccp_allowoptions[NUM_PPP]; /* what we'll agree to do */ -ccp_options ccp_hisoptions[NUM_PPP]; /* what we agreed to do */ - -/* - * Callbacks for fsm code. - */ -static void ccp_resetci __P((fsm *)); -static int ccp_cilen __P((fsm *)); -static void ccp_addci __P((fsm *, u_char *, int *)); -static int ccp_ackci __P((fsm *, u_char *, int)); -static int ccp_nakci __P((fsm *, u_char *, int)); -static int ccp_rejci __P((fsm *, u_char *, int)); -static int ccp_reqci __P((fsm *, u_char *, int *, int)); -static void ccp_up __P((fsm *)); -static void ccp_down __P((fsm *)); -static int ccp_extcode __P((fsm *, int, int, u_char *, int)); -static void ccp_rack_timeout __P((void *)); -static char *method_name __P((ccp_options *, ccp_options *)); - -static fsm_callbacks ccp_callbacks = { - ccp_resetci, - ccp_cilen, - ccp_addci, - ccp_ackci, - ccp_nakci, - ccp_rejci, - ccp_reqci, - ccp_up, - ccp_down, - NULL, - NULL, - NULL, - NULL, - ccp_extcode, - "CCP" -}; - -/* - * Do we want / did we get any compression? - */ -#define ANY_COMPRESS(opt) ((opt).deflate || (opt).bsd_compress \ - || (opt).predictor_1 || (opt).predictor_2) - -/* - * Local state (mainly for handling reset-reqs and reset-acks). - */ -static int ccp_localstate[NUM_PPP]; -#define RACK_PENDING 1 /* waiting for reset-ack */ -#define RREQ_REPEAT 2 /* send another reset-req if no reset-ack */ - -#define RACKTIMEOUT 1 /* second */ - -static int all_rejected[NUM_PPP]; /* we rejected all peer's options */ - -/* - * Option parsing. - */ -static int -setbsdcomp(argv) - char **argv; -{ - int rbits, abits; - char *str, *endp; - - str = *argv; - abits = rbits = strtol(str, &endp, 0); - if (endp != str && *endp == ',') { - str = endp + 1; - abits = strtol(str, &endp, 0); - } - if (*endp != 0 || endp == str) { - option_error("invalid parameter '%s' for bsdcomp option", *argv); - return 0; - } - if ((rbits != 0 && (rbits < BSD_MIN_BITS || rbits > BSD_MAX_BITS)) - || (abits != 0 && (abits < BSD_MIN_BITS || abits > BSD_MAX_BITS))) { - option_error("bsdcomp option values must be 0 or %d .. %d", - BSD_MIN_BITS, BSD_MAX_BITS); - return 0; - } - if (rbits > 0) { - ccp_wantoptions[0].bsd_compress = 1; - ccp_wantoptions[0].bsd_bits = rbits; - } else - ccp_wantoptions[0].bsd_compress = 0; - if (abits > 0) { - ccp_allowoptions[0].bsd_compress = 1; - ccp_allowoptions[0].bsd_bits = abits; - } else - ccp_allowoptions[0].bsd_compress = 0; - return 1; -} - -static int -setdeflate(argv) - char **argv; -{ - int rbits, abits; - char *str, *endp; - - str = *argv; - abits = rbits = strtol(str, &endp, 0); - if (endp != str && *endp == ',') { - str = endp + 1; - abits = strtol(str, &endp, 0); - } - if (*endp != 0 || endp == str) { - option_error("invalid parameter '%s' for deflate option", *argv); - return 0; - } - if ((rbits != 0 && (rbits < DEFLATE_MIN_SIZE || rbits > DEFLATE_MAX_SIZE)) - || (abits != 0 && (abits < DEFLATE_MIN_SIZE - || abits > DEFLATE_MAX_SIZE))) { - option_error("deflate option values must be 0 or %d .. %d", - DEFLATE_MIN_SIZE, DEFLATE_MAX_SIZE); - return 0; - } - if (rbits > 0) { - ccp_wantoptions[0].deflate = 1; - ccp_wantoptions[0].deflate_size = rbits; - } else - ccp_wantoptions[0].deflate = 0; - if (abits > 0) { - ccp_allowoptions[0].deflate = 1; - ccp_allowoptions[0].deflate_size = abits; - } else - ccp_allowoptions[0].deflate = 0; - return 1; -} - - -/* - * ccp_init - initialize CCP. - */ -static void -ccp_init(unit) - int unit; -{ - fsm *f = &ccp_fsm[unit]; - - f->unit = unit; - f->protocol = PPP_CCP; - f->callbacks = &ccp_callbacks; - fsm_init(f); - - memset(&ccp_wantoptions[unit], 0, sizeof(ccp_options)); - memset(&ccp_gotoptions[unit], 0, sizeof(ccp_options)); - memset(&ccp_allowoptions[unit], 0, sizeof(ccp_options)); - memset(&ccp_hisoptions[unit], 0, sizeof(ccp_options)); - - ccp_wantoptions[0].deflate = 1; - ccp_wantoptions[0].deflate_size = DEFLATE_MAX_SIZE; - ccp_wantoptions[0].deflate_correct = 1; - ccp_wantoptions[0].deflate_draft = 1; - ccp_allowoptions[0].deflate = 1; - ccp_allowoptions[0].deflate_size = DEFLATE_MAX_SIZE; - ccp_allowoptions[0].deflate_correct = 1; - ccp_allowoptions[0].deflate_draft = 1; - - ccp_wantoptions[0].bsd_compress = 1; - ccp_wantoptions[0].bsd_bits = BSD_MAX_BITS; - ccp_allowoptions[0].bsd_compress = 1; - ccp_allowoptions[0].bsd_bits = BSD_MAX_BITS; - - ccp_allowoptions[0].predictor_1 = 1; -} - -/* - * ccp_open - CCP is allowed to come up. - */ -static void -ccp_open(unit) - int unit; -{ - fsm *f = &ccp_fsm[unit]; - - if (f->state != OPENED) - ccp_flags_set(unit, 1, 0); - - /* - * Find out which compressors the kernel supports before - * deciding whether to open in silent mode. - */ - ccp_resetci(f); - if (!ANY_COMPRESS(ccp_gotoptions[unit])) - f->flags |= OPT_SILENT; - - fsm_open(f); -} - -/* - * ccp_close - Terminate CCP. - */ -static void -ccp_close(unit, reason) - int unit; - char *reason; -{ - ccp_flags_set(unit, 0, 0); - fsm_close(&ccp_fsm[unit], reason); -} - -/* - * ccp_lowerup - we may now transmit CCP packets. - */ -static void -ccp_lowerup(unit) - int unit; -{ - fsm_lowerup(&ccp_fsm[unit]); -} - -/* - * ccp_lowerdown - we may not transmit CCP packets. - */ -static void -ccp_lowerdown(unit) - int unit; -{ - fsm_lowerdown(&ccp_fsm[unit]); -} - -/* - * ccp_input - process a received CCP packet. - */ -static void -ccp_input(unit, p, len) - int unit; - u_char *p; - int len; -{ - fsm *f = &ccp_fsm[unit]; - int oldstate; - - /* - * Check for a terminate-request so we can print a message. - */ - oldstate = f->state; - fsm_input(f, p, len); - if (oldstate == OPENED && p[0] == TERMREQ && f->state != OPENED) - notice("Compression disabled by peer."); - - /* - * If we get a terminate-ack and we're not asking for compression, - * close CCP. - */ - if (oldstate == REQSENT && p[0] == TERMACK - && !ANY_COMPRESS(ccp_gotoptions[unit])) - ccp_close(unit, "No compression negotiated"); -} - -/* - * Handle a CCP-specific code. - */ -static int -ccp_extcode(f, code, id, p, len) - fsm *f; - int code, id; - u_char *p; - int len; -{ - switch (code) { - case CCP_RESETREQ: - if (f->state != OPENED) - break; - /* send a reset-ack, which the transmitter will see and - reset its compression state. */ - fsm_sdata(f, CCP_RESETACK, id, NULL, 0); - break; - - case CCP_RESETACK: - if (ccp_localstate[f->unit] & RACK_PENDING && id == f->reqid) { - ccp_localstate[f->unit] &= ~(RACK_PENDING | RREQ_REPEAT); - UNTIMEOUT(ccp_rack_timeout, f); - } - break; - - default: - return 0; - } - - return 1; -} - -/* - * ccp_protrej - peer doesn't talk CCP. - */ -static void -ccp_protrej(unit) - int unit; -{ - ccp_flags_set(unit, 0, 0); - fsm_lowerdown(&ccp_fsm[unit]); -} - -/* - * ccp_resetci - initialize at start of negotiation. - */ -static void -ccp_resetci(f) - fsm *f; -{ - ccp_options *go = &ccp_gotoptions[f->unit]; - u_char opt_buf[16]; - - *go = ccp_wantoptions[f->unit]; - all_rejected[f->unit] = 0; - - /* - * Check whether the kernel knows about the various - * compression methods we might request. - */ - if (go->bsd_compress) { - opt_buf[0] = CI_BSD_COMPRESS; - opt_buf[1] = CILEN_BSD_COMPRESS; - opt_buf[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, BSD_MIN_BITS); - if (ccp_test(f->unit, opt_buf, CILEN_BSD_COMPRESS, 0) <= 0) - go->bsd_compress = 0; - } - if (go->deflate) { - if (go->deflate_correct) { - opt_buf[0] = CI_DEFLATE; - opt_buf[1] = CILEN_DEFLATE; - opt_buf[2] = DEFLATE_MAKE_OPT(DEFLATE_MIN_SIZE); - opt_buf[3] = DEFLATE_CHK_SEQUENCE; - if (ccp_test(f->unit, opt_buf, CILEN_DEFLATE, 0) <= 0) - go->deflate_correct = 0; - } - if (go->deflate_draft) { - opt_buf[0] = CI_DEFLATE_DRAFT; - opt_buf[1] = CILEN_DEFLATE; - opt_buf[2] = DEFLATE_MAKE_OPT(DEFLATE_MIN_SIZE); - opt_buf[3] = DEFLATE_CHK_SEQUENCE; - if (ccp_test(f->unit, opt_buf, CILEN_DEFLATE, 0) <= 0) - go->deflate_draft = 0; - } - if (!go->deflate_correct && !go->deflate_draft) - go->deflate = 0; - } - if (go->predictor_1) { - opt_buf[0] = CI_PREDICTOR_1; - opt_buf[1] = CILEN_PREDICTOR_1; - if (ccp_test(f->unit, opt_buf, CILEN_PREDICTOR_1, 0) <= 0) - go->predictor_1 = 0; - } - if (go->predictor_2) { - opt_buf[0] = CI_PREDICTOR_2; - opt_buf[1] = CILEN_PREDICTOR_2; - if (ccp_test(f->unit, opt_buf, CILEN_PREDICTOR_2, 0) <= 0) - go->predictor_2 = 0; - } -} - -/* - * ccp_cilen - Return total length of our configuration info. - */ -static int -ccp_cilen(f) - fsm *f; -{ - ccp_options *go = &ccp_gotoptions[f->unit]; - - return (go->bsd_compress? CILEN_BSD_COMPRESS: 0) - + (go->deflate? CILEN_DEFLATE: 0) - + (go->predictor_1? CILEN_PREDICTOR_1: 0) - + (go->predictor_2? CILEN_PREDICTOR_2: 0); -} - -/* - * ccp_addci - put our requests in a packet. - */ -static void -ccp_addci(f, p, lenp) - fsm *f; - u_char *p; - int *lenp; -{ - int res; - ccp_options *go = &ccp_gotoptions[f->unit]; - u_char *p0 = p; - - /* - * Add the compression types that we can receive, in decreasing - * preference order. Get the kernel to allocate the first one - * in case it gets Acked. - */ - if (go->deflate) { - p[0] = go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT; - p[1] = CILEN_DEFLATE; - p[2] = DEFLATE_MAKE_OPT(go->deflate_size); - p[3] = DEFLATE_CHK_SEQUENCE; - for (;;) { - res = ccp_test(f->unit, p, CILEN_DEFLATE, 0); - if (res > 0) { - p += CILEN_DEFLATE; - break; - } - if (res < 0 || go->deflate_size <= DEFLATE_MIN_SIZE) { - go->deflate = 0; - break; - } - --go->deflate_size; - p[2] = DEFLATE_MAKE_OPT(go->deflate_size); - } - if (p != p0 && go->deflate_correct && go->deflate_draft) { - p[0] = CI_DEFLATE_DRAFT; - p[1] = CILEN_DEFLATE; - p[2] = p[2 - CILEN_DEFLATE]; - p[3] = DEFLATE_CHK_SEQUENCE; - p += CILEN_DEFLATE; - } - } - if (go->bsd_compress) { - p[0] = CI_BSD_COMPRESS; - p[1] = CILEN_BSD_COMPRESS; - p[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, go->bsd_bits); - if (p != p0) { - p += CILEN_BSD_COMPRESS; /* not the first option */ - } else { - for (;;) { - res = ccp_test(f->unit, p, CILEN_BSD_COMPRESS, 0); - if (res > 0) { - p += CILEN_BSD_COMPRESS; - break; - } - if (res < 0 || go->bsd_bits <= BSD_MIN_BITS) { - go->bsd_compress = 0; - break; - } - --go->bsd_bits; - p[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, go->bsd_bits); - } - } - } - /* XXX Should Predictor 2 be preferable to Predictor 1? */ - if (go->predictor_1) { - p[0] = CI_PREDICTOR_1; - p[1] = CILEN_PREDICTOR_1; - if (p == p0 && ccp_test(f->unit, p, CILEN_PREDICTOR_1, 0) <= 0) { - go->predictor_1 = 0; - } else { - p += CILEN_PREDICTOR_1; - } - } - if (go->predictor_2) { - p[0] = CI_PREDICTOR_2; - p[1] = CILEN_PREDICTOR_2; - if (p == p0 && ccp_test(f->unit, p, CILEN_PREDICTOR_2, 0) <= 0) { - go->predictor_2 = 0; - } else { - p += CILEN_PREDICTOR_2; - } - } - - go->method = (p > p0)? p0[0]: -1; - - *lenp = p - p0; -} - -/* - * ccp_ackci - process a received configure-ack, and return - * 1 iff the packet was OK. - */ -static int -ccp_ackci(f, p, len) - fsm *f; - u_char *p; - int len; -{ - ccp_options *go = &ccp_gotoptions[f->unit]; - u_char *p0 = p; - - if (go->deflate) { - if (len < CILEN_DEFLATE - || p[0] != (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT) - || p[1] != CILEN_DEFLATE - || p[2] != DEFLATE_MAKE_OPT(go->deflate_size) - || p[3] != DEFLATE_CHK_SEQUENCE) - return 0; - p += CILEN_DEFLATE; - len -= CILEN_DEFLATE; - /* XXX Cope with first/fast ack */ - if (len == 0) - return 1; - if (go->deflate_correct && go->deflate_draft) { - if (len < CILEN_DEFLATE - || p[0] != CI_DEFLATE_DRAFT - || p[1] != CILEN_DEFLATE - || p[2] != DEFLATE_MAKE_OPT(go->deflate_size) - || p[3] != DEFLATE_CHK_SEQUENCE) - return 0; - p += CILEN_DEFLATE; - len -= CILEN_DEFLATE; - } - } - if (go->bsd_compress) { - if (len < CILEN_BSD_COMPRESS - || p[0] != CI_BSD_COMPRESS || p[1] != CILEN_BSD_COMPRESS - || p[2] != BSD_MAKE_OPT(BSD_CURRENT_VERSION, go->bsd_bits)) - return 0; - p += CILEN_BSD_COMPRESS; - len -= CILEN_BSD_COMPRESS; - /* XXX Cope with first/fast ack */ - if (p == p0 && len == 0) - return 1; - } - if (go->predictor_1) { - if (len < CILEN_PREDICTOR_1 - || p[0] != CI_PREDICTOR_1 || p[1] != CILEN_PREDICTOR_1) - return 0; - p += CILEN_PREDICTOR_1; - len -= CILEN_PREDICTOR_1; - /* XXX Cope with first/fast ack */ - if (p == p0 && len == 0) - return 1; - } - if (go->predictor_2) { - if (len < CILEN_PREDICTOR_2 - || p[0] != CI_PREDICTOR_2 || p[1] != CILEN_PREDICTOR_2) - return 0; - p += CILEN_PREDICTOR_2; - len -= CILEN_PREDICTOR_2; - /* XXX Cope with first/fast ack */ - if (p == p0 && len == 0) - return 1; - } - - if (len != 0) - return 0; - return 1; -} - -/* - * ccp_nakci - process received configure-nak. - * Returns 1 iff the nak was OK. - */ -static int -ccp_nakci(f, p, len) - fsm *f; - u_char *p; - int len; -{ - ccp_options *go = &ccp_gotoptions[f->unit]; - ccp_options no; /* options we've seen already */ - ccp_options try; /* options to ask for next time */ - - memset(&no, 0, sizeof(no)); - try = *go; - - if (go->deflate && len >= CILEN_DEFLATE - && p[0] == (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT) - && p[1] == CILEN_DEFLATE) { - no.deflate = 1; - /* - * Peer wants us to use a different code size or something. - * Stop asking for Deflate if we don't understand his suggestion. - */ - if (DEFLATE_METHOD(p[2]) != DEFLATE_METHOD_VAL - || DEFLATE_SIZE(p[2]) < DEFLATE_MIN_SIZE - || p[3] != DEFLATE_CHK_SEQUENCE) - try.deflate = 0; - else if (DEFLATE_SIZE(p[2]) < go->deflate_size) - try.deflate_size = DEFLATE_SIZE(p[2]); - p += CILEN_DEFLATE; - len -= CILEN_DEFLATE; - if (go->deflate_correct && go->deflate_draft - && len >= CILEN_DEFLATE && p[0] == CI_DEFLATE_DRAFT - && p[1] == CILEN_DEFLATE) { - p += CILEN_DEFLATE; - len -= CILEN_DEFLATE; - } - } - - if (go->bsd_compress && len >= CILEN_BSD_COMPRESS - && p[0] == CI_BSD_COMPRESS && p[1] == CILEN_BSD_COMPRESS) { - no.bsd_compress = 1; - /* - * Peer wants us to use a different number of bits - * or a different version. - */ - if (BSD_VERSION(p[2]) != BSD_CURRENT_VERSION) - try.bsd_compress = 0; - else if (BSD_NBITS(p[2]) < go->bsd_bits) - try.bsd_bits = BSD_NBITS(p[2]); - p += CILEN_BSD_COMPRESS; - len -= CILEN_BSD_COMPRESS; - } - - /* - * Predictor-1 and 2 have no options, so they can't be Naked. - * - * There may be remaining options but we ignore them. - */ - - if (f->state != OPENED) - *go = try; - return 1; -} - -/* - * ccp_rejci - reject some of our suggested compression methods. - */ -static int -ccp_rejci(f, p, len) - fsm *f; - u_char *p; - int len; -{ - ccp_options *go = &ccp_gotoptions[f->unit]; - ccp_options try; /* options to request next time */ - - try = *go; - - /* - * Cope with empty configure-rejects by ceasing to send - * configure-requests. - */ - if (len == 0 && all_rejected[f->unit]) - return -1; - - if (go->deflate && len >= CILEN_DEFLATE - && p[0] == (go->deflate_correct? CI_DEFLATE: CI_DEFLATE_DRAFT) - && p[1] == CILEN_DEFLATE) { - if (p[2] != DEFLATE_MAKE_OPT(go->deflate_size) - || p[3] != DEFLATE_CHK_SEQUENCE) - return 0; /* Rej is bad */ - if (go->deflate_correct) - try.deflate_correct = 0; - else - try.deflate_draft = 0; - p += CILEN_DEFLATE; - len -= CILEN_DEFLATE; - if (go->deflate_correct && go->deflate_draft - && len >= CILEN_DEFLATE && p[0] == CI_DEFLATE_DRAFT - && p[1] == CILEN_DEFLATE) { - if (p[2] != DEFLATE_MAKE_OPT(go->deflate_size) - || p[3] != DEFLATE_CHK_SEQUENCE) - return 0; /* Rej is bad */ - try.deflate_draft = 0; - p += CILEN_DEFLATE; - len -= CILEN_DEFLATE; - } - if (!try.deflate_correct && !try.deflate_draft) - try.deflate = 0; - } - if (go->bsd_compress && len >= CILEN_BSD_COMPRESS - && p[0] == CI_BSD_COMPRESS && p[1] == CILEN_BSD_COMPRESS) { - if (p[2] != BSD_MAKE_OPT(BSD_CURRENT_VERSION, go->bsd_bits)) - return 0; - try.bsd_compress = 0; - p += CILEN_BSD_COMPRESS; - len -= CILEN_BSD_COMPRESS; - } - if (go->predictor_1 && len >= CILEN_PREDICTOR_1 - && p[0] == CI_PREDICTOR_1 && p[1] == CILEN_PREDICTOR_1) { - try.predictor_1 = 0; - p += CILEN_PREDICTOR_1; - len -= CILEN_PREDICTOR_1; - } - if (go->predictor_2 && len >= CILEN_PREDICTOR_2 - && p[0] == CI_PREDICTOR_2 && p[1] == CILEN_PREDICTOR_2) { - try.predictor_2 = 0; - p += CILEN_PREDICTOR_2; - len -= CILEN_PREDICTOR_2; - } - - if (len != 0) - return 0; - - if (f->state != OPENED) - *go = try; - - return 1; -} - -/* - * ccp_reqci - processed a received configure-request. - * Returns CONFACK, CONFNAK or CONFREJ and the packet modified - * appropriately. - */ -static int -ccp_reqci(f, p, lenp, dont_nak) - fsm *f; - u_char *p; - int *lenp; - int dont_nak; -{ - int ret, newret, res; - u_char *p0, *retp; - int len, clen, type, nb; - ccp_options *ho = &ccp_hisoptions[f->unit]; - ccp_options *ao = &ccp_allowoptions[f->unit]; - - ret = CONFACK; - retp = p0 = p; - len = *lenp; - - memset(ho, 0, sizeof(ccp_options)); - ho->method = (len > 0)? p[0]: -1; - - while (len > 0) { - newret = CONFACK; - if (len < 2 || p[1] < 2 || p[1] > len) { - /* length is bad */ - clen = len; - newret = CONFREJ; - - } else { - type = p[0]; - clen = p[1]; - - switch (type) { - case CI_DEFLATE: - case CI_DEFLATE_DRAFT: - if (!ao->deflate || clen != CILEN_DEFLATE - || (!ao->deflate_correct && type == CI_DEFLATE) - || (!ao->deflate_draft && type == CI_DEFLATE_DRAFT)) { - newret = CONFREJ; - break; - } - - ho->deflate = 1; - ho->deflate_size = nb = DEFLATE_SIZE(p[2]); - if (DEFLATE_METHOD(p[2]) != DEFLATE_METHOD_VAL - || p[3] != DEFLATE_CHK_SEQUENCE - || nb > ao->deflate_size || nb < DEFLATE_MIN_SIZE) { - newret = CONFNAK; - if (!dont_nak) { - p[2] = DEFLATE_MAKE_OPT(ao->deflate_size); - p[3] = DEFLATE_CHK_SEQUENCE; - /* fall through to test this #bits below */ - } else - break; - } - - /* - * Check whether we can do Deflate with the window - * size they want. If the window is too big, reduce - * it until the kernel can cope and nak with that. - * We only check this for the first option. - */ - if (p == p0) { - for (;;) { - res = ccp_test(f->unit, p, CILEN_DEFLATE, 1); - if (res > 0) - break; /* it's OK now */ - if (res < 0 || nb == DEFLATE_MIN_SIZE || dont_nak) { - newret = CONFREJ; - p[2] = DEFLATE_MAKE_OPT(ho->deflate_size); - break; - } - newret = CONFNAK; - --nb; - p[2] = DEFLATE_MAKE_OPT(nb); - } - } - break; - - case CI_BSD_COMPRESS: - if (!ao->bsd_compress || clen != CILEN_BSD_COMPRESS) { - newret = CONFREJ; - break; - } - - ho->bsd_compress = 1; - ho->bsd_bits = nb = BSD_NBITS(p[2]); - if (BSD_VERSION(p[2]) != BSD_CURRENT_VERSION - || nb > ao->bsd_bits || nb < BSD_MIN_BITS) { - newret = CONFNAK; - if (!dont_nak) { - p[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, ao->bsd_bits); - /* fall through to test this #bits below */ - } else - break; - } - - /* - * Check whether we can do BSD-Compress with the code - * size they want. If the code size is too big, reduce - * it until the kernel can cope and nak with that. - * We only check this for the first option. - */ - if (p == p0) { - for (;;) { - res = ccp_test(f->unit, p, CILEN_BSD_COMPRESS, 1); - if (res > 0) - break; - if (res < 0 || nb == BSD_MIN_BITS || dont_nak) { - newret = CONFREJ; - p[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, - ho->bsd_bits); - break; - } - newret = CONFNAK; - --nb; - p[2] = BSD_MAKE_OPT(BSD_CURRENT_VERSION, nb); - } - } - break; - - case CI_PREDICTOR_1: - if (!ao->predictor_1 || clen != CILEN_PREDICTOR_1) { - newret = CONFREJ; - break; - } - - ho->predictor_1 = 1; - if (p == p0 - && ccp_test(f->unit, p, CILEN_PREDICTOR_1, 1) <= 0) { - newret = CONFREJ; - } - break; - - case CI_PREDICTOR_2: - if (!ao->predictor_2 || clen != CILEN_PREDICTOR_2) { - newret = CONFREJ; - break; - } - - ho->predictor_2 = 1; - if (p == p0 - && ccp_test(f->unit, p, CILEN_PREDICTOR_2, 1) <= 0) { - newret = CONFREJ; - } - break; - - default: - newret = CONFREJ; - } - } - - if (newret == CONFNAK && dont_nak) - newret = CONFREJ; - if (!(newret == CONFACK || (newret == CONFNAK && ret == CONFREJ))) { - /* we're returning this option */ - if (newret == CONFREJ && ret == CONFNAK) - retp = p0; - ret = newret; - if (p != retp) - BCOPY(p, retp, clen); - retp += clen; - } - - p += clen; - len -= clen; - } - - if (ret != CONFACK) { - if (ret == CONFREJ && *lenp == retp - p0) - all_rejected[f->unit] = 1; - else - *lenp = retp - p0; - } - return ret; -} - -/* - * Make a string name for a compression method (or 2). - */ -static char * -method_name(opt, opt2) - ccp_options *opt, *opt2; -{ - static char result[64]; - - if (!ANY_COMPRESS(*opt)) - return "(none)"; - switch (opt->method) { - case CI_DEFLATE: - case CI_DEFLATE_DRAFT: - if (opt2 != NULL && opt2->deflate_size != opt->deflate_size) - slprintf(result, sizeof(result), "Deflate%s (%d/%d)", - (opt->method == CI_DEFLATE_DRAFT? "(old#)": ""), - opt->deflate_size, opt2->deflate_size); - else - slprintf(result, sizeof(result), "Deflate%s (%d)", - (opt->method == CI_DEFLATE_DRAFT? "(old#)": ""), - opt->deflate_size); - break; - case CI_BSD_COMPRESS: - if (opt2 != NULL && opt2->bsd_bits != opt->bsd_bits) - slprintf(result, sizeof(result), "BSD-Compress (%d/%d)", - opt->bsd_bits, opt2->bsd_bits); - else - slprintf(result, sizeof(result), "BSD-Compress (%d)", - opt->bsd_bits); - break; - case CI_PREDICTOR_1: - return "Predictor 1"; - case CI_PREDICTOR_2: - return "Predictor 2"; - default: - slprintf(result, sizeof(result), "Method %d", opt->method); - } - return result; -} - -/* - * CCP has come up - inform the kernel driver and log a message. - */ -static void -ccp_up(f) - fsm *f; -{ - ccp_options *go = &ccp_gotoptions[f->unit]; - ccp_options *ho = &ccp_hisoptions[f->unit]; - char method1[64]; - - ccp_flags_set(f->unit, 1, 1); - if (ANY_COMPRESS(*go)) { - if (ANY_COMPRESS(*ho)) { - if (go->method == ho->method) { - notice("%s compression enabled", method_name(go, ho)); - } else { - strlcpy(method1, method_name(go, NULL), sizeof(method1)); - notice("%s / %s compression enabled", - method1, method_name(ho, NULL)); - } - } else - notice("%s receive compression enabled", method_name(go, NULL)); - } else if (ANY_COMPRESS(*ho)) - notice("%s transmit compression enabled", method_name(ho, NULL)); -} - -/* - * CCP has gone down - inform the kernel driver. - */ -static void -ccp_down(f) - fsm *f; -{ - if (ccp_localstate[f->unit] & RACK_PENDING) - UNTIMEOUT(ccp_rack_timeout, f); - ccp_localstate[f->unit] = 0; - ccp_flags_set(f->unit, 1, 0); -} - -/* - * Print the contents of a CCP packet. - */ -static char *ccp_codenames[] = { - "ConfReq", "ConfAck", "ConfNak", "ConfRej", - "TermReq", "TermAck", "CodeRej", - NULL, NULL, NULL, NULL, NULL, NULL, - "ResetReq", "ResetAck", -}; - -static int -ccp_printpkt(p, plen, printer, arg) - u_char *p; - int plen; - void (*printer) __P((void *, char *, ...)); - void *arg; -{ - u_char *p0, *optend; - int code, id, len; - int optlen; - - p0 = p; - if (plen < HEADERLEN) - return 0; - code = p[0]; - id = p[1]; - len = (p[2] << 8) + p[3]; - if (len < HEADERLEN || len > plen) - return 0; - - if (code >= 1 && code <= sizeof(ccp_codenames) / sizeof(char *) - && ccp_codenames[code-1] != NULL) - printer(arg, " %s", ccp_codenames[code-1]); - else - printer(arg, " code=0x%x", code); - printer(arg, " id=0x%x", id); - len -= HEADERLEN; - p += HEADERLEN; - - switch (code) { - case CONFREQ: - case CONFACK: - case CONFNAK: - case CONFREJ: - /* print list of possible compression methods */ - while (len >= 2) { - code = p[0]; - optlen = p[1]; - if (optlen < 2 || optlen > len) - break; - printer(arg, " <"); - len -= optlen; - optend = p + optlen; - switch (code) { - case CI_DEFLATE: - case CI_DEFLATE_DRAFT: - if (optlen >= CILEN_DEFLATE) { - printer(arg, "deflate%s %d", - (code == CI_DEFLATE_DRAFT? "(old#)": ""), - DEFLATE_SIZE(p[2])); - if (DEFLATE_METHOD(p[2]) != DEFLATE_METHOD_VAL) - printer(arg, " method %d", DEFLATE_METHOD(p[2])); - if (p[3] != DEFLATE_CHK_SEQUENCE) - printer(arg, " check %d", p[3]); - p += CILEN_DEFLATE; - } - break; - case CI_BSD_COMPRESS: - if (optlen >= CILEN_BSD_COMPRESS) { - printer(arg, "bsd v%d %d", BSD_VERSION(p[2]), - BSD_NBITS(p[2])); - p += CILEN_BSD_COMPRESS; - } - break; - case CI_PREDICTOR_1: - if (optlen >= CILEN_PREDICTOR_1) { - printer(arg, "predictor 1"); - p += CILEN_PREDICTOR_1; - } - break; - case CI_PREDICTOR_2: - if (optlen >= CILEN_PREDICTOR_2) { - printer(arg, "predictor 2"); - p += CILEN_PREDICTOR_2; - } - break; - } - while (p < optend) - printer(arg, " %.2x", *p++); - printer(arg, ">"); - } - break; - - case TERMACK: - case TERMREQ: - if (len > 0 && *p >= ' ' && *p < 0x7f) { - print_string(p, len, printer, arg); - p += len; - len = 0; - } - break; - } - - /* dump out the rest of the packet in hex */ - while (--len >= 0) - printer(arg, " %.2x", *p++); - - return p - p0; -} - -/* - * We have received a packet that the decompressor failed to - * decompress. Here we would expect to issue a reset-request, but - * Motorola has a patent on resetting the compressor as a result of - * detecting an error in the decompressed data after decompression. - * (See US patent 5,130,993; international patent publication number - * WO 91/10289; Australian patent 73296/91.) - * - * So we ask the kernel whether the error was detected after - * decompression; if it was, we take CCP down, thus disabling - * compression :-(, otherwise we issue the reset-request. - */ -static void -ccp_datainput(unit, pkt, len) - int unit; - u_char *pkt; - int len; -{ - fsm *f; - - f = &ccp_fsm[unit]; - if (f->state == OPENED) { - if (ccp_fatal_error(unit)) { - /* - * Disable compression by taking CCP down. - */ - error("Lost compression sync: disabling compression"); - ccp_close(unit, "Lost compression sync"); - } else { - /* - * Send a reset-request to reset the peer's compressor. - * We don't do that if we are still waiting for an - * acknowledgement to a previous reset-request. - */ - if (!(ccp_localstate[f->unit] & RACK_PENDING)) { - fsm_sdata(f, CCP_RESETREQ, f->reqid = ++f->id, NULL, 0); - TIMEOUT(ccp_rack_timeout, f, RACKTIMEOUT); - ccp_localstate[f->unit] |= RACK_PENDING; - } else - ccp_localstate[f->unit] |= RREQ_REPEAT; - } - } -} - -/* - * Timeout waiting for reset-ack. - */ -static void -ccp_rack_timeout(arg) - void *arg; -{ - fsm *f = arg; - - if (f->state == OPENED && ccp_localstate[f->unit] & RREQ_REPEAT) { - fsm_sdata(f, CCP_RESETREQ, f->reqid, NULL, 0); - TIMEOUT(ccp_rack_timeout, f, RACKTIMEOUT); - ccp_localstate[f->unit] &= ~RREQ_REPEAT; - } else - ccp_localstate[f->unit] &= ~RACK_PENDING; -} - diff --git a/cpukit/pppd/ccp.h b/cpukit/pppd/ccp.h deleted file mode 100644 index 609d858c5e..0000000000 --- a/cpukit/pppd/ccp.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * ccp.h - Definitions for PPP Compression Control Protocol. - * - * Copyright (c) 1994 The Australian National University. - * All rights reserved. - * - * Permission to use, copy, modify, and distribute this software and its - * documentation is hereby granted, provided that the above copyright - * notice appears in all copies. This software is provided without any - * warranty, express or implied. The Australian National University - * makes no representations about the suitability of this software for - * any purpose. - * - * IN NO EVENT SHALL THE AUSTRALIAN NATIONAL UNIVERSITY BE LIABLE TO ANY - * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES - * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF - * THE AUSTRALIAN NATIONAL UNIVERSITY HAVE BEEN ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * THE AUSTRALIAN NATIONAL UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS - * ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO - * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, - * OR MODIFICATIONS. - * - * $Id$ - */ - -typedef struct ccp_options { - bool bsd_compress; /* do BSD Compress? */ - bool deflate; /* do Deflate? */ - bool predictor_1; /* do Predictor-1? */ - bool predictor_2; /* do Predictor-2? */ - bool deflate_correct; /* use correct code for deflate? */ - bool deflate_draft; /* use draft RFC code for deflate? */ - u_short bsd_bits; /* # bits/code for BSD Compress */ - u_short deflate_size; /* lg(window size) for Deflate */ - short method; /* code for chosen compression method */ -} ccp_options; - -extern fsm ccp_fsm[]; -extern ccp_options ccp_wantoptions[]; -extern ccp_options ccp_gotoptions[]; -extern ccp_options ccp_allowoptions[]; -extern ccp_options ccp_hisoptions[]; - -extern struct protent ccp_protent; diff --git a/cpukit/pppd/chap.c b/cpukit/pppd/chap.c deleted file mode 100644 index 5609ec8bae..0000000000 --- a/cpukit/pppd/chap.c +++ /dev/null @@ -1,860 +0,0 @@ -/* - * chap.c - Challenge Handshake Authentication Protocol. - * - * Copyright (c) 1993 The Australian National University. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the Australian National University. The name of the University - * may not be used to endorse or promote products derived from this - * software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * Copyright (c) 1991 Gregory M. Christy. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by Gregory M. Christy. The name of the author may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#define RCSID "$Id$" - -/* - * TODO: - */ - -#include -#include -#include -#include - -#include "pppd.h" -#include "chap.h" -#include "md5.h" -#ifdef CHAPMS -#include "chap_ms.h" -#endif - -static const char rcsid[] = RCSID; - -/* - * Command-line options. - */ -static option_t chap_option_list[] = { - { "chap-restart", o_int, &chap[0].timeouttime, - "Set timeout for CHAP" }, - { "chap-max-challenge", o_int, &chap[0].max_transmits, - "Set max #xmits for challenge" }, - { "chap-interval", o_int, &chap[0].chal_interval, - "Set interval for rechallenge" }, -#ifdef MSLANMAN - { "ms-lanman", o_bool, &ms_lanman, - "Use LanMan passwd when using MS-CHAP", 1 }, -#endif - { NULL } -}; - -/* - * Protocol entry points. - */ -static void ChapInit __P((int)); -static void ChapLowerUp __P((int)); -static void ChapLowerDown __P((int)); -static void ChapInput __P((int, u_char *, int)); -static void ChapProtocolReject __P((int)); -static int ChapPrintPkt __P((u_char *, int, - void (*) __P((void *, char *, ...)), void *)); - -struct protent chap_protent = { - PPP_CHAP, - ChapInit, - ChapInput, - ChapProtocolReject, - ChapLowerUp, - ChapLowerDown, - NULL, - NULL, - ChapPrintPkt, - NULL, - 1, - "CHAP", - NULL, - chap_option_list, - NULL, - NULL, - NULL -}; - -chap_state chap[NUM_PPP]; /* CHAP state; one for each unit */ - -static void ChapChallengeTimeout __P((void *)); -static void ChapResponseTimeout __P((void *)); -static void ChapReceiveChallenge __P((chap_state *, u_char *, int, int)); -static void ChapRechallenge __P((void *)); -static void ChapReceiveResponse __P((chap_state *, u_char *, int, int)); -static void ChapReceiveSuccess __P((chap_state *, u_char *, u_char, int)); -static void ChapReceiveFailure __P((chap_state *, u_char *, u_char, int)); -static void ChapSendStatus __P((chap_state *, int)); -static void ChapSendChallenge __P((chap_state *)); -static void ChapSendResponse __P((chap_state *)); -static void ChapGenChallenge __P((chap_state *)); - -extern double drand48 __P((void)); -extern void srand48 __P((long)); - -/* - * ChapInit - Initialize a CHAP unit. - */ -static void -ChapInit(unit) - int unit; -{ - chap_state *cstate = &chap[unit]; - - BZERO(cstate, sizeof(*cstate)); - cstate->unit = unit; - cstate->clientstate = CHAPCS_INITIAL; - cstate->serverstate = CHAPSS_INITIAL; - cstate->timeouttime = CHAP_DEFTIMEOUT; - cstate->max_transmits = CHAP_DEFTRANSMITS; - /* random number generator is initialized in magic_init */ -} - - -/* - * ChapAuthWithPeer - Authenticate us with our peer (start client). - * - */ -void -ChapAuthWithPeer(unit, our_name, digest) - int unit; - char *our_name; - int digest; -{ - chap_state *cstate = &chap[unit]; - - cstate->resp_name = our_name; - cstate->resp_type = digest; - - if (cstate->clientstate == CHAPCS_INITIAL || - cstate->clientstate == CHAPCS_PENDING) { - /* lower layer isn't up - wait until later */ - cstate->clientstate = CHAPCS_PENDING; - return; - } - - /* - * We get here as a result of LCP coming up. - * So even if CHAP was open before, we will - * have to re-authenticate ourselves. - */ - cstate->clientstate = CHAPCS_LISTEN; -} - - -/* - * ChapAuthPeer - Authenticate our peer (start server). - */ -void -ChapAuthPeer(unit, our_name, digest) - int unit; - char *our_name; - int digest; -{ - chap_state *cstate = &chap[unit]; - - cstate->chal_name = our_name; - cstate->chal_type = digest; - - if (cstate->serverstate == CHAPSS_INITIAL || - cstate->serverstate == CHAPSS_PENDING) { - /* lower layer isn't up - wait until later */ - cstate->serverstate = CHAPSS_PENDING; - return; - } - - ChapGenChallenge(cstate); - ChapSendChallenge(cstate); /* crank it up dude! */ - cstate->serverstate = CHAPSS_INITIAL_CHAL; -} - - -/* - * ChapChallengeTimeout - Timeout expired on sending challenge. - */ -static void -ChapChallengeTimeout(arg) - void *arg; -{ - chap_state *cstate = (chap_state *) arg; - - /* if we aren't sending challenges, don't worry. then again we */ - /* probably shouldn't be here either */ - if (cstate->serverstate != CHAPSS_INITIAL_CHAL && - cstate->serverstate != CHAPSS_RECHALLENGE) - return; - - if (cstate->chal_transmits >= cstate->max_transmits) { - /* give up on peer */ - error("Peer failed to respond to CHAP challenge"); - cstate->serverstate = CHAPSS_BADAUTH; - auth_peer_fail(cstate->unit, PPP_CHAP); - return; - } - - ChapSendChallenge(cstate); /* Re-send challenge */ -} - - -/* - * ChapResponseTimeout - Timeout expired on sending response. - */ -static void -ChapResponseTimeout(arg) - void *arg; -{ - chap_state *cstate = (chap_state *) arg; - - /* if we aren't sending a response, don't worry. */ - if (cstate->clientstate != CHAPCS_RESPONSE) - return; - - ChapSendResponse(cstate); /* re-send response */ -} - - -/* - * ChapRechallenge - Time to challenge the peer again. - */ -static void -ChapRechallenge(arg) - void *arg; -{ - chap_state *cstate = (chap_state *) arg; - - /* if we aren't sending a response, don't worry. */ - if (cstate->serverstate != CHAPSS_OPEN) - return; - - ChapGenChallenge(cstate); - ChapSendChallenge(cstate); - cstate->serverstate = CHAPSS_RECHALLENGE; -} - - -/* - * ChapLowerUp - The lower layer is up. - * - * Start up if we have pending requests. - */ -static void -ChapLowerUp(unit) - int unit; -{ - chap_state *cstate = &chap[unit]; - - if (cstate->clientstate == CHAPCS_INITIAL) - cstate->clientstate = CHAPCS_CLOSED; - else if (cstate->clientstate == CHAPCS_PENDING) - cstate->clientstate = CHAPCS_LISTEN; - - if (cstate->serverstate == CHAPSS_INITIAL) - cstate->serverstate = CHAPSS_CLOSED; - else if (cstate->serverstate == CHAPSS_PENDING) { - ChapGenChallenge(cstate); - ChapSendChallenge(cstate); - cstate->serverstate = CHAPSS_INITIAL_CHAL; - } -} - - -/* - * ChapLowerDown - The lower layer is down. - * - * Cancel all timeouts. - */ -static void -ChapLowerDown(unit) - int unit; -{ - chap_state *cstate = &chap[unit]; - - /* Timeout(s) pending? Cancel if so. */ - if (cstate->serverstate == CHAPSS_INITIAL_CHAL || - cstate->serverstate == CHAPSS_RECHALLENGE) - UNTIMEOUT(ChapChallengeTimeout, cstate); - else if (cstate->serverstate == CHAPSS_OPEN - && cstate->chal_interval != 0) - UNTIMEOUT(ChapRechallenge, cstate); - if (cstate->clientstate == CHAPCS_RESPONSE) - UNTIMEOUT(ChapResponseTimeout, cstate); - - cstate->clientstate = CHAPCS_INITIAL; - cstate->serverstate = CHAPSS_INITIAL; -} - - -/* - * ChapProtocolReject - Peer doesn't grok CHAP. - */ -static void -ChapProtocolReject(unit) - int unit; -{ - chap_state *cstate = &chap[unit]; - - if (cstate->serverstate != CHAPSS_INITIAL && - cstate->serverstate != CHAPSS_CLOSED) - auth_peer_fail(unit, PPP_CHAP); - if (cstate->clientstate != CHAPCS_INITIAL && - cstate->clientstate != CHAPCS_CLOSED) - auth_withpeer_fail(unit, PPP_CHAP); - ChapLowerDown(unit); /* shutdown chap */ -} - - -/* - * ChapInput - Input CHAP packet. - */ -static void -ChapInput(unit, inpacket, packet_len) - int unit; - u_char *inpacket; - int packet_len; -{ - chap_state *cstate = &chap[unit]; - u_char *inp; - u_char code, id; - int len; - - /* - * Parse header (code, id and length). - * If packet too short, drop it. - */ - inp = inpacket; - if (packet_len < CHAP_HEADERLEN) { - CHAPDEBUG(("ChapInput: rcvd short header.")); - return; - } - GETCHAR(code, inp); - GETCHAR(id, inp); - GETSHORT(len, inp); - if (len < CHAP_HEADERLEN) { - CHAPDEBUG(("ChapInput: rcvd illegal length.")); - return; - } - if (len > packet_len) { - CHAPDEBUG(("ChapInput: rcvd short packet.")); - return; - } - len -= CHAP_HEADERLEN; - - /* - * Action depends on code (as in fact it usually does :-). - */ - switch (code) { - case CHAP_CHALLENGE: - ChapReceiveChallenge(cstate, inp, id, len); - break; - - case CHAP_RESPONSE: - ChapReceiveResponse(cstate, inp, id, len); - break; - - case CHAP_FAILURE: - ChapReceiveFailure(cstate, inp, id, len); - break; - - case CHAP_SUCCESS: - ChapReceiveSuccess(cstate, inp, id, len); - break; - - default: /* Need code reject? */ - warn("Unknown CHAP code (%d) received.", code); - break; - } -} - - -/* - * ChapReceiveChallenge - Receive Challenge and send Response. - */ -static void -ChapReceiveChallenge(cstate, inp, id, len) - chap_state *cstate; - u_char *inp; - int id; - int len; -{ - int rchallenge_len; - u_char *rchallenge; - int secret_len; - char secret[MAXSECRETLEN]; - char rhostname[256]; - MD5_CTX mdContext; - u_char hash[MD5_SIGNATURE_SIZE]; - - if (cstate->clientstate == CHAPCS_CLOSED || - cstate->clientstate == CHAPCS_PENDING) { - CHAPDEBUG(("ChapReceiveChallenge: in state %d", cstate->clientstate)); - return; - } - - if (len < 2) { - CHAPDEBUG(("ChapReceiveChallenge: rcvd short packet.")); - return; - } - - GETCHAR(rchallenge_len, inp); - len -= sizeof (u_char) + rchallenge_len; /* now name field length */ - if (len < 0) { - CHAPDEBUG(("ChapReceiveChallenge: rcvd short packet.")); - return; - } - rchallenge = inp; - INCPTR(rchallenge_len, inp); - - if (len >= sizeof(rhostname)) - len = sizeof(rhostname) - 1; - BCOPY(inp, rhostname, len); - rhostname[len] = '\000'; - - /* Microsoft doesn't send their name back in the PPP packet */ - if (explicit_remote || (remote_name[0] != 0 && rhostname[0] == 0)) { - strlcpy(rhostname, remote_name, sizeof(rhostname)); - CHAPDEBUG(("ChapReceiveChallenge: using '%q' as remote name", - rhostname)); - } - - /* get secret for authenticating ourselves with the specified host */ - if (!get_secret(cstate->unit, cstate->resp_name, rhostname, - secret, &secret_len, 0)) { - secret_len = 0; /* assume null secret if can't find one */ - warn("No CHAP secret found for authenticating us to %q", rhostname); - } - - /* cancel response send timeout if necessary */ - if (cstate->clientstate == CHAPCS_RESPONSE) - UNTIMEOUT(ChapResponseTimeout, cstate); - - cstate->resp_id = id; - cstate->resp_transmits = 0; - - /* generate MD based on negotiated type */ - switch (cstate->resp_type) { - - case CHAP_DIGEST_MD5: - MD5Init(&mdContext); - MD5Update(&mdContext, &cstate->resp_id, 1); - MD5Update(&mdContext, secret, secret_len); - MD5Update(&mdContext, rchallenge, rchallenge_len); - MD5Final(hash, &mdContext); - BCOPY(hash, cstate->response, MD5_SIGNATURE_SIZE); - cstate->resp_length = MD5_SIGNATURE_SIZE; - break; - -#ifdef CHAPMS - case CHAP_MICROSOFT: - ChapMS(cstate, rchallenge, rchallenge_len, secret, secret_len); - break; -#endif - - default: - CHAPDEBUG(("unknown digest type %d", cstate->resp_type)); - return; - } - - BZERO(secret, sizeof(secret)); - ChapSendResponse(cstate); -} - - -/* - * ChapReceiveResponse - Receive and process response. - */ -static void -ChapReceiveResponse(cstate, inp, id, len) - chap_state *cstate; - u_char *inp; - int id; - int len; -{ - u_char *remmd, remmd_len; - int secret_len, old_state; - int code; - char rhostname[256]; - MD5_CTX mdContext; - char secret[MAXSECRETLEN]; - u_char hash[MD5_SIGNATURE_SIZE]; - - if (cstate->serverstate == CHAPSS_CLOSED || - cstate->serverstate == CHAPSS_PENDING) { - CHAPDEBUG(("ChapReceiveResponse: in state %d", cstate->serverstate)); - return; - } - - if (id != cstate->chal_id) - return; /* doesn't match ID of last challenge */ - - /* - * If we have received a duplicate or bogus Response, - * we have to send the same answer (Success/Failure) - * as we did for the first Response we saw. - */ - if (cstate->serverstate == CHAPSS_OPEN) { - ChapSendStatus(cstate, CHAP_SUCCESS); - return; - } - if (cstate->serverstate == CHAPSS_BADAUTH) { - ChapSendStatus(cstate, CHAP_FAILURE); - return; - } - - if (len < 2) { - CHAPDEBUG(("ChapReceiveResponse: rcvd short packet.")); - return; - } - GETCHAR(remmd_len, inp); /* get length of MD */ - remmd = inp; /* get pointer to MD */ - INCPTR(remmd_len, inp); - - len -= sizeof (u_char) + remmd_len; - if (len < 0) { - CHAPDEBUG(("ChapReceiveResponse: rcvd short packet.")); - return; - } - - UNTIMEOUT(ChapChallengeTimeout, cstate); - - if (len >= sizeof(rhostname)) - len = sizeof(rhostname) - 1; - BCOPY(inp, rhostname, len); - rhostname[len] = '\000'; - - /* - * Get secret for authenticating them with us, - * do the hash ourselves, and compare the result. - */ - code = CHAP_FAILURE; - if (!get_secret(cstate->unit, (explicit_remote? remote_name: rhostname), - cstate->chal_name, secret, &secret_len, 1)) { - warn("No CHAP secret found for authenticating %q", rhostname); - } else { - - /* generate MD based on negotiated type */ - switch (cstate->chal_type) { - - case CHAP_DIGEST_MD5: /* only MD5 is defined for now */ - if (remmd_len != MD5_SIGNATURE_SIZE) - break; /* it's not even the right length */ - MD5Init(&mdContext); - MD5Update(&mdContext, &cstate->chal_id, 1); - MD5Update(&mdContext, secret, secret_len); - MD5Update(&mdContext, cstate->challenge, cstate->chal_len); - MD5Final(hash, &mdContext); - - /* compare local and remote MDs and send the appropriate status */ - if (memcmp (hash, remmd, MD5_SIGNATURE_SIZE) == 0) - code = CHAP_SUCCESS; /* they are the same! */ - break; - - default: - CHAPDEBUG(("unknown digest type %d", cstate->chal_type)); - } - } - - BZERO(secret, sizeof(secret)); - ChapSendStatus(cstate, code); - - if (code == CHAP_SUCCESS) { - old_state = cstate->serverstate; - cstate->serverstate = CHAPSS_OPEN; - if (old_state == CHAPSS_INITIAL_CHAL) { - auth_peer_success(cstate->unit, PPP_CHAP, rhostname, len); - } - if (cstate->chal_interval != 0) - TIMEOUT(ChapRechallenge, cstate, cstate->chal_interval); - notice("CHAP peer authentication succeeded for %q", rhostname); - - } else { - error("CHAP peer authentication failed for remote host %q", rhostname); - cstate->serverstate = CHAPSS_BADAUTH; - auth_peer_fail(cstate->unit, PPP_CHAP); - } -} - -/* - * ChapReceiveSuccess - Receive Success - */ -static void -ChapReceiveSuccess(cstate, inp, id, len) - chap_state *cstate; - u_char *inp; - u_char id; - int len; -{ - - if (cstate->clientstate == CHAPCS_OPEN) - /* presumably an answer to a duplicate response */ - return; - - if (cstate->clientstate != CHAPCS_RESPONSE) { - /* don't know what this is */ - CHAPDEBUG(("ChapReceiveSuccess: in state %d\n", cstate->clientstate)); - return; - } - - UNTIMEOUT(ChapResponseTimeout, cstate); - - /* - * Print message. - */ - if (len > 0) - PRINTMSG(inp, len); - - cstate->clientstate = CHAPCS_OPEN; - - auth_withpeer_success(cstate->unit, PPP_CHAP); -} - - -/* - * ChapReceiveFailure - Receive failure. - */ -static void -ChapReceiveFailure(cstate, inp, id, len) - chap_state *cstate; - u_char *inp; - u_char id; - int len; -{ - if (cstate->clientstate != CHAPCS_RESPONSE) { - /* don't know what this is */ - CHAPDEBUG(("ChapReceiveFailure: in state %d\n", cstate->clientstate)); - return; - } - - UNTIMEOUT(ChapResponseTimeout, cstate); - - /* - * Print message. - */ - if (len > 0) - PRINTMSG(inp, len); - - error("CHAP authentication failed"); - auth_withpeer_fail(cstate->unit, PPP_CHAP); -} - - -/* - * ChapSendChallenge - Send an Authenticate challenge. - */ -static void -ChapSendChallenge(cstate) - chap_state *cstate; -{ - u_char *outp; - int chal_len, name_len; - int outlen; - - chal_len = cstate->chal_len; - name_len = strlen(cstate->chal_name); - outlen = CHAP_HEADERLEN + sizeof (u_char) + chal_len + name_len; - outp = outpacket_buf; - - MAKEHEADER(outp, PPP_CHAP); /* paste in a CHAP header */ - - PUTCHAR(CHAP_CHALLENGE, outp); - PUTCHAR(cstate->chal_id, outp); - PUTSHORT(outlen, outp); - - PUTCHAR(chal_len, outp); /* put length of challenge */ - BCOPY(cstate->challenge, outp, chal_len); - INCPTR(chal_len, outp); - - BCOPY(cstate->chal_name, outp, name_len); /* append hostname */ - - output(cstate->unit, outpacket_buf, outlen + PPP_HDRLEN); - - TIMEOUT(ChapChallengeTimeout, cstate, cstate->timeouttime); - ++cstate->chal_transmits; -} - - -/* - * ChapSendStatus - Send a status response (ack or nak). - */ -static void -ChapSendStatus(cstate, code) - chap_state *cstate; - int code; -{ - u_char *outp; - int outlen, msglen; - char msg[256]; - - if (code == CHAP_SUCCESS) - slprintf(msg, sizeof(msg), "Welcome to %s.", hostname); - else - slprintf(msg, sizeof(msg), "I don't like you. Go 'way."); - msglen = strlen(msg); - - outlen = CHAP_HEADERLEN + msglen; - outp = outpacket_buf; - - MAKEHEADER(outp, PPP_CHAP); /* paste in a header */ - - PUTCHAR(code, outp); - PUTCHAR(cstate->chal_id, outp); - PUTSHORT(outlen, outp); - BCOPY(msg, outp, msglen); - output(cstate->unit, outpacket_buf, outlen + PPP_HDRLEN); -} - -/* - * ChapGenChallenge is used to generate a pseudo-random challenge string of - * a pseudo-random length between min_len and max_len. The challenge - * string and its length are stored in *cstate, and various other fields of - * *cstate are initialized. - */ - -static void -ChapGenChallenge(cstate) - chap_state *cstate; -{ - int chal_len; - u_char *ptr = cstate->challenge; - int i; - - /* pick a random challenge length between MIN_CHALLENGE_LENGTH and - MAX_CHALLENGE_LENGTH */ - chal_len = (unsigned) ((drand48() * - (MAX_CHALLENGE_LENGTH - MIN_CHALLENGE_LENGTH)) + - MIN_CHALLENGE_LENGTH); - cstate->chal_len = chal_len; - cstate->chal_id = ++cstate->id; - cstate->chal_transmits = 0; - - /* generate a random string */ - for (i = 0; i < chal_len; i++) - *ptr++ = (char) (drand48() * 0xff); -} - -/* - * ChapSendResponse - send a response packet with values as specified - * in *cstate. - */ -/* ARGSUSED */ -static void -ChapSendResponse(cstate) - chap_state *cstate; -{ - u_char *outp; - int outlen, md_len, name_len; - - md_len = cstate->resp_length; - name_len = strlen(cstate->resp_name); - outlen = CHAP_HEADERLEN + sizeof (u_char) + md_len + name_len; - outp = outpacket_buf; - - MAKEHEADER(outp, PPP_CHAP); - - PUTCHAR(CHAP_RESPONSE, outp); /* we are a response */ - PUTCHAR(cstate->resp_id, outp); /* copy id from challenge packet */ - PUTSHORT(outlen, outp); /* packet length */ - - PUTCHAR(md_len, outp); /* length of MD */ - BCOPY(cstate->response, outp, md_len); /* copy MD to buffer */ - INCPTR(md_len, outp); - - BCOPY(cstate->resp_name, outp, name_len); /* append our name */ - - /* send the packet */ - output(cstate->unit, outpacket_buf, outlen + PPP_HDRLEN); - - cstate->clientstate = CHAPCS_RESPONSE; - TIMEOUT(ChapResponseTimeout, cstate, cstate->timeouttime); - ++cstate->resp_transmits; -} - -/* - * ChapPrintPkt - print the contents of a CHAP packet. - */ -static char *ChapCodenames[] = { - "Challenge", "Response", "Success", "Failure" -}; - -static int -ChapPrintPkt(p, plen, printer, arg) - u_char *p; - int plen; - void (*printer) __P((void *, char *, ...)); - void *arg; -{ - int code, id, len; - int clen, nlen; - u_char x; - - if (plen < CHAP_HEADERLEN) - return 0; - GETCHAR(code, p); - GETCHAR(id, p); - GETSHORT(len, p); - if (len < CHAP_HEADERLEN || len > plen) - return 0; - - if (code >= 1 && code <= sizeof(ChapCodenames) / sizeof(char *)) - printer(arg, " %s", ChapCodenames[code-1]); - else - printer(arg, " code=0x%x", code); - printer(arg, " id=0x%x", id); - len -= CHAP_HEADERLEN; - switch (code) { - case CHAP_CHALLENGE: - case CHAP_RESPONSE: - if (len < 1) - break; - clen = p[0]; - if (len < clen + 1) - break; - ++p; - nlen = len - clen - 1; - printer(arg, " <"); - for (; clen > 0; --clen) { - GETCHAR(x, p); - printer(arg, "%.2x", x); - } - printer(arg, ">, name = "); - print_string((char *)p, nlen, printer, arg); - break; - case CHAP_FAILURE: - case CHAP_SUCCESS: - printer(arg, " "); - print_string((char *)p, len, printer, arg); - break; - default: - for (clen = len; clen > 0; --clen) { - GETCHAR(x, p); - printer(arg, " %.2x", x); - } - } - - return len + CHAP_HEADERLEN; -} diff --git a/cpukit/pppd/chap.h b/cpukit/pppd/chap.h deleted file mode 100644 index 9f0361b1ae..0000000000 --- a/cpukit/pppd/chap.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - * chap.h - Challenge Handshake Authentication Protocol definitions. - * - * Copyright (c) 1993 The Australian National University. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the Australian National University. The name of the University - * may not be used to endorse or promote products derived from this - * software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * Copyright (c) 1991 Gregory M. Christy - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the author. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * $Id$ - */ - -#ifndef __CHAP_INCLUDE__ - -/* Code + ID + length */ -#define CHAP_HEADERLEN 4 - -/* - * CHAP codes. - */ - -#define CHAP_DIGEST_MD5 5 /* use MD5 algorithm */ -#define MD5_SIGNATURE_SIZE 16 /* 16 bytes in a MD5 message digest */ -#define CHAP_MICROSOFT 0x80 /* use Microsoft-compatible alg. */ -#define MS_CHAP_RESPONSE_LEN 49 /* Response length for MS-CHAP */ - -#define CHAP_CHALLENGE 1 -#define CHAP_RESPONSE 2 -#define CHAP_SUCCESS 3 -#define CHAP_FAILURE 4 - -/* - * Challenge lengths (for challenges we send) and other limits. - */ -#define MIN_CHALLENGE_LENGTH 16 -#define MAX_CHALLENGE_LENGTH 24 -#define MAX_RESPONSE_LENGTH 64 /* sufficient for MD5 or MS-CHAP */ - -/* - * Each interface is described by a chap structure. - */ - -typedef struct chap_state { - int unit; /* Interface unit number */ - int clientstate; /* Client state */ - int serverstate; /* Server state */ - u_char challenge[MAX_CHALLENGE_LENGTH]; /* last challenge string sent */ - u_char chal_len; /* challenge length */ - u_char chal_id; /* ID of last challenge */ - u_char chal_type; /* hash algorithm for challenges */ - u_char id; /* Current id */ - char *chal_name; /* Our name to use with challenge */ - int chal_interval; /* Time until we challenge peer again */ - int timeouttime; /* Timeout time in seconds */ - int max_transmits; /* Maximum # of challenge transmissions */ - int chal_transmits; /* Number of transmissions of challenge */ - int resp_transmits; /* Number of transmissions of response */ - u_char response[MAX_RESPONSE_LENGTH]; /* Response to send */ - u_char resp_length; /* length of response */ - u_char resp_id; /* ID for response messages */ - u_char resp_type; /* hash algorithm for responses */ - char *resp_name; /* Our name to send with response */ -} chap_state; - - -/* - * Client (peer) states. - */ -#define CHAPCS_INITIAL 0 /* Lower layer down, not opened */ -#define CHAPCS_CLOSED 1 /* Lower layer up, not opened */ -#define CHAPCS_PENDING 2 /* Auth us to peer when lower up */ -#define CHAPCS_LISTEN 3 /* Listening for a challenge */ -#define CHAPCS_RESPONSE 4 /* Sent response, waiting for status */ -#define CHAPCS_OPEN 5 /* We've received Success */ - -/* - * Server (authenticator) states. - */ -#define CHAPSS_INITIAL 0 /* Lower layer down, not opened */ -#define CHAPSS_CLOSED 1 /* Lower layer up, not opened */ -#define CHAPSS_PENDING 2 /* Auth peer when lower up */ -#define CHAPSS_INITIAL_CHAL 3 /* We've sent the first challenge */ -#define CHAPSS_OPEN 4 /* We've sent a Success msg */ -#define CHAPSS_RECHALLENGE 5 /* We've sent another challenge */ -#define CHAPSS_BADAUTH 6 /* We've sent a Failure msg */ - -/* - * Timeouts. - */ -#define CHAP_DEFTIMEOUT 5 /* Timeout time in seconds */ -#define CHAP_DEFTRANSMITS 10 /* max # times to send challenge */ - -extern chap_state chap[]; - -void ChapAuthWithPeer __P((int, char *, int)); -void ChapAuthPeer __P((int, char *, int)); - -extern struct protent chap_protent; - -#define __CHAP_INCLUDE__ -#endif /* __CHAP_INCLUDE__ */ diff --git a/cpukit/pppd/chap_ms.c b/cpukit/pppd/chap_ms.c deleted file mode 100644 index 81a57bb5aa..0000000000 --- a/cpukit/pppd/chap_ms.c +++ /dev/null @@ -1,338 +0,0 @@ -/* - * chap_ms.c - Microsoft MS-CHAP compatible implementation. - * - * Copyright (c) 1995 Eric Rosenquist, Strata Software Limited. - * http://www.strataware.com/ - * - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by Eric Rosenquist. The name of the author may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -/* - * Modifications by Lauri Pesonen / lpesonen@clinet.fi, april 1997 - * - * Implemented LANManager type password response to MS-CHAP challenges. - * Now pppd provides both NT style and LANMan style blocks, and the - * prefered is set by option "ms-lanman". Default is to use NT. - * The hash text (StdText) was taken from Win95 RASAPI32.DLL. - * - * You should also use DOMAIN\\USERNAME as described in README.MSCHAP80 - */ - -#define RCSID "$Id$" - -#ifdef CHAPMS - -#include -#include -#include -#include -#include -#include -#include -#ifdef HAVE_CRYPT_H -#include -#endif - -#include "pppd.h" -#include "chap.h" -#include "chap_ms.h" -#include "md4.h" - -#ifndef USE_CRYPT -#include -#endif - -static const char rcsid[] = RCSID; - -typedef struct { - u_char LANManResp[24]; - u_char NTResp[24]; - u_char UseNT; /* If 1, ignore the LANMan response field */ -} MS_ChapResponse; -/* We use MS_CHAP_RESPONSE_LEN, rather than sizeof(MS_ChapResponse), - in case this struct gets padded. */ - - -static void ChallengeResponse __P((u_char *, u_char *, u_char *)); -static void DesEncrypt __P((u_char *, u_char *, u_char *)); -static void MakeKey __P((u_char *, u_char *)); -static u_char Get7Bits __P((u_char *, int)); -static void ChapMS_NT __P((char *, int, char *, int, MS_ChapResponse *)); -#ifdef MSLANMAN -static void ChapMS_LANMan __P((char *, int, char *, int, MS_ChapResponse *)); -#endif - -#ifdef USE_CRYPT -static void Expand __P((u_char *, u_char *)); -static void Collapse __P((u_char *, u_char *)); -#endif - -#ifdef MSLANMAN -bool ms_lanman = 0; /* Use LanMan password instead of NT */ - /* Has meaning only with MS-CHAP challenges */ -#endif - -static void -ChallengeResponse(challenge, pwHash, response) - u_char *challenge; /* IN 8 octets */ - u_char *pwHash; /* IN 16 octets */ - u_char *response; /* OUT 24 octets */ -{ - char ZPasswordHash[21]; - - BZERO(ZPasswordHash, sizeof(ZPasswordHash)); - BCOPY(pwHash, ZPasswordHash, MD4_SIGNATURE_SIZE); - -#if 0 - dbglog("ChallengeResponse - ZPasswordHash %.*B", - sizeof(ZPasswordHash), ZPasswordHash); -#endif - - DesEncrypt(challenge, ZPasswordHash + 0, response + 0); - DesEncrypt(challenge, ZPasswordHash + 7, response + 8); - DesEncrypt(challenge, ZPasswordHash + 14, response + 16); - -#if 0 - dbglog("ChallengeResponse - response %.24B", response); -#endif -} - - -#ifdef USE_CRYPT -static void -DesEncrypt(clear, key, cipher) - u_char *clear; /* IN 8 octets */ - u_char *key; /* IN 7 octets */ - u_char *cipher; /* OUT 8 octets */ -{ - u_char des_key[8]; - u_char crypt_key[66]; - u_char des_input[66]; - - MakeKey(key, des_key); - - Expand(des_key, crypt_key); - setkey(crypt_key); - -#if 0 - CHAPDEBUG((LOG_INFO, "DesEncrypt: 8 octet input : %.8B", clear)); -#endif - - Expand(clear, des_input); - encrypt(des_input, 0); - Collapse(des_input, cipher); - -#if 0 - CHAPDEBUG((LOG_INFO, "DesEncrypt: 8 octet output: %.8B", cipher)); -#endif -} - -#else /* USE_CRYPT */ - -static void -DesEncrypt(clear, key, cipher) - u_char *clear; /* IN 8 octets */ - u_char *key; /* IN 7 octets */ - u_char *cipher; /* OUT 8 octets */ -{ - des_cblock des_key; - des_key_schedule key_schedule; - - MakeKey(key, des_key); - - des_set_key(&des_key, key_schedule); - -#if 0 - CHAPDEBUG((LOG_INFO, "DesEncrypt: 8 octet input : %.8B", clear)); -#endif - - des_ecb_encrypt((des_cblock *)clear, (des_cblock *)cipher, key_schedule, 1); - -#if 0 - CHAPDEBUG((LOG_INFO, "DesEncrypt: 8 octet output: %.8B", cipher)); -#endif -} - -#endif /* USE_CRYPT */ - - -static u_char Get7Bits(input, startBit) - u_char *input; - int startBit; -{ - register unsigned int word; - - word = (unsigned)input[startBit / 8] << 8; - word |= (unsigned)input[startBit / 8 + 1]; - - word >>= 15 - (startBit % 8 + 7); - - return word & 0xFE; -} - -#ifdef USE_CRYPT - -/* in == 8-byte string (expanded version of the 56-bit key) - * out == 64-byte string where each byte is either 1 or 0 - * Note that the low-order "bit" is always ignored by by setkey() - */ -static void Expand(in, out) - u_char *in; - u_char *out; -{ - int j, c; - int i; - - for(i = 0; i < 64; in++){ - c = *in; - for(j = 7; j >= 0; j--) - *out++ = (c >> j) & 01; - i += 8; - } -} - -/* The inverse of Expand - */ -static void Collapse(in, out) - u_char *in; - u_char *out; -{ - int j; - int i; - unsigned int c; - - for (i = 0; i < 64; i += 8, out++) { - c = 0; - for (j = 7; j >= 0; j--, in++) - c |= *in << j; - *out = c & 0xff; - } -} -#endif - -static void MakeKey(key, des_key) - u_char *key; /* IN 56 bit DES key missing parity bits */ - u_char *des_key; /* OUT 64 bit DES key with parity bits added */ -{ - des_key[0] = Get7Bits(key, 0); - des_key[1] = Get7Bits(key, 7); - des_key[2] = Get7Bits(key, 14); - des_key[3] = Get7Bits(key, 21); - des_key[4] = Get7Bits(key, 28); - des_key[5] = Get7Bits(key, 35); - des_key[6] = Get7Bits(key, 42); - des_key[7] = Get7Bits(key, 49); - -#ifndef USE_CRYPT - des_set_odd_parity((des_cblock *)des_key); -#endif - -#if 0 - CHAPDEBUG((LOG_INFO, "MakeKey: 56-bit input : %.7B", key)); - CHAPDEBUG((LOG_INFO, "MakeKey: 64-bit output: %.8B", des_key)); -#endif -} - -static void -ChapMS_NT(rchallenge, rchallenge_len, secret, secret_len, response) - char *rchallenge; - int rchallenge_len; - char *secret; - int secret_len; - MS_ChapResponse *response; -{ - int i; -#ifdef __NetBSD__ - /* NetBSD uses the libc md4 routines which take bytes instead of bits */ - int mdlen = secret_len * 2; -#else - int mdlen = secret_len * 2 * 8; -#endif - MD4_CTX md4Context; - u_char hash[MD4_SIGNATURE_SIZE]; - u_char unicodePassword[MAX_NT_PASSWORD * 2]; - - /* Initialize the Unicode version of the secret (== password). */ - /* This implicitly supports 8-bit ISO8859/1 characters. */ - BZERO(unicodePassword, sizeof(unicodePassword)); - for (i = 0; i < secret_len; i++) - unicodePassword[i * 2] = (u_char)secret[i]; - - MD4Init(&md4Context); - MD4Update(&md4Context, unicodePassword, mdlen); - - MD4Final(hash, &md4Context); /* Tell MD4 we're done */ - - ChallengeResponse(rchallenge, hash, response->NTResp); -} - -#ifdef MSLANMAN -static u_char *StdText = (u_char *)"KGS!@#$%"; /* key from rasapi32.dll */ - -static void -ChapMS_LANMan(rchallenge, rchallenge_len, secret, secret_len, response) - char *rchallenge; - int rchallenge_len; - char *secret; - int secret_len; - MS_ChapResponse *response; -{ - int i; - u_char UcasePassword[MAX_NT_PASSWORD]; /* max is actually 14 */ - u_char PasswordHash[MD4_SIGNATURE_SIZE]; - - /* LANMan password is case insensitive */ - BZERO(UcasePassword, sizeof(UcasePassword)); - for (i = 0; i < secret_len; i++) - UcasePassword[i] = (u_char)toupper(secret[i]); - DesEncrypt( StdText, UcasePassword + 0, PasswordHash + 0 ); - DesEncrypt( StdText, UcasePassword + 7, PasswordHash + 8 ); - ChallengeResponse(rchallenge, PasswordHash, response->LANManResp); -} -#endif - -void -ChapMS(cstate, rchallenge, rchallenge_len, secret, secret_len) - chap_state *cstate; - char *rchallenge; - int rchallenge_len; - char *secret; - int secret_len; -{ - MS_ChapResponse response; - -#if 0 - CHAPDEBUG((LOG_INFO, "ChapMS: secret is '%.*s'", secret_len, secret)); -#endif - BZERO(&response, sizeof(response)); - - /* Calculate both always */ - ChapMS_NT(rchallenge, rchallenge_len, secret, secret_len, &response); - -#ifdef MSLANMAN - ChapMS_LANMan(rchallenge, rchallenge_len, secret, secret_len, &response); - - /* prefered method is set by option */ - response.UseNT = !ms_lanman; -#else - response.UseNT = 1; -#endif - - BCOPY(&response, cstate->response, MS_CHAP_RESPONSE_LEN); - cstate->resp_length = MS_CHAP_RESPONSE_LEN; -} - -#endif /* CHAPMS */ diff --git a/cpukit/pppd/chap_ms.h b/cpukit/pppd/chap_ms.h deleted file mode 100644 index fad2755c86..0000000000 --- a/cpukit/pppd/chap_ms.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * chap.h - Challenge Handshake Authentication Protocol definitions. - * - * Copyright (c) 1995 Eric Rosenquist, Strata Software Limited. - * http://www.strataware.com/ - * - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by Eric Rosenquist. The name of the author may not be used to - * endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * $Id$ - */ - -#ifndef __CHAPMS_INCLUDE__ - -#define MD4_SIGNATURE_SIZE 16 /* 16 bytes in a MD4 message digest */ -#define MAX_NT_PASSWORD 256 /* Maximum number of (Unicode) chars in an NT password */ - -void ChapMS __P((chap_state *, char *, int, char *, int)); - -#define __CHAPMS_INCLUDE__ -#endif /* __CHAPMS_INCLUDE__ */ diff --git a/cpukit/pppd/chat.c b/cpukit/pppd/chat.c deleted file mode 100644 index 74be1b06f0..0000000000 --- a/cpukit/pppd/chat.c +++ /dev/null @@ -1,818 +0,0 @@ -/* - * Chat -- a program for automatic session establishment (i.e. dial - * the phone and log in). - * - * Standard termination codes: - * 0 - successful completion of the script - * 1 - invalid argument, expect string too large, etc. - * 2 - error on an I/O operation or fatal error condition. - * 3 - timeout waiting for a simple string. - * 4 - the first string declared as "ABORT" - * 5 - the second string declared as "ABORT" - * 6 - ... and so on for successive ABORT strings. - * - * This software is in the public domain. - * - * ----------------- - * 22-May-99 added environment substitutuion, enabled with -E switch. - * Andreas Arens . - * - * 12-May-99 added a feature to read data to be sent from a file, - * if the send string starts with @. Idea from gpk . - * - * added -T and -U option and \T and \U substitution to pass a phone - * number into chat script. Two are needed for some ISDN TA applications. - * Keith Dart - * - * - * Added SAY keyword to send output to stderr. - * This allows to turn ECHO OFF and to output specific, user selected, - * text to give progress messages. This best works when stderr - * exists (i.e.: pppd in nodetach mode). - * - * Added HANGUP directives to allow for us to be called - * back. When HANGUP is set to NO, chat will not hangup at HUP signal. - * We rely on timeouts in that case. - * - * Added CLR_ABORT to clear previously set ABORT string. This has been - * dictated by the HANGUP above as "NO CARRIER" (for example) must be - * an ABORT condition until we know the other host is going to close - * the connection for call back. As soon as we have completed the - * first stage of the call back sequence, "NO CARRIER" is a valid, non - * fatal string. As soon as we got called back (probably get "CONNECT"), - * we should re-arm the ABORT "NO CARRIER". Hence the CLR_ABORT command. - * Note that CLR_ABORT packs the abort_strings[] array so that we do not - * have unused entries not being reclaimed. - * - * In the same vein as above, added CLR_REPORT keyword. - * - * Allow for comments. Line starting with '#' are comments and are - * ignored. If a '#' is to be expected as the first character, the - * expect string must be quoted. - * - * - * Francis Demierre - * Thu May 15 17:15:40 MET DST 1997 - * - * - * Added -r "report file" switch & REPORT keyword. - * Robert Geer - * - * Added -s "use stderr" and -S "don't use syslog" switches. - * June 18, 1997 - * Karl O. Pinc - * - * - * Added -e "echo" switch & ECHO keyword - * Dick Streefland - * - * - * Considerable updates and modifications by - * Al Longyear - * Paul Mackerras - * - * - * The original author is: - * - * Karl Fox - * Morning Star Technologies, Inc. - * 1760 Zollinger Road - * Columbus, OH 43221 - * (614)451-1883 - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "pppd.h" - -#undef TERMIOS -#define TERMIOS - - -#define STR_LEN 1024 -char temp2[STR_LEN]; - -#ifndef SIGTYPE -#define SIGTYPE void -#endif - -#undef __P -#undef __V - -#ifdef __STDC__ -#include -#define __V(x) x -#define __P(x) x -#else -#include -#define __V(x) (va_alist) va_dcl -#define __P(x) () -#define const -#endif - -#ifndef O_NONBLOCK -#define O_NONBLOCK O_NDELAY -#endif - - -/*************** Micro getopt() *********************************************/ -#define OPTION(c,v) (_O&2&&**v?*(*v)++:!c||_O&4?0:(!(_O&1)&& \ - (--c,++v),_O=4,c&&**v=='-'&&v[0][1]?*++*v=='-'\ - &&!v[0][1]?(--c,++v,0):(_O=2,*(*v)++):0)) -#define OPTARG(c,v) (_O&2?**v||(++v,--c)?(_O=1,--c,*v++): \ - (_O=4,(char*)0):(char*)0) -#define OPTONLYARG(c,v) (_O&2&&**v?(_O=1,--c,*v++):(char*)0) -#define ARG(c,v) (c?(--c,*v++):(char*)0) - -#if 0 -static int _O = 0; /* Internal state */ -#endif -/*************** Micro getopt() *********************************************/ - -char *program_name; - -#define MAX_ABORTS 16 -#define MAX_REPORTS 16 -#define DEFAULT_CHAT_TIMEOUT 45 -#define MAX_TIMEOUTS 10 - -int echo = 0; -int quiet = 0; -int report = 0; -int use_env = 0; -int exit_code = 0; -char *report_file = (char *) 0; -char *chat_file = (char *) 0; -char *phone_num = (char *) 0; -char *phone_num2 = (char *) 0; -static int ttyfd; -static int timeout = DEFAULT_CHAT_TIMEOUT; - -#ifdef TERMIOS -#define term_parms struct termios -#define get_term_param(param) tcgetattr(0, param) -#define set_term_param(param) tcsetattr(0, TCSANOW, param) -struct termios saved_tty_parameters; -#endif - -char *fail_reason = (char *)0; -char fail_buffer[50]; -char *abort_string[MAX_ABORTS]={"BUSY","NO DIALTONE","NO CARRIER","NO ANSWER","RING\r\nRING"}; -int n_aborts = 5; -int abort_next = 0, timeout_next = 0, echo_next = 0; -int clear_abort_next = 0; - -char *report_string[MAX_REPORTS] ; -char report_buffer[50] ; -int n_reports = 0, report_next = 0, report_gathering = 0 ; -int clear_report_next = 0; - -int say_next = 0, hup_next = 0; - -void *dup_mem __P((void *b, size_t c)); -void *copy_of __P((char *s)); -void break_sequence __P((void)); -static int get_string __P((register char *string)); -static int put_string __P((register char *s)); -static int write_char __P((int c)); -static int put_char __P((int c)); -static int get_char __P((void)); -void chat_send __P((register char *s)); -static char *character __P((int c)); -void chat_expect __P((register char *s)); -static char *clean __P((register char *s, int sending)); -char *expect_strtok __P((char *, char *)); -int chatmain __P((int, int, char *)); - - -void *dup_mem(b, c) -void *b; -size_t c; -{ - void *ans = malloc (c); - if (!ans) - return NULL; - - memcpy(ans, b, c); - return ans; -} - -void *copy_of (s) -char *s; -{ - return dup_mem(s, strlen (s) + 1); -} - -char *getnextcommand(char **string) -{ - char *buf=*string,*res; - res=strchr(buf,'|'); - if (res==NULL) - return NULL; - *res='\0'; - *string=res+1; - return buf; -} - -int chatmain(int fd, int mode, char *pScript) -{ - char *arg; - - /* initialize exit code */ - exit_code = 0; - ttyfd = fd; - - if ( debug ) { - dbglog("chat_main: %s\n", pScript); - } - - /* get first expect string */ - arg = getnextcommand(&pScript); - while (( arg != NULL ) && ( exit_code == 0 )) { - /* process the expect string */ - chat_expect(arg); - if ( exit_code == 0 ) { - /* get the next send string */ - arg = getnextcommand(&pScript); - if ( arg != NULL ) { - /* process the send string */ - chat_send(arg); - - /* get the next expect string */ - arg = getnextcommand(&pScript); - } - } - } - ttyfd = (int)-1; - - return ( exit_code ); -} - -void break_sequence() -{ - tcsendbreak(ttyfd, 0); -} - -/* - * 'Clean up' this string. - */ -static char *clean(s, sending) -register char *s; -int sending; /* set to 1 when sending (putting) this string. */ -{ - char temp[STR_LEN], env_str[STR_LEN], cur_chr; - register char *s1, *phchar; - int add_return = sending; -#define isoctal(chr) (((chr) >= '0') && ((chr) <= '7')) -#define isalnumx(chr) ((((chr) >= '0') && ((chr) <= '9')) \ - || (((chr) >= 'a') && ((chr) <= 'z')) \ - || (((chr) >= 'A') && ((chr) <= 'Z')) \ - || (chr) == '_') - - s1 = temp; - while (*s) { - cur_chr = *s++; - if (cur_chr == '^') { - cur_chr = *s++; - if (cur_chr == '\0') { - *s1++ = '^'; - break; - } - cur_chr &= 0x1F; - if (cur_chr != 0) { - *s1++ = cur_chr; - } - continue; - } - - if (use_env && cur_chr == '$') { /* ARI */ - phchar = env_str; - while (isalnumx(*s)) - *phchar++ = *s++; - *phchar = '\0'; - phchar = getenv(env_str); - if (phchar) - while (*phchar) - *s1++ = *phchar++; - continue; - } - - if (cur_chr != '\\') { - *s1++ = cur_chr; - continue; - } - - cur_chr = *s++; - if (cur_chr == '\0') { - if (sending) { - *s1++ = '\\'; - *s1++ = '\\'; - } - break; - } - - switch (cur_chr) { - case 'b': - *s1++ = '\b'; - break; - - case 'c': - if (sending && *s == '\0') - add_return = 0; - else - *s1++ = cur_chr; - break; - - case '\\': - case 'K': - case 'p': - case 'd': - if (sending) - *s1++ = '\\'; - *s1++ = cur_chr; - break; - - case 'T': - if (sending && phone_num) { - for (phchar = phone_num; *phchar != '\0'; phchar++) - *s1++ = *phchar; - } - else { - *s1++ = '\\'; - *s1++ = 'T'; - } - break; - - case 'U': - if (sending && phone_num2) { - for (phchar = phone_num2; *phchar != '\0'; phchar++) - *s1++ = *phchar; - } - else { - *s1++ = '\\'; - *s1++ = 'U'; - } - break; - - case 'q': - quiet = 1; - break; - - case 'r': - *s1++ = '\r'; - break; - - case 'n': - *s1++ = '\n'; - break; - - case 's': - *s1++ = ' '; - break; - - case 't': - *s1++ = '\t'; - break; - - case 'N': - if (sending) { - *s1++ = '\\'; - *s1++ = '\0'; - } - else - *s1++ = 'N'; - break; - - case '$': /* ARI */ - if (use_env) { - *s1++ = cur_chr; - break; - } - /* FALL THROUGH */ - - default: - if (isoctal (cur_chr)) { - cur_chr &= 0x07; - if (isoctal (*s)) { - cur_chr <<= 3; - cur_chr |= *s++ - '0'; - if (isoctal (*s)) { - cur_chr <<= 3; - cur_chr |= *s++ - '0'; - } - } - - if (cur_chr != 0 || sending) { - if (sending && (cur_chr == '\\' || cur_chr == 0)) - *s1++ = '\\'; - *s1++ = cur_chr; - } - break; - } - - if (sending) - *s1++ = '\\'; - *s1++ = cur_chr; - break; - } - } - - if (add_return) - *s1++ = '\r'; - - *s1++ = '\0'; /* guarantee closure */ - *s1++ = '\0'; /* terminate the string */ - return dup_mem (temp, (size_t) (s1 - temp)); /* may have embedded nuls */ -} - -/* - * A modified version of 'strtok'. This version skips \ sequences. - */ -char *expect_strtok (s, term) - char *s, *term; -{ - static char *str = ""; - int escape_flag = 0; - char *result; - -/* - * If a string was specified then do initial processing. - */ - if (s) - str = s; - -/* - * If this is the escape flag then reset it and ignore the character. - */ - if (*str) - result = str; - else - result = (char *) 0; - - while (*str) { - if (escape_flag) { - escape_flag = 0; - ++str; - continue; - } - - if (*str == '\\') { - ++str; - escape_flag = 1; - continue; - } - -/* - * If this is not in the termination string, continue. - */ - if (strchr (term, *str) == (char *) 0) { - ++str; - continue; - } - -/* - * This is the terminator. Mark the end of the string and stop. - */ - *str++ = '\0'; - break; - } - return (result); -} - -/* - * Process the expect string - */ -void chat_expect (s) -char *s; -{ - char *expect; - char *reply; - - if (strcmp(s, "HANGUP") == 0) { - ++hup_next; - return; - } - - if (strcmp(s, "ABORT") == 0) { - ++abort_next; - return; - } - - if (strcmp(s, "CLR_ABORT") == 0) { - ++clear_abort_next; - return; - } - - if (strcmp(s, "REPORT") == 0) { - ++report_next; - return; - } - - if (strcmp(s, "CLR_REPORT") == 0) { - ++clear_report_next; - return; - } - - if (strcmp(s, "TIMEOUT") == 0) { - ++timeout_next; - return; - } - - if (strcmp(s, "ECHO") == 0) { - ++echo_next; - return; - } - - if (strcmp(s, "SAY") == 0) { - ++say_next; - return; - } - -/* - * Fetch the expect and reply string. - */ - for (;;) { - expect = expect_strtok (s, "-"); - s = (char *) 0; - - if (expect == (char *) 0) - return; - - reply = expect_strtok (s, "-"); - -/* - * Handle the expect string. If successful then exit. - */ - if (get_string (expect)) - return; - -/* - * If there is a sub-reply string then send it. Otherwise any condition - * is terminal. - */ - if (reply == (char *) 0 || exit_code != 3) - break; - - chat_send (reply); - } -} - -/* - * Translate the input character to the appropriate string for printing - * the data. - */ - -static char *character(c) -int c; -{ - static char string[10]; - char *meta; - - meta = (c & 0x80) ? "M-" : ""; - c &= 0x7F; - - if (c < 32) - sprintf(string, "%s^%c", meta, (int)c + '@'); - else if (c == 127) - sprintf(string, "%s^?", meta); - else - sprintf(string, "%s%c", meta, c); - - return (string); -} - -/* - * process the reply string - */ -void chat_send (s) -register char *s; -{ -/* char file_data[STR_LEN]; */ - - if (say_next) { - say_next = 0; - s = clean(s, 1); - write(2, s, strlen(s)); - free(s); - return; - } - - if (hup_next) { - hup_next = 0; - return; - } - - if (echo_next) { - echo_next = 0; - echo = (strcmp(s, "ON") == 0); - return; - } - - if (abort_next) { - char *s1; - - abort_next = 0; - if ( n_aborts < MAX_ABORTS ) { - s1 = clean(s, 0); - if (( strlen(s1) <= strlen(s) ) && - ( strlen(s1) < sizeof(fail_buffer))) { - - abort_string[n_aborts++] = s1; - } - } - return; - } - - if (clear_abort_next) { - clear_abort_next = 0; - return; - } - - if (report_next) { - report_next = 0; - return; - } - - if (clear_report_next) { - clear_report_next = 0; - return; - } - - if (timeout_next) { - timeout_next = 0; - timeout = atoi(s); - - if (timeout <= 0) - timeout = DEFAULT_CHAT_TIMEOUT; - - return; - } - - if (strcmp(s, "EOT") == 0) - s = "^D\\c"; - else if (strcmp(s, "BREAK") == 0) - s = "\\K\\c"; - - if (!put_string(s)) { - exit_code = 2; - } -} - -static int get_char() -{ - int status; - char c; - int tries=MAX_TIMEOUTS; - - while(tries) - { - status = read(ttyfd, &c, 1); - switch (status) { - case 1: - return ((int)c & 0x7F); - default: - tries--; - } - } - return -1; -} - -static int put_char(c) -int c; -{ - char ch = c; - - write(ttyfd, &ch, 1); - - return 0; -} - -static int write_char (c) -int c; -{ - if (put_char(c) < 0) { - return (0); - } - return (1); -} - -static int put_string (s) -register char *s; -{ - quiet = 0; - s = clean(s, 1); - while (*s) { - register char c = *s++; - - if (c != '\\') { - if (!write_char (c)) - return 0; - continue; - } - - c = *s++; - switch (c) { - case 'd': - sleep(1); - break; - - case 'K': - break_sequence(); - break; - - case 'p': -#if 0 /* FIXME!!! */ - usleep(10000); /* 1/100th of a second (arg is microseconds) */ -#else - sleep(1); -#endif - break; - - default: - if (!write_char (c)) - return 0; - break; - } - } - - return (1); -} - -/* - * 'Wait for' this string to appear on this file descriptor. - */ -static int get_string(string) -register char *string; -{ - int c, len, minlen; - register char *s = temp2, *end = s + STR_LEN; - char *logged = temp2; - struct termios tios; - - memset(temp2, 0, sizeof(temp2)); - - tcgetattr(ttyfd, &tios); - tios.c_cc[VMIN] = 0; - tios.c_cc[VTIME] = timeout*10/MAX_TIMEOUTS; - tcsetattr(ttyfd, TCSANOW, &tios); - - string = clean(string, 0); - len = strlen(string); - minlen = (len > sizeof(fail_buffer)? len: sizeof(fail_buffer)) - 1; - - if (len > STR_LEN) { - exit_code = 1; - return 0; - } - - if (len == 0) { - return (1); - } - - while ( (c = get_char()) >= 0) { - int n, abort_len; - - *s++ = c; - *s=0; - - if (s - temp2 >= len && - c == string[len - 1] && - strncmp(s - len, string, len) == 0) { - return (1); - } - - for (n = 0; n < n_aborts; ++n) { - if (s - temp2 >= (abort_len = strlen(abort_string[n])) && - strncmp(s - abort_len, abort_string[n], abort_len) == 0) { - - exit_code = n + 4; - strcpy(fail_reason = fail_buffer, abort_string[n]); - return (0); - } - } - - if (s >= end) { - if (logged < s - minlen) { - logged = s; - } - s -= minlen; - memmove(temp2, s, minlen); - logged = temp2 + (logged - s); - s = temp2 + minlen; - } - } - - exit_code = 3; - return (0); -} diff --git a/cpukit/pppd/demand.c b/cpukit/pppd/demand.c deleted file mode 100644 index 1f2e9932d4..0000000000 --- a/cpukit/pppd/demand.c +++ /dev/null @@ -1,347 +0,0 @@ -/* - * demand.c - Support routines for demand-dialling. - * - * Copyright (c) 1993 The Australian National University. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the Australian National University. The name of the University - * may not be used to endorse or promote products derived from this - * software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#define RCSID "$Id$"; - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef PPP_FILTER -#include -#include -#include -#endif - -#include "pppd.h" -#include "fsm.h" -#include "ipcp.h" -#include "lcp.h" - -static const char rcsid[] = RCSID; - -char *frame; -int framelen; -int framemax; -int escape_flag; -int flush_flag; -int fcs; - -struct packet { - int length; - struct packet *next; - unsigned char data[1]; -}; - -struct packet *pend_q; -struct packet *pend_qtail; - -static int active_packet __P((unsigned char *, int)); - -/* - * demand_conf - configure the interface for doing dial-on-demand. - */ -void -demand_conf() -{ - int i; - struct protent *protp; - -/* framemax = lcp_allowoptions[0].mru; - if (framemax < PPP_MRU) */ - framemax = PPP_MRU; - framemax += PPP_HDRLEN + PPP_FCSLEN; - frame = malloc(framemax); - if (frame == NULL) - novm("demand frame"); - framelen = 0; - pend_q = NULL; - escape_flag = 0; - flush_flag = 0; - fcs = PPP_INITFCS; - - ppp_send_config(0, PPP_MRU, (u_int32_t) 0, 0, 0); - ppp_recv_config(0, PPP_MRU, (u_int32_t) 0, 0, 0); - -#ifdef PPP_FILTER - set_filters(&pass_filter, &active_filter); -#endif - - /* - * Call the demand_conf procedure for each protocol that's got one. - */ - for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->enabled_flag && protp->demand_conf != NULL) - if (!((*protp->demand_conf)(0))) - die(1); -} - - -/* - * demand_block - set each network protocol to block further packets. - */ -void -demand_block() -{ - int i; - struct protent *protp; - - for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->enabled_flag && protp->demand_conf != NULL) - sifnpmode(0, protp->protocol & ~0x8000, NPMODE_QUEUE); - get_loop_output(); -} - -/* - * demand_discard - set each network protocol to discard packets - * with an error. - */ -void -demand_discard() -{ - struct packet *pkt, *nextpkt; - int i; - struct protent *protp; - - for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->enabled_flag && protp->demand_conf != NULL) - sifnpmode(0, protp->protocol & ~0x8000, NPMODE_ERROR); - get_loop_output(); - - /* discard all saved packets */ - for (pkt = pend_q; pkt != NULL; pkt = nextpkt) { - nextpkt = pkt->next; - free(pkt); - } - pend_q = NULL; - framelen = 0; - flush_flag = 0; - escape_flag = 0; - fcs = PPP_INITFCS; -} - -/* - * demand_unblock - set each enabled network protocol to pass packets. - */ -void -demand_unblock() -{ - int i; - struct protent *protp; - - for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->enabled_flag && protp->demand_conf != NULL) - sifnpmode(0, protp->protocol & ~0x8000, NPMODE_PASS); -} - -/* - * FCS lookup table as calculated by genfcstab. - */ -static u_short fcstab[256] = { - 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf, - 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7, - 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e, - 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876, - 0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd, - 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5, - 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c, - 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974, - 0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb, - 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3, - 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a, - 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72, - 0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9, - 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1, - 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738, - 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70, - 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7, - 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff, - 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036, - 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e, - 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5, - 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd, - 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134, - 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c, - 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3, - 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb, - 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232, - 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a, - 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1, - 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9, - 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330, - 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78 -}; - -/* - * loop_chars - process characters received from the loopback. - * Calls loop_frame when a complete frame has been accumulated. - * Return value is 1 if we need to bring up the link, 0 otherwise. - */ -int -loop_chars(p, n) - unsigned char *p; - int n; -{ - int c, rv; - - rv = 0; - for (; n > 0; --n) { - c = *p++; - if (c == PPP_FLAG) { - if (!escape_flag && !flush_flag - && framelen > 2 && fcs == PPP_GOODFCS) { - framelen -= 2; - if (loop_frame(frame, framelen)) - rv = 1; - } - framelen = 0; - flush_flag = 0; - escape_flag = 0; - fcs = PPP_INITFCS; - continue; - } - if (flush_flag) - continue; - if (escape_flag) { - c ^= PPP_TRANS; - escape_flag = 0; - } else if (c == PPP_ESCAPE) { - escape_flag = 1; - continue; - } - if (framelen >= framemax) { - flush_flag = 1; - continue; - } - frame[framelen++] = c; - fcs = PPP_FCS(fcs, c); - } - return rv; -} - -/* - * loop_frame - given a frame obtained from the loopback, - * decide whether to bring up the link or not, and, if we want - * to transmit this frame later, put it on the pending queue. - * Return value is 1 if we need to bring up the link, 0 otherwise. - * We assume that the kernel driver has already applied the - * pass_filter, so we won't get packets it rejected. - * We apply the active_filter to see if we want this packet to - * bring up the link. - */ -int -loop_frame(frame, len) - unsigned char *frame; - int len; -{ - struct packet *pkt; - - /* dbglog("from loop: %P", frame, len); */ - if (len < PPP_HDRLEN) - return 0; - if ((PPP_PROTOCOL(frame) & 0x8000) != 0) - return 0; /* shouldn't get any of these anyway */ - if (!active_packet(frame, len)) - return 0; - - pkt = (struct packet *) malloc(sizeof(struct packet) + len); - if (pkt != NULL) { - pkt->length = len; - pkt->next = NULL; - memcpy(pkt->data, frame, len); - if (pend_q == NULL) - pend_q = pkt; - else - pend_qtail->next = pkt; - pend_qtail = pkt; - } - return 1; -} - -/* - * demand_rexmit - Resend all those frames which we got via the - * loopback, now that the real serial link is up. - */ -void -demand_rexmit(proto) - int proto; -{ - struct packet *pkt, *prev, *nextpkt; - - prev = NULL; - pkt = pend_q; - pend_q = NULL; - for (; pkt != NULL; pkt = nextpkt) { - nextpkt = pkt->next; - if (PPP_PROTOCOL(pkt->data) == proto) { - output(0, pkt->data, pkt->length); - free(pkt); - } else { - if (prev == NULL) - pend_q = pkt; - else - prev->next = pkt; - prev = pkt; - } - } - pend_qtail = prev; - if (prev != NULL) - prev->next = NULL; -} - -/* - * Scan a packet to decide whether it is an "active" packet, - * that is, whether it is worth bringing up the link for. - */ -static int -active_packet(p, len) - unsigned char *p; - int len; -{ - int proto, i; - struct protent *protp; - - if (len < PPP_HDRLEN) - return 0; - proto = PPP_PROTOCOL(p); -#ifdef PPP_FILTER - if (active_filter.bf_len != 0 - && bpf_filter(active_filter.bf_insns, frame, len, len) == 0) - return 0; -#endif - for (i = 0; (protp = protocols[i]) != NULL; ++i) { - if (protp->protocol < 0xC000 && (protp->protocol & ~0x8000) == proto) { - if (!protp->enabled_flag) - return 0; - if (protp->active_pkt == NULL) - return 1; - return (*protp->active_pkt)(p, len); - } - } - return 0; /* not a supported protocol !!?? */ -} diff --git a/cpukit/pppd/example/Makefile-user b/cpukit/pppd/example/Makefile-user deleted file mode 100644 index 69cc8aab50..0000000000 --- a/cpukit/pppd/example/Makefile-user +++ /dev/null @@ -1,45 +0,0 @@ -# -# Makefile -# - -# -# RTEMS_MAKEFILE_PATH is typically set in an environment variable -# - -EXEC=ppptest.exe -PGM=${ARCH}/$(EXEC) - -# optional managers required -MANAGERS=io event semaphore - -# C source names -CSRCS = init.c pppdapp.c - -COBJS_ = $(CSRCS:.c=.o) -COBJS = $(COBJS_:%=${ARCH}/%) - -# C++ source names -CXXSRCS = -CXXOBJS_ = $(CXXSRCS:.cc=.o) -CXXOBJS = $(CXXOBJS_:%=${ARCH}/%) - -# AS source names -ASSRCS = -ASOBJS_ = $(ASSRCS:.s=.o) -ASOBJS = $(ASOBJS_:%=${ARCH}/%) - -# Libraries -LIBS = -lrtemsall -lc - -include $(RTEMS_MAKEFILE_PATH)/Makefile.inc - -include $(RTEMS_CUSTOM) -include $(PROJECT_ROOT)/make/leaf.cfg - -OBJS= $(COBJS) $(CXXOBJS) $(ASOBJS) - -all: ${ARCH} $(PGM) - -$(PGM): $(OBJS) - $(make-exe) - diff --git a/cpukit/pppd/example/README b/cpukit/pppd/example/README deleted file mode 100644 index 677e00af33..0000000000 --- a/cpukit/pppd/example/README +++ /dev/null @@ -1,15 +0,0 @@ -# -# $Id$ -# - -This is an example user application using pppd. It is built using -the RTEMS application Makefiles. The file Makefile-user should -be renamed to Makefile or the -f option given to make. The file -is renamed to avoid bootstrap -c removing it. - -The files ppp.conf and pppd.options are sample configuration files -that have successfully used to make ppp connections over a null -modem serial cable to a UNIX box. Please review the man pages -for either the ppp or pppd applications to ensure they are configured -correctly. - diff --git a/cpukit/pppd/example/init.c b/cpukit/pppd/example/init.c deleted file mode 100644 index f35d195bf2..0000000000 --- a/cpukit/pppd/example/init.c +++ /dev/null @@ -1,24 +0,0 @@ - -#include -#include -#include -#include -#include - -#define CONFIGURE_INIT -#include "system.h" -#include "netconfig.h" - - -extern int pppdapp_initialize(void); - - -rtems_task Init(rtems_task_argument argument) -{ - /* initialize network */ - rtems_bsdnet_initialize_network(); - rtems_pppd_initialize(); - pppdapp_initialize(); - - rtems_task_delete(RTEMS_SELF); -} diff --git a/cpukit/pppd/example/netconfig.h b/cpukit/pppd/example/netconfig.h deleted file mode 100644 index 3428288cd2..0000000000 --- a/cpukit/pppd/example/netconfig.h +++ /dev/null @@ -1,36 +0,0 @@ - -#ifndef NETCONFIG_H_ -#define NETCONFIG_H_ - -#include - -/* external function prototypes */ -extern int rtems_ppp_driver_attach(struct rtems_bsdnet_ifconfig *config, int attaching); - -/* Default network interface */ -static struct rtems_bsdnet_ifconfig netdriver_config = { - "ppp0", /* name */ - rtems_ppp_driver_attach, /* attach function */ - NULL, /* No more interfaces */ - NULL, /* IP address */ - NULL, /* IP net mask */ - NULL, /* Driver supplies hardware address */ - 0 /* Use default driver parameters */ -}; - -/* Network configuration */ -struct rtems_bsdnet_config rtems_bsdnet_config = { - &netdriver_config, - NULL, - 30, /* Default network task priority */ - (256*1024), /* Default mbuf capacity */ - (512*1024), /* Default mbuf cluster capacity */ - 0, /* Host name */ - 0, /* Domain name */ - 0, /* Gateway */ - 0, /* Log host */ - { 0 }, /* Name server(s) */ - { 0 }, /* NTP server(s) */ -}; - -#endif diff --git a/cpukit/pppd/example/ppp.conf b/cpukit/pppd/example/ppp.conf deleted file mode 100644 index 094b1946a8..0000000000 --- a/cpukit/pppd/example/ppp.conf +++ /dev/null @@ -1,27 +0,0 @@ - -# -# Example configuration file for setting up a ppp server -# using a null-modem serial cable: -# -# Tested using ppp on OpenBSD 2.9 -# - just follow instructions in man page for accepting -# ppp connections over the serial port -# - if pap and/or chap is enabled, you must have a ppp.secret -# file which will be used for user authentication -# - found useful to turn on syslog for ppp -# - -default: - set log Phase Chat LQM LCP IPCP CCP command - set device /dev/cua00 - set speed 57600 - set ctsrts on - set dial "" - -openbsd-server: - set timeout 0 - set ifaddr 192.168.2.100 192.168.2.123 - enable dns - allow users - enable chap - enable pap diff --git a/cpukit/pppd/example/pppd.options b/cpukit/pppd/example/pppd.options deleted file mode 100644 index c0706e6ec5..0000000000 --- a/cpukit/pppd/example/pppd.options +++ /dev/null @@ -1,9 +0,0 @@ -/dev/tty00 -57600 -crtscts -passive -local -noauth -debug -persist -192.168.2.222:192.168.2.111 diff --git a/cpukit/pppd/example/pppdapp.c b/cpukit/pppd/example/pppdapp.c deleted file mode 100644 index 59e5029088..0000000000 --- a/cpukit/pppd/example/pppdapp.c +++ /dev/null @@ -1,146 +0,0 @@ - -#include -#include -#include "system.h" - - -/* define global variables */ -static unsigned int pppdapp_linkcount = 0; -static rtems_id pppdapp_taskid; - - -static void pppdapp_linkup_hook(void) -{ - pppdapp_linkcount++; - printf("PPP LINK UP [%d]\n", pppdapp_linkcount); -} - -static void pppdapp_linkdown_hook(void) -{ - printf("PPP LINK DOWN [%d]\n", pppdapp_linkcount); -} - -static void pppdapp_ipup_hook(void) -{ - /* send ipup signal to pppdapp task */ - rtems_event_send(pppdapp_taskid, RTEMS_EVENT_10); -} - -static void pppdapp_ipdown_hook(void) -{ - /* send ip down signal to pppdapp task */ - rtems_event_send(pppdapp_taskid, RTEMS_EVENT_11); -} - -static void pppdapp_setup(void) -{ - const char *pUser = "oscar"; - const char *pPassword = "goldman"; - -#undef USE_MODEM -#ifdef USE_MODEM - const char *pTelephone = "5551234"; - const char *pInitScript = "TIMEOUT@5@@AT@@OK@"; - const char *pConnectScript = "TIMEOUT@90@@ATDT%s@CONNECT@@name:@%s@word:@%s@"; - const char *pDisconnectScript = "TIMEOUT@5@@ATH0@@OK@"; - char pConnect[128]; - - /* set the connect string */ - sprintf(pConnect, pConnectScript, pTelephone, pUser, pPassword); - - /* set pppd options for modem */ - rtems_pppd_set_option("/dev/ttyS2", NULL); - rtems_pppd_set_option("57600", NULL); - rtems_pppd_set_option("crtscts", NULL); - rtems_pppd_set_option("modem", NULL); - rtems_pppd_set_option("noauth", NULL); - rtems_pppd_set_option("debug", NULL); - rtems_pppd_set_option("init", pInitScript); - rtems_pppd_set_option("connect", pConnect); - rtems_pppd_set_option("disconnect", pDisconnectScript); -#else - /* set pppd options for null modem direct link serial cable */ - rtems_pppd_set_option("/dev/ttyS1", NULL); - rtems_pppd_set_option("57600", NULL); - rtems_pppd_set_option("crtscts", NULL); - rtems_pppd_set_option("local", NULL); - rtems_pppd_set_option("noauth", NULL); - rtems_pppd_set_option("debug", NULL); - rtems_pppd_set_option("user", pUser); - rtems_pppd_set_option("password", pPassword); -#endif - - /* set up pppd hooks */ - rtems_pppd_set_hook(RTEMS_PPPD_LINKUP_HOOK, pppdapp_linkup_hook); - rtems_pppd_set_hook(RTEMS_PPPD_LINKDOWN_HOOK, pppdapp_linkdown_hook); - rtems_pppd_set_hook(RTEMS_PPPD_IPUP_HOOK, pppdapp_ipup_hook); - rtems_pppd_set_hook(RTEMS_PPPD_IPDOWN_HOOK, pppdapp_ipdown_hook); -} - -static rtems_task pppdapp(rtems_task_argument arg) -{ - rtems_status_code sc = RTEMS_SUCCESSFUL; - rtems_interval tickspersecond = 0; - rtems_option options; - rtems_event_set in; - rtems_event_set out; - - /* initialize ticks per second */ - rtems_clock_get(RTEMS_CLOCK_GET_TICKS_PER_SECOND, &tickspersecond); - if ( tickspersecond == 0 ) { - /* ensure value is greater than zero */ - tickspersecond = 100; - } - - /* initiate connection */ - pppdapp_setup(); - rtems_pppd_connect(); - - /* enter processing loop */ - in = (RTEMS_EVENT_10 | RTEMS_EVENT_11); - options = (RTEMS_EVENT_ANY | RTEMS_WAIT); - while ( sc == RTEMS_SUCCESSFUL ) { - /* wait for the next event */ - sc = rtems_event_receive(in, options, RTEMS_NO_TIMEOUT, &out); - if ( sc == RTEMS_SUCCESSFUL ) { - /* determine which event was sent */ - if ( out & RTEMS_EVENT_10 ) { - /* ip up recived */ - /* call disconnect function */ - rtems_pppd_disconnect(); - } - if ( out & RTEMS_EVENT_11 ) { - /* ip down recived */ - /* sleep 10 seconds and call connect function */ - rtems_task_wake_after(10*tickspersecond); - rtems_pppd_connect(); - } - } - } - - /* terminate myself */ - rtems_task_delete(RTEMS_SELF); -} - -int pppdapp_initialize(void) -{ - int iReturn = (int)-1; - rtems_status_code status; - rtems_name taskName; - - taskName = rtems_build_name( 'p', 'a', 'p', 'p' ); - status = rtems_task_create(taskName, - CONFIGURE_INIT_TASK_PRIORITY, - CONFIGURE_INIT_TASK_STACK_SIZE, - CONFIGURE_INIT_TASK_INITIAL_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &pppdapp_taskid); - if ( status == RTEMS_SUCCESSFUL ) { - status = rtems_task_start(pppdapp_taskid, pppdapp, 0); - if ( status == RTEMS_SUCCESSFUL ) { - iReturn = (int)0; - } - } - - return ( iReturn ); -} diff --git a/cpukit/pppd/example/system.h b/cpukit/pppd/example/system.h deleted file mode 100644 index 87678da1b6..0000000000 --- a/cpukit/pppd/example/system.h +++ /dev/null @@ -1,42 +0,0 @@ - -#ifndef SYSTEM_H -#define SYSTEM_H - -#include -#include - -/* functions */ -extern rtems_task Init(rtems_task_argument argument); - -#include - -#define CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE -#ifdef CONFIGURE_INIT -rtems_driver_address_table Device_drivers[5] = { - CONSOLE_DRIVER_TABLE_ENTRY, - CLOCK_DRIVER_TABLE_ENTRY, - TTY1_DRIVER_TABLE_ENTRY, - TTY2_DRIVER_TABLE_ENTRY, - {NULL, NULL, NULL, NULL, NULL, NULL} -}; -#endif - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE -#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 8 - -#define CONFIGURE_EXECUTIVE_RAM_SIZE (512*1024) -#define CONFIGURE_MAXIMUM_SEMAPHORES 20 -#define CONFIGURE_MAXIMUM_TASKS 20 - -#define CONFIGURE_MICROSECONDS_PER_TICK 10000 - -#define CONFIGURE_INIT_TASK_STACK_SIZE (10*1024) -#define CONFIGURE_INIT_TASK_PRIORITY 120 -#define CONFIGURE_INIT_TASK_INITIAL_MODES (RTEMS_PREEMPT | \ - RTEMS_NO_TIMESLICE | \ - RTEMS_NO_ASR | \ - RTEMS_INTERRUPT_LEVEL(0)) - -#include - -#endif diff --git a/cpukit/pppd/fsm.c b/cpukit/pppd/fsm.c deleted file mode 100644 index 53401a9129..0000000000 --- a/cpukit/pppd/fsm.c +++ /dev/null @@ -1,764 +0,0 @@ -/* - * fsm.c - {Link, IP} Control Protocol Finite State Machine. - * - * Copyright (c) 1989 Carnegie Mellon University. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by Carnegie Mellon University. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#define RCSID "$Id$" - -/* - * TODO: - * Randomize fsm id on link/init. - * Deal with variable outgoing MTU. - */ - -#include -#include -#include - -#include "pppd.h" -#include "fsm.h" - -static const char rcsid[] = RCSID; - -static void fsm_timeout __P((void *)); -static void fsm_rconfreq __P((fsm *, u_char, u_char *, int)); -static void fsm_rconfack __P((fsm *, int, u_char *, int)); -static void fsm_rconfnakrej __P((fsm *, int, int, u_char *, int)); -static void fsm_rtermreq __P((fsm *, int, u_char *, int)); -static void fsm_rtermack __P((fsm *)); -static void fsm_rcoderej __P((fsm *, u_char *, int)); -static void fsm_sconfreq __P((fsm *, int)); - -#define PROTO_NAME(f) ((f)->callbacks->proto_name) - -int peer_mru[NUM_PPP]; - - -/* - * fsm_init - Initialize fsm. - * - * Initialize fsm state. - */ -void -fsm_init(f) - fsm *f; -{ - f->state = INITIAL; - f->flags = 0; - f->id = 100; /* XXX Start with random id? */ - f->timeouttime = DEFTIMEOUT; - f->maxconfreqtransmits = DEFMAXCONFREQS; - f->maxtermtransmits = DEFMAXTERMREQS; - f->maxnakloops = DEFMAXNAKLOOPS; - f->term_reason_len = 0; -} - - -/* - * fsm_lowerup - The lower layer is up. - */ -void -fsm_lowerup(f) - fsm *f; -{ - switch( f->state ){ - case INITIAL: - f->state = CLOSED; - break; - - case STARTING: - if( f->flags & OPT_SILENT ) - f->state = STOPPED; - else { - /* Send an initial configure-request */ - fsm_sconfreq(f, 0); - f->state = REQSENT; - } - break; - - default: - FSMDEBUG(("%s: Up event in state %d!", PROTO_NAME(f), f->state)); - } -} - - -/* - * fsm_lowerdown - The lower layer is down. - * - * Cancel all timeouts and inform upper layers. - */ -void -fsm_lowerdown(f) - fsm *f; -{ - switch( f->state ){ - case CLOSED: - f->state = INITIAL; - break; - - case STOPPED: - f->state = STARTING; - if( f->callbacks->starting ) - (*f->callbacks->starting)(f); - break; - - case CLOSING: - f->state = INITIAL; - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - break; - - case STOPPING: - case REQSENT: - case ACKRCVD: - case ACKSENT: - f->state = STARTING; - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - break; - - case OPENED: - if( f->callbacks->down ) - (*f->callbacks->down)(f); - f->state = STARTING; - break; - - default: - FSMDEBUG(("%s: Down event in state %d!", PROTO_NAME(f), f->state)); - } -} - - -/* - * fsm_open - Link is allowed to come up. - */ -void -fsm_open(f) - fsm *f; -{ - switch( f->state ){ - case INITIAL: - f->state = STARTING; - if( f->callbacks->starting ) - (*f->callbacks->starting)(f); - break; - - case CLOSED: - if( f->flags & OPT_SILENT ) - f->state = STOPPED; - else { - /* Send an initial configure-request */ - fsm_sconfreq(f, 0); - f->state = REQSENT; - } - break; - - case CLOSING: - f->state = STOPPING; - /* fall through */ - case STOPPED: - case OPENED: - if( f->flags & OPT_RESTART ){ - fsm_lowerdown(f); - fsm_lowerup(f); - } - break; - } -} - - -/* - * fsm_close - Start closing connection. - * - * Cancel timeouts and either initiate close or possibly go directly to - * the CLOSED state. - */ -void -fsm_close(f, reason) - fsm *f; - char *reason; -{ - f->term_reason = reason; - f->term_reason_len = (reason == NULL? 0: strlen(reason)); - switch( f->state ){ - case STARTING: - f->state = INITIAL; - break; - case STOPPED: - f->state = CLOSED; - break; - case STOPPING: - f->state = CLOSING; - break; - - case REQSENT: - case ACKRCVD: - case ACKSENT: - case OPENED: - if( f->state != OPENED ) - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - else if( f->callbacks->down ) - (*f->callbacks->down)(f); /* Inform upper layers we're down */ - - /* Init restart counter, send Terminate-Request */ - f->retransmits = f->maxtermtransmits; - fsm_sdata(f, TERMREQ, f->reqid = ++f->id, - (u_char *) f->term_reason, f->term_reason_len); - TIMEOUT(fsm_timeout, f, f->timeouttime); - --f->retransmits; - - f->state = CLOSING; - break; - } -} - - -/* - * fsm_timeout - Timeout expired. - */ -static void -fsm_timeout(arg) - void *arg; -{ - fsm *f = (fsm *) arg; - - switch (f->state) { - case CLOSING: - case STOPPING: - if( f->retransmits <= 0 ){ - /* - * We've waited for an ack long enough. Peer probably heard us. - */ - f->state = (f->state == CLOSING)? CLOSED: STOPPED; - if( f->callbacks->finished ) - (*f->callbacks->finished)(f); - } else { - /* Send Terminate-Request */ - fsm_sdata(f, TERMREQ, f->reqid = ++f->id, - (u_char *) f->term_reason, f->term_reason_len); - TIMEOUT(fsm_timeout, f, f->timeouttime); - --f->retransmits; - } - break; - - case REQSENT: - case ACKRCVD: - case ACKSENT: - if (f->retransmits <= 0) { - warn("%s: timeout sending Config-Requests\n", PROTO_NAME(f)); - f->state = STOPPED; - if( (f->flags & OPT_PASSIVE) == 0 && f->callbacks->finished ) - (*f->callbacks->finished)(f); - - } else { - /* Retransmit the configure-request */ - if (f->callbacks->retransmit) - (*f->callbacks->retransmit)(f); - fsm_sconfreq(f, 1); /* Re-send Configure-Request */ - if( f->state == ACKRCVD ) - f->state = REQSENT; - } - break; - - default: - FSMDEBUG(("%s: Timeout event in state %d!", PROTO_NAME(f), f->state)); - } -} - - -/* - * fsm_input - Input packet. - */ -void -fsm_input(f, inpacket, l) - fsm *f; - u_char *inpacket; - int l; -{ - u_char *inp; - u_char code, id; - int len; - - /* - * Parse header (code, id and length). - * If packet too short, drop it. - */ - inp = inpacket; - if (l < HEADERLEN) { - FSMDEBUG(("fsm_input(%x): Rcvd short header.", f->protocol)); - return; - } - GETCHAR(code, inp); - GETCHAR(id, inp); - GETSHORT(len, inp); - if (len < HEADERLEN) { - FSMDEBUG(("fsm_input(%x): Rcvd illegal length.", f->protocol)); - return; - } - if (len > l) { - FSMDEBUG(("fsm_input(%x): Rcvd short packet.", f->protocol)); - return; - } - len -= HEADERLEN; /* subtract header length */ - - if( f->state == INITIAL || f->state == STARTING ){ - FSMDEBUG(("fsm_input(%x): Rcvd packet in state %d.", - f->protocol, f->state)); - return; - } - - /* - * Action depends on code. - */ - switch (code) { - case CONFREQ: - fsm_rconfreq(f, id, inp, len); - break; - - case CONFACK: - fsm_rconfack(f, id, inp, len); - break; - - case CONFNAK: - case CONFREJ: - fsm_rconfnakrej(f, code, id, inp, len); - break; - - case TERMREQ: - fsm_rtermreq(f, id, inp, len); - break; - - case TERMACK: - fsm_rtermack(f); - break; - - case CODEREJ: - fsm_rcoderej(f, inp, len); - break; - - default: - if( !f->callbacks->extcode - || !(*f->callbacks->extcode)(f, code, id, inp, len) ) - fsm_sdata(f, CODEREJ, ++f->id, inpacket, len + HEADERLEN); - break; - } -} - - -/* - * fsm_rconfreq - Receive Configure-Request. - */ -static void -fsm_rconfreq(f, id, inp, len) - fsm *f; - u_char id; - u_char *inp; - int len; -{ - int code, reject_if_disagree; - - switch( f->state ){ - case CLOSED: - /* Go away, we're closed */ - fsm_sdata(f, TERMACK, id, NULL, 0); - return; - case CLOSING: - case STOPPING: - return; - - case OPENED: - /* Go down and restart negotiation */ - if( f->callbacks->down ) - (*f->callbacks->down)(f); /* Inform upper layers */ - fsm_sconfreq(f, 0); /* Send initial Configure-Request */ - break; - - case STOPPED: - /* Negotiation started by our peer */ - fsm_sconfreq(f, 0); /* Send initial Configure-Request */ - f->state = REQSENT; - break; - } - - /* - * Pass the requested configuration options - * to protocol-specific code for checking. - */ - if (f->callbacks->reqci){ /* Check CI */ - reject_if_disagree = (f->nakloops >= f->maxnakloops); - code = (*f->callbacks->reqci)(f, inp, &len, reject_if_disagree); - } else if (len) - code = CONFREJ; /* Reject all CI */ - else - code = CONFACK; - - /* send the Ack, Nak or Rej to the peer */ - fsm_sdata(f, code, id, inp, len); - - if (code == CONFACK) { - if (f->state == ACKRCVD) { - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - f->state = OPENED; - if (f->callbacks->up) - (*f->callbacks->up)(f); /* Inform upper layers */ - } else { - f->state = ACKSENT; - ppp_delay(); - } - f->nakloops = 0; - - } else { - /* we sent CONFACK or CONFREJ */ - if (f->state != ACKRCVD) - f->state = REQSENT; - if( code == CONFNAK ) - ++f->nakloops; - } -} - - -/* - * fsm_rconfack - Receive Configure-Ack. - */ -static void -fsm_rconfack(f, id, inp, len) - fsm *f; - int id; - u_char *inp; - int len; -{ - if (id != f->reqid || f->seen_ack) /* Expected id? */ - return; /* Nope, toss... */ - if( !(f->callbacks->ackci? (*f->callbacks->ackci)(f, inp, len): - (len == 0)) ){ - /* Ack is bad - ignore it */ - error("Received bad configure-ack: %P", inp, len); - return; - } - f->seen_ack = 1; - - switch (f->state) { - case CLOSED: - case STOPPED: - fsm_sdata(f, TERMACK, id, NULL, 0); - break; - - case REQSENT: - f->state = ACKRCVD; - f->retransmits = f->maxconfreqtransmits; - break; - - case ACKRCVD: - /* Huh? an extra valid Ack? oh well... */ - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - fsm_sconfreq(f, 0); - f->state = REQSENT; - break; - - case ACKSENT: - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - f->state = OPENED; - f->retransmits = f->maxconfreqtransmits; - if (f->callbacks->up) - (*f->callbacks->up)(f); /* Inform upper layers */ - break; - - case OPENED: - /* Go down and restart negotiation */ - if (f->callbacks->down) - (*f->callbacks->down)(f); /* Inform upper layers */ - fsm_sconfreq(f, 0); /* Send initial Configure-Request */ - f->state = REQSENT; - break; - } -} - - -/* - * fsm_rconfnakrej - Receive Configure-Nak or Configure-Reject. - */ -static void -fsm_rconfnakrej(f, code, id, inp, len) - fsm *f; - int code, id; - u_char *inp; - int len; -{ - int (*proc) __P((fsm *, u_char *, int)); - int ret; - - if (id != f->reqid || f->seen_ack) /* Expected id? */ - return; /* Nope, toss... */ - proc = (code == CONFNAK)? f->callbacks->nakci: f->callbacks->rejci; - if (!proc || !(ret = proc(f, inp, len))) { - /* Nak/reject is bad - ignore it */ - error("Received bad configure-nak/rej: %P", inp, len); - return; - } - f->seen_ack = 1; - - switch (f->state) { - case CLOSED: - case STOPPED: - fsm_sdata(f, TERMACK, id, NULL, 0); - break; - - case REQSENT: - case ACKSENT: - /* They didn't agree to what we wanted - try another request */ - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - if (ret < 0) - f->state = STOPPED; /* kludge for stopping CCP */ - else - fsm_sconfreq(f, 0); /* Send Configure-Request */ - break; - - case ACKRCVD: - /* Got a Nak/reject when we had already had an Ack?? oh well... */ - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - fsm_sconfreq(f, 0); - f->state = REQSENT; - break; - - case OPENED: - /* Go down and restart negotiation */ - if (f->callbacks->down) - (*f->callbacks->down)(f); /* Inform upper layers */ - fsm_sconfreq(f, 0); /* Send initial Configure-Request */ - f->state = REQSENT; - break; - } -} - - -/* - * fsm_rtermreq - Receive Terminate-Req. - */ -static void -fsm_rtermreq(f, id, p, len) - fsm *f; - int id; - u_char *p; - int len; -{ - switch (f->state) { - case ACKRCVD: - case ACKSENT: - f->state = REQSENT; /* Start over but keep trying */ - break; - - case OPENED: - if (len > 0) { - info("%s terminated by peer (%0.*v)", PROTO_NAME(f), len, p); - } else - info("%s terminated by peer", PROTO_NAME(f)); - if (f->callbacks->down) - (*f->callbacks->down)(f); /* Inform upper layers */ - f->retransmits = 0; - f->state = STOPPING; - TIMEOUT(fsm_timeout, f, f->timeouttime); - break; - } - - fsm_sdata(f, TERMACK, id, NULL, 0); -} - - -/* - * fsm_rtermack - Receive Terminate-Ack. - */ -static void -fsm_rtermack(f) - fsm *f; -{ - switch (f->state) { - case CLOSING: - UNTIMEOUT(fsm_timeout, f); - f->state = CLOSED; - if( f->callbacks->finished ) - (*f->callbacks->finished)(f); - break; - case STOPPING: - UNTIMEOUT(fsm_timeout, f); - f->state = STOPPED; - if( f->callbacks->finished ) - (*f->callbacks->finished)(f); - break; - - case ACKRCVD: - f->state = REQSENT; - break; - - case OPENED: - if (f->callbacks->down) - (*f->callbacks->down)(f); /* Inform upper layers */ - fsm_sconfreq(f, 0); - break; - } -} - - -/* - * fsm_rcoderej - Receive an Code-Reject. - */ -static void -fsm_rcoderej(f, inp, len) - fsm *f; - u_char *inp; - int len; -{ - u_char code, id; - - if (len < HEADERLEN) { - FSMDEBUG(("fsm_rcoderej: Rcvd short Code-Reject packet!")); - return; - } - GETCHAR(code, inp); - GETCHAR(id, inp); - warn("%s: Rcvd Code-Reject for code %d, id %d", PROTO_NAME(f), code, id); - - if( f->state == ACKRCVD ) - f->state = REQSENT; -} - - -/* - * fsm_protreject - Peer doesn't speak this protocol. - * - * Treat this as a catastrophic error (RXJ-). - */ -void -fsm_protreject(f) - fsm *f; -{ - switch( f->state ){ - case CLOSING: - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - /* fall through */ - case CLOSED: - f->state = CLOSED; - if( f->callbacks->finished ) - (*f->callbacks->finished)(f); - break; - - case STOPPING: - case REQSENT: - case ACKRCVD: - case ACKSENT: - UNTIMEOUT(fsm_timeout, f); /* Cancel timeout */ - /* fall through */ - case STOPPED: - f->state = STOPPED; - if( f->callbacks->finished ) - (*f->callbacks->finished)(f); - break; - - case OPENED: - if( f->callbacks->down ) - (*f->callbacks->down)(f); - - /* Init restart counter, send Terminate-Request */ - f->retransmits = f->maxtermtransmits; - fsm_sdata(f, TERMREQ, f->reqid = ++f->id, - (u_char *) f->term_reason, f->term_reason_len); - TIMEOUT(fsm_timeout, f, f->timeouttime); - --f->retransmits; - - f->state = STOPPING; - break; - - default: - FSMDEBUG(("%s: Protocol-reject event in state %d!", - PROTO_NAME(f), f->state)); - } -} - - -/* - * fsm_sconfreq - Send a Configure-Request. - */ -static void -fsm_sconfreq(f, retransmit) - fsm *f; - int retransmit; -{ - u_char *outp; - int cilen; - - if( f->state != REQSENT && f->state != ACKRCVD && f->state != ACKSENT ){ - /* Not currently negotiating - reset options */ - if( f->callbacks->resetci ) - (*f->callbacks->resetci)(f); - f->nakloops = 0; - } - - if( !retransmit ){ - /* New request - reset retransmission counter, use new ID */ - f->retransmits = f->maxconfreqtransmits; - f->reqid = ++f->id; - } - - f->seen_ack = 0; - - /* - * Make up the request packet - */ - outp = outpacket_buf + PPP_HDRLEN + HEADERLEN; - if( f->callbacks->cilen && f->callbacks->addci ){ - cilen = (*f->callbacks->cilen)(f); - if( cilen > peer_mru[f->unit] - HEADERLEN ) - cilen = peer_mru[f->unit] - HEADERLEN; - if (f->callbacks->addci) - (*f->callbacks->addci)(f, outp, &cilen); - } else - cilen = 0; - - /* send the request to our peer */ - fsm_sdata(f, CONFREQ, f->reqid, outp, cilen); - - /* start the retransmit timer */ - --f->retransmits; - TIMEOUT(fsm_timeout, f, f->timeouttime); -} - - -/* - * fsm_sdata - Send some data. - * - * Used for all packets sent to our peer by this module. - */ -void -fsm_sdata(f, code, id, data, datalen) - fsm *f; - u_char code, id; - u_char *data; - int datalen; -{ - u_char *outp; - int outlen; - - /* Adjust length to be smaller than MTU */ - outp = outpacket_buf; - if (datalen > peer_mru[f->unit] - HEADERLEN) - datalen = peer_mru[f->unit] - HEADERLEN; - if (datalen && data != outp + PPP_HDRLEN + HEADERLEN) - BCOPY(data, outp + PPP_HDRLEN + HEADERLEN, datalen); - outlen = datalen + HEADERLEN; - MAKEHEADER(outp, f->protocol); - PUTCHAR(code, outp); - PUTCHAR(id, outp); - PUTSHORT(outlen, outp); - output(f->unit, outpacket_buf, outlen + PPP_HDRLEN); -} diff --git a/cpukit/pppd/fsm.h b/cpukit/pppd/fsm.h deleted file mode 100644 index d1e623467c..0000000000 --- a/cpukit/pppd/fsm.h +++ /dev/null @@ -1,144 +0,0 @@ -/* - * fsm.h - {Link, IP} Control Protocol Finite State Machine definitions. - * - * Copyright (c) 1989 Carnegie Mellon University. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by Carnegie Mellon University. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * $Id$ - */ - -/* - * Packet header = Code, id, length. - */ -#define HEADERLEN 4 - - -/* - * CP (LCP, IPCP, etc.) codes. - */ -#define CONFREQ 1 /* Configuration Request */ -#define CONFACK 2 /* Configuration Ack */ -#define CONFNAK 3 /* Configuration Nak */ -#define CONFREJ 4 /* Configuration Reject */ -#define TERMREQ 5 /* Termination Request */ -#define TERMACK 6 /* Termination Ack */ -#define CODEREJ 7 /* Code Reject */ - - -/* - * Each FSM is described by an fsm structure and fsm callbacks. - */ -typedef struct fsm { - int unit; /* Interface unit number */ - int protocol; /* Data Link Layer Protocol field value */ - int state; /* State */ - int flags; /* Contains option bits */ - u_char id; /* Current id */ - u_char reqid; /* Current request id */ - u_char seen_ack; /* Have received valid Ack/Nak/Rej to Req */ - int timeouttime; /* Timeout time in milliseconds */ - int maxconfreqtransmits; /* Maximum Configure-Request transmissions */ - int retransmits; /* Number of retransmissions left */ - int maxtermtransmits; /* Maximum Terminate-Request transmissions */ - int nakloops; /* Number of nak loops since last ack */ - int maxnakloops; /* Maximum number of nak loops tolerated */ - struct fsm_callbacks *callbacks; /* Callback routines */ - char *term_reason; /* Reason for closing protocol */ - int term_reason_len; /* Length of term_reason */ -} fsm; - - -typedef struct fsm_callbacks { - void (*resetci) /* Reset our Configuration Information */ - __P((fsm *)); - int (*cilen) /* Length of our Configuration Information */ - __P((fsm *)); - void (*addci) /* Add our Configuration Information */ - __P((fsm *, u_char *, int *)); - int (*ackci) /* ACK our Configuration Information */ - __P((fsm *, u_char *, int)); - int (*nakci) /* NAK our Configuration Information */ - __P((fsm *, u_char *, int)); - int (*rejci) /* Reject our Configuration Information */ - __P((fsm *, u_char *, int)); - int (*reqci) /* Request peer's Configuration Information */ - __P((fsm *, u_char *, int *, int)); - void (*up) /* Called when fsm reaches OPENED state */ - __P((fsm *)); - void (*down) /* Called when fsm leaves OPENED state */ - __P((fsm *)); - void (*starting) /* Called when we want the lower layer */ - __P((fsm *)); - void (*finished) /* Called when we don't want the lower layer */ - __P((fsm *)); - void (*protreject) /* Called when Protocol-Reject received */ - __P((int)); - void (*retransmit) /* Retransmission is necessary */ - __P((fsm *)); - int (*extcode) /* Called when unknown code received */ - __P((fsm *, int, int, u_char *, int)); - char *proto_name; /* String name for protocol (for messages) */ -} fsm_callbacks; - - -/* - * Link states. - */ -#define INITIAL 0 /* Down, hasn't been opened */ -#define STARTING 1 /* Down, been opened */ -#define CLOSED 2 /* Up, hasn't been opened */ -#define STOPPED 3 /* Open, waiting for down event */ -#define CLOSING 4 /* Terminating the connection, not open */ -#define STOPPING 5 /* Terminating, but open */ -#define REQSENT 6 /* We've sent a Config Request */ -#define ACKRCVD 7 /* We've received a Config Ack */ -#define ACKSENT 8 /* We've sent a Config Ack */ -#define OPENED 9 /* Connection available */ - - -/* - * Flags - indicate options controlling FSM operation - */ -#define OPT_PASSIVE 1 /* Don't die if we don't get a response */ -#define OPT_RESTART 2 /* Treat 2nd OPEN as DOWN, UP */ -#define OPT_SILENT 4 /* Wait for peer to speak first */ - - -/* - * Timeouts. - */ -#define DEFTIMEOUT 5 /* Timeout time in seconds */ -#define DEFMAXTERMREQS 2 /* Maximum Terminate-Request transmissions */ -#define DEFMAXCONFREQS 10 /* Maximum Configure-Request transmissions */ -#define DEFMAXNAKLOOPS 5 /* Maximum number of nak loops */ - - -/* - * Prototypes - */ -void fsm_init __P((fsm *)); -void fsm_lowerup __P((fsm *)); -void fsm_lowerdown __P((fsm *)); -void fsm_open __P((fsm *)); -void fsm_close __P((fsm *, char *)); -void fsm_input __P((fsm *, u_char *, int)); -void fsm_protreject __P((fsm *)); -void fsm_sdata __P((fsm *, u_char, u_char, u_char *, int)); - - -/* - * Variables - */ -extern int peer_mru[]; /* currently negotiated peer MRU (per unit) */ diff --git a/cpukit/pppd/ipcp.c b/cpukit/pppd/ipcp.c deleted file mode 100644 index d11e7c653a..0000000000 --- a/cpukit/pppd/ipcp.c +++ /dev/null @@ -1,1769 +0,0 @@ -/* - * ipcp.c - PPP IP Control Protocol. - * - * Copyright (c) 1989 Carnegie Mellon University. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by Carnegie Mellon University. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#define RCSID "$Id$" - -/* - * TODO: - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "pppd.h" -#include "fsm.h" -#include "ipcp.h" -#include "pathnames.h" - -static const char rcsid[] = RCSID; - -/* global vars */ -ipcp_options ipcp_wantoptions[NUM_PPP]; /* Options that we want to request */ -ipcp_options ipcp_gotoptions[NUM_PPP]; /* Options that peer ack'd */ -ipcp_options ipcp_allowoptions[NUM_PPP]; /* Options we allow peer to request */ -ipcp_options ipcp_hisoptions[NUM_PPP]; /* Options that we ack'd */ - -bool disable_defaultip = 0; /* Don't use hostname for default IP adrs */ - -/* Hook for a plugin to know when IP protocol has come up */ -void (*ip_up_hook) __P((void)) = NULL; - -/* Hook for a plugin to know when IP protocol has come down */ -void (*ip_down_hook) __P((void)) = NULL; - -/* local vars */ -static int default_route_set[NUM_PPP]; /* Have set up a default route */ -static int proxy_arp_set[NUM_PPP]; /* Have created proxy arp entry */ -static bool usepeerdns; /* Ask peer for DNS addrs */ -static int ipcp_is_up; /* have called np_up() */ - -/* - * Callbacks for fsm code. (CI = Configuration Information) - */ -static void ipcp_resetci __P((fsm *)); /* Reset our CI */ -static int ipcp_cilen __P((fsm *)); /* Return length of our CI */ -static void ipcp_addci __P((fsm *, u_char *, int *)); /* Add our CI */ -static int ipcp_ackci __P((fsm *, u_char *, int)); /* Peer ack'd our CI */ -static int ipcp_nakci __P((fsm *, u_char *, int)); /* Peer nak'd our CI */ -static int ipcp_rejci __P((fsm *, u_char *, int)); /* Peer rej'd our CI */ -static int ipcp_reqci __P((fsm *, u_char *, int *, int)); /* Rcv CI */ -static void ipcp_up __P((fsm *)); /* We're UP */ -static void ipcp_down __P((fsm *)); /* We're DOWN */ -static void ipcp_finished __P((fsm *)); /* Don't need lower layer */ - -fsm ipcp_fsm[NUM_PPP]; /* IPCP fsm structure */ - -static fsm_callbacks ipcp_callbacks = { /* IPCP callback routines */ - ipcp_resetci, /* Reset our Configuration Information */ - ipcp_cilen, /* Length of our Configuration Information */ - ipcp_addci, /* Add our Configuration Information */ - ipcp_ackci, /* ACK our Configuration Information */ - ipcp_nakci, /* NAK our Configuration Information */ - ipcp_rejci, /* Reject our Configuration Information */ - ipcp_reqci, /* Request peer's Configuration Information */ - ipcp_up, /* Called when fsm reaches OPENED state */ - ipcp_down, /* Called when fsm leaves OPENED state */ - NULL, /* Called when we want the lower layer up */ - ipcp_finished, /* Called when we want the lower layer down */ - NULL, /* Called when Protocol-Reject received */ - NULL, /* Retransmission is necessary */ - NULL, /* Called to handle protocol-specific codes */ - "IPCP" /* String name of protocol */ -}; - -/* - * Command-line options. - */ -static int setvjslots __P((char **)); -static int setdnsaddr __P((char **)); -static int setwinsaddr __P((char **)); - -static option_t ipcp_option_list[] = { - { "noip", o_bool, &ipcp_protent.enabled_flag, - "Disable IP and IPCP" }, - { "-ip", o_bool, &ipcp_protent.enabled_flag, - "Disable IP and IPCP" }, - { "novj", o_bool, &ipcp_wantoptions[0].neg_vj, - "Disable VJ compression", OPT_A2COPY, &ipcp_allowoptions[0].neg_vj }, - { "-vj", o_bool, &ipcp_wantoptions[0].neg_vj, - "Disable VJ compression", OPT_A2COPY, &ipcp_allowoptions[0].neg_vj }, - { "novjccomp", o_bool, &ipcp_wantoptions[0].cflag, - "Disable VJ connection-ID compression", OPT_A2COPY, - &ipcp_allowoptions[0].cflag }, - { "-vjccomp", o_bool, &ipcp_wantoptions[0].cflag, - "Disable VJ connection-ID compression", OPT_A2COPY, - &ipcp_allowoptions[0].cflag }, - { "vj-max-slots", 1, setvjslots, - "Set maximum VJ header slots" }, - { "ipcp-accept-local", o_bool, &ipcp_wantoptions[0].accept_local, - "Accept peer's address for us", 1 }, - { "ipcp-accept-remote", o_bool, &ipcp_wantoptions[0].accept_remote, - "Accept peer's address for it", 1 }, - { "ipparam", o_string, &ipparam, - "Set ip script parameter" }, - { "noipdefault", o_bool, &disable_defaultip, - "Don't use name for default IP adrs", 1 }, - { "ms-dns", 1, setdnsaddr, - "DNS address for the peer's use" }, - { "ms-wins", 1, setwinsaddr, - "Nameserver for SMB over TCP/IP for peer" }, - { "ipcp-restart", o_int, &ipcp_fsm[0].timeouttime, - "Set timeout for IPCP" }, - { "ipcp-max-terminate", o_int, &ipcp_fsm[0].maxtermtransmits, - "Set max #xmits for term-reqs" }, - { "ipcp-max-configure", o_int, &ipcp_fsm[0].maxconfreqtransmits, - "Set max #xmits for conf-reqs" }, - { "ipcp-max-failure", o_int, &ipcp_fsm[0].maxnakloops, - "Set max #conf-naks for IPCP" }, - { "defaultroute", o_bool, &ipcp_wantoptions[0].default_route, - "Add default route", OPT_ENABLE|1, &ipcp_allowoptions[0].default_route }, - { "nodefaultroute", o_bool, &ipcp_allowoptions[0].default_route, - "disable defaultroute option", OPT_A2COPY, - &ipcp_wantoptions[0].default_route }, - { "-defaultroute", o_bool, &ipcp_allowoptions[0].default_route, - "disable defaultroute option", OPT_A2COPY, - &ipcp_wantoptions[0].default_route }, - { "proxyarp", o_bool, &ipcp_wantoptions[0].proxy_arp, - "Add proxy ARP entry", OPT_ENABLE|1, &ipcp_allowoptions[0].proxy_arp }, - { "noproxyarp", o_bool, &ipcp_allowoptions[0].proxy_arp, - "disable proxyarp option", OPT_A2COPY, - &ipcp_wantoptions[0].proxy_arp }, - { "-proxyarp", o_bool, &ipcp_allowoptions[0].proxy_arp, - "disable proxyarp option", OPT_A2COPY, - &ipcp_wantoptions[0].proxy_arp }, - { "usepeerdns", o_bool, &usepeerdns, - "Ask peer for DNS address(es)", 1 }, - { NULL } -}; - -/* - * Protocol entry points from main code. - */ -static void ipcp_init __P((int)); -static void ipcp_open __P((int)); -static void ipcp_close __P((int, char *)); -static void ipcp_lowerup __P((int)); -static void ipcp_lowerdown __P((int)); -static void ipcp_input __P((int, u_char *, int)); -static void ipcp_protrej __P((int)); -static int ipcp_printpkt __P((u_char *, int, - void (*) __P((void *, char *, ...)), void *)); -static void ip_check_options __P((void)); -static int ip_demand_conf __P((int)); -static int ip_active_pkt __P((u_char *, int)); -static void create_resolv __P((u_int32_t, u_int32_t)); - -struct protent ipcp_protent = { - PPP_IPCP, - ipcp_init, - ipcp_input, - ipcp_protrej, - ipcp_lowerup, - ipcp_lowerdown, - ipcp_open, - ipcp_close, - ipcp_printpkt, - NULL, - 1, - "IPCP", - "IP", - ipcp_option_list, - ip_check_options, - ip_demand_conf, - ip_active_pkt -}; - -static void ipcp_clear_addrs __P((int, u_int32_t, u_int32_t)); - -/* - * Lengths of configuration options. - */ -#define CILEN_VOID 2 -#define CILEN_COMPRESS 4 /* min length for compression protocol opt. */ -#define CILEN_VJ 6 /* length for RFC1332 Van-Jacobson opt. */ -#define CILEN_ADDR 6 /* new-style single address option */ -#define CILEN_ADDRS 10 /* old-style dual address option */ - - -#define CODENAME(x) ((x) == CONFACK ? "ACK" : \ - (x) == CONFNAK ? "NAK" : "REJ") - -/* - * Make a string representation of a network IP address. - */ -char * -ip_ntoa(ipaddr) -u_int32_t ipaddr; -{ - static char b[64]; - - slprintf(b, sizeof(b), "%I", ipaddr); - return b; -} - -/* - * Option parsing. - */ - -/* - * setvjslots - set maximum number of connection slots for VJ compression - */ -static int -setvjslots(argv) - char **argv; -{ - int value; - - if (!int_option(*argv, &value)) - return 0; - if (value < 2 || value > 16) { - option_error("vj-max-slots value must be between 2 and 16"); - return 0; - } - ipcp_wantoptions [0].maxslotindex = - ipcp_allowoptions[0].maxslotindex = value - 1; - return 1; -} - -/* - * setdnsaddr - set the dns address(es) - */ -static int -setdnsaddr(argv) - char **argv; -{ - u_int32_t dns; - struct hostent *hp; - - dns = inet_addr(*argv); - if (dns == (u_int32_t) -1) { - if ((hp = gethostbyname(*argv)) == NULL) { - option_error("invalid address parameter '%s' for ms-dns option", - *argv); - return 0; - } - dns = *(u_int32_t *)hp->h_addr; - } - - /* if there is no primary then update it. */ - if (ipcp_allowoptions[0].dnsaddr[0] == 0) - ipcp_allowoptions[0].dnsaddr[0] = dns; - - /* always set the secondary address value to the same value. */ - ipcp_allowoptions[0].dnsaddr[1] = dns; - - return (1); -} - -/* - * setwinsaddr - set the wins address(es) - * This is primrarly used with the Samba package under UNIX or for pointing - * the caller to the existing WINS server on a Windows NT platform. - */ -static int -setwinsaddr(argv) - char **argv; -{ - u_int32_t wins; - struct hostent *hp; - - wins = inet_addr(*argv); - if (wins == (u_int32_t) -1) { - if ((hp = gethostbyname(*argv)) == NULL) { - option_error("invalid address parameter '%s' for ms-wins option", - *argv); - return 0; - } - wins = *(u_int32_t *)hp->h_addr; - } - - /* if there is no primary then update it. */ - if (ipcp_allowoptions[0].winsaddr[0] == 0) - ipcp_allowoptions[0].winsaddr[0] = wins; - - /* always set the secondary address value to the same value. */ - ipcp_allowoptions[0].winsaddr[1] = wins; - - return (1); -} - - -/* - * ipcp_init - Initialize IPCP. - */ -static void -ipcp_init(unit) - int unit; -{ - fsm *f = &ipcp_fsm[unit]; - ipcp_options *wo = &ipcp_wantoptions[unit]; - ipcp_options *ao = &ipcp_allowoptions[unit]; - - f->unit = unit; - f->protocol = PPP_IPCP; - f->callbacks = &ipcp_callbacks; - fsm_init(&ipcp_fsm[unit]); - - memset(wo, 0, sizeof(*wo)); - memset(ao, 0, sizeof(*ao)); - - wo->neg_addr = 1; - wo->neg_vj = 1; - wo->vj_protocol = IPCP_VJ_COMP; - wo->maxslotindex = MAX_STATES - 1; /* really max index */ - wo->cflag = 1; - - /* max slots and slot-id compression are currently hardwired in */ - /* ppp_if.c to 16 and 1, this needs to be changed (among other */ - /* things) gmc */ - - ao->neg_addr = 1; - ao->neg_vj = 1; - ao->maxslotindex = MAX_STATES - 1; - ao->cflag = 1; - - /* - * XXX These control whether the user may use the proxyarp - * and defaultroute options. - */ - ao->proxy_arp = 1; - ao->default_route = 1; -} - - -/* - * ipcp_open - IPCP is allowed to come up. - */ -static void -ipcp_open(unit) - int unit; -{ - fsm_open(&ipcp_fsm[unit]); -} - - -/* - * ipcp_close - Take IPCP down. - */ -static void -ipcp_close(unit, reason) - int unit; - char *reason; -{ - fsm_close(&ipcp_fsm[unit], reason); -} - - -/* - * ipcp_lowerup - The lower layer is up. - */ -static void -ipcp_lowerup(unit) - int unit; -{ - fsm_lowerup(&ipcp_fsm[unit]); -} - - -/* - * ipcp_lowerdown - The lower layer is down. - */ -static void -ipcp_lowerdown(unit) - int unit; -{ - fsm_lowerdown(&ipcp_fsm[unit]); -} - - -/* - * ipcp_input - Input IPCP packet. - */ -static void -ipcp_input(unit, p, len) - int unit; - u_char *p; - int len; -{ - fsm_input(&ipcp_fsm[unit], p, len); -} - - -/* - * ipcp_protrej - A Protocol-Reject was received for IPCP. - * - * Pretend the lower layer went down, so we shut up. - */ -static void -ipcp_protrej(unit) - int unit; -{ - fsm_lowerdown(&ipcp_fsm[unit]); -} - - -/* - * ipcp_resetci - Reset our CI. - * Called by fsm_sconfreq, Send Configure Request. - */ -static void -ipcp_resetci(f) - fsm *f; -{ - ipcp_options *wo = &ipcp_wantoptions[f->unit]; - ipcp_options *go = &ipcp_gotoptions[f->unit]; - - wo->req_addr = wo->neg_addr && ipcp_allowoptions[f->unit].neg_addr; - if (wo->ouraddr == 0 || disable_defaultip) - wo->accept_local = 1; - if (wo->hisaddr == 0) - wo->accept_remote = 1; - wo->req_dns1 = usepeerdns; /* Request DNS addresses from the peer */ - wo->req_dns2 = usepeerdns; - *go = *wo; - if (disable_defaultip) - go->ouraddr = 0; -} - - -/* - * ipcp_cilen - Return length of our CI. - * Called by fsm_sconfreq, Send Configure Request. - */ -static int -ipcp_cilen(f) - fsm *f; -{ - ipcp_options *go = &ipcp_gotoptions[f->unit]; - ipcp_options *wo = &ipcp_wantoptions[f->unit]; - ipcp_options *ho = &ipcp_hisoptions[f->unit]; - -#define LENCIVJ(neg, old) (neg ? (old? CILEN_COMPRESS : CILEN_VJ) : 0) -#define LENCIADDR(neg, old) (neg ? (old? CILEN_ADDRS : CILEN_ADDR) : 0) -#define LENCIDNS(neg) (neg ? (CILEN_ADDR) : 0) - - /* - * First see if we want to change our options to the old - * forms because we have received old forms from the peer. - */ - if (wo->neg_addr && !go->neg_addr && !go->old_addrs) { - /* use the old style of address negotiation */ - go->neg_addr = 1; - go->old_addrs = 1; - } - if (wo->neg_vj && !go->neg_vj && !go->old_vj) { - /* try an older style of VJ negotiation */ - /* use the old style only if the peer did */ - if (ho->neg_vj && ho->old_vj) { - go->neg_vj = 1; - go->old_vj = 1; - go->vj_protocol = ho->vj_protocol; - } - } - - return (LENCIADDR(go->neg_addr, go->old_addrs) + - LENCIVJ(go->neg_vj, go->old_vj) + - LENCIDNS(go->req_dns1) + - LENCIDNS(go->req_dns2)) ; -} - - -/* - * ipcp_addci - Add our desired CIs to a packet. - * Called by fsm_sconfreq, Send Configure Request. - */ -static void -ipcp_addci(f, ucp, lenp) - fsm *f; - u_char *ucp; - int *lenp; -{ - ipcp_options *go = &ipcp_gotoptions[f->unit]; - int len = *lenp; - -#define ADDCIVJ(opt, neg, val, old, maxslotindex, cflag) \ - if (neg) { \ - int vjlen = old? CILEN_COMPRESS : CILEN_VJ; \ - if (len >= vjlen) { \ - PUTCHAR(opt, ucp); \ - PUTCHAR(vjlen, ucp); \ - PUTSHORT(val, ucp); \ - if (!old) { \ - PUTCHAR(maxslotindex, ucp); \ - PUTCHAR(cflag, ucp); \ - } \ - len -= vjlen; \ - } else \ - neg = 0; \ - } - -#define ADDCIADDR(opt, neg, old, val1, val2) \ - if (neg) { \ - int addrlen = (old? CILEN_ADDRS: CILEN_ADDR); \ - if (len >= addrlen) { \ - u_int32_t l; \ - PUTCHAR(opt, ucp); \ - PUTCHAR(addrlen, ucp); \ - l = ntohl(val1); \ - PUTLONG(l, ucp); \ - if (old) { \ - l = ntohl(val2); \ - PUTLONG(l, ucp); \ - } \ - len -= addrlen; \ - } else \ - neg = 0; \ - } - -#define ADDCIDNS(opt, neg, addr) \ - if (neg) { \ - if (len >= CILEN_ADDR) { \ - u_int32_t l; \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_ADDR, ucp); \ - l = ntohl(addr); \ - PUTLONG(l, ucp); \ - len -= CILEN_ADDR; \ - } else \ - neg = 0; \ - } - - ADDCIADDR((go->old_addrs? CI_ADDRS: CI_ADDR), go->neg_addr, - go->old_addrs, go->ouraddr, go->hisaddr); - - ADDCIVJ(CI_COMPRESSTYPE, go->neg_vj, go->vj_protocol, go->old_vj, - go->maxslotindex, go->cflag); - - ADDCIDNS(CI_MS_DNS1, go->req_dns1, go->dnsaddr[0]); - - ADDCIDNS(CI_MS_DNS2, go->req_dns2, go->dnsaddr[1]); - - *lenp -= len; -} - - -/* - * ipcp_ackci - Ack our CIs. - * Called by fsm_rconfack, Receive Configure ACK. - * - * Returns: - * 0 - Ack was bad. - * 1 - Ack was good. - */ -static int -ipcp_ackci(f, p, len) - fsm *f; - u_char *p; - int len; -{ - ipcp_options *go = &ipcp_gotoptions[f->unit]; - u_short cilen, citype, cishort; - u_int32_t cilong; - u_char cimaxslotindex, cicflag; - - /* - * CIs must be in exactly the same order that we sent... - * Check packet length and CI length at each step. - * If we find any deviations, then this packet is bad. - */ - -#define ACKCIVJ(opt, neg, val, old, maxslotindex, cflag) \ - if (neg) { \ - int vjlen = old? CILEN_COMPRESS : CILEN_VJ; \ - if ((len -= vjlen) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != vjlen || \ - citype != opt) \ - goto bad; \ - GETSHORT(cishort, p); \ - if (cishort != val) \ - goto bad; \ - if (!old) { \ - GETCHAR(cimaxslotindex, p); \ - if (cimaxslotindex != maxslotindex) \ - goto bad; \ - GETCHAR(cicflag, p); \ - if (cicflag != cflag) \ - goto bad; \ - } \ - } - -#define ACKCIADDR(opt, neg, old, val1, val2) \ - if (neg) { \ - int addrlen = (old? CILEN_ADDRS: CILEN_ADDR); \ - u_int32_t l; \ - if ((len -= addrlen) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != addrlen || \ - citype != opt) \ - goto bad; \ - GETLONG(l, p); \ - cilong = htonl(l); \ - if (val1 != cilong) \ - goto bad; \ - if (old) { \ - GETLONG(l, p); \ - cilong = htonl(l); \ - if (val2 != cilong) \ - goto bad; \ - } \ - } - -#define ACKCIDNS(opt, neg, addr) \ - if (neg) { \ - u_int32_t l; \ - if ((len -= CILEN_ADDR) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_ADDR || citype != opt) \ - goto bad; \ - GETLONG(l, p); \ - cilong = htonl(l); \ - if (addr != cilong) \ - goto bad; \ - } - - ACKCIADDR((go->old_addrs? CI_ADDRS: CI_ADDR), go->neg_addr, - go->old_addrs, go->ouraddr, go->hisaddr); - - ACKCIVJ(CI_COMPRESSTYPE, go->neg_vj, go->vj_protocol, go->old_vj, - go->maxslotindex, go->cflag); - - ACKCIDNS(CI_MS_DNS1, go->req_dns1, go->dnsaddr[0]); - - ACKCIDNS(CI_MS_DNS2, go->req_dns2, go->dnsaddr[1]); - - /* - * If there are any remaining CIs, then this packet is bad. - */ - if (len != 0) - goto bad; - return (1); - -bad: - IPCPDEBUG(("ipcp_ackci: received bad Ack!")); - return (0); -} - -/* - * ipcp_nakci - Peer has sent a NAK for some of our CIs. - * This should not modify any state if the Nak is bad - * or if IPCP is in the OPENED state. - * Calback from fsm_rconfnakrej - Receive Configure-Nak or Configure-Reject. - * - * Returns: - * 0 - Nak was bad. - * 1 - Nak was good. - */ -static int -ipcp_nakci(f, p, len) - fsm *f; - u_char *p; - int len; -{ - ipcp_options *go = &ipcp_gotoptions[f->unit]; - u_char cimaxslotindex, cicflag; - u_char citype, cilen, *next; - u_short cishort; - u_int32_t ciaddr1, ciaddr2, l, cidnsaddr; - ipcp_options no; /* options we've seen Naks for */ - ipcp_options try; /* options to request next time */ - - BZERO(&no, sizeof(no)); - try = *go; - - /* - * Any Nak'd CIs must be in exactly the same order that we sent. - * Check packet length and CI length at each step. - * If we find any deviations, then this packet is bad. - */ -#define NAKCIADDR(opt, neg, old, code) \ - if (go->neg && \ - len >= (cilen = (old? CILEN_ADDRS: CILEN_ADDR)) && \ - p[1] == cilen && \ - p[0] == opt) { \ - len -= cilen; \ - INCPTR(2, p); \ - GETLONG(l, p); \ - ciaddr1 = htonl(l); \ - if (old) { \ - GETLONG(l, p); \ - ciaddr2 = htonl(l); \ - no.old_addrs = 1; \ - } else \ - ciaddr2 = 0; \ - no.neg = 1; \ - code \ - } - -#define NAKCIVJ(opt, neg, code) \ - if (go->neg && \ - ((cilen = p[1]) == CILEN_COMPRESS || cilen == CILEN_VJ) && \ - len >= cilen && \ - p[0] == opt) { \ - len -= cilen; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - no.neg = 1; \ - code \ - } - -#define NAKCIDNS(opt, neg, code) \ - if (go->neg && \ - ((cilen = p[1]) == CILEN_ADDR) && \ - len >= cilen && \ - p[0] == opt) { \ - len -= cilen; \ - INCPTR(2, p); \ - GETLONG(l, p); \ - cidnsaddr = htonl(l); \ - no.neg = 1; \ - code \ - } - - /* - * Accept the peer's idea of {our,his} address, if different - * from our idea, only if the accept_{local,remote} flag is set. - */ - NAKCIADDR((go->old_addrs? CI_ADDRS: CI_ADDR), neg_addr, go->old_addrs, - if (go->accept_local && ciaddr1) { /* Do we know our address? */ - try.ouraddr = ciaddr1; - } - if (go->accept_remote && ciaddr2) { /* Does he know his? */ - try.hisaddr = ciaddr2; - } - ); - - /* - * Accept the peer's value of maxslotindex provided that it - * is less than what we asked for. Turn off slot-ID compression - * if the peer wants. Send old-style compress-type option if - * the peer wants. - */ - NAKCIVJ(CI_COMPRESSTYPE, neg_vj, - if (cilen == CILEN_VJ) { - GETCHAR(cimaxslotindex, p); - GETCHAR(cicflag, p); - if (cishort == IPCP_VJ_COMP) { - try.old_vj = 0; - if (cimaxslotindex < go->maxslotindex) - try.maxslotindex = cimaxslotindex; - if (!cicflag) - try.cflag = 0; - } else { - try.neg_vj = 0; - } - } else { - if (cishort == IPCP_VJ_COMP || cishort == IPCP_VJ_COMP_OLD) { - try.old_vj = 1; - try.vj_protocol = cishort; - } else { - try.neg_vj = 0; - } - } - ); - - NAKCIDNS(CI_MS_DNS1, req_dns1, - try.dnsaddr[0] = cidnsaddr; - ); - - NAKCIDNS(CI_MS_DNS2, req_dns2, - try.dnsaddr[1] = cidnsaddr; - ); - - /* - * There may be remaining CIs, if the peer is requesting negotiation - * on an option that we didn't include in our request packet. - * If they want to negotiate about IP addresses, we comply. - * If they want us to ask for compression, we refuse. - */ - while (len > CILEN_VOID) { - GETCHAR(citype, p); - GETCHAR(cilen, p); - if( (len -= cilen) < 0 ) - goto bad; - next = p + cilen - 2; - - switch (citype) { - case CI_COMPRESSTYPE: - if (go->neg_vj || no.neg_vj || - (cilen != CILEN_VJ && cilen != CILEN_COMPRESS)) - goto bad; - no.neg_vj = 1; - break; - case CI_ADDRS: - if ((go->neg_addr && go->old_addrs) || no.old_addrs - || cilen != CILEN_ADDRS) - goto bad; - try.neg_addr = 1; - try.old_addrs = 1; - GETLONG(l, p); - ciaddr1 = htonl(l); - if (ciaddr1 && go->accept_local) - try.ouraddr = ciaddr1; - GETLONG(l, p); - ciaddr2 = htonl(l); - if (ciaddr2 && go->accept_remote) - try.hisaddr = ciaddr2; - no.old_addrs = 1; - break; - case CI_ADDR: - if (go->neg_addr || no.neg_addr || cilen != CILEN_ADDR) - goto bad; - try.old_addrs = 0; - GETLONG(l, p); - ciaddr1 = htonl(l); - if (ciaddr1 && go->accept_local) - try.ouraddr = ciaddr1; - if (try.ouraddr != 0) - try.neg_addr = 1; - no.neg_addr = 1; - break; - } - p = next; - } - - /* - * OK, the Nak is good. Now we can update state. - * If there are any remaining options, we ignore them. - */ - if (f->state != OPENED) - *go = try; - - return 1; - -bad: - IPCPDEBUG(("ipcp_nakci: received bad Nak!")); - return 0; -} - - -/* - * ipcp_rejci - Reject some of our CIs. - * Callback from fsm_rconfnakrej. - */ -static int -ipcp_rejci(f, p, len) - fsm *f; - u_char *p; - int len; -{ - ipcp_options *go = &ipcp_gotoptions[f->unit]; - u_char cimaxslotindex, ciflag, cilen; - u_short cishort; - u_int32_t cilong; - ipcp_options try; /* options to request next time */ - - try = *go; - /* - * Any Rejected CIs must be in exactly the same order that we sent. - * Check packet length and CI length at each step. - * If we find any deviations, then this packet is bad. - */ -#define REJCIADDR(opt, neg, old, val1, val2) \ - if (go->neg && \ - len >= (cilen = old? CILEN_ADDRS: CILEN_ADDR) && \ - p[1] == cilen && \ - p[0] == opt) { \ - u_int32_t l; \ - len -= cilen; \ - INCPTR(2, p); \ - GETLONG(l, p); \ - cilong = htonl(l); \ - /* Check rejected value. */ \ - if (cilong != val1) \ - goto bad; \ - if (old) { \ - GETLONG(l, p); \ - cilong = htonl(l); \ - /* Check rejected value. */ \ - if (cilong != val2) \ - goto bad; \ - } \ - try.neg = 0; \ - } - -#define REJCIVJ(opt, neg, val, old, maxslot, cflag) \ - if (go->neg && \ - p[1] == (old? CILEN_COMPRESS : CILEN_VJ) && \ - len >= p[1] && \ - p[0] == opt) { \ - len -= p[1]; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - /* Check rejected value. */ \ - if (cishort != val) \ - goto bad; \ - if (!old) { \ - GETCHAR(cimaxslotindex, p); \ - if (cimaxslotindex != maxslot) \ - goto bad; \ - GETCHAR(ciflag, p); \ - if (ciflag != cflag) \ - goto bad; \ - } \ - try.neg = 0; \ - } - -#define REJCIDNS(opt, neg, dnsaddr) \ - if (go->neg && \ - ((cilen = p[1]) == CILEN_ADDR) && \ - len >= cilen && \ - p[0] == opt) { \ - u_int32_t l; \ - len -= cilen; \ - INCPTR(2, p); \ - GETLONG(l, p); \ - cilong = htonl(l); \ - /* Check rejected value. */ \ - if (cilong != dnsaddr) \ - goto bad; \ - try.neg = 0; \ - } - - - REJCIADDR((go->old_addrs? CI_ADDRS: CI_ADDR), neg_addr, - go->old_addrs, go->ouraddr, go->hisaddr); - - REJCIVJ(CI_COMPRESSTYPE, neg_vj, go->vj_protocol, go->old_vj, - go->maxslotindex, go->cflag); - - REJCIDNS(CI_MS_DNS1, req_dns1, go->dnsaddr[0]); - - REJCIDNS(CI_MS_DNS2, req_dns2, go->dnsaddr[1]); - - /* - * If there are any remaining CIs, then this packet is bad. - */ - if (len != 0) - goto bad; - /* - * Now we can update state. - */ - if (f->state != OPENED) - *go = try; - return 1; - -bad: - IPCPDEBUG(("ipcp_rejci: received bad Reject!")); - return 0; -} - - -/* - * ipcp_reqci - Check the peer's requested CIs and send appropriate response. - * Callback from fsm_rconfreq, Receive Configure Request - * - * Returns: CONFACK, CONFNAK or CONFREJ and input packet modified - * appropriately. If reject_if_disagree is non-zero, doesn't return - * CONFNAK; returns CONFREJ if it can't return CONFACK. - */ -static int -ipcp_reqci(f, inp, len, reject_if_disagree) - fsm *f; - u_char *inp; /* Requested CIs */ - int *len; /* Length of requested CIs */ - int reject_if_disagree; -{ - ipcp_options *wo = &ipcp_wantoptions[f->unit]; - ipcp_options *ho = &ipcp_hisoptions[f->unit]; - ipcp_options *ao = &ipcp_allowoptions[f->unit]; - ipcp_options *go = &ipcp_gotoptions[f->unit]; - u_char *cip, *next; /* Pointer to current and next CIs */ - u_short cilen, citype; /* Parsed len, type */ - u_short cishort; /* Parsed short value */ - u_int32_t tl, ciaddr1, ciaddr2;/* Parsed address values */ - int rc = CONFACK; /* Final packet return code */ - int orc; /* Individual option return code */ - u_char *p; /* Pointer to next char to parse */ - u_char *ucp = inp; /* Pointer to current output char */ - int l = *len; /* Length left */ - u_char maxslotindex, cflag; - int d; - - /* - * Reset all his options. - */ - BZERO(ho, sizeof(*ho)); - - /* - * Process all his options. - */ - next = inp; - while (l) { - orc = CONFACK; /* Assume success */ - cip = p = next; /* Remember begining of CI */ - if (l < 2 || /* Not enough data for CI header or */ - p[1] < 2 || /* CI length too small or */ - p[1] > l) { /* CI length too big? */ - IPCPDEBUG(("ipcp_reqci: bad CI length!")); - orc = CONFREJ; /* Reject bad CI */ - cilen = l; /* Reject till end of packet */ - l = 0; /* Don't loop again */ - goto endswitch; - } - GETCHAR(citype, p); /* Parse CI type */ - GETCHAR(cilen, p); /* Parse CI length */ - l -= cilen; /* Adjust remaining length */ - next += cilen; /* Step to next CI */ - - switch (citype) { /* Check CI type */ - case CI_ADDRS: - if (!ao->neg_addr || - cilen != CILEN_ADDRS) { /* Check CI length */ - orc = CONFREJ; /* Reject CI */ - break; - } - - /* - * If he has no address, or if we both have his address but - * disagree about it, then NAK it with our idea. - * In particular, if we don't know his address, but he does, - * then accept it. - */ - GETLONG(tl, p); /* Parse source address (his) */ - ciaddr1 = htonl(tl); - if (ciaddr1 != wo->hisaddr - && (ciaddr1 == 0 || !wo->accept_remote)) { - orc = CONFNAK; - if (!reject_if_disagree) { - DECPTR(sizeof(u_int32_t), p); - tl = ntohl(wo->hisaddr); - PUTLONG(tl, p); - } - } else if (ciaddr1 == 0 && wo->hisaddr == 0) { - /* - * If neither we nor he knows his address, reject the option. - */ - orc = CONFREJ; - wo->req_addr = 0; /* don't NAK with 0.0.0.0 later */ - break; - } - - /* - * If he doesn't know our address, or if we both have our address - * but disagree about it, then NAK it with our idea. - */ - GETLONG(tl, p); /* Parse desination address (ours) */ - ciaddr2 = htonl(tl); - if (ciaddr2 != wo->ouraddr) { - if (ciaddr2 == 0 || !wo->accept_local) { - orc = CONFNAK; - if (!reject_if_disagree) { - DECPTR(sizeof(u_int32_t), p); - tl = ntohl(wo->ouraddr); - PUTLONG(tl, p); - } - } else { - go->ouraddr = ciaddr2; /* accept peer's idea */ - } - } - - ho->neg_addr = 1; - ho->old_addrs = 1; - ho->hisaddr = ciaddr1; - ho->ouraddr = ciaddr2; - break; - - case CI_ADDR: - if (!ao->neg_addr || - cilen != CILEN_ADDR) { /* Check CI length */ - orc = CONFREJ; /* Reject CI */ - break; - } - - /* - * If he has no address, or if we both have his address but - * disagree about it, then NAK it with our idea. - * In particular, if we don't know his address, but he does, - * then accept it. - */ - GETLONG(tl, p); /* Parse source address (his) */ - ciaddr1 = htonl(tl); - if (ciaddr1 != wo->hisaddr - && (ciaddr1 == 0 || !wo->accept_remote)) { - orc = CONFNAK; - if (!reject_if_disagree) { - DECPTR(sizeof(u_int32_t), p); - tl = ntohl(wo->hisaddr); - PUTLONG(tl, p); - } - } else if (ciaddr1 == 0 && wo->hisaddr == 0) { - /* - * Don't ACK an address of 0.0.0.0 - reject it instead. - */ - orc = CONFREJ; - wo->req_addr = 0; /* don't NAK with 0.0.0.0 later */ - break; - } - - ho->neg_addr = 1; - ho->hisaddr = ciaddr1; - break; - - case CI_MS_DNS1: - case CI_MS_DNS2: - /* Microsoft primary or secondary DNS request */ - d = citype == CI_MS_DNS2; - - /* If we do not have a DNS address then we cannot send it */ - if (ao->dnsaddr[d] == 0 || - cilen != CILEN_ADDR) { /* Check CI length */ - orc = CONFREJ; /* Reject CI */ - break; - } - GETLONG(tl, p); - if (htonl(tl) != ao->dnsaddr[d]) { - DECPTR(sizeof(u_int32_t), p); - tl = ntohl(ao->dnsaddr[d]); - PUTLONG(tl, p); - orc = CONFNAK; - } - break; - - case CI_MS_WINS1: - case CI_MS_WINS2: - /* Microsoft primary or secondary WINS request */ - d = citype == CI_MS_WINS2; - - /* If we do not have a DNS address then we cannot send it */ - if (ao->winsaddr[d] == 0 || - cilen != CILEN_ADDR) { /* Check CI length */ - orc = CONFREJ; /* Reject CI */ - break; - } - GETLONG(tl, p); - if (htonl(tl) != ao->winsaddr[d]) { - DECPTR(sizeof(u_int32_t), p); - tl = ntohl(ao->winsaddr[d]); - PUTLONG(tl, p); - orc = CONFNAK; - } - break; - - case CI_COMPRESSTYPE: - if (!ao->neg_vj || - (cilen != CILEN_VJ && cilen != CILEN_COMPRESS)) { - orc = CONFREJ; - break; - } - GETSHORT(cishort, p); - - if (!(cishort == IPCP_VJ_COMP || - (cishort == IPCP_VJ_COMP_OLD && cilen == CILEN_COMPRESS))) { - orc = CONFREJ; - break; - } - - ho->neg_vj = 1; - ho->vj_protocol = cishort; - if (cilen == CILEN_VJ) { - GETCHAR(maxslotindex, p); - if (maxslotindex > ao->maxslotindex) { - orc = CONFNAK; - if (!reject_if_disagree){ - DECPTR(1, p); - PUTCHAR(ao->maxslotindex, p); - } - } - GETCHAR(cflag, p); - if (cflag && !ao->cflag) { - orc = CONFNAK; - if (!reject_if_disagree){ - DECPTR(1, p); - PUTCHAR(wo->cflag, p); - } - } - ho->maxslotindex = maxslotindex; - ho->cflag = cflag; - } else { - ho->old_vj = 1; - ho->maxslotindex = MAX_STATES - 1; - ho->cflag = 1; - } - break; - - default: - orc = CONFREJ; - break; - } -endswitch: - if (orc == CONFACK && /* Good CI */ - rc != CONFACK) /* but prior CI wasnt? */ - continue; /* Don't send this one */ - - if (orc == CONFNAK) { /* Nak this CI? */ - if (reject_if_disagree) /* Getting fed up with sending NAKs? */ - orc = CONFREJ; /* Get tough if so */ - else { - if (rc == CONFREJ) /* Rejecting prior CI? */ - continue; /* Don't send this one */ - if (rc == CONFACK) { /* Ack'd all prior CIs? */ - rc = CONFNAK; /* Not anymore... */ - ucp = inp; /* Backup */ - } - } - } - - if (orc == CONFREJ && /* Reject this CI */ - rc != CONFREJ) { /* but no prior ones? */ - rc = CONFREJ; - ucp = inp; /* Backup */ - } - - /* Need to move CI? */ - if (ucp != cip) - BCOPY(cip, ucp, cilen); /* Move it */ - - /* Update output pointer */ - INCPTR(cilen, ucp); - } - - /* - * If we aren't rejecting this packet, and we want to negotiate - * their address, and they didn't send their address, then we - * send a NAK with a CI_ADDR option appended. We assume the - * input buffer is long enough that we can append the extra - * option safely. - */ - if (rc != CONFREJ && !ho->neg_addr && - wo->req_addr && !reject_if_disagree) { - if (rc == CONFACK) { - rc = CONFNAK; - ucp = inp; /* reset pointer */ - wo->req_addr = 0; /* don't ask again */ - } - PUTCHAR(CI_ADDR, ucp); - PUTCHAR(CILEN_ADDR, ucp); - tl = ntohl(wo->hisaddr); - PUTLONG(tl, ucp); - } - - *len = ucp - inp; /* Compute output length */ - IPCPDEBUG(("ipcp: returning Configure-%s", CODENAME(rc))); - return (rc); /* Return final code */ -} - - -/* - * ip_check_options - check that any IP-related options are OK, - * and assign appropriate defaults. - */ -static void -ip_check_options() -{ - struct hostent *hp; - u_int32_t local; - ipcp_options *wo = &ipcp_wantoptions[0]; - - /* - * Default our local IP address based on our hostname. - * If local IP address already given, don't bother. - */ - if (wo->ouraddr == 0) { - /* - * Look up our hostname (possibly with domain name appended) - * and take the first IP address as our local IP address. - * If there isn't an IP address for our hostname, too bad. - */ - wo->accept_local = 1; /* don't insist on this default value */ - if ((hp = gethostbyname(hostname)) != NULL) { - local = *(u_int32_t *)hp->h_addr; - if (local != 0 && !bad_ip_adrs(local)) - wo->ouraddr = local; - } - } -} - - -/* - * ip_demand_conf - configure the interface as though - * IPCP were up, for use with dial-on-demand. - */ -static int -ip_demand_conf(u) - int u; -{ - ipcp_options *wo = &ipcp_wantoptions[u]; - - if (wo->hisaddr == 0) { - /* make up an arbitrary address for the peer */ - wo->hisaddr = htonl(0x0a707070 + pppifunit); - wo->accept_remote = 1; - } - if (wo->ouraddr == 0) { - /* make up an arbitrary address for us */ - wo->ouraddr = htonl(0x0a404040 + pppifunit); - wo->accept_local = 1; - disable_defaultip = 1; /* don't tell the peer this address */ - } - if (!sifaddr(u, wo->ouraddr, wo->hisaddr, GetMask(wo->ouraddr))) - return 0; - if (!sifup(u)) - return 0; - if (!sifnpmode(u, PPP_IP, NPMODE_QUEUE)) - return 0; - if (wo->default_route) - if (sifdefaultroute(u, wo->ouraddr, wo->hisaddr)) - default_route_set[u] = 1; - if (wo->proxy_arp) - if (sifproxyarp(u, wo->hisaddr)) - proxy_arp_set[u] = 1; - - notice("local IP address %I", wo->ouraddr); - notice("remote IP address %I", wo->hisaddr); - - return 1; -} - - -/* - * ipcp_up - IPCP has come UP. - * - * Configure the IP network interface appropriately and bring it up. - */ -static void -ipcp_up(f) - fsm *f; -{ - u_int32_t mask; - ipcp_options *ho = &ipcp_hisoptions[f->unit]; - ipcp_options *go = &ipcp_gotoptions[f->unit]; - ipcp_options *wo = &ipcp_wantoptions[f->unit]; - - IPCPDEBUG(("ipcp: up")); - - /* - * We must have a non-zero IP address for both ends of the link. - */ - if (!ho->neg_addr) - ho->hisaddr = wo->hisaddr; - - if (ho->hisaddr == 0) { - error("Could not determine remote IP address"); - ipcp_close(f->unit, "Could not determine remote IP address"); - return; - } - if (go->ouraddr == 0) { - error("Could not determine local IP address"); - ipcp_close(f->unit, "Could not determine local IP address"); - return; - } - - if (usepeerdns && (go->dnsaddr[0] || go->dnsaddr[1])) { - create_resolv(go->dnsaddr[0], go->dnsaddr[1]); - } - - /* - * Check that the peer is allowed to use the IP address it wants. - */ - if (!auth_ip_addr(f->unit, ho->hisaddr)) { - error("Peer is not authorized to use remote address %I", ho->hisaddr); - ipcp_close(f->unit, "Unauthorized remote IP address"); - return; - } - - /* set tcp compression */ - sifvjcomp(f->unit, ho->neg_vj, ho->cflag, ho->maxslotindex); - - /* - * If we are doing dial-on-demand, the interface is already - * configured, so we put out any saved-up packets, then set the - * interface to pass IP packets. - */ - if (demand) { - if (go->ouraddr != wo->ouraddr || ho->hisaddr != wo->hisaddr) { - ipcp_clear_addrs(f->unit, wo->ouraddr, wo->hisaddr); - if (go->ouraddr != wo->ouraddr) { - warn("Local IP address changed to %I", go->ouraddr); - wo->ouraddr = go->ouraddr; - } - if (ho->hisaddr != wo->hisaddr) { - warn("Remote IP address changed to %I", ho->hisaddr); - wo->hisaddr = ho->hisaddr; - } - - /* Set the interface to the new addresses */ - mask = GetMask(go->ouraddr); - if (!sifaddr(f->unit, go->ouraddr, ho->hisaddr, mask)) { - if (debug) - warn("Interface configuration failed"); - ipcp_close(f->unit, "Interface configuration failed"); - return; - } - - /* assign a default route through the interface if required */ - if (ipcp_wantoptions[f->unit].default_route) - if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr)) - default_route_set[f->unit] = 1; - - /* Make a proxy ARP entry if requested. */ - if (ipcp_wantoptions[f->unit].proxy_arp) - if (sifproxyarp(f->unit, ho->hisaddr)) - proxy_arp_set[f->unit] = 1; - - } - demand_rexmit(PPP_IP); - sifnpmode(f->unit, PPP_IP, NPMODE_PASS); - - } else { - /* - * Set IP addresses and (if specified) netmask. - */ - mask = GetMask(go->ouraddr); - -#if !(defined(SVR4) && (defined(SNI) || defined(__USLC__))) - if (!sifaddr(f->unit, go->ouraddr, ho->hisaddr, mask)) { - if (debug) - warn("Interface configuration failed"); - ipcp_close(f->unit, "Interface configuration failed"); - return; - } -#endif - - /* bring the interface up for IP */ - if (!sifup(f->unit)) { - if (debug) - warn("Interface failed to come up"); - ipcp_close(f->unit, "Interface configuration failed"); - return; - } - -#if (defined(SVR4) && (defined(SNI) || defined(__USLC__))) - if (!sifaddr(f->unit, go->ouraddr, ho->hisaddr, mask)) { - if (debug) - warn("Interface configuration failed"); - ipcp_close(f->unit, "Interface configuration failed"); - return; - } -#endif - sifnpmode(f->unit, PPP_IP, NPMODE_PASS); - - /* assign a default route through the interface if required */ - if (ipcp_wantoptions[f->unit].default_route) - if (sifdefaultroute(f->unit, go->ouraddr, ho->hisaddr)) - default_route_set[f->unit] = 1; - - /* Make a proxy ARP entry if requested. */ - if (ipcp_wantoptions[f->unit].proxy_arp) - if (sifproxyarp(f->unit, ho->hisaddr)) - proxy_arp_set[f->unit] = 1; - - ipcp_wantoptions[0].ouraddr = go->ouraddr; - - notice("local IP address %I", go->ouraddr); - notice("remote IP address %I", ho->hisaddr); - if (go->dnsaddr[0]) - notice("primary DNS address %I", go->dnsaddr[0]); - if (go->dnsaddr[1]) - notice("secondary DNS address %I", go->dnsaddr[1]); - } - - np_up(f->unit, PPP_IP); - ipcp_is_up = 1; - - if (ip_up_hook) - ip_up_hook(); -} - - -/* - * ipcp_down - IPCP has gone DOWN. - * - * Take the IP network interface down, clear its addresses - * and delete routes through it. - */ -static void -ipcp_down(f) - fsm *f; -{ - IPCPDEBUG(("ipcp: down")); - /* XXX a bit IPv4-centric here, we only need to get the stats - * before the interface is marked down. */ - update_link_stats(f->unit); - if (ip_down_hook) - ip_down_hook(); - if (ipcp_is_up) { - ipcp_is_up = 0; - np_down(f->unit, PPP_IP); - } - sifvjcomp(f->unit, 0, 0, 0); - - /* - * If we are doing dial-on-demand, set the interface - * to queue up outgoing packets (for now). - */ - if (demand) { - sifnpmode(f->unit, PPP_IP, NPMODE_QUEUE); - } else { - sifnpmode(f->unit, PPP_IP, NPMODE_DROP); - sifdown(f->unit); - ipcp_clear_addrs(f->unit, ipcp_gotoptions[f->unit].ouraddr, - ipcp_hisoptions[f->unit].hisaddr); - } -} - - -/* - * ipcp_clear_addrs() - clear the interface addresses, routes, - * proxy arp entries, etc. - */ -static void -ipcp_clear_addrs(unit, ouraddr, hisaddr) - int unit; - u_int32_t ouraddr; /* local address */ - u_int32_t hisaddr; /* remote address */ -{ - if (proxy_arp_set[unit]) { - cifproxyarp(unit, hisaddr); - proxy_arp_set[unit] = 0; - } - if (default_route_set[unit]) { - cifdefaultroute(unit, ouraddr, hisaddr); - default_route_set[unit] = 0; - } - cifaddr(unit, ouraddr, hisaddr); -} - - -/* - * ipcp_finished - possibly shut down the lower layers. - */ -static void -ipcp_finished(f) - fsm *f; -{ - np_finished(f->unit, PPP_IP); -} - -/* - * create_resolv - create the replacement resolv.conf file - */ -static void -create_resolv(peerdns1, peerdns2) - u_int32_t peerdns1, peerdns2; -{ - extern int rtems_bsdnet_nameserver_count; - extern struct in_addr rtems_bsdnet_nameserver[]; - - /* initialize values */ - rtems_bsdnet_nameserver_count = (int)0; - - /* check to see if primary was specified */ - if ( peerdns1 ) { - rtems_bsdnet_nameserver[rtems_bsdnet_nameserver_count].s_addr = peerdns1; - rtems_bsdnet_nameserver_count++; - } - - /* check to see if secondary was specified */ - if ( peerdns2 ) { - rtems_bsdnet_nameserver[rtems_bsdnet_nameserver_count].s_addr = peerdns2; - rtems_bsdnet_nameserver_count++; - } - - /* initialize resolver */ - __res_init(); -} - -/* - * ipcp_printpkt - print the contents of an IPCP packet. - */ -static char *ipcp_codenames[] = { - "ConfReq", "ConfAck", "ConfNak", "ConfRej", - "TermReq", "TermAck", "CodeRej" -}; - -static int -ipcp_printpkt(p, plen, printer, arg) - u_char *p; - int plen; - void (*printer) __P((void *, char *, ...)); - void *arg; -{ - int code, id, len, olen; - u_char *pstart, *optend; - u_short cishort; - u_int32_t cilong; - - if (plen < HEADERLEN) - return 0; - pstart = p; - GETCHAR(code, p); - GETCHAR(id, p); - GETSHORT(len, p); - if (len < HEADERLEN || len > plen) - return 0; - - if (code >= 1 && code <= sizeof(ipcp_codenames) / sizeof(char *)) - printer(arg, " %s", ipcp_codenames[code-1]); - else - printer(arg, " code=0x%x", code); - printer(arg, " id=0x%x", id); - len -= HEADERLEN; - switch (code) { - case CONFREQ: - case CONFACK: - case CONFNAK: - case CONFREJ: - /* print option list */ - while (len >= 2) { - GETCHAR(code, p); - GETCHAR(olen, p); - p -= 2; - if (olen < 2 || olen > len) { - break; - } - printer(arg, " <"); - len -= olen; - optend = p + olen; - switch (code) { - case CI_ADDRS: - if (olen == CILEN_ADDRS) { - p += 2; - GETLONG(cilong, p); - printer(arg, "addrs %I", htonl(cilong)); - GETLONG(cilong, p); - printer(arg, " %I", htonl(cilong)); - } - break; - case CI_COMPRESSTYPE: - if (olen >= CILEN_COMPRESS) { - p += 2; - GETSHORT(cishort, p); - printer(arg, "compress "); - switch (cishort) { - case IPCP_VJ_COMP: - printer(arg, "VJ"); - break; - case IPCP_VJ_COMP_OLD: - printer(arg, "old-VJ"); - break; - default: - printer(arg, "0x%x", cishort); - } - } - break; - case CI_ADDR: - if (olen == CILEN_ADDR) { - p += 2; - GETLONG(cilong, p); - printer(arg, "addr %I", htonl(cilong)); - } - break; - case CI_MS_DNS1: - case CI_MS_DNS2: - p += 2; - GETLONG(cilong, p); - printer(arg, "ms-dns%d %I", code - CI_MS_DNS1 + 1, - htonl(cilong)); - break; - case CI_MS_WINS1: - case CI_MS_WINS2: - p += 2; - GETLONG(cilong, p); - printer(arg, "ms-wins %I", htonl(cilong)); - break; - } - while (p < optend) { - GETCHAR(code, p); - printer(arg, " %.2x", code); - } - printer(arg, ">"); - } - break; - - case TERMACK: - case TERMREQ: - if (len > 0 && *p >= ' ' && *p < 0x7f) { - printer(arg, " "); - print_string(p, len, printer, arg); - p += len; - len = 0; - } - break; - } - - /* print the rest of the bytes in the packet */ - for (; len > 0; --len) { - GETCHAR(code, p); - printer(arg, " %.2x", code); - } - - return p - pstart; -} - -/* - * ip_active_pkt - see if this IP packet is worth bringing the link up for. - * We don't bring the link up for IP fragments or for TCP FIN packets - * with no data. - */ -#define IP_HDRLEN 20 /* bytes */ -#define IP_OFFMASK 0x1fff -#define IPPROTO_TCP 6 -#define TCP_HDRLEN 20 -#define TH_FIN 0x01 - -/* - * We use these macros because the IP header may be at an odd address, - * and some compilers might use word loads to get th_off or ip_hl. - */ - -#define net_short(x) (((x)[0] << 8) + (x)[1]) -#define get_iphl(x) (((unsigned char *)(x))[0] & 0xF) -#define get_ipoff(x) net_short((unsigned char *)(x) + 6) -#define get_ipproto(x) (((unsigned char *)(x))[9]) -#define get_tcpoff(x) (((unsigned char *)(x))[12] >> 4) -#define get_tcpflags(x) (((unsigned char *)(x))[13]) - -static int -ip_active_pkt(pkt, len) - u_char *pkt; - int len; -{ - u_char *tcp; - int hlen; - - len -= PPP_HDRLEN; - pkt += PPP_HDRLEN; - if (len < IP_HDRLEN) - return 0; - if ((get_ipoff(pkt) & IP_OFFMASK) != 0) - return 0; - if (get_ipproto(pkt) != IPPROTO_TCP) - return 1; - hlen = get_iphl(pkt) * 4; - if (len < hlen + TCP_HDRLEN) - return 0; - tcp = pkt + hlen; - if ((get_tcpflags(tcp) & TH_FIN) != 0 && len == hlen + get_tcpoff(tcp) * 4) - return 0; - return 1; -} diff --git a/cpukit/pppd/ipcp.h b/cpukit/pppd/ipcp.h deleted file mode 100644 index 8c5aca861d..0000000000 --- a/cpukit/pppd/ipcp.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * ipcp.h - IP Control Protocol definitions. - * - * Copyright (c) 1989 Carnegie Mellon University. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by Carnegie Mellon University. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * $Id$ - */ - -/* - * Options. - */ -#define CI_ADDRS 1 /* IP Addresses */ -#define CI_COMPRESSTYPE 2 /* Compression Type */ -#define CI_ADDR 3 - -#define CI_MS_DNS1 129 /* Primary DNS value */ -#define CI_MS_WINS1 130 /* Primary WINS value */ -#define CI_MS_DNS2 131 /* Secondary DNS value */ -#define CI_MS_WINS2 132 /* Secondary WINS value */ - -#define MAX_STATES 16 /* from slcompress.h */ - -#define IPCP_VJMODE_OLD 1 /* "old" mode (option # = 0x0037) */ -#define IPCP_VJMODE_RFC1172 2 /* "old-rfc"mode (option # = 0x002d) */ -#define IPCP_VJMODE_RFC1332 3 /* "new-rfc"mode (option # = 0x002d, */ - /* maxslot and slot number compression) */ - -#define IPCP_VJ_COMP 0x002d /* current value for VJ compression option*/ -#define IPCP_VJ_COMP_OLD 0x0037 /* "old" (i.e, broken) value for VJ */ - /* compression option*/ - -typedef struct ipcp_options { - bool neg_addr; /* Negotiate IP Address? */ - bool old_addrs; /* Use old (IP-Addresses) option? */ - bool req_addr; /* Ask peer to send IP address? */ - bool default_route; /* Assign default route through interface? */ - bool proxy_arp; /* Make proxy ARP entry for peer? */ - bool neg_vj; /* Van Jacobson Compression? */ - bool old_vj; /* use old (short) form of VJ option? */ - bool accept_local; /* accept peer's value for ouraddr */ - bool accept_remote; /* accept peer's value for hisaddr */ - bool req_dns1; /* Ask peer to send primary DNS address? */ - bool req_dns2; /* Ask peer to send secondary DNS address? */ - int vj_protocol; /* protocol value to use in VJ option */ - int maxslotindex; /* values for RFC1332 VJ compression neg. */ - bool cflag; - u_int32_t ouraddr, hisaddr; /* Addresses in NETWORK BYTE ORDER */ - u_int32_t dnsaddr[2]; /* Primary and secondary MS DNS entries */ - u_int32_t winsaddr[2]; /* Primary and secondary MS WINS entries */ -} ipcp_options; - -extern fsm ipcp_fsm[]; -extern ipcp_options ipcp_wantoptions[]; -extern ipcp_options ipcp_gotoptions[]; -extern ipcp_options ipcp_allowoptions[]; -extern ipcp_options ipcp_hisoptions[]; - -char *ip_ntoa __P((u_int32_t)); - -extern struct protent ipcp_protent; diff --git a/cpukit/pppd/ipxcp.c b/cpukit/pppd/ipxcp.c deleted file mode 100644 index 4e408a00f9..0000000000 --- a/cpukit/pppd/ipxcp.c +++ /dev/null @@ -1,1449 +0,0 @@ -/* - * ipxcp.c - PPP IPX Control Protocol. - * - * Copyright (c) 1989 Carnegie Mellon University. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by Carnegie Mellon University. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#ifdef IPX_CHANGE - -#define RCSID "$Id$" - -/* - * TODO: - */ - -#include -#include -#include -#include -#include -#include -#include - -#include "pppd.h" -#include "fsm.h" -#include "ipxcp.h" -#include "pathnames.h" -#include "magic.h" - -static const char rcsid[] = RCSID; - -/* global vars */ -ipxcp_options ipxcp_wantoptions[NUM_PPP]; /* Options that we want to request */ -ipxcp_options ipxcp_gotoptions[NUM_PPP]; /* Options that peer ack'd */ -ipxcp_options ipxcp_allowoptions[NUM_PPP]; /* Options we allow peer to request */ -ipxcp_options ipxcp_hisoptions[NUM_PPP]; /* Options that we ack'd */ - -#define wo (&ipxcp_wantoptions[0]) -#define ao (&ipxcp_allowoptions[0]) -#define go (&ipxcp_gotoptions[0]) -#define ho (&ipxcp_hisoptions[0]) - -/* - * Callbacks for fsm code. (CI = Configuration Information) - */ -static void ipxcp_resetci __P((fsm *)); /* Reset our CI */ -static int ipxcp_cilen __P((fsm *)); /* Return length of our CI */ -static void ipxcp_addci __P((fsm *, u_char *, int *)); /* Add our CI */ -static int ipxcp_ackci __P((fsm *, u_char *, int)); /* Peer ack'd our CI */ -static int ipxcp_nakci __P((fsm *, u_char *, int)); /* Peer nak'd our CI */ -static int ipxcp_rejci __P((fsm *, u_char *, int)); /* Peer rej'd our CI */ -static int ipxcp_reqci __P((fsm *, u_char *, int *, int)); /* Rcv CI */ -static void ipxcp_up __P((fsm *)); /* We're UP */ -static void ipxcp_down __P((fsm *)); /* We're DOWN */ -static void ipxcp_finished __P((fsm *)); /* Don't need lower layer */ - -fsm ipxcp_fsm[NUM_PPP]; /* IPXCP fsm structure */ - -static fsm_callbacks ipxcp_callbacks = { /* IPXCP callback routines */ - ipxcp_resetci, /* Reset our Configuration Information */ - ipxcp_cilen, /* Length of our Configuration Information */ - ipxcp_addci, /* Add our Configuration Information */ - ipxcp_ackci, /* ACK our Configuration Information */ - ipxcp_nakci, /* NAK our Configuration Information */ - ipxcp_rejci, /* Reject our Configuration Information */ - ipxcp_reqci, /* Request peer's Configuration Information */ - ipxcp_up, /* Called when fsm reaches OPENED state */ - ipxcp_down, /* Called when fsm leaves OPENED state */ - NULL, /* Called when we want the lower layer up */ - ipxcp_finished, /* Called when we want the lower layer down */ - NULL, /* Called when Protocol-Reject received */ - NULL, /* Retransmission is necessary */ - NULL, /* Called to handle protocol-specific codes */ - "IPXCP" /* String name of protocol */ -}; - -/* - * Command-line options. - */ -static int setipxnode __P((char **)); -static int setipxname __P((char **)); - -static option_t ipxcp_option_list[] = { - { "ipx", o_bool, &ipxcp_protent.enabled_flag, - "Enable IPXCP (and IPX)", 1 }, - { "+ipx", o_bool, &ipxcp_protent.enabled_flag, - "Enable IPXCP (and IPX)", 1 }, - { "noipx", o_bool, &ipxcp_protent.enabled_flag, - "Disable IPXCP (and IPX)" }, - { "-ipx", o_bool, &ipxcp_protent.enabled_flag, - "Disable IPXCP (and IPX)" } , - { "ipx-network", o_uint32, &ipxcp_wantoptions[0].our_network, - "Set our IPX network number", 0, &ipxcp_wantoptions[0].neg_nn }, - { "ipxcp-accept-network", o_bool, &ipxcp_wantoptions[0].accept_network, - "Accept peer IPX network number", 1, - &ipxcp_allowoptions[0].accept_network }, - { "ipx-node", o_special, setipxnode, - "Set IPX node number" }, - { "ipxcp-accept-local", o_bool, &ipxcp_wantoptions[0].accept_local, - "Accept our IPX address", 1, - &ipxcp_allowoptions[0].accept_local }, - { "ipxcp-accept-remote", o_bool, &ipxcp_wantoptions[0].accept_remote, - "Accept peer's IPX address", 1, - &ipxcp_allowoptions[0].accept_remote }, - { "ipx-routing", o_int, &ipxcp_wantoptions[0].router, - "Set IPX routing proto number", 0, - &ipxcp_wantoptions[0].neg_router }, - { "ipx-router-name", o_special, setipxname, - "Set IPX router name" }, - { "ipxcp-restart", o_int, &ipxcp_fsm[0].timeouttime, - "Set timeout for IPXCP" }, - { "ipxcp-max-terminate", o_int, &ipxcp_fsm[0].maxtermtransmits, - "Set max #xmits for IPXCP term-reqs" }, - { "ipxcp-max-configure", o_int, &ipxcp_fsm[0].maxconfreqtransmits, - "Set max #xmits for IPXCP conf-reqs" }, - { "ipxcp-max-failure", o_int, &ipxcp_fsm[0].maxnakloops, - "Set max #conf-naks for IPXCP" }, - { NULL } -}; - -/* - * Protocol entry points. - */ - -static void ipxcp_init __P((int)); -static void ipxcp_open __P((int)); -static void ipxcp_close __P((int, char *)); -static void ipxcp_lowerup __P((int)); -static void ipxcp_lowerdown __P((int)); -static void ipxcp_input __P((int, u_char *, int)); -static void ipxcp_protrej __P((int)); -static int ipxcp_printpkt __P((u_char *, int, - void (*) __P((void *, char *, ...)), void *)); - -struct protent ipxcp_protent = { - PPP_IPXCP, - ipxcp_init, - ipxcp_input, - ipxcp_protrej, - ipxcp_lowerup, - ipxcp_lowerdown, - ipxcp_open, - ipxcp_close, - ipxcp_printpkt, - NULL, - 0, - "IPXCP", - "IPX", - ipxcp_option_list, - NULL, - NULL, - NULL -}; - -/* - * Lengths of configuration options. - */ - -#define CILEN_VOID 2 -#define CILEN_COMPLETE 2 /* length of complete option */ -#define CILEN_NETN 6 /* network number length option */ -#define CILEN_NODEN 8 /* node number length option */ -#define CILEN_PROTOCOL 4 /* Minimum length of routing protocol */ -#define CILEN_NAME 3 /* Minimum length of router name */ -#define CILEN_COMPRESS 4 /* Minimum length of compression protocol */ - -#define CODENAME(x) ((x) == CONFACK ? "ACK" : \ - (x) == CONFNAK ? "NAK" : "REJ") - -static int ipxcp_is_up; - -static char *ipx_ntoa __P((u_int32_t)); - -/* Used in printing the node number */ -#define NODE(base) base[0], base[1], base[2], base[3], base[4], base[5] - -/* Used to generate the proper bit mask */ -#define BIT(num) (1 << (num)) - -/* - * Convert from internal to external notation - */ - -static short int -to_external(internal) -short int internal; -{ - short int external; - - if (internal & BIT(IPX_NONE) ) - external = IPX_NONE; - else - external = RIP_SAP; - - return external; -} - -/* - * Make a string representation of a network IP address. - */ - -static char * -ipx_ntoa(ipxaddr) -u_int32_t ipxaddr; -{ - static char b[64]; - slprintf(b, sizeof(b), "%x", ipxaddr); - return b; -} - - -static u_char * -setipxnodevalue(src,dst) -u_char *src, *dst; -{ - int indx; - int item; - - for (;;) { - if (!isxdigit (*src)) - break; - - for (indx = 0; indx < 5; ++indx) { - dst[indx] <<= 4; - dst[indx] |= (dst[indx + 1] >> 4) & 0x0F; - } - - item = toupper (*src) - '0'; - if (item > 9) - item -= 7; - - dst[5] = (dst[5] << 4) | item; - ++src; - } - return src; -} - -static int -setipxnode(argv) - char **argv; -{ - char *end; - - memset (&ipxcp_wantoptions[0].our_node[0], 0, 6); - memset (&ipxcp_wantoptions[0].his_node[0], 0, 6); - - end = setipxnodevalue (*argv, &ipxcp_wantoptions[0].our_node[0]); - if (*end == ':') - end = setipxnodevalue (++end, &ipxcp_wantoptions[0].his_node[0]); - - if (*end == '\0') { - ipxcp_wantoptions[0].neg_node = 1; - return 1; - } - - option_error("invalid parameter '%s' for ipx-node option", *argv); - return 0; -} - -static int -setipxname (argv) - char **argv; -{ - char *dest = ipxcp_wantoptions[0].name; - char *src = *argv; - int count; - char ch; - - ipxcp_wantoptions[0].neg_name = 1; - ipxcp_allowoptions[0].neg_name = 1; - memset (dest, '\0', sizeof (ipxcp_wantoptions[0].name)); - - count = 0; - while (*src) { - ch = *src++; - if (! isalnum (ch) && ch != '_') { - option_error("IPX router name must be alphanumeric or _"); - return 0; - } - - if (count >= sizeof (ipxcp_wantoptions[0].name)) { - option_error("IPX router name is limited to %d characters", - sizeof (ipxcp_wantoptions[0].name) - 1); - return 0; - } - - dest[count++] = toupper (ch); - } - - return 1; -} - -/* - * ipxcp_init - Initialize IPXCP. - */ -static void -ipxcp_init(unit) - int unit; -{ - fsm *f = &ipxcp_fsm[unit]; - - f->unit = unit; - f->protocol = PPP_IPXCP; - f->callbacks = &ipxcp_callbacks; - fsm_init(&ipxcp_fsm[unit]); - - memset (wo->name, 0, sizeof (wo->name)); - memset (wo->our_node, 0, sizeof (wo->our_node)); - memset (wo->his_node, 0, sizeof (wo->his_node)); - - wo->neg_nn = 1; - wo->neg_complete = 1; - wo->network = 0; - - ao->neg_node = 1; - ao->neg_nn = 1; - ao->neg_name = 1; - ao->neg_complete = 1; - ao->neg_router = 1; - - ao->accept_local = 0; - ao->accept_remote = 0; - ao->accept_network = 0; - - wo->tried_rip = 0; - wo->tried_nlsp = 0; -} - -/* - * Copy the node number - */ - -static void -copy_node (src, dst) -u_char *src, *dst; -{ - memcpy (dst, src, sizeof (ipxcp_wantoptions[0].our_node)); -} - -/* - * Compare node numbers - */ - -static int -compare_node (src, dst) -u_char *src, *dst; -{ - return memcmp (dst, src, sizeof (ipxcp_wantoptions[0].our_node)) == 0; -} - -/* - * Is the node number zero? - */ - -static int -zero_node (node) -u_char *node; -{ - int indx; - for (indx = 0; indx < sizeof (ipxcp_wantoptions[0].our_node); ++indx) - if (node [indx] != 0) - return 0; - return 1; -} - -/* - * Increment the node number - */ - -static void -inc_node (node) -u_char *node; -{ - u_char *outp; - u_int32_t magic_num; - - outp = node; - magic_num = magic(); - *outp++ = '\0'; - *outp++ = '\0'; - PUTLONG (magic_num, outp); -} - -/* - * ipxcp_open - IPXCP is allowed to come up. - */ -static void -ipxcp_open(unit) - int unit; -{ - fsm_open(&ipxcp_fsm[unit]); -} - -/* - * ipxcp_close - Take IPXCP down. - */ -static void -ipxcp_close(unit, reason) - int unit; - char *reason; -{ - fsm_close(&ipxcp_fsm[unit], reason); -} - - -/* - * ipxcp_lowerup - The lower layer is up. - */ -static void -ipxcp_lowerup(unit) - int unit; -{ - fsm_lowerup(&ipxcp_fsm[unit]); -} - - -/* - * ipxcp_lowerdown - The lower layer is down. - */ -static void -ipxcp_lowerdown(unit) - int unit; -{ - fsm_lowerdown(&ipxcp_fsm[unit]); -} - - -/* - * ipxcp_input - Input IPXCP packet. - */ -static void -ipxcp_input(unit, p, len) - int unit; - u_char *p; - int len; -{ - fsm_input(&ipxcp_fsm[unit], p, len); -} - - -/* - * ipxcp_protrej - A Protocol-Reject was received for IPXCP. - * - * Pretend the lower layer went down, so we shut up. - */ -static void -ipxcp_protrej(unit) - int unit; -{ - fsm_lowerdown(&ipxcp_fsm[unit]); -} - - -/* - * ipxcp_resetci - Reset our CI. - */ -static void -ipxcp_resetci(f) - fsm *f; -{ - wo->req_node = wo->neg_node && ao->neg_node; - wo->req_nn = wo->neg_nn && ao->neg_nn; - - if (wo->our_network == 0) { - wo->neg_node = 1; - ao->accept_network = 1; - } -/* - * If our node number is zero then change it. - */ - if (zero_node (wo->our_node)) { - inc_node (wo->our_node); - ao->accept_local = 1; - wo->neg_node = 1; - } -/* - * If his node number is zero then change it. - */ - if (zero_node (wo->his_node)) { - inc_node (wo->his_node); - ao->accept_remote = 1; - } -/* - * If no routing agent was specified then we do RIP/SAP according to the - * RFC documents. If you have specified something then OK. Otherwise, we - * do RIP/SAP. - */ - if (ao->router == 0) { - ao->router |= BIT(RIP_SAP); - wo->router |= BIT(RIP_SAP); - } - - /* Always specify a routing protocol unless it was REJected. */ - wo->neg_router = 1; -/* - * Start with these default values - */ - *go = *wo; -} - -/* - * ipxcp_cilen - Return length of our CI. - */ - -static int -ipxcp_cilen(f) - fsm *f; -{ - int len; - - len = go->neg_nn ? CILEN_NETN : 0; - len += go->neg_node ? CILEN_NODEN : 0; - len += go->neg_name ? CILEN_NAME + strlen (go->name) - 1 : 0; - - /* RFC says that defaults should not be included. */ - if (go->neg_router && to_external(go->router) != RIP_SAP) - len += CILEN_PROTOCOL; - - return (len); -} - - -/* - * ipxcp_addci - Add our desired CIs to a packet. - */ -static void -ipxcp_addci(f, ucp, lenp) - fsm *f; - u_char *ucp; - int *lenp; -{ -/* - * Add the options to the record. - */ - if (go->neg_nn) { - PUTCHAR (IPX_NETWORK_NUMBER, ucp); - PUTCHAR (CILEN_NETN, ucp); - PUTLONG (go->our_network, ucp); - } - - if (go->neg_node) { - int indx; - PUTCHAR (IPX_NODE_NUMBER, ucp); - PUTCHAR (CILEN_NODEN, ucp); - for (indx = 0; indx < sizeof (go->our_node); ++indx) - PUTCHAR (go->our_node[indx], ucp); - } - - if (go->neg_name) { - int cilen = strlen (go->name); - int indx; - PUTCHAR (IPX_ROUTER_NAME, ucp); - PUTCHAR (CILEN_NAME + cilen - 1, ucp); - for (indx = 0; indx < cilen; ++indx) - PUTCHAR (go->name [indx], ucp); - } - - if (go->neg_router) { - short external = to_external (go->router); - if (external != RIP_SAP) { - PUTCHAR (IPX_ROUTER_PROTOCOL, ucp); - PUTCHAR (CILEN_PROTOCOL, ucp); - PUTSHORT (external, ucp); - } - } -} - -/* - * ipxcp_ackci - Ack our CIs. - * - * Returns: - * 0 - Ack was bad. - * 1 - Ack was good. - */ -static int -ipxcp_ackci(f, p, len) - fsm *f; - u_char *p; - int len; -{ - u_short cilen, citype, cishort; - u_char cichar; - u_int32_t cilong; - -#define ACKCIVOID(opt, neg) \ - if (neg) { \ - if ((len -= CILEN_VOID) < 0) \ - break; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_VOID || \ - citype != opt) \ - break; \ - } - -#define ACKCICOMPLETE(opt,neg) ACKCIVOID(opt, neg) - -#define ACKCICHARS(opt, neg, val, cnt) \ - if (neg) { \ - int indx, count = cnt; \ - len -= (count + 2); \ - if (len < 0) \ - break; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != (count + 2) || \ - citype != opt) \ - break; \ - for (indx = 0; indx < count; ++indx) {\ - GETCHAR(cichar, p); \ - if (cichar != ((u_char *) &val)[indx]) \ - break; \ - }\ - if (indx != count) \ - break; \ - } - -#define ACKCINODE(opt,neg,val) ACKCICHARS(opt,neg,val,sizeof(val)) -#define ACKCINAME(opt,neg,val) ACKCICHARS(opt,neg,val,strlen(val)) - -#define ACKCINETWORK(opt, neg, val) \ - if (neg) { \ - if ((len -= CILEN_NETN) < 0) \ - break; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_NETN || \ - citype != opt) \ - break; \ - GETLONG(cilong, p); \ - if (cilong != val) \ - break; \ - } - -#define ACKCIPROTO(opt, neg, val) \ - if (neg) { \ - if (len < 2) \ - break; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_PROTOCOL || citype != opt) \ - break; \ - len -= cilen; \ - if (len < 0) \ - break; \ - GETSHORT(cishort, p); \ - if (cishort != to_external (val) || cishort == RIP_SAP) \ - break; \ - } -/* - * Process the ACK frame in the order in which the frame was assembled - */ - do { - ACKCINETWORK (IPX_NETWORK_NUMBER, go->neg_nn, go->our_network); - ACKCINODE (IPX_NODE_NUMBER, go->neg_node, go->our_node); - ACKCINAME (IPX_ROUTER_NAME, go->neg_name, go->name); - if (len > 0) - ACKCIPROTO (IPX_ROUTER_PROTOCOL, go->neg_router, go->router); -/* - * This is the end of the record. - */ - if (len == 0) - return (1); - } while (0); -/* - * The frame is invalid - */ - IPXCPDEBUG(("ipxcp_ackci: received bad Ack!")); - return (0); -} - -/* - * ipxcp_nakci - Peer has sent a NAK for some of our CIs. - * This should not modify any state if the Nak is bad - * or if IPXCP is in the OPENED state. - * - * Returns: - * 0 - Nak was bad. - * 1 - Nak was good. - */ - -static int -ipxcp_nakci(f, p, len) - fsm *f; - u_char *p; - int len; -{ - u_char citype, cilen, *next; - u_short s; - u_int32_t l; - ipxcp_options no; /* options we've seen Naks for */ - ipxcp_options try; /* options to request next time */ - - BZERO(&no, sizeof(no)); - try = *go; - - while (len > CILEN_VOID) { - GETCHAR (citype, p); - GETCHAR (cilen, p); - len -= cilen; - if (len < 0) - goto bad; - next = &p [cilen - CILEN_VOID]; - - switch (citype) { - case IPX_NETWORK_NUMBER: - if (!go->neg_nn || no.neg_nn || (cilen != CILEN_NETN)) - goto bad; - no.neg_nn = 1; - - GETLONG(l, p); - if (l && ao->accept_network) - try.our_network = l; - break; - - case IPX_NODE_NUMBER: - if (!go->neg_node || no.neg_node || (cilen != CILEN_NODEN)) - goto bad; - no.neg_node = 1; - - if (!zero_node (p) && ao->accept_local && - ! compare_node (p, ho->his_node)) - copy_node (p, try.our_node); - break; - - /* This has never been sent. Ignore the NAK frame */ - case IPX_COMPRESSION_PROTOCOL: - goto bad; - - case IPX_ROUTER_PROTOCOL: - if (!go->neg_router || (cilen < CILEN_PROTOCOL)) - goto bad; - - GETSHORT (s, p); - if (s > 15) /* This is just bad, but ignore for now. */ - break; - - s = BIT(s); - if (no.router & s) /* duplicate NAKs are always bad */ - goto bad; - - if (no.router == 0) /* Reset on first NAK only */ - try.router = 0; - - no.router |= s; - try.router |= s; - try.neg_router = 1; - break; - - /* These, according to the RFC, must never be NAKed. */ - case IPX_ROUTER_NAME: - case IPX_COMPLETE: - goto bad; - - /* These are for options which we have not seen. */ - default: - break; - } - p = next; - } - - /* - * Do not permit the peer to force a router protocol which we do not - * support. However, default to the condition that will accept "NONE". - */ - try.router &= (ao->router | BIT(IPX_NONE)); - if (try.router == 0 && ao->router != 0) - try.router = BIT(IPX_NONE); - - if (try.router != 0) - try.neg_router = 1; - - /* - * OK, the Nak is good. Now we can update state. - * If there are any options left, we ignore them. - */ - if (f->state != OPENED) - *go = try; - - return 1; - -bad: - IPXCPDEBUG(("ipxcp_nakci: received bad Nak!")); - return 0; -} - -/* - * ipxcp_rejci - Reject some of our CIs. - */ -static int -ipxcp_rejci(f, p, len) - fsm *f; - u_char *p; - int len; -{ - u_short cilen, citype, cishort; - u_char cichar; - u_int32_t cilong; - ipxcp_options try; /* options to request next time */ - -#define REJCINETWORK(opt, neg, val) \ - if (neg && p[0] == opt) { \ - if ((len -= CILEN_NETN) < 0) \ - break; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_NETN || \ - citype != opt) \ - break; \ - GETLONG(cilong, p); \ - if (cilong != val) \ - break; \ - neg = 0; \ - } - -#define REJCICHARS(opt, neg, val, cnt) \ - if (neg && p[0] == opt) { \ - int indx, count = cnt; \ - len -= (count + 2); \ - if (len < 0) \ - break; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != (count + 2) || \ - citype != opt) \ - break; \ - for (indx = 0; indx < count; ++indx) {\ - GETCHAR(cichar, p); \ - if (cichar != ((u_char *) &val)[indx]) \ - break; \ - }\ - if (indx != count) \ - break; \ - neg = 0; \ - } - -#define REJCINODE(opt,neg,val) REJCICHARS(opt,neg,val,sizeof(val)) -#define REJCINAME(opt,neg,val) REJCICHARS(opt,neg,val,strlen(val)) - -#define REJCIVOID(opt, neg) \ - if (neg && p[0] == opt) { \ - if ((len -= CILEN_VOID) < 0) \ - break; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_VOID || citype != opt) \ - break; \ - neg = 0; \ - } - -/* a reject for RIP/SAP is invalid since we don't send it and you can't - reject something which is not sent. (You can NAK, but you can't REJ.) */ -#define REJCIPROTO(opt, neg, val, bit) \ - if (neg && p[0] == opt) { \ - if ((len -= CILEN_PROTOCOL) < 0) \ - break; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_PROTOCOL) \ - break; \ - GETSHORT(cishort, p); \ - if (cishort != to_external (val) || cishort == RIP_SAP) \ - break; \ - neg = 0; \ - } -/* - * Any Rejected CIs must be in exactly the same order that we sent. - * Check packet length and CI length at each step. - * If we find any deviations, then this packet is bad. - */ - try = *go; - - do { - REJCINETWORK (IPX_NETWORK_NUMBER, try.neg_nn, try.our_network); - REJCINODE (IPX_NODE_NUMBER, try.neg_node, try.our_node); - REJCINAME (IPX_ROUTER_NAME, try.neg_name, try.name); - REJCIPROTO (IPX_ROUTER_PROTOCOL, try.neg_router, try.router, 0); -/* - * This is the end of the record. - */ - if (len == 0) { - if (f->state != OPENED) - *go = try; - return (1); - } - } while (0); -/* - * The frame is invalid at this point. - */ - IPXCPDEBUG(("ipxcp_rejci: received bad Reject!")); - return 0; -} - -/* - * ipxcp_reqci - Check the peer's requested CIs and send appropriate response. - * - * Returns: CONFACK, CONFNAK or CONFREJ and input packet modified - * appropriately. If reject_if_disagree is non-zero, doesn't return - * CONFNAK; returns CONFREJ if it can't return CONFACK. - */ -static int -ipxcp_reqci(f, inp, len, reject_if_disagree) - fsm *f; - u_char *inp; /* Requested CIs */ - int *len; /* Length of requested CIs */ - int reject_if_disagree; -{ - u_char *cip, *next; /* Pointer to current and next CIs */ - u_short cilen, citype; /* Parsed len, type */ - u_short cishort; /* Parsed short value */ - u_int32_t cinetwork; /* Parsed address values */ - int rc = CONFACK; /* Final packet return code */ - int orc; /* Individual option return code */ - u_char *p; /* Pointer to next char to parse */ - u_char *ucp = inp; /* Pointer to current output char */ - int l = *len; /* Length left */ - - /* - * Reset all his options. - */ - BZERO(ho, sizeof(*ho)); - - /* - * Process all his options. - */ - next = inp; - while (l) { - orc = CONFACK; /* Assume success */ - cip = p = next; /* Remember begining of CI */ - if (l < 2 || /* Not enough data for CI header or */ - p[1] < 2 || /* CI length too small or */ - p[1] > l) { /* CI length too big? */ - IPXCPDEBUG(("ipxcp_reqci: bad CI length!")); - orc = CONFREJ; /* Reject bad CI */ - cilen = l; /* Reject till end of packet */ - l = 0; /* Don't loop again */ - goto endswitch; - } - GETCHAR(citype, p); /* Parse CI type */ - GETCHAR(cilen, p); /* Parse CI length */ - l -= cilen; /* Adjust remaining length */ - next += cilen; /* Step to next CI */ - - switch (citype) { /* Check CI type */ -/* - * The network number must match. Choose the larger of the two. - */ - case IPX_NETWORK_NUMBER: - /* if we wont negotiate the network number or the length is wrong - then reject the option */ - if ( !ao->neg_nn || cilen != CILEN_NETN ) { - orc = CONFREJ; - break; - } - GETLONG(cinetwork, p); - - /* If the network numbers match then acknowledge them. */ - if (cinetwork != 0) { - ho->his_network = cinetwork; - ho->neg_nn = 1; - if (wo->our_network == cinetwork) - break; -/* - * If the network number is not given or we don't accept their change or - * the network number is too small then NAK it. - */ - if (! ao->accept_network || cinetwork < wo->our_network) { - DECPTR (sizeof (u_int32_t), p); - PUTLONG (wo->our_network, p); - orc = CONFNAK; - } - break; - } -/* - * The peer sent '0' for the network. Give it ours if we have one. - */ - if (go->our_network != 0) { - DECPTR (sizeof (u_int32_t), p); - PUTLONG (wo->our_network, p); - orc = CONFNAK; -/* - * We don't have one. Reject the value. - */ - } else - orc = CONFREJ; - - break; -/* - * The node number is required - */ - case IPX_NODE_NUMBER: - /* if we wont negotiate the node number or the length is wrong - then reject the option */ - if ( cilen != CILEN_NODEN ) { - orc = CONFREJ; - break; - } - - copy_node (p, ho->his_node); - ho->neg_node = 1; -/* - * If the remote does not have a number and we do then NAK it with the value - * which we have for it. (We never have a default value of zero.) - */ - if (zero_node (ho->his_node)) { - orc = CONFNAK; - copy_node (wo->his_node, p); - INCPTR (sizeof (wo->his_node), p); - break; - } -/* - * If you have given me the expected network node number then I'll accept - * it now. - */ - if (compare_node (wo->his_node, ho->his_node)) { - orc = CONFACK; - ho->neg_node = 1; - INCPTR (sizeof (wo->his_node), p); - break; - } -/* - * If his node number is the same as ours then ask him to try the next - * value. - */ - if (compare_node (ho->his_node, go->our_node)) { - inc_node (ho->his_node); - orc = CONFNAK; - copy_node (ho->his_node, p); - INCPTR (sizeof (wo->his_node), p); - break; - } -/* - * If we don't accept a new value then NAK it. - */ - if (! ao->accept_remote) { - copy_node (wo->his_node, p); - INCPTR (sizeof (wo->his_node), p); - orc = CONFNAK; - break; - } - orc = CONFACK; - ho->neg_node = 1; - INCPTR (sizeof (wo->his_node), p); - break; -/* - * Compression is not desired at this time. It is always rejected. - */ - case IPX_COMPRESSION_PROTOCOL: - orc = CONFREJ; - break; -/* - * The routing protocol is a bitmask of various types. Any combination - * of the values RIP_SAP and NLSP are permissible. 'IPX_NONE' for no - * routing protocol must be specified only once. - */ - case IPX_ROUTER_PROTOCOL: - if ( !ao->neg_router || cilen < CILEN_PROTOCOL ) { - orc = CONFREJ; - break; - } - - GETSHORT (cishort, p); - - if (wo->neg_router == 0) { - wo->neg_router = 1; - wo->router = BIT(IPX_NONE); - } - - if ((cishort == IPX_NONE && ho->router != 0) || - (ho->router & BIT(IPX_NONE))) { - orc = CONFREJ; - break; - } - - cishort = BIT(cishort); - if (ho->router & cishort) { - orc = CONFREJ; - break; - } - - ho->router |= cishort; - ho->neg_router = 1; - - /* Finally do not allow a router protocol which we do not - support. */ - - if ((cishort & (ao->router | BIT(IPX_NONE))) == 0) { - int protocol; - - if (cishort == BIT(NLSP) && - (ao->router & BIT(RIP_SAP)) && - !wo->tried_rip) { - protocol = RIP_SAP; - wo->tried_rip = 1; - } else - protocol = IPX_NONE; - - DECPTR (sizeof (u_int16_t), p); - PUTSHORT (protocol, p); - orc = CONFNAK; - } - break; -/* - * The router name is advisorary. Just accept it if it is not too large. - */ - case IPX_ROUTER_NAME: - if (cilen >= CILEN_NAME) { - int name_size = cilen - CILEN_NAME; - if (name_size > sizeof (ho->name)) - name_size = sizeof (ho->name) - 1; - memset (ho->name, 0, sizeof (ho->name)); - memcpy (ho->name, p, name_size); - ho->name [name_size] = '\0'; - ho->neg_name = 1; - orc = CONFACK; - break; - } - orc = CONFREJ; - break; -/* - * This is advisorary. - */ - case IPX_COMPLETE: - if (cilen != CILEN_COMPLETE) - orc = CONFREJ; - else { - ho->neg_complete = 1; - orc = CONFACK; - } - break; -/* - * All other entries are not known at this time. - */ - default: - orc = CONFREJ; - break; - } -endswitch: - if (orc == CONFACK && /* Good CI */ - rc != CONFACK) /* but prior CI wasnt? */ - continue; /* Don't send this one */ - - if (orc == CONFNAK) { /* Nak this CI? */ - if (reject_if_disagree) /* Getting fed up with sending NAKs? */ - orc = CONFREJ; /* Get tough if so */ - if (rc == CONFREJ) /* Rejecting prior CI? */ - continue; /* Don't send this one */ - if (rc == CONFACK) { /* Ack'd all prior CIs? */ - rc = CONFNAK; /* Not anymore... */ - ucp = inp; /* Backup */ - } - } - - if (orc == CONFREJ && /* Reject this CI */ - rc != CONFREJ) { /* but no prior ones? */ - rc = CONFREJ; - ucp = inp; /* Backup */ - } - - /* Need to move CI? */ - if (ucp != cip) - BCOPY(cip, ucp, cilen); /* Move it */ - - /* Update output pointer */ - INCPTR(cilen, ucp); - } - - /* - * If we aren't rejecting this packet, and we want to negotiate - * their address, and they didn't send their address, then we - * send a NAK with a IPX_NODE_NUMBER option appended. We assume the - * input buffer is long enough that we can append the extra - * option safely. - */ - - if (rc != CONFREJ && !ho->neg_node && - wo->req_nn && !reject_if_disagree) { - if (rc == CONFACK) { - rc = CONFNAK; - wo->req_nn = 0; /* don't ask again */ - ucp = inp; /* reset pointer */ - } - - if (zero_node (wo->his_node)) - inc_node (wo->his_node); - - PUTCHAR (IPX_NODE_NUMBER, ucp); - PUTCHAR (CILEN_NODEN, ucp); - copy_node (wo->his_node, ucp); - INCPTR (sizeof (wo->his_node), ucp); - } - - *len = ucp - inp; /* Compute output length */ - IPXCPDEBUG(("ipxcp: returning Configure-%s", CODENAME(rc))); - return (rc); /* Return final code */ -} - -/* - * ipxcp_up - IPXCP has come UP. - * - * Configure the IP network interface appropriately and bring it up. - */ - -static void -ipxcp_up(f) - fsm *f; -{ - int unit = f->unit; - - IPXCPDEBUG(("ipxcp: up")); - - /* The default router protocol is RIP/SAP. */ - if (ho->router == 0) - ho->router = BIT(RIP_SAP); - - if (go->router == 0) - go->router = BIT(RIP_SAP); - - /* Fetch the network number */ - if (!ho->neg_nn) - ho->his_network = wo->his_network; - - if (!ho->neg_node) - copy_node (wo->his_node, ho->his_node); - - if (!wo->neg_node && !go->neg_node) - copy_node (wo->our_node, go->our_node); - - if (zero_node (go->our_node)) { - static char errmsg[] = "Could not determine local IPX node address"; - if (debug) - error(errmsg); - ipxcp_close(f->unit, errmsg); - return; - } - - go->network = go->our_network; - if (ho->his_network != 0 && ho->his_network > go->network) - go->network = ho->his_network; - - if (go->network == 0) { - static char errmsg[] = "Can not determine network number"; - if (debug) - error(errmsg); - ipxcp_close (unit, errmsg); - return; - } - - /* bring the interface up */ - if (!sifup(unit)) { - if (debug) - warn("sifup failed (IPX)"); - ipxcp_close(unit, "Interface configuration failed"); - return; - } - ipxcp_is_up = 1; - - /* set the network number for IPX */ - if (!sipxfaddr(unit, go->network, go->our_node)) { - if (debug) - warn("sipxfaddr failed"); - ipxcp_close(unit, "Interface configuration failed"); - return; - } - - np_up(f->unit, PPP_IPX); -} - -/* - * ipxcp_down - IPXCP has gone DOWN. - * - * Take the IP network interface down, clear its addresses - * and delete routes through it. - */ - -static void -ipxcp_down(f) - fsm *f; -{ - IPXCPDEBUG(("ipxcp: down")); - - if (!ipxcp_is_up) - return; - ipxcp_is_up = 0; - np_down(f->unit, PPP_IPX); - cipxfaddr(f->unit); - sifnpmode(f->unit, PPP_IPX, NPMODE_DROP); - sifdown(f->unit); -} - - -/* - * ipxcp_finished - possibly shut down the lower layers. - */ -static void -ipxcp_finished(f) - fsm *f; -{ - np_finished(f->unit, PPP_IPX); -} - - -/* - * ipxcp_printpkt - print the contents of an IPXCP packet. - */ -static char *ipxcp_codenames[] = { - "ConfReq", "ConfAck", "ConfNak", "ConfRej", - "TermReq", "TermAck", "CodeRej" -}; - -static int -ipxcp_printpkt(p, plen, printer, arg) - u_char *p; - int plen; - void (*printer) __P((void *, char *, ...)); - void *arg; -{ - int code, id, len, olen; - u_char *pstart, *optend; - u_short cishort; - u_int32_t cilong; - - if (plen < HEADERLEN) - return 0; - pstart = p; - GETCHAR(code, p); - GETCHAR(id, p); - GETSHORT(len, p); - if (len < HEADERLEN || len > plen) - return 0; - - if (code >= 1 && code <= sizeof(ipxcp_codenames) / sizeof(char *)) - printer(arg, " %s", ipxcp_codenames[code-1]); - else - printer(arg, " code=0x%x", code); - printer(arg, " id=0x%x", id); - len -= HEADERLEN; - switch (code) { - case CONFREQ: - case CONFACK: - case CONFNAK: - case CONFREJ: - /* print option list */ - while (len >= 2) { - GETCHAR(code, p); - GETCHAR(olen, p); - p -= 2; - if (olen < CILEN_VOID || olen > len) { - break; - } - printer(arg, " <"); - len -= olen; - optend = p + olen; - switch (code) { - case IPX_NETWORK_NUMBER: - if (olen == CILEN_NETN) { - p += 2; - GETLONG(cilong, p); - printer (arg, "network %s", ipx_ntoa (cilong)); - } - break; - case IPX_NODE_NUMBER: - if (olen == CILEN_NODEN) { - p += 2; - printer (arg, "node "); - while (p < optend) { - GETCHAR(code, p); - printer(arg, "%.2x", (int) (unsigned int) (unsigned char) code); - } - } - break; - case IPX_COMPRESSION_PROTOCOL: - if (olen == CILEN_COMPRESS) { - p += 2; - GETSHORT (cishort, p); - printer (arg, "compression %d", (int) cishort); - } - break; - case IPX_ROUTER_PROTOCOL: - if (olen == CILEN_PROTOCOL) { - p += 2; - GETSHORT (cishort, p); - printer (arg, "router proto %d", (int) cishort); - } - break; - case IPX_ROUTER_NAME: - if (olen >= CILEN_NAME) { - p += 2; - printer (arg, "router name \""); - while (p < optend) { - GETCHAR(code, p); - if (code >= 0x20 && code <= 0x7E) - printer (arg, "%c", (int) (unsigned int) (unsigned char) code); - else - printer (arg, " \\%.2x", (int) (unsigned int) (unsigned char) code); - } - printer (arg, "\""); - } - break; - case IPX_COMPLETE: - if (olen == CILEN_COMPLETE) { - p += 2; - printer (arg, "complete"); - } - break; - default: - break; - } - - while (p < optend) { - GETCHAR(code, p); - printer(arg, " %.2x", (int) (unsigned int) (unsigned char) code); - } - printer(arg, ">"); - } - break; - - case TERMACK: - case TERMREQ: - if (len > 0 && *p >= ' ' && *p < 0x7f) { - printer(arg, " "); - print_string(p, len, printer, arg); - p += len; - len = 0; - } - break; - } - - /* print the rest of the bytes in the packet */ - for (; len > 0; --len) { - GETCHAR(code, p); - printer(arg, " %.2x", (int) (unsigned int) (unsigned char) code); - } - - return p - pstart; -} -#endif /* ifdef IPX_CHANGE */ diff --git a/cpukit/pppd/ipxcp.h b/cpukit/pppd/ipxcp.h deleted file mode 100644 index 47f680d70c..0000000000 --- a/cpukit/pppd/ipxcp.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * ipxcp.h - IPX Control Protocol definitions. - * - * Copyright (c) 1989 Carnegie Mellon University. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by Carnegie Mellon University. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * $Id$ - */ - -/* - * Options. - */ -#define IPX_NETWORK_NUMBER 1 /* IPX Network Number */ -#define IPX_NODE_NUMBER 2 -#define IPX_COMPRESSION_PROTOCOL 3 -#define IPX_ROUTER_PROTOCOL 4 -#define IPX_ROUTER_NAME 5 -#define IPX_COMPLETE 6 - -/* Values for the router protocol */ -#define IPX_NONE 0 -#define RIP_SAP 2 -#define NLSP 4 - -typedef struct ipxcp_options { - bool neg_node; /* Negotiate IPX node number? */ - bool req_node; /* Ask peer to send IPX node number? */ - - bool neg_nn; /* Negotiate IPX network number? */ - bool req_nn; /* Ask peer to send IPX network number */ - - bool neg_name; /* Negotiate IPX router name */ - bool neg_complete; /* Negotiate completion */ - bool neg_router; /* Negotiate IPX router number */ - - bool accept_local; /* accept peer's value for ournode */ - bool accept_remote; /* accept peer's value for hisnode */ - bool accept_network; /* accept network number */ - - bool tried_nlsp; /* I have suggested NLSP already */ - bool tried_rip; /* I have suggested RIP/SAP already */ - - u_int32_t his_network; /* base network number */ - u_int32_t our_network; /* our value for network number */ - u_int32_t network; /* the final network number */ - - u_char his_node[6]; /* peer's node number */ - u_char our_node[6]; /* our node number */ - u_char name [48]; /* name of the router */ - int router; /* routing protocol */ -} ipxcp_options; - -extern fsm ipxcp_fsm[]; -extern ipxcp_options ipxcp_wantoptions[]; -extern ipxcp_options ipxcp_gotoptions[]; -extern ipxcp_options ipxcp_allowoptions[]; -extern ipxcp_options ipxcp_hisoptions[]; - -extern struct protent ipxcp_protent; diff --git a/cpukit/pppd/lcp.c b/cpukit/pppd/lcp.c deleted file mode 100644 index 781f5569ad..0000000000 --- a/cpukit/pppd/lcp.c +++ /dev/null @@ -1,1953 +0,0 @@ -/* - * lcp.c - PPP Link Control Protocol. - * - * Copyright (c) 1989 Carnegie Mellon University. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by Carnegie Mellon University. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#define RCSID "$Id$"; - -/* - * TODO: - */ - -#include -#include -#include - -#include "pppd.h" -#include "fsm.h" -#include "lcp.h" -#include "chap.h" -#include "magic.h" - -static const char rcsid[] = RCSID; - -/* - * LCP-related command-line options. - */ -int lcp_echo_interval = 0; /* Interval between LCP echo-requests */ -int lcp_echo_fails = 0; /* Tolerance to unanswered echo-requests */ -bool lax_recv = 0; /* accept control chars in asyncmap */ - -static int setescape __P((char **)); - -static option_t lcp_option_list[] = { - /* LCP options */ - { "noaccomp", o_bool, &lcp_wantoptions[0].neg_accompression, - "Disable address/control compression", - OPT_A2COPY, &lcp_allowoptions[0].neg_accompression }, - { "-ac", o_bool, &lcp_wantoptions[0].neg_accompression, - "Disable address/control compression", - OPT_A2COPY, &lcp_allowoptions[0].neg_accompression }, - { "default-asyncmap", o_bool, &lcp_wantoptions[0].neg_asyncmap, - "Disable asyncmap negotiation", - OPT_A2COPY, &lcp_allowoptions[0].neg_asyncmap }, - { "-am", o_bool, &lcp_wantoptions[0].neg_asyncmap, - "Disable asyncmap negotiation", - OPT_A2COPY, &lcp_allowoptions[0].neg_asyncmap }, - { "asyncmap", o_uint32, &lcp_wantoptions[0].asyncmap, - "Set asyncmap (for received packets)", - OPT_OR, &lcp_wantoptions[0].neg_asyncmap }, - { "-as", o_uint32, &lcp_wantoptions[0].asyncmap, - "Set asyncmap (for received packets)", - OPT_OR, &lcp_wantoptions[0].neg_asyncmap }, - { "nomagic", o_bool, &lcp_wantoptions[0].neg_magicnumber, - "Disable magic number negotiation (looped-back line detection)", - OPT_A2COPY, &lcp_allowoptions[0].neg_magicnumber }, - { "-mn", o_bool, &lcp_wantoptions[0].neg_magicnumber, - "Disable magic number negotiation (looped-back line detection)", - OPT_A2COPY, &lcp_allowoptions[0].neg_magicnumber }, - { "default-mru", o_bool, &lcp_wantoptions[0].neg_mru, - "Disable MRU negotiation (use default 1500)", - OPT_A2COPY, &lcp_allowoptions[0].neg_mru }, - { "-mru", o_bool, &lcp_wantoptions[0].neg_mru, - "Disable MRU negotiation (use default 1500)", - OPT_A2COPY, &lcp_allowoptions[0].neg_mru }, - { "mru", o_int, &lcp_wantoptions[0].mru, - "Set MRU (maximum received packet size) for negotiation", - 0, &lcp_wantoptions[0].neg_mru }, - { "nopcomp", o_bool, &lcp_wantoptions[0].neg_pcompression, - "Disable protocol field compression", - OPT_A2COPY, &lcp_allowoptions[0].neg_pcompression }, - { "-pc", o_bool, &lcp_wantoptions[0].neg_pcompression, - "Disable protocol field compression", - OPT_A2COPY, &lcp_allowoptions[0].neg_pcompression }, - { "-p", o_bool, &lcp_wantoptions[0].passive, - "Set passive mode", 1 }, - { "passive", o_bool, &lcp_wantoptions[0].passive, - "Set passive mode", 1 }, - { "silent", o_bool, &lcp_wantoptions[0].silent, - "Set silent mode", 1 }, - { "escape", o_special, setescape, - "List of character codes to escape on transmission" }, - { "lcp-echo-failure", o_int, &lcp_echo_fails, - "Set number of consecutive echo failures to indicate link failure" }, - { "lcp-echo-interval", o_int, &lcp_echo_interval, - "Set time in seconds between LCP echo requests" }, - { "lcp-restart", o_int, &lcp_fsm[0].timeouttime, - "Set time in seconds between LCP retransmissions" }, - { "lcp-max-terminate", o_int, &lcp_fsm[0].maxtermtransmits, - "Set maximum number of LCP terminate-request transmissions" }, - { "lcp-max-configure", o_int, &lcp_fsm[0].maxconfreqtransmits, - "Set maximum number of LCP configure-request transmissions" }, - { "lcp-max-failure", o_int, &lcp_fsm[0].maxnakloops, - "Set limit on number of LCP configure-naks" }, - { "receive-all", o_bool, &lax_recv, - "Accept all received control characters", 1 }, - {NULL} -}; - -/* global vars */ -fsm lcp_fsm[NUM_PPP]; /* LCP fsm structure (global)*/ -lcp_options lcp_wantoptions[NUM_PPP]; /* Options that we want to request */ -lcp_options lcp_gotoptions[NUM_PPP]; /* Options that peer ack'd */ -lcp_options lcp_allowoptions[NUM_PPP]; /* Options we allow peer to request */ -lcp_options lcp_hisoptions[NUM_PPP]; /* Options that we ack'd */ -u_int32_t xmit_accm[NUM_PPP][8]; /* extended transmit ACCM */ - -static int lcp_echos_pending = 0; /* Number of outstanding echo msgs */ -static int lcp_echo_number = 0; /* ID number of next echo frame */ -static int lcp_echo_timer_running = 0; /* set if a timer is running */ - -static u_char nak_buffer[PPP_MRU]; /* where we construct a nak packet */ - -/* - * Callbacks for fsm code. (CI = Configuration Information) - */ -static void lcp_resetci __P((fsm *)); /* Reset our CI */ -static int lcp_cilen __P((fsm *)); /* Return length of our CI */ -static void lcp_addci __P((fsm *, u_char *, int *)); /* Add our CI to pkt */ -static int lcp_ackci __P((fsm *, u_char *, int)); /* Peer ack'd our CI */ -static int lcp_nakci __P((fsm *, u_char *, int)); /* Peer nak'd our CI */ -static int lcp_rejci __P((fsm *, u_char *, int)); /* Peer rej'd our CI */ -static int lcp_reqci __P((fsm *, u_char *, int *, int)); /* Rcv peer CI */ -static void lcp_up __P((fsm *)); /* We're UP */ -static void lcp_down __P((fsm *)); /* We're DOWN */ -static void lcp_starting __P((fsm *)); /* We need lower layer up */ -static void lcp_finished __P((fsm *)); /* We need lower layer down */ -static int lcp_extcode __P((fsm *, int, int, u_char *, int)); -static void lcp_rprotrej __P((fsm *, u_char *, int)); - -/* - * routines to send LCP echos to peer - */ - -static void lcp_echo_lowerup __P((int)); -static void lcp_echo_lowerdown __P((int)); -static void LcpEchoTimeout __P((void *)); -static void lcp_received_echo_reply __P((fsm *, int, u_char *, int)); -static void LcpSendEchoRequest __P((fsm *)); -static void LcpLinkFailure __P((fsm *)); -static void LcpEchoCheck __P((fsm *)); - -static fsm_callbacks lcp_callbacks = { /* LCP callback routines */ - lcp_resetci, /* Reset our Configuration Information */ - lcp_cilen, /* Length of our Configuration Information */ - lcp_addci, /* Add our Configuration Information */ - lcp_ackci, /* ACK our Configuration Information */ - lcp_nakci, /* NAK our Configuration Information */ - lcp_rejci, /* Reject our Configuration Information */ - lcp_reqci, /* Request peer's Configuration Information */ - lcp_up, /* Called when fsm reaches OPENED state */ - lcp_down, /* Called when fsm leaves OPENED state */ - lcp_starting, /* Called when we want the lower layer up */ - lcp_finished, /* Called when we want the lower layer down */ - NULL, /* Called when Protocol-Reject received */ - NULL, /* Retransmission is necessary */ - lcp_extcode, /* Called to handle LCP-specific codes */ - "LCP" /* String name of protocol */ -}; - -/* - * Protocol entry points. - * Some of these are called directly. - */ - -static void lcp_init __P((int)); -static void lcp_input __P((int, u_char *, int)); -static void lcp_protrej __P((int)); -static int lcp_printpkt __P((u_char *, int, - void (*) __P((void *, char *, ...)), void *)); - -struct protent lcp_protent = { - PPP_LCP, - lcp_init, - lcp_input, - lcp_protrej, - lcp_lowerup, - lcp_lowerdown, - lcp_open, - lcp_close, - lcp_printpkt, - NULL, - 1, - "LCP", - NULL, - lcp_option_list, - NULL, - NULL, - NULL -}; - -int lcp_loopbackfail = DEFLOOPBACKFAIL; - -/* - * Length of each type of configuration option (in octets) - */ -#define CILEN_VOID 2 -#define CILEN_CHAR 3 -#define CILEN_SHORT 4 /* CILEN_VOID + 2 */ -#define CILEN_CHAP 5 /* CILEN_VOID + 2 + 1 */ -#define CILEN_LONG 6 /* CILEN_VOID + 4 */ -#define CILEN_LQR 8 /* CILEN_VOID + 2 + 4 */ -#define CILEN_CBCP 3 - -#define CODENAME(x) ((x) == CONFACK ? "ACK" : \ - (x) == CONFNAK ? "NAK" : "REJ") - - -/* - * setescape - add chars to the set we escape on transmission. - */ -static int -setescape(argv) - char **argv; -{ - int n, ret; - char *p, *endp; - - p = *argv; - ret = 1; - while (*p) { - n = strtol(p, &endp, 16); - if (p == endp) { - option_error("escape parameter contains invalid hex number '%s'", - p); - return 0; - } - p = endp; - if (n < 0 || n == 0x5E || n > 0xFF) { - option_error("can't escape character 0x%x", n); - ret = 0; - } else - xmit_accm[0][n >> 5] |= 1 << (n & 0x1F); - while (*p == ',' || *p == ' ') - ++p; - } - return ret; -} - -/* - * lcp_init - Initialize LCP. - */ -static void -lcp_init(unit) - int unit; -{ - fsm *f = &lcp_fsm[unit]; - lcp_options *wo = &lcp_wantoptions[unit]; - lcp_options *ao = &lcp_allowoptions[unit]; - - f->unit = unit; - f->protocol = PPP_LCP; - f->callbacks = &lcp_callbacks; - - fsm_init(f); - - wo->passive = 0; - wo->silent = 0; - wo->restart = 0; /* Set to 1 in kernels or multi-line - implementations */ - wo->neg_mru = 1; - wo->mru = DEFMRU; - wo->neg_asyncmap = 1; - wo->asyncmap = 0; - wo->neg_chap = 0; /* Set to 1 on server */ - wo->neg_upap = 0; /* Set to 1 on server */ - wo->chap_mdtype = CHAP_DIGEST_MD5; - wo->neg_magicnumber = 1; - wo->neg_pcompression = 1; - wo->neg_accompression = 1; - wo->neg_lqr = 0; /* no LQR implementation yet */ - wo->neg_cbcp = 0; - - ao->neg_mru = 1; - ao->mru = MAXMRU; - ao->neg_asyncmap = 1; - ao->asyncmap = 0; - ao->neg_chap = 1; - ao->chap_mdtype = CHAP_DIGEST_MD5; - ao->neg_upap = 1; - ao->neg_magicnumber = 1; - ao->neg_pcompression = 1; - ao->neg_accompression = 1; - ao->neg_lqr = 0; /* no LQR implementation yet */ -#ifdef CBCP_SUPPORT - ao->neg_cbcp = 1; -#else - ao->neg_cbcp = 0; -#endif - - memset(xmit_accm[unit], 0, sizeof(xmit_accm[0])); - xmit_accm[unit][3] = 0x60000000; -} - - -/* - * lcp_open - LCP is allowed to come up. - */ -void -lcp_open(unit) - int unit; -{ - fsm *f = &lcp_fsm[unit]; - lcp_options *wo = &lcp_wantoptions[unit]; - - f->flags = 0; - if (wo->passive) - f->flags |= OPT_PASSIVE; - if (wo->silent) - f->flags |= OPT_SILENT; - fsm_open(f); -} - - -/* - * lcp_close - Take LCP down. - */ -void -lcp_close(unit, reason) - int unit; - char *reason; -{ - fsm *f = &lcp_fsm[unit]; - - if (phase != PHASE_DEAD) - new_phase(PHASE_TERMINATE); - if (f->state == STOPPED && f->flags & (OPT_PASSIVE|OPT_SILENT)) { - /* - * This action is not strictly according to the FSM in RFC1548, - * but it does mean that the program terminates if you do a - * lcp_close() in passive/silent mode when a connection hasn't - * been established. - */ - f->state = CLOSED; - lcp_finished(f); - - } else - fsm_close(&lcp_fsm[unit], reason); -} - - -/* - * lcp_lowerup - The lower layer is up. - */ -void -lcp_lowerup(unit) - int unit; -{ - lcp_options *wo = &lcp_wantoptions[unit]; - - /* - * Don't use A/C or protocol compression on transmission, - * but accept A/C and protocol compressed packets - * if we are going to ask for A/C and protocol compression. - */ - ppp_set_xaccm(unit, xmit_accm[unit]); - ppp_send_config(unit, PPP_MRU, 0xffffffff, 0, 0); - ppp_recv_config(unit, PPP_MRU, (lax_recv? 0: 0xffffffff), - wo->neg_pcompression, wo->neg_accompression); - peer_mru[unit] = PPP_MRU; - lcp_allowoptions[unit].asyncmap = xmit_accm[unit][0]; - - fsm_lowerup(&lcp_fsm[unit]); -} - - -/* - * lcp_lowerdown - The lower layer is down. - */ -void -lcp_lowerdown(unit) - int unit; -{ - fsm_lowerdown(&lcp_fsm[unit]); -} - - -/* - * lcp_input - Input LCP packet. - */ -static void -lcp_input(unit, p, len) - int unit; - u_char *p; - int len; -{ - fsm *f = &lcp_fsm[unit]; - - fsm_input(f, p, len); -} - - -/* - * lcp_extcode - Handle a LCP-specific code. - */ -static int -lcp_extcode(f, code, id, inp, len) - fsm *f; - int code, id; - u_char *inp; - int len; -{ - u_char *magp; - - switch( code ){ - case PROTREJ: - lcp_rprotrej(f, inp, len); - break; - - case ECHOREQ: - if (f->state != OPENED) - break; - magp = inp; - PUTLONG(lcp_gotoptions[f->unit].magicnumber, magp); - fsm_sdata(f, ECHOREP, id, inp, len); - break; - - case ECHOREP: - lcp_received_echo_reply(f, id, inp, len); - break; - - case DISCREQ: - break; - - default: - return 0; - } - return 1; -} - - -/* - * lcp_rprotrej - Receive an Protocol-Reject. - * - * Figure out which protocol is rejected and inform it. - */ -static void -lcp_rprotrej(f, inp, len) - fsm *f; - u_char *inp; - int len; -{ - int i; - struct protent *protp; - u_short prot; - - if (len < 2) { - LCPDEBUG(("lcp_rprotrej: Rcvd short Protocol-Reject packet!")); - return; - } - - GETSHORT(prot, inp); - - /* - * Protocol-Reject packets received in any state other than the LCP - * OPENED state SHOULD be silently discarded. - */ - if( f->state != OPENED ){ - LCPDEBUG(("Protocol-Reject discarded: LCP in state %d", f->state)); - return; - } - - /* - * Upcall the proper Protocol-Reject routine. - */ - for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->protocol == prot && protp->enabled_flag) { - (*protp->protrej)(f->unit); - return; - } - - warn("Protocol-Reject for unsupported protocol 0x%x", prot); -} - - -/* - * lcp_protrej - A Protocol-Reject was received. - */ -/*ARGSUSED*/ -static void -lcp_protrej(unit) - int unit; -{ - /* - * Can't reject LCP! - */ - error("Received Protocol-Reject for LCP!"); - fsm_protreject(&lcp_fsm[unit]); -} - - -/* - * lcp_sprotrej - Send a Protocol-Reject for some protocol. - */ -void -lcp_sprotrej(unit, p, len) - int unit; - u_char *p; - int len; -{ - /* - * Send back the protocol and the information field of the - * rejected packet. We only get here if LCP is in the OPENED state. - */ - p += 2; - len -= 2; - - fsm_sdata(&lcp_fsm[unit], PROTREJ, ++lcp_fsm[unit].id, - p, len); -} - - -/* - * lcp_resetci - Reset our CI. - */ -static void -lcp_resetci(f) - fsm *f; -{ - lcp_wantoptions[f->unit].magicnumber = magic(); - lcp_wantoptions[f->unit].numloops = 0; - lcp_gotoptions[f->unit] = lcp_wantoptions[f->unit]; - peer_mru[f->unit] = PPP_MRU; - auth_reset(f->unit); -} - - -/* - * lcp_cilen - Return length of our CI. - */ -static int -lcp_cilen(f) - fsm *f; -{ - lcp_options *go = &lcp_gotoptions[f->unit]; - -#define LENCIVOID(neg) ((neg) ? CILEN_VOID : 0) -#define LENCICHAP(neg) ((neg) ? CILEN_CHAP : 0) -#define LENCISHORT(neg) ((neg) ? CILEN_SHORT : 0) -#define LENCILONG(neg) ((neg) ? CILEN_LONG : 0) -#define LENCILQR(neg) ((neg) ? CILEN_LQR: 0) -#define LENCICBCP(neg) ((neg) ? CILEN_CBCP: 0) - /* - * NB: we only ask for one of CHAP and UPAP, even if we will - * accept either. - */ - return (LENCISHORT(go->neg_mru && go->mru != DEFMRU) + - LENCILONG(go->neg_asyncmap && go->asyncmap != 0xFFFFFFFF) + - LENCICHAP(go->neg_chap) + - LENCISHORT(!go->neg_chap && go->neg_upap) + - LENCILQR(go->neg_lqr) + - LENCICBCP(go->neg_cbcp) + - LENCILONG(go->neg_magicnumber) + - LENCIVOID(go->neg_pcompression) + - LENCIVOID(go->neg_accompression)); -} - - -/* - * lcp_addci - Add our desired CIs to a packet. - */ -static void -lcp_addci(f, ucp, lenp) - fsm *f; - u_char *ucp; - int *lenp; -{ - lcp_options *go = &lcp_gotoptions[f->unit]; - u_char *start_ucp = ucp; - -#define ADDCIVOID(opt, neg) \ - if (neg) { \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_VOID, ucp); \ - } -#define ADDCISHORT(opt, neg, val) \ - if (neg) { \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_SHORT, ucp); \ - PUTSHORT(val, ucp); \ - } -#define ADDCICHAP(opt, neg, val, digest) \ - if (neg) { \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_CHAP, ucp); \ - PUTSHORT(val, ucp); \ - PUTCHAR(digest, ucp); \ - } -#define ADDCILONG(opt, neg, val) \ - if (neg) { \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_LONG, ucp); \ - PUTLONG(val, ucp); \ - } -#define ADDCILQR(opt, neg, val) \ - if (neg) { \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_LQR, ucp); \ - PUTSHORT(PPP_LQR, ucp); \ - PUTLONG(val, ucp); \ - } -#define ADDCICHAR(opt, neg, val) \ - if (neg) { \ - PUTCHAR(opt, ucp); \ - PUTCHAR(CILEN_CHAR, ucp); \ - PUTCHAR(val, ucp); \ - } - - ADDCISHORT(CI_MRU, go->neg_mru && go->mru != DEFMRU, go->mru); - ADDCILONG(CI_ASYNCMAP, go->neg_asyncmap && go->asyncmap != 0xFFFFFFFF, - go->asyncmap); - ADDCICHAP(CI_AUTHTYPE, go->neg_chap, PPP_CHAP, go->chap_mdtype); - ADDCISHORT(CI_AUTHTYPE, !go->neg_chap && go->neg_upap, PPP_PAP); - ADDCILQR(CI_QUALITY, go->neg_lqr, go->lqr_period); - ADDCICHAR(CI_CALLBACK, go->neg_cbcp, CBCP_OPT); - ADDCILONG(CI_MAGICNUMBER, go->neg_magicnumber, go->magicnumber); - ADDCIVOID(CI_PCOMPRESSION, go->neg_pcompression); - ADDCIVOID(CI_ACCOMPRESSION, go->neg_accompression); - - if (ucp - start_ucp != *lenp) { - /* this should never happen, because peer_mtu should be 1500 */ - error("Bug in lcp_addci: wrong length"); - } -} - - -/* - * lcp_ackci - Ack our CIs. - * This should not modify any state if the Ack is bad. - * - * Returns: - * 0 - Ack was bad. - * 1 - Ack was good. - */ -static int -lcp_ackci(f, p, len) - fsm *f; - u_char *p; - int len; -{ - lcp_options *go = &lcp_gotoptions[f->unit]; - u_char cilen, citype, cichar; - u_short cishort; - u_int32_t cilong; - - /* - * CIs must be in exactly the same order that we sent. - * Check packet length and CI length at each step. - * If we find any deviations, then this packet is bad. - */ -#define ACKCIVOID(opt, neg) \ - if (neg) { \ - if ((len -= CILEN_VOID) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_VOID || \ - citype != opt) \ - goto bad; \ - } -#define ACKCISHORT(opt, neg, val) \ - if (neg) { \ - if ((len -= CILEN_SHORT) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_SHORT || \ - citype != opt) \ - goto bad; \ - GETSHORT(cishort, p); \ - if (cishort != val) \ - goto bad; \ - } -#define ACKCICHAR(opt, neg, val) \ - if (neg) { \ - if ((len -= CILEN_CHAR) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_CHAR || \ - citype != opt) \ - goto bad; \ - GETCHAR(cichar, p); \ - if (cichar != val) \ - goto bad; \ - } -#define ACKCICHAP(opt, neg, val, digest) \ - if (neg) { \ - if ((len -= CILEN_CHAP) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_CHAP || \ - citype != opt) \ - goto bad; \ - GETSHORT(cishort, p); \ - if (cishort != val) \ - goto bad; \ - GETCHAR(cichar, p); \ - if (cichar != digest) \ - goto bad; \ - } -#define ACKCILONG(opt, neg, val) \ - if (neg) { \ - if ((len -= CILEN_LONG) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_LONG || \ - citype != opt) \ - goto bad; \ - GETLONG(cilong, p); \ - if (cilong != val) \ - goto bad; \ - } -#define ACKCILQR(opt, neg, val) \ - if (neg) { \ - if ((len -= CILEN_LQR) < 0) \ - goto bad; \ - GETCHAR(citype, p); \ - GETCHAR(cilen, p); \ - if (cilen != CILEN_LQR || \ - citype != opt) \ - goto bad; \ - GETSHORT(cishort, p); \ - if (cishort != PPP_LQR) \ - goto bad; \ - GETLONG(cilong, p); \ - if (cilong != val) \ - goto bad; \ - } - - ACKCISHORT(CI_MRU, go->neg_mru && go->mru != DEFMRU, go->mru); - ACKCILONG(CI_ASYNCMAP, go->neg_asyncmap && go->asyncmap != 0xFFFFFFFF, - go->asyncmap); - ACKCICHAP(CI_AUTHTYPE, go->neg_chap, PPP_CHAP, go->chap_mdtype); - ACKCISHORT(CI_AUTHTYPE, !go->neg_chap && go->neg_upap, PPP_PAP); - ACKCILQR(CI_QUALITY, go->neg_lqr, go->lqr_period); - ACKCICHAR(CI_CALLBACK, go->neg_cbcp, CBCP_OPT); - ACKCILONG(CI_MAGICNUMBER, go->neg_magicnumber, go->magicnumber); - ACKCIVOID(CI_PCOMPRESSION, go->neg_pcompression); - ACKCIVOID(CI_ACCOMPRESSION, go->neg_accompression); - - /* - * If there are any remaining CIs, then this packet is bad. - */ - if (len != 0) - goto bad; - return (1); -bad: - LCPDEBUG(("lcp_acki: received bad Ack!")); - return (0); -} - - -/* - * lcp_nakci - Peer has sent a NAK for some of our CIs. - * This should not modify any state if the Nak is bad - * or if LCP is in the OPENED state. - * - * Returns: - * 0 - Nak was bad. - * 1 - Nak was good. - */ -static int -lcp_nakci(f, p, len) - fsm *f; - u_char *p; - int len; -{ - lcp_options *go = &lcp_gotoptions[f->unit]; - lcp_options *wo = &lcp_wantoptions[f->unit]; - u_char citype, cichar, *next; - u_short cishort; - u_int32_t cilong; - lcp_options no; /* options we've seen Naks for */ - lcp_options try; /* options to request next time */ - int looped_back = 0; - int cilen; - - BZERO(&no, sizeof(no)); - try = *go; - - /* - * Any Nak'd CIs must be in exactly the same order that we sent. - * Check packet length and CI length at each step. - * If we find any deviations, then this packet is bad. - */ -#define NAKCIVOID(opt, neg, code) \ - if (go->neg && \ - len >= CILEN_VOID && \ - p[1] == CILEN_VOID && \ - p[0] == opt) { \ - len -= CILEN_VOID; \ - INCPTR(CILEN_VOID, p); \ - no.neg = 1; \ - code \ - } -#define NAKCICHAP(opt, neg, code) \ - if (go->neg && \ - len >= CILEN_CHAP && \ - p[1] == CILEN_CHAP && \ - p[0] == opt) { \ - len -= CILEN_CHAP; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - GETCHAR(cichar, p); \ - no.neg = 1; \ - code \ - } -#define NAKCICHAR(opt, neg, code) \ - if (go->neg && \ - len >= CILEN_CHAR && \ - p[1] == CILEN_CHAR && \ - p[0] == opt) { \ - len -= CILEN_CHAR; \ - INCPTR(2, p); \ - GETCHAR(cichar, p); \ - no.neg = 1; \ - code \ - } -#define NAKCISHORT(opt, neg, code) \ - if (go->neg && \ - len >= CILEN_SHORT && \ - p[1] == CILEN_SHORT && \ - p[0] == opt) { \ - len -= CILEN_SHORT; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - no.neg = 1; \ - code \ - } -#define NAKCILONG(opt, neg, code) \ - if (go->neg && \ - len >= CILEN_LONG && \ - p[1] == CILEN_LONG && \ - p[0] == opt) { \ - len -= CILEN_LONG; \ - INCPTR(2, p); \ - GETLONG(cilong, p); \ - no.neg = 1; \ - code \ - } -#define NAKCILQR(opt, neg, code) \ - if (go->neg && \ - len >= CILEN_LQR && \ - p[1] == CILEN_LQR && \ - p[0] == opt) { \ - len -= CILEN_LQR; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - GETLONG(cilong, p); \ - no.neg = 1; \ - code \ - } - - /* - * We don't care if they want to send us smaller packets than - * we want. Therefore, accept any MRU less than what we asked for, - * but then ignore the new value when setting the MRU in the kernel. - * If they send us a bigger MRU than what we asked, accept it, up to - * the limit of the default MRU we'd get if we didn't negotiate. - */ - if (go->neg_mru && go->mru != DEFMRU) { - NAKCISHORT(CI_MRU, neg_mru, - if (cishort <= wo->mru || cishort <= DEFMRU) - try.mru = cishort; - ); - } - - /* - * Add any characters they want to our (receive-side) asyncmap. - */ - if (go->neg_asyncmap && go->asyncmap != 0xFFFFFFFF) { - NAKCILONG(CI_ASYNCMAP, neg_asyncmap, - try.asyncmap = go->asyncmap | cilong; - ); - } - - /* - * If they've nak'd our authentication-protocol, check whether - * they are proposing a different protocol, or a different - * hash algorithm for CHAP. - */ - if ((go->neg_chap || go->neg_upap) - && len >= CILEN_SHORT - && p[0] == CI_AUTHTYPE && p[1] >= CILEN_SHORT && p[1] <= len) { - cilen = p[1]; - len -= cilen; - no.neg_chap = go->neg_chap; - no.neg_upap = go->neg_upap; - INCPTR(2, p); - GETSHORT(cishort, p); - if (cishort == PPP_PAP && cilen == CILEN_SHORT) { - /* - * If we were asking for CHAP, they obviously don't want to do it. - * If we weren't asking for CHAP, then we were asking for PAP, - * in which case this Nak is bad. - */ - if (!go->neg_chap) - goto bad; - try.neg_chap = 0; - - } else if (cishort == PPP_CHAP && cilen == CILEN_CHAP) { - GETCHAR(cichar, p); - if (go->neg_chap) { - /* - * We were asking for CHAP/MD5; they must want a different - * algorithm. If they can't do MD5, we can ask for M$-CHAP - * if we support it, otherwise we'll have to stop - * asking for CHAP. - */ - if (cichar != go->chap_mdtype) { -#ifdef CHAPMS - if (cichar == CHAP_MICROSOFT) - go->chap_mdtype = CHAP_MICROSOFT; - else -#endif /* CHAPMS */ - try.neg_chap = 0; - } - } else { - /* - * Stop asking for PAP if we were asking for it. - */ - try.neg_upap = 0; - } - - } else { - /* - * We don't recognize what they're suggesting. - * Stop asking for what we were asking for. - */ - if (go->neg_chap) - try.neg_chap = 0; - else - try.neg_upap = 0; - p += cilen - CILEN_SHORT; - } - } - - /* - * If they can't cope with our link quality protocol, we'll have - * to stop asking for LQR. We haven't got any other protocol. - * If they Nak the reporting period, take their value XXX ? - */ - NAKCILQR(CI_QUALITY, neg_lqr, - if (cishort != PPP_LQR) - try.neg_lqr = 0; - else - try.lqr_period = cilong; - ); - - /* - * Only implementing CBCP...not the rest of the callback options - */ - NAKCICHAR(CI_CALLBACK, neg_cbcp, - try.neg_cbcp = 0; - ); - - /* - * Check for a looped-back line. - */ - NAKCILONG(CI_MAGICNUMBER, neg_magicnumber, - try.magicnumber = magic(); - looped_back = 1; - ); - - /* - * Peer shouldn't send Nak for protocol compression or - * address/control compression requests; they should send - * a Reject instead. If they send a Nak, treat it as a Reject. - */ - NAKCIVOID(CI_PCOMPRESSION, neg_pcompression, - try.neg_pcompression = 0; - ); - NAKCIVOID(CI_ACCOMPRESSION, neg_accompression, - try.neg_accompression = 0; - ); - - /* - * There may be remaining CIs, if the peer is requesting negotiation - * on an option that we didn't include in our request packet. - * If we see an option that we requested, or one we've already seen - * in this packet, then this packet is bad. - * If we wanted to respond by starting to negotiate on the requested - * option(s), we could, but we don't, because except for the - * authentication type and quality protocol, if we are not negotiating - * an option, it is because we were told not to. - * For the authentication type, the Nak from the peer means - * `let me authenticate myself with you' which is a bit pointless. - * For the quality protocol, the Nak means `ask me to send you quality - * reports', but if we didn't ask for them, we don't want them. - * An option we don't recognize represents the peer asking to - * negotiate some option we don't support, so ignore it. - */ - while (len > CILEN_VOID) { - GETCHAR(citype, p); - GETCHAR(cilen, p); - if (cilen < CILEN_VOID || (len -= cilen) < 0) - goto bad; - next = p + cilen - 2; - - switch (citype) { - case CI_MRU: - if ((go->neg_mru && go->mru != DEFMRU) - || no.neg_mru || cilen != CILEN_SHORT) - goto bad; - GETSHORT(cishort, p); - if (cishort < DEFMRU) - try.mru = cishort; - break; - case CI_ASYNCMAP: - if ((go->neg_asyncmap && go->asyncmap != 0xFFFFFFFF) - || no.neg_asyncmap || cilen != CILEN_LONG) - goto bad; - break; - case CI_AUTHTYPE: - if (go->neg_chap || no.neg_chap || go->neg_upap || no.neg_upap) - goto bad; - break; - case CI_MAGICNUMBER: - if (go->neg_magicnumber || no.neg_magicnumber || - cilen != CILEN_LONG) - goto bad; - break; - case CI_PCOMPRESSION: - if (go->neg_pcompression || no.neg_pcompression - || cilen != CILEN_VOID) - goto bad; - break; - case CI_ACCOMPRESSION: - if (go->neg_accompression || no.neg_accompression - || cilen != CILEN_VOID) - goto bad; - break; - case CI_QUALITY: - if (go->neg_lqr || no.neg_lqr || cilen != CILEN_LQR) - goto bad; - break; - } - p = next; - } - - /* - * OK, the Nak is good. Now we can update state. - * If there are any options left we ignore them. - */ - if (f->state != OPENED) { - if (looped_back) { - if (++try.numloops >= lcp_loopbackfail) { - notice("Serial line is looped back."); - lcp_close(f->unit, "Loopback detected"); - status = EXIT_LOOPBACK; - } - } else - try.numloops = 0; - *go = try; - } - - return 1; - -bad: - LCPDEBUG(("lcp_nakci: received bad Nak!")); - return 0; -} - - -/* - * lcp_rejci - Peer has Rejected some of our CIs. - * This should not modify any state if the Reject is bad - * or if LCP is in the OPENED state. - * - * Returns: - * 0 - Reject was bad. - * 1 - Reject was good. - */ -static int -lcp_rejci(f, p, len) - fsm *f; - u_char *p; - int len; -{ - lcp_options *go = &lcp_gotoptions[f->unit]; - u_char cichar; - u_short cishort; - u_int32_t cilong; - lcp_options try; /* options to request next time */ - - try = *go; - - /* - * Any Rejected CIs must be in exactly the same order that we sent. - * Check packet length and CI length at each step. - * If we find any deviations, then this packet is bad. - */ -#define REJCIVOID(opt, neg) \ - if (go->neg && \ - len >= CILEN_VOID && \ - p[1] == CILEN_VOID && \ - p[0] == opt) { \ - len -= CILEN_VOID; \ - INCPTR(CILEN_VOID, p); \ - try.neg = 0; \ - } -#define REJCISHORT(opt, neg, val) \ - if (go->neg && \ - len >= CILEN_SHORT && \ - p[1] == CILEN_SHORT && \ - p[0] == opt) { \ - len -= CILEN_SHORT; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - /* Check rejected value. */ \ - if (cishort != val) \ - goto bad; \ - try.neg = 0; \ - } -#define REJCICHAP(opt, neg, val, digest) \ - if (go->neg && \ - len >= CILEN_CHAP && \ - p[1] == CILEN_CHAP && \ - p[0] == opt) { \ - len -= CILEN_CHAP; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - GETCHAR(cichar, p); \ - /* Check rejected value. */ \ - if (cishort != val || cichar != digest) \ - goto bad; \ - try.neg = 0; \ - try.neg_upap = 0; \ - } -#define REJCILONG(opt, neg, val) \ - if (go->neg && \ - len >= CILEN_LONG && \ - p[1] == CILEN_LONG && \ - p[0] == opt) { \ - len -= CILEN_LONG; \ - INCPTR(2, p); \ - GETLONG(cilong, p); \ - /* Check rejected value. */ \ - if (cilong != val) \ - goto bad; \ - try.neg = 0; \ - } -#define REJCILQR(opt, neg, val) \ - if (go->neg && \ - len >= CILEN_LQR && \ - p[1] == CILEN_LQR && \ - p[0] == opt) { \ - len -= CILEN_LQR; \ - INCPTR(2, p); \ - GETSHORT(cishort, p); \ - GETLONG(cilong, p); \ - /* Check rejected value. */ \ - if (cishort != PPP_LQR || cilong != val) \ - goto bad; \ - try.neg = 0; \ - } -#define REJCICBCP(opt, neg, val) \ - if (go->neg && \ - len >= CILEN_CBCP && \ - p[1] == CILEN_CBCP && \ - p[0] == opt) { \ - len -= CILEN_CBCP; \ - INCPTR(2, p); \ - GETCHAR(cichar, p); \ - /* Check rejected value. */ \ - if (cichar != val) \ - goto bad; \ - try.neg = 0; \ - } - - REJCISHORT(CI_MRU, neg_mru, go->mru); - REJCILONG(CI_ASYNCMAP, neg_asyncmap, go->asyncmap); - REJCICHAP(CI_AUTHTYPE, neg_chap, PPP_CHAP, go->chap_mdtype); - if (!go->neg_chap) { - REJCISHORT(CI_AUTHTYPE, neg_upap, PPP_PAP); - } - REJCILQR(CI_QUALITY, neg_lqr, go->lqr_period); - REJCICBCP(CI_CALLBACK, neg_cbcp, CBCP_OPT); - REJCILONG(CI_MAGICNUMBER, neg_magicnumber, go->magicnumber); - REJCIVOID(CI_PCOMPRESSION, neg_pcompression); - REJCIVOID(CI_ACCOMPRESSION, neg_accompression); - - /* - * If there are any remaining CIs, then this packet is bad. - */ - if (len != 0) - goto bad; - /* - * Now we can update state. - */ - if (f->state != OPENED) - *go = try; - return 1; - -bad: - LCPDEBUG(("lcp_rejci: received bad Reject!")); - return 0; -} - - -/* - * lcp_reqci - Check the peer's requested CIs and send appropriate response. - * - * Returns: CONFACK, CONFNAK or CONFREJ and input packet modified - * appropriately. If reject_if_disagree is non-zero, doesn't return - * CONFNAK; returns CONFREJ if it can't return CONFACK. - */ -static int -lcp_reqci(f, inp, lenp, reject_if_disagree) - fsm *f; - u_char *inp; /* Requested CIs */ - int *lenp; /* Length of requested CIs */ - int reject_if_disagree; -{ - lcp_options *go = &lcp_gotoptions[f->unit]; - lcp_options *ho = &lcp_hisoptions[f->unit]; - lcp_options *ao = &lcp_allowoptions[f->unit]; - u_char *cip, *next; /* Pointer to current and next CIs */ - int cilen, citype, cichar; /* Parsed len, type, char value */ - u_short cishort; /* Parsed short value */ - u_int32_t cilong; /* Parse long value */ - int rc = CONFACK; /* Final packet return code */ - int orc; /* Individual option return code */ - u_char *p; /* Pointer to next char to parse */ - u_char *rejp; /* Pointer to next char in reject frame */ - u_char *nakp; /* Pointer to next char in Nak frame */ - int l = *lenp; /* Length left */ - - /* - * Reset all his options. - */ - BZERO(ho, sizeof(*ho)); - - /* - * Process all his options. - */ - next = inp; - nakp = nak_buffer; - rejp = inp; - while (l) { - orc = CONFACK; /* Assume success */ - cip = p = next; /* Remember begining of CI */ - if (l < 2 || /* Not enough data for CI header or */ - p[1] < 2 || /* CI length too small or */ - p[1] > l) { /* CI length too big? */ - LCPDEBUG(("lcp_reqci: bad CI length!")); - orc = CONFREJ; /* Reject bad CI */ - cilen = l; /* Reject till end of packet */ - l = 0; /* Don't loop again */ - citype = 0; - goto endswitch; - } - GETCHAR(citype, p); /* Parse CI type */ - GETCHAR(cilen, p); /* Parse CI length */ - l -= cilen; /* Adjust remaining length */ - next += cilen; /* Step to next CI */ - - switch (citype) { /* Check CI type */ - case CI_MRU: - if (!ao->neg_mru || /* Allow option? */ - cilen != CILEN_SHORT) { /* Check CI length */ - orc = CONFREJ; /* Reject CI */ - break; - } - GETSHORT(cishort, p); /* Parse MRU */ - - /* - * He must be able to receive at least our minimum. - * No need to check a maximum. If he sends a large number, - * we'll just ignore it. - */ - if (cishort < MINMRU) { - orc = CONFNAK; /* Nak CI */ - PUTCHAR(CI_MRU, nakp); - PUTCHAR(CILEN_SHORT, nakp); - PUTSHORT(MINMRU, nakp); /* Give him a hint */ - break; - } - ho->neg_mru = 1; /* Remember he sent MRU */ - ho->mru = cishort; /* And remember value */ - break; - - case CI_ASYNCMAP: - if (!ao->neg_asyncmap || - cilen != CILEN_LONG) { - orc = CONFREJ; - break; - } - GETLONG(cilong, p); - - /* - * Asyncmap must have set at least the bits - * which are set in lcp_allowoptions[unit].asyncmap. - */ - if ((ao->asyncmap & ~cilong) != 0) { - orc = CONFNAK; - PUTCHAR(CI_ASYNCMAP, nakp); - PUTCHAR(CILEN_LONG, nakp); - PUTLONG(ao->asyncmap | cilong, nakp); - break; - } - ho->neg_asyncmap = 1; - ho->asyncmap = cilong; - break; - - case CI_AUTHTYPE: - if (cilen < CILEN_SHORT || - !(ao->neg_upap || ao->neg_chap)) { - /* - * Reject the option if we're not willing to authenticate. - */ - orc = CONFREJ; - break; - } - GETSHORT(cishort, p); - - /* - * Authtype must be PAP or CHAP. - * - * Note: if both ao->neg_upap and ao->neg_chap are set, - * and the peer sends a Configure-Request with two - * authenticate-protocol requests, one for CHAP and one - * for UPAP, then we will reject the second request. - * Whether we end up doing CHAP or UPAP depends then on - * the ordering of the CIs in the peer's Configure-Request. - */ - - if (cishort == PPP_PAP) { - if (ho->neg_chap || /* we've already accepted CHAP */ - cilen != CILEN_SHORT) { - LCPDEBUG(("lcp_reqci: rcvd AUTHTYPE PAP, rejecting...")); - orc = CONFREJ; - break; - } - if (!ao->neg_upap) { /* we don't want to do PAP */ - orc = CONFNAK; /* NAK it and suggest CHAP */ - PUTCHAR(CI_AUTHTYPE, nakp); - PUTCHAR(CILEN_CHAP, nakp); - PUTSHORT(PPP_CHAP, nakp); - PUTCHAR(ao->chap_mdtype, nakp); - /* XXX if we can do CHAP_MICROSOFT as well, we should - probably put in another option saying so */ - break; - } - ho->neg_upap = 1; - break; - } - if (cishort == PPP_CHAP) { - if (ho->neg_upap || /* we've already accepted PAP */ - cilen != CILEN_CHAP) { - LCPDEBUG(("lcp_reqci: rcvd AUTHTYPE CHAP, rejecting...")); - orc = CONFREJ; - break; - } - if (!ao->neg_chap) { /* we don't want to do CHAP */ - orc = CONFNAK; /* NAK it and suggest PAP */ - PUTCHAR(CI_AUTHTYPE, nakp); - PUTCHAR(CILEN_SHORT, nakp); - PUTSHORT(PPP_PAP, nakp); - break; - } - GETCHAR(cichar, p); /* get digest type*/ - if (cichar != CHAP_DIGEST_MD5 -#ifdef CHAPMS - && cichar != CHAP_MICROSOFT -#endif - ) { - orc = CONFNAK; - PUTCHAR(CI_AUTHTYPE, nakp); - PUTCHAR(CILEN_CHAP, nakp); - PUTSHORT(PPP_CHAP, nakp); - PUTCHAR(ao->chap_mdtype, nakp); - break; - } - ho->chap_mdtype = cichar; /* save md type */ - ho->neg_chap = 1; - break; - } - - /* - * We don't recognize the protocol they're asking for. - * Nak it with something we're willing to do. - * (At this point we know ao->neg_upap || ao->neg_chap.) - */ - orc = CONFNAK; - PUTCHAR(CI_AUTHTYPE, nakp); - if (ao->neg_chap) { - PUTCHAR(CILEN_CHAP, nakp); - PUTSHORT(PPP_CHAP, nakp); - PUTCHAR(ao->chap_mdtype, nakp); - } else { - PUTCHAR(CILEN_SHORT, nakp); - PUTSHORT(PPP_PAP, nakp); - } - break; - - case CI_QUALITY: - if (!ao->neg_lqr || - cilen != CILEN_LQR) { - orc = CONFREJ; - break; - } - - GETSHORT(cishort, p); - GETLONG(cilong, p); - - /* - * Check the protocol and the reporting period. - * XXX When should we Nak this, and what with? - */ - if (cishort != PPP_LQR) { - orc = CONFNAK; - PUTCHAR(CI_QUALITY, nakp); - PUTCHAR(CILEN_LQR, nakp); - PUTSHORT(PPP_LQR, nakp); - PUTLONG(ao->lqr_period, nakp); - break; - } - break; - - case CI_MAGICNUMBER: - if (!(ao->neg_magicnumber || go->neg_magicnumber) || - cilen != CILEN_LONG) { - orc = CONFREJ; - break; - } - GETLONG(cilong, p); - - /* - * He must have a different magic number. - */ - if (go->neg_magicnumber && - cilong == go->magicnumber) { - cilong = magic(); /* Don't put magic() inside macro! */ - orc = CONFNAK; - PUTCHAR(CI_MAGICNUMBER, nakp); - PUTCHAR(CILEN_LONG, nakp); - PUTLONG(cilong, nakp); - break; - } - ho->neg_magicnumber = 1; - ho->magicnumber = cilong; - break; - - - case CI_PCOMPRESSION: - if (!ao->neg_pcompression || - cilen != CILEN_VOID) { - orc = CONFREJ; - break; - } - ho->neg_pcompression = 1; - break; - - case CI_ACCOMPRESSION: - if (!ao->neg_accompression || - cilen != CILEN_VOID) { - orc = CONFREJ; - break; - } - ho->neg_accompression = 1; - break; - - default: - LCPDEBUG(("lcp_reqci: rcvd unknown option %d", citype)); - orc = CONFREJ; - break; - } - -endswitch: - if (orc == CONFACK && /* Good CI */ - rc != CONFACK) /* but prior CI wasnt? */ - continue; /* Don't send this one */ - - if (orc == CONFNAK) { /* Nak this CI? */ - if (reject_if_disagree /* Getting fed up with sending NAKs? */ - && citype != CI_MAGICNUMBER) { - orc = CONFREJ; /* Get tough if so */ - } else { - if (rc == CONFREJ) /* Rejecting prior CI? */ - continue; /* Don't send this one */ - rc = CONFNAK; - } - } - if (orc == CONFREJ) { /* Reject this CI */ - rc = CONFREJ; - if (cip != rejp) /* Need to move rejected CI? */ - BCOPY(cip, rejp, cilen); /* Move it */ - INCPTR(cilen, rejp); /* Update output pointer */ - } - } - - /* - * If we wanted to send additional NAKs (for unsent CIs), the - * code would go here. The extra NAKs would go at *nakp. - * At present there are no cases where we want to ask the - * peer to negotiate an option. - */ - - switch (rc) { - case CONFACK: - *lenp = next - inp; - break; - case CONFNAK: - /* - * Copy the Nak'd options from the nak_buffer to the caller's buffer. - */ - *lenp = nakp - nak_buffer; - BCOPY(nak_buffer, inp, *lenp); - break; - case CONFREJ: - *lenp = rejp - inp; - break; - } - - LCPDEBUG(("lcp_reqci: returning CONF%s.", CODENAME(rc))); - return (rc); /* Return final code */ -} - - -/* - * lcp_up - LCP has come UP. - */ -static void -lcp_up(f) - fsm *f; -{ - lcp_options *wo = &lcp_wantoptions[f->unit]; - lcp_options *ho = &lcp_hisoptions[f->unit]; - lcp_options *go = &lcp_gotoptions[f->unit]; - lcp_options *ao = &lcp_allowoptions[f->unit]; - - if (!go->neg_magicnumber) - go->magicnumber = 0; - if (!ho->neg_magicnumber) - ho->magicnumber = 0; - - /* - * Set our MTU to the smaller of the MTU we wanted and - * the MRU our peer wanted. If we negotiated an MRU, - * set our MRU to the larger of value we wanted and - * the value we got in the negotiation. - */ - ppp_send_config(f->unit, MIN(ao->mru, (ho->neg_mru? ho->mru: PPP_MRU)), - (ho->neg_asyncmap? ho->asyncmap: 0xffffffff), - ho->neg_pcompression, ho->neg_accompression); - ppp_recv_config(f->unit, (go->neg_mru? MAX(wo->mru, go->mru): PPP_MRU), - (lax_recv? 0: go->neg_asyncmap? go->asyncmap: 0xffffffff), - go->neg_pcompression, go->neg_accompression); - - if (ho->neg_mru) - peer_mru[f->unit] = ho->mru; - - lcp_echo_lowerup(f->unit); /* Enable echo messages */ - - link_established(f->unit); -} - - -/* - * lcp_down - LCP has gone DOWN. - * - * Alert other protocols. - */ -static void -lcp_down(f) - fsm *f; -{ - lcp_options *go = &lcp_gotoptions[f->unit]; - - lcp_echo_lowerdown(f->unit); - - link_down(f->unit); - - ppp_send_config(f->unit, PPP_MRU, 0xffffffff, 0, 0); - ppp_recv_config(f->unit, PPP_MRU, - (go->neg_asyncmap? go->asyncmap: 0xffffffff), - go->neg_pcompression, go->neg_accompression); - peer_mru[f->unit] = PPP_MRU; -} - - -/* - * lcp_starting - LCP needs the lower layer up. - */ -static void -lcp_starting(f) - fsm *f; -{ - link_required(f->unit); -} - - -/* - * lcp_finished - LCP has finished with the lower layer. - */ -static void -lcp_finished(f) - fsm *f; -{ - link_terminated(f->unit); -} - - -/* - * lcp_printpkt - print the contents of an LCP packet. - */ -static char *lcp_codenames[] = { - "ConfReq", "ConfAck", "ConfNak", "ConfRej", - "TermReq", "TermAck", "CodeRej", "ProtRej", - "EchoReq", "EchoRep", "DiscReq" -}; - -static int -lcp_printpkt(p, plen, printer, arg) - u_char *p; - int plen; - void (*printer) __P((void *, char *, ...)); - void *arg; -{ - int code, id, len, olen; - u_char *pstart, *optend; - u_short cishort; - u_int32_t cilong; - - if (plen < HEADERLEN) - return 0; - pstart = p; - GETCHAR(code, p); - GETCHAR(id, p); - GETSHORT(len, p); - if (len < HEADERLEN || len > plen) - return 0; - - if (code >= 1 && code <= sizeof(lcp_codenames) / sizeof(char *)) - printer(arg, " %s", lcp_codenames[code-1]); - else - printer(arg, " code=0x%x", code); - printer(arg, " id=0x%x", id); - len -= HEADERLEN; - switch (code) { - case CONFREQ: - case CONFACK: - case CONFNAK: - case CONFREJ: - /* print option list */ - while (len >= 2) { - GETCHAR(code, p); - GETCHAR(olen, p); - p -= 2; - if (olen < 2 || olen > len) { - break; - } - printer(arg, " <"); - len -= olen; - optend = p + olen; - switch (code) { - case CI_MRU: - if (olen == CILEN_SHORT) { - p += 2; - GETSHORT(cishort, p); - printer(arg, "mru %d", cishort); - } - break; - case CI_ASYNCMAP: - if (olen == CILEN_LONG) { - p += 2; - GETLONG(cilong, p); - printer(arg, "asyncmap 0x%x", cilong); - } - break; - case CI_AUTHTYPE: - if (olen >= CILEN_SHORT) { - p += 2; - printer(arg, "auth "); - GETSHORT(cishort, p); - switch (cishort) { - case PPP_PAP: - printer(arg, "pap"); - break; - case PPP_CHAP: - printer(arg, "chap"); - if (p < optend) { - switch (*p) { - case CHAP_DIGEST_MD5: - printer(arg, " MD5"); - ++p; - break; -#ifdef CHAPMS - case CHAP_MICROSOFT: - printer(arg, " m$oft"); - ++p; - break; -#endif - } - } - break; - default: - printer(arg, "0x%x", cishort); - } - } - break; - case CI_QUALITY: - if (olen >= CILEN_SHORT) { - p += 2; - printer(arg, "quality "); - GETSHORT(cishort, p); - switch (cishort) { - case PPP_LQR: - printer(arg, "lqr"); - break; - default: - printer(arg, "0x%x", cishort); - } - } - break; - case CI_CALLBACK: - if (olen >= CILEN_CHAR) { - p += 2; - printer(arg, "callback "); - GETCHAR(cishort, p); - switch (cishort) { - case CBCP_OPT: - printer(arg, "CBCP"); - break; - default: - printer(arg, "0x%x", cishort); - } - } - break; - case CI_MAGICNUMBER: - if (olen == CILEN_LONG) { - p += 2; - GETLONG(cilong, p); - printer(arg, "magic 0x%x", cilong); - } - break; - case CI_PCOMPRESSION: - if (olen == CILEN_VOID) { - p += 2; - printer(arg, "pcomp"); - } - break; - case CI_ACCOMPRESSION: - if (olen == CILEN_VOID) { - p += 2; - printer(arg, "accomp"); - } - break; - } - while (p < optend) { - GETCHAR(code, p); - printer(arg, " %.2x", code); - } - printer(arg, ">"); - } - break; - - case TERMACK: - case TERMREQ: - if (len > 0 && *p >= ' ' && *p < 0x7f) { - printer(arg, " "); - print_string(p, len, printer, arg); - p += len; - len = 0; - } - break; - - case ECHOREQ: - case ECHOREP: - case DISCREQ: - if (len >= 4) { - GETLONG(cilong, p); - printer(arg, " magic=0x%x", cilong); - p += 4; - len -= 4; - } - break; - } - - /* print the rest of the bytes in the packet */ - for (; len > 0; --len) { - GETCHAR(code, p); - printer(arg, " %.2x", code); - } - - return p - pstart; -} - -/* - * Time to shut down the link because there is nothing out there. - */ - -static -void LcpLinkFailure (f) - fsm *f; -{ - if (f->state == OPENED) { - info("No response to %d echo-requests", lcp_echos_pending); - notice("Serial link appears to be disconnected."); - lcp_close(f->unit, "Peer not responding"); - status = EXIT_PEER_DEAD; - } -} - -/* - * Timer expired for the LCP echo requests from this process. - */ - -static void -LcpEchoCheck (f) - fsm *f; -{ - LcpSendEchoRequest (f); - if (f->state != OPENED) - return; - - /* - * Start the timer for the next interval. - */ - if (lcp_echo_timer_running) - warn("assertion lcp_echo_timer_running==0 failed"); - TIMEOUT (LcpEchoTimeout, f, lcp_echo_interval); - lcp_echo_timer_running = 1; -} - -/* - * LcpEchoTimeout - Timer expired on the LCP echo - */ - -static void -LcpEchoTimeout (arg) - void *arg; -{ - if (lcp_echo_timer_running != 0) { - lcp_echo_timer_running = 0; - LcpEchoCheck ((fsm *) arg); - } -} - -/* - * LcpEchoReply - LCP has received a reply to the echo - */ - -static void -lcp_received_echo_reply (f, id, inp, len) - fsm *f; - int id; - u_char *inp; - int len; -{ - u_int32_t magic; - - /* Check the magic number - don't count replies from ourselves. */ - if (len < 4) { - dbglog("lcp: received short Echo-Reply, length %d", len); - return; - } - GETLONG(magic, inp); - if (lcp_gotoptions[f->unit].neg_magicnumber - && magic == lcp_gotoptions[f->unit].magicnumber) { - warn("appear to have received our own echo-reply!"); - return; - } - - /* Reset the number of outstanding echo frames */ - lcp_echos_pending = 0; -} - -/* - * LcpSendEchoRequest - Send an echo request frame to the peer - */ - -static void -LcpSendEchoRequest (f) - fsm *f; -{ - u_int32_t lcp_magic; - u_char pkt[4], *pktp; - - /* - * Detect the failure of the peer at this point. - */ - if (lcp_echo_fails != 0) { - if (lcp_echos_pending >= lcp_echo_fails) { - LcpLinkFailure(f); - lcp_echos_pending = 0; - } - } - - /* - * Make and send the echo request frame. - */ - if (f->state == OPENED) { - lcp_magic = lcp_gotoptions[f->unit].magicnumber; - pktp = pkt; - PUTLONG(lcp_magic, pktp); - fsm_sdata(f, ECHOREQ, lcp_echo_number++ & 0xFF, pkt, pktp - pkt); - ++lcp_echos_pending; - } -} - -/* - * lcp_echo_lowerup - Start the timer for the LCP frame - */ - -static void -lcp_echo_lowerup (unit) - int unit; -{ - fsm *f = &lcp_fsm[unit]; - - /* Clear the parameters for generating echo frames */ - lcp_echos_pending = 0; - lcp_echo_number = 0; - lcp_echo_timer_running = 0; - - /* If a timeout interval is specified then start the timer */ - if (lcp_echo_interval != 0) - LcpEchoCheck (f); -} - -/* - * lcp_echo_lowerdown - Stop the timer for the LCP frame - */ - -static void -lcp_echo_lowerdown (unit) - int unit; -{ - fsm *f = &lcp_fsm[unit]; - - if (lcp_echo_timer_running != 0) { - UNTIMEOUT (LcpEchoTimeout, f); - lcp_echo_timer_running = 0; - } -} diff --git a/cpukit/pppd/lcp.h b/cpukit/pppd/lcp.h deleted file mode 100644 index 16ba4cc44b..0000000000 --- a/cpukit/pppd/lcp.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - * lcp.h - Link Control Protocol definitions. - * - * Copyright (c) 1989 Carnegie Mellon University. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by Carnegie Mellon University. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * $Id$ - */ - -/* - * Options. - */ -#define CI_MRU 1 /* Maximum Receive Unit */ -#define CI_ASYNCMAP 2 /* Async Control Character Map */ -#define CI_AUTHTYPE 3 /* Authentication Type */ -#define CI_QUALITY 4 /* Quality Protocol */ -#define CI_MAGICNUMBER 5 /* Magic Number */ -#define CI_PCOMPRESSION 7 /* Protocol Field Compression */ -#define CI_ACCOMPRESSION 8 /* Address/Control Field Compression */ -#define CI_CALLBACK 13 /* callback */ - -/* - * LCP-specific packet types. - */ -#define PROTREJ 8 /* Protocol Reject */ -#define ECHOREQ 9 /* Echo Request */ -#define ECHOREP 10 /* Echo Reply */ -#define DISCREQ 11 /* Discard Request */ -#define CBCP_OPT 6 /* Use callback control protocol */ - -/* - * The state of options is described by an lcp_options structure. - */ -typedef struct lcp_options { - bool passive; /* Don't die if we don't get a response */ - bool silent; /* Wait for the other end to start first */ - bool restart; /* Restart vs. exit after close */ - bool neg_mru; /* Negotiate the MRU? */ - bool neg_asyncmap; /* Negotiate the async map? */ - bool neg_upap; /* Ask for UPAP authentication? */ - bool neg_chap; /* Ask for CHAP authentication? */ - bool neg_magicnumber; /* Ask for magic number? */ - bool neg_pcompression; /* HDLC Protocol Field Compression? */ - bool neg_accompression; /* HDLC Address/Control Field Compression? */ - bool neg_lqr; /* Negotiate use of Link Quality Reports */ - bool neg_cbcp; /* Negotiate use of CBCP */ - int mru; /* Value of MRU */ - u_char chap_mdtype; /* which MD type (hashing algorithm) */ - u_int32_t asyncmap; /* Value of async map */ - u_int32_t magicnumber; - int numloops; /* Number of loops during magic number neg. */ - u_int32_t lqr_period; /* Reporting period for LQR 1/100ths second */ -} lcp_options; - -extern fsm lcp_fsm[]; -extern lcp_options lcp_wantoptions[]; -extern lcp_options lcp_gotoptions[]; -extern lcp_options lcp_allowoptions[]; -extern lcp_options lcp_hisoptions[]; -extern u_int32_t xmit_accm[][8]; - -#define DEFMRU 1500 /* Try for this */ -#define MINMRU 128 /* No MRUs below this */ -#define MAXMRU 16384 /* Normally limit MRU to this */ - -void lcp_open __P((int)); -void lcp_close __P((int, char *)); -void lcp_lowerup __P((int)); -void lcp_lowerdown __P((int)); -void lcp_sprotrej __P((int, u_char *, int)); /* send protocol reject */ - -extern struct protent lcp_protent; - -/* Default number of times we receive our magic number from the peer - before deciding the link is looped-back. */ -#define DEFLOOPBACKFAIL 10 diff --git a/cpukit/pppd/magic.c b/cpukit/pppd/magic.c deleted file mode 100644 index c571ef792e..0000000000 --- a/cpukit/pppd/magic.c +++ /dev/null @@ -1,85 +0,0 @@ -/* - * magic.c - PPP Magic Number routines. - * - * Copyright (c) 1989 Carnegie Mellon University. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by Carnegie Mellon University. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#define RCSID "$Id$" - -#include -#include -#include -#include -#include - -#include "pppd.h" -#include "magic.h" - -static const char rcsid[] = RCSID; - -extern long mrand48 __P((void)); -extern void srand48 __P((long)); - -/* - * magic_init - Initialize the magic number generator. - * - * Attempts to compute a random number seed which will not repeat. - * The current method uses the current hostid, current process ID - * and current time, currently. - */ -void -magic_init() -{ - long seed; - struct timeval t; - - gettimeofday(&t, NULL); - seed = get_host_seed() ^ t.tv_sec ^ t.tv_usec ^ getpid(); - srand48(seed); -} - -/* - * magic - Returns the next magic number. - */ -u_int32_t -magic() -{ - return (u_int32_t) mrand48(); -} - -/* - * Substitute procedures for those systems which don't have - * drand48 et al. - */ - -double -drand48() -{ - return (double)rand() / (double)0x7fffffffL; /* 2**31-1 */ -} - -long -mrand48() -{ - return rand(); -} - -void -srand48(seedval) -long seedval; -{ - srand((int)seedval); -} diff --git a/cpukit/pppd/magic.h b/cpukit/pppd/magic.h deleted file mode 100644 index 1344626a38..0000000000 --- a/cpukit/pppd/magic.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * magic.h - PPP Magic Number definitions. - * - * Copyright (c) 1989 Carnegie Mellon University. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by Carnegie Mellon University. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * $Id$ - */ - -void magic_init __P((void)); /* Initialize the magic number generator */ -u_int32_t magic __P((void)); /* Returns the next magic number */ diff --git a/cpukit/pppd/md4.c b/cpukit/pppd/md4.c deleted file mode 100644 index cda9f943d0..0000000000 --- a/cpukit/pppd/md4.c +++ /dev/null @@ -1,298 +0,0 @@ -/* -** ******************************************************************** -** md4.c -- Implementation of MD4 Message Digest Algorithm ** -** Updated: 2/16/90 by Ronald L. Rivest ** -** (C) 1990 RSA Data Security, Inc. ** -** ******************************************************************** -*/ - -/* -** To use MD4: -** -- Include md4.h in your program -** -- Declare an MDstruct MD to hold the state of the digest -** computation. -** -- Initialize MD using MDbegin(&MD) -** -- For each full block (64 bytes) X you wish to process, call -** MD4Update(&MD,X,512) -** (512 is the number of bits in a full block.) -** -- For the last block (less than 64 bytes) you wish to process, -** MD4Update(&MD,X,n) -** where n is the number of bits in the partial block. A partial -** block terminates the computation, so every MD computation -** should terminate by processing a partial block, even if it -** has n = 0. -** -- The message digest is available in MD.buffer[0] ... -** MD.buffer[3]. (Least-significant byte of each word -** should be output first.) -** -- You can print out the digest using MDprint(&MD) -*/ - -/* Implementation notes: -** This implementation assumes that ints are 32-bit quantities. -*/ - -#define TRUE 1 -#define FALSE 0 - -/* Compile-time includes -*/ -#include -#include "md4.h" -#include "pppd.h" - -/* Compile-time declarations of MD4 "magic constants". -*/ -#define I0 0x67452301 /* Initial values for MD buffer */ -#define I1 0xefcdab89 -#define I2 0x98badcfe -#define I3 0x10325476 -#define C2 013240474631 /* round 2 constant = sqrt(2) in octal */ -#define C3 015666365641 /* round 3 constant = sqrt(3) in octal */ -/* C2 and C3 are from Knuth, The Art of Programming, Volume 2 -** (Seminumerical Algorithms), Second Edition (1981), Addison-Wesley. -** Table 2, page 660. -*/ - -#define fs1 3 /* round 1 shift amounts */ -#define fs2 7 -#define fs3 11 -#define fs4 19 -#define gs1 3 /* round 2 shift amounts */ -#define gs2 5 -#define gs3 9 -#define gs4 13 -#define hs1 3 /* round 3 shift amounts */ -#define hs2 9 -#define hs3 11 -#define hs4 15 - -/* Compile-time macro declarations for MD4. -** Note: The "rot" operator uses the variable "tmp". -** It assumes tmp is declared as unsigned int, so that the >> -** operator will shift in zeros rather than extending the sign bit. -*/ -#define f(X,Y,Z) ((X&Y) | ((~X)&Z)) -#define g(X,Y,Z) ((X&Y) | (X&Z) | (Y&Z)) -#define h(X,Y,Z) (X^Y^Z) -#define rot(X,S) (tmp=X,(tmp<>(32-S))) -#define ff(A,B,C,D,i,s) A = rot((A + f(B,C,D) + X[i]),s) -#define gg(A,B,C,D,i,s) A = rot((A + g(B,C,D) + X[i] + C2),s) -#define hh(A,B,C,D,i,s) A = rot((A + h(B,C,D) + X[i] + C3),s) - -/* MD4print(MDp) -** Print message digest buffer MDp as 32 hexadecimal digits. -** Order is from low-order byte of buffer[0] to high-order byte of -** buffer[3]. -** Each byte is printed with high-order hexadecimal digit first. -** This is a user-callable routine. -*/ -void -MD4Print(MDp) -MD4_CTX *MDp; -{ - int i,j; - for (i=0;i<4;i++) - for (j=0;j<32;j=j+8) - printf("%02x",(MDp->buffer[i]>>j) & 0xFF); -} - -/* MD4Init(MDp) -** Initialize message digest buffer MDp. -** This is a user-callable routine. -*/ -void -MD4Init(MDp) -MD4_CTX *MDp; -{ - int i; - MDp->buffer[0] = I0; - MDp->buffer[1] = I1; - MDp->buffer[2] = I2; - MDp->buffer[3] = I3; - for (i=0;i<8;i++) MDp->count[i] = 0; - MDp->done = 0; -} - -/* MDblock(MDp,X) -** Update message digest buffer MDp->buffer using 16-word data block X. -** Assumes all 16 words of X are full of data. -** Does not update MDp->count. -** This routine is not user-callable. -*/ -static void -MDblock(MDp,Xb) -MD4_CTX *MDp; -unsigned char *Xb; -{ - register unsigned int tmp, A, B, C, D; - unsigned int X[16]; - int i; - - for (i = 0; i < 16; ++i) { - X[i] = Xb[0] + (Xb[1] << 8) + (Xb[2] << 16) + (Xb[3] << 24); - Xb += 4; - } - - A = MDp->buffer[0]; - B = MDp->buffer[1]; - C = MDp->buffer[2]; - D = MDp->buffer[3]; - /* Update the message digest buffer */ - ff(A , B , C , D , 0 , fs1); /* Round 1 */ - ff(D , A , B , C , 1 , fs2); - ff(C , D , A , B , 2 , fs3); - ff(B , C , D , A , 3 , fs4); - ff(A , B , C , D , 4 , fs1); - ff(D , A , B , C , 5 , fs2); - ff(C , D , A , B , 6 , fs3); - ff(B , C , D , A , 7 , fs4); - ff(A , B , C , D , 8 , fs1); - ff(D , A , B , C , 9 , fs2); - ff(C , D , A , B , 10 , fs3); - ff(B , C , D , A , 11 , fs4); - ff(A , B , C , D , 12 , fs1); - ff(D , A , B , C , 13 , fs2); - ff(C , D , A , B , 14 , fs3); - ff(B , C , D , A , 15 , fs4); - gg(A , B , C , D , 0 , gs1); /* Round 2 */ - gg(D , A , B , C , 4 , gs2); - gg(C , D , A , B , 8 , gs3); - gg(B , C , D , A , 12 , gs4); - gg(A , B , C , D , 1 , gs1); - gg(D , A , B , C , 5 , gs2); - gg(C , D , A , B , 9 , gs3); - gg(B , C , D , A , 13 , gs4); - gg(A , B , C , D , 2 , gs1); - gg(D , A , B , C , 6 , gs2); - gg(C , D , A , B , 10 , gs3); - gg(B , C , D , A , 14 , gs4); - gg(A , B , C , D , 3 , gs1); - gg(D , A , B , C , 7 , gs2); - gg(C , D , A , B , 11 , gs3); - gg(B , C , D , A , 15 , gs4); - hh(A , B , C , D , 0 , hs1); /* Round 3 */ - hh(D , A , B , C , 8 , hs2); - hh(C , D , A , B , 4 , hs3); - hh(B , C , D , A , 12 , hs4); - hh(A , B , C , D , 2 , hs1); - hh(D , A , B , C , 10 , hs2); - hh(C , D , A , B , 6 , hs3); - hh(B , C , D , A , 14 , hs4); - hh(A , B , C , D , 1 , hs1); - hh(D , A , B , C , 9 , hs2); - hh(C , D , A , B , 5 , hs3); - hh(B , C , D , A , 13 , hs4); - hh(A , B , C , D , 3 , hs1); - hh(D , A , B , C , 11 , hs2); - hh(C , D , A , B , 7 , hs3); - hh(B , C , D , A , 15 , hs4); - MDp->buffer[0] += A; - MDp->buffer[1] += B; - MDp->buffer[2] += C; - MDp->buffer[3] += D; -} - -/* MD4Update(MDp,X,count) -** Input: X -- a pointer to an array of unsigned characters. -** count -- the number of bits of X to use. -** (if not a multiple of 8, uses high bits of last byte.) -** Update MDp using the number of bits of X given by count. -** This is the basic input routine for an MD4 user. -** The routine completes the MD computation when count < 512, so -** every MD computation should end with one call to MD4Update with a -** count less than 512. A call with count 0 will be ignored if the -** MD has already been terminated (done != 0), so an extra call with -** count 0 can be given as a "courtesy close" to force termination -** if desired. -*/ -void -MD4Update(MDp,X,count) -MD4_CTX *MDp; -unsigned char *X; -unsigned int count; -{ - unsigned int i, tmp, bit, byte, mask; - unsigned char XX[64]; - unsigned char *p; - - /* return with no error if this is a courtesy close with count - ** zero and MDp->done is true. - */ - if (count == 0 && MDp->done) return; - /* check to see if MD is already done and report error */ - if (MDp->done) - { printf("\nError: MD4Update MD already done."); return; } - - /* Add count to MDp->count */ - tmp = count; - p = MDp->count; - while (tmp) - { tmp += *p; - *p++ = tmp; - tmp = tmp >> 8; - } - - /* Process data */ - if (count == 512) - { /* Full block of data to handle */ - MDblock(MDp,X); - } - else if (count > 512) /* Check for count too large */ - { - printf("\nError: MD4Update called with illegal count value %d.", - count); - return; - } - else /* partial block -- must be last block so finish up */ - { - /* Find out how many bytes and residual bits there are */ - byte = count >> 3; - bit = count & 7; - /* Copy X into XX since we need to modify it */ - for (i=0;i<=byte;i++) XX[i] = X[i]; - for (i=byte+1;i<64;i++) XX[i] = 0; - /* Add padding '1' bit and low-order zeros in last byte */ - mask = 1 << (7 - bit); - XX[byte] = (XX[byte] | mask) & ~( mask - 1); - /* If room for bit count, finish up with this block */ - if (byte <= 55) - { - for (i=0;i<8;i++) XX[56+i] = MDp->count[i]; - MDblock(MDp,XX); - } - else /* need to do two blocks to finish up */ - { - MDblock(MDp,XX); - for (i=0;i<56;i++) XX[i] = 0; - for (i=0;i<8;i++) XX[56+i] = MDp->count[i]; - MDblock(MDp,XX); - } - /* Set flag saying we're done with MD computation */ - MDp->done = 1; - } -} - -/* -** Finish up MD4 computation and return message digest. -*/ -void -MD4Final(buf, MD) -unsigned char *buf; -MD4_CTX *MD; -{ - int i, j; - unsigned int w; - - MD4Update(MD, NULL, 0); - for (i = 0; i < 4; ++i) { - w = MD->buffer[i]; - for (j = 0; j < 4; ++j) { - *buf++ = w; - w >>= 8; - } - } -} - -/* -** End of md4.c -****************************(cut)***********************************/ diff --git a/cpukit/pppd/md4.h b/cpukit/pppd/md4.h deleted file mode 100644 index 80e8f9a2ac..0000000000 --- a/cpukit/pppd/md4.h +++ /dev/null @@ -1,64 +0,0 @@ - -/* -** ******************************************************************** -** md4.h -- Header file for implementation of ** -** MD4 Message Digest Algorithm ** -** Updated: 2/13/90 by Ronald L. Rivest ** -** (C) 1990 RSA Data Security, Inc. ** -** ******************************************************************** -*/ - -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif - - -/* MDstruct is the data structure for a message digest computation. -*/ -typedef struct { - unsigned int buffer[4]; /* Holds 4-word result of MD computation */ - unsigned char count[8]; /* Number of bits processed so far */ - unsigned int done; /* Nonzero means MD computation finished */ -} MD4_CTX; - -/* MD4Init(MD4_CTX *) -** Initialize the MD4_CTX prepatory to doing a message digest -** computation. -*/ -extern void MD4Init __P((MD4_CTX *MD)); - -/* MD4Update(MD,X,count) -** Input: X -- a pointer to an array of unsigned characters. -** count -- the number of bits of X to use (an unsigned int). -** Updates MD using the first "count" bits of X. -** The array pointed to by X is not modified. -** If count is not a multiple of 8, MD4Update uses high bits of -** last byte. -** This is the basic input routine for a user. -** The routine terminates the MD computation when count < 512, so -** every MD computation should end with one call to MD4Update with a -** count less than 512. Zero is OK for a count. -*/ -extern void MD4Update __P((MD4_CTX *MD, unsigned char *X, unsigned int count)); - -/* MD4Print(MD) -** Prints message digest buffer MD as 32 hexadecimal digits. -** Order is from low-order byte of buffer[0] to high-order byte -** of buffer[3]. -** Each byte is printed with high-order hexadecimal digit first. -*/ -extern void MD4Print __P((MD4_CTX *)); - -/* MD4Final(buf, MD) -** Returns message digest from MD and terminates the message -** digest computation. -*/ -extern void MD4Final __P((unsigned char *, MD4_CTX *)); - -/* -** End of md4.h -****************************(cut)***********************************/ diff --git a/cpukit/pppd/md5.c b/cpukit/pppd/md5.c deleted file mode 100644 index 0c16b3e545..0000000000 --- a/cpukit/pppd/md5.c +++ /dev/null @@ -1,308 +0,0 @@ - - -/* - *********************************************************************** - ** md5.c -- the source code for MD5 routines ** - ** RSA Data Security, Inc. MD5 Message-Digest Algorithm ** - ** Created: 2/17/90 RLR ** - ** Revised: 1/91 SRD,AJ,BSK,JT Reference C ver., 7/10 constant corr. ** - *********************************************************************** - */ - -/* - *********************************************************************** - ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved. ** - ** ** - ** License to copy and use this software is granted provided that ** - ** it is identified as the "RSA Data Security, Inc. MD5 Message- ** - ** Digest Algorithm" in all material mentioning or referencing this ** - ** software or this function. ** - ** ** - ** License is also granted to make and use derivative works ** - ** provided that such works are identified as "derived from the RSA ** - ** Data Security, Inc. MD5 Message-Digest Algorithm" in all ** - ** material mentioning or referencing the derived work. ** - ** ** - ** RSA Data Security, Inc. makes no representations concerning ** - ** either the merchantability of this software or the suitability ** - ** of this software for any particular purpose. It is provided "as ** - ** is" without express or implied warranty of any kind. ** - ** ** - ** These notices must be retained in any copies of any part of this ** - ** documentation and/or software. ** - *********************************************************************** - */ - -#include /* memcpy */ - -#include "md5.h" - -/* - *********************************************************************** - ** Message-digest routines: ** - ** To form the message digest for a message M ** - ** (1) Initialize a context buffer mdContext using MD5Init ** - ** (2) Call MD5Update on mdContext and M ** - ** (3) Call MD5Final on mdContext ** - ** The message digest is now in mdContext->digest[0...15] ** - *********************************************************************** - */ - -/* forward declaration */ -static void Transform (); - -static unsigned char PADDING[64] = { - 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; - -/* F, G, H and I are basic MD5 functions */ -#define F(x, y, z) (((x) & (y)) | ((~x) & (z))) -#define G(x, y, z) (((x) & (z)) | ((y) & (~z))) -#define H(x, y, z) ((x) ^ (y) ^ (z)) -#define I(x, y, z) ((y) ^ ((x) | (~z))) - -/* ROTATE_LEFT rotates x left n bits */ -#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) - -/* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4 */ -/* Rotation is separate from addition to prevent recomputation */ -#define FF(a, b, c, d, x, s, ac) \ - {(a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ - } -#define GG(a, b, c, d, x, s, ac) \ - {(a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ - } -#define HH(a, b, c, d, x, s, ac) \ - {(a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ - } -#define II(a, b, c, d, x, s, ac) \ - {(a) += I ((b), (c), (d)) + (x) + (UINT4)(ac); \ - (a) = ROTATE_LEFT ((a), (s)); \ - (a) += (b); \ - } - -#ifdef __STDC__ -#define UL(x) x##U -#else -#define UL(x) x -#endif - -/* The routine MD5Init initializes the message-digest context - mdContext. All fields are set to zero. - */ -void MD5Init (mdContext) -MD5_CTX *mdContext; -{ - mdContext->i[0] = mdContext->i[1] = (UINT4)0; - - /* Load magic initialization constants. - */ - mdContext->buf[0] = (UINT4)0x67452301; - mdContext->buf[1] = (UINT4)0xefcdab89; - mdContext->buf[2] = (UINT4)0x98badcfe; - mdContext->buf[3] = (UINT4)0x10325476; -} - -/* The routine MD5Update updates the message-digest context to - account for the presence of each of the characters inBuf[0..inLen-1] - in the message whose digest is being computed. - */ -void MD5Update (mdContext, inBuf, inLen) -MD5_CTX *mdContext; -unsigned char *inBuf; -unsigned int inLen; -{ - UINT4 in[16]; - int mdi; - unsigned int i, ii; - - /* compute number of bytes mod 64 */ - mdi = (int)((mdContext->i[0] >> 3) & 0x3F); - - /* update number of bits */ - if ((mdContext->i[0] + ((UINT4)inLen << 3)) < mdContext->i[0]) - mdContext->i[1]++; - mdContext->i[0] += ((UINT4)inLen << 3); - mdContext->i[1] += ((UINT4)inLen >> 29); - - while (inLen--) { - /* add new character to buffer, increment mdi */ - mdContext->in[mdi++] = *inBuf++; - - /* transform if necessary */ - if (mdi == 0x40) { - for (i = 0, ii = 0; i < 16; i++, ii += 4) - in[i] = (((UINT4)mdContext->in[ii+3]) << 24) | - (((UINT4)mdContext->in[ii+2]) << 16) | - (((UINT4)mdContext->in[ii+1]) << 8) | - ((UINT4)mdContext->in[ii]); - Transform (mdContext->buf, in); - mdi = 0; - } - } -} - -/* The routine MD5Final terminates the message-digest computation and - ends with the desired message digest in mdContext->digest[0...15]. - */ -void MD5Final (hash, mdContext) -unsigned char hash[]; -MD5_CTX *mdContext; -{ - UINT4 in[16]; - int mdi; - unsigned int i, ii; - unsigned int padLen; - - /* save number of bits */ - in[14] = mdContext->i[0]; - in[15] = mdContext->i[1]; - - /* compute number of bytes mod 64 */ - mdi = (int)((mdContext->i[0] >> 3) & 0x3F); - - /* pad out to 56 mod 64 */ - padLen = (mdi < 56) ? (56 - mdi) : (120 - mdi); - MD5Update (mdContext, PADDING, padLen); - - /* append length in bits and transform */ - for (i = 0, ii = 0; i < 14; i++, ii += 4) - in[i] = (((UINT4)mdContext->in[ii+3]) << 24) | - (((UINT4)mdContext->in[ii+2]) << 16) | - (((UINT4)mdContext->in[ii+1]) << 8) | - ((UINT4)mdContext->in[ii]); - Transform (mdContext->buf, in); - - /* store buffer in digest */ - for (i = 0, ii = 0; i < 4; i++, ii += 4) { - mdContext->digest[ii] = (unsigned char)(mdContext->buf[i] & 0xFF); - mdContext->digest[ii+1] = - (unsigned char)((mdContext->buf[i] >> 8) & 0xFF); - mdContext->digest[ii+2] = - (unsigned char)((mdContext->buf[i] >> 16) & 0xFF); - mdContext->digest[ii+3] = - (unsigned char)((mdContext->buf[i] >> 24) & 0xFF); - } - memcpy(hash, mdContext->digest, 16); -} - -/* Basic MD5 step. Transforms buf based on in. - */ -static void Transform (buf, in) -UINT4 *buf; -UINT4 *in; -{ - UINT4 a = buf[0], b = buf[1], c = buf[2], d = buf[3]; - - /* Round 1 */ -#define S11 7 -#define S12 12 -#define S13 17 -#define S14 22 - FF ( a, b, c, d, in[ 0], S11, UL(3614090360)); /* 1 */ - FF ( d, a, b, c, in[ 1], S12, UL(3905402710)); /* 2 */ - FF ( c, d, a, b, in[ 2], S13, UL( 606105819)); /* 3 */ - FF ( b, c, d, a, in[ 3], S14, UL(3250441966)); /* 4 */ - FF ( a, b, c, d, in[ 4], S11, UL(4118548399)); /* 5 */ - FF ( d, a, b, c, in[ 5], S12, UL(1200080426)); /* 6 */ - FF ( c, d, a, b, in[ 6], S13, UL(2821735955)); /* 7 */ - FF ( b, c, d, a, in[ 7], S14, UL(4249261313)); /* 8 */ - FF ( a, b, c, d, in[ 8], S11, UL(1770035416)); /* 9 */ - FF ( d, a, b, c, in[ 9], S12, UL(2336552879)); /* 10 */ - FF ( c, d, a, b, in[10], S13, UL(4294925233)); /* 11 */ - FF ( b, c, d, a, in[11], S14, UL(2304563134)); /* 12 */ - FF ( a, b, c, d, in[12], S11, UL(1804603682)); /* 13 */ - FF ( d, a, b, c, in[13], S12, UL(4254626195)); /* 14 */ - FF ( c, d, a, b, in[14], S13, UL(2792965006)); /* 15 */ - FF ( b, c, d, a, in[15], S14, UL(1236535329)); /* 16 */ - - /* Round 2 */ -#define S21 5 -#define S22 9 -#define S23 14 -#define S24 20 - GG ( a, b, c, d, in[ 1], S21, UL(4129170786)); /* 17 */ - GG ( d, a, b, c, in[ 6], S22, UL(3225465664)); /* 18 */ - GG ( c, d, a, b, in[11], S23, UL( 643717713)); /* 19 */ - GG ( b, c, d, a, in[ 0], S24, UL(3921069994)); /* 20 */ - GG ( a, b, c, d, in[ 5], S21, UL(3593408605)); /* 21 */ - GG ( d, a, b, c, in[10], S22, UL( 38016083)); /* 22 */ - GG ( c, d, a, b, in[15], S23, UL(3634488961)); /* 23 */ - GG ( b, c, d, a, in[ 4], S24, UL(3889429448)); /* 24 */ - GG ( a, b, c, d, in[ 9], S21, UL( 568446438)); /* 25 */ - GG ( d, a, b, c, in[14], S22, UL(3275163606)); /* 26 */ - GG ( c, d, a, b, in[ 3], S23, UL(4107603335)); /* 27 */ - GG ( b, c, d, a, in[ 8], S24, UL(1163531501)); /* 28 */ - GG ( a, b, c, d, in[13], S21, UL(2850285829)); /* 29 */ - GG ( d, a, b, c, in[ 2], S22, UL(4243563512)); /* 30 */ - GG ( c, d, a, b, in[ 7], S23, UL(1735328473)); /* 31 */ - GG ( b, c, d, a, in[12], S24, UL(2368359562)); /* 32 */ - - /* Round 3 */ -#define S31 4 -#define S32 11 -#define S33 16 -#define S34 23 - HH ( a, b, c, d, in[ 5], S31, UL(4294588738)); /* 33 */ - HH ( d, a, b, c, in[ 8], S32, UL(2272392833)); /* 34 */ - HH ( c, d, a, b, in[11], S33, UL(1839030562)); /* 35 */ - HH ( b, c, d, a, in[14], S34, UL(4259657740)); /* 36 */ - HH ( a, b, c, d, in[ 1], S31, UL(2763975236)); /* 37 */ - HH ( d, a, b, c, in[ 4], S32, UL(1272893353)); /* 38 */ - HH ( c, d, a, b, in[ 7], S33, UL(4139469664)); /* 39 */ - HH ( b, c, d, a, in[10], S34, UL(3200236656)); /* 40 */ - HH ( a, b, c, d, in[13], S31, UL( 681279174)); /* 41 */ - HH ( d, a, b, c, in[ 0], S32, UL(3936430074)); /* 42 */ - HH ( c, d, a, b, in[ 3], S33, UL(3572445317)); /* 43 */ - HH ( b, c, d, a, in[ 6], S34, UL( 76029189)); /* 44 */ - HH ( a, b, c, d, in[ 9], S31, UL(3654602809)); /* 45 */ - HH ( d, a, b, c, in[12], S32, UL(3873151461)); /* 46 */ - HH ( c, d, a, b, in[15], S33, UL( 530742520)); /* 47 */ - HH ( b, c, d, a, in[ 2], S34, UL(3299628645)); /* 48 */ - - /* Round 4 */ -#define S41 6 -#define S42 10 -#define S43 15 -#define S44 21 - II ( a, b, c, d, in[ 0], S41, UL(4096336452)); /* 49 */ - II ( d, a, b, c, in[ 7], S42, UL(1126891415)); /* 50 */ - II ( c, d, a, b, in[14], S43, UL(2878612391)); /* 51 */ - II ( b, c, d, a, in[ 5], S44, UL(4237533241)); /* 52 */ - II ( a, b, c, d, in[12], S41, UL(1700485571)); /* 53 */ - II ( d, a, b, c, in[ 3], S42, UL(2399980690)); /* 54 */ - II ( c, d, a, b, in[10], S43, UL(4293915773)); /* 55 */ - II ( b, c, d, a, in[ 1], S44, UL(2240044497)); /* 56 */ - II ( a, b, c, d, in[ 8], S41, UL(1873313359)); /* 57 */ - II ( d, a, b, c, in[15], S42, UL(4264355552)); /* 58 */ - II ( c, d, a, b, in[ 6], S43, UL(2734768916)); /* 59 */ - II ( b, c, d, a, in[13], S44, UL(1309151649)); /* 60 */ - II ( a, b, c, d, in[ 4], S41, UL(4149444226)); /* 61 */ - II ( d, a, b, c, in[11], S42, UL(3174756917)); /* 62 */ - II ( c, d, a, b, in[ 2], S43, UL( 718787259)); /* 63 */ - II ( b, c, d, a, in[ 9], S44, UL(3951481745)); /* 64 */ - - buf[0] += a; - buf[1] += b; - buf[2] += c; - buf[3] += d; -} - -/* - *********************************************************************** - ** End of md5.c ** - ******************************** (cut) ******************************** - */ diff --git a/cpukit/pppd/md5.h b/cpukit/pppd/md5.h deleted file mode 100644 index 7492b2228e..0000000000 --- a/cpukit/pppd/md5.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - *********************************************************************** - ** md5.h -- header file for implementation of MD5 ** - ** RSA Data Security, Inc. MD5 Message-Digest Algorithm ** - ** Created: 2/17/90 RLR ** - ** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version ** - ** Revised (for MD5): RLR 4/27/91 ** - ** -- G modified to have y&~z instead of y&z ** - ** -- FF, GG, HH modified to add in last register done ** - ** -- Access pattern: round 2 works mod 5, round 3 works mod 3 ** - ** -- distinct additive constant for each step ** - ** -- round 4 added, working mod 7 ** - *********************************************************************** - */ - -/* - *********************************************************************** - ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved. ** - ** ** - ** License to copy and use this software is granted provided that ** - ** it is identified as the "RSA Data Security, Inc. MD5 Message- ** - ** Digest Algorithm" in all material mentioning or referencing this ** - ** software or this function. ** - ** ** - ** License is also granted to make and use derivative works ** - ** provided that such works are identified as "derived from the RSA ** - ** Data Security, Inc. MD5 Message-Digest Algorithm" in all ** - ** material mentioning or referencing the derived work. ** - ** ** - ** RSA Data Security, Inc. makes no representations concerning ** - ** either the merchantability of this software or the suitability ** - ** of this software for any particular purpose. It is provided "as ** - ** is" without express or implied warranty of any kind. ** - ** ** - ** These notices must be retained in any copies of any part of this ** - ** documentation and/or software. ** - *********************************************************************** - */ - -#ifndef __MD5_INCLUDE__ - -/* typedef a 32-bit type */ -typedef unsigned int UINT4; - -/* Data structure for MD5 (Message-Digest) computation */ -typedef struct { - UINT4 i[2]; /* number of _bits_ handled mod 2^64 */ - UINT4 buf[4]; /* scratch buffer */ - unsigned char in[64]; /* input buffer */ - unsigned char digest[16]; /* actual digest after MD5Final call */ -} MD5_CTX; - -void MD5Init (); -void MD5Update (); -void MD5Final (); - -#define __MD5_INCLUDE__ -#endif /* __MD5_INCLUDE__ */ diff --git a/cpukit/pppd/options.c b/cpukit/pppd/options.c deleted file mode 100644 index 00dcf591ba..0000000000 --- a/cpukit/pppd/options.c +++ /dev/null @@ -1,1525 +0,0 @@ -/* - * options.c - handles option processing for PPP. - * - * Copyright (c) 1989 Carnegie Mellon University. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by Carnegie Mellon University. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#define RCSID "$Id$" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef PLUGIN -#include -#endif -#ifdef PPP_FILTER -#include -#include /* XXX: To get struct pcap */ -#endif - -#include "pppd.h" -#include "pathnames.h" -#include "patchlevel.h" -#include "fsm.h" -#include "lcp.h" -#include "ipcp.h" -#include "upap.h" -#include "chap.h" -#include "ccp.h" - -#include - -#if defined(ultrix) || defined(NeXT) -char *strdup __P((char *)); -#endif - -static const char rcsid[] = RCSID; - -/* - * Option variables and default values. - */ -#ifdef PPP_FILTER -int dflag = 0; /* Tell libpcap we want debugging */ -#endif -int debug = 0; /* Debug flag */ -int kdebugflag = 0; /* Tell kernel to print debug messages */ -int default_device = 1; /* Using /dev/tty or equivalent */ -char devnam[MAXPATHLEN]; /* Device name */ -int crtscts = 0; /* Use hardware flow control */ -bool modem = 1; /* Use modem control lines */ -int inspeed = 0; /* Input/Output speed requested */ -u_int32_t netmask = 0; /* IP netmask to set on interface */ -bool lockflag = 0; /* Create lock file to lock the serial dev */ -bool nodetach = 0; /* Don't detach from controlling tty */ -bool updetach = 0; /* Detach once link is up */ -char *initializer = NULL; /* Script to initialize physical link */ -char *connect_script = NULL; /* Script to establish physical link */ -char *disconnect_script = NULL; /* Script to disestablish physical link */ -char *welcomer = NULL; /* Script to run after phys link estab. */ -char *ptycommand = NULL; /* Command to run on other side of pty */ -int maxconnect = 0; /* Maximum connect time */ -char user[MAXNAMELEN]; /* Username for PAP */ -char passwd[MAXSECRETLEN]; /* Password for PAP */ -bool persist = 0; /* Reopen link after it goes down */ -char our_name[MAXNAMELEN]; /* Our name for authentication purposes */ -bool demand = 0; /* do dial-on-demand */ -char *ipparam = NULL; /* Extra parameter for ip up/down scripts */ -int idle_time_limit = 0; /* Disconnect if idle for this many seconds */ -int holdoff = 30; /* # seconds to pause before reconnecting */ -bool holdoff_specified; /* true if a holdoff value has been given */ -bool notty = 0; /* Stdin/out is not a tty */ -char *record_file = NULL; /* File to record chars sent/received */ -int using_pty = 0; -bool sync_serial = 0; /* Device is synchronous serial device */ -int log_to_fd = 1; /* send log messages to this fd too */ -int maxfail = 10; /* max # of unsuccessful connection attempts */ -char linkname[MAXPATHLEN]; /* logical name for link */ -bool tune_kernel; /* may alter kernel settings */ -int connect_delay = 1000; /* wait this many ms after connect script */ - -extern option_t auth_options[]; -extern struct stat devstat; -extern int prepass; /* Doing pre-pass to find device name */ - -struct option_info initializer_info; -struct option_info connect_script_info; -struct option_info disconnect_script_info; -struct option_info welcomer_info; -struct option_info devnam_info; -struct option_info ptycommand_info; - -#ifdef PPP_FILTER -struct bpf_program pass_filter;/* Filter program for packets to pass */ -struct bpf_program active_filter; /* Filter program for link-active pkts */ -pcap_t pc; /* Fake struct pcap so we can compile expr */ -#endif - -char *current_option; /* the name of the option being parsed */ -int privileged_option; /* set iff the current option came from root */ -char *option_source; /* string saying where the option came from */ -bool log_to_file; /* log_to_fd is a file opened by us */ - -/* - * Prototypes - */ -static int setdevname __P((char *)); -static int setipaddr __P((char *)); -static int setspeed __P((char *)); -static int noopt __P((char **)); -static int setdomain __P((char **)); -static int setnetmask __P((char **)); -static int setxonxoff __P((char **)); -static int readfile __P((char **)); -static int callfile __P((char **)); -static void usage __P((void)); -static int setlogfile __P((char **)); -#ifdef PLUGIN -static int loadplugin __P((char **)); -#endif - -#ifdef PPP_FILTER -static int setpassfilter __P((char **)); -static int setactivefilter __P((char **)); -#endif - -static option_t *find_option __P((char *name)); -static int process_option __P((option_t *, char **)); -static int n_arguments __P((option_t *)); -static int number_option __P((char *, u_int32_t *, int)); - -/* - * Structure to store extra lists of options. - */ -struct option_list { - option_t *options; - struct option_list *next; -}; - -static struct option_list *extra_options = NULL; - -/* - * Valid arguments. - */ -option_t general_options[] = { - { "debug", o_int, &debug, - "Increase debugging level", OPT_INC|OPT_NOARG|1 }, - { "-d", o_int, &debug, - "Increase debugging level", OPT_INC|OPT_NOARG|1 }, - { "kdebug", o_int, &kdebugflag, - "Set kernel driver debug level" }, - { "nodetach", o_bool, &nodetach, - "Don't detach from controlling tty", 1 }, - { "-detach", o_bool, &nodetach, - "Don't detach from controlling tty", 1 }, - { "updetach", o_bool, &updetach, - "Detach from controlling tty once link is up", 1 }, - { "holdoff", o_int, &holdoff, - "Set time in seconds before retrying connection" }, - { "idle", o_int, &idle_time_limit, - "Set time in seconds before disconnecting idle link" }, - { "lock", o_bool, &lockflag, - "Lock serial device with UUCP-style lock file", 1 }, - { "-all", o_special_noarg, noopt, - "Don't request/allow any LCP or IPCP options (useless)" }, - { "init", o_string, &initializer, - "A program to initialize the device", - OPT_A2INFO | OPT_PRIVFIX, &initializer_info }, - { "connect", o_string, &connect_script, - "A program to set up a connection", - OPT_A2INFO | OPT_PRIVFIX, &connect_script_info }, - { "disconnect", o_string, &disconnect_script, - "Program to disconnect serial device", - OPT_A2INFO | OPT_PRIVFIX, &disconnect_script_info }, - { "welcome", o_string, &welcomer, - "Script to welcome client", - OPT_A2INFO | OPT_PRIVFIX, &welcomer_info }, - { "pty", o_string, &ptycommand, - "Script to run on pseudo-tty master side", - OPT_A2INFO | OPT_PRIVFIX | OPT_DEVNAM, &ptycommand_info }, - { "notty", o_bool, ¬ty, - "Input/output is not a tty", OPT_DEVNAM | 1 }, - { "record", o_string, &record_file, - "Record characters sent/received to file" }, - { "maxconnect", o_int, &maxconnect, - "Set connection time limit", OPT_LLIMIT|OPT_NOINCR|OPT_ZEROINF }, - { "crtscts", o_int, &crtscts, - "Set hardware (RTS/CTS) flow control", OPT_NOARG|OPT_VAL(1) }, - { "nocrtscts", o_int, &crtscts, - "Disable hardware flow control", OPT_NOARG|OPT_VAL(-1) }, - { "-crtscts", o_int, &crtscts, - "Disable hardware flow control", OPT_NOARG|OPT_VAL(-1) }, - { "cdtrcts", o_int, &crtscts, - "Set alternate hardware (DTR/CTS) flow control", OPT_NOARG|OPT_VAL(2) }, - { "nocdtrcts", o_int, &crtscts, - "Disable hardware flow control", OPT_NOARG|OPT_VAL(-1) }, - { "xonxoff", o_special_noarg, setxonxoff, - "Set software (XON/XOFF) flow control" }, - { "domain", o_special, setdomain, - "Add given domain name to hostname" }, - { "mtu", o_int, &lcp_allowoptions[0].mru, - "Set our MTU", OPT_LIMITS, NULL, MAXMRU, MINMRU }, - { "netmask", o_special, setnetmask, - "set netmask" }, - { "modem", o_bool, &modem, - "Use modem control lines", 1 }, - { "local", o_bool, &modem, - "Don't use modem control lines" }, - { "file", o_special, readfile, - "Take options from a file", OPT_PREPASS }, - { "call", o_special, callfile, - "Take options from a privileged file", OPT_PREPASS }, - { "persist", o_bool, &persist, - "Keep on reopening connection after close", 1 }, - { "nopersist", o_bool, &persist, - "Turn off persist option" }, - { "demand", o_bool, &demand, - "Dial on demand", OPT_INITONLY | 1, &persist }, - { "sync", o_bool, &sync_serial, - "Use synchronous HDLC serial encoding", 1 }, - { "logfd", o_int, &log_to_fd, - "Send log messages to this file descriptor" }, - { "logfile", o_special, setlogfile, - "Append log messages to this file" }, - { "nolog", o_int, &log_to_fd, - "Don't send log messages to any file", - OPT_NOARG | OPT_VAL(-1) }, - { "nologfd", o_int, &log_to_fd, - "Don't send log messages to any file descriptor", - OPT_NOARG | OPT_VAL(-1) }, - { "linkname", o_string, linkname, - "Set logical name for link", - OPT_PRIV|OPT_STATIC, NULL, MAXPATHLEN }, - { "maxfail", o_int, &maxfail, - "Maximum number of unsuccessful connection attempts to allow" }, - { "ktune", o_bool, &tune_kernel, - "Alter kernel settings as necessary", 1 }, - { "noktune", o_bool, &tune_kernel, - "Don't alter kernel settings", 0 }, - { "connect-delay", o_int, &connect_delay, - "Maximum time (in ms) to wait after connect script finishes" }, -#ifdef PLUGIN - { "plugin", o_special, loadplugin, - "Load a plug-in module into pppd", OPT_PRIV }, -#endif - -#ifdef PPP_FILTER - { "pdebug", o_int, &dflag, - "libpcap debugging" }, - { "pass-filter", 1, setpassfilter, - "set filter for packets to pass" }, - { "active-filter", 1, setactivefilter, - "set filter for active pkts" }, -#endif - - { NULL } -}; - -#ifndef IMPLEMENTATION -#define IMPLEMENTATION "" -#endif - -static char *usage_string = "\ -pppd version %s.%d%s\n\ -Usage: %s [ options ], where options are:\n\ - Communicate over the named device\n\ - Set the baud rate to \n\ - : Set the local and/or remote interface IP\n\ - addresses. Either one may be omitted.\n\ - asyncmap Set the desired async map to hex \n\ - auth Require authentication from peer\n\ - connect

Invoke shell command

to set up the serial line\n\ - crtscts Use hardware RTS/CTS flow control\n\ - defaultroute Add default route through interface\n\ - file Take options from file \n\ - modem Use modem control lines\n\ - mru Set MRU value to for negotiation\n\ -See pppd(8) for more options.\n\ -"; - -/* - * parse_args - parse a string of arguments from the command line. - * If prepass is true, we are scanning for the device name and only - * processing a few options, so error messages are suppressed. - */ -int -parse_args(argc, argv) - int argc; - char **argv; -{ - char *arg; - option_t *opt; - int ret; - - privileged_option = privileged; - option_source = "command line"; - while (argc > 0) { - arg = *argv++; - --argc; - - /* - * First see if it's an option in the new option list. - */ - opt = find_option(arg); - if (opt != NULL) { - int n = n_arguments(opt); - if (argc < n) { - option_error("too few parameters for option %s", arg); - return 0; - } - current_option = arg; - if (!process_option(opt, argv)) - return 0; - argc -= n; - argv += n; - continue; - } - - /* - * Maybe a tty name, speed or IP address? - */ - if ((ret = setdevname(arg)) == 0 - && (ret = setspeed(arg)) == 0 - && (ret = setipaddr(arg)) == 0 - && !prepass) { - option_error("unrecognized option '%s'", arg); - usage(); - return 0; - } - if (ret < 0) /* error */ - return 0; - } - return 1; -} - -#if 0 -/* - * scan_args - scan the command line arguments to get the tty name, - * if specified. Also checks whether the notty or pty option was given. - */ -void -scan_args(argc, argv) - int argc; - char **argv; -{ - char *arg; - option_t *opt; - - privileged_option = privileged; - while (argc > 0) { - arg = *argv++; - --argc; - - if (strcmp(arg, "notty") == 0 || strcmp(arg, "pty") == 0) - using_pty = 1; - - /* Skip options and their arguments */ - opt = find_option(arg); - if (opt != NULL) { - int n = n_arguments(opt); - argc -= n; - argv += n; - continue; - } - - /* Check if it's a tty name and copy it if so */ - (void) setdevname(arg, 1); - } -} -#endif - -/* - * options_from_file - Read a string of options from a file, - * and interpret them. - */ -int -options_from_file(filename, must_exist, check_prot, priv) - char *filename; - int must_exist; - int check_prot; - int priv; -{ - FILE *f; - int i, newline, ret, err; - option_t *opt; - int oldpriv; - char *oldsource; - char *argv[MAXARGS]; - char args[MAXARGS][MAXWORDLEN]; - char cmd[MAXWORDLEN]; - - f = fopen(filename, "r"); - err = errno; - if (f == NULL) { - if (!must_exist && err == ENOENT) - return 1; - errno = err; - option_error("Can't open options file %s: %m", filename); - return 0; - } - - oldpriv = privileged_option; - privileged_option = priv; - oldsource = option_source; - option_source = strdup(filename); - if (option_source == NULL) - option_source = "file"; - ret = 0; - while (getword(f, cmd, &newline, filename)) { - /* - * First see if it's a command. - */ - opt = find_option(cmd); - if (opt != NULL) { - int n = n_arguments(opt); - for (i = 0; i < n; ++i) { - if (!getword(f, args[i], &newline, filename)) { - option_error( - "In file %s: too few parameters for option '%s'", - filename, cmd); - goto err; - } - argv[i] = args[i]; - } - current_option = cmd; - if ((opt->flags & OPT_DEVEQUIV) && devnam_fixed) { - option_error("the %s option may not be used in the %s file", - cmd, filename); - goto err; - } - if (!process_option(opt, argv)) - goto err; - continue; - } - - /* - * Maybe a tty name, speed or IP address? - */ - if ((i = setdevname(cmd)) == 0 - && (i = setspeed(cmd)) == 0 - && (i = setipaddr(cmd)) == 0) { - option_error("In file %s: unrecognized option '%s'", - filename, cmd); - goto err; - } - if (i < 0) /* error */ - goto err; - } - ret = 1; - -err: - fclose(f); - privileged_option = oldpriv; - option_source = oldsource; - return ret; -} - -/* - * options_from_user - See if the use has a ~/.ppprc file, - * and if so, interpret options from it. - */ -int -options_from_user() -{ - return 0; -} - -/* - * options_for_tty - See if an options file exists for the serial - * device, and if so, interpret options from it. - */ -int -options_for_tty() -{ - char *dev, *path, *p; - int ret; - size_t pl; - - dev = devnam; - if (strncmp(dev, "/dev/", 5) == 0) - dev += 5; - if (dev[0] == 0 || strcmp(dev, "tty") == 0) - return 1; /* don't look for /etc/ppp/options.tty */ - pl = strlen(_PATH_TTYOPT) + strlen(dev) + 1; - path = malloc(pl); - if (path == NULL) - novm("tty init file name"); - slprintf(path, pl, "%s%s", _PATH_TTYOPT, dev); - /* Turn slashes into dots, for Solaris case (e.g. /dev/term/a) */ - for (p = path + strlen(_PATH_TTYOPT); *p != 0; ++p) - if (*p == '/') - *p = '.'; - ret = options_from_file(path, 0, 0, 1); - free(path); - return ret; -} - -/* - * options_from_list - process a string of options in a wordlist. - */ -int -options_from_list(w, priv) - struct wordlist *w; - int priv; -{ - char *argv[MAXARGS]; - option_t *opt; - int i, ret = 0; - - privileged_option = priv; - option_source = "secrets file"; - - while (w != NULL) { - /* - * First see if it's a command. - */ - opt = find_option(w->word); - if (opt != NULL) { - int n = n_arguments(opt); - struct wordlist *w0 = w; - for (i = 0; i < n; ++i) { - w = w->next; - if (w == NULL) { - option_error( - "In secrets file: too few parameters for option '%s'", - w0->word); - goto err; - } - argv[i] = w->word; - } - current_option = w0->word; - if (!process_option(opt, argv)) - goto err; - w = w->next; - continue; - } - - /* - * Maybe a tty name, speed or IP address? - */ - if ((i = setdevname(w->word)) == 0 - && (i = setspeed(w->word)) == 0 - && (i = setipaddr(w->word)) == 0) { - option_error("In secrets file: unrecognized option '%s'", - w->word); - goto err; - } - if (i < 0) /* error */ - goto err; - w = w->next; - } - ret = 1; - -err: - return ret; -} - -/* - * find_option - scan the option lists for the various protocols - * looking for an entry with the given name. - * This could be optimized by using a hash table. - */ -static option_t * -find_option(name) - char *name; -{ - option_t *opt; - struct option_list *list; - int i; - - for (list = extra_options; list != NULL; list = list->next) - for (opt = list->options; opt->name != NULL; ++opt) - if (strcmp(name, opt->name) == 0) - return opt; - for (opt = general_options; opt->name != NULL; ++opt) - if (strcmp(name, opt->name) == 0) - return opt; - for (opt = auth_options; opt->name != NULL; ++opt) - if (strcmp(name, opt->name) == 0) - return opt; - for (i = 0; protocols[i] != NULL; ++i) - if ((opt = protocols[i]->options) != NULL) - for (; opt->name != NULL; ++opt) - if (strcmp(name, opt->name) == 0) - return opt; - return NULL; -} - -/* - * process_option - process one new-style option. - */ -static int -process_option(opt, argv) - option_t *opt; - char **argv; -{ - u_int32_t v; - int iv, a; - char *sv; - int (*parser) __P((char **)); - - if ((opt->flags & OPT_PREPASS) == 0 && prepass) - return 1; - if ((opt->flags & OPT_INITONLY) && phase != PHASE_INITIALIZE) { - option_error("it's too late to use the %s option", opt->name); - return 0; - } - if ((opt->flags & OPT_PRIV) && !privileged_option) { - option_error("using the %s option requires root privilege", opt->name); - return 0; - } - if ((opt->flags & OPT_ENABLE) && *(bool *)(opt->addr2) == 0) { - option_error("%s option is disabled", opt->name); - return 0; - } - if ((opt->flags & OPT_PRIVFIX) && !privileged_option) { - struct option_info *ip = (struct option_info *) opt->addr2; - if (ip && ip->priv) { - option_error("%s option cannot be overridden", opt->name); - return 0; - } - } - - switch (opt->type) { - case o_bool: - v = opt->flags & OPT_VALUE; - *(bool *)(opt->addr) = v; - if (opt->addr2 && (opt->flags & OPT_A2COPY)) - *(bool *)(opt->addr2) = v; - break; - - case o_int: - iv = 0; - if ((opt->flags & OPT_NOARG) == 0) { - if (!int_option(*argv, &iv)) - return 0; - if ((((opt->flags & OPT_LLIMIT) && iv < opt->lower_limit) - || ((opt->flags & OPT_ULIMIT) && iv > opt->upper_limit)) - && !((opt->flags & OPT_ZEROOK && iv == 0))) { - char *zok = (opt->flags & OPT_ZEROOK)? " zero or": ""; - switch (opt->flags & OPT_LIMITS) { - case OPT_LLIMIT: - option_error("%s value must be%s >= %d", - opt->name, zok, opt->lower_limit); - break; - case OPT_ULIMIT: - option_error("%s value must be%s <= %d", - opt->name, zok, opt->upper_limit); - break; - case OPT_LIMITS: - option_error("%s value must be%s between %d and %d", - opt->name, opt->lower_limit, opt->upper_limit); - break; - } - return 0; - } - } - a = opt->flags & OPT_VALUE; - if (a >= 128) - a -= 256; /* sign extend */ - iv += a; - if (opt->flags & OPT_INC) - iv += *(int *)(opt->addr); - if ((opt->flags & OPT_NOINCR) && !privileged_option) { - int oldv = *(int *)(opt->addr); - if ((opt->flags & OPT_ZEROINF) ? - (oldv != 0 && (iv == 0 || iv > oldv)) : (iv > oldv)) { - option_error("%s value cannot be increased", opt->name); - return 0; - } - } - *(int *)(opt->addr) = iv; - if (opt->addr2 && (opt->flags & OPT_A2COPY)) - *(int *)(opt->addr2) = iv; - break; - - case o_uint32: - if (opt->flags & OPT_NOARG) { - v = opt->flags & OPT_VALUE; - } else if (!number_option(*argv, &v, 16)) - return 0; - if (opt->flags & OPT_OR) - v |= *(u_int32_t *)(opt->addr); - *(u_int32_t *)(opt->addr) = v; - if (opt->addr2 && (opt->flags & OPT_A2COPY)) - *(u_int32_t *)(opt->addr2) = v; - break; - - case o_string: - if (opt->flags & OPT_STATIC) { - strlcpy((char *)(opt->addr), *argv, opt->upper_limit); - } else { - sv = strdup(*argv); - if (sv == NULL) - novm("option argument"); - if ( *(char **)(opt->addr) != NULL ) { - free((void *)*(char **)(opt->addr)); - *(char **)(opt->addr) = NULL; - } - *(char **)(opt->addr) = sv; - } - break; - - case o_special_noarg: - case o_special: - parser = (int (*) __P((char **))) opt->addr; - if (!(*parser)(argv)) - return 0; - break; - } - - if (opt->addr2) { - if (opt->flags & OPT_A2INFO) { - struct option_info *ip = (struct option_info *) opt->addr2; - ip->priv = privileged_option; - ip->source = option_source; - } else if ((opt->flags & (OPT_A2COPY|OPT_ENABLE)) == 0) - *(bool *)(opt->addr2) = 1; - } - - return 1; -} - -/* - * n_arguments - tell how many arguments an option takes - */ -static int -n_arguments(opt) - option_t *opt; -{ - return (opt->type == o_bool || opt->type == o_special_noarg - || (opt->flags & OPT_NOARG))? 0: 1; -} - -/* - * add_options - add a list of options to the set we grok. - */ -void -add_options(opt) - option_t *opt; -{ - struct option_list *list; - - list = malloc(sizeof(*list)); - if (list == 0) - novm("option list entry"); - list->options = opt; - list->next = extra_options; - extra_options = list; -} - -/* - * usage - print out a message telling how to use the program. - */ -static void -usage() -{ - if (phase == PHASE_INITIALIZE) - fprintf(stderr, usage_string, VERSION, PATCHLEVEL, IMPLEMENTATION, - progname); -} - -/* - * option_error - print a message about an error in an option. - * The message is logged, and also sent to - * stderr if phase == PHASE_INITIALIZE. - */ -void -option_error __V((char *fmt, ...)) -{ - va_list args; - char buf[256]; - -#if defined(__STDC__) - va_start(args, fmt); -#else - char *fmt; - va_start(args); - fmt = va_arg(args, char *); -#endif - if (prepass) { - va_end(args); - return; - } - vslprintf(buf, sizeof(buf), fmt, args); - va_end(args); - - fprintf(stderr, "pppd: %s\n", buf); -} - -/* - * Read a word from a file. - * Words are delimited by white-space or by quotes (" or '). - * Quotes, white-space and \ may be escaped with \. - * \ is ignored. - */ -int -getword(f, word, newlinep, filename) - FILE *f; - char *word; - int *newlinep; - char *filename; -{ - int c, len, escape; - int quoted, comment; - int value, digit, got, n; - -#define isoctal(c) ((c) >= '0' && (c) < '8') - - *newlinep = 0; - len = 0; - escape = 0; - comment = 0; - - /* - * First skip white-space and comments. - */ - for (;;) { - c = getc(f); - if (c == EOF) - break; - - /* - * A newline means the end of a comment; backslash-newline - * is ignored. Note that we cannot have escape && comment. - */ - if (c == '\n') { - if (!escape) { - *newlinep = 1; - comment = 0; - } else - escape = 0; - continue; - } - - /* - * Ignore characters other than newline in a comment. - */ - if (comment) - continue; - - /* - * If this character is escaped, we have a word start. - */ - if (escape) - break; - - /* - * If this is the escape character, look at the next character. - */ - if (c == '\\') { - escape = 1; - continue; - } - - /* - * If this is the start of a comment, ignore the rest of the line. - */ - if (c == '#') { - comment = 1; - continue; - } - - /* - * A non-whitespace character is the start of a word. - */ - if (!isspace(c)) - break; - } - - /* - * Save the delimiter for quoted strings. - */ - if (!escape && (c == '"' || c == '\'')) { - quoted = c; - c = getc(f); - } else - quoted = 0; - - /* - * Process characters until the end of the word. - */ - while (c != EOF) { - if (escape) { - /* - * This character is escaped: backslash-newline is ignored, - * various other characters indicate particular values - * as for C backslash-escapes. - */ - escape = 0; - if (c == '\n') { - c = getc(f); - continue; - } - - got = 0; - switch (c) { - case 'a': - value = '\a'; - break; - case 'b': - value = '\b'; - break; - case 'f': - value = '\f'; - break; - case 'n': - value = '\n'; - break; - case 'r': - value = '\r'; - break; - case 's': - value = ' '; - break; - case 't': - value = '\t'; - break; - - default: - if (isoctal(c)) { - /* - * \ddd octal sequence - */ - value = 0; - for (n = 0; n < 3 && isoctal(c); ++n) { - value = (value << 3) + (c & 07); - c = getc(f); - } - got = 1; - break; - } - - if (c == 'x') { - /* - * \x sequence - */ - value = 0; - c = getc(f); - for (n = 0; n < 2 && isxdigit(c); ++n) { - digit = toupper(c) - '0'; - if (digit > 10) - digit += '0' + 10 - 'A'; - value = (value << 4) + digit; - c = getc (f); - } - got = 1; - break; - } - - /* - * Otherwise the character stands for itself. - */ - value = c; - break; - } - - /* - * Store the resulting character for the escape sequence. - */ - if (len < MAXWORDLEN-1) - word[len] = value; - ++len; - - if (!got) - c = getc(f); - continue; - - } - - /* - * Not escaped: see if we've reached the end of the word. - */ - if (quoted) { - if (c == quoted) - break; - } else { - if (isspace(c) || c == '#') { - ungetc (c, f); - break; - } - } - - /* - * Backslash starts an escape sequence. - */ - if (c == '\\') { - escape = 1; - c = getc(f); - continue; - } - - /* - * An ordinary character: store it in the word and get another. - */ - if (len < MAXWORDLEN-1) - word[len] = c; - ++len; - - c = getc(f); - } - - /* - * End of the word: check for errors. - */ - if (c == EOF) { - if (ferror(f)) { - if (errno == 0) - errno = EIO; - option_error("Error reading %s: %m", filename); - die(1); - } - /* - * If len is zero, then we didn't find a word before the - * end of the file. - */ - if (len == 0) - return 0; - } - - /* - * Warn if the word was too long, and append a terminating null. - */ - if (len >= MAXWORDLEN) { - option_error("warning: word in file %s too long (%.20s...)", - filename, word); - len = MAXWORDLEN - 1; - } - word[len] = 0; - - return 1; - -#undef isoctal - -} - -/* - * number_option - parse an unsigned numeric parameter for an option. - */ -static int -number_option(str, valp, base) - char *str; - u_int32_t *valp; - int base; -{ - char *ptr; - - *valp = strtoul(str, &ptr, base); - if (ptr == str) { - option_error("invalid numeric parameter '%s' for %s option", - str, current_option); - return 0; - } - return 1; -} - - -/* - * int_option - like number_option, but valp is int *, - * the base is assumed to be 0, and *valp is not changed - * if there is an error. - */ -int -int_option(str, valp) - char *str; - int *valp; -{ - u_int32_t v; - - if (!number_option(str, &v, 0)) - return 0; - *valp = (int) v; - return 1; -} - - -/* - * The following procedures parse options. - */ - -/* - * readfile - take commands from a file. - */ -static int -readfile(argv) - char **argv; -{ - return options_from_file(*argv, 1, 1, privileged_option); -} - -/* - * callfile - take commands from /etc/ppp/peers/. - * Name may not contain /../, start with / or ../, or end in /.. - */ -static int -callfile(argv) - char **argv; -{ - char *fname, *arg, *p; - int l, ok; - - arg = *argv; - ok = 1; - if (arg[0] == '/' || arg[0] == 0) - ok = 0; - else { - for (p = arg; *p != 0; ) { - if (p[0] == '.' && p[1] == '.' && (p[2] == '/' || p[2] == 0)) { - ok = 0; - break; - } - while (*p != '/' && *p != 0) - ++p; - if (*p == '/') - ++p; - } - } - if (!ok) { - option_error("call option value may not contain .. or start with /"); - return 0; - } - - l = strlen(arg) + strlen(_PATH_PEERFILES) + 1; - if ((fname = (char *) malloc(l)) == NULL) - novm("call file name"); - slprintf(fname, l, "%s%s", _PATH_PEERFILES, arg); - - ok = options_from_file(fname, 1, 1, 1); - - free(fname); - return ok; -} - -#ifdef PPP_FILTER -/* - * setpdebug - Set libpcap debugging level. - */ -static int -setpdebug(argv) - char **argv; -{ - return int_option(*argv, &dflag); -} - -/* - * setpassfilter - Set the pass filter for packets - */ -static int -setpassfilter(argv) - char **argv; -{ - pc.linktype = DLT_PPP; - pc.snapshot = PPP_HDRLEN; - - if (pcap_compile(&pc, &pass_filter, *argv, 1, netmask) == 0) - return 1; - option_error("error in pass-filter expression: %s\n", pcap_geterr(&pc)); - return 0; -} - -/* - * setactivefilter - Set the active filter for packets - */ -static int -setactivefilter(argv) - char **argv; -{ - pc.linktype = DLT_PPP; - pc.snapshot = PPP_HDRLEN; - - if (pcap_compile(&pc, &active_filter, *argv, 1, netmask) == 0) - return 1; - option_error("error in active-filter expression: %s\n", pcap_geterr(&pc)); - return 0; -} -#endif - -/* - * noopt - Disable all options. - */ -static int -noopt(argv) - char **argv; -{ - BZERO((char *) &lcp_wantoptions[0], sizeof (struct lcp_options)); - BZERO((char *) &lcp_allowoptions[0], sizeof (struct lcp_options)); - BZERO((char *) &ipcp_wantoptions[0], sizeof (struct ipcp_options)); - BZERO((char *) &ipcp_allowoptions[0], sizeof (struct ipcp_options)); - - return (1); -} - -/* - * setdomain - Set domain name to append to hostname - */ -static int -setdomain(argv) - char **argv; -{ - if (!privileged_option) { - option_error("using the domain option requires root privilege"); - return 0; - } - gethostname(hostname, MAXNAMELEN); - if (**argv != 0) { - if (**argv != '.') - strncat(hostname, ".", MAXNAMELEN - strlen(hostname)); - strncat(hostname, *argv, MAXNAMELEN - strlen(hostname)); - } - hostname[MAXNAMELEN-1] = 0; - return (1); -} - - -/* - * setspeed - Set the speed. - */ -static int -setspeed(arg) - char *arg; -{ - int spd; - int ret = (int )1; - speed_t spdValue = (speed_t)0; - char *ptr; - - if ( !prepass ) { - spd = strtol(arg, &ptr, 0); - if (ptr == arg || *ptr != 0 || spd == 0) { - ret = (int)0; - } - else { - switch ( spd ) { - case 2400: - spdValue = B2400; - break; - case 4800: - spdValue = B4800; - break; - case 9600: - spdValue = B9600; - break; - case 19200: - spdValue = B19200; - break; - case 38400: - spdValue = B38400; - break; - case 57600: - spdValue = B57600; - break; - case 115200: - spdValue = B115200; - break; - default: - ret = (int)0; - break; - } - - if ( spdValue ) { - inspeed = spdValue; - } - } - } - - return ( ret ); -} - - -/* - * setdevname - Set the device name. - */ -static int -setdevname(cp) - char *cp; -{ - struct stat statbuf; - char dev[MAXPATHLEN]; - - if (*cp == 0) - return 0; - - if (strncmp("/dev/", cp, 5) != 0) { - strlcpy(dev, "/dev/", sizeof(dev)); - strlcat(dev, cp, sizeof(dev)); - cp = dev; - } - - /* - * Check if there is a character device by this name. - */ - if (stat(cp, &statbuf) < 0) { - if (errno == ENOENT) - return 0; - option_error("Couldn't stat %s: %m", cp); - return -1; - } - if (!S_ISCHR(statbuf.st_mode)) { - option_error("%s is not a character device", cp); - return -1; - } - - if (phase != PHASE_INITIALIZE) { - option_error("device name cannot be changed after initialization"); - return -1; - } else if (devnam_fixed) { - option_error("per-tty options file may not specify device name"); - return -1; - } - - if (devnam_info.priv && !privileged_option) { - option_error("device name cannot be overridden"); - return -1; - } - - strlcpy(devnam, cp, sizeof(devnam)); - devstat = statbuf; - default_device = 0; - devnam_info.priv = privileged_option; - devnam_info.source = option_source; - - return 1; -} - - -/* - * setipaddr - Set the IP address - */ -static int -setipaddr(arg) - char *arg; -{ - struct hostent *hp; - char *colon; - u_int32_t local, remote; - ipcp_options *wo = &ipcp_wantoptions[0]; - - /* - * IP address pair separated by ":". - */ - if ((colon = strchr(arg, ':')) == NULL) - return 0; - if (prepass) - return 1; - - /* - * If colon first character, then no local addr. - */ - if (colon != arg) { - *colon = '\0'; - if ((local = inet_addr(arg)) == (u_int32_t) -1) { - if ((hp = gethostbyname(arg)) == NULL) { - option_error("unknown host: %s", arg); - return -1; - } else { - local = *(u_int32_t *)hp->h_addr; - } - } - if (bad_ip_adrs(local)) { - option_error("bad local IP address %s", ip_ntoa(local)); - return -1; - } - if (local != 0) - wo->ouraddr = local; - *colon = ':'; - } - - /* - * If colon last character, then no remote addr. - */ - if (*++colon != '\0') { - if ((remote = inet_addr(colon)) == (u_int32_t) -1) { - if ((hp = gethostbyname(colon)) == NULL) { - option_error("unknown host: %s", colon); - return -1; - } else { - remote = *(u_int32_t *)hp->h_addr; - if (remote_name[0] == 0) - strlcpy(remote_name, colon, sizeof(remote_name)); - } - } - if (bad_ip_adrs(remote)) { - option_error("bad remote IP address %s", ip_ntoa(remote)); - return -1; - } - if (remote != 0) - wo->hisaddr = remote; - } - - return 1; -} - - -/* - * setnetmask - set the netmask to be used on the interface. - */ -static int -setnetmask(argv) - char **argv; -{ - u_int32_t mask, b; - int n, ok; - char *p, *endp; - - /* - * Unfortunately, if we use inet_addr, we can't tell whether - * a result of all 1s is an error or a valid 255.255.255.255. - */ - p = *argv; - ok = 0; - mask = 0; - for (n = 3;; --n) { - b = strtoul(p, &endp, 0); - if (endp == p) - break; - if (b > 255) { - if (n == 3) { - /* accept e.g. 0xffffff00 */ - p = endp; - mask = b; - } - break; - } - mask |= b << (n * 8); - p = endp; - if (*p != '.' || n == 0) - break; - ++p; - } - - mask = htonl(mask); - - if (*p != 0 || (netmask & ~mask) != 0) { - option_error("invalid netmask value '%s'", *argv); - return 0; - } - - netmask = mask; - return (1); -} - -static int -setxonxoff(argv) - char **argv; -{ - lcp_wantoptions[0].asyncmap |= 0x000A0000; /* escape ^S and ^Q */ - lcp_wantoptions[0].neg_asyncmap = 1; - - crtscts = -2; - return (1); -} - -static int -setlogfile(argv) - char **argv; -{ - int fd, err; - - fd = open(*argv, O_WRONLY | O_APPEND | O_CREAT | O_EXCL, 0644); - if (fd < 0 && errno == EEXIST) - fd = open(*argv, O_WRONLY | O_APPEND); - err = errno; - if (fd < 0) { - errno = err; - option_error("Can't open log file %s: %m", *argv); - return 0; - } - if (log_to_file && log_to_fd >= 0) - close(log_to_fd); - log_to_fd = fd; - log_to_file = 1; - return 1; -} - -#ifdef PLUGIN -static int -loadplugin(argv) - char **argv; -{ - char *arg = *argv; - void *handle; - const char *err; - void (*init) __P((void)); - - handle = dlopen(arg, RTLD_GLOBAL | RTLD_NOW); - if (handle == 0) { - err = dlerror(); - if (err != 0) - option_error("%s", err); - option_error("Couldn't load plugin %s", arg); - return 0; - } - init = dlsym(handle, "plugin_init"); - if (init == 0) { - option_error("%s has no initialization entry point", arg); - dlclose(handle); - return 0; - } - info("Plugin %s loaded.", arg); - (*init)(); - return 1; -} -#endif /* PLUGIN */ diff --git a/cpukit/pppd/patchlevel.h b/cpukit/pppd/patchlevel.h deleted file mode 100644 index 54d88b8a66..0000000000 --- a/cpukit/pppd/patchlevel.h +++ /dev/null @@ -1,6 +0,0 @@ -/* $Id$ */ -#define PATCHLEVEL 11 - -#define VERSION "2.3" -#define IMPLEMENTATION "" -#define DATE "23 December 1999" diff --git a/cpukit/pppd/pathnames.h b/cpukit/pppd/pathnames.h deleted file mode 100644 index 0a4f6e69f2..0000000000 --- a/cpukit/pppd/pathnames.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * define path names - * - * $Id$ - */ - -#ifdef HAVE_PATHS_H -#include - -#else -#ifndef _PATH_VARRUN -#define _PATH_VARRUN "/etc/ppp/" -#endif -#define _PATH_DEVNULL "/dev/null" -#endif - -#ifndef _ROOT_PATH -#define _ROOT_PATH -#endif - -#define _PATH_UPAPFILE _ROOT_PATH "/etc/ppp/pap-secrets" -#define _PATH_CHAPFILE _ROOT_PATH "/etc/ppp/chap-secrets" -#define _PATH_SYSOPTIONS _ROOT_PATH "/etc/ppp/options" -#define _PATH_IPUP _ROOT_PATH "/etc/ppp/ip-up" -#define _PATH_IPDOWN _ROOT_PATH "/etc/ppp/ip-down" -#define _PATH_AUTHUP _ROOT_PATH "/etc/ppp/auth-up" -#define _PATH_AUTHDOWN _ROOT_PATH "/etc/ppp/auth-down" -#define _PATH_TTYOPT _ROOT_PATH "/etc/ppp/options." -#define _PATH_CONNERRS _ROOT_PATH "/etc/ppp/connect-errors" -#define _PATH_PEERFILES _ROOT_PATH "/etc/ppp/peers/" -#define _PATH_RESOLV _ROOT_PATH "/etc/ppp/resolv.conf" - -#define _PATH_USEROPT ".ppprc" - -#ifdef INET6 -#define _PATH_IPV6UP _ROOT_PATH "/etc/ppp/ipv6-up" -#define _PATH_IPV6DOWN _ROOT_PATH "/etc/ppp/ipv6-down" -#endif - -#ifdef IPX_CHANGE -#define _PATH_IPXUP _ROOT_PATH "/etc/ppp/ipx-up" -#define _PATH_IPXDOWN _ROOT_PATH "/etc/ppp/ipx-down" -#endif /* IPX_CHANGE */ diff --git a/cpukit/pppd/pppd.8 b/cpukit/pppd/pppd.8 deleted file mode 100644 index 227345ff5f..0000000000 --- a/cpukit/pppd/pppd.8 +++ /dev/null @@ -1,1480 +0,0 @@ -.\" manual page [] for pppd 2.3 -.\" $Id$ -.\" SH section heading -.\" SS subsection heading -.\" LP paragraph -.\" IP indented paragraph -.\" TP hanging label -.TH PPPD 8 -.SH NAME -pppd \- Point to Point Protocol daemon -.SH SYNOPSIS -.B pppd -[ -.I tty_name -] [ -.I speed -] [ -.I options -] -.SH DESCRIPTION -.LP -The Point-to-Point Protocol (PPP) provides a method for transmitting -datagrams over serial point-to-point links. PPP -is composed of three parts: a method for encapsulating datagrams over -serial links, an extensible Link Control Protocol (LCP), and -a family of Network Control Protocols (NCP) for establishing -and configuring different network-layer protocols. -.LP -The encapsulation scheme is provided by driver code in the kernel. -Pppd provides the basic LCP, authentication support, and an NCP for -establishing and configuring the Internet Protocol (IP) (called the IP -Control Protocol, IPCP). -.SH FREQUENTLY USED OPTIONS -.TP -.I -Communicate over the named device. The string "/dev/" is prepended if -necessary. If no device name is given, or if the name of the terminal -connected to the standard input is given, pppd will use that terminal, -and will not fork to put itself in the background. A value for this -option from a privileged source cannot be overridden by a -non-privileged user. -.TP -.I -Set the baud rate to (a decimal number). On systems such as -4.4BSD and NetBSD, any speed can be specified. Other systems -(e.g. SunOS) allow only a limited set of speeds. -.TP -.B asyncmap \fI -Set the async character map to . This map describes which -control characters cannot be successfully received over the serial -line. Pppd will ask the peer to send these characters as a 2-byte -escape sequence. The argument is a 32 bit hex number with each bit -representing a character to escape. Bit 0 (00000001) represents the -character 0x00; bit 31 (80000000) represents the character 0x1f or ^_. -If multiple \fIasyncmap\fR options are given, the values are ORed -together. If no \fIasyncmap\fR option is given, no async character -map will be negotiated for the receive direction; the peer should then -escape \fIall\fR control characters. To escape transmitted -characters, use the \fIescape\fR option. -.TP -.B auth -Require the peer to authenticate itself before allowing network -packets to be sent or received. This option is the default if the -system has a default route. If neither this option nor the -\fInoauth\fR option is specified, pppd will only allow the peer to use -IP addresses to which the system does not already have a route. -.TP -.B call \fIname -Read options from the file /etc/ppp/peers/\fIname\fR. This file may -contain privileged options, such as \fInoauth\fR, even if pppd -is not being run by root. The \fIname\fR string may not begin with / -or include .. as a pathname component. The format of the options file -is described below. -.TP -.B connect \fIscript -Use the executable or shell command specified by \fIscript\fR to set -up the serial line. This script would typically use the chat(8) -program to dial the modem and start the remote ppp session. A value -for this option from a privileged source cannot be overridden by a -non-privileged user. -.TP -.B crtscts -Use hardware flow control (i.e. RTS/CTS) to control the flow of -data on the serial port. If neither the \fIcrtscts\fR, the -\fInocrtscts\fR, the \fIcdtrcts\fR nor the \fInocdtrcts\fR option -is given, the hardware flow control setting for the serial port is -left unchanged. -Some serial ports (such as Macintosh serial ports) lack a true -RTS output. Such serial ports use this mode to implement -unidirectional flow control. The serial port will -suspend transmission when requested by the modem (via CTS) -but will be unable to request the modem stop sending to the -computer. This mode retains the ability to use DTR as -a modem control line. -.TP -.B defaultroute -Add a default route to the system routing tables, using the peer as -the gateway, when IPCP negotiation is successfully completed. -This entry is removed when the PPP connection is broken. This option -is privileged if the \fInodefaultroute\fR option has been specified. -.TP -.B disconnect \fIscript -Run the executable or shell command specified by \fIscript\fR after -pppd has terminated the link. This script could, for example, issue -commands to the modem to cause it to hang up if hardware modem control -signals were not available. The disconnect script is not run if the -modem has already hung up. A value for this option from a privileged -source cannot be overridden by a non-privileged user. -.TP -.B escape \fIxx,yy,... -Specifies that certain characters should be escaped on transmission -(regardless of whether the peer requests them to be escaped with its -async control character map). The characters to be escaped are -specified as a list of hex numbers separated by commas. Note that -almost any character can be specified for the \fIescape\fR option, -unlike the \fIasyncmap\fR option which only allows control characters -to be specified. The characters which may not be escaped are those -with hex values 0x20 - 0x3f or 0x5e. -.TP -.B file \fIname -Read options from file \fIname\fR (the format is described below). -The file must be readable by the user who has invoked pppd. -.TP -.B init \fIscript -Run the executable or shell command specified by \fIscript\fR to -initialize the serial line. This script would typically use the -chat(8) program to configure the modem to enable auto answer. A value -for this option from a privileged source cannot be overridden by a -non-privileged user. -.TP -.B lock -Specifies that pppd should create a UUCP-style lock file for the -serial device to ensure exclusive access to the device. -.TP -.B mru \fIn -Set the MRU [Maximum Receive Unit] value to \fIn\fR. Pppd -will ask the peer to send packets of no more than \fIn\fR bytes. The -minimum MRU value is 128. The default MRU value is 1500. A value of -296 is recommended for slow links (40 bytes for TCP/IP header + 256 -bytes of data). (Note that for IPv6 MRU must be at least 1280) -.TP -.B mtu \fIn -Set the MTU [Maximum Transmit Unit] value to \fIn\fR. Unless the -peer requests a smaller value via MRU negotiation, pppd will -request that the kernel networking code send data packets of no more -than \fIn\fR bytes through the PPP network interface. (Note that for -IPv6 MTU must be at least 1280) -.TP -.B passive -Enables the "passive" option in the LCP. With this option, pppd will -attempt to initiate a connection; if no reply is received from the -peer, pppd will then just wait passively for a valid LCP packet from -the peer, instead of exiting, as it would without this option. -.SH OPTIONS -.TP -.I \fB:\fI -Set the local and/or remote interface IP addresses. Either one may be -omitted. The IP addresses can be specified with a host name or in -decimal dot notation (e.g. 150.234.56.78). The default local -address is the (first) IP address of the system (unless the -\fInoipdefault\fR -option is given). The remote address will be obtained from the peer -if not specified in any option. Thus, in simple cases, this option is -not required. If a local and/or remote IP address is specified with -this option, pppd -will not accept a different value from the peer in the IPCP -negotiation, unless the \fIipcp-accept-local\fR and/or -\fIipcp-accept-remote\fR options are given, respectively. -.TP -.B ipv6 \fI\fR,\fI -Set the local and/or remote 64-bit interface identifier. Either one may be -omitted. The identifier must be specified in standard ascii notation of -IPv6 addresses (e.g. ::dead:beef). If the -\fIipv6cp-use-ipaddr\fR -option is given, the local identifier is the local IPv4 address (see above). -On systems which supports a unique persistent id, such as EUI-48 derived -from the Ethernet MAC address, \fIipv6cp-use-persistent\fR option can be -used to replace the \fIipv6 ,\fR option. Otherwise the -identifier is randomized. -.TP -.B active-filter \fIfilter-expression -Specifies a packet filter to be applied to data packets to determine -which packets are to be regarded as link activity, and therefore reset -the idle timer, or cause the link to be brought up in demand-dialling -mode. This option is useful in conjunction with the -\fBidle\fR option if there are packets being sent or received -regularly over the link (for example, routing information packets) -which would otherwise prevent the link from ever appearing to be idle. -The \fIfilter-expression\fR syntax is as described for tcpdump(1), -except that qualifiers which are inappropriate for a PPP link, such as -\fBether\fR and \fBarp\fR, are not permitted. Generally the filter -expression should be enclosed in single-quotes to prevent whitespace -in the expression from being interpreted by the shell. This option -is currently only available under NetBSD, and then only -if both the kernel and pppd were compiled with PPP_FILTER defined. -.TP -.B allow-ip \fIaddress(es) -Allow peers to use the given IP address or subnet without -authenticating themselves. The parameter is parsed as for each -element of the list of allowed IP addresses in the secrets files (see -the AUTHENTICATION section below). -.TP -.B bsdcomp \fInr,nt -Request that the peer compress packets that it sends, using the -BSD-Compress scheme, with a maximum code size of \fInr\fR bits, and -agree to compress packets sent to the peer with a maximum code size of -\fInt\fR bits. If \fInt\fR is not specified, it defaults to the value -given for \fInr\fR. Values in the range 9 to 15 may be used for -\fInr\fR and \fInt\fR; larger values give better compression but -consume more kernel memory for compression dictionaries. -Alternatively, a value of 0 for \fInr\fR or \fInt\fR disables -compression in the corresponding direction. Use \fInobsdcomp\fR or -\fIbsdcomp 0\fR to disable BSD-Compress compression entirely. -.TP -.B cdtrcts -Use a non-standard hardware flow control (i.e. DTR/CTS) to control -the flow of data on the serial port. If neither the \fIcrtscts\fR, -the \fInocrtscts\fR, the \fIcdtrcts\fR nor the \fInocdtrcts\fR -option is given, the hardware flow control setting for the serial -port is left unchanged. -Some serial ports (such as Macintosh serial ports) lack a true -RTS output. Such serial ports use this mode to implement true -bi-directional flow control. The sacrifice is that this flow -control mode does not permit using DTR as a modem control line. -.TP -.B chap-interval \fIn -If this option is given, pppd will rechallenge the peer every \fIn\fR -seconds. -.TP -.B chap-max-challenge \fIn -Set the maximum number of CHAP challenge transmissions to \fIn\fR -(default 10). -.TP -.B chap-restart \fIn -Set the CHAP restart interval (retransmission timeout for challenges) -to \fIn\fR seconds (default 3). -.TP -.B connect-delay \fIn -Wait for up \fIn\fR milliseconds after the connect script finishes for -a valid PPP packet from the peer. At the end of this time, or when a -valid PPP packet is received from the peer, pppd will commence -negotiation by sending its first LCP packet. The default value is -1000 (1 second). This wait period only applies if the \fBconnect\fR -or \fBpty\fR option is used. -.TP -.B debug -Enables connection debugging facilities. -If this option is given, pppd will log the contents of all -control packets sent or received in a readable form. The packets are -logged through syslog with facility \fIdaemon\fR and level -\fIdebug\fR. This information can be directed to a file by setting up -/etc/syslog.conf appropriately (see syslog.conf(5)). -.TP -.B default-asyncmap -Disable asyncmap negotiation, forcing all control characters to be -escaped for both the transmit and the receive direction. -.TP -.B default-mru -Disable MRU [Maximum Receive Unit] negotiation. With this option, -pppd will use the default MRU value of 1500 bytes for both the -transmit and receive direction. -.TP -.B deflate \fInr,nt -Request that the peer compress packets that it sends, using the -Deflate scheme, with a maximum window size of \fI2**nr\fR bytes, and -agree to compress packets sent to the peer with a maximum window size -of \fI2**nt\fR bytes. If \fInt\fR is not specified, it defaults to -the value given for \fInr\fR. Values in the range 8 to 15 may be used -for \fInr\fR and \fInt\fR; larger values give better compression but -consume more kernel memory for compression dictionaries. -Alternatively, a value of 0 for \fInr\fR or \fInt\fR disables -compression in the corresponding direction. Use \fInodeflate\fR or -\fIdeflate 0\fR to disable Deflate compression entirely. (Note: pppd -requests Deflate compression in preference to BSD-Compress if the peer -can do either.) -.TP -.B demand -Initiate the link only on demand, i.e. when data traffic is present. -With this option, the remote IP address must be specified by the user -on the command line or in an options file. Pppd will initially -configure the interface and enable it for IP traffic without -connecting to the peer. When traffic is available, pppd will -connect to the peer and perform negotiation, authentication, etc. -When this is completed, pppd will commence passing data packets -(i.e., IP packets) across the link. - -The \fIdemand\fR option implies the \fIpersist\fR option. If this -behaviour is not desired, use the \fInopersist\fR option after the -\fIdemand\fR option. The \fIidle\fR and \fIholdoff\fR -options are also useful in conjuction with the \fIdemand\fR option. -.TP -.B domain \fId -Append the domain name \fId\fR to the local host name for authentication -purposes. For example, if gethostname() returns the name porsche, but -the fully qualified domain name is porsche.Quotron.COM, you could -specify \fIdomain Quotron.COM\fR. Pppd would then use the name -\fIporsche.Quotron.COM\fR for looking up secrets in the secrets file, -and as the default name to send to the peer when authenticating itself -to the peer. This option is privileged. -.TP -.B hide-password -When logging the contents of PAP packets, this option causes pppd to -exclude the password string from the log. This is the default. -.TP -.B holdoff \fIn -Specifies how many seconds to wait before re-initiating the link after -it terminates. This option only has any effect if the \fIpersist\fR -or \fIdemand\fR option is used. The holdoff period is not applied if -the link was terminated because it was idle. -.TP -.B idle \fIn -Specifies that pppd should disconnect if the link is idle for \fIn\fR -seconds. The link is idle when no data packets (i.e. IP packets) are -being sent or received. Note: it is not advisable to use this option -with the \fIpersist\fR option without the \fIdemand\fR option. -If the \fBactive-filter\fR -option is given, data packets which are rejected by the specified -activity filter also count as the link being idle. -.TP -.B ipcp-accept-local -With this option, pppd will accept the peer's idea of our local IP -address, even if the local IP address was specified in an option. -.TP -.B ipcp-accept-remote -With this option, pppd will accept the peer's idea of its (remote) IP -address, even if the remote IP address was specified in an option. -.TP -.B ipcp-max-configure \fIn -Set the maximum number of IPCP configure-request transmissions to -\fIn\fR (default 10). -.TP -.B ipcp-max-failure \fIn -Set the maximum number of IPCP configure-NAKs returned before starting -to send configure-Rejects instead to \fIn\fR (default 10). -.TP -.B ipcp-max-terminate \fIn -Set the maximum number of IPCP terminate-request transmissions to -\fIn\fR (default 3). -.TP -.B ipcp-restart \fIn -Set the IPCP restart interval (retransmission timeout) to \fIn\fR -seconds (default 3). -.TP -.B ipparam \fIstring -Provides an extra parameter to the ip-up and ip-down scripts. If this -option is given, the \fIstring\fR supplied is given as the 6th -parameter to those scripts. -.TP -.B ipv6cp-max-configure \fIn -Set the maximum number of IPv6CP configure-request transmissions to -\fIn\fR (default 10). -.TP -.B ipv6cp-max-failure \fIn -Set the maximum number of IPv6CP configure-NAKs returned before starting -to send configure-Rejects instead to \fIn\fR (default 10). -.TP -.B ipv6cp-max-terminate \fIn -Set the maximum number of IPv6CP terminate-request transmissions to -\fIn\fR (default 3). -.TP -.B ipv6cp-restart \fIn -Set the IPv6CP restart interval (retransmission timeout) to \fIn\fR -seconds (default 3). -.TP -.B ipx -Enable the IPXCP and IPX protocols. This option is presently only -supported under Linux, and only if your kernel has been configured to -include IPX support. -.TP -.B ipx-network \fIn -Set the IPX network number in the IPXCP configure request frame to -\fIn\fR, a hexadecimal number (without a leading 0x). There is no -valid default. If this option is not specified, the network number is -obtained from the peer. If the peer does not have the network number, -the IPX protocol will not be started. -.TP -.B ipx-node \fIn\fB:\fIm -Set the IPX node numbers. The two node numbers are separated from each -other with a colon character. The first number \fIn\fR is the local -node number. The second number \fIm\fR is the peer's node number. Each -node number is a hexadecimal number, at most 10 digits long. The node -numbers on the ipx-network must be unique. There is no valid -default. If this option is not specified then the node numbers are -obtained from the peer. -.TP -.B ipx-router-name \fI -Set the name of the router. This is a string and is sent to the peer -as information data. -.TP -.B ipx-routing \fIn -Set the routing protocol to be received by this option. More than one -instance of \fIipx-routing\fR may be specified. The '\fInone\fR' -option (0) may be specified as the only instance of ipx-routing. The -values may be \fI0\fR for \fINONE\fR, \fI2\fR for \fIRIP/SAP\fR, and -\fI4\fR for \fINLSP\fR. -.TP -.B ipxcp-accept-local -Accept the peer's NAK for the node number specified in the ipx-node -option. If a node number was specified, and non-zero, the default is -to insist that the value be used. If you include this option then you -will permit the peer to override the entry of the node number. -.TP -.B ipxcp-accept-network -Accept the peer's NAK for the network number specified in the -ipx-network option. If a network number was specified, and non-zero, the -default is to insist that the value be used. If you include this -option then you will permit the peer to override the entry of the node -number. -.TP -.B ipxcp-accept-remote -Use the peer's network number specified in the configure request -frame. If a node number was specified for the peer and this option was -not specified, the peer will be forced to use the value which you have -specified. -.TP -.B ipxcp-max-configure \fIn -Set the maximum number of IPXCP configure request frames which the -system will send to \fIn\fR. The default is 10. -.TP -.B ipxcp-max-failure \fIn -Set the maximum number of IPXCP NAK frames which the local system will -send before it rejects the options. The default value is 3. -.TP -.B ipxcp-max-terminate \fIn -Set the maximum nuber of IPXCP terminate request frames before the -local system considers that the peer is not listening to them. The -default value is 3. -.TP -.B kdebug \fIn -Enable debugging code in the kernel-level PPP driver. The argument -\fIn\fR is a number which is the sum of the following values: 1 to -enable general debug messages, 2 to request that the contents of -received packets be printed, and 4 to request that the contents of -transmitted packets be printed. On most systems, messages printed by -the kernel are logged by syslog(1) to a file as directed in the -/etc/syslog.conf configuration file. -.TP -.B ktune -Enables pppd to alter kernel settings as appropriate. Under Linux, -pppd will enable IP forwarding (i.e. set /proc/sys/net/ipv4/ip_forward -to 1) if the \fIproxyarp\fR option is used, and will enable the -dynamic IP address option (i.e. set /proc/sys/net/ipv4/ip_dynaddr to -1) in demand mode if the local address changes. -.TP -.B lcp-echo-failure \fIn -If this option is given, pppd will presume the peer to be dead -if \fIn\fR LCP echo-requests are sent without receiving a valid LCP -echo-reply. If this happens, pppd will terminate the -connection. Use of this option requires a non-zero value for the -\fIlcp-echo-interval\fR parameter. This option can be used to enable -pppd to terminate after the physical connection has been broken -(e.g., the modem has hung up) in situations where no hardware modem -control lines are available. -.TP -.B lcp-echo-interval \fIn -If this option is given, pppd will send an LCP echo-request frame to -the peer every \fIn\fR seconds. Normally the peer should respond to -the echo-request by sending an echo-reply. This option can be used -with the \fIlcp-echo-failure\fR option to detect that the peer is no -longer connected. -.TP -.B lcp-max-configure \fIn -Set the maximum number of LCP configure-request transmissions to -\fIn\fR (default 10). -.TP -.B lcp-max-failure \fIn -Set the maximum number of LCP configure-NAKs returned before starting -to send configure-Rejects instead to \fIn\fR (default 10). -.TP -.B lcp-max-terminate \fIn -Set the maximum number of LCP terminate-request transmissions to -\fIn\fR (default 3). -.TP -.B lcp-restart \fIn -Set the LCP restart interval (retransmission timeout) to \fIn\fR -seconds (default 3). -.TP -.B linkname \fIname\fR -Sets the logical name of the link to \fIname\fR. Pppd will create a -file named \fBppp-\fIname\fB.pid\fR in /var/run (or /etc/ppp on some -systems) containing its process ID. This can be useful in determining -which instance of pppd is responsible for the link to a given peer -system. This is a privileged option. -.TP -.B local -Don't use the modem control lines. With this option, pppd will ignore -the state of the CD (Carrier Detect) signal from the modem and will -not change the state of the DTR (Data Terminal Ready) signal. -.TP -.B logfd \fIn -Send log messages to file descriptor \fIn\fR. Pppd will send log -messages to at most one file or file descriptor (as well as sending -the log messages to syslog), so this option and the \fBlogfile\fR -option are mutually exclusive. The default is for pppd to send log -messages to stdout (file descriptor 1), unless the serial port is -already open on stdout. -.TP -.B logfile \fIfilename -Append log messages to the file \fIfilename\fR (as well as sending the -log messages to syslog). The file is opened with the privileges of -the user who invoked pppd, in append mode. -.TP -.B login -Use the system password database for authenticating the peer using -PAP, and record the user in the system wtmp file. Note that the peer -must have an entry in the /etc/ppp/pap-secrets file as well as the -system password database to be allowed access. -.TP -.B maxconnect \fIn -Terminate the connection when it has been available for network -traffic for \fIn\fR seconds (i.e. \fIn\fR seconds after the first -network control protocol comes up). -.TP -.B maxfail \fIn -Terminate after \fIn\fR consecutive failed connection attempts. A -value of 0 means no limit. The default value is 10. -.TP -.B modem -Use the modem control lines. This option is the default. With this -option, pppd will wait for the CD (Carrier Detect) signal from the -modem to be asserted when opening the serial device (unless a connect -script is specified), and it will drop the DTR (Data Terminal Ready) -signal briefly when the connection is terminated and before executing -the connect script. On Ultrix, this option implies hardware flow -control, as for the \fIcrtscts\fR option. -.TP -.B ms-dns \fI -If pppd is acting as a server for Microsoft Windows clients, this -option allows pppd to supply one or two DNS (Domain Name Server) -addresses to the clients. The first instance of this option specifies -the primary DNS address; the second instance (if given) specifies the -secondary DNS address. (This option was present in some older -versions of pppd under the name \fBdns-addr\fR.) -.TP -.B ms-wins \fI -If pppd is acting as a server for Microsoft Windows or "Samba" -clients, this option allows pppd to supply one or two WINS (Windows -Internet Name Services) server addresses to the clients. The first -instance of this option specifies the primary WINS address; the second -instance (if given) specifies the secondary WINS address. -.TP -.B name \fIname -Set the name of the local system for authentication purposes to -\fIname\fR. This is a privileged option. With this option, pppd will -use lines in the secrets files which have \fIname\fR as the second -field when looking for a secret to use in authenticating the peer. In -addition, unless overridden with the \fIuser\fR option, \fIname\fR -will be used as the name to send to the peer when authenticating the -local system to the peer. (Note that pppd does not append the domain -name to \fIname\fR.) -.TP -.B netmask \fIn -Set the interface netmask to \fIn\fR, a 32 bit netmask in "decimal dot" -notation (e.g. 255.255.255.0). If this option is given, the value -specified is ORed with the default netmask. The default netmask is -chosen based on the negotiated remote IP address; it is the -appropriate network mask for the class of the remote IP address, ORed -with the netmasks for any non point-to-point network interfaces in the -system which are on the same network. (Note: on some platforms, pppd -will always use 255.255.255.255 for the netmask, if that is the only -appropriate value for a point-to-point interface.) -.TP -.B noaccomp -Disable Address/Control compression in both directions (send and -receive). -.TP -.B noauth -Do not require the peer to authenticate itself. This option is -privileged. -.TP -.B nobsdcomp -Disables BSD-Compress compression; \fBpppd\fR will not request or -agree to compress packets using the BSD-Compress scheme. -.TP -.B noccp -Disable CCP (Compression Control Protocol) negotiation. This option -should only be required if the peer is buggy and gets confused by -requests from pppd for CCP negotiation. -.TP -.B nocrtscts -Disable hardware flow control (i.e. RTS/CTS) on the serial port. -If neither the \fIcrtscts\fR nor the \fInocrtscts\fR nor the -\fIcdtrcts\fR nor the \fInodtrcts\fR option is given, the hardware -flow control setting for the serial port is left unchanged. -.TP -.B nodtrcts -This option is a synonym for \fInocrtscts\fR. Either of these options will -disable both forms of hardware flow control. -.TP -.B nodefaultroute -Disable the \fIdefaultroute\fR option. The system administrator who -wishes to prevent users from creating default routes with pppd -can do so by placing this option in the /etc/ppp/options file. -.TP -.B nodeflate -Disables Deflate compression; pppd will not request or agree to -compress packets using the Deflate scheme. -.TP -.B nodetach -Don't detach from the controlling terminal. Without this option, if a -serial device other than the terminal on the standard input is -specified, pppd will fork to become a background process. -.TP -.B noip -Disable IPCP negotiation and IP communication. This option should -only be required if the peer is buggy and gets confused by requests -from pppd for IPCP negotiation. -.TP -.B noipv6 -Disable IPv6CP negotiation and IPv6 communication. This option should -only be required if the peer is buggy and gets confused by requests -from pppd for IPv6CP negotiation. -.TP -.B noipdefault -Disables the default behaviour when no local IP address is specified, -which is to determine (if possible) the local IP address from the -hostname. With this option, the peer will have to supply the local IP -address during IPCP negotiation (unless it specified explicitly on the -command line or in an options file). -.TP -.B noipx -Disable the IPXCP and IPX protocols. This option should only be -required if the peer is buggy and gets confused by requests from pppd -for IPXCP negotiation. -.TP -.B noktune -Opposite of the \fIktune\fR option; disables pppd from changing system -settings. -.TP -.B nolog -Do not send log messages to a file or file descriptor. This option -cancels the \fBlogfd\fR and \fBlogfile\fR options. -.B nomagic -Disable magic number negotiation. With this option, pppd cannot -detect a looped-back line. This option should only be needed if the -peer is buggy. -.TP -.B nopcomp -Disable protocol field compression negotiation in both the receive and -the transmit direction. -.TP -.B nopersist -Exit once a connection has been made and terminated. This is the -default unless the \fIpersist\fR or \fIdemand\fR option has been -specified. -.TP -.B nopredictor1 -Do not accept or agree to Predictor-1 compression. -.TP -.B noproxyarp -Disable the \fIproxyarp\fR option. The system administrator who -wishes to prevent users from creating proxy ARP entries with pppd can -do so by placing this option in the /etc/ppp/options file. -.TP -.B notty -Normally, pppd requires a terminal device. With this option, pppd -will allocate itself a pseudo-tty master/slave pair and use the slave -as its terminal device. Pppd will create a child process to act as a -`character shunt' to transfer characters between the pseudo-tty master -and its standard input and output. Thus pppd will transmit characters -on its standard output and receive characters on its standard input -even if they are not terminal devices. This option increases the -latency and CPU overhead of transferring data over the ppp interface -as all of the characters sent and received must flow through the -character shunt process. An explicit device name may not be given if -this option is used. -.TP -.B novj -Disable Van Jacobson style TCP/IP header compression in both the -transmit and the receive direction. -.TP -.B novjccomp -Disable the connection-ID compression option in Van Jacobson style -TCP/IP header compression. With this option, pppd will not omit the -connection-ID byte from Van Jacobson compressed TCP/IP headers, nor -ask the peer to do so. -.TP -.B papcrypt -Indicates that all secrets in the /etc/ppp/pap-secrets file which are -used for checking the identity of the peer are encrypted, and thus -pppd should not accept a password which, before encryption, is -identical to the secret from the /etc/ppp/pap-secrets file. -.TP -.B pap-max-authreq \fIn -Set the maximum number of PAP authenticate-request transmissions to -\fIn\fR (default 10). -.TP -.B pap-restart \fIn -Set the PAP restart interval (retransmission timeout) to \fIn\fR -seconds (default 3). -.TP -.B pap-timeout \fIn -Set the maximum time that pppd will wait for the peer to authenticate -itself with PAP to \fIn\fR seconds (0 means no limit). -.TP -.B pass-filter \fIfilter-expression -Specifies a packet filter to applied to data packets being sent or -received to determine which packets should be allowed to pass. -Packets which are rejected by the filter are silently discarded. This -option can be used to prevent specific network daemons (such as -routed) using up link bandwidth, or to provide a basic firewall -capability. -The \fIfilter-expression\fR syntax is as described for tcpdump(1), -except that qualifiers which are inappropriate for a PPP link, such as -\fBether\fR and \fBarp\fR, are not permitted. Generally the filter -expression should be enclosed in single-quotes to prevent whitespace -in the expression from being interpreted by the shell. Note that it -is possible to apply different constraints to incoming and outgoing -packets using the \fBinbound\fR and \fBoutbound\fR qualifiers. This -option is currently only available under NetBSD, and then only if both -the kernel and pppd were compiled with PPP_FILTER defined. -.TP -.B persist -Do not exit after a connection is terminated; instead try to reopen -the connection. -.TP -.B plugin \fIfilename -Load the shared library object file \fIfilename\fR as a plugin. This -is a privileged option. -.TP -.B predictor1 -Request that the peer compress frames that it sends using Predictor-1 -compression, and agree to compress transmitted frames with Predictor-1 -if requested. This option has no effect unless the kernel driver -supports Predictor-1 compression. -.TP -.B privgroup \fIgroup-name -Allows members of group \fIgroup-name\fR to use privileged options. -This is a privileged option. Use of this option requires care as -there is no guarantee that members of \fIgroup-name\fR cannot use pppd -to become root themselves. Consider it equivalent to putting the -members of \fIgroup-name\fR in the kmem or disk group. -.TP -.B proxyarp -Add an entry to this system's ARP [Address Resolution Protocol] table -with the IP address of the peer and the Ethernet address of this -system. This will have the effect of making the peer appear to other -systems to be on the local ethernet. -.TP -.B pty \fIscript -Specifies that the command \fIscript\fR is to be used to communicate -rather than a specific terminal device. Pppd will allocate itself a -pseudo-tty master/slave pair and use the slave as its terminal -device. The \fIscript\fR will be run in a child process with the -pseudo-tty master as its standard input and output. An explicit -device name may not be given if this option is used. (Note: if the -\fIrecord\fR option is used in conjuction with the \fIpty\fR option, -the child process will have pipes on its standard input and output.) -.TP -.B receive-all -With this option, pppd will accept all control characters from the -peer, including those marked in the receive asyncmap. Without this -option, pppd will discard those characters as specified in RFC1662. -This option should only be needed if the peer is buggy. -.TP -.B record \fIfilename -Specifies that pppd should record all characters sent and received to -a file named \fIfilename\fR. This file is opened in append mode, -using the user's user-ID and permissions. This option is implemented -using a pseudo-tty and a process to transfer characters between the -pseudo-tty and the real serial device, so it will increase the latency -and CPU overhead of transferring data over the ppp interface. The -characters are stored in a tagged format with timestamps, which can be -displayed in readable form using the pppdump(8) program. -.TP -.B remotename \fIname -Set the assumed name of the remote system for authentication purposes -to \fIname\fR. -.TP -.B refuse-chap -With this option, pppd will not agree to authenticate itself to the -peer using CHAP. -.TP -.B refuse-pap -With this option, pppd will not agree to authenticate itself to the -peer using PAP. -.TP -.B require-chap -Require the peer to authenticate itself using CHAP [Challenge -Handshake Authentication Protocol] authentication. -.TP -.B require-pap -Require the peer to authenticate itself using PAP [Password -Authentication Protocol] authentication. -.TP -.B show-password -When logging the contents of PAP packets, this option causes pppd to -show the password string in the log message. -.TP -.B silent -With this option, pppd will not transmit LCP packets to initiate a -connection until a valid LCP packet is received from the peer (as for -the `passive' option with ancient versions of pppd). -.TP -.B sync -Use synchronous HDLC serial encoding instead of asynchronous. -The device used by pppd with this option must have sync support. -Currently supports Microgate SyncLink adapters -under Linux and FreeBSD 2.2.8 and later. -.TP -.B updetach -With this option, pppd will detach from its controlling terminal once -it has successfully established the ppp connection (to the point where -the first network control protocol, usually the IP control protocol, -has come up). -.TP -.B usehostname -Enforce the use of the hostname (with domain name appended, if given) -as the name of the local system for authentication purposes (overrides -the \fIname\fR option). This option is not normally needed since the -\fIname\fR option is privileged. -.TP -.B usepeerdns -Ask the peer for up to 2 DNS server addresses. The addresses supplied -by the peer (if any) are passed to the /etc/ppp/ip-up script in the -environment variables DNS1 and DNS2. In addition, pppd will create an -/etc/ppp/resolv.conf file containing one or two nameserver lines with -the address(es) supplied by the peer. -.TP -.B user \fIname -Sets the name used for authenticating the local system to the peer to -\fIname\fR. -.TP -.B vj-max-slots \fIn -Sets the number of connection slots to be used by the Van Jacobson -TCP/IP header compression and decompression code to \fIn\fR, which -must be between 2 and 16 (inclusive). -.TP -.B welcome \fIscript -Run the executable or shell command specified by \fIscript\fR before -initiating PPP negotiation, after the connect script (if any) has -completed. A value for this option from a privileged source cannot be -overridden by a non-privileged user. -.TP -.B xonxoff -Use software flow control (i.e. XON/XOFF) to control the flow of data on -the serial port. -.SH OPTIONS FILES -Options can be taken from files as well as the command line. Pppd -reads options from the files /etc/ppp/options, ~/.ppprc and -/etc/ppp/options.\fIttyname\fR (in that order) before processing the -options on the command line. (In fact, the command-line options are -scanned to find the terminal name before the options.\fIttyname\fR -file is read.) In forming the name of the options.\fIttyname\fR file, -the initial /dev/ is removed from the terminal name, and any remaining -/ characters are replaced with dots. -.PP -An options file is parsed into a series of words, delimited by -whitespace. Whitespace can be included in a word by enclosing the -word in double-quotes ("). A backslash (\\) quotes the following character. -A hash (#) starts a comment, which continues until the end of the -line. There is no restriction on using the \fIfile\fR or \fIcall\fR -options within an options file. -.SH SECURITY -.I pppd -provides system administrators with sufficient access control that PPP -access to a server machine can be provided to legitimate users without -fear of compromising the security of the server or the network it's -on. This control is provided through restrictions on which IP -addresses the peer may use, based on its authenticated identity (if -any), and through restrictions on which options a non-privileged user -may use. Several of pppd's options are privileged, in particular -those which permit potentially insecure configurations; these options -are only accepted in files which are under the control of the system -administrator, or if pppd is being run by root. -.PP -The default behaviour of pppd is to allow an unauthenticated peer to -use a given IP address only if the system does not already have a -route to that IP address. For example, a system with a -permanent connection to the wider internet will normally have a -default route, and thus all peers will have to authenticate themselves -in order to set up a connection. On such a system, the \fIauth\fR -option is the default. On the other hand, a system where the -PPP link is the only connection to the internet will not normally have -a default route, so the peer will be able to use almost any IP address -without authenticating itself. -.PP -As indicated above, some security-sensitive options are privileged, -which means that they may not be used by an ordinary non-privileged -user running a setuid-root pppd, either on the command line, in the -user's ~/.ppprc file, or in an options file read using the \fIfile\fR -option. Privileged options may be used in /etc/ppp/options file or in -an options file read using the \fIcall\fR option. If pppd is being -run by the root user, privileged options can be used without -restriction. -.PP -When opening the device, pppd uses either the invoking user's user ID -or the root UID (that is, 0), depending on whether the device name was -specified by the user or the system administrator. If the device name -comes from a privileged source, that is, /etc/ppp/options or an -options file read using the \fIcall\fR option, pppd uses full root -privileges when opening the device. Thus, by creating an appropriate -file under /etc/ppp/peers, the system administrator can allow users to -establish a ppp connection via a device which they would not normally -have permission to access. Otherwise pppd uses the invoking user's -real UID when opening the device. -.SH AUTHENTICATION -Authentication is the process whereby one peer convinces the other of -its identity. This involves the first peer sending its name to the -other, together with some kind of secret information which could only -come from the genuine authorized user of that name. In such an -exchange, we will call the first peer the "client" and the other the -"server". The client has a name by which it identifies itself to the -server, and the server also has a name by which it identifies itself -to the client. Generally the genuine client shares some secret (or -password) with the server, and authenticates itself by proving that it -knows that secret. Very often, the names used for authentication -correspond to the internet hostnames of the peers, but this is not -essential. -.LP -At present, pppd supports two authentication protocols: the Password -Authentication Protocol (PAP) and the Challenge Handshake -Authentication Protocol (CHAP). PAP involves the client sending its -name and a cleartext password to the server to authenticate itself. -In contrast, the server initiates the CHAP authentication exchange by -sending a challenge to the client (the challenge packet includes the -server's name). The client must respond with a response which -includes its name plus a hash value derived from the shared secret and -the challenge, in order to prove that it knows the secret. -.LP -The PPP protocol, being symmetrical, allows both peers to require the -other to authenticate itself. In that case, two separate and -independent authentication exchanges will occur. The two exchanges -could use different authentication protocols, and in principle, -different names could be used in the two exchanges. -.LP -The default behaviour of pppd is to agree to authenticate if -requested, and to not require authentication from the peer. However, -pppd will not agree to authenticate itself with a particular protocol -if it has no secrets which could be used to do so. -.LP -Pppd stores secrets for use in authentication in secrets -files (/etc/ppp/pap-secrets for PAP, /etc/ppp/chap-secrets for CHAP). -Both secrets files have the same format. The secrets files can -contain secrets for pppd to use in authenticating itself to other -systems, as well as secrets for pppd to use when authenticating other -systems to itself. -.LP -Each line in a secrets file contains one secret. A given secret is -specific to a particular combination of client and server - it can -only be used by that client to authenticate itself to that server. -Thus each line in a secrets file has at least 3 fields: the name of -the client, the name of the server, and the secret. These fields may -be followed by a list of the IP addresses that the specified client -may use when connecting to the specified server. -.LP -A secrets file is parsed into words as for a options file, so the -client name, server name and secrets fields must each be one word, -with any embedded spaces or other special characters quoted or -escaped. Note that case is significant in the client and server names -and in the secret. -.LP -If the secret starts with an `@', what follows is assumed to be the -name of a file from which to read the secret. A "*" as the client or -server name matches any name. When selecting a secret, pppd takes the -best match, i.e. the match with the fewest wildcards. -.LP -Any following words on the same line are taken to be a list of -acceptable IP addresses for that client. If there are only 3 words on -the line, or if the first word is "-", then all IP addresses are -disallowed. To allow any address, use "*". A word starting with "!" -indicates that the specified address is \fInot\fR acceptable. An -address may be followed by "/" and a number \fIn\fR, to indicate a -whole subnet, i.e. all addresses which have the same value in the most -significant \fIn\fR bits. In this form, the address may be followed -by a plus sign ("+") to indicate that one address from the subnet is -authorized, based on the ppp network interface unit number in use. -In this case, the host part of the address will be set to the unit -number plus one. -.LP -Thus a secrets file contains both secrets for use in authenticating -other hosts, plus secrets which we use for authenticating ourselves to -others. When pppd is authenticating the peer (checking the peer's -identity), it chooses a secret with the peer's name in the first -field and the name of the local system in the second field. The -name of the local system defaults to the hostname, with the domain -name appended if the \fIdomain\fR option is used. This default can be -overridden with the \fIname\fR option, except when the -\fIusehostname\fR option is used. -.LP -When pppd is choosing a secret to use in authenticating itself to the -peer, it first determines what name it is going to use to identify -itself to the peer. This name can be specified by the user with the -\fIuser\fR option. If this option is not used, the name defaults to -the name of the local system, determined as described in the previous -paragraph. Then pppd looks for a secret with this name in the first -field and the peer's name in the second field. Pppd will know the -name of the peer if CHAP authentication is being used, because the -peer will have sent it in the challenge packet. However, if PAP is being -used, pppd will have to determine the peer's name from the options -specified by the user. The user can specify the peer's name directly -with the \fIremotename\fR option. Otherwise, if the remote IP address -was specified by a name (rather than in numeric form), that name will -be used as the peer's name. Failing that, pppd will use the null -string as the peer's name. -.LP -When authenticating the peer with PAP, the supplied password is first -compared with the secret from the secrets file. If the password -doesn't match the secret, the password is encrypted using crypt() and -checked against the secret again. Thus secrets for authenticating the -peer can be stored in encrypted form if desired. If the -\fIpapcrypt\fR option is given, the first (unencrypted) comparison is -omitted, for better security. -.LP -Furthermore, if the \fIlogin\fR option was specified, the username and -password are also checked against the system password database. Thus, -the system administrator can set up the pap-secrets file to allow PPP -access only to certain users, and to restrict the set of IP addresses -that each user can use. Typically, when using the \fIlogin\fR option, -the secret in /etc/ppp/pap-secrets would be "", which will match any -password supplied by the peer. This avoids the need to have the same -secret in two places. -.LP -Authentication must be satisfactorily completed before IPCP (or any -other Network Control Protocol) can be started. If the peer is -required to authenticate itself, and fails to do so, pppd will -terminated the link (by closing LCP). If IPCP negotiates an -unacceptable IP address for the remote host, IPCP will be closed. IP -packets can only be sent or received when IPCP is open. -.LP -In some cases it is desirable to allow some hosts which can't -authenticate themselves to connect and use one of a restricted set of -IP addresses, even when the local host generally requires -authentication. If the peer refuses to authenticate itself when -requested, pppd takes that as equivalent to authenticating with PAP -using the empty string for the username and password. Thus, by adding -a line to the pap-secrets file which specifies the empty string for -the client and password, it is possible to allow restricted access to -hosts which refuse to authenticate themselves. -.SH ROUTING -.LP -When IPCP negotiation is completed successfully, pppd will inform the -kernel of the local and remote IP addresses for the ppp interface. -This is sufficient to create a host route to the remote end of the -link, which will enable the peers to exchange IP packets. -Communication with other machines generally requires further -modification to routing tables and/or ARP (Address Resolution -Protocol) tables. In most cases the \fIdefaultroute\fR and/or -\fIproxyarp\fR options are sufficient for this, but in some cases -further intervention is required. The /etc/ppp/ip-up script can be -used for this. -.LP -Sometimes it is desirable to add a default route through the remote -host, as in the case of a machine whose only connection to the -Internet is through the ppp interface. The \fIdefaultroute\fR option -causes pppd to create such a default route when IPCP comes up, and -delete it when the link is terminated. -.LP -In some cases it is desirable to use proxy ARP, for example on a -server machine connected to a LAN, in order to allow other hosts to -communicate with the remote host. The \fIproxyarp\fR option causes -pppd to look for a network interface on the same subnet as the remote -host (an interface supporting broadcast and ARP, which is up and not a -point-to-point or loopback interface). If found, pppd creates a -permanent, published ARP entry with the IP address of the remote host -and the hardware address of the network interface found. -.LP -When the \fIdemand\fR option is used, the interface IP addresses have -already been set at the point when IPCP comes up. If pppd has not -been able to negotiate the same addresses that it used to configure -the interface (for example when the peer is an ISP that uses dynamic -IP address assignment), pppd has to change the interface IP addresses -to the negotiated addresses. This may disrupt existing connections, -and the use of demand dialling with peers that do dynamic IP address -assignment is not recommended. -.SH EXAMPLES -.LP -The following examples assume that the /etc/ppp/options file contains -the \fIauth\fR option (as in the default /etc/ppp/options file in the -ppp distribution). -.LP -Probably the most common use of pppd is to dial out to an ISP. This -can be done with a command such as -.IP -pppd call isp -.LP -where the /etc/ppp/peers/isp file is set up by the system -administrator to contain something like this: -.IP -ttyS0 19200 crtscts -.br -connect '/usr/sbin/chat -v -f /etc/ppp/chat-isp' -.br -noauth -.LP -In this example, we are using chat to dial the ISP's modem and go -through any logon sequence required. The /etc/ppp/chat-isp file -contains the script used by chat; it could for example contain -something like this: -.IP -ABORT "NO CARRIER" -.br -ABORT "NO DIALTONE" -.br -ABORT "ERROR" -.br -ABORT "NO ANSWER" -.br -ABORT "BUSY" -.br -ABORT "Username/Password Incorrect" -.br -"" "at" -.br -OK "at&d0&c1" -.br -OK "atdt2468135" -.br -"name:" "^Umyuserid" -.br -"word:" "\\qmypassword" -.br -"ispts" "\\q^Uppp" -.br -"~-^Uppp-~" -.LP -See the chat(8) man page for details of chat scripts. -.LP -Pppd can also be used to provide a dial-in ppp service for users. If -the users already have login accounts, the simplest way to set up the -ppp service is to let the users log in to their accounts and run pppd -(installed setuid-root) with a command such as -.IP -pppd proxyarp -.LP -To allow a user to use the PPP facilities, you need to allocate an IP -address for that user's machine and create an entry in -/etc/ppp/pap-secrets or /etc/ppp/chap-secrets (depending on which -authentication method the PPP implementation on the user's machine -supports), so that the user's -machine can authenticate itself. For example, if Joe has a machine -called "joespc" which is to be allowed to dial in to the machine -called "server" and use the IP address joespc.my.net, you would add an -entry like this to /etc/ppp/pap-secrets or /etc/ppp/chap-secrets: -.IP -joespc server "joe's secret" joespc.my.net -.LP -Alternatively, you can create a username called (for example) "ppp", -whose login shell is pppd and whose home directory is /etc/ppp. -Options to be used when pppd is run this way can be put in -/etc/ppp/.ppprc. -.LP -If your serial connection is any more complicated than a piece of -wire, you may need to arrange for some control characters to be -escaped. In particular, it is often useful to escape XON (^Q) and -XOFF (^S), using \fIasyncmap a0000\fR. If the path includes a telnet, -you probably should escape ^] as well (\fIasyncmap 200a0000\fR). If -the path includes an rlogin, you will need to use the \fIescape ff\fR -option on the end which is running the rlogin client, since many -rlogin implementations are not transparent; they will remove the -sequence [0xff, 0xff, 0x73, 0x73, followed by any 8 bytes] from the -stream. -.SH DIAGNOSTICS -.LP -Messages are sent to the syslog daemon using facility LOG_DAEMON. -(This can be overriden by recompiling pppd with the macro -LOG_PPP defined as the desired facility.) In order to see the error -and debug messages, you will need to edit your /etc/syslog.conf file -to direct the messages to the desired output device or file. -.LP -The \fIdebug\fR option causes the contents of all control packets sent -or received to be logged, that is, all LCP, PAP, CHAP or IPCP packets. -This can be useful if the PPP negotiation does not succeed or if -authentication fails. -If debugging is enabled at compile time, the \fIdebug\fR option also -causes other debugging messages to be logged. -.LP -Debugging can also be enabled or disabled by sending a SIGUSR1 signal -to the pppd process. This signal acts as a toggle. -.SH EXIT STATUS -The exit status of pppd is set to indicate whether any error was -detected, or the reason for the link being terminated. The values -used are: -.TP -.B 0 -Pppd has detached, or otherwise the connection was successfully -established and terminated at the peer's request. -.TP -.B 1 -An immediately fatal error of some kind occurred, such as an essential -system call failing, or running out of virtual memory. -.TP -.B 2 -An error was detected in processing the options given, such as two -mutually exclusive options being used. -.TP -.B 3 -Pppd is not setuid-root and the invoking user is not root. -.TP -.B 4 -The kernel does not support PPP, for example, the PPP kernel driver is -not included or cannot be loaded. -.TP -.B 5 -Pppd terminated because it was sent a SIGINT, SIGTERM or SIGHUP -signal. -.TP -.B 6 -The serial port could not be locked. -.TP -.B 7 -The serial port could not be opened. -.TP -.B 8 -The connect script failed (returned a non-zero exit status). -.TP -.B 9 -The command specified as the argument to the \fIpty\fR option could -not be run. -.TP -.B 10 -The PPP negotiation failed, that is, it didn't reach the point where -at least one network protocol (e.g. IP) was running. -.TP -.B 11 -The peer system failed (or refused) to authenticate itself. -.TP -.B 12 -The link was established successfully and terminated because it was -idle. -.TP -.B 13 -The link was established successfully and terminated because the -connect time limit was reached. -.TP -.B 14 -Callback was negotiated and an incoming call should arrive shortly. -.TP -.B 15 -The link was terminated because the peer is not responding to echo -requests. -.TP -.B 16 -The link was terminated by the modem hanging up. -.TP -.B 17 -The PPP negotiation failed because serial loopback was detected. -.TP -.B 18 -The init script failed (returned a non-zero exit status). -.TP -.B 19 -We failed to authenticate ourselves to the peer. -.SH SCRIPTS -Pppd invokes scripts at various stages in its processing which can be -used to perform site-specific ancillary processing. These scripts are -usually shell scripts, but could be executable code files instead. -Pppd does not wait for the scripts to finish. The scripts are -executed as root (with the real and effective user-id set to 0), so -that they can do things such as update routing tables or run -privileged daemons. Be careful that the contents of these scripts do -not compromise your system's security. Pppd runs the scripts with -standard input, output and error redirected to /dev/null, and with an -environment that is empty except for some environment variables that -give information about the link. The environment variables that pppd -sets are: -.TP -.B DEVICE -The name of the serial tty device being used. -.TP -.B IFNAME -The name of the network interface being used. -.TP -.B IPLOCAL -The IP address for the local end of the link. This is only set when -IPCP has come up. -.TP -.B IPREMOTE -The IP address for the remote end of the link. This is only set when -IPCP has come up. -.TP -.B PEERNAME -The authenticated name of the peer. This is only set if the peer -authenticates itself. -.TP -.B SPEED -The baud rate of the tty device. -.TP -.B ORIG_UID -The real user-id of the user who invoked pppd. -.TP -.B PPPLOGNAME -The username of the real user-id that invoked pppd. This is always set. -.P -For the ip-down and auth-down scripts, pppd also sets the following -variables giving statistics for the connection: -.TP -.B CONNECT_TIME -The number of seconds from when the PPP negotiation started until the -connection was terminated. -.TP -.B BYTES_SENT -The number of bytes sent (at the level of the serial port) during the -connection. -.TP -.B BYTES_RCVD -The number of bytes received (at the level of the serial port) during -the connection. -.TP -.B LINKNAME -The logical name of the link, set with the \fIlinkname\fR option. -.P -Pppd invokes the following scripts, if they exist. It is not an error -if they don't exist. -.TP -.B /etc/ppp/auth-up -A program or script which is executed after the remote system -successfully authenticates itself. It is executed with the parameters -.IP -\fIinterface-name peer-name user-name tty-device speed\fR -.IP -Note that this script is not executed if the peer doesn't authenticate -itself, for example when the \fInoauth\fR option is used. -.TP -.B /etc/ppp/auth-down -A program or script which is executed when the link goes down, if -/etc/ppp/auth-up was previously executed. It is executed in the same -manner with the same parameters as /etc/ppp/auth-up. -.TP -.B /etc/ppp/ip-up -A program or script which is executed when the link is available for -sending and receiving IP packets (that is, IPCP has come up). It is -executed with the parameters -.IP -\fIinterface-name tty-device speed local-IP-address -remote-IP-address ipparam\fR -.TP -.B /etc/ppp/ip-down -A program or script which is executed when the link is no longer -available for sending and receiving IP packets. This script can be -used for undoing the effects of the /etc/ppp/ip-up script. It is -invoked in the same manner and with the same parameters as the ip-up -script. -.TP -.B /etc/ppp/ipv6-up -Like /etc/ppp/ip-up, except that it is executed when the link is available -for sending and receiving IPv6 packets. It is executed with the parameters -.IP -\fIinterface-name tty-device speed local-link-local-address -remote-link-local-address ipparam\fR -.TP -.B /etc/ppp/ipv6-down -Similar to /etc/ppp/ip-down, but it is executed when IPv6 packets can no -longer be transmitted on the link. It is executed with the same parameters -as the ipv6-up script. -.TP -.B /etc/ppp/ipx-up -A program or script which is executed when the link is available for -sending and receiving IPX packets (that is, IPXCP has come up). It is -executed with the parameters -.IP -\fIinterface-name tty-device speed network-number local-IPX-node-address -remote-IPX-node-address local-IPX-routing-protocol remote-IPX-routing-protocol -local-IPX-router-name remote-IPX-router-name ipparam pppd-pid\fR -.IP -The local-IPX-routing-protocol and remote-IPX-routing-protocol field -may be one of the following: -.IP -NONE to indicate that there is no routing protocol -.br -RIP to indicate that RIP/SAP should be used -.br -NLSP to indicate that Novell NLSP should be used -.br -RIP NLSP to indicate that both RIP/SAP and NLSP should be used -.TP -.B /etc/ppp/ipx-down -A program or script which is executed when the link is no longer -available for sending and receiving IPX packets. This script can be -used for undoing the effects of the /etc/ppp/ipx-up script. It is -invoked in the same manner and with the same parameters as the ipx-up -script. -.SH FILES -.TP -.B /var/run/ppp\fIn\fB.pid \fR(BSD or Linux), \fB/etc/ppp/ppp\fIn\fB.pid \fR(others) -Process-ID for pppd process on ppp interface unit \fIn\fR. -.TP -.B /var/run/ppp-\fIname\fB.pid \fR(BSD or Linux), \fB/etc/ppp/ppp-\fIname\fB.pid \fR(others) -Process-ID for pppd process for logical link \fIname\fR (see the -\fIlinkname\fR option). -.TP -.B /etc/ppp/pap-secrets -Usernames, passwords and IP addresses for PAP authentication. This -file should be owned by root and not readable or writable by any other -user. Pppd will log a warning if this is not the case. -.TP -.B /etc/ppp/chap-secrets -Names, secrets and IP addresses for CHAP authentication. As for -/etc/ppp/pap-secrets, this file should be owned by root and not -readable or writable by any other user. Pppd will log a warning if -this is not the case. -.TP -.B /etc/ppp/options -System default options for pppd, read before user default options or -command-line options. -.TP -.B ~/.ppprc -User default options, read before /etc/ppp/options.\fIttyname\fR. -.TP -.B /etc/ppp/options.\fIttyname -System default options for the serial port being used, read after -~/.ppprc. In forming the \fIttyname\fR part of this -filename, an initial /dev/ is stripped from the port name (if -present), and any slashes in the remaining part are converted to -dots. -.TP -.B /etc/ppp/peers -A directory containing options files which may contain privileged -options, even if pppd was invoked by a user other than root. The -system administrator can create options files in this directory to -permit non-privileged users to dial out without requiring the peer to -authenticate, but only to certain trusted peers. -.SH SEE ALSO -.TP -.B RFC1144 -Jacobson, V. -\fICompressing TCP/IP headers for low-speed serial links.\fR -February 1990. -.TP -.B RFC1321 -Rivest, R. -.I The MD5 Message-Digest Algorithm. -April 1992. -.TP -.B RFC1332 -McGregor, G. -.I PPP Internet Protocol Control Protocol (IPCP). -May 1992. -.TP -.B RFC1334 -Lloyd, B.; Simpson, W.A. -.I PPP authentication protocols. -October 1992. -.TP -.B RFC1661 -Simpson, W.A. -.I The Point\-to\-Point Protocol (PPP). -July 1994. -.TP -.B RFC1662 -Simpson, W.A. -.I PPP in HDLC-like Framing. -July 1994. -.TP -.B RFC2472 -Haskin, D. -.I IP Version 6 over PPP -December 1998. -.SH NOTES -The following signals have the specified effect when sent to pppd. -.TP -.B SIGINT, SIGTERM -These signals cause pppd to terminate the link (by closing LCP), -restore the serial device settings, and exit. -.TP -.B SIGHUP -This signal causes pppd to terminate the link, restore the serial -device settings, and close the serial device. If the \fIpersist\fR or -\fIdemand\fR option has been specified, pppd will try to reopen the -serial device and start another connection (after the holdoff period). -Otherwise pppd will exit. If this signal is received during the -holdoff period, it causes pppd to end the holdoff period immediately. -.TP -.B SIGUSR1 -This signal toggles the state of the \fIdebug\fR option. -.TP -.B SIGUSR2 -This signal causes pppd to renegotiate compression. This can be -useful to re-enable compression after it has been disabled as a result -of a fatal decompression error. (Fatal decompression errors generally -indicate a bug in one or other implementation.) - -.SH AUTHORS -Paul Mackerras (Paul.Mackerras@cs.anu.edu.au), based on earlier work by -Drew Perkins, -Brad Clements, -Karl Fox, -Greg Christy, -and -Brad Parker. diff --git a/cpukit/pppd/pppd.h b/cpukit/pppd/pppd.h deleted file mode 100644 index 6af6ec1fd6..0000000000 --- a/cpukit/pppd/pppd.h +++ /dev/null @@ -1,664 +0,0 @@ -/* - * pppd.h - PPP daemon global declarations. - * - * Copyright (c) 1989 Carnegie Mellon University. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by Carnegie Mellon University. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * $Id$ - */ - -#ifndef __PPPD_H__ -#define __PPPD_H__ - -#include /* for FILE */ -#include /* for NGROUPS_MAX */ -#include /* for MAXPATHLEN and BSD4_4, if defined */ -#include /* for u_int32_t, if defined */ -#include /* for struct timeval */ -#include -#include "rtemsdialer.h" - -#if defined(__STDC__) -#include -#define __V(x) x -#else -#include -#define __V(x) (va_alist) va_dcl -#define const -#define volatile -#endif - -#ifdef INET6 -#include "eui64.h" -#endif - -/* - * Limits. - */ - -#define NUM_PPP 1 /* One PPP interface supported (per process) */ -#define MAXWORDLEN 1024 /* max length of word in file (incl null) */ -#define MAXARGS 1 /* max # args to a command */ -#define MAXNAMELEN 256 /* max length of hostname or name for auth */ -#define MAXSECRETLEN 256 /* max length of password or secret */ - -/* - * Option descriptor structure. - */ - -typedef unsigned char bool; - -enum opt_type { - o_special_noarg = 0, - o_special = 1, - o_bool, - o_int, - o_uint32, - o_string, -}; - -typedef struct { - char *name; /* name of the option */ - enum opt_type type; - void *addr; - char *description; - int flags; - void *addr2; - int upper_limit; - int lower_limit; -} option_t; - -/* Values for flags */ -#define OPT_VALUE 0xff /* mask for presupplied value */ -#define OPT_HEX 0x100 /* int option is in hex */ -#define OPT_NOARG 0x200 /* option doesn't take argument */ -#define OPT_OR 0x400 /* OR in argument to value */ -#define OPT_INC 0x800 /* increment value */ -#define OPT_PRIV 0x1000 /* privileged option */ -#define OPT_STATIC 0x2000 /* string option goes into static array */ -#define OPT_LLIMIT 0x4000 /* check value against lower limit */ -#define OPT_ULIMIT 0x8000 /* check value against upper limit */ -#define OPT_LIMITS (OPT_LLIMIT|OPT_ULIMIT) -#define OPT_ZEROOK 0x10000 /* 0 value is OK even if not within limits */ -#define OPT_NOINCR 0x20000 /* value mustn't be increased */ -#define OPT_ZEROINF 0x40000 /* with OPT_NOINCR, 0 == infinity */ -#define OPT_A2INFO 0x100000 /* addr2 -> option_info to update */ -#define OPT_A2COPY 0x200000 /* addr2 -> second location to rcv value */ -#define OPT_ENABLE 0x400000 /* use *addr2 as enable for option */ -#define OPT_PRIVFIX 0x800000 /* can't be overridden if noauth */ -#define OPT_PREPASS 0x1000000 /* do this opt in pre-pass to find device */ -#define OPT_INITONLY 0x2000000 /* option can only be set in init phase */ -#define OPT_DEVEQUIV 0x4000000 /* equiv to device name */ -#define OPT_DEVNAM (OPT_PREPASS | OPT_INITONLY | OPT_DEVEQUIV) - -#define OPT_VAL(x) ((x) & OPT_VALUE) - -#ifndef GIDSET_TYPE -#define GIDSET_TYPE gid_t -#endif - -/* Structure representing a list of permitted IP addresses. */ -struct permitted_ip { - int permit; /* 1 = permit, 0 = forbid */ - u_int32_t base; /* match if (addr & mask) == base */ - u_int32_t mask; /* base and mask are in network byte order */ -}; - -/* - * Unfortunately, the linux kernel driver uses a different structure - * for statistics from the rest of the ports. - * This structure serves as a common representation for the bits - * pppd needs. - */ -struct pppd_stats { - unsigned int bytes_in; - unsigned int bytes_out; -}; - -/* Used for storing a sequence of words. Usually malloced. */ -struct wordlist { - struct wordlist *next; - char *word; -}; - -/* - * Global variables. - */ - -extern int kill_link; /* Signal to terminate processing loop */ -extern int hungup; /* Physical layer has disconnected */ -extern int pppifunit; /* Interface unit number */ -extern char ifname[]; /* Interface name */ -extern int ttyfd; /* Serial device file descriptor */ -extern char hostname[]; /* Our hostname */ -extern u_char outpacket_buf[]; /* Buffer for outgoing packets */ -extern int phase; /* Current state of link - see values below */ -extern int baud_rate; /* Current link speed in bits/sec */ -extern char *progname; /* Name of this program */ -extern int redirect_stderr;/* Connector's stderr should go to file */ -extern char peer_authname[];/* Authenticated name of peer */ -extern int privileged; /* We were run by real-uid root */ -extern int need_holdoff; /* Need holdoff period after link terminates */ -extern char **script_env; /* Environment variables for scripts */ -extern int detached; /* Have detached from controlling tty */ -extern GIDSET_TYPE groups[NGROUPS_MAX]; /* groups the user is in */ -extern int ngroups; /* How many groups valid in groups */ -extern struct pppd_stats link_stats; /* byte/packet counts etc. for link */ -extern int using_pty; /* using pty as device (notty or pty opt.) */ -extern int log_to_fd; /* logging to this fd as well as syslog */ -extern char *no_ppp_msg; /* message to print if ppp not in kernel */ -extern volatile int status; /* exit status for pppd */ -extern int devnam_fixed; /* can no longer change devnam */ -extern int unsuccess; /* # unsuccessful connection attempts */ -extern int do_callback; /* set if we want to do callback next */ -extern int doing_callback; /* set if this is a callback */ -extern dialerfp pppd_dialer; /* script dialer function callback */ - -/* Values for do_callback and doing_callback */ -#define CALLBACK_DIALIN 1 /* we are expecting the call back */ -#define CALLBACK_DIALOUT 2 /* we are dialling out to call back */ - -/* - * Variables set by command-line options. - */ - -extern int debug; /* Debug flag */ -extern int kdebugflag; /* Tell kernel to print debug messages */ -extern int default_device; /* Using /dev/tty or equivalent */ -extern char devnam[MAXPATHLEN]; /* Device name */ -extern int crtscts; /* Use hardware flow control */ -extern bool modem; /* Use modem control lines */ -extern int inspeed; /* Input/Output speed requested */ -extern u_int32_t netmask; /* IP netmask to set on interface */ -extern bool lockflag; /* Create lock file to lock the serial dev */ -extern bool nodetach; /* Don't detach from controlling tty */ -extern bool updetach; /* Detach from controlling tty when link up */ -extern char *initializer; /* Script to initialize physical link */ -extern char *connect_script; /* Script to establish physical link */ -extern char *disconnect_script; /* Script to disestablish physical link */ -extern char *welcomer; /* Script to welcome client after connection */ -extern char *ptycommand; /* Command to run on other side of pty */ -extern int maxconnect; /* Maximum connect time (seconds) */ -extern char user[MAXNAMELEN];/* Our name for authenticating ourselves */ -extern char passwd[MAXSECRETLEN]; /* Password for PAP or CHAP */ -extern bool auth_required; /* Peer is required to authenticate */ -extern bool persist; /* Reopen link after it goes down */ -extern bool uselogin; /* Use /etc/passwd for checking PAP */ -extern char our_name[MAXNAMELEN];/* Our name for authentication purposes */ -extern char remote_name[MAXNAMELEN]; /* Peer's name for authentication */ -extern bool explicit_remote;/* remote_name specified with remotename opt */ -extern bool demand; /* Do dial-on-demand */ -extern char *ipparam; /* Extra parameter for ip up/down scripts */ -extern bool cryptpap; /* Others' PAP passwords are encrypted */ -extern int idle_time_limit;/* Shut down link if idle for this long */ -extern int holdoff; /* Dead time before restarting */ -extern bool holdoff_specified; /* true if user gave a holdoff value */ -extern bool notty; /* Stdin/out is not a tty */ -extern char *record_file; /* File to record chars sent/received */ -extern bool sync_serial; /* Device is synchronous serial device */ -extern int maxfail; /* Max # of unsuccessful connection attempts */ -extern char linkname[MAXPATHLEN]; /* logical name for link */ -extern bool tune_kernel; /* May alter kernel settings as necessary */ -extern int connect_delay; /* Time to delay after connect script */ - -#ifdef PPP_FILTER -extern struct bpf_program pass_filter; /* Filter for pkts to pass */ -extern struct bpf_program active_filter; /* Filter for link-active pkts */ -#endif - -#ifdef MSLANMAN -extern bool ms_lanman; /* Use LanMan password instead of NT */ - /* Has meaning only with MS-CHAP challenges */ -#endif - -extern char *current_option; /* the name of the option being parsed */ -extern int privileged_option; /* set iff the current option came from root */ -extern char *option_source; /* string saying where the option came from */ - -/* - * Values for phase. - */ -#define PHASE_DEAD 0 -#define PHASE_INITIALIZE 1 -#define PHASE_SERIALCONN 2 -#define PHASE_DORMANT 3 -#define PHASE_ESTABLISH 4 -#define PHASE_AUTHENTICATE 5 -#define PHASE_CALLBACK 6 -#define PHASE_NETWORK 7 -#define PHASE_RUNNING 8 -#define PHASE_TERMINATE 9 -#define PHASE_DISCONNECT 10 -#define PHASE_HOLDOFF 11 - -/* - * The following struct gives the addresses of procedures to call - * for a particular protocol. - */ -struct protent { - u_short protocol; /* PPP protocol number */ - /* Initialization procedure */ - void (*init) __P((int unit)); - /* Process a received packet */ - void (*input) __P((int unit, u_char *pkt, int len)); - /* Process a received protocol-reject */ - void (*protrej) __P((int unit)); - /* Lower layer has come up */ - void (*lowerup) __P((int unit)); - /* Lower layer has gone down */ - void (*lowerdown) __P((int unit)); - /* Open the protocol */ - void (*open) __P((int unit)); - /* Close the protocol */ - void (*close) __P((int unit, char *reason)); - /* Print a packet in readable form */ - int (*printpkt) __P((u_char *pkt, int len, - void (*printer) __P((void *, char *, ...)), - void *arg)); - /* Process a received data packet */ - void (*datainput) __P((int unit, u_char *pkt, int len)); - bool enabled_flag; /* 0 iff protocol is disabled */ - char *name; /* Text name of protocol */ - char *data_name; /* Text name of corresponding data protocol */ - option_t *options; /* List of command-line options */ - /* Check requested options, assign defaults */ - void (*check_options) __P((void)); - /* Configure interface for demand-dial */ - int (*demand_conf) __P((int unit)); - /* Say whether to bring up link for this pkt */ - int (*active_pkt) __P((u_char *pkt, int len)); -}; - -/* Table of pointers to supported protocols */ -extern struct protent *protocols[]; - -/* - * Prototypes. - */ - -/* Procedures exported from main.c. */ -void die __P((int)); /* Cleanup and exit */ -void quit __P((void)); /* like die(1) */ -void novm __P((char *)); /* Say we ran out of memory, and die */ -void ppptimeout __P((void (*func)(void *), void *arg, int t)); - /* Call func(arg) after t seconds */ -void untimeout __P((void (*func)(void *), void *arg)); - /* Cancel call to func(arg) */ -void update_link_stats __P((int)); /* Get stats at link termination */ -void new_phase __P((int)); /* signal start of new phase */ - -/* Procedures exported from utils.c. */ -void log_packet __P((u_char *, int, char *, int)); - /* Format a packet and log it with syslog */ -void print_string __P((char *, int, void (*) (void *, char *, ...), - void *)); /* Format a string for output */ -int slprintf __P((char *, int, char *, ...)); /* sprintf++ */ -int vslprintf __P((char *, int, char *, va_list)); /* vsprintf++ */ -size_t strlcpy __P((char *, const char *, size_t)); /* safe strcpy */ -size_t strlcat __P((char *, const char *, size_t)); /* safe strncpy */ -void pppd_dbglog __P((char *, ...)); /* log a debug message */ -void pppd_info __P((char *, ...)); /* log an informational message */ -void pppd_notice __P((char *, ...)); /* log a notice-level message */ -void pppd_warn __P((char *, ...)); /* log a warning message */ -void pppd_error __P((char *, ...)); /* log an error message */ -void pppd_fatal __P((char *, ...)); /* log an error message and die(1) */ - -#define dbglog pppd_dbglog -#define info pppd_info -#define notice pppd_notice -#define warn pppd_warn -#define error pppd_error -#define fatal pppd_fatal - -/* Procedures exported from auth.c */ -void link_required __P((int)); /* we are starting to use the link */ -void link_terminated __P((int)); /* we are finished with the link */ -void link_down __P((int)); /* the LCP layer has left the Opened state */ -void link_established __P((int)); /* the link is up; authenticate now */ -void start_networks __P((void)); /* start all the network control protos */ -void np_up __P((int, int)); /* a network protocol has come up */ -void np_down __P((int, int)); /* a network protocol has gone down */ -void np_finished __P((int, int)); /* a network protocol no longer needs link */ -void auth_peer_fail __P((int, int)); - /* peer failed to authenticate itself */ -void auth_peer_success __P((int, int, char *, int)); - /* peer successfully authenticated itself */ -void auth_withpeer_fail __P((int, int)); - /* we failed to authenticate ourselves */ -void auth_withpeer_success __P((int, int)); - /* we successfully authenticated ourselves */ -int auth_check_options __P((void)); - /* check authentication options supplied */ -void auth_reset __P((int)); /* check what secrets we have */ -int check_passwd __P((int, char *, int, char *, int, char **)); - /* Check peer-supplied username/password */ -int get_secret __P((int, char *, char *, char *, int *, int)); - /* get "secret" for chap */ -int auth_ip_addr __P((int, u_int32_t)); - /* check if IP address is authorized */ -int bad_ip_adrs __P((u_int32_t)); - /* check if IP address is unreasonable */ - -/* Procedures exported from demand.c */ -void demand_conf __P((void)); /* config interface(s) for demand-dial */ -void demand_block __P((void)); /* set all NPs to queue up packets */ -void demand_unblock __P((void)); /* set all NPs to pass packets */ -void demand_discard __P((void)); /* set all NPs to discard packets */ -void demand_rexmit __P((int)); /* retransmit saved frames for an NP */ -int loop_chars __P((unsigned char *, int)); /* process chars from loopback */ -int loop_frame __P((unsigned char *, int)); /* should we bring link up? */ - -/* Procedures exported from sys-*.c */ -void sys_init __P((void)); /* Do system-dependent initialization */ -void sys_cleanup __P((void)); /* Restore system state before exiting */ -int sys_check_options __P((void)); /* Check options specified */ -void sys_close __P((void)); /* Clean up in a child before execing */ -int ppp_available __P((void)); /* Test whether ppp kernel support exists */ -int get_pty __P((int *, int *, char *, int)); /* Get pty master/slave */ -int open_ppp_loopback __P((void)); /* Open loopback for demand-dialling */ -int establish_ppp __P((int)); /* Turn serial port into a ppp interface */ -void restore_loop __P((void)); /* Transfer ppp unit back to loopback */ -void disestablish_ppp __P((int)); /* Restore port to normal operation */ -void clean_check __P((void)); /* Check if line was 8-bit clean */ -void set_up_tty __P((int, int)); /* Set up port's speed, parameters, etc. */ -void restore_tty __P((int)); /* Restore port's original parameters */ -void setdtr __P((int, int)); /* Raise or lower port's DTR line */ -void output __P((int, u_char *, int)); /* Output a PPP packet */ -void wait_input __P((struct timeval *)); /* Wait for input, with timeout */ - -void ppp_delay __P((void)); /* delay task for a little while */ -int read_packet __P((u_char *)); /* Read PPP packet */ -int get_loop_output __P((void)); /* Read pkts from loopback */ -void ppp_send_config __P((int, int, u_int32_t, int, int)); - /* Configure i/f transmit parameters */ -void ppp_set_xaccm __P((int, ext_accm)); - /* Set extended transmit ACCM */ -void ppp_recv_config __P((int, int, u_int32_t, int, int)); - /* Configure i/f receive parameters */ -int ccp_test __P((int, u_char *, int, int)); - /* Test support for compression scheme */ -void ccp_flags_set __P((int, int, int)); - /* Set kernel CCP state */ -int ccp_fatal_error __P((int)); /* Test for fatal decomp error in kernel */ -int get_idle_time __P((int, struct ppp_idle *)); - /* Find out how long link has been idle */ -int get_ppp_stats __P((int, struct pppd_stats *)); - /* Return link statistics */ -int sifvjcomp __P((int, int, int, int)); - /* Configure VJ TCP header compression */ -int sifup __P((int)); /* Configure i/f up for one protocol */ -int sifnpmode __P((int u, int proto, enum NPmode mode)); - /* Set mode for handling packets for proto */ -int sifdown __P((int)); /* Configure i/f down for one protocol */ -int sifaddr __P((int, u_int32_t, u_int32_t, u_int32_t)); - /* Configure IPv4 addresses for i/f */ -int cifaddr __P((int, u_int32_t, u_int32_t)); - /* Reset i/f IP addresses */ -#ifdef INET6 -int sif6addr __P((int, eui64_t, eui64_t)); - /* Configure IPv6 addresses for i/f */ -int cif6addr __P((int, eui64_t, eui64_t)); - /* Remove an IPv6 address from i/f */ -#endif -int sifdefaultroute __P((int, u_int32_t, u_int32_t)); - /* Create default route through i/f */ -int cifdefaultroute __P((int, u_int32_t, u_int32_t)); - /* Delete default route through i/f */ -int sifproxyarp __P((int, u_int32_t)); - /* Add proxy ARP entry for peer */ -int cifproxyarp __P((int, u_int32_t)); - /* Delete proxy ARP entry for peer */ -u_int32_t GetMask __P((u_int32_t)); /* Get appropriate netmask for address */ -int lock __P((char *)); /* Create lock file for device */ -int relock __P((int)); /* Rewrite lock file with new pid */ -void unlock __P((void)); /* Delete previously-created lock file */ -void logwtmp __P((const char *, const char *, const char *)); - /* Write entry to wtmp file */ -int get_host_seed __P((void)); /* Get host-dependent random number seed */ -int have_route_to __P((u_int32_t)); /* Check if route to addr exists */ -#ifdef PPP_FILTER -int set_filters __P((struct bpf_program *pass, struct bpf_program *active)); - /* Set filter programs in kernel */ -#endif -#ifdef IPX_CHANGE -int sipxfaddr __P((int, unsigned long, unsigned char *)); -int cipxfaddr __P((int)); -#endif - -/* Procedures exported from options.c */ -int parse_args __P((int argc, char **argv)); - /* Parse options from arguments given */ -int options_from_file __P((char *filename, int must_exist, int check_prot, - int privileged)); - /* Parse options from an options file */ -int options_from_user __P((void)); /* Parse options from user's .ppprc */ -int options_for_tty __P((void)); /* Parse options from /etc/ppp/options.tty */ -int options_from_list __P((struct wordlist *, int privileged)); - /* Parse options from a wordlist */ -int getword __P((FILE *f, char *word, int *newlinep, char *filename)); - /* Read a word from a file */ -void option_error __P((char *fmt, ...)); - /* Print an error message about an option */ -int int_option __P((char *, int *)); - /* Simplified number_option for decimal ints */ -void add_options __P((option_t *)); /* Add extra options */ - -/* - * This structure is used to store information about certain - * options, such as where the option value came from (/etc/ppp/options, - * command line, etc.) and whether it came from a privileged source. - */ - -struct option_info { - int priv; /* was value set by sysadmin? */ - char *source; /* where option came from */ -}; - -extern struct option_info devnam_info; -extern struct option_info initializer_info; -extern struct option_info connect_script_info; -extern struct option_info disconnect_script_info; -extern struct option_info welcomer_info; -extern struct option_info ptycommand_info; - -/* - * Hooks to enable plugins to change various things. - */ -extern int (*new_phase_hook) __P((int)); -extern int (*idle_time_hook) __P((struct ppp_idle *)); -extern int (*holdoff_hook) __P((void)); -extern int (*pap_check_hook) __P((void)); -extern int (*pap_auth_hook) __P((char *user, char *passwd/*, char **msgp, - struct wordlist **paddrs, - struct wordlist **popts*/)); -extern void (*pap_logout_hook) __P((void)); -extern int (*pap_passwd_hook) __P((char *user, char *passwd)); -extern void (*ip_up_hook) __P((void)); -extern void (*ip_down_hook) __P((void)); -extern void (*auth_linkup_hook) __P((void)); -extern void (*auth_linkdown_hook) __P((void)); - -/* - * Inline versions of get/put char/short/long. - * Pointer is advanced; we assume that both arguments - * are lvalues and will already be in registers. - * cp MUST be u_char *. - */ -#define GETCHAR(c, cp) { \ - (c) = *(cp)++; \ -} -#define PUTCHAR(c, cp) { \ - *(cp)++ = (u_char) (c); \ -} - - -#define GETSHORT(s, cp) { \ - (s) = *(cp)++ << 8; \ - (s) |= *(cp)++; \ -} -#define PUTSHORT(s, cp) { \ - *(cp)++ = (u_char) ((s) >> 8); \ - *(cp)++ = (u_char) (s); \ -} - -#define GETLONG(l, cp) { \ - (l) = *(cp)++ << 8; \ - (l) |= *(cp)++; (l) <<= 8; \ - (l) |= *(cp)++; (l) <<= 8; \ - (l) |= *(cp)++; \ -} -#define PUTLONG(l, cp) { \ - *(cp)++ = (u_char) ((l) >> 24); \ - *(cp)++ = (u_char) ((l) >> 16); \ - *(cp)++ = (u_char) ((l) >> 8); \ - *(cp)++ = (u_char) (l); \ -} - -#define INCPTR(n, cp) ((cp) += (n)) -#define DECPTR(n, cp) ((cp) -= (n)) - -/* - * System dependent definitions for user-level 4.3BSD UNIX implementation. - */ - -#define TIMEOUT(r, f, t) ppptimeout((r), (f), (t)) -#define UNTIMEOUT(r, f) untimeout((r), (f)) - -#define BCOPY(s, d, l) memcpy(d, s, l) -#define BZERO(s, n) memset(s, 0, n) - -#define PRINTMSG(m, l) { info("Remote message: %0.*v", l, m); } - -/* - * MAKEHEADER - Add Header fields to a packet. - */ -#define MAKEHEADER(p, t) { \ - PUTCHAR(PPP_ALLSTATIONS, p); \ - PUTCHAR(PPP_UI, p); \ - PUTSHORT(t, p); } - -/* - * Exit status values. - */ -#define EXIT_OK 0 -#define EXIT_FATAL_ERROR 1 -#define EXIT_OPTION_ERROR 2 -#define EXIT_NOT_ROOT 3 -#define EXIT_NO_KERNEL_SUPPORT 4 -#define EXIT_USER_REQUEST 5 -#define EXIT_LOCK_FAILED 6 -#define EXIT_OPEN_FAILED 7 -#define EXIT_CONNECT_FAILED 8 -#define EXIT_PTYCMD_FAILED 9 -#define EXIT_NEGOTIATION_FAILED 10 -#define EXIT_PEER_AUTH_FAILED 11 -#define EXIT_IDLE_TIMEOUT 12 -#define EXIT_CONNECT_TIME 13 -#define EXIT_CALLBACK 14 -#define EXIT_PEER_DEAD 15 -#define EXIT_HANGUP 16 -#define EXIT_LOOPBACK 17 -#define EXIT_INIT_FAILED 18 -#define EXIT_AUTH_TOPEER_FAILED 19 - -/* - * Debug macros. Slightly useful for finding bugs in pppd, not particularly - * useful for finding out why your connection isn't being established. - */ - -#ifdef DEBUGALL -#define DEBUGMAIN 1 -#define DEBUGFSM 1 -#define DEBUGLCP 1 -#define DEBUGIPCP 1 -#define DEBUGIPV6CP 1 -#define DEBUGUPAP 1 -#define DEBUGCHAP 1 -#endif -#define DEBUGMAIN 1 -#define DEBUGUPAP 1 -#define DEBUGCHAP 1 - - -#ifdef DEBUGMAIN -#define MAINDEBUG(x) if (debug) dbglog x -#else -#define MAINDEBUG(x) -#endif - -#ifdef DEBUGSYS -#define SYSDEBUG(x) if (debug) dbglog x -#else -#define SYSDEBUG(x) -#endif - -#ifdef DEBUGFSM -#define FSMDEBUG(x) if (debug) dbglog x -#else -#define FSMDEBUG(x) -#endif - -#ifdef DEBUGLCP -#define LCPDEBUG(x) if (debug) dbglog x -#else -#define LCPDEBUG(x) -#endif - -#ifdef DEBUGIPCP -#define IPCPDEBUG(x) if (debug) dbglog x -#else -#define IPCPDEBUG(x) -#endif - -#ifdef DEBUGIPV6CP -#define IPV6CPDEBUG(x) if (debug) dbglog x -#else -#define IPV6CPDEBUG(x) -#endif - -#ifdef DEBUGUPAP -#define UPAPDEBUG(x) if (debug) dbglog x -#else -#define UPAPDEBUG(x) -#endif - -#ifdef DEBUGCHAP -#define CHAPDEBUG(x) if (debug) dbglog x -#else -#define CHAPDEBUG(x) -#endif - -#ifdef DEBUGIPXCP -#define IPXCPDEBUG(x) if (debug) dbglog x -#else -#define IPXCPDEBUG(x) -#endif - -#ifndef SIGTYPE -#if defined(sun) || defined(SYSV) || defined(POSIX_SOURCE) -#define SIGTYPE void -#else -#define SIGTYPE int -#endif /* defined(sun) || defined(SYSV) || defined(POSIX_SOURCE) */ -#endif /* SIGTYPE */ - -#ifndef MIN -#define MIN(a, b) ((a) < (b)? (a): (b)) -#endif -#ifndef MAX -#define MAX(a, b) ((a) > (b)? (a): (b)) -#endif - -#endif /* __PPP_H__ */ diff --git a/cpukit/pppd/rtemsdialer.h b/cpukit/pppd/rtemsdialer.h deleted file mode 100644 index 611986b802..0000000000 --- a/cpukit/pppd/rtemsdialer.h +++ /dev/null @@ -1,24 +0,0 @@ - -#ifndef DIALER_H -#define DIALER_H - -/* define constant mode values */ -#define DIALER_INIT 0 -#define DIALER_CONNECT 1 -#define DIALER_WELCOME 2 -#define DIALER_DISCONNECT 3 - -/* define constant return values */ -#define DIALER_SUCCESS 0 -#define DIALER_INVALIDARG 1 -#define DIALER_UNEXPECTED 2 -#define DIALER_TIMEOUT 3 -#define DIALER_CMDFAILED 4 - -/* define typedef for dialer function prototype */ -typedef int (*dialerfp)(int tty, int mode, char *pScript); - -/* declare default chat program dialer */ -extern int chatmain(int tty, int mode, char *pScript); - -#endif diff --git a/cpukit/pppd/rtemsmain.c b/cpukit/pppd/rtemsmain.c deleted file mode 100644 index 17804db38f..0000000000 --- a/cpukit/pppd/rtemsmain.c +++ /dev/null @@ -1,899 +0,0 @@ -/* - * main.c - Point-to-Point Protocol main module - * - * Copyright (c) 1989 Carnegie Mellon University. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by Carnegie Mellon University. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#define RCSID "$Id$" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "pppd.h" -#include "magic.h" -#include "fsm.h" -#include "lcp.h" -#include "ipcp.h" -#ifdef INET6 -#include "ipv6cp.h" -#endif -#include "upap.h" -#include "chap.h" -#include "ccp.h" -#include "pathnames.h" -#include "patchlevel.h" -#include "rtemsdialer.h" - -#ifdef CBCP_SUPPORT -#include "cbcp.h" -#endif - -#ifdef IPX_CHANGE -#include "ipxcp.h" -#endif /* IPX_CHANGE */ -#ifdef AT_CHANGE -#include "atcp.h" -#endif - -static const char rcsid[] = RCSID; - -/* interface vars */ -char ifname[32]; /* Interface name */ -int pppifunit; /* Interface unit number */ - -char *progname; /* Name of this program */ -char hostname[MAXNAMELEN]; /* Our hostname */ -static char ppp_devnam[MAXPATHLEN]; /* name of PPP tty (maybe ttypx) */ - -int ttyfd; /* Serial port file descriptor */ -int baud_rate; /* Actual bits/second for serial device */ -int hungup; /* terminal has been hung up */ -int privileged; /* we're running as real uid root */ -int need_holdoff; /* need holdoff period before restarting */ -int detached; /* have detached from terminal */ -struct stat devstat; /* result of stat() on devnam */ -int prepass = 0; /* doing prepass to find device name */ -int devnam_fixed; /* set while in options.ttyxx file */ -volatile int status; /* exit status for pppd */ -int unsuccess; /* # unsuccessful connection attempts */ -int do_callback; /* != 0 if we should do callback next */ -int doing_callback; /* != 0 if we are doing callback */ -char *callback_script; /* script for doing callback */ -dialerfp pppd_dialer; - -int (*holdoff_hook) __P((void)) = NULL; -int (*new_phase_hook) __P((int)) = NULL; - -static int fd_ppp = -1; /* fd for talking PPP */ -static int pty_master; /* fd for master side of pty */ -static int pty_slave; /* fd for slave side of pty */ -static int real_ttyfd; /* fd for actual serial port (not pty) */ - -int phase; /* where the link is at */ -int kill_link; -int open_ccp_flag; - -char **script_env; /* Env. variable values for scripts */ -int s_env_nalloc; /* # words avail at script_env */ - -u_char outpacket_buf[PPP_MRU+PPP_HDRLEN]; /* buffer for outgoing packet */ -u_char inpacket_buf[PPP_MRU+PPP_HDRLEN]; /* buffer for incoming packet */ - -char *no_ppp_msg = "Sorry - this system lacks PPP kernel support\n"; - -static struct timeval start_time; /* Time when link was started. */ - -struct pppd_stats link_stats; -int link_connect_time; -int link_stats_valid; - -/* Prototypes for procedures local to this file. */ - -static void cleanup __P((void)); -static void close_tty __P((void)); -static void get_input __P((void)); -static void calltimeout __P((void)); -static struct timeval *timeleft __P((struct timeval *)); -static void holdoff_end __P((void *)); -static int device_script __P((int, int, char *)); - -extern char *ttyname __P((int)); -extern char *getlogin __P((void)); -int pppdmain __P((int, char *[])); - -/* - * PPP Data Link Layer "protocol" table. - * One entry per supported protocol. - * The last entry must be NULL. - */ -struct protent *protocols[] = { - &lcp_protent, - &pap_protent, - &chap_protent, -#ifdef CBCP_SUPPORT - &cbcp_protent, -#endif - &ipcp_protent, -#ifdef INET6 - &ipv6cp_protent, -#endif - &ccp_protent, -#ifdef IPX_CHANGE - &ipxcp_protent, -#endif -#ifdef AT_CHANGE - &atcp_protent, -#endif - NULL -}; - -int -pppdmain(argc, argv) - int argc; - char *argv[]; -{ - int i, fdflags, t; - char *connector; - struct timeval timo; - struct protent *protp; - - new_phase(PHASE_INITIALIZE); - - script_env = NULL; - hostname[MAXNAMELEN-1] = 0; - privileged = 1; - privileged_option = 1; - - /* - * Initialize magic number generator now so that protocols may - * use magic numbers in initialization. - */ - magic_init(); - -#ifdef XXX_XXX - /* moved code the the rtems_pppd_reset_options function */ - - /* - * Initialize to the standard option set, then parse, in order, - * the system options file, the user's options file, - * the tty's options file, and the command line arguments. - */ - for (i = 0; (protp = protocols[i]) != NULL; ++i) - (*protp->init)(0); -#endif - - progname = *argv; - - - if (!ppp_available()) { - option_error(no_ppp_msg); - return(EXIT_NO_KERNEL_SUPPORT); - } - - /* - * Check that the options given are valid and consistent. - */ - if (!sys_check_options()) { - return(EXIT_OPTION_ERROR); - } - if (!auth_check_options()) { - return(EXIT_OPTION_ERROR); - } - for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (protp->check_options != NULL) - (*protp->check_options)(); - - /* default holdoff to 0 if no connect script has been given */ - if (connect_script == 0 && !holdoff_specified) - holdoff = 0; - - if (default_device) - nodetach = 1; - - /* - * Initialize system-dependent stuff. - */ - sys_init(); - /* if (debug) - setlogmask(LOG_UPTO(LOG_DEBUG)); - */ - - do_callback = 0; - for (;;) { - - need_holdoff = 1; - ttyfd = -1; - real_ttyfd = -1; - status = EXIT_OK; - ++unsuccess; - doing_callback = do_callback; - do_callback = 0; - - new_phase(PHASE_SERIALCONN); - - /* - * Get a pty master/slave pair if the pty, notty, or record - * options were specified. - */ - strlcpy(ppp_devnam, devnam, sizeof(ppp_devnam)); - pty_master = -1; - pty_slave = -1; - - /* - * Open the serial device and set it up to be the ppp interface. - * First we open it in non-blocking mode so we can set the - * various termios flags appropriately. If we aren't dialling - * out and we want to use the modem lines, we reopen it later - * in order to wait for the carrier detect signal from the modem. - */ - hungup = 0; - kill_link = 0; - connector = doing_callback? callback_script: connect_script; - if (devnam[0] != 0) { - for (;;) { - /* If the user specified the device name, become the - user before opening it. */ - int err; - ttyfd = open(devnam, O_NONBLOCK | O_RDWR, 0); - err = errno; - if (ttyfd >= 0) { - break; - } - errno = err; - if (err != EINTR) { - error("Failed to open %s: %m", devnam); - status = EXIT_OPEN_FAILED; - } - if (!persist || err != EINTR) - goto fail; - } - if ((fdflags = fcntl(ttyfd, F_GETFL)) == -1 - || fcntl(ttyfd, F_SETFL, fdflags & ~O_NONBLOCK) < 0) - warn("Couldn't reset non-blocking mode on device: %m"); - - /* - * Set line speed, flow control, etc. - * If we have a non-null connection or initializer script, - * on most systems we set CLOCAL for now so that we can talk - * to the modem before carrier comes up. But this has the - * side effect that we might miss it if CD drops before we - * get to clear CLOCAL below. On systems where we can talk - * successfully to the modem with CLOCAL clear and CD down, - * we could clear CLOCAL at this point. - */ - set_up_tty(ttyfd, ((connector != NULL && connector[0] != 0) - || initializer != NULL)); - real_ttyfd = ttyfd; - } - - /* run connection script */ - if ((connector && connector[0]) || initializer) { - if (real_ttyfd != -1) { - /* XXX do this if doing_callback == CALLBACK_DIALIN? */ - if (!default_device && modem) { - setdtr(real_ttyfd, 0); /* in case modem is off hook */ - sleep(1); - setdtr(real_ttyfd, 1); - } - } - - if (initializer && initializer[0]) { - if (device_script(ttyfd, DIALER_INIT, initializer) < 0) { - error("Initializer script failed"); - status = EXIT_INIT_FAILED; - goto fail; - } - if (kill_link) - goto disconnect; - - info("Serial port initialized."); - } - - if (connector && connector[0]) { - if (device_script(ttyfd, DIALER_CONNECT, connector) < 0) { - error("Connect script failed"); - status = EXIT_CONNECT_FAILED; - goto fail; - } - if (kill_link) - goto disconnect; - - info("Serial connection established."); - } - - /* set line speed, flow control, etc.; - clear CLOCAL if modem option */ - if (real_ttyfd != -1) - set_up_tty(real_ttyfd, 0); - - if (doing_callback == CALLBACK_DIALIN) - connector = NULL; - } - - /* reopen tty if necessary to wait for carrier */ - if (connector == NULL && modem && devnam[0] != 0) { - for (;;) { - if ((i = open(devnam, O_RDWR)) >= 0) - break; - if (errno != EINTR) { - error("Failed to reopen %s: %m", devnam); - status = EXIT_OPEN_FAILED; - } - if (!persist || errno != EINTR || hungup || kill_link) - goto fail; - } - close(i); - } - - info("Serial connection established."); - sleep(1); - - /* run welcome script, if any */ - if (welcomer && welcomer[0]) { - if (device_script(ttyfd, DIALER_WELCOME, welcomer) < 0) - warn("Welcome script failed"); - } - - /* set up the serial device as a ppp interface */ - fd_ppp = establish_ppp(ttyfd); - if (fd_ppp < 0) { - status = EXIT_FATAL_ERROR; - goto disconnect; - } - - if (!demand) { - info("Using interface ppp%d", pppifunit); - slprintf(ifname, sizeof(ifname), "ppp%d", pppifunit); - } - - /* - * Start opening the connection and wait for - * incoming events (reply, timeout, etc.). - */ - notice("Connect: %s <--> %s", ifname, ppp_devnam); - gettimeofday(&start_time, NULL); - - lcp_lowerup(0); - lcp_open(0); /* Start protocol */ - - open_ccp_flag = 0; - status = EXIT_NEGOTIATION_FAILED; - new_phase(PHASE_ESTABLISH); - while (phase != PHASE_DEAD) { - wait_input(timeleft(&timo)); - calltimeout(); - get_input(); - - if (kill_link) { - lcp_close(0, "User request"); - kill_link = 0; - } - if (open_ccp_flag) { - if (phase == PHASE_NETWORK || phase == PHASE_RUNNING) { - ccp_fsm[0].flags = OPT_RESTART; /* clears OPT_SILENT */ - (*ccp_protent.open)(0); - } - open_ccp_flag = 0; - } - } - - /* - * If we may want to bring the link up again, transfer - * the ppp unit back to the loopback. Set the - * real serial device back to its normal mode of operation. - */ - clean_check(); - if (demand) - restore_loop(); - disestablish_ppp(ttyfd); - fd_ppp = -1; - if (!hungup) - lcp_lowerdown(0); - - /* - * Run disconnector script, if requested. - * XXX we may not be able to do this if the line has hung up! - */ - disconnect: - if (disconnect_script && !hungup) { - new_phase(PHASE_DISCONNECT); - if (real_ttyfd >= 0) - set_up_tty(real_ttyfd, 1); - if (device_script(ttyfd, DIALER_DISCONNECT, disconnect_script) < 0) { - warn("disconnect script failed"); - } else { - info("Serial link disconnected."); - } - } - - fail: - if (pty_master >= 0) - close(pty_master); - if (pty_slave >= 0) - close(pty_slave); - if (real_ttyfd >= 0) - close_tty(); - - if (!persist || (maxfail > 0 && unsuccess >= maxfail)) - break; - - kill_link = 0; - if (demand) - demand_discard(); - t = need_holdoff? holdoff: 0; - if (holdoff_hook) - t = (*holdoff_hook)(); - if (t > 0) { - new_phase(PHASE_HOLDOFF); - TIMEOUT(holdoff_end, NULL, t); - do { - wait_input(timeleft(&timo)); - - calltimeout(); - if (kill_link) { - kill_link = 0; - new_phase(PHASE_DORMANT); /* allow signal to end holdoff */ - } - } while (phase == PHASE_HOLDOFF); - if (!persist) - break; - } - } - - die(status); - return status; -} - -/* - * holdoff_end - called via a timeout when the holdoff period ends. - */ -static void -holdoff_end(arg) - void *arg; -{ - new_phase(PHASE_DORMANT); -} - -/* List of protocol names, to make our messages a little more informative. */ -struct protocol_list { - u_short proto; - const char *name; -} protocol_list[] = { - { 0x21, "IP" }, - { 0x23, "OSI Network Layer" }, - { 0x25, "Xerox NS IDP" }, - { 0x27, "DECnet Phase IV" }, - { 0x29, "Appletalk" }, - { 0x2b, "Novell IPX" }, - { 0x2d, "VJ compressed TCP/IP" }, - { 0x2f, "VJ uncompressed TCP/IP" }, - { 0x31, "Bridging PDU" }, - { 0x33, "Stream Protocol ST-II" }, - { 0x35, "Banyan Vines" }, - { 0x39, "AppleTalk EDDP" }, - { 0x3b, "AppleTalk SmartBuffered" }, - { 0x3d, "Multi-Link" }, - { 0x3f, "NETBIOS Framing" }, - { 0x41, "Cisco Systems" }, - { 0x43, "Ascom Timeplex" }, - { 0x45, "Fujitsu Link Backup and Load Balancing (LBLB)" }, - { 0x47, "DCA Remote Lan" }, - { 0x49, "Serial Data Transport Protocol (PPP-SDTP)" }, - { 0x4b, "SNA over 802.2" }, - { 0x4d, "SNA" }, - { 0x4f, "IP6 Header Compression" }, - { 0x6f, "Stampede Bridging" }, - { 0xfb, "single-link compression" }, - { 0xfd, "1st choice compression" }, - { 0x0201, "802.1d Hello Packets" }, - { 0x0203, "IBM Source Routing BPDU" }, - { 0x0205, "DEC LANBridge100 Spanning Tree" }, - { 0x0231, "Luxcom" }, - { 0x0233, "Sigma Network Systems" }, - { 0x8021, "Internet Protocol Control Protocol" }, - { 0x8023, "OSI Network Layer Control Protocol" }, - { 0x8025, "Xerox NS IDP Control Protocol" }, - { 0x8027, "DECnet Phase IV Control Protocol" }, - { 0x8029, "Appletalk Control Protocol" }, - { 0x802b, "Novell IPX Control Protocol" }, - { 0x8031, "Bridging NCP" }, - { 0x8033, "Stream Protocol Control Protocol" }, - { 0x8035, "Banyan Vines Control Protocol" }, - { 0x803d, "Multi-Link Control Protocol" }, - { 0x803f, "NETBIOS Framing Control Protocol" }, - { 0x8041, "Cisco Systems Control Protocol" }, - { 0x8043, "Ascom Timeplex" }, - { 0x8045, "Fujitsu LBLB Control Protocol" }, - { 0x8047, "DCA Remote Lan Network Control Protocol (RLNCP)" }, - { 0x8049, "Serial Data Control Protocol (PPP-SDCP)" }, - { 0x804b, "SNA over 802.2 Control Protocol" }, - { 0x804d, "SNA Control Protocol" }, - { 0x804f, "IP6 Header Compression Control Protocol" }, - { 0x006f, "Stampede Bridging Control Protocol" }, - { 0x80fb, "Single Link Compression Control Protocol" }, - { 0x80fd, "Compression Control Protocol" }, - { 0xc021, "Link Control Protocol" }, - { 0xc023, "Password Authentication Protocol" }, - { 0xc025, "Link Quality Report" }, - { 0xc027, "Shiva Password Authentication Protocol" }, - { 0xc029, "CallBack Control Protocol (CBCP)" }, - { 0xc081, "Container Control Protocol" }, - { 0xc223, "Challenge Handshake Authentication Protocol" }, - { 0xc281, "Proprietary Authentication Protocol" }, - { 0, NULL }, -}; - -/* - * protocol_name - find a name for a PPP protocol. - */ -const char * -protocol_name(proto) - int proto; -{ - struct protocol_list *lp; - - for (lp = protocol_list; lp->proto != 0; ++lp) - if (proto == lp->proto) - return lp->name; - return NULL; -} - -/* - * get_input - called when incoming data is available. - */ -static void -get_input(void) -{ - int len, i; - u_char *p; - u_short protocol; - struct protent *protp; - - p = inpacket_buf; /* point to beginning of packet buffer */ - - len = read_packet(inpacket_buf); - if (len < 0) - return; - - if (len == 0) { - notice("Modem hangup"); - hungup = 1; - status = EXIT_HANGUP; - lcp_lowerdown(0); /* serial link is no longer available */ - link_terminated(0); - return; - } - - if (debug /*&& (debugflags & DBG_INPACKET)*/) - dbglog("rcvd %P", p, len); - - if (len < PPP_HDRLEN) { - MAINDEBUG(("io(): Received short packet.")); - return; - } - - p += 2; /* Skip address and control */ - GETSHORT(protocol, p); - len -= PPP_HDRLEN; - - /* - * Toss all non-LCP packets unless LCP is OPEN. - */ - if (protocol != PPP_LCP && lcp_fsm[0].state != OPENED) { - MAINDEBUG(("get_input: Received non-LCP packet when LCP not open.")); - return; - } - - /* - * Until we get past the authentication phase, toss all packets - * except LCP, LQR and authentication packets. - */ - if (phase <= PHASE_AUTHENTICATE - && !(protocol == PPP_LCP || protocol == PPP_LQR - || protocol == PPP_PAP || protocol == PPP_CHAP)) { - MAINDEBUG(("get_input: discarding proto 0x%x in phase %d", - protocol, phase)); - return; - } - - /* - * Upcall the proper protocol input routine. - */ - for (i = 0; (protp = protocols[i]) != NULL; ++i) { - if (protp->protocol == protocol && protp->enabled_flag) { - (*protp->input)(0, p, len); - return; - } - if (protocol == (protp->protocol & ~0x8000) && protp->enabled_flag - && protp->datainput != NULL) { - (*protp->datainput)(0, p, len); - return; - } - } - - if (debug) { - const char *pname = protocol_name(protocol); - if (pname != NULL) - warn("Unsupported protocol '%s' (0x%x) received", pname, protocol); - else - warn("Unsupported protocol 0x%x received", protocol); - } - lcp_sprotrej(0, p - PPP_HDRLEN, len + PPP_HDRLEN); - - return; -} - -/* - * new_phase - signal the start of a new phase of pppd's operation. - */ -void -new_phase(p) - int p; -{ - phase = p; - if (new_phase_hook) - (*new_phase_hook)(p); -} - -/* - * die - clean up state and exit with the specified status. - */ -void -die(status) - int status; -{ - cleanup(); -} - -/* - * cleanup - restore anything which needs to be restored before we exit - */ -/* ARGSUSED */ -static void -cleanup() -{ - sys_cleanup(); - - if (fd_ppp >= 0) - disestablish_ppp(ttyfd); - if (real_ttyfd >= 0) - close_tty(); - - sys_close(); -} - -/* - * close_tty - restore the terminal device and close it. - */ -static void -close_tty() -{ - /* drop dtr to hang up */ - if (!default_device && modem) { - setdtr(real_ttyfd, 0); - /* - * This sleep is in case the serial port has CLOCAL set by default, - * and consequently will reassert DTR when we close the device. - */ - sleep(1); - } - - restore_tty(real_ttyfd); - - close(real_ttyfd); - real_ttyfd = -1; -} - -/* - * update_link_stats - get stats at link termination. - */ -void -update_link_stats(u) - int u; -{ - struct timeval now; - char numbuf[32]; - - if (!get_ppp_stats(u, &link_stats) - || gettimeofday(&now, NULL) < 0) - return; - link_connect_time = now.tv_sec - start_time.tv_sec; - link_stats_valid = 1; - - slprintf(numbuf, sizeof(numbuf), "%d", link_connect_time); - slprintf(numbuf, sizeof(numbuf), "%d", link_stats.bytes_out); - slprintf(numbuf, sizeof(numbuf), "%d", link_stats.bytes_in); -} - -struct callout { - struct timeval c_time; /* time at which to call routine */ - void *c_arg; /* argument to routine */ - void (*c_func) __P((void *)); /* routine */ - struct callout *c_next; -}; - -static struct callout *callout = NULL; /* Callout list */ -static struct timeval timenow; /* Current time */ - -/* - * timeout - Schedule a timeout. - * - * Note that this timeout takes the number of seconds, NOT hz (as in - * the kernel). - */ -void -ppptimeout(func, arg, time) - void (*func) __P((void *)); - void *arg; - int time; -{ - struct callout *newp, *p, **pp; - - MAINDEBUG(("Timeout %p:%p in %d seconds.", func, arg, time)); - - /* - * Allocate timeout. - */ - if ((newp = (struct callout *) malloc(sizeof(struct callout))) == NULL) - fatal("Out of memory in timeout()!"); - newp->c_arg = arg; - newp->c_func = func; - gettimeofday(&timenow, NULL); - newp->c_time.tv_sec = timenow.tv_sec + time; - newp->c_time.tv_usec = timenow.tv_usec; - - /* - * Find correct place and link it in. - */ - for (pp = &callout; (p = *pp); pp = &p->c_next) - if (newp->c_time.tv_sec < p->c_time.tv_sec - || (newp->c_time.tv_sec == p->c_time.tv_sec - && newp->c_time.tv_usec < p->c_time.tv_usec)) - break; - newp->c_next = p; - *pp = newp; -} - - -/* - * untimeout - Unschedule a timeout. - */ -void -untimeout(func, arg) - void (*func) __P((void *)); - void *arg; -{ - struct callout **copp, *freep; - - MAINDEBUG(("Untimeout %p:%p.", func, arg)); - - /* - * Find first matching timeout and remove it from the list. - */ - for (copp = &callout; (freep = *copp); copp = &freep->c_next) - if (freep->c_func == func && freep->c_arg == arg) { - *copp = freep->c_next; - free((char *) freep); - break; - } -} - - -/* - * calltimeout - Call any timeout routines which are now due. - */ -static void -calltimeout() -{ - struct callout *p; - - while (callout != NULL) { - p = callout; - - if (gettimeofday(&timenow, NULL) < 0) - fatal("Failed to get time of day: %m"); - if (!(p->c_time.tv_sec < timenow.tv_sec - || (p->c_time.tv_sec == timenow.tv_sec - && p->c_time.tv_usec <= timenow.tv_usec))) - break; /* no, it's not time yet */ - - callout = p->c_next; - (*p->c_func)(p->c_arg); - - free((char *) p); - } -} - - -/* - * timeleft - return the length of time until the next timeout is due. - */ -static struct timeval * -timeleft(tvp) - struct timeval *tvp; -{ - if (callout == NULL) - return NULL; - - gettimeofday(&timenow, NULL); - tvp->tv_sec = callout->c_time.tv_sec - timenow.tv_sec; - tvp->tv_usec = callout->c_time.tv_usec - timenow.tv_usec; - if (tvp->tv_usec < 0) { - tvp->tv_usec += 1000000; - tvp->tv_sec -= 1; - } - if (tvp->tv_sec < 0) - tvp->tv_sec = tvp->tv_usec = 0; - - return tvp; -} - -/* - * device_script - run a program to talk to the serial device - * (e.g. to run the connector or disconnector script). - */ -static int device_script(int fd, int mode, char *program) -{ - int iReturn = -1; - char pScript[128]; - - /* copyt script into temporary location */ - strcpy(pScript, program); - - /* check to see if dialer was initialized */ - if ( !pppd_dialer ) { - /* set default dialer to chatmain */ - pppd_dialer = chatmain; - } - - /* check to see if dialer is set */ - if ( pppd_dialer ) { - /* call the dialer */ - iReturn = (*pppd_dialer)(fd, mode, program); - } - - return ( -iReturn ); -} - -/* - * novm - log an error message saying we ran out of memory, and die. - */ -void -novm(msg) - char *msg; -{ - fatal("Virtual memory exhausted allocating %s\n", msg); -} diff --git a/cpukit/pppd/rtemspppd.c b/cpukit/pppd/rtemspppd.c deleted file mode 100644 index 1277499205..0000000000 --- a/cpukit/pppd/rtemspppd.c +++ /dev/null @@ -1,217 +0,0 @@ - -#include -#include -#include "pppd.h" -#include "rtemspppd.h" - - -/* define pppd function prototypes */ -extern void pppasyncattach(void); -extern int pppdmain(int, char **); - -/* define global variables */ -rtems_id rtems_pppd_taskid; -rtems_pppd_hookfunction rtems_pppd_errorfp; -rtems_pppd_hookfunction rtems_pppd_exitfp; - - -static rtems_task pppTask(rtems_task_argument arg) -{ - rtems_status_code sc = RTEMS_SUCCESSFUL; - rtems_option options; - rtems_event_set in; - rtems_event_set out; - int iStatus; - - /* call function to setup ppp line discipline */ - pppasyncattach(); - - /* enter processing loop */ - in = (RTEMS_EVENT_29 | RTEMS_EVENT_30); - options = (RTEMS_EVENT_ANY | RTEMS_WAIT); - while ( sc == RTEMS_SUCCESSFUL ) { - /* wait for the next event */ - sc = rtems_event_receive(in, options, RTEMS_NO_TIMEOUT, &out); - if ( sc == RTEMS_SUCCESSFUL ) { - /* determine which event was sent */ - if ( out & RTEMS_EVENT_29 ) { - /* terminate event received */ - /* set value to break out of event loop */ - sc = RTEMS_UNSATISFIED; - } - else if ( out & RTEMS_EVENT_30 ) { - /* connect request */ - /* execute the pppd main code */ - iStatus = pppdmain(0, NULL); - if ( iStatus == EXIT_OK ) { - /* check exit callback */ - if ( rtems_pppd_exitfp ) { - (*rtems_pppd_exitfp)(); - } - } - else { - /* check error callback */ - if ( rtems_pppd_errorfp ) { - (*rtems_pppd_errorfp)(); - } - } - } - } - } - - /* terminate myself */ - rtems_pppd_taskid = 0; - rtems_task_delete(RTEMS_SELF); -} - -int rtems_pppd_initialize(void) -{ - int iReturn = (int)-1; - rtems_unsigned32 priority = 100; - rtems_status_code status; - rtems_name taskName; - - /* determine priority value */ - if ( rtems_bsdnet_config.network_task_priority ) { - priority = rtems_bsdnet_config.network_task_priority; - } - - /* initialize the exit hook */ - rtems_pppd_exitfp = (rtems_pppd_hookfunction)0; - - /* create the rtems task */ - taskName = rtems_build_name( 'p', 'p', 'p', 'd' ); - status = rtems_task_create(taskName, priority, 8192, - (RTEMS_PREEMPT|RTEMS_NO_TIMESLICE|RTEMS_NO_ASR|RTEMS_INTERRUPT_LEVEL(0)), - RTEMS_NO_FLOATING_POINT|RTEMS_LOCAL, - &rtems_pppd_taskid); - if ( status == RTEMS_SUCCESSFUL ) { - status = rtems_task_start(rtems_pppd_taskid, pppTask, 0); - if ( status == RTEMS_SUCCESSFUL ) { - iReturn = rtems_pppd_reset_options(); - } - } - - return ( iReturn ); -} - -int rtems_pppd_terminate(void) -{ - /* send terminate signal to pppd task */ - rtems_event_send(rtems_pppd_taskid, RTEMS_EVENT_29); - - /* call the disconnect function */ - rtems_pppd_disconnect(); - - return ( 0 ); -} - -int rtems_pppd_reset_options(void) -{ - int i; - struct protent *protp; - - /* - * Initialize to the standard option set, then parse, in order, - * the system options file, the user's options file, - * the tty's options file, and the command line arguments. - */ - for (i = 0; (protp = protocols[i]) != NULL; ++i) - (*protp->init)(0); - - return ( 0 ); -} - -int rtems_pppd_set_hook(int id, rtems_pppd_hookfunction hookfp) -{ - int iReturn = (int)0; - - switch ( id ) { - case RTEMS_PPPD_LINKUP_HOOK: - auth_linkup_hook = hookfp; - break; - case RTEMS_PPPD_LINKDOWN_HOOK: - auth_linkdown_hook = hookfp; - break; - case RTEMS_PPPD_IPUP_HOOK: - ip_up_hook = hookfp; - break; - case RTEMS_PPPD_IPDOWN_HOOK: - ip_down_hook = hookfp; - break; - case RTEMS_PPPD_ERROR_HOOK: - rtems_pppd_errorfp = hookfp; - break; - case RTEMS_PPPD_EXIT_HOOK: - rtems_pppd_exitfp = hookfp; - break; - default: - iReturn = (int)-1; - break; - } - - return ( iReturn ); -} - -int rtems_pppd_set_dialer(rtems_pppd_dialerfunction dialerfp) -{ - pppd_dialer = dialerfp; - return ( (int)0 ); -} - -int rtems_pppd_set_option(const char *pOption, const char *pValue) -{ - int iReturn = (int)0; - int prevPhase; - struct wordlist option; - struct wordlist value; - - if ( pOption != (const char *)0 ) { - /* initialize the values */ - option.word = (char *)pOption; - option.next = (struct wordlist *)0; - if ( pValue != (const char *)0 ) { - option.next = &value; - value.word = (char *)pValue; - value.next = (struct wordlist *)0; - } - - /* save current phase value */ - prevPhase = phase; - phase = PHASE_INITIALIZE; - - /* process option and reset phase value */ - iReturn = options_from_list(&option, 1); - phase = prevPhase; - } - - return ( iReturn ); -} - -int rtems_pppd_connect(void) -{ - /* send connect signal to pppd task */ - rtems_event_send(rtems_pppd_taskid, RTEMS_EVENT_30); - - return ( 0 ); -} - -static void timeout_terminate(void *arg) -{ - /* set pppd global variables to disconnect */ - persist = 0; - kill_link = 1; -} - -int rtems_pppd_disconnect(void) -{ - /* need to wait a little time before we can bring the link down */ - /* set up time out in 1 seconds */ - TIMEOUT(timeout_terminate, NULL, 1); - - /* send event to wake up the pppd code */ - /* pretend its a serial interrput */ - rtems_event_send(rtems_pppd_taskid, RTEMS_EVENT_31); - - return ( 0 ); -} diff --git a/cpukit/pppd/rtemspppd.h b/cpukit/pppd/rtemspppd.h deleted file mode 100644 index f60916e2ee..0000000000 --- a/cpukit/pppd/rtemspppd.h +++ /dev/null @@ -1,29 +0,0 @@ - -#ifndef RTEMSPPPD_H -#define RTEMSPPPD_H - - -/* define hook function identifiers */ -#define RTEMS_PPPD_LINKUP_HOOK 1 -#define RTEMS_PPPD_LINKDOWN_HOOK 2 -#define RTEMS_PPPD_IPUP_HOOK 3 -#define RTEMS_PPPD_IPDOWN_HOOK 4 -#define RTEMS_PPPD_ERROR_HOOK 5 -#define RTEMS_PPPD_EXIT_HOOK 6 - -/* define hook function pointer prototype */ -typedef void (*rtems_pppd_hookfunction)(void); -typedef int (*rtems_pppd_dialerfunction)(int tty, int mode, char *pScript); - - -/* define pppd function prototyes */ -int rtems_pppd_initialize(void); -int rtems_pppd_terminate(void); -int rtems_pppd_reset_options(void); -int rtems_pppd_set_hook(int id, rtems_pppd_hookfunction hookfp); -int rtems_pppd_set_dialer(rtems_pppd_dialerfunction dialerfp); -int rtems_pppd_set_option(const char *pOption, const char *pValue); -int rtems_pppd_connect(void); -int rtems_pppd_disconnect(void); - -#endif diff --git a/cpukit/pppd/sys-rtems.c b/cpukit/pppd/sys-rtems.c deleted file mode 100644 index 0fc3e139b9..0000000000 --- a/cpukit/pppd/sys-rtems.c +++ /dev/null @@ -1,1330 +0,0 @@ -/* - * sys-bsd.c - System-dependent procedures for setting up - * PPP interfaces on bsd-4.4-ish systems (including 386BSD, NetBSD, etc.) - * - * Copyright (c) 1989 Carnegie Mellon University. - * Copyright (c) 1995 The Australian National University. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by Carnegie Mellon University and The Australian National University. - * The names of the Universities may not be used to endorse or promote - * products derived from this software without specific prior written - * permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#define RCSID "$Id$" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef PPP_FILTER -#include -#endif - -#include -#include -#include -#include -#include -#include - -#if RTM_VERSION >= 3 -#include -#if defined(NetBSD) && (NetBSD >= 199703) -#include -#else /* NetBSD 1.2D or later */ -#include -#endif -#endif - -#include -#include -#include -extern int rtems_bsdnet_microseconds_per_tick; -extern rtems_id rtems_pppd_taskid; - -#include "pppd.h" -#include "fsm.h" -#include "ipcp.h" - -static const char rcsid[] = RCSID; - - -static int initdisc = -1; /* Initial TTY discipline for ppp_fd */ -static int initfdflags = -1; /* Initial file descriptor flags for ppp_fd */ -static int ppp_fd = -1; /* fd which is set to PPP discipline */ -static int rtm_seq; - -static int restore_term; /* 1 => we've munged the terminal */ -static struct termios inittermios; /* Initial TTY termios */ -static struct winsize wsinfo; /* Initial window size info */ - -static int loop_slave = -1; -static int loop_master; - -static unsigned char inbuf[512]; /* buffer for chars read from loopback */ - -static int sockfd; /* socket for doing interface ioctls */ - -static int if_is_up; /* the interface is currently up */ -static u_int32_t ifaddrs[2]; /* local and remote addresses we set */ -static u_int32_t default_route_gateway; /* gateway addr for default route */ -static u_int32_t proxy_arp_addr; /* remote addr for proxy arp */ - -/* Prototypes for procedures local to this file. */ -static int dodefaultroute __P((u_int32_t, int)); -static int get_ether_addr __P((u_int32_t, struct sockaddr_dl *)); - - -/* - * sys_init - System-dependent initialization. - */ -void -sys_init() -{ - /* Get an internet socket for doing socket ioctl's on. */ - if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) - fatal("Couldn't create IP socket: %m"); -} - -/* - * sys_cleanup - restore any system state we modified before exiting: - * mark the interface down, delete default route and/or proxy arp entry. - * This should call die() because it's called from die(). - */ -void -sys_cleanup() -{ - struct ifreq ifr; - - if (if_is_up) { - strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); - if (ioctl(sockfd, SIOCGIFFLAGS, &ifr) >= 0 - && ((ifr.ifr_flags & IFF_UP) != 0)) { - ifr.ifr_flags &= ~IFF_UP; - ioctl(sockfd, SIOCSIFFLAGS, &ifr); - } - } - if (ifaddrs[0] != 0) - cifaddr(0, ifaddrs[0], ifaddrs[1]); - if (default_route_gateway) - cifdefaultroute(0, 0, default_route_gateway); - if (proxy_arp_addr) - cifproxyarp(0, proxy_arp_addr); -} - -/* - * sys_close - Clean up in a child process before execing. - */ -void -sys_close() -{ - close(sockfd); - if (loop_slave >= 0) { - close(loop_slave); - close(loop_master); - } -} - -/* - * sys_check_options - check the options that the user specified - */ -int -sys_check_options() -{ - return 1; -} - -/* - * ppp_available - check whether the system has any ppp interfaces - * (in fact we check whether we can do an ioctl on ppp0). - */ -int -ppp_available() -{ - int s, ok; - struct ifreq ifr; - - if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) - return 1; /* can't tell */ - - strlcpy(ifr.ifr_name, "ppp0", sizeof (ifr.ifr_name)); - ok = ioctl(s, SIOCGIFFLAGS, (caddr_t) &ifr) >= 0; - close(s); - - return ok; -} - -/* - * establish_ppp - Turn the serial port into a ppp interface. - */ -int -establish_ppp(fd) - int fd; -{ - int taskid = (int)rtems_pppd_taskid; - int pppdisc = PPPDISC; - int x; - - if (demand) { - /* - * Demand mode - prime the old ppp device to relinquish the unit. - */ - if (ioctl(ppp_fd, PPPIOCXFERUNIT, 0) < 0) - fatal("ioctl(transfer ppp unit): %m"); - } - - /* - * Save the old line discipline of fd, and set it to PPP. - */ - if (ioctl(fd, TIOCGETD, &initdisc) < 0) - fatal("ioctl(TIOCGETD): %m"); - if (ioctl(fd, TIOCSETD, &pppdisc) < 0) - fatal("ioctl(TIOCSETD): %m"); - - /* set pppd taskid into the driver */ - ioctl(fd, PPPIOCSTASK, &taskid); - - if (!demand) { - /* - * Find out which interface we were given. - */ - if (ioctl(fd, PPPIOCGUNIT, &pppifunit) < 0) - fatal("ioctl(PPPIOCGUNIT): %m"); - } else { - /* - * Check that we got the same unit again. - */ - if (ioctl(fd, PPPIOCGUNIT, &x) < 0) - fatal("ioctl(PPPIOCGUNIT): %m"); - if (x != pppifunit) - fatal("transfer_ppp failed: wanted unit %d, got %d", pppifunit, x); - x = TTYDISC; - ioctl(loop_slave, TIOCSETD, &x); - } - - ppp_fd = fd; - - /* - * Enable debug in the driver if requested. - */ - if (kdebugflag) { - if (ioctl(fd, PPPIOCGFLAGS, (caddr_t) &x) < 0) { - warn("ioctl (PPPIOCGFLAGS): %m"); - } else { - x |= (kdebugflag & 0xFF) * SC_DEBUG; - if (ioctl(fd, PPPIOCSFLAGS, (caddr_t) &x) < 0) - warn("ioctl(PPPIOCSFLAGS): %m"); - } - } - - /* - * Set device for non-blocking reads. - */ - if ((initfdflags = fcntl(fd, F_GETFL)) == -1 - || fcntl(fd, F_SETFL, initfdflags | O_NONBLOCK) == -1) { - warn("Couldn't set device to non-blocking mode: %m"); - } - - return fd; -} - -/* - * restore_loop - reattach the ppp unit to the loopback. - */ -void -restore_loop() -{ - int x; - - /* - * Transfer the ppp interface back to the loopback. - */ - if (ioctl(ppp_fd, PPPIOCXFERUNIT, 0) < 0) - fatal("ioctl(transfer ppp unit): %m"); - x = PPPDISC; - if (ioctl(loop_slave, TIOCSETD, &x) < 0) - fatal("ioctl(TIOCSETD): %m"); - - /* - * Check that we got the same unit again. - */ - if (ioctl(loop_slave, PPPIOCGUNIT, &x) < 0) - fatal("ioctl(PPPIOCGUNIT): %m"); - if (x != pppifunit) - fatal("transfer_ppp failed: wanted unit %d, got %d", pppifunit, x); - ppp_fd = loop_slave; -} - - -/* - * disestablish_ppp - Restore the serial port to normal operation. - * This shouldn't call die() because it's called from die(). - */ -void -disestablish_ppp(fd) - int fd; -{ - int taskid = (int)0; - - /* clear pppd taskid from the driver */ - ioctl(fd, PPPIOCSTASK, &taskid); - - /* Reset non-blocking mode on fd. */ - if (initfdflags != -1 && fcntl(fd, F_SETFL, initfdflags) < 0) - warn("Couldn't restore device fd flags: %m"); - initfdflags = -1; - - /* Restore old line discipline. */ - if (initdisc >= 0 && ioctl(fd, TIOCSETD, &initdisc) < 0) - error("ioctl(TIOCSETD): %m"); - initdisc = -1; - - if (fd == ppp_fd) - ppp_fd = -1; -} - -/* - * Check whether the link seems not to be 8-bit clean. - */ -void -clean_check() -{ - int x; - char *s; - - if (ioctl(ppp_fd, PPPIOCGFLAGS, (caddr_t) &x) == 0) { - s = NULL; - switch (~x & (SC_RCV_B7_0|SC_RCV_B7_1|SC_RCV_EVNP|SC_RCV_ODDP)) { - case SC_RCV_B7_0: - s = "bit 7 set to 1"; - break; - case SC_RCV_B7_1: - s = "bit 7 set to 0"; - break; - case SC_RCV_EVNP: - s = "odd parity"; - break; - case SC_RCV_ODDP: - s = "even parity"; - break; - } - if (s != NULL) { - warn("Serial link is not 8-bit clean:"); - warn("All received characters had %s", s); - } - } -} - -/* - * set_up_tty: Set up the serial port on `fd' for 8 bits, no parity, - * at the requested speed, etc. If `local' is true, set CLOCAL - * regardless of whether the modem option was specified. - * - * For *BSD, we assume that speed_t values numerically equal bits/second. - */ -void -set_up_tty(fd, local) - int fd, local; -{ - struct termios tios; - - if (tcgetattr(fd, &tios) < 0) - fatal("tcgetattr: %m"); - - if (!restore_term) { - inittermios = tios; - ioctl(fd, TIOCGWINSZ, &wsinfo); - } - - tios.c_cflag &= ~(CSIZE | CSTOPB | PARENB | CLOCAL); - if (crtscts > 0 && !local) { - if (crtscts == 2) { -#ifdef CDTRCTS - tios.c_cflag |= CDTRCTS; -#endif - } else - tios.c_cflag |= CRTSCTS; - } else if (crtscts < 0) { - tios.c_cflag &= ~CRTSCTS; -#ifdef CDTRCTS - tios.c_cflag &= ~CDTRCTS; -#endif - } - - tios.c_cflag |= CS8 | CREAD | HUPCL; - if (local || !modem) - tios.c_cflag |= CLOCAL; - tios.c_iflag = IGNBRK | IGNPAR; - tios.c_oflag = 0; - tios.c_lflag = 0; - tios.c_cc[VMIN] = 1; - tios.c_cc[VTIME] = 0; - - if (crtscts == -2) { - tios.c_iflag |= IXON | IXOFF; - tios.c_cc[VSTOP] = 0x13; /* DC3 = XOFF = ^S */ - tios.c_cc[VSTART] = 0x11; /* DC1 = XON = ^Q */ - } - - if (inspeed) { - cfsetospeed(&tios, inspeed); - cfsetispeed(&tios, inspeed); - } else { - inspeed = cfgetospeed(&tios); - /* - * We can't proceed if the serial port speed is 0, - * since that implies that the serial port is disabled. - */ - if (inspeed == 0) - fatal("Baud rate for %s is 0; need explicit baud rate", devnam); - } - baud_rate = inspeed; - -/* if (tcsetattr(fd, TCSAFLUSH, &tios) < 0) { */ - if (tcsetattr(fd, TCSADRAIN, &tios) < 0) { - fatal("tcsetattr: %m"); - } - - restore_term = 1; -} - -/* - * restore_tty - restore the terminal to the saved settings. - */ -void -restore_tty(fd) - int fd; -{ - if (restore_term) { - if (!default_device) { - /* - * Turn off echoing, because otherwise we can get into - * a loop with the tty and the modem echoing to each other. - * We presume we are the sole user of this tty device, so - * when we close it, it will revert to its defaults anyway. - */ - inittermios.c_lflag &= ~(ECHO | ECHONL); - } -/* if (tcsetattr(fd, TCSAFLUSH, &inittermios) < 0) { */ - if (tcsetattr(fd, TCSADRAIN, &inittermios) < 0) { - if (errno != ENXIO) - warn("tcsetattr: %m"); - } - ioctl(fd, TIOCSWINSZ, &wsinfo); - restore_term = 0; - } -} - -/* - * setdtr - control the DTR line on the serial port. - * This is called from die(), so it shouldn't call die(). - */ -void -setdtr(fd, on) -int fd, on; -{ - int modembits = TIOCM_DTR; - - ioctl(fd, (on? TIOCMBIS: TIOCMBIC), &modembits); -} - -/* - * get_pty - get a pty master/slave pair and chown the slave side - * to the uid given. Assumes slave_name points to >= 12 bytes of space. - */ -int -get_pty(master_fdp, slave_fdp, slave_name, uid) - int *master_fdp; - int *slave_fdp; - char *slave_name; - int uid; -{ - return 1; -} - - -/* - * open_ppp_loopback - open the device we use for getting - * packets in demand mode, and connect it to a ppp interface. - * Here we use a pty. - */ -int -open_ppp_loopback() -{ - return loop_master; -} - - -/* - * output - Output PPP packet. - */ -void -output(unit, p, len) - int unit; - u_char *p; - int len; -{ - if (debug); - dbglog("sent %P", p, len); -/* printf("sent packet [%d]\n", len); */ - - if (write(ttyfd, p, len) < 0) { - if (errno != EIO) - error("write: %m"); - } -} - -void -ppp_delay(void) -{ - rtems_interval ticks; - - /* recommended delay to help negotiation */ - ticks = 300000/rtems_bsdnet_microseconds_per_tick; - rtems_task_wake_after(ticks); -} - -/* - * wait_input - wait until there is data available, - * for the length of time specified by *timo (indefinite - * if timo is NULL). - */ -void -wait_input(timo) - struct timeval *timo; -{ - rtems_interval ticks; - rtems_event_set events; - - ticks = ((timo->tv_sec*1000000)+timo->tv_usec)/rtems_bsdnet_microseconds_per_tick; - if ( ticks > 0 ) { - rtems_event_receive(RTEMS_EVENT_31, (RTEMS_EVENT_ANY|RTEMS_WAIT), ticks, &events); - } -} - -/* - * read_packet - get a PPP packet from the serial device. - */ -int -read_packet(buf) - u_char *buf; -{ - int len; - - if ((len = read(ttyfd, buf, PPP_MTU + PPP_HDRLEN)) < 0) { - if (errno == EWOULDBLOCK || errno == EINTR) len = -1; - /*fatal("read: %m"); */ - } - -/* printf("read packet [%d]\n", len); */ - return len; -} - - -/* - * get_loop_output - read characters from the loopback, form them - * into frames, and detect when we want to bring the real link up. - * Return value is 1 if we need to bring up the link, 0 otherwise. - */ -int -get_loop_output() -{ - int rv = 0; - int n; - - while ((n = read(loop_master, inbuf, sizeof(inbuf))) >= 0) { - if (loop_chars(inbuf, n)) - rv = 1; - } - - if (n == 0) - fatal("eof on loopback"); - if (errno != EWOULDBLOCK) - fatal("read from loopback: %m"); - - return rv; -} - - -/* - * ppp_send_config - configure the transmit characteristics of - * the ppp interface. - */ -void -ppp_send_config(unit, mtu, asyncmap, pcomp, accomp) - int unit, mtu; - u_int32_t asyncmap; - int pcomp, accomp; -{ - u_int x; - struct ifreq ifr; - - strlcpy(ifr.ifr_name, ifname, sizeof (ifr.ifr_name)); - ifr.ifr_mtu = mtu; - if (ioctl(sockfd, SIOCSIFMTU, (caddr_t) &ifr) < 0) - fatal("ioctl(SIOCSIFMTU): %m"); - - if (ioctl(ppp_fd, PPPIOCSASYNCMAP, (caddr_t) &asyncmap) < 0) - fatal("ioctl(PPPIOCSASYNCMAP): %m"); - - if (ioctl(ppp_fd, PPPIOCGFLAGS, (caddr_t) &x) < 0) - fatal("ioctl (PPPIOCGFLAGS): %m"); - x = pcomp? x | SC_COMP_PROT: x &~ SC_COMP_PROT; - x = accomp? x | SC_COMP_AC: x &~ SC_COMP_AC; -/* x = sync_serial ? x | SC_SYNC : x & ~SC_SYNC; */ - if (ioctl(ppp_fd, PPPIOCSFLAGS, (caddr_t) &x) < 0) - fatal("ioctl(PPPIOCSFLAGS): %m"); -} - - -/* - * ppp_set_xaccm - set the extended transmit ACCM for the interface. - */ -void -ppp_set_xaccm(unit, accm) - int unit; - ext_accm accm; -{ - if (ioctl(ppp_fd, PPPIOCSXASYNCMAP, accm) < 0 && errno != ENOTTY) - warn("ioctl(set extended ACCM): %m"); -} - - -/* - * ppp_recv_config - configure the receive-side characteristics of - * the ppp interface. - */ -void -ppp_recv_config(unit, mru, asyncmap, pcomp, accomp) - int unit, mru; - u_int32_t asyncmap; - int pcomp, accomp; -{ - int x; - - if (ioctl(ppp_fd, PPPIOCSMRU, (caddr_t) &mru) < 0) - fatal("ioctl(PPPIOCSMRU): %m"); - if (ioctl(ppp_fd, PPPIOCSRASYNCMAP, (caddr_t) &asyncmap) < 0) - fatal("ioctl(PPPIOCSRASYNCMAP): %m"); - if (ioctl(ppp_fd, PPPIOCGFLAGS, (caddr_t) &x) < 0) - fatal("ioctl (PPPIOCGFLAGS): %m"); - x = !accomp? x | SC_REJ_COMP_AC: x &~ SC_REJ_COMP_AC; - if (ioctl(ppp_fd, PPPIOCSFLAGS, (caddr_t) &x) < 0) - fatal("ioctl(PPPIOCSFLAGS): %m"); -} - -/* - * ccp_test - ask kernel whether a given compression method - * is acceptable for use. Returns 1 if the method and parameters - * are OK, 0 if the method is known but the parameters are not OK - * (e.g. code size should be reduced), or -1 if the method is unknown. - */ -int -ccp_test(unit, opt_ptr, opt_len, for_transmit) - int unit, opt_len, for_transmit; - u_char *opt_ptr; -{ - struct ppp_option_data data; - - data.ptr = opt_ptr; - data.length = opt_len; - data.transmit = for_transmit; - if (ioctl(ttyfd, PPPIOCSCOMPRESS, (caddr_t) &data) >= 0) - return 1; - return (errno == ENOBUFS)? 0: -1; -} - -/* - * ccp_flags_set - inform kernel about the current state of CCP. - */ -void -ccp_flags_set(unit, isopen, isup) - int unit, isopen, isup; -{ - int x; - - if (ioctl(ppp_fd, PPPIOCGFLAGS, (caddr_t) &x) < 0) { - error("ioctl (PPPIOCGFLAGS): %m"); - return; - } - x = isopen? x | SC_CCP_OPEN: x &~ SC_CCP_OPEN; - x = isup? x | SC_CCP_UP: x &~ SC_CCP_UP; - if (ioctl(ppp_fd, PPPIOCSFLAGS, (caddr_t) &x) < 0) - error("ioctl(PPPIOCSFLAGS): %m"); -} - -/* - * ccp_fatal_error - returns 1 if decompression was disabled as a - * result of an error detected after decompression of a packet, - * 0 otherwise. This is necessary because of patent nonsense. - */ -int -ccp_fatal_error(unit) - int unit; -{ - int x; - - if (ioctl(ppp_fd, PPPIOCGFLAGS, (caddr_t) &x) < 0) { - error("ioctl(PPPIOCGFLAGS): %m"); - return 0; - } - return x & SC_DC_FERROR; -} - -/* - * get_idle_time - return how long the link has been idle. - */ -int -get_idle_time(u, ip) - int u; - struct ppp_idle *ip; -{ - return ioctl(ppp_fd, PPPIOCGIDLE, ip) >= 0; -} - -/* - * get_ppp_stats - return statistics for the link. - */ -int -get_ppp_stats(u, stats) - int u; - struct pppd_stats *stats; -{ - struct ifpppstatsreq req; - - memset (&req, 0, sizeof (req)); - strlcpy(req.ifr_name, ifname, sizeof(req.ifr_name)); - if (ioctl(sockfd, SIOCGPPPSTATS, &req) < 0) { - error("Couldn't get PPP statistics: %m"); - return 0; - } - stats->bytes_in = req.stats.p.ppp_ibytes; - stats->bytes_out = req.stats.p.ppp_obytes; - return 1; -} - - -#ifdef PPP_FILTER -/* - * set_filters - transfer the pass and active filters to the kernel. - */ -int -set_filters(pass, active) - struct bpf_program *pass, *active; -{ - int ret = 1; - - if (pass->bf_len > 0) { - if (ioctl(ppp_fd, PPPIOCSPASS, pass) < 0) { - error("Couldn't set pass-filter in kernel: %m"); - ret = 0; - } - } - if (active->bf_len > 0) { - if (ioctl(ppp_fd, PPPIOCSACTIVE, active) < 0) { - error("Couldn't set active-filter in kernel: %m"); - ret = 0; - } - } - return ret; -} -#endif - -/* - * sifvjcomp - config tcp header compression - */ -int -sifvjcomp(u, vjcomp, cidcomp, maxcid) - int u, vjcomp, cidcomp, maxcid; -{ - u_int x; - - if (ioctl(ppp_fd, PPPIOCGFLAGS, (caddr_t) &x) < 0) { - error("ioctl (PPPIOCGFLAGS): %m"); - return 0; - } - x = vjcomp ? x | SC_COMP_TCP: x &~ SC_COMP_TCP; - x = cidcomp? x & ~SC_NO_TCP_CCID: x | SC_NO_TCP_CCID; - if (ioctl(ppp_fd, PPPIOCSFLAGS, (caddr_t) &x) < 0) { - error("ioctl(PPPIOCSFLAGS): %m"); - return 0; - } - if (vjcomp && ioctl(ppp_fd, PPPIOCSMAXCID, (caddr_t) &maxcid) < 0) { - error("ioctl(PPPIOCSFLAGS): %m"); - return 0; - } - return 1; -} - -/* - * sifup - Config the interface up and enable IP packets to pass. - */ -int -sifup(u) - int u; -{ - struct ifreq ifr; - - strlcpy(ifr.ifr_name, ifname, sizeof (ifr.ifr_name)); - if (ioctl(sockfd, SIOCGIFFLAGS, (caddr_t) &ifr) < 0) { - error("ioctl (SIOCGIFFLAGS): %m"); - return 0; - } - ifr.ifr_flags |= IFF_UP; - if (ioctl(sockfd, SIOCSIFFLAGS, (caddr_t) &ifr) < 0) { - error("ioctl(SIOCSIFFLAGS): %m"); - return 0; - } - if_is_up = 1; - return 1; -} - -/* - * sifnpmode - Set the mode for handling packets for a given NP. - */ -int -sifnpmode(u, proto, mode) - int u; - int proto; - enum NPmode mode; -{ - struct npioctl npi; - - npi.protocol = proto; - npi.mode = mode; - if (ioctl(ppp_fd, PPPIOCSNPMODE, &npi) < 0) { - error("ioctl(set NP %d mode to %d): %m", proto, mode); - return 0; - } - return 1; -} - -/* - * sifdown - Config the interface down and disable IP. - */ -int -sifdown(u) - int u; -{ - struct ifreq ifr; - int rv; - struct npioctl npi; - - rv = 1; - npi.protocol = PPP_IP; - npi.mode = NPMODE_ERROR; - ioctl(ppp_fd, PPPIOCSNPMODE, (caddr_t) &npi); - /* ignore errors, because ppp_fd might have been closed by now. */ - - strlcpy(ifr.ifr_name, ifname, sizeof (ifr.ifr_name)); - if (ioctl(sockfd, SIOCGIFFLAGS, (caddr_t) &ifr) < 0) { - error("ioctl (SIOCGIFFLAGS): %m"); - rv = 0; - } else { - ifr.ifr_flags &= ~IFF_UP; - if (ioctl(sockfd, SIOCSIFFLAGS, (caddr_t) &ifr) < 0) { - error("ioctl(SIOCSIFFLAGS): %m"); - rv = 0; - } else - if_is_up = 0; - } - return rv; -} - -/* - * SET_SA_FAMILY - set the sa_family field of a struct sockaddr, - * if it exists. - */ -#define SET_SA_FAMILY(addr, family) \ - BZERO((char *) &(addr), sizeof(addr)); \ - addr.sa_family = (family); \ - addr.sa_len = sizeof(addr); - -/* - * sifaddr - Config the interface IP addresses and netmask. - */ -int -sifaddr(u, o, h, m) - int u; - u_int32_t o, h, m; -{ - struct ifaliasreq ifra; - struct ifreq ifr; - - strlcpy(ifra.ifra_name, ifname, sizeof(ifra.ifra_name)); - SET_SA_FAMILY(ifra.ifra_addr, AF_INET); - ((struct sockaddr_in *) &ifra.ifra_addr)->sin_addr.s_addr = o; - SET_SA_FAMILY(ifra.ifra_broadaddr, AF_INET); - ((struct sockaddr_in *) &ifra.ifra_broadaddr)->sin_addr.s_addr = h; - if (m != 0) { - SET_SA_FAMILY(ifra.ifra_mask, AF_INET); - ((struct sockaddr_in *) &ifra.ifra_mask)->sin_addr.s_addr = m; - } else - BZERO(&ifra.ifra_mask, sizeof(ifra.ifra_mask)); - BZERO(&ifr, sizeof(ifr)); - strlcpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name)); - if (ioctl(sockfd, SIOCDIFADDR, (caddr_t) &ifr) < 0) { - if (errno != EADDRNOTAVAIL) - warn("Couldn't remove interface address: %m"); - } - if (ioctl(sockfd, SIOCAIFADDR, (caddr_t) &ifra) < 0) { - if (errno != EEXIST) { - error("Couldn't set interface address: %m"); - return 0; - } - warn("Couldn't set interface address: Address %I already exists", o); - } - ifaddrs[0] = o; - ifaddrs[1] = h; - return 1; -} - -/* - * cifaddr - Clear the interface IP addresses, and delete routes - * through the interface if possible. - */ -int -cifaddr(u, o, h) - int u; - u_int32_t o, h; -{ - struct ifaliasreq ifra; - - ifaddrs[0] = 0; - strlcpy(ifra.ifra_name, ifname, sizeof(ifra.ifra_name)); - SET_SA_FAMILY(ifra.ifra_addr, AF_INET); - ((struct sockaddr_in *) &ifra.ifra_addr)->sin_addr.s_addr = o; - SET_SA_FAMILY(ifra.ifra_broadaddr, AF_INET); - ((struct sockaddr_in *) &ifra.ifra_broadaddr)->sin_addr.s_addr = h; - BZERO(&ifra.ifra_mask, sizeof(ifra.ifra_mask)); - if (ioctl(sockfd, SIOCDIFADDR, (caddr_t) &ifra) < 0) { - if (errno != EADDRNOTAVAIL) - warn("Couldn't delete interface address: %m"); - return 0; - } - return 1; -} - -/* - * sifdefaultroute - assign a default route through the address given. - */ -int -sifdefaultroute(u, l, g) - int u; - u_int32_t l, g; -{ - return dodefaultroute(g, 's'); -} - -/* - * cifdefaultroute - delete a default route through the address given. - */ -int -cifdefaultroute(u, l, g) - int u; - u_int32_t l, g; -{ - return dodefaultroute(g, 'c'); -} - -/* - * dodefaultroute - talk to a routing socket to add/delete a default route. - */ -static int -dodefaultroute(g, cmd) - u_int32_t g; - int cmd; -{ -/* int status; */ - struct sockaddr_in address; - struct sockaddr_in netmask; - struct sockaddr_in gateway; - - memset((void *) &address, 0, sizeof(address)); - address.sin_len = sizeof address; - address.sin_family = AF_INET; - address.sin_addr.s_addr = INADDR_ANY; - - memset((void *) &netmask, 0, sizeof(netmask)); - netmask.sin_len = sizeof netmask; - netmask.sin_addr.s_addr = INADDR_ANY; - netmask.sin_family = AF_INET; - - if (cmd=='s') { - memset((void *) &gateway, 0, sizeof(gateway)); - gateway.sin_len = sizeof gateway; - gateway.sin_family = AF_INET; - gateway.sin_addr.s_addr = g; - - rtems_bsdnet_rtrequest(RTM_ADD, - (struct sockaddr *)&address, - (struct sockaddr *)&gateway, - (struct sockaddr *)&netmask, - (RTF_UP|RTF_GATEWAY|RTF_STATIC), NULL); - } - else { - memset((void *) &gateway, 0, sizeof(gateway)); - gateway.sin_len = sizeof gateway; - gateway.sin_family = AF_INET; - gateway.sin_addr.s_addr = INADDR_ANY; - - rtems_bsdnet_rtrequest(RTM_DELETE, - (struct sockaddr *)&address, - (struct sockaddr *)&gateway, - (struct sockaddr *)&netmask, - (RTF_UP|RTF_STATIC), NULL); - } - - default_route_gateway = (cmd == 's')? g: 0; - - return 1; -} - -#if RTM_VERSION >= 3 - -/* - * sifproxyarp - Make a proxy ARP entry for the peer. - */ -static struct { - struct rt_msghdr hdr; - struct sockaddr_inarp dst; - struct sockaddr_dl hwa; - char extra[128]; -} arpmsg; - -static int arpmsg_valid; - -int -sifproxyarp(unit, hisaddr) - int unit; - u_int32_t hisaddr; -{ - int routes; - - /* - * Get the hardware address of an interface on the same subnet - * as our local address. - */ - memset(&arpmsg, 0, sizeof(arpmsg)); - if (!get_ether_addr(hisaddr, &arpmsg.hwa)) { - error("Cannot determine ethernet address for proxy ARP"); - return 0; - } - - if ((routes = socket(PF_ROUTE, SOCK_RAW, AF_INET)) < 0) { - error("Couldn't add proxy arp entry: socket: %m"); - return 0; - } - - arpmsg.hdr.rtm_type = RTM_ADD; - arpmsg.hdr.rtm_flags = RTF_ANNOUNCE | RTF_HOST | RTF_STATIC; - arpmsg.hdr.rtm_version = RTM_VERSION; - arpmsg.hdr.rtm_seq = ++rtm_seq; - arpmsg.hdr.rtm_addrs = RTA_DST | RTA_GATEWAY; - arpmsg.hdr.rtm_inits = RTV_EXPIRE; - arpmsg.dst.sin_len = sizeof(struct sockaddr_inarp); - arpmsg.dst.sin_family = AF_INET; - arpmsg.dst.sin_addr.s_addr = hisaddr; - arpmsg.dst.sin_other = SIN_PROXY; - - arpmsg.hdr.rtm_msglen = (char *) &arpmsg.hwa - (char *) &arpmsg - + arpmsg.hwa.sdl_len; - if (write(routes, &arpmsg, arpmsg.hdr.rtm_msglen) < 0) { - error("Couldn't add proxy arp entry: %m"); - close(routes); - return 0; - } - - close(routes); - arpmsg_valid = 1; - proxy_arp_addr = hisaddr; - return 1; -} - -/* - * cifproxyarp - Delete the proxy ARP entry for the peer. - */ -int -cifproxyarp(unit, hisaddr) - int unit; - u_int32_t hisaddr; -{ - int routes; - - if (!arpmsg_valid) - return 0; - arpmsg_valid = 0; - - arpmsg.hdr.rtm_type = RTM_DELETE; - arpmsg.hdr.rtm_seq = ++rtm_seq; - - if ((routes = socket(PF_ROUTE, SOCK_RAW, AF_INET)) < 0) { - error("Couldn't delete proxy arp entry: socket: %m"); - return 0; - } - - if (write(routes, &arpmsg, arpmsg.hdr.rtm_msglen) < 0) { - error("Couldn't delete proxy arp entry: %m"); - close(routes); - return 0; - } - - close(routes); - proxy_arp_addr = 0; - return 1; -} - -#else /* RTM_VERSION */ - -/* - * sifproxyarp - Make a proxy ARP entry for the peer. - */ -int -sifproxyarp(unit, hisaddr) - int unit; - u_int32_t hisaddr; -{ - struct arpreq arpreq; - struct { - struct sockaddr_dl sdl; - char space[128]; - } dls; - - BZERO(&arpreq, sizeof(arpreq)); - - /* - * Get the hardware address of an interface on the same subnet - * as our local address. - */ - if (!get_ether_addr(hisaddr, &dls.sdl)) { - error("Cannot determine ethernet address for proxy ARP"); - return 0; - } - - arpreq.arp_ha.sa_len = sizeof(struct sockaddr); - arpreq.arp_ha.sa_family = AF_UNSPEC; - BCOPY(LLADDR(&dls.sdl), arpreq.arp_ha.sa_data, dls.sdl.sdl_alen); - SET_SA_FAMILY(arpreq.arp_pa, AF_INET); - ((struct sockaddr_in *) &arpreq.arp_pa)->sin_addr.s_addr = hisaddr; - arpreq.arp_flags = ATF_PERM | ATF_PUBL; - if (ioctl(sockfd, SIOCSARP, (caddr_t)&arpreq) < 0) { - error("Couldn't add proxy arp entry: %m"); - return 0; - } - - proxy_arp_addr = hisaddr; - return 1; -} - -/* - * cifproxyarp - Delete the proxy ARP entry for the peer. - */ -int -cifproxyarp(unit, hisaddr) - int unit; - u_int32_t hisaddr; -{ - struct arpreq arpreq; - - BZERO(&arpreq, sizeof(arpreq)); - SET_SA_FAMILY(arpreq.arp_pa, AF_INET); - ((struct sockaddr_in *) &arpreq.arp_pa)->sin_addr.s_addr = hisaddr; - if (ioctl(sockfd, SIOCDARP, (caddr_t)&arpreq) < 0) { - warn("Couldn't delete proxy arp entry: %m"); - return 0; - } - proxy_arp_addr = 0; - return 1; -} -#endif /* RTM_VERSION */ - - -/* - * get_ether_addr - get the hardware address of an interface on the - * the same subnet as ipaddr. - */ -#define MAX_IFS 32 - -static int -get_ether_addr(ipaddr, hwaddr) - u_int32_t ipaddr; - struct sockaddr_dl *hwaddr; -{ - struct ifreq *ifr, *ifend, *ifp; - u_int32_t ina, mask; - struct sockaddr_dl *dla; - struct ifreq ifreq; - struct ifconf ifc; - struct ifreq ifs[MAX_IFS]; - - ifc.ifc_len = sizeof(ifs); - ifc.ifc_req = ifs; - if (ioctl(sockfd, SIOCGIFCONF, &ifc) < 0) { - error("ioctl(SIOCGIFCONF): %m"); - return 0; - } - - /* - * Scan through looking for an interface with an Internet - * address on the same subnet as `ipaddr'. - */ - ifend = (struct ifreq *) (ifc.ifc_buf + ifc.ifc_len); - for (ifr = ifc.ifc_req; ifr < ifend; ifr = (struct ifreq *) - ((char *)&ifr->ifr_addr + ifr->ifr_addr.sa_len)) { - if (ifr->ifr_addr.sa_family == AF_INET) { - ina = ((struct sockaddr_in *) &ifr->ifr_addr)->sin_addr.s_addr; - strlcpy(ifreq.ifr_name, ifr->ifr_name, sizeof(ifreq.ifr_name)); - /* - * Check that the interface is up, and not point-to-point - * or loopback. - */ - if (ioctl(sockfd, SIOCGIFFLAGS, &ifreq) < 0) - continue; - if ((ifreq.ifr_flags & - (IFF_UP|IFF_BROADCAST|IFF_POINTOPOINT|IFF_LOOPBACK|IFF_NOARP)) - != (IFF_UP|IFF_BROADCAST)) - continue; - /* - * Get its netmask and check that it's on the right subnet. - */ - if (ioctl(sockfd, SIOCGIFNETMASK, &ifreq) < 0) - continue; - mask = ((struct sockaddr_in *) &ifreq.ifr_addr)->sin_addr.s_addr; - if ((ipaddr & mask) != (ina & mask)) - continue; - - break; - } - } - - if (ifr >= ifend) - return 0; - info("found interface %s for proxy arp", ifr->ifr_name); - - /* - * Now scan through again looking for a link-level address - * for this interface. - */ - ifp = ifr; - for (ifr = ifc.ifc_req; ifr < ifend; ) { - if (strcmp(ifp->ifr_name, ifr->ifr_name) == 0 - && ifr->ifr_addr.sa_family == AF_LINK) { - /* - * Found the link-level address - copy it out - */ - dla = (struct sockaddr_dl *) &ifr->ifr_addr; - BCOPY(dla, hwaddr, dla->sdl_len); - return 1; - } - ifr = (struct ifreq *) ((char *)&ifr->ifr_addr + ifr->ifr_addr.sa_len); - } - - return 0; -} - -/* - * Return user specified netmask, modified by any mask we might determine - * for address `addr' (in network byte order). - * Here we scan through the system's list of interfaces, looking for - * any non-point-to-point interfaces which might appear to be on the same - * network as `addr'. If we find any, we OR in their netmask to the - * user-specified netmask. - */ -u_int32_t -GetMask(addr) - u_int32_t addr; -{ - u_int32_t mask, nmask, ina; - struct ifreq *ifr, *ifend, ifreq; - struct ifconf ifc; - struct ifreq ifs[MAX_IFS]; - - addr = ntohl(addr); - if (IN_CLASSA(addr)) /* determine network mask for address class */ - nmask = IN_CLASSA_NET; - else if (IN_CLASSB(addr)) - nmask = IN_CLASSB_NET; - else - nmask = IN_CLASSC_NET; - /* class D nets are disallowed by bad_ip_adrs */ - mask = netmask | htonl(nmask); - - /* - * Scan through the system's network interfaces. - */ - ifc.ifc_len = sizeof(ifs); - ifc.ifc_req = ifs; - if (ioctl(sockfd, SIOCGIFCONF, &ifc) < 0) { - warn("ioctl(SIOCGIFCONF): %m"); - return mask; - } - ifend = (struct ifreq *) (ifc.ifc_buf + ifc.ifc_len); - for (ifr = ifc.ifc_req; ifr < ifend; ifr = (struct ifreq *) - ((char *)&ifr->ifr_addr + ifr->ifr_addr.sa_len)) { - /* - * Check the interface's internet address. - */ - if (ifr->ifr_addr.sa_family != AF_INET) - continue; - ina = ((struct sockaddr_in *) &ifr->ifr_addr)->sin_addr.s_addr; - if ((ntohl(ina) & nmask) != (addr & nmask)) - continue; - /* - * Check that the interface is up, and not point-to-point or loopback. - */ - strlcpy(ifreq.ifr_name, ifr->ifr_name, sizeof(ifreq.ifr_name)); - if (ioctl(sockfd, SIOCGIFFLAGS, &ifreq) < 0) - continue; - if ((ifreq.ifr_flags & (IFF_UP|IFF_POINTOPOINT|IFF_LOOPBACK)) - != IFF_UP) - continue; - /* - * Get its netmask and OR it into our mask. - */ - if (ioctl(sockfd, SIOCGIFNETMASK, &ifreq) < 0) - continue; - mask |= ((struct sockaddr_in *)&ifreq.ifr_addr)->sin_addr.s_addr; - } - - return mask; -} - -/* - * have_route_to - determine if the system has any route to - * a given IP address. - * For demand mode to work properly, we have to ignore routes - * through our own interface. - */ -int have_route_to(u_int32_t addr) -{ - return -1; -} - -/* - * Use the hostid as part of the random number seed. - */ -int -get_host_seed() -{ - return 17; -} diff --git a/cpukit/pppd/upap.c b/cpukit/pppd/upap.c deleted file mode 100644 index dc6be8a98b..0000000000 --- a/cpukit/pppd/upap.c +++ /dev/null @@ -1,638 +0,0 @@ -/* - * upap.c - User/Password Authentication Protocol. - * - * Copyright (c) 1989 Carnegie Mellon University. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by Carnegie Mellon University. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#define RCSID "$Id$" - -/* - * TODO: - */ - -#include -#include - -#include "pppd.h" -#include "upap.h" - -static const char rcsid[] = RCSID; - -static bool hide_password = 1; - -/* - * Command-line options. - */ -static option_t pap_option_list[] = { - { "hide-password", o_bool, &hide_password, - "Don't output passwords to log", 1 }, - { "show-password", o_bool, &hide_password, - "Show password string in debug log messages", 0 }, - { "pap-restart", o_int, &upap[0].us_timeouttime, - "Set retransmit timeout for PAP" }, - { "pap-max-authreq", o_int, &upap[0].us_maxtransmits, - "Set max number of transmissions for auth-reqs" }, - { "pap-timeout", o_int, &upap[0].us_reqtimeout, - "Set time limit for peer PAP authentication" }, - { NULL } -}; - -/* - * Protocol entry points. - */ -static void upap_init __P((int)); -static void upap_lowerup __P((int)); -static void upap_lowerdown __P((int)); -static void upap_input __P((int, u_char *, int)); -static void upap_protrej __P((int)); -static int upap_printpkt __P((u_char *, int, - void (*) __P((void *, char *, ...)), void *)); - -struct protent pap_protent = { - PPP_PAP, - upap_init, - upap_input, - upap_protrej, - upap_lowerup, - upap_lowerdown, - NULL, - NULL, - upap_printpkt, - NULL, - 1, - "PAP", - NULL, - pap_option_list, - NULL, - NULL, - NULL -}; - -upap_state upap[NUM_PPP]; /* UPAP state; one for each unit */ - -static void upap_timeout __P((void *)); -static void upap_reqtimeout __P((void *)); -static void upap_rauthreq __P((upap_state *, u_char *, int, int)); -static void upap_rauthack __P((upap_state *, u_char *, int, int)); -static void upap_rauthnak __P((upap_state *, u_char *, int, int)); -static void upap_sauthreq __P((upap_state *)); -static void upap_sresp __P((upap_state *, u_char, u_char, char *, int)); - - -/* - * upap_init - Initialize a UPAP unit. - */ -static void -upap_init(unit) - int unit; -{ - upap_state *u = &upap[unit]; - - u->us_unit = unit; - u->us_user = NULL; - u->us_userlen = 0; - u->us_passwd = NULL; - u->us_passwdlen = 0; - u->us_clientstate = UPAPCS_INITIAL; - u->us_serverstate = UPAPSS_INITIAL; - u->us_id = 0; - u->us_timeouttime = UPAP_DEFTIMEOUT; - u->us_maxtransmits = 10; - u->us_reqtimeout = UPAP_DEFREQTIME; -} - - -/* - * upap_authwithpeer - Authenticate us with our peer (start client). - * - * Set new state and send authenticate's. - */ -void -upap_authwithpeer(unit, user, password) - int unit; - char *user, *password; -{ - upap_state *u = &upap[unit]; - - /* Save the username and password we're given */ - u->us_user = user; - u->us_userlen = strlen(user); - u->us_passwd = password; - u->us_passwdlen = strlen(password); - u->us_transmits = 0; - - /* Lower layer up yet? */ - if (u->us_clientstate == UPAPCS_INITIAL || - u->us_clientstate == UPAPCS_PENDING) { - u->us_clientstate = UPAPCS_PENDING; - return; - } - - upap_sauthreq(u); /* Start protocol */ -} - - -/* - * upap_authpeer - Authenticate our peer (start server). - * - * Set new state. - */ -void -upap_authpeer(unit) - int unit; -{ - upap_state *u = &upap[unit]; - - /* Lower layer up yet? */ - if (u->us_serverstate == UPAPSS_INITIAL || - u->us_serverstate == UPAPSS_PENDING) { - u->us_serverstate = UPAPSS_PENDING; - return; - } - - u->us_serverstate = UPAPSS_LISTEN; - if (u->us_reqtimeout > 0) - TIMEOUT(upap_reqtimeout, u, u->us_reqtimeout); -} - - -/* - * upap_timeout - Retransmission timer for sending auth-reqs expired. - */ -static void -upap_timeout(arg) - void *arg; -{ - upap_state *u = (upap_state *) arg; - - if (u->us_clientstate != UPAPCS_AUTHREQ) - return; - - if (u->us_transmits >= u->us_maxtransmits) { - /* give up in disgust */ - error("No response to PAP authenticate-requests"); - u->us_clientstate = UPAPCS_BADAUTH; - auth_withpeer_fail(u->us_unit, PPP_PAP); - return; - } - - upap_sauthreq(u); /* Send Authenticate-Request */ -} - - -/* - * upap_reqtimeout - Give up waiting for the peer to send an auth-req. - */ -static void -upap_reqtimeout(arg) - void *arg; -{ - upap_state *u = (upap_state *) arg; - - if (u->us_serverstate != UPAPSS_LISTEN) - return; /* huh?? */ - - auth_peer_fail(u->us_unit, PPP_PAP); - u->us_serverstate = UPAPSS_BADAUTH; -} - - -/* - * upap_lowerup - The lower layer is up. - * - * Start authenticating if pending. - */ -static void -upap_lowerup(unit) - int unit; -{ - upap_state *u = &upap[unit]; - - if (u->us_clientstate == UPAPCS_INITIAL) - u->us_clientstate = UPAPCS_CLOSED; - else if (u->us_clientstate == UPAPCS_PENDING) { - upap_sauthreq(u); /* send an auth-request */ - } - - if (u->us_serverstate == UPAPSS_INITIAL) - u->us_serverstate = UPAPSS_CLOSED; - else if (u->us_serverstate == UPAPSS_PENDING) { - u->us_serverstate = UPAPSS_LISTEN; - if (u->us_reqtimeout > 0) - TIMEOUT(upap_reqtimeout, u, u->us_reqtimeout); - } -} - - -/* - * upap_lowerdown - The lower layer is down. - * - * Cancel all timeouts. - */ -static void -upap_lowerdown(unit) - int unit; -{ - upap_state *u = &upap[unit]; - - if (u->us_clientstate == UPAPCS_AUTHREQ) /* Timeout pending? */ - UNTIMEOUT(upap_timeout, u); /* Cancel timeout */ - if (u->us_serverstate == UPAPSS_LISTEN && u->us_reqtimeout > 0) - UNTIMEOUT(upap_reqtimeout, u); - - u->us_clientstate = UPAPCS_INITIAL; - u->us_serverstate = UPAPSS_INITIAL; -} - - -/* - * upap_protrej - Peer doesn't speak this protocol. - * - * This shouldn't happen. In any case, pretend lower layer went down. - */ -static void -upap_protrej(unit) - int unit; -{ - upap_state *u = &upap[unit]; - - if (u->us_clientstate == UPAPCS_AUTHREQ) { - error("PAP authentication failed due to protocol-reject"); - auth_withpeer_fail(unit, PPP_PAP); - } - if (u->us_serverstate == UPAPSS_LISTEN) { - error("PAP authentication of peer failed (protocol-reject)"); - auth_peer_fail(unit, PPP_PAP); - } - upap_lowerdown(unit); -} - - -/* - * upap_input - Input UPAP packet. - */ -static void -upap_input(unit, inpacket, l) - int unit; - u_char *inpacket; - int l; -{ - upap_state *u = &upap[unit]; - u_char *inp; - u_char code, id; - int len; - - /* - * Parse header (code, id and length). - * If packet too short, drop it. - */ - inp = inpacket; - if (l < UPAP_HEADERLEN) { - UPAPDEBUG(("pap_input: rcvd short header.")); - return; - } - GETCHAR(code, inp); - GETCHAR(id, inp); - GETSHORT(len, inp); - if (len < UPAP_HEADERLEN) { - UPAPDEBUG(("pap_input: rcvd illegal length.")); - return; - } - if (len > l) { - UPAPDEBUG(("pap_input: rcvd short packet.")); - return; - } - len -= UPAP_HEADERLEN; - - /* - * Action depends on code. - */ - switch (code) { - case UPAP_AUTHREQ: - upap_rauthreq(u, inp, id, len); - break; - - case UPAP_AUTHACK: - upap_rauthack(u, inp, id, len); - break; - - case UPAP_AUTHNAK: - upap_rauthnak(u, inp, id, len); - break; - - default: /* XXX Need code reject */ - break; - } -} - - -/* - * upap_rauth - Receive Authenticate. - */ -static void -upap_rauthreq(u, inp, id, len) - upap_state *u; - u_char *inp; - int id; - int len; -{ - u_char ruserlen, rpasswdlen; - char *ruser, *rpasswd; - int retcode; - char *msg; - int msglen; - - if (u->us_serverstate < UPAPSS_LISTEN) - return; - - /* - * If we receive a duplicate authenticate-request, we are - * supposed to return the same status as for the first request. - */ - if (u->us_serverstate == UPAPSS_OPEN) { - upap_sresp(u, UPAP_AUTHACK, id, "", 0); /* return auth-ack */ - return; - } - if (u->us_serverstate == UPAPSS_BADAUTH) { - upap_sresp(u, UPAP_AUTHNAK, id, "", 0); /* return auth-nak */ - return; - } - - /* - * Parse user/passwd. - */ - if (len < 1) { - UPAPDEBUG(("pap_rauth: rcvd short packet.")); - return; - } - GETCHAR(ruserlen, inp); - len -= sizeof (u_char) + ruserlen + sizeof (u_char); - if (len < 0) { - UPAPDEBUG(("pap_rauth: rcvd short packet.")); - return; - } - ruser = (char *) inp; - INCPTR(ruserlen, inp); - GETCHAR(rpasswdlen, inp); - if (len < rpasswdlen) { - UPAPDEBUG(("pap_rauth: rcvd short packet.")); - return; - } - rpasswd = (char *) inp; - - /* - * Check the username and password given. - */ - retcode = check_passwd(u->us_unit, ruser, ruserlen, rpasswd, - rpasswdlen, &msg); - BZERO(rpasswd, rpasswdlen); - msglen = strlen(msg); - if (msglen > 255) - msglen = 255; - - upap_sresp(u, retcode, id, msg, msglen); - - if (retcode == UPAP_AUTHACK) { - u->us_serverstate = UPAPSS_OPEN; - auth_peer_success(u->us_unit, PPP_PAP, ruser, ruserlen); - } else { - u->us_serverstate = UPAPSS_BADAUTH; - auth_peer_fail(u->us_unit, PPP_PAP); - } - - if (u->us_reqtimeout > 0) - UNTIMEOUT(upap_reqtimeout, u); -} - - -/* - * upap_rauthack - Receive Authenticate-Ack. - */ -static void -upap_rauthack(u, inp, id, len) - upap_state *u; - u_char *inp; - int id; - int len; -{ - u_char msglen; - char *msg; - - if (u->us_clientstate != UPAPCS_AUTHREQ) /* XXX */ - return; - - /* - * Parse message. - */ - if (len < 1) { - UPAPDEBUG(("pap_rauthack: ignoring missing msg-length.")); - } else { - GETCHAR(msglen, inp); - if (msglen > 0) { - len -= sizeof (u_char); - if (len < msglen) { - UPAPDEBUG(("pap_rauthack: rcvd short packet.")); - return; - } - msg = (char *) inp; - PRINTMSG(msg, msglen); - } - } - - u->us_clientstate = UPAPCS_OPEN; - - auth_withpeer_success(u->us_unit, PPP_PAP); -} - - -/* - * upap_rauthnak - Receive Authenticate-Nakk. - */ -static void -upap_rauthnak(u, inp, id, len) - upap_state *u; - u_char *inp; - int id; - int len; -{ - u_char msglen; - char *msg; - - if (u->us_clientstate != UPAPCS_AUTHREQ) /* XXX */ - return; - - /* - * Parse message. - */ - if (len < 1) { - UPAPDEBUG(("pap_rauthnak: ignoring missing msg-length.")); - } else { - GETCHAR(msglen, inp); - if (msglen > 0) { - len -= sizeof (u_char); - if (len < msglen) { - UPAPDEBUG(("pap_rauthnak: rcvd short packet.")); - return; - } - msg = (char *) inp; - PRINTMSG(msg, msglen); - } - } - - u->us_clientstate = UPAPCS_BADAUTH; - - error("PAP authentication failed"); - auth_withpeer_fail(u->us_unit, PPP_PAP); -} - - -/* - * upap_sauthreq - Send an Authenticate-Request. - */ -static void -upap_sauthreq(u) - upap_state *u; -{ - u_char *outp; - int outlen; - - outlen = UPAP_HEADERLEN + 2 * sizeof (u_char) + - u->us_userlen + u->us_passwdlen; - outp = outpacket_buf; - - MAKEHEADER(outp, PPP_PAP); - - PUTCHAR(UPAP_AUTHREQ, outp); - PUTCHAR(++u->us_id, outp); - PUTSHORT(outlen, outp); - PUTCHAR(u->us_userlen, outp); - BCOPY(u->us_user, outp, u->us_userlen); - INCPTR(u->us_userlen, outp); - PUTCHAR(u->us_passwdlen, outp); - BCOPY(u->us_passwd, outp, u->us_passwdlen); - - output(u->us_unit, outpacket_buf, outlen + PPP_HDRLEN); - - TIMEOUT(upap_timeout, u, u->us_timeouttime); - ++u->us_transmits; - u->us_clientstate = UPAPCS_AUTHREQ; -} - - -/* - * upap_sresp - Send a response (ack or nak). - */ -static void -upap_sresp(u, code, id, msg, msglen) - upap_state *u; - u_char code, id; - char *msg; - int msglen; -{ - u_char *outp; - int outlen; - - outlen = UPAP_HEADERLEN + sizeof (u_char) + msglen; - outp = outpacket_buf; - MAKEHEADER(outp, PPP_PAP); - - PUTCHAR(code, outp); - PUTCHAR(id, outp); - PUTSHORT(outlen, outp); - PUTCHAR(msglen, outp); - BCOPY(msg, outp, msglen); - output(u->us_unit, outpacket_buf, outlen + PPP_HDRLEN); -} - -/* - * upap_printpkt - print the contents of a PAP packet. - */ -static char *upap_codenames[] = { - "AuthReq", "AuthAck", "AuthNak" -}; - -static int -upap_printpkt(p, plen, printer, arg) - u_char *p; - int plen; - void (*printer) __P((void *, char *, ...)); - void *arg; -{ - int code, id, len; - int mlen, ulen, wlen; - char *user, *pwd, *msg; - u_char *pstart; - - if (plen < UPAP_HEADERLEN) - return 0; - pstart = p; - GETCHAR(code, p); - GETCHAR(id, p); - GETSHORT(len, p); - if (len < UPAP_HEADERLEN || len > plen) - return 0; - - if (code >= 1 && code <= sizeof(upap_codenames) / sizeof(char *)) - printer(arg, " %s", upap_codenames[code-1]); - else - printer(arg, " code=0x%x", code); - printer(arg, " id=0x%x", id); - len -= UPAP_HEADERLEN; - switch (code) { - case UPAP_AUTHREQ: - if (len < 1) - break; - ulen = p[0]; - if (len < ulen + 2) - break; - wlen = p[ulen + 1]; - if (len < ulen + wlen + 2) - break; - user = (char *) (p + 1); - pwd = (char *) (p + ulen + 2); - p += ulen + wlen + 2; - len -= ulen + wlen + 2; - printer(arg, " user="); - print_string(user, ulen, printer, arg); - printer(arg, " password="); - if (!hide_password) - print_string(pwd, wlen, printer, arg); - else - printer(arg, ""); - break; - case UPAP_AUTHACK: - case UPAP_AUTHNAK: - if (len < 1) - break; - mlen = p[0]; - if (len < mlen + 1) - break; - msg = (char *) (p + 1); - p += mlen + 1; - len -= mlen + 1; - printer(arg, " "); - print_string(msg, mlen, printer, arg); - break; - } - - /* print the rest of the bytes in the packet */ - for (; len > 0; --len) { - GETCHAR(code, p); - printer(arg, " %.2x", code); - } - - return p - pstart; -} diff --git a/cpukit/pppd/upap.h b/cpukit/pppd/upap.h deleted file mode 100644 index 6d5bf64026..0000000000 --- a/cpukit/pppd/upap.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * upap.h - User/Password Authentication Protocol definitions. - * - * Copyright (c) 1989 Carnegie Mellon University. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by Carnegie Mellon University. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * $Id$ - */ - -/* - * Packet header = Code, id, length. - */ -#define UPAP_HEADERLEN 4 - - -/* - * UPAP codes. - */ -#define UPAP_AUTHREQ 1 /* Authenticate-Request */ -#define UPAP_AUTHACK 2 /* Authenticate-Ack */ -#define UPAP_AUTHNAK 3 /* Authenticate-Nak */ - - -/* - * Each interface is described by upap structure. - */ -typedef struct upap_state { - int us_unit; /* Interface unit number */ - char *us_user; /* User */ - int us_userlen; /* User length */ - char *us_passwd; /* Password */ - int us_passwdlen; /* Password length */ - int us_clientstate; /* Client state */ - int us_serverstate; /* Server state */ - u_char us_id; /* Current id */ - int us_timeouttime; /* Timeout (seconds) for auth-req retrans. */ - int us_transmits; /* Number of auth-reqs sent */ - int us_maxtransmits; /* Maximum number of auth-reqs to send */ - int us_reqtimeout; /* Time to wait for auth-req from peer */ -} upap_state; - - -/* - * Client states. - */ -#define UPAPCS_INITIAL 0 /* Connection down */ -#define UPAPCS_CLOSED 1 /* Connection up, haven't requested auth */ -#define UPAPCS_PENDING 2 /* Connection down, have requested auth */ -#define UPAPCS_AUTHREQ 3 /* We've sent an Authenticate-Request */ -#define UPAPCS_OPEN 4 /* We've received an Ack */ -#define UPAPCS_BADAUTH 5 /* We've received a Nak */ - -/* - * Server states. - */ -#define UPAPSS_INITIAL 0 /* Connection down */ -#define UPAPSS_CLOSED 1 /* Connection up, haven't requested auth */ -#define UPAPSS_PENDING 2 /* Connection down, have requested auth */ -#define UPAPSS_LISTEN 3 /* Listening for an Authenticate */ -#define UPAPSS_OPEN 4 /* We've sent an Ack */ -#define UPAPSS_BADAUTH 5 /* We've sent a Nak */ - - -/* - * Timeouts. - */ -#define UPAP_DEFTIMEOUT 5 /* Timeout (seconds) for retransmitting req */ -#define UPAP_DEFREQTIME 30 /* Time to wait for auth-req from peer */ - -extern upap_state upap[]; - -void upap_authwithpeer __P((int, char *, char *)); -void upap_authpeer __P((int)); - -extern struct protent pap_protent; diff --git a/cpukit/pppd/utils.c b/cpukit/pppd/utils.c deleted file mode 100644 index b4f0e39ab2..0000000000 --- a/cpukit/pppd/utils.c +++ /dev/null @@ -1,872 +0,0 @@ -/* - * utils.c - various utility functions used in pppd. - * - * Copyright (c) 1999 The Australian National University. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the Australian National University. The name of the University - * may not be used to endorse or promote products derived from this - * software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. - */ - -#define RCSID "$Id$" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef SVR4 -#include -#endif - -#include "pppd.h" - -static const char rcsid[] = RCSID; - -#if defined(SUNOS4) -extern char *strerror(); -#endif - -static void pr_log __P((void *, char *, ...)); -static void logit __P((int, char *, va_list)); -static void vslp_printer __P((void *, char *, ...)); -static void format_packet __P((u_char *, int, void (*) (void *, char *, ...), - void *)); - -struct buffer_info { - char *ptr; - int len; -}; - -/* - * strlcpy - like strcpy/strncpy, doesn't overflow destination buffer, - * always leaves destination null-terminated (for len > 0). - */ -size_t -strlcpy(dest, src, len) - char *dest; - const char *src; - size_t len; -{ - size_t ret = strlen(src); - - if (len != 0) { - if (ret < len) - strcpy(dest, src); - else { - strncpy(dest, src, len - 1); - dest[len-1] = 0; - } - } - return ret; -} - -/* - * strlcat - like strcat/strncat, doesn't overflow destination buffer, - * always leaves destination null-terminated (for len > 0). - */ -size_t -strlcat(dest, src, len) - char *dest; - const char *src; - size_t len; -{ - size_t dlen = strlen(dest); - - return dlen + strlcpy(dest + dlen, src, (len > dlen? len - dlen: 0)); -} - - -/* - * slprintf - format a message into a buffer. Like sprintf except we - * also specify the length of the output buffer, and we handle - * %r (recursive format), %m (error message), %v (visible string), - * %q (quoted string), %t (current time) and %I (IP address) formats. - * Doesn't do floating-point formats. - * Returns the number of chars put into buf. - */ -int -slprintf __V((char *buf, int buflen, char *fmt, ...)) -{ - va_list args; - int n; - -#if defined(__STDC__) - va_start(args, fmt); -#else - char *buf; - int buflen; - char *fmt; - va_start(args); - buf = va_arg(args, char *); - buflen = va_arg(args, int); - fmt = va_arg(args, char *); -#endif - n = vslprintf(buf, buflen, fmt, args); - va_end(args); - return n; -} - -/* - * vslprintf - like slprintf, takes a va_list instead of a list of args. - */ -#define OUTCHAR(c) (buflen > 0? (--buflen, *buf++ = (c)): 0) - -int -vslprintf(buf, buflen, fmt, args) - char *buf; - int buflen; - char *fmt; - va_list args; -{ - int c, i, n; - int width, prec, fillch; - int base, len, neg, quoted; - unsigned long val = 0; - char *str, *f, *buf0; - unsigned char *p; - char num[32]; - time_t t; - u_int32_t ip; - static char hexchars[] = "0123456789abcdef"; - struct buffer_info bufinfo; - - buf0 = buf; - --buflen; - while (buflen > 0) { - for (f = fmt; *f != '%' && *f != 0; ++f) - ; - if (f > fmt) { - len = f - fmt; - if (len > buflen) - len = buflen; - memcpy(buf, fmt, len); - buf += len; - buflen -= len; - fmt = f; - } - if (*fmt == 0) - break; - c = *++fmt; - width = 0; - prec = -1; - fillch = ' '; - if (c == '0') { - fillch = '0'; - c = *++fmt; - } - if (c == '*') { - width = va_arg(args, int); - c = *++fmt; - } else { - while (isdigit(c)) { - width = width * 10 + c - '0'; - c = *++fmt; - } - } - if (c == '.') { - c = *++fmt; - if (c == '*') { - prec = va_arg(args, int); - c = *++fmt; - } else { - prec = 0; - while (isdigit(c)) { - prec = prec * 10 + c - '0'; - c = *++fmt; - } - } - } - str = 0; - base = 0; - neg = 0; - ++fmt; - switch (c) { - case 'd': - i = va_arg(args, int); - if (i < 0) { - neg = 1; - val = -i; - } else - val = i; - base = 10; - break; - case 'o': - val = va_arg(args, unsigned int); - base = 8; - break; - case 'x': - case 'X': - val = va_arg(args, unsigned int); - base = 16; - break; - case 'p': - val = (unsigned long) va_arg(args, void *); - base = 16; - neg = 2; - break; - case 's': - str = va_arg(args, char *); - break; - case 'c': - num[0] = va_arg(args, int); - num[1] = 0; - str = num; - break; - case 'm': - str = strerror(errno); - break; - case 'I': - ip = va_arg(args, u_int32_t); - ip = ntohl(ip); - slprintf(num, sizeof(num), "%d.%d.%d.%d", (ip >> 24) & 0xff, - (ip >> 16) & 0xff, (ip >> 8) & 0xff, ip & 0xff); - str = num; - break; - case 'r': - f = va_arg(args, char *); -#if !defined(__PPC__) && !defined(__i960__) - n = vslprintf(buf, buflen + 1, f, va_arg(args, va_list)); -#else - /* HACK: On the powerpc, a va_list is an array of 1 structure */ - n = vslprintf(buf, buflen + 1, f, va_arg(args, void *)); -#endif - buf += n; - buflen -= n; - continue; - case 't': - time(&t); - str = ctime(&t); - str += 4; /* chop off the day name */ - str[15] = 0; /* chop off year and newline */ - break; - case 'v': /* "visible" string */ - case 'q': /* quoted string */ - quoted = c == 'q'; - p = va_arg(args, unsigned char *); - if (fillch == '0' && prec >= 0) { - n = prec; - } else { - n = strlen((char *)p); - if (prec >= 0 && n > prec) - n = prec; - } - while (n > 0 && buflen > 0) { - c = *p++; - --n; - if (!quoted && c >= 0x80) { - OUTCHAR('M'); - OUTCHAR('-'); - c -= 0x80; - } - if (quoted && (c == '"' || c == '\\')) - OUTCHAR('\\'); - if (c < 0x20 || (0x7f <= c && c < 0xa0)) { - if (quoted) { - OUTCHAR('\\'); - switch (c) { - case '\t': OUTCHAR('t'); break; - case '\n': OUTCHAR('n'); break; - case '\b': OUTCHAR('b'); break; - case '\f': OUTCHAR('f'); break; - default: - OUTCHAR('x'); - OUTCHAR(hexchars[c >> 4]); - OUTCHAR(hexchars[c & 0xf]); - } - } else { - if (c == '\t') - OUTCHAR(c); - else { - OUTCHAR('^'); - OUTCHAR(c ^ 0x40); - } - } - } else - OUTCHAR(c); - } - continue; - case 'P': /* print PPP packet */ - bufinfo.ptr = buf; - bufinfo.len = buflen + 1; - p = va_arg(args, unsigned char *); - n = va_arg(args, int); - format_packet(p, n, vslp_printer, &bufinfo); - buf = bufinfo.ptr; - buflen = bufinfo.len - 1; - continue; - case 'B': - p = va_arg(args, unsigned char *); - for (n = prec; n > 0; --n) { - c = *p++; - if (fillch == ' ') - OUTCHAR(' '); - OUTCHAR(hexchars[(c >> 4) & 0xf]); - OUTCHAR(hexchars[c & 0xf]); - } - continue; - default: - *buf++ = '%'; - if (c != '%') - --fmt; /* so %z outputs %z etc. */ - --buflen; - continue; - } - if (base != 0) { - str = num + sizeof(num); - *--str = 0; - while (str > num + neg) { - *--str = hexchars[val % base]; - val = val / base; - if (--prec <= 0 && val == 0) - break; - } - switch (neg) { - case 1: - *--str = '-'; - break; - case 2: - *--str = 'x'; - *--str = '0'; - break; - } - len = num + sizeof(num) - 1 - str; - } else { - len = strlen(str); - if (prec >= 0 && len > prec) - len = prec; - } - if (width > 0) { - if (width > buflen) - width = buflen; - if ((n = width - len) > 0) { - buflen -= n; - for (; n > 0; --n) - *buf++ = fillch; - } - } - if (len > buflen) - len = buflen; - memcpy(buf, str, len); - buf += len; - buflen -= len; - } - *buf = 0; - return buf - buf0; -} - -/* - * vslp_printer - used in processing a %P format - */ -static void -vslp_printer __V((void *arg, char *fmt, ...)) -{ - int n; - va_list pvar; - struct buffer_info *bi; - -#if defined(__STDC__) - va_start(pvar, fmt); -#else - void *arg; - char *fmt; - va_start(pvar); - arg = va_arg(pvar, void *); - fmt = va_arg(pvar, char *); -#endif - - bi = (struct buffer_info *) arg; - n = vslprintf(bi->ptr, bi->len, fmt, pvar); - va_end(pvar); - - bi->ptr += n; - bi->len -= n; -} - -/* - * log_packet - format a packet and log it. - */ - -char line[256]; /* line to be logged accumulated here */ -char *linep; - -void -log_packet(p, len, prefix, level) - u_char *p; - int len; - char *prefix; - int level; -{ - strlcpy(line, prefix, sizeof(line)); - linep = line + strlen(line); - format_packet(p, len, pr_log, NULL); -} - -/* - * format_packet - make a readable representation of a packet, - * calling `printer(arg, format, ...)' to output it. - */ -static void -format_packet(p, len, printer, arg) - u_char *p; - int len; - void (*printer) __P((void *, char *, ...)); - void *arg; -{ - int i, n; - u_short proto; - struct protent *protp; - - if (len >= PPP_HDRLEN && p[0] == PPP_ALLSTATIONS && p[1] == PPP_UI) { - p += 2; - GETSHORT(proto, p); - len -= PPP_HDRLEN; - for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (proto == protp->protocol) - break; - if (protp != NULL) { - printer(arg, "[%s", protp->name); - n = (*protp->printpkt)(p, len, printer, arg); - printer(arg, "]"); - p += n; - len -= n; - } else { - for (i = 0; (protp = protocols[i]) != NULL; ++i) - if (proto == (protp->protocol & ~0x8000)) - break; - if (protp != 0 && protp->data_name != 0) { - printer(arg, "[%s data]", protp->data_name); - if (len > 8) - printer(arg, "%.8B ...", p); - else - printer(arg, "%.*B", len, p); - len = 0; - } else - printer(arg, "[proto=0x%x]", proto); - } - } - - if (len > 32) - printer(arg, "%.32B ...", p); - else - printer(arg, "%.*B", len, p); -} - -static void -pr_log __V((void *arg, char *fmt, ...)) -{ - int n; - va_list pvar; - char buf[256]; - -#if defined(__STDC__) - va_start(pvar, fmt); -#else - void *arg; - char *fmt; - va_start(pvar); - arg = va_arg(pvar, void *); - fmt = va_arg(pvar, char *); -#endif - - n = vslprintf(buf, sizeof(buf), fmt, pvar); - va_end(pvar); - - if (linep + n + 1 > line + sizeof(line)) { - linep = line; - } - strlcpy(linep, buf, line + sizeof(line) - linep); - linep += n; -} - -/* - * print_string - print a readable representation of a string using - * printer. - */ -void -print_string(p, len, printer, arg) - char *p; - int len; - void (*printer) __P((void *, char *, ...)); - void *arg; -{ - int c; - - printer(arg, "\""); - for (; len > 0; --len) { - c = *p++; - if (' ' <= c && c <= '~') { - if (c == '\\' || c == '"') - printer(arg, "\\"); - printer(arg, "%c", c); - } else { - switch (c) { - case '\n': - printer(arg, "\\n"); - break; - case '\r': - printer(arg, "\\r"); - break; - case '\t': - printer(arg, "\\t"); - break; - default: - printer(arg, "\\%.3o", c); - } - } - } - printer(arg, "\""); -} - -/* - * logit - does the hard work for fatal et al. - */ -static void -logit(level, fmt, args) - int level; - char *fmt; - va_list args; -{ - int n; - char buf[256]; - - n = vslprintf(buf, sizeof(buf), fmt, args); -/* if (log_to_fd >= 0 && (level != LOG_DEBUG || debug)) { */ - if (log_to_fd >= 0 && (debug)) { - if (buf[n-1] != '\n') - buf[n++] = '\n'; - if (write(log_to_fd, buf, n) != n) - log_to_fd = -1; - } -} - -/* - * fatal - log an error message and die horribly. - */ -void -pppd_fatal __V((char *fmt, ...)) -{ - va_list pvar; - -#if defined(__STDC__) - va_start(pvar, fmt); -#else - char *fmt; - va_start(pvar); - fmt = va_arg(pvar, char *); -#endif - - logit(LOG_ERR, fmt, pvar); - va_end(pvar); - - die(1); /* as promised */ -} - -/* - * error - log an error message. - */ -void -pppd_error __V((char *fmt, ...)) -{ - va_list pvar; - -#if defined(__STDC__) - va_start(pvar, fmt); -#else - char *fmt; - va_start(pvar); - fmt = va_arg(pvar, char *); -#endif - - logit(LOG_ERR, fmt, pvar); - va_end(pvar); -} - -/* - * warn - log a warning message. - */ -void -pppd_warn __V((char *fmt, ...)) -{ - va_list pvar; - -#if defined(__STDC__) - va_start(pvar, fmt); -#else - char *fmt; - va_start(pvar); - fmt = va_arg(pvar, char *); -#endif - - logit(LOG_WARNING, fmt, pvar); - va_end(pvar); -} - -/* - * notice - log a notice-level message. - */ -void -pppd_notice __V((char *fmt, ...)) -{ - va_list pvar; - -#if defined(__STDC__) - va_start(pvar, fmt); -#else - char *fmt; - va_start(pvar); - fmt = va_arg(pvar, char *); -#endif - - logit(LOG_NOTICE, fmt, pvar); - va_end(pvar); -} - -/* - * info - log an informational message. - */ -void -pppd_info __V((char *fmt, ...)) -{ - va_list pvar; - -#if defined(__STDC__) - va_start(pvar, fmt); -#else - char *fmt; - va_start(pvar); - fmt = va_arg(pvar, char *); -#endif - - logit(LOG_INFO, fmt, pvar); - va_end(pvar); -} - -/* - * dbglog - log a debug message. - */ -void -pppd_dbglog __V((char *fmt, ...)) -{ - va_list pvar; - -#if defined(__STDC__) - va_start(pvar, fmt); -#else - char *fmt; - va_start(pvar); - fmt = va_arg(pvar, char *); -#endif - - logit(LOG_DEBUG, fmt, pvar); - va_end(pvar); -} - -/* Procedures for locking the serial device using a lock file. */ -#ifndef LOCK_DIR -#ifdef _linux_ -#define LOCK_DIR "/var/lock" -#else -#ifdef SVR4 -#define LOCK_DIR "/var/spool/locks" -#else -#define LOCK_DIR "/var/spool/lock" -#endif -#endif -#endif /* LOCK_DIR */ - -static char lock_file[MAXPATHLEN]; - -/* - * lock - create a lock file for the named device - */ -int -lock(dev) - char *dev; -{ -#ifdef LOCKLIB - int result; - - result = mklock (dev, (void *) 0); - if (result == 0) { - strlcpy(lock_file, sizeof(lock_file), dev); - return 0; - } - - if (result > 0) - notice("Device %s is locked by pid %d", dev, result); - else - error("Can't create lock file %s", lock_file); - return -1; - -#else /* LOCKLIB */ - - char lock_buffer[12]; - int fd, pid, n; - -#ifdef SVR4 - struct stat sbuf; - - if (stat(dev, &sbuf) < 0) { - error("Can't get device number for %s: %m", dev); - return -1; - } - if ((sbuf.st_mode & S_IFMT) != S_IFCHR) { - error("Can't lock %s: not a character device", dev); - return -1; - } - slprintf(lock_file, sizeof(lock_file), "%s/LK.%03d.%03d.%03d", - LOCK_DIR, major(sbuf.st_dev), - major(sbuf.st_rdev), minor(sbuf.st_rdev)); -#else - char *p; - - if ((p = strrchr(dev, '/')) != NULL) - dev = p + 1; - slprintf(lock_file, sizeof(lock_file), "%s/LCK..%s", LOCK_DIR, dev); -#endif - - while ((fd = open(lock_file, O_EXCL | O_CREAT | O_RDWR, 0644)) < 0) { - if (errno != EEXIST) { - error("Can't create lock file %s: %m", lock_file); - break; - } - - /* Read the lock file to find out who has the device locked. */ - fd = open(lock_file, O_RDONLY, 0); - if (fd < 0) { - if (errno == ENOENT) /* This is just a timing problem. */ - continue; - error("Can't open existing lock file %s: %m", lock_file); - break; - } -#ifndef LOCK_BINARY - n = read(fd, lock_buffer, 11); -#else - n = read(fd, &pid, sizeof(pid)); -#endif /* LOCK_BINARY */ - close(fd); - fd = -1; - if (n <= 0) { - error("Can't read pid from lock file %s", lock_file); - break; - } - - /* See if the process still exists. */ -#ifndef LOCK_BINARY - lock_buffer[n] = 0; - pid = atoi(lock_buffer); -#endif /* LOCK_BINARY */ - if (pid == getpid()) - return 1; /* somebody else locked it for us */ - if (pid == 0 - || (kill(pid, 0) == -1 && errno == ESRCH)) { - if (unlink (lock_file) == 0) { - notice("Removed stale lock on %s (pid %d)", dev, pid); - continue; - } - warn("Couldn't remove stale lock on %s", dev); - } else - notice("Device %s is locked by pid %d", dev, pid); - break; - } - - if (fd < 0) { - lock_file[0] = 0; - return -1; - } - - pid = getpid(); -#ifndef LOCK_BINARY - slprintf(lock_buffer, sizeof(lock_buffer), "%10d\n", pid); - write (fd, lock_buffer, 11); -#else - write(fd, &pid, sizeof (pid)); -#endif - close(fd); - return 0; - -#endif -} - -/* - * relock - called to update our lockfile when we are about to detach, - * thus changing our pid (we fork, the child carries on, and the parent dies). - * Note that this is called by the parent, with pid equal to the pid - * of the child. This avoids a potential race which would exist if - * we had the child rewrite the lockfile (the parent might die first, - * and another process could think the lock was stale if it checked - * between when the parent died and the child rewrote the lockfile). - */ -int -relock(pid) - int pid; -{ -#ifdef LOCKLIB - /* XXX is there a way to do this? */ - return -1; -#else /* LOCKLIB */ - - int fd; - char lock_buffer[12]; - - if (lock_file[0] == 0) - return -1; - fd = open(lock_file, O_WRONLY, 0); - if (fd < 0) { - error("Couldn't reopen lock file %s: %m", lock_file); - lock_file[0] = 0; - return -1; - } - -#ifndef LOCK_BINARY - slprintf(lock_buffer, sizeof(lock_buffer), "%10d\n", pid); - write (fd, lock_buffer, 11); -#else - write(fd, &pid, sizeof(pid)); -#endif /* LOCK_BINARY */ - close(fd); - return 0; - -#endif /* LOCKLIB */ -} - -/* - * unlock - remove our lockfile - */ -void -unlock() -{ - if (lock_file[0]) { -#ifdef LOCKLIB - (void) rmlock(lock_file, (void *) 0); -#else - unlink(lock_file); -#endif - lock_file[0] = 0; - } -} - diff --git a/cpukit/rtems/src/clocktodtoseconds.c b/cpukit/rtems/src/clocktodtoseconds.c deleted file mode 100644 index 16e9d24a1e..0000000000 --- a/cpukit/rtems/src/clocktodtoseconds.c +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Time of Day (TOD) Handler - * - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include -#include -#include -#include - -/*PAGE - * - * _TOD_To_seconds - * - * This routine returns the seconds from the epoch until the - * current date and time. - * - * Input parameters: - * the_tod - pointer to the time and date structure - * - * Output parameters: - * returns - seconds since epoch until the_tod - */ - -unsigned32 _TOD_To_seconds( - TOD_Control *the_tod -) -{ - unsigned32 time; - unsigned32 year_mod_4; - - time = the_tod->day - 1; - year_mod_4 = the_tod->year & 3; - - if ( year_mod_4 == 0 ) - time += _TOD_Days_to_date[ 1 ][ the_tod->month ]; - else - time += _TOD_Days_to_date[ 0 ][ the_tod->month ]; - - time += ( (the_tod->year - TOD_BASE_YEAR) / 4 ) * - ( (TOD_DAYS_PER_YEAR * 4) + 1); - - time += _TOD_Days_since_last_leap_year[ year_mod_4 ]; - - time *= TOD_SECONDS_PER_DAY; - - time += ((the_tod->hour * TOD_MINUTES_PER_HOUR) + the_tod->minute) - * TOD_SECONDS_PER_MINUTE; - - time += the_tod->second; - - return( time ); -} - diff --git a/cpukit/rtems/src/clocktodvalidate.c b/cpukit/rtems/src/clocktodvalidate.c deleted file mode 100644 index 18f377e500..0000000000 --- a/cpukit/rtems/src/clocktodvalidate.c +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Time of Day (TOD) Handler - * - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include -#include -#include -#include - -/*PAGE - * - * _TOD_Validate - * - * This kernel routine checks the validity of a date and time structure. - * - * Input parameters: - * the_tod - pointer to a time and date structure - * - * Output parameters: - * TRUE - if the date, time, and tick are valid - * FALSE - if the the_tod is invalid - * - * NOTE: This routine only works for leap-years through 2099. - */ - -boolean _TOD_Validate( - TOD_Control *the_tod -) -{ - unsigned32 days_in_month; - - if ((the_tod->ticks >= _TOD_Ticks_per_second) || - (the_tod->second >= TOD_SECONDS_PER_MINUTE) || - (the_tod->minute >= TOD_MINUTES_PER_HOUR) || - (the_tod->hour >= TOD_HOURS_PER_DAY) || - (the_tod->month == 0) || - (the_tod->month > TOD_MONTHS_PER_YEAR) || - (the_tod->year < TOD_BASE_YEAR) || - (the_tod->day == 0) ) - return FALSE; - - if ( (the_tod->year % 4) == 0 ) - days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; - else - days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; - - if ( the_tod->day > days_in_month ) - return FALSE; - - return TRUE; -} - diff --git a/cpukit/score/cpu/arm/rtems/asm.h b/cpukit/score/cpu/arm/rtems/asm.h deleted file mode 100644 index b974287b45..0000000000 --- a/cpukit/score/cpu/arm/rtems/asm.h +++ /dev/null @@ -1,125 +0,0 @@ -/* asm.h - * - * This include file attempts to address the problems - * caused by incompatible flavors of assemblers and - * toolsets. It primarily addresses variations in the - * use of leading underscores on symbols and the requirement - * that register names be preceded by a %. - * - * - * NOTE: The spacing in the use of these macros - * is critical to them working as advertised. - * - * COPYRIGHT: - * - * This file is based on similar code found in newlib available - * from ftp.cygnus.com. The file which was used had no copyright - * notice. This file is freely distributable as long as the source - * of the file is noted. This file is: - * - * COPYRIGHT (c) 2000 Canon Research Centre France SA. - * Emmanuel Raguet, mailto:raguet@crf.canon.fr - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - */ - -#ifndef __ARM_ASM_h -#define __ARM_ASM_h - -/* - * Indicate we are in an assembly file and get the basic CPU definitions. - */ - -#ifndef ASM -#define ASM -#endif -#include -#include - -/* - * Recent versions of GNU cpp define variables which indicate the - * need for underscores and percents. If not using GNU cpp or - * the version does not support this, then you will obviously - * have to define these as appropriate. - */ - -#ifndef __USER_LABEL_PREFIX__ -#define __USER_LABEL_PREFIX__ _ -#endif - -#ifndef __REGISTER_PREFIX__ -#define __REGISTER_PREFIX__ -#endif - -/* ANSI concatenation macros. */ - -#define CONCAT1(a, b) CONCAT2(a, b) -#define CONCAT2(a, b) a ## b - -/* Use the right prefix for global labels. */ - -#define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x) - -/* Use the right prefix for registers. */ - -#define REG(x) CONCAT1 (__REGISTER_PREFIX__, x) - -/* - * define macros for all of the registers on this CPU - * - * EXAMPLE: #define d0 REG (d0) - */ - -#define r0 REG(r0) -#define r1 REG(r1) -#define r2 REG(r2) -#define r3 REG(r3) -#define r4 REG(r4) -#define r5 REG(r5) -#define r6 REG(r6) -#define r7 REG(r7) -#define r8 REG(r8) -#define r9 REG(r9) -#define r10 REG(r10) -#define r11 REG(r11) -#define r12 REG(r12) -#define r13 REG(r13) -#define r14 REG(r14) -#define r15 REG(r15) - -#define CPSR REG(CPSR) - -#define SPSR REG(SPSR) - -/* - * Define macros to handle section beginning and ends. - */ - - -#define BEGIN_CODE_DCL .text -#define END_CODE_DCL -#define BEGIN_DATA_DCL .data -#define END_DATA_DCL -#define BEGIN_CODE .text -#define END_CODE -#define BEGIN_DATA -#define END_DATA -#define BEGIN_BSS -#define END_BSS -#define END - -/* - * Following must be tailor for a particular flavor of the C compiler. - * They may need to put underscores in front of the symbols. - */ - -#define PUBLIC(sym) .globl SYM (sym) -#define EXTERN(sym) .globl SYM (sym) - -#endif -/* end of include file */ - - diff --git a/cpukit/score/cpu/c4x/rtems/asm.h b/cpukit/score/cpu/c4x/rtems/asm.h deleted file mode 100644 index 24f9c5e391..0000000000 --- a/cpukit/score/cpu/c4x/rtems/asm.h +++ /dev/null @@ -1,101 +0,0 @@ -/* asm.h - * - * This include file attempts to address the problems - * caused by incompatible flavors of assemblers and - * toolsets. It primarily addresses variations in the - * use of leading underscores on symbols and the requirement - * that register names be preceded by a %. - * - * - * NOTE: The spacing in the use of these macros - * is critical to them working as advertised. - * - * COPYRIGHT: - * - * This file is based on similar code found in newlib available - * from ftp.cygnus.com. The file which was used had no copyright - * notice. This file is freely distributable as long as the source - * of the file is noted. This file is: - * - * COPYRIGHT (c) 1994-1997. - * On-Line Applications Research Corporation (OAR). - * - * $Id$ - */ - -#ifndef __C4X_ASM_h -#define __C4X_ASM_h - -/* - * Indicate we are in an assembly file and get the basic CPU definitions. - */ - -#ifndef ASM -#define ASM -#endif -#include -#include - -/* - * Recent versions of GNU cpp define variables which indicate the - * need for underscores and percents. If not using GNU cpp or - * the version does not support this, then you will obviously - * have to define these as appropriate. - */ - -#ifndef __USER_LABEL_PREFIX__ -#define __USER_LABEL_PREFIX__ _ -#endif - -#ifndef __REGISTER_PREFIX__ -#define __REGISTER_PREFIX__ -#endif - -/* ANSI concatenation macros. */ - -#define CONCAT1(a, b) CONCAT2(a, b) -#define CONCAT2(a, b) a ## b - -/* Use the right prefix for global labels. */ - -#define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x) - -/* Use the right prefix for registers. */ - -#define REG(x) CONCAT1 (__REGISTER_PREFIX__, x) - -/* - * define macros for all of the registers on this CPU - * - * EXAMPLE: #define d0 REG (d0) - */ - -/* - * Define macros to handle section beginning and ends. - */ - - -#define BEGIN_CODE_DCL .text -#define END_CODE_DCL -#define BEGIN_DATA_DCL .data -#define END_DATA_DCL -#define BEGIN_CODE .text -#define END_CODE -#define BEGIN_DATA -#define END_DATA -#define BEGIN_BSS -#define END_BSS -#define END - -/* - * Following must be tailor for a particular flavor of the C compiler. - * They may need to put underscores in front of the symbols. - */ - -#define PUBLIC(sym) .globl SYM (sym) -#define EXTERN(sym) .globl SYM (sym) - -#endif -/* end of include file */ - - diff --git a/cpukit/score/cpu/c4x/rtems/tic4x/c4xio.h b/cpukit/score/cpu/c4x/rtems/tic4x/c4xio.h deleted file mode 100644 index f85f461ebc..0000000000 --- a/cpukit/score/cpu/c4x/rtems/tic4x/c4xio.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - * C4X IO Information - * - * $Id$ - */ - -#ifndef __C4XIO_h -#define __C4XIO_h - -/* - * Address defines - */ - -#ifdef _TMS320C40 -#define C4X_TIMER_0 ((struct c4x_timer*)0x100020) -#else -#define C4X_TIMER_0 ((struct c4x_timer*)0x808020) -#define C4X_TIMER_1 ((struct c4x_timer*)0x808030) -#endif - -/* XXX how portable */ - -/* C32 Internal Control Registers */ -#define C4X_STRB0_REG 0x808064 -#define C4X_STRB1_REG 0x808068 -#define C4X_IOSTRB_REG 0x808060 - -/* C32 Internal RAM Locations */ -/* XXX how long */ -#define C4X_RAM_BLK_0 0x87fe00 -#define C4X_RAM_BLK_1 0x87ff00 - -/* - * Data Structures to Overlay the Peripherals on the CPU - */ - -struct c4x_timer { - volatile int tcontrol; - volatile int r1[3]; - volatile int tcounter; - volatile int r2[3]; - volatile int tperiod; -}; - - - - -/* - * Timer Support Routines - * - * The following section of C4x timer code is based on C40 specific - * timer code from Ran Cabell . The - * only C3x/C4x difference spotted was the address of the timer. - * The names have been changed to be more RTEMS like. - */ - -#define c4x_timer_get_control( _timer ) (volatile int)(_timer->tcontrol) - -#define c4x_timer_set_control( _timer, _value ) \ - do { \ - (volatile int)(_timer->tcontrol) = _value; \ - } while (0); - -#define c4x_timer_start( _timer ) \ - c4x_timer_set_control(_timer, 0x02c1 ) - -#define c4x_timer_stop( _timer ) _timer->tcontrol = 0 - -#define c4x_timer_get_counter( _timer ) (volatile int)(_timer->tcounter) - -#define c4x_timer_set_counter( _timer, _value ) \ - do { \ - (volatile int)(_timer->tcounter) = _value; \ - } while (0); - -#define c4x_timer_get_period( _timer ) (volatile int)(_timer->tperiod) - -#define c4x_timer_set_period( _timer, _value ) \ - do { \ - (volatile int)(_timer->tperiod) = _value; \ - } while (0); - -/* - * IO Flags - * - * NOTE: iof on c3x, iiof on c4x - */ - -#ifdef _TMS320C40 - -#else - -static inline unsigned32 c3x_get_iof( void ) -{ - register unsigned32 iof_value; - - __asm__ volatile ("ldi iof, %0" : "=r" (iof_value)); - return iof_value; -} - -static inline void c3x_set_iof( unsigned32 value ) -{ - __asm__ volatile ("ldi %0,iof" : : "g" (value) : "iof", "cc"); -} - -#endif - - -#endif -/* end if include file */ diff --git a/cpukit/score/cpu/h8300/rtems/asm.h b/cpukit/score/cpu/h8300/rtems/asm.h deleted file mode 100644 index ecd858f968..0000000000 --- a/cpukit/score/cpu/h8300/rtems/asm.h +++ /dev/null @@ -1,123 +0,0 @@ -/* asm.h - * - * This include file attempts to address the problems - * caused by incompatible flavors of assemblers and - * toolsets. It primarily addresses variations in the - * use of leading underscores on symbols and the requirement - * that register names be preceded by a %. - * - * - * NOTE: The spacing in the use of these macros - * is critical to them working as advertised. - * - * COPYRIGHT: - * - * This file is based on similar code found in newlib available - * from ftp.cygnus.com. The file which was used had no copyright - * notice. This file is freely distributable as long as the source - * of the file is noted. This file is: - * - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#ifndef __H8300_CPU_ASM_h -#define __H8300_CPU_ASM_h - -/* - * Indicate we are in an assembly file and get the basic CPU definitions. - */ - -#define ASM -#include - -/* - * Recent versions of GNU cpp define variables which indicate the - * need for underscores and percents. If not using GNU cpp or - * the version does not support this, then you will obviously - * have to define these as appropriate. - */ - -#ifndef __USER_LABEL_PREFIX__ -#define __USER_LABEL_PREFIX__ _ -#endif - -#ifndef __REGISTER_PREFIX__ -#define __REGISTER_PREFIX__ -#endif - -/* ANSI concatenation macros. */ - -#define CONCAT1(a, b) CONCAT2(a, b) -#define CONCAT2(a, b) a ## b - -/* Use the right prefix for global labels. */ - -#define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x) - -/* Use the right prefix for registers. */ - -#define REG(x) CONCAT1 (__REGISTER_PREFIX__, x) - -/* - * define macros for all of the registers on this CPU - * - * EXAMPLE: #define d0 REG (d0) - */ -#define r0 REG(r0) -#define r1 REG(r1) -#define r2 REG(r2) -#define r3 REG(r3) -#define r4 REG(r4) -#define r5 REG(r5) -#define r6 REG(r6) -#define r7 REG(r7) - -#define er0 REG(er0) -#define er1 REG(er1) -#define er2 REG(er2) -#define er3 REG(er3) -#define er4 REG(er4) -#define er5 REG(er5) -#define er6 REG(er6) -#define er7 REG(er7) - -#define sp REG(sp) - -/* - * Define macros to handle section beginning and ends. - */ - - -#define BEGIN_CODE_DCL .text -#define END_CODE_DCL -#define BEGIN_DATA_DCL .data -#define END_DATA_DCL -#define BEGIN_CODE asm ( ".text -#define END_CODE "); -#define BEGIN_DATA -#define END_DATA -#define BEGIN_BSS -#define END_BSS -#define END - -/* - * Following must be tailor for a particular flavor of the C compiler. - * They may need to put underscores in front of the symbols. - */ - -#define PUBLIC(sym) .globl SYM (sym) -#define EXTERN(sym) .globl SYM (sym) - -#endif -/* end of include file */ - - asm( \".h8300h\" ); - diff --git a/cpukit/score/cpu/i386/rtems/asm.h b/cpukit/score/cpu/i386/rtems/asm.h deleted file mode 100644 index f1981791a3..0000000000 --- a/cpukit/score/cpu/i386/rtems/asm.h +++ /dev/null @@ -1,138 +0,0 @@ -/* asm.h - * - * This include file attempts to address the problems - * caused by incompatible flavors of assemblers and - * toolsets. It primarily addresses variations in the - * use of leading underscores on symbols and the requirement - * that register names be preceded by a %. - * - * - * NOTE: The spacing in the use of these macros - * is critical to them working as advertised. - * - * COPYRIGHT: - * - * This file is based on similar code found in newlib available - * from ftp.cygnus.com. The file which was used had no copyright - * notice. This file is freely distributable as long as the source - * of the file is noted. This file is: - * - * COPYRIGHT (c) 1994-1997. - * On-Line Applications Research Corporation (OAR). - * - * $Id$ - */ - -#ifndef __i386_ASM_h -#define __i386_ASM_h - -/* - * Indicate we are in an assembly file and get the basic CPU definitions. - */ - -#ifndef ASM -#define ASM -#endif -#include -#include - -/* - * Recent versions of GNU cpp define variables which indicate the - * need for underscores and percents. If not using GNU cpp or - * the version does not support this, then you will obviously - * have to define these as appropriate. - */ - -/* - * Looks like there is a bug in gcc 2.6.2 where this is not - * defined correctly when configured as i386-coff and - * i386-aout. - */ - -#undef __REGISTER_PREFIX__ -#define __REGISTER_PREFIX__ % - -/* -#ifndef __REGISTER_PREFIX__ -#define __REGISTER_PREFIX__ -#endif -*/ - -/* ANSI concatenation macros. */ - -#define CONCAT1(a, b) CONCAT2(a, b) -#define CONCAT2(a, b) a ## b - -/* Use the right prefix for global labels. */ - -#define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x) - -/* Use the right prefix for registers. */ - -#define REG(x) CONCAT1 (__REGISTER_PREFIX__, x) - -#define eax REG (eax) -#define ebx REG (ebx) -#define ecx REG (ecx) -#define edx REG (edx) -#define esi REG (esi) -#define edi REG (edi) -#define esp REG (esp) -#define ebp REG (ebp) -#define cr0 REG (cr0) - -#define ax REG (ax) -#define bx REG (bx) -#define cx REG (cx) -#define dx REG (dx) -#define si REG (si) -#define di REG (di) -#define sp REG (sp) -#define bp REG (bp) - -#define ah REG (ah) -#define bh REG (bh) -#define ch REG (ch) -#define dh REG (dh) - -#define al REG (al) -#define bl REG (bl) -#define cl REG (cl) -#define dl REG (dl) - -#define cs REG (cs) -#define ds REG (ds) -#define es REG (es) -#define fs REG (fs) -#define gs REG (gs) -#define ss REG (ss) - -/* - * Define macros to handle section beginning and ends. - */ - - -#define BEGIN_CODE_DCL .text -#define END_CODE_DCL -#define BEGIN_DATA_DCL .data -#define END_DATA_DCL -#define BEGIN_CODE .text -#define END_CODE -#define BEGIN_DATA .data -#define END_DATA -#define BEGIN_BSS .bss -#define END_BSS -#define END - -/* - * Following must be tailor for a particular flavor of the C compiler. - * They may need to put underscores in front of the symbols. - */ - -#define PUBLIC(sym) .globl SYM (sym) -#define EXTERN(sym) .globl SYM (sym) - -#endif -/* end of include file */ - - diff --git a/cpukit/score/cpu/m68k/rtems/asm.h b/cpukit/score/cpu/m68k/rtems/asm.h deleted file mode 100644 index 6c388fb396..0000000000 --- a/cpukit/score/cpu/m68k/rtems/asm.h +++ /dev/null @@ -1,144 +0,0 @@ -/* asm.h - * - * This include file attempts to address the problems - * caused by incompatible flavors of assemblers and - * toolsets. It primarily addresses variations in the - * use of leading underscores on symbols and the requirement - * that register names be preceded by a %. - * - * - * NOTE: The spacing in the use of these macros - * is critical to them working as advertised. - * - * COPYRIGHT: - * - * This file is based on similar code found in newlib available - * from ftp.cygnus.com. The file which was used had no copyright - * notice. This file is freely distributable as long as the source - * of the file is noted. This file is: - * - * COPYRIGHT (c) 1994-1997. - * On-Line Applications Research Corporation (OAR). - * - * $Id$ - */ - -#ifndef __M68k_ASM_h -#define __M68k_ASM_h - -/* - * Indicate we are in an assembly file and get the basic CPU definitions. - */ - -#ifndef ASM -#define ASM -#endif -#include -#include - -/* - * Recent versions of GNU cpp define variables which indicate the - * need for underscores and percents. If not using GNU cpp or - * the version does not support this, then you will obviously - * have to define these as appropriate. - */ - -#ifndef __USER_LABEL_PREFIX__ -#define __USER_LABEL_PREFIX__ _ -#endif - -#ifndef __REGISTER_PREFIX__ -#define __REGISTER_PREFIX__ -#endif - -/* ANSI concatenation macros. */ - -#define CONCAT1(a, b) CONCAT2(a, b) -#define CONCAT2(a, b) a ## b - -/* Use the right prefix for global labels. */ - -#define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x) - -/* Use the right prefix for registers. */ - -#define REG(x) CONCAT1 (__REGISTER_PREFIX__, x) - -#define d0 REG (d0) -#define d1 REG (d1) -#define d2 REG (d2) -#define d3 REG (d3) -#define d4 REG (d4) -#define d5 REG (d5) -#define d6 REG (d6) -#define d7 REG (d7) -#define a0 REG (a0) -#define a1 REG (a1) -#define a2 REG (a2) -#define a3 REG (a3) -#define a4 REG (a4) -#define a5 REG (a5) -#define a6 REG (a6) -#define a7 REG (a7) -#define sp REG (sp) - -#define msp REG (msp) -#define usp REG (usp) -#define isp REG (isp) -#define sr REG (sr) -#define vbr REG (vbr) -#define dfc REG (dfc) -#define sfc REG (sfc) - -/* mcf52xx special regs */ -#define cacr REG (cacr) -#define acr0 REG (acr0) -#define acr1 REG (acr1) -#define rambar0 REG (rambar0) -#define mbar REG (mbar) - - -#define fp0 REG (fp0) -#define fp1 REG (fp1) -#define fp2 REG (fp2) -#define fp3 REG (fp3) -#define fp4 REG (fp4) -#define fp5 REG (fp5) -#define fp6 REG (fp6) -#define fp7 REG (fp7) - -#define fpc REG (fpc) -#define fpi REG (fpi) -#define fps REG (fps) -#define fpsr REG (fpsr) - - -/* - * Define macros to handle section beginning and ends. - */ - - -#define BEGIN_CODE_DCL .text -#define END_CODE_DCL -#define BEGIN_DATA_DCL .data -#define END_DATA_DCL -#define BEGIN_CODE .text -#define END_CODE -#define BEGIN_DATA .data -#define END_DATA -#define BEGIN_BSS .bss -#define END_BSS -#define END - -/* - * Following must be tailor for a particular flavor of the C compiler. - * They may need to put underscores in front of the symbols. - */ - -#define PUBLIC(sym) .globl SYM (sym) -#define EXTERN(sym) .globl SYM (sym) - -#endif -/* end of include file */ - - diff --git a/cpukit/score/cpu/m68k/rtems/m68k/m68302.h b/cpukit/score/cpu/m68k/rtems/m68k/m68302.h deleted file mode 100644 index c4bd0a5586..0000000000 --- a/cpukit/score/cpu/m68k/rtems/m68k/m68302.h +++ /dev/null @@ -1,661 +0,0 @@ -/* - *------------------------------------------------------------------ - * - * m68302.h - Definitions for Motorola MC68302 processor. - * - * Section references in this file refer to revision 2 of Motorola's - * "MC68302 Integrated Multiprotocol Processor User's Manual". - * (Motorola document MC68302UM/AD REV 2.) - * - * Based on Don Meyer's cpu68302.h that was posted in comp.sys.m68k - * on 17 February, 1993. - * - * Copyright 1995 David W. Glessner. - * - * Redistribution and use in source and binary forms are permitted - * provided that the following conditions are met: - * 1. Redistribution of source code and documentation must retain - * the above copyright notice, this list of conditions and the - * following disclaimer. - * 2. The name of the author may not be used to endorse or promote - * products derived from this software without specific prior - * written permission. - * - * This software is provided "AS IS" without warranty of any kind, - * either expressed or implied, including, but not limited to, the - * implied warranties of merchantability, title and fitness for a - * particular purpose. - * - * - * $Id$ - * - *------------------------------------------------------------------ - */ - -#ifndef __MOTOROLA_MC68302_DEFINITIONS_h -#define __MOTOROLA_MC68302_DEFINITIONS_h - -/* - * BAR - Base Address Register - * Section 2.7 - */ -#define M302_BAR (*((volatile rtems_unsigned16 *) 0xf2)) - -/* - * SCR - System Control Register - * Section 3.8.1 - */ -#define M302_SCR (*((volatile rtems_unsigned32 *) 0xf4)) -/* - * SCR bits - */ -#define RBIT_SCR_IPA 0x08000000 -#define RBIT_SCR_HWT 0x04000000 -#define RBIT_SCR_WPV 0x02000000 -#define RBIT_SCR_ADC 0x01000000 - -#define RBIT_SCR_ERRE 0x00400000 -#define RBIT_SCR_VGE 0x00200000 -#define RBIT_SCR_WPVE 0x00100000 -#define RBIT_SCR_RMCST 0x00080000 -#define RBIT_SCR_EMWS 0x00040000 -#define RBIT_SCR_ADCE 0x00020000 -#define RBIT_SCR_BCLM 0x00010000 - -#define RBIT_SCR_FRZW 0x00008000 -#define RBIT_SCR_FRZ2 0x00004000 -#define RBIT_SCR_FRZ1 0x00002000 -#define RBIT_SCR_SAM 0x00001000 -#define RBIT_SCR_HWDEN 0x00000800 -#define RBIT_SCR_HWDCN2 0x00000400 -#define RBIT_SCR_HWDCN1 0x00000200 /* 512 clocks */ -#define RBIT_SCR_HWDCN0 0x00000100 /* 128 clocks */ - -#define RBIT_SCR_LPREC 0x00000080 -#define RBIT_SCR_LPP16 0x00000040 -#define RBIT_SCR_LPEN 0x00000020 -#define RBIT_SCR_LPCLKDIV 0x0000001f - - -/* - * 68000 interrupt and trap vector numbers - */ -#define M68K_IVEC_BUS_ERROR 2 -#define M68K_IVEC_ADDRESS_ERROR 3 -#define M68K_IVEC_ILLEGAL_OPCODE 4 -#define M68K_IVEC_ZERO_DIVIDE 5 -#define M68K_IVEC_CHK 6 -#define M68K_IVEC_TRAPV 7 -#define M68K_IVEC_PRIVILEGE 8 -#define M68K_IVEC_TRACE 9 -#define M68K_IVEC_LINE_A 10 -#define M68K_IVEC_LINE_F 11 -/* Unassigned, Reserved 12-14 */ -#define M68K_IVEC_UNINITIALIZED_INT 15 -/* Unassigned, Reserved 16-23 */ -#define M68K_IVEC_SPURIOUS_INT 24 - -#define M68K_IVEC_LEVEL1_AUTOVECTOR 25 -#define M68K_IVEC_LEVEL2_AUTOVECTOR 26 -#define M68K_IVEC_LEVEL3_AUTOVECTOR 27 -#define M68K_IVEC_LEVEL4_AUTOVECTOR 28 -#define M68K_IVEC_LEVEL5_AUTOVECTOR 29 -#define M68K_IVEC_LEVEL6_AUTOVECTOR 30 -#define M68K_IVEC_LEVEL7_AUTOVECTOR 31 - -#define M68K_IVEC_TRAP0 32 -#define M68K_IVEC_TRAP1 33 -#define M68K_IVEC_TRAP2 34 -#define M68K_IVEC_TRAP3 35 -#define M68K_IVEC_TRAP4 36 -#define M68K_IVEC_TRAP5 37 -#define M68K_IVEC_TRAP6 38 -#define M68K_IVEC_TRAP7 39 -#define M68K_IVEC_TRAP8 40 -#define M68K_IVEC_TRAP9 41 -#define M68K_IVEC_TRAP10 42 -#define M68K_IVEC_TRAP11 43 -#define M68K_IVEC_TRAP12 44 -#define M68K_IVEC_TRAP13 45 -#define M68K_IVEC_TRAP14 46 -#define M68K_IVEC_TRAP15 47 -/* - * Unassigned, Reserved 48-59 - * - * Note: Vectors 60-63 are used by the MC68302 (e.g. BAR, SCR). - */ - -/* - * MC68302 Interrupt Vectors - * Section 3.2 - */ -enum m68302_ivec_e { - M302_IVEC_ERR =0, - M302_IVEC_PB8 =1, /* General-Purpose Interrupt 0 */ - M302_IVEC_SMC2 =2, - M302_IVEC_SMC1 =3, - M302_IVEC_TIMER3 =4, - M302_IVEC_SCP =5, - M302_IVEC_TIMER2 =6, - M302_IVEC_PB9 =7, /* General-Purpose Interrupt 1 */ - M302_IVEC_SCC3 =8, - M302_IVEC_TIMER1 =9, - M302_IVEC_SCC2 =10, - M302_IVEC_IDMA =11, - M302_IVEC_SDMA =12, /* SDMA Channels Bus Error */ - M302_IVEC_SCC1 =13, - M302_IVEC_PB10 =14, /* General-Purpose Interrupt 2 */ - M302_IVEC_PB11 =15, /* General-Purpose Interrupt 3 */ - M302_IVEC_IRQ1 =17, /* External Device */ - M302_IVEC_IRQ6 =22, /* External Device */ - M302_IVEC_IRQ7 =23 /* External Device */ -}; - - -/* - * GIMR - Global Interrupt Mode Register - * Section 3.2.5.1 - */ -#define RBIT_GIMR_MOD (1<<15) -#define RBIT_GIMR_IV7 (1<<14) -#define RBIT_GIMR_IV6 (1<<13) -#define RBIT_GIMR_IV1 (1<<12) -#define RBIT_GIMR_ET7 (1<<10) -#define RBIT_GIMR_ET6 (1<<9) -#define RBIT_GIMR_ET1 (1<<8) -#define RBIT_GIMR_VECTOR (7<<5) - -/* - * IPR - Interrupt Pending Register (Section 3.2.5.2) - * IMR - Interrupt Mask Register (Section 3.2.5.3) - * ISR - Interrupt In-Service Register (Section 3.2.5.4) - */ -#define RBIT_IPR_PB11 (1<<15) -#define RBIT_IPR_PB10 (1<<14) -#define RBIT_IPR_SCC1 (1<<13) -#define RBIT_IPR_SDMA (1<<12) -#define RBIT_IPR_IDMA (1<<11) -#define RBIT_IPR_SCC2 (1<<10) -#define RBIT_IPR_TIMER1 (1<<9) -#define RBIT_IPR_SCC3 (1<<8) -#define RBIT_IPR_PB9 (1<<7) -#define RBIT_IPR_TIMER2 (1<<6) -#define RBIT_IPR_SCP (1<<5) -#define RBIT_IPR_TIMER3 (1<<4) -#define RBIT_IPR_SMC1 (1<<3) -#define RBIT_IPR_SMC2 (1<<2) -#define RBIT_IPR_PB8 (1<<1) -#define RBIT_IPR_ERR (1<<0) - -#define RBIT_ISR_PB11 (1<<15) -#define RBIT_ISR_PB10 (1<<14) -#define RBIT_ISR_SCC1 (1<<13) -#define RBIT_ISR_SDMA (1<<12) -#define RBIT_ISR_IDMA (1<<11) -#define RBIT_ISR_SCC2 (1<<10) -#define RBIT_ISR_TIMER1 (1<<9) -#define RBIT_ISR_SCC3 (1<<8) -#define RBIT_ISR_PB9 (1<<7) -#define RBIT_ISR_TIMER2 (1<<6) -#define RBIT_ISR_SCP (1<<5) -#define RBIT_ISR_TIMER3 (1<<4) -#define RBIT_ISR_SMC1 (1<<3) -#define RBIT_ISR_SMC2 (1<<2) -#define RBIT_ISR_PB8 (1<<1) - -#define RBIT_IMR_PB11 (1<<15) /* PB11 Interrupt Mask */ -#define RBIT_IMR_PB10 (1<<14) /* PB10 Interrupt Mask */ -#define RBIT_IMR_SCC1 (1<<13) /* SCC1 Interrupt Mask */ -#define RBIT_IMR_SDMA (1<<12) /* SDMA Interrupt Mask */ -#define RBIT_IMR_IDMA (1<<11) /* IDMA Interrupt Mask */ -#define RBIT_IMR_SCC2 (1<<10) /* SCC2 Interrupt Mask */ -#define RBIT_IMR_TIMER1 (1<<9) /* TIMER1 Interrupt Mask */ -#define RBIT_IMR_SCC3 (1<<8) /* SCC3 Interrupt Mask */ -#define RBIT_IMR_PB9 (1<<7) /* PB9 Interrupt Mask */ -#define RBIT_IMR_TIMER2 (1<<6) /* TIMER2 Interrupt Mask */ -#define RBIT_IMR_SCP (1<<5) /* SCP Interrupt Mask */ -#define RBIT_IMR_TIMER3 (1<<4) /* TIMER3 Interrupt Mask */ -#define RBIT_IMR_SMC1 (1<<3) /* SMC1 Interrupt Mask */ -#define RBIT_IMR_SMC2 (1<<2) /* SMC2 Interrupt Mask */ -#define RBIT_IMR_PB8 (1<<1) /* PB8 Interrupt Mask */ - - -/* - * DRAM Refresh - * Section 3.9 - * - * The DRAM refresh memory map replaces the SCC2 Tx BD 6 and Tx BD 7 - * structures in the parameter RAM. - * - * Access to the DRAM registers can be accomplished by - * the following approach: - * - * volatile m302_DRAM_refresh_t *dram; - * dram = (volatile m302_DRAM_refresh_t *) &m302.scc2.bd.tx[6]; - * - * Then simply use pointer references (e.g. dram->count = 3). - */ -typedef struct { - rtems_unsigned16 dram_high; /* DRAM high address and FC */ - rtems_unsigned16 dram_low; /* DRAM low address */ - rtems_unsigned16 increment; /* increment step (bytes/row) */ - rtems_unsigned16 count; /* RAM refresh cycle count (#rows) */ - rtems_unsigned16 t_ptr_h; /* temporary refresh high addr & FC */ - rtems_unsigned16 t_ptr_l; /* temporary refresh low address */ - rtems_unsigned16 t_count; /* temporary refresh cycles count */ - rtems_unsigned16 res; /* reserved */ -} m302_DRAM_refresh_t; - - -/* - * TMR - Timer Mode Register (for timers 1 and 2) - * Section 3.5.2.1 - */ -#define RBIT_TMR_ICLK_STOP (0<<1) -#define RBIT_TMR_ICLK_MASTER (1<<1) -#define RBIT_TMR_ICLK_MASTER16 (2<<1) -#define RBIT_TMR_ICLK_TIN (3<<1) - -#define RBIT_TMR_OM (1<<5) -#define RBIT_TMR_ORI (1<<4) -#define RBIT_TMR_FRR (1<<3) -#define RBIT_TMR_RST (1<<0) - - -/* - * TER - Timer Event Register (for timers 1 and 2) - * Section 3.5.2.5 - */ -#define RBIT_TER_REF (1<<1) /* Output Reference Event */ -#define RBIT_TER_CAP (1<<0) /* Capture Event */ - - -/* - * SCC Buffer Descriptors and Buffer Descriptors Table - * Section 4.5.5 - */ -typedef struct m302_SCC_bd { - rtems_unsigned16 status; /* status and control */ - rtems_unsigned16 length; /* data length */ - volatile rtems_unsigned8 *buffer; /* data buffer pointer */ -} m302_SCC_bd_t; - -typedef struct { - m302_SCC_bd_t rx[8]; /* receive buffer descriptors */ - m302_SCC_bd_t tx[8]; /* transmit buffer descriptors */ -} m302_SCC_bd_table_t; - - -/* - * SCC Parameter RAM (offset 0x080 from an SCC Base) - * Section 4.5.6 - * - * Each SCC parameter RAM area begins at offset 0x80 from each SCC base - * area (0x400, 0x500, or 0x600 from the dual-port RAM base). - * - * Offsets 0x9c-0xbf from each SCC base area compose the protocol-specific - * portion of the SCC parameter RAM. - */ -typedef struct { - rtems_unsigned8 rfcr; /* Rx Function Code */ - rtems_unsigned8 tfcr; /* Tx Function Code */ - rtems_unsigned16 mrblr; /* Maximum Rx Buffer Length */ - rtems_unsigned16 _rstate; /* Rx Internal State */ - rtems_unsigned8 res2; - rtems_unsigned8 rbd; /* Rx Internal Buffer Number */ - rtems_unsigned32 _rdptr; /* Rx Internal Data Pointer */ - rtems_unsigned16 _rcount; /* Rx Internal Byte Count */ - rtems_unsigned16 _rtmp; /* Rx Temp */ - rtems_unsigned16 _tstate; /* Tx Internal State */ - rtems_unsigned8 res7; - rtems_unsigned8 tbd; /* Tx Internal Buffer Number */ - rtems_unsigned32 _tdptr; /* Tx Internal Data Pointer */ - rtems_unsigned16 _tcount; /* Tx Internal Byte Count */ - rtems_unsigned16 _ttmp; /* Tx Temp */ -} m302_SCC_parameters_t; - -/* - * UART-Specific SCC Parameter RAM - * Section 4.5.11.3 - */ -typedef struct { - rtems_unsigned16 max_idl; /* Maximum IDLE Characters (rx) */ - rtems_unsigned16 idlc; /* Temporary rx IDLE counter */ - rtems_unsigned16 brkcr; /* Break Count Register (tx) */ - rtems_unsigned16 parec; /* Receive Parity Error Counter */ - rtems_unsigned16 frmec; /* Receive Framing Error Counter */ - rtems_unsigned16 nosec; /* Receive Noise Counter */ - rtems_unsigned16 brkec; /* Receive Break Condition Counter */ - rtems_unsigned16 uaddr1; /* UART ADDRESS Character 1 */ - rtems_unsigned16 uaddr2; /* UART ADDRESS Character 2 */ - rtems_unsigned16 rccr; /* Receive Control Character Register */ - rtems_unsigned16 character[8]; /* Control Characters 1 through 8*/ -} m302_SCC_UartSpecific_t; -/* - * This definition allows for the checking of receive buffers - * for errors. - */ - -#define RCV_ERR 0x003F - -/* - * UART receive buffer descriptor bit definitions. - * Section 4.5.11.14 - */ -#define RBIT_UART_CTRL (1<<11) /* buffer contains a control char */ -#define RBIT_UART_ADDR (1<<10) /* first byte contains an address */ -#define RBIT_UART_MATCH (1<<9) /* indicates which addr char matched */ -#define RBIT_UART_IDLE (1<<8) /* buffer closed due to IDLE sequence */ -#define RBIT_UART_BR (1<<5) /* break sequence was received */ -#define RBIT_UART_FR (1<<4) /* framing error was received */ -#define RBIT_UART_PR (1<<3) /* parity error was received */ -#define RBIT_UART_OV (1<<1) /* receiver overrun occurred */ -#define RBIT_UART_CD (1<<0) /* carrier detect lost */ -#define RBIT_UART_STATUS 0x003B /* all status bits */ - -/* - * UART transmit buffer descriptor bit definitions. - * Section 4.5.11.15 - */ -#define RBIT_UART_CR (1<<11) /* clear-to-send report - * this results in two idle bits - * between back-to-back frames - */ -#define RBIT_UART_A (1<<10) /* buffer contains address characters - * only valid in multidrop mode (UM0=1) - */ -#define RBIT_UART_PREAMBLE (1<<9) /* send preamble before data */ -#define RBIT_UART_CTS_LOST (1<<0) /* CTS lost */ - -/* - * UART event register - * Section 4.5.11.16 - */ -#define M302_UART_EV_CTS (1<<7) /* CTS status changed */ -#define M302_UART_EV_CD (1<<6) /* carrier detect status changed */ -#define M302_UART_EV_IDL (1<<5) /* IDLE sequence status changed */ -#define M302_UART_EV_BRK (1<<4) /* break character was received */ -#define M302_UART_EV_CCR (1<<3) /* control character received */ -#define M302_UART_EV_TX (1<<1) /* buffer has been transmitted */ -#define M302_UART_EV_RX (1<<0) /* buffer has been received */ - - -/* - * HDLC-Specific SCC Parameter RAM - * Section 4.5.12.3 - * - * c_mask_l should be 0xF0B8 for 16-bit CRC, 0xdebb for 32-bit CRC - * c_mask_h is a don't care for 16-bit CRC, 0x20E2 for 32-bit CRC - */ -typedef struct { - rtems_unsigned16 rcrc_l; /* Temp Receive CRC Low */ - rtems_unsigned16 rcrc_h; /* Temp Receive CRC High */ - rtems_unsigned16 c_mask_l; /* CRC Mask Low */ - rtems_unsigned16 c_mask_h; /* CRC Mask High */ - rtems_unsigned16 tcrc_l; /* Temp Transmit CRC Low */ - rtems_unsigned16 tcrc_h; /* Temp Transmit CRC High */ - - rtems_unsigned16 disfc; /* Discard Frame Counter */ - rtems_unsigned16 crcec; /* CRC Error Counter */ - rtems_unsigned16 abtsc; /* Abort Sequence Counter */ - rtems_unsigned16 nmarc; /* Nonmatching Address Received Cntr */ - rtems_unsigned16 retrc; /* Frame Retransmission Counter */ - - rtems_unsigned16 mflr; /* Maximum Frame Length Register */ - rtems_unsigned16 max_cnt; /* Maximum_Length Counter */ - - rtems_unsigned16 hmask; /* User Defined Frame Address Mask */ - rtems_unsigned16 haddr1; /* User Defined Frame Address */ - rtems_unsigned16 haddr2; /* " */ - rtems_unsigned16 haddr3; /* " */ - rtems_unsigned16 haddr4; /* " */ -} m302_SCC_HdlcSpecific_t; -/* - * HDLC receiver buffer descriptor bit definitions - * Section 4.5.12.10 - */ -#define RBIT_HDLC_EMPTY_BIT 0x8000 /* buffer associated with BD is empty */ -#define RBIT_HDLC_LAST_BIT 0x0800 /* buffer is last in a frame */ -#define RBIT_HDLC_FIRST_BIT 0x0400 /* buffer is first in a frame */ -#define RBIT_HDLC_FRAME_LEN 0x0020 /* receiver frame length violation */ -#define RBIT_HDLC_NONOCT_Rx 0x0010 /* received non-octet aligned frame */ -#define RBIT_HDLC_ABORT_SEQ 0x0008 /* received abort sequence */ -#define RBIT_HDLC_CRC_ERROR 0x0004 /* frame contains a CRC error */ -#define RBIT_HDLC_OVERRUN 0x0002 /* receiver overrun occurred */ -#define RBIT_HDLC_CD_LOST 0x0001 /* carrier detect lost */ - -/* - * HDLC transmit buffer descriptor bit definitions - * Section 4.5.12.11 - */ -#define RBIT_HDLC_READY_BIT 0x8000 /* buffer is ready to transmit */ -#define RBIT_HDLC_EXT_BUFFER 0x4000 /* buffer is in external memory */ -#define RBIT_HDLC_WRAP_BIT 0x2000 /* last buffer in bd table, so wrap */ -#define RBIT_HDLC_WAKE_UP 0x1000 /* interrupt when buffer serviced */ -#define RBIT_HDLC_LAST_BIT 0x0800 /* buffer is last in the frame */ -#define RBIT_HDLC_TxCRC_BIT 0x0400 /* transmit a CRC sequence */ -#define RBIT_HDLC_UNDERRUN 0x0002 /* transmitter underrun */ -#define RBIT_HDLC_CTS_LOST 0x0001 /* CTS lost */ - -/* - * HDLC event register bit definitions - * Section 4.5.12.12 - */ -#define RBIT_HDLC_CTS 0x80 /* CTS status changed */ -#define RBIT_HDLC_CD 0x40 /* carrier detect status changed */ -#define RBIT_HDLC_IDL 0x20 /* IDLE sequence status changed */ -#define RBIT_HDLC_TXE 0x10 /* transmit error */ -#define RBIT_HDLC_RXF 0x08 /* received frame */ -#define RBIT_HDLC_BSY 0x04 /* frame rcvd and discarded due to - * lack of buffers - */ -#define RBIT_HDLC_TXB 0x02 /* buffer has been transmitted */ -#define RBIT_HDLC_RXB 0x01 /* received buffer */ - - - -typedef struct { - m302_SCC_bd_table_t bd; /* +000 Buffer Descriptor Table */ - m302_SCC_parameters_t parm; /* +080 Common Parameter RAM */ - union { /* +09C Protocol-Specific Parm RAM */ - m302_SCC_UartSpecific_t uart; - m302_SCC_HdlcSpecific_t hdlc; - } prot; - rtems_unsigned8 res[0x040]; /* +0C0 reserved, (not implemented) */ -} m302_SCC_t; - - -/* - * Common SCC Registers - */ -typedef struct { - rtems_unsigned16 res1; - rtems_unsigned16 scon; /* SCC Configuration Register 4.5.2 */ - rtems_unsigned16 scm; /* SCC Mode Register 4.5.3 */ - rtems_unsigned16 dsr; /* SCC Data Synchronization Register 4.5.4 */ - rtems_unsigned8 scce; /* SCC Event Register 4.5.8.1 */ - rtems_unsigned8 res2; - rtems_unsigned8 sccm; /* SCC Mask Register 4.5.8.2 */ - rtems_unsigned8 res3; - rtems_unsigned8 sccs; /* SCC Status Register 4.5.8.3 */ - rtems_unsigned8 res4; - rtems_unsigned16 res5; -} m302_SCC_Registers_t; - -/* - * SCON - SCC Configuration Register - * Section 4.5.2 - */ -#define RBIT_SCON_WOMS (1<<15) /* Wired-OR Mode Select (NMSI mode only) - * When set, the TXD driver is an - * open-drain output */ -#define RBIT_SCON_EXTC (1<<14) /* External Clock Source */ -#define RBIT_SCON_TCS (1<<13) /* Transmit Clock Source */ -#define RBIT_SCON_RCS (1<<12) /* Receive Clock Source */ - -/* - * SCM - SCC Mode Register bit definitions - * Section 4.5.3 - * The parameter-specific mode bits occupy bits 15 through 6. - */ -#define RBIT_SCM_ENR (1<<3) /* Enable receiver */ -#define RBIT_SCM_ENT (1<<2) /* Enable transmitter */ - - -/* - * Internal MC68302 Registers - * starts at offset 0x800 from dual-port RAM base - * Section 2.8 - */ -typedef struct { - /* offset +800 */ - rtems_unsigned16 res0; - rtems_unsigned16 cmr; /* IDMA Channel Mode Register */ - rtems_unsigned32 sapr; /* IDMA Source Address Pointer */ - rtems_unsigned32 dapr; /* IDMA Destination Address Pointer */ - rtems_unsigned16 bcr; /* IDMA Byte Count Register */ - rtems_unsigned8 csr; /* IDMA Channel Status Register */ - rtems_unsigned8 res1; - rtems_unsigned8 fcr; /* IDMA Function Code Register */ - rtems_unsigned8 res2; - - /* offset +812 */ - rtems_unsigned16 gimr; /* Global Interrupt Mode Register */ - rtems_unsigned16 ipr; /* Interrupt Pending Register */ - rtems_unsigned16 imr; /* Interrupt Mask Register */ - rtems_unsigned16 isr; /* Interrupt In-Service Register */ - rtems_unsigned16 res3; - rtems_unsigned16 res4; - - /* offset +81e */ - rtems_unsigned16 pacnt; /* Port A Control Register */ - rtems_unsigned16 paddr; /* Port A Data Direction Register */ - rtems_unsigned16 padat; /* Port A Data Register */ - rtems_unsigned16 pbcnt; /* Port B Control Register */ - rtems_unsigned16 pbddr; /* Port B Data Direction Register */ - rtems_unsigned16 pbdat; /* Port B Data Register */ - rtems_unsigned16 res5; - - /* offset +82c */ - rtems_unsigned16 res6; - rtems_unsigned16 res7; - - rtems_unsigned16 br0; /* Base Register (CS0) */ - rtems_unsigned16 or0; /* Option Register (CS0) */ - rtems_unsigned16 br1; /* Base Register (CS1) */ - rtems_unsigned16 or1; /* Option Register (CS1) */ - rtems_unsigned16 br2; /* Base Register (CS2) */ - rtems_unsigned16 or2; /* Option Register (CS2) */ - rtems_unsigned16 br3; /* Base Register (CS3) */ - rtems_unsigned16 or3; /* Option Register (CS3) */ - - /* offset +840 */ - rtems_unsigned16 tmr1; /* Timer Unit 1 Mode Register */ - rtems_unsigned16 trr1; /* Timer Unit 1 Reference Register */ - rtems_unsigned16 tcr1; /* Timer Unit 1 Capture Register */ - rtems_unsigned16 tcn1; /* Timer Unit 1 Counter */ - rtems_unsigned8 res8; - rtems_unsigned8 ter1; /* Timer Unit 1 Event Register */ - rtems_unsigned16 wrr; /* Watchdog Reference Register */ - rtems_unsigned16 wcn; /* Watchdog Counter */ - rtems_unsigned16 res9; - rtems_unsigned16 tmr2; /* Timer Unit 2 Mode Register */ - rtems_unsigned16 trr2; /* Timer Unit 2 Reference Register */ - rtems_unsigned16 tcr2; /* Timer Unit 2 Capture Register */ - rtems_unsigned16 tcn2; /* Timer Unit 2 Counter */ - rtems_unsigned8 resa; - rtems_unsigned8 ter2; /* Timer Unit 2 Event Register */ - rtems_unsigned16 resb; - rtems_unsigned16 resc; - rtems_unsigned16 resd; - - /* offset +860 */ - rtems_unsigned8 cr; /* Command Register */ - rtems_unsigned8 rese[0x1f]; - - /* offset +880, +890, +8a0 */ - m302_SCC_Registers_t scc[3]; /* SCC1, SCC2, SCC3 Registers */ - - /* offset +8b0 */ - rtems_unsigned16 spmode; /* SCP,SMC Mode and Clock Cntrl Reg */ - rtems_unsigned16 simask; /* Serial Interface Mask Register */ - rtems_unsigned16 simode; /* Serial Interface Mode Register */ -} m302_internalReg_t ; - - -/* - * MC68302 dual-port RAM structure. - * (Includes System RAM, Parameter RAM, and Internal Registers). - * Section 2.8 - */ -typedef struct { - rtems_unsigned8 mem[0x240]; /* +000 User Data Memory */ - rtems_unsigned8 res1[0x1c0]; /* +240 reserved, (not implemented) */ - m302_SCC_t scc1; /* +400 SCC1 */ - m302_SCC_t scc2; /* +500 SCC2 */ - m302_SCC_t scc3; /* +600 SCC3 */ - rtems_unsigned8 res2[0x100]; /* +700 reserved, (not implemented) */ - m302_internalReg_t reg; /* +800 68302 Internal Registers */ -} m302_dualPortRAM_t; - -/* some useful defines the some of the registers above */ - - -/* ---- - MC68302 Chip Select Registers - p3-46 2nd Edition - - */ -#define BR_ENABLED 1 -#define BR_DISABLED 0 -#define BR_FC_NULL 0 -#define BR_READ_ONLY 0 -#define BR_READ_WRITE 2 -#define OR_DTACK_0 0x0000 -#define OR_DTACK_1 0x2000 -#define OR_DTACK_2 0x4000 -#define OR_DTACK_3 0x6000 -#define OR_DTACK_4 0x8000 -#define OR_DTACK_5 0xA000 -#define OR_DTACK_6 0xC000 -#define OR_DTACK_EXT 0xE000 -#define OR_SIZE_64K 0x1FE0 -#define OR_SIZE_128K 0x1FC0 -#define OR_SIZE_256K 0x1F80 -#define OR_SIZE_512K 0x1F00 -#define OR_SIZE_1M 0x1E00 -#define OR_SIZE_2M 0x1C00 -#define OR_MASK_RW 0x0000 -#define OR_NO_MASK_RW 0x0002 -#define OR_MASK_FC 0x0000 -#define OR_NO_MASK_FC 0x0001 - -#define MAKE_BR(base_address, enable, rw, fc) \ - ((base_address >> 11) | fc | rw | enable) - -#define MAKE_OR(bsize, DtAck, RW_Mask, FC_Mask) \ - (DtAck | ((~(bsize - 1) & 0x00FFFFFF) >> 11) | FC_Mask | RW_Mask) - -#define __REG_CAT(r, n) r ## n -#define WRITE_BR(csel, base_address, enable, rw, fc) \ - __REG_CAT(m302.reg.br, csel) = MAKE_BR(base_address, enable, rw, fc) -#define WRITE_OR(csel, bsize, DtAck, RW_Mask, FC_Mask) \ - __REG_CAT(m302.reg.or, csel) = MAKE_OR(bsize, DtAck, RW_Mask, FC_Mask) - -/* ---- - MC68302 Watchdog Timer Enable Bit - - */ -#define WATCHDOG_ENABLE (1) -#define WATCHDOG_TRIGGER() (m302.reg.wrr = 0x10 | WATCHDOG_ENABLE, m302.reg.wcn = 0) -#define WATCHDOG_TOGGLE() (m302.reg.wcn = WATCHDOG_TIMEOUT_PERIOD) -#define DISABLE_WATCHDOG() (m302.reg.wrr = 0) - -/* - * Declare the variable that's used to reference the variables in - * the dual-port RAM. - */ -extern volatile m302_dualPortRAM_t m302; - -#endif -/* end of include file */ diff --git a/cpukit/score/cpu/m68k/rtems/m68k/m68360.h b/cpukit/score/cpu/m68k/rtems/m68k/m68360.h deleted file mode 100644 index 1bdf0a5995..0000000000 --- a/cpukit/score/cpu/m68k/rtems/m68k/m68360.h +++ /dev/null @@ -1,889 +0,0 @@ -/* - ************************************************************************** - ************************************************************************** - ** ** - ** MOTOROLA MC68360 QUAD INTEGRATED COMMUNICATIONS CONTROLLER (QUICC) ** - ** ** - ** HARDWARE DECLARATIONS ** - ** ** - ** ** - ** Submitted By: ** - ** ** - ** W. Eric Norum ** - ** Saskatchewan Accelerator Laboratory ** - ** University of Saskatchewan ** - ** 107 North Road ** - ** Saskatoon, Saskatchewan, CANADA ** - ** S7N 5C6 ** - ** ** - ** eric@skatter.usask.ca ** - ** ** - ** $Id$ ** - ** ** - ************************************************************************** - ************************************************************************** - */ - -#ifndef __MC68360_h -#define __MC68360_h - -/* - ************************************************************************* - * REGISTER SUBBLOCKS * - ************************************************************************* - */ - -/* - * Memory controller registers - */ -typedef struct m360MEMCRegisters_ { - unsigned long br; - unsigned long or; - unsigned long _pad[2]; -} m360MEMCRegisters_t; - -/* - * Serial Communications Controller registers - */ -typedef struct m360SCCRegisters_ { - unsigned long gsmr_l; - unsigned long gsmr_h; - unsigned short psmr; - unsigned short _pad0; - unsigned short todr; - unsigned short dsr; - unsigned short scce; - unsigned short _pad1; - unsigned short sccm; - unsigned char _pad2; - unsigned char sccs; - unsigned long _pad3[2]; -} m360SCCRegisters_t; - -/* - * Serial Management Controller registers - */ -typedef struct m360SMCRegisters_ { - unsigned short _pad0; - unsigned short smcmr; - unsigned short _pad1; - unsigned char smce; - unsigned char _pad2; - unsigned short _pad3; - unsigned char smcm; - unsigned char _pad4; - unsigned long _pad5; -} m360SMCRegisters_t; - - -/* - ************************************************************************* - * Miscellaneous Parameters * - ************************************************************************* - */ -typedef struct m360MiscParms_ { - unsigned short rev_num; - unsigned short _res1; - unsigned long _res2; - unsigned long _res3; -} m360MiscParms_t; - -/* - ************************************************************************* - * RISC Timers * - ************************************************************************* - */ -typedef struct m360TimerParms_ { - unsigned short tm_base; - unsigned short _tm_ptr; - unsigned short _r_tmr; - unsigned short _r_tmv; - unsigned long tm_cmd; - unsigned long tm_cnt; -} m360TimerParms_t; - -/* - * RISC Controller Configuration Register (RCCR) - * All other bits in this register are either reserved or - * used only with a Motorola-supplied RAM microcode packge. - */ -#define M360_RCCR_TIME (1<<15) /* Enable timer */ -#define M360_RCCR_TIMEP(x) ((x)<<8) /* Timer period */ - -/* - * Command register - * Set up this register before issuing a M360_CR_OP_SET_TIMER command. - */ -#define M360_TM_CMD_V (1<<31) /* Set to enable timer */ -#define M360_TM_CMD_R (1<<30) /* Set for automatic restart */ -#define M360_TM_CMD_TIMER(x) ((x)<<16) /* Select timer */ -#define M360_TM_CMD_PERIOD(x) (x) /* Timer period (16 bits) */ - -/* - ************************************************************************* - * DMA Controllers * - ************************************************************************* - */ -typedef struct m360IDMAparms_ { - unsigned short ibase; - unsigned short ibptr; - unsigned long _istate; - unsigned long _itemp; -} m360IDMAparms_t; - -/* - ************************************************************************* - * Serial Communication Controllers * - ************************************************************************* - */ -typedef struct m360SCCparms_ { - unsigned short rbase; - unsigned short tbase; - unsigned char rfcr; - unsigned char tfcr; - unsigned short mrblr; - unsigned long _rstate; - unsigned long _pad0; - unsigned short _rbptr; - unsigned short _pad1; - unsigned long _pad2; - unsigned long _tstate; - unsigned long _pad3; - unsigned short _tbptr; - unsigned short _pad4; - unsigned long _pad5; - unsigned long _rcrc; - unsigned long _tcrc; - union { - struct { - unsigned long _res0; - unsigned long _res1; - unsigned short max_idl; - unsigned short _idlc; - unsigned short brkcr; - unsigned short parec; - unsigned short frmec; - unsigned short nosec; - unsigned short brkec; - unsigned short brklen; - unsigned short uaddr[2]; - unsigned short _rtemp; - unsigned short toseq; - unsigned short character[8]; - unsigned short rccm; - unsigned short rccr; - unsigned short rlbc; - } uart; - struct { - unsigned long crc_p; - unsigned long crc_c; - } transparent; - - } un; -} m360SCCparms_t; - -typedef struct m360SCCENparms_ { - unsigned short rbase; - unsigned short tbase; - unsigned char rfcr; - unsigned char tfcr; - unsigned short mrblr; - unsigned long _rstate; - unsigned long _pad0; - unsigned short _rbptr; - unsigned short _pad1; - unsigned long _pad2; - unsigned long _tstate; - unsigned long _pad3; - unsigned short _tbptr; - unsigned short _pad4; - unsigned long _pad5; - unsigned long _rcrc; - unsigned long _tcrc; - union { - struct { - unsigned long _res0; - unsigned long _res1; - unsigned short max_idl; - unsigned short _idlc; - unsigned short brkcr; - unsigned short parec; - unsigned short frmec; - unsigned short nosec; - unsigned short brkec; - unsigned short brklen; - unsigned short uaddr[2]; - unsigned short _rtemp; - unsigned short toseq; - unsigned short character[8]; - unsigned short rccm; - unsigned short rccr; - unsigned short rlbc; - } uart; - struct { - unsigned long c_pres; - unsigned long c_mask; - unsigned long crcec; - unsigned long alec; - unsigned long disfc; - unsigned short pads; - unsigned short ret_lim; - unsigned short _ret_cnt; - unsigned short mflr; - unsigned short minflr; - unsigned short maxd1; - unsigned short maxd2; - unsigned short _maxd; - unsigned short dma_cnt; - unsigned short _max_b; - unsigned short gaddr1; - unsigned short gaddr2; - unsigned short gaddr3; - unsigned short gaddr4; - unsigned long _tbuf0data0; - unsigned long _tbuf0data1; - unsigned long _tbuf0rba0; - unsigned long _tbuf0crc; - unsigned short _tbuf0bcnt; - unsigned short paddr_h; - unsigned short paddr_m; - unsigned short paddr_l; - unsigned short p_per; - unsigned short _rfbd_ptr; - unsigned short _tfbd_ptr; - unsigned short _tlbd_ptr; - unsigned long _tbuf1data0; - unsigned long _tbuf1data1; - unsigned long _tbuf1rba0; - unsigned long _tbuf1crc; - unsigned short _tbuf1bcnt; - unsigned short _tx_len; - unsigned short iaddr1; - unsigned short iaddr2; - unsigned short iaddr3; - unsigned short iaddr4; - unsigned short _boff_cnt; - unsigned short taddr_h; - unsigned short taddr_m; - unsigned short taddr_l; - } ethernet; - struct { - unsigned long crc_p; - unsigned long crc_c; - } transparent; - } un; -} m360SCCENparms_t; - -/* - * Receive and transmit function code register bits - * These apply to the function code registers of all devices, not just SCC. - */ -#define M360_RFCR_MOT (1<<4) -#define M360_RFCR_DMA_SPACE 0x8 -#define M360_TFCR_MOT (1<<4) -#define M360_TFCR_DMA_SPACE 0x8 - -/* - ************************************************************************* - * Serial Management Controllers * - ************************************************************************* - */ -typedef struct m360SMCparms_ { - unsigned short rbase; - unsigned short tbase; - unsigned char rfcr; - unsigned char tfcr; - unsigned short mrblr; - unsigned long _rstate; - unsigned long _pad0; - unsigned short _rbptr; - unsigned short _pad1; - unsigned long _pad2; - unsigned long _tstate; - unsigned long _pad3; - unsigned short _tbptr; - unsigned short _pad4; - unsigned long _pad5; - union { - struct { - unsigned short max_idl; - unsigned short _pad0; - unsigned short brklen; - unsigned short brkec; - unsigned short brkcr; - unsigned short _r_mask; - } uart; - struct { - unsigned short _pad0[5]; - } transparent; - } un; -} m360SMCparms_t; - -/* - * Mode register - */ -#define M360_SMCMR_CLEN(x) ((x)<<11) /* Character length */ -#define M360_SMCMR_2STOP (1<<10) /* 2 stop bits */ -#define M360_SMCMR_PARITY (1<<9) /* Enable parity */ -#define M360_SMCMR_EVEN (1<<8) /* Even parity */ -#define M360_SMCMR_SM_GCI (0<<4) /* GCI Mode */ -#define M360_SMCMR_SM_UART (2<<4) /* UART Mode */ -#define M360_SMCMR_SM_TRANSPARENT (3<<4) /* Transparent Mode */ -#define M360_SMCMR_DM_LOOPBACK (1<<2) /* Local loopback mode */ -#define M360_SMCMR_DM_ECHO (2<<2) /* Echo mode */ -#define M360_SMCMR_TEN (1<<1) /* Enable transmitter */ -#define M360_SMCMR_REN (1<<0) /* Enable receiver */ - -/* - * Event and mask registers (SMCE, SMCM) - */ -#define M360_SMCE_BRK (1<<4) -#define M360_SMCE_BSY (1<<2) -#define M360_SMCE_TX (1<<1) -#define M360_SMCE_RX (1<<0) - -/* - ************************************************************************* - * Serial Peripheral Interface * - ************************************************************************* - */ -typedef struct m360SPIparms_ { - unsigned short rbase; - unsigned short tbase; - unsigned char rfcr; - unsigned char tfcr; - unsigned short mrblr; - unsigned long _rstate; - unsigned long _pad0; - unsigned short _rbptr; - unsigned short _pad1; - unsigned long _pad2; - unsigned long _tstate; - unsigned long _pad3; - unsigned short _tbptr; - unsigned short _pad4; - unsigned long _pad5; -} m360SPIparms_t; - -/* - * Mode register (SPMODE) - */ -#define M360_SPMODE_LOOP (1<<14) /* Local loopback mode */ -#define M360_SPMODE_CI (1<<13) /* Clock invert */ -#define M360_SPMODE_CP (1<<12) /* Clock phase */ -#define M360_SPMODE_DIV16 (1<<11) /* Divide BRGCLK by 16 */ -#define M360_SPMODE_REV (1<<10) /* Reverse data */ -#define M360_SPMODE_MASTER (1<<9) /* SPI is master */ -#define M360_SPMODE_EN (1<<8) /* Enable SPI */ -#define M360_SPMODE_CLEN(x) ((x)<<4) /* Character length */ -#define M360_SPMODE_PM(x) (x) /* Prescaler modulus */ - -/* - * Mode register (SPCOM) - */ -#define M360_SPCOM_STR (1<<7) /* Start transmit */ - -/* - * Event and mask registers (SPIE, SPIM) - */ -#define M360_SPIE_MME (1<<5) /* Multi-master error */ -#define M360_SPIE_TXE (1<<4) /* Tx error */ -#define M360_SPIE_BSY (1<<2) /* Busy condition*/ -#define M360_SPIE_TXB (1<<1) /* Tx buffer */ -#define M360_SPIE_RXB (1<<0) /* Rx buffer */ - -/* - ************************************************************************* - * SDMA (SCC, SMC, SPI) Buffer Descriptors * - ************************************************************************* - */ -typedef struct m360BufferDescriptor_ { - unsigned short status; - unsigned short length; - volatile void *buffer; -} m360BufferDescriptor_t; - -/* - * Bits in receive buffer descriptor status word - */ -#define M360_BD_EMPTY (1<<15) /* Ethernet, SCC UART, SMC UART, SPI */ -#define M360_BD_WRAP (1<<13) /* Ethernet, SCC UART, SMC UART, SPI */ -#define M360_BD_INTERRUPT (1<<12) /* Ethernet, SCC UART, SMC UART, SPI */ -#define M360_BD_LAST (1<<11) /* Ethernet, SPI */ -#define M360_BD_CONTROL_CHAR (1<<11) /* SCC UART */ -#define M360_BD_FIRST_IN_FRAME (1<<10) /* Ethernet */ -#define M360_BD_ADDRESS (1<<10) /* SCC UART */ -#define M360_BD_CONTINUOUS (1<<9) /* SCC UART, SMC UART, SPI */ -#define M360_BD_MISS (1<<8) /* Ethernet */ -#define M360_BD_IDLE (1<<8) /* SCC UART, SMC UART */ -#define M360_BD_ADDRSS_MATCH (1<<7) /* SCC UART */ -#define M360_BD_LONG (1<<5) /* Ethernet */ -#define M360_BD_BREAK (1<<5) /* SCC UART, SMC UART */ -#define M360_BD_NONALIGNED (1<<4) /* Ethernet */ -#define M360_BD_FRAMING_ERROR (1<<4) /* SCC UART, SMC UART */ -#define M360_BD_SHORT (1<<3) /* Ethernet */ -#define M360_BD_PARITY_ERROR (1<<3) /* SCC UART, SMC UART */ -#define M360_BD_CRC_ERROR (1<<2) /* Ethernet */ -#define M360_BD_OVERRUN (1<<1) /* Ethernet, SCC UART, SMC UART, SPI */ -#define M360_BD_COLLISION (1<<0) /* Ethernet */ -#define M360_BD_CARRIER_LOST (1<<0) /* SCC UART */ -#define M360_BD_MASTER_ERROR (1<<0) /* SPI */ - -/* - * Bits in transmit buffer descriptor status word - * Many bits have the same meaning as those in receiver buffer descriptors. - */ -#define M360_BD_READY (1<<15) /* Ethernet, SCC UART, SMC UART, SPI */ -#define M360_BD_PAD (1<<14) /* Ethernet */ -#define M360_BD_CTS_REPORT (1<<11) /* SCC UART */ -#define M360_BD_TX_CRC (1<<10) /* Ethernet */ -#define M360_BD_DEFER (1<<9) /* Ethernet */ -#define M360_BD_HEARTBEAT (1<<8) /* Ethernet */ -#define M360_BD_PREAMBLE (1<<8) /* SCC UART, SMC UART */ -#define M360_BD_LATE_COLLISION (1<<7) /* Ethernet */ -#define M360_BD_NO_STOP_BIT (1<<7) /* SCC UART */ -#define M360_BD_RETRY_LIMIT (1<<6) /* Ethernet */ -#define M360_BD_RETRY_COUNT(x) (((x)&0x3C)>>2) /* Ethernet */ -#define M360_BD_UNDERRUN (1<<1) /* Ethernet, SPI */ -#define M360_BD_CARRIER_LOST (1<<0) /* Ethernet */ -#define M360_BD_CTS_LOST (1<<0) /* SCC UART */ - -/* - ************************************************************************* - * IDMA Buffer Descriptors * - ************************************************************************* - */ -typedef struct m360IDMABufferDescriptor_ { - unsigned short status; - unsigned short _pad; - unsigned long length; - void *source; - void *destination; -} m360IDMABufferDescriptor_t; - -/* - ************************************************************************* - * RISC Communication Processor Module Command Register (CR) * - ************************************************************************* - */ -#define M360_CR_RST (1<<15) /* Reset communication processor */ -#define M360_CR_OP_INIT_RX_TX (0<<8) /* SCC, SMC UART, SMC GCI, SPI */ -#define M360_CR_OP_INIT_RX (1<<8) /* SCC, SMC UART, SPI */ -#define M360_CR_OP_INIT_TX (2<<8) /* SCC, SMC UART, SPI */ -#define M360_CR_OP_INIT_HUNT (3<<8) /* SCC, SMC UART */ -#define M360_CR_OP_STOP_TX (4<<8) /* SCC, SMC UART */ -#define M360_CR_OP_GR_STOP_TX (5<<8) /* SCC */ -#define M360_CR_OP_INIT_IDMA (5<<8) /* IDMA */ -#define M360_CR_OP_RESTART_TX (6<<8) /* SCC, SMC UART */ -#define M360_CR_OP_CLOSE_RX_BD (7<<8) /* SCC, SMC UART, SPI */ -#define M360_CR_OP_SET_GRP_ADDR (8<<8) /* SCC */ -#define M360_CR_OP_SET_TIMER (8<<8) /* Timer */ -#define M360_CR_OP_GCI_TIMEOUT (9<<8) /* SMC GCI */ -#define M360_CR_OP_RESERT_BCS (10<<8) /* SCC */ -#define M360_CR_OP_GCI_ABORT (10<<8) /* SMC GCI */ -#define M360_CR_CHAN_SCC1 (0<<4) /* Channel selection */ -#define M360_CR_CHAN_SCC2 (4<<4) -#define M360_CR_CHAN_SPI (5<<4) -#define M360_CR_CHAN_TIMER (5<<4) -#define M360_CR_CHAN_SCC3 (8<<4) -#define M360_CR_CHAN_SMC1 (9<<4) -#define M360_CR_CHAN_IDMA1 (9<<4) -#define M360_CR_CHAN_SCC4 (12<<4) -#define M360_CR_CHAN_SMC2 (13<<4) -#define M360_CR_CHAN_IDMA2 (13<<4) -#define M360_CR_FLG (1<<0) /* Command flag */ - -/* - ************************************************************************* - * System Protection Control Register (SYPCR) * - ************************************************************************* - */ -#define M360_SYPCR_SWE (1<<7) /* Software watchdog enable */ -#define M360_SYPCR_SWRI (1<<6) /* Software watchdog reset select */ -#define M360_SYPCR_SWT1 (1<<5) /* Software watchdog timing bit 1 */ -#define M360_SYPCR_SWT0 (1<<4) /* Software watchdog timing bit 0 */ -#define M360_SYPCR_DBFE (1<<3) /* Double bus fault monitor enable */ -#define M360_SYPCR_BME (1<<2) /* Bus monitor external enable */ -#define M360_SYPCR_BMT1 (1<<1) /* Bus monitor timing bit 1 */ -#define M360_SYPCR_BMT0 (1<<0) /* Bus monitor timing bit 0 */ - -/* - ************************************************************************* - * Memory Control Registers * - ************************************************************************* - */ -#define M360_GMR_RCNT(x) ((x)<<24) /* Refresh count */ -#define M360_GMR_RFEN (1<<23) /* Refresh enable */ -#define M360_GMR_RCYC(x) ((x)<<21) /* Refresh cycle length */ -#define M360_GMR_PGS(x) ((x)<<18) /* Page size */ -#define M360_GMR_DPS_32BIT (0<<16) /* DRAM port size */ -#define M360_GMR_DPS_16BIT (1<<16) -#define M360_GMR_DPS_8BIT (2<<16) -#define M360_GMR_DPS_DSACK (3<<16) -#define M360_GMR_WBT40 (1<<15) /* Wait between 040 transfers */ -#define M360_GMR_WBTQ (1<<14) /* Wait between 360 transfers */ -#define M360_GMR_SYNC (1<<13) /* Synchronous external access */ -#define M360_GMR_EMWS (1<<12) /* External master wait state */ -#define M360_GMR_OPAR (1<<11) /* Odd parity */ -#define M360_GMR_PBEE (1<<10) /* Parity bus error enable */ -#define M360_GMR_TSS40 (1<<9) /* TS* sample for 040 */ -#define M360_GMR_NCS (1<<8) /* No CPU space */ -#define M360_GMR_DWQ (1<<7) /* Delay write for 360 */ -#define M360_GMR_DW40 (1<<6) /* Delay write for 040 */ -#define M360_GMR_GAMX (1<<5) /* Global address mux enable */ - -#define M360_MEMC_BR_FC(x) ((x)<<7) /* Function code limit */ -#define M360_MEMC_BR_TRLXQ (1<<6) /* Relax timing requirements */ -#define M360_MEMC_BR_BACK40 (1<<5) /* Burst acknowledge to 040 */ -#define M360_MEMC_BR_CSNT40 (1<<4) /* CS* negate timing for 040 */ -#define M360_MEMC_BR_CSNTQ (1<<3) /* CS* negate timing for 360 */ -#define M360_MEMC_BR_PAREN (1<<2) /* Enable parity checking */ -#define M360_MEMC_BR_WP (1<<1) /* Write Protect */ -#define M360_MEMC_BR_V (1<<0) /* Base/Option register are valid */ - -#define M360_MEMC_OR_TCYC(x) ((x)<<28) /* Cycle length (clocks) */ -#define M360_MEMC_OR_WAITS(x) M360_MEMC_OR_TCYC((x)+1) -#define M360_MEMC_OR_2KB 0x0FFFF800 /* Address range */ -#define M360_MEMC_OR_4KB 0x0FFFF000 -#define M360_MEMC_OR_8KB 0x0FFFE000 -#define M360_MEMC_OR_16KB 0x0FFFC000 -#define M360_MEMC_OR_32KB 0x0FFF8000 -#define M360_MEMC_OR_64KB 0x0FFF0000 -#define M360_MEMC_OR_128KB 0x0FFE0000 -#define M360_MEMC_OR_256KB 0x0FFC0000 -#define M360_MEMC_OR_512KB 0x0FF80000 -#define M360_MEMC_OR_1MB 0x0FF00000 -#define M360_MEMC_OR_2MB 0x0FE00000 -#define M360_MEMC_OR_4MB 0x0FC00000 -#define M360_MEMC_OR_8MB 0x0F800000 -#define M360_MEMC_OR_16MB 0x0F000000 -#define M360_MEMC_OR_32MB 0x0E000000 -#define M360_MEMC_OR_64MB 0x0C000000 -#define M360_MEMC_OR_128MB 0x08000000 -#define M360_MEMC_OR_256MB 0x00000000 -#define M360_MEMC_OR_FCMC(x) ((x)<<7) /* Function code mask */ -#define M360_MEMC_OR_BCYC(x) ((x)<<5) /* Burst cycle length (clocks) */ -#define M360_MEMC_OR_PGME (1<<3) /* Page mode enable */ -#define M360_MEMC_OR_32BIT (0<<1) /* Port size */ -#define M360_MEMC_OR_16BIT (1<<1) -#define M360_MEMC_OR_8BIT (2<<1) -#define M360_MEMC_OR_DSACK (3<<1) -#define M360_MEMC_OR_DRAM (1<<0) /* Dynamic RAM select */ - -/* - ************************************************************************* - * SI Mode Register (SIMODE) * - ************************************************************************* - */ -#define M360_SI_SMC2_BITS 0xFFFF0000 /* All SMC2 bits */ -#define M360_SI_SMC2_TDM (1<<31) /* Multiplexed SMC2 */ -#define M360_SI_SMC2_BRG1 (0<<28) /* SMC2 clock souce */ -#define M360_SI_SMC2_BRG2 (1<<28) -#define M360_SI_SMC2_BRG3 (2<<28) -#define M360_SI_SMC2_BRG4 (3<<28) -#define M360_SI_SMC2_CLK5 (0<<28) -#define M360_SI_SMC2_CLK6 (1<<28) -#define M360_SI_SMC2_CLK7 (2<<28) -#define M360_SI_SMC2_CLK8 (3<<28) -#define M360_SI_SMC1_BITS 0x0000FFFF /* All SMC1 bits */ -#define M360_SI_SMC1_TDM (1<<15) /* Multiplexed SMC1 */ -#define M360_SI_SMC1_BRG1 (0<<12) /* SMC1 clock souce */ -#define M360_SI_SMC1_BRG2 (1<<12) -#define M360_SI_SMC1_BRG3 (2<<12) -#define M360_SI_SMC1_BRG4 (3<<12) -#define M360_SI_SMC1_CLK1 (0<<12) -#define M360_SI_SMC1_CLK2 (1<<12) -#define M360_SI_SMC1_CLK3 (2<<12) -#define M360_SI_SMC1_CLK4 (3<<12) - -/* - ************************************************************************* - * SDMA Configuration Register (SDMA) * - ************************************************************************* - */ -#define M360_SDMA_FREEZE (2<<13) /* Freeze on next bus cycle */ -#define M360_SDMA_SISM_7 (7<<8) /* Normal interrupt service mask */ -#define M360_SDMA_SAID_4 (4<<4) /* Normal arbitration ID */ -#define M360_SDMA_INTE (1<<1) /* SBER interrupt enable */ -#define M360_SDMA_INTB (1<<0) /* SBKP interrupt enable */ - -/* - ************************************************************************* - * Baud (sic) Rate Generators * - ************************************************************************* - */ -#define M360_BRG_RST (1<<17) /* Reset generator */ -#define M360_BRG_EN (1<<16) /* Enable generator */ -#define M360_BRG_EXTC_BRGCLK (0<<14) /* Source is BRGCLK */ -#define M360_BRG_EXTC_CLK2 (1<<14) /* Source is CLK2 pin */ -#define M360_BRG_EXTC_CLK6 (2<<14) /* Source is CLK6 pin */ -#define M360_BRG_ATB (1<<13) /* Autobaud */ -#define M360_BRG_115200 (13<<1) /* Assume 25 MHz clock */ -#define M360_BRG_57600 (26<<1) -#define M360_BRG_38400 (40<<1) -#define M360_BRG_19200 (80<<1) -#define M360_BRG_9600 (162<<1) -#define M360_BRG_4800 (324<<1) -#define M360_BRG_2400 (650<<1) -#define M360_BRG_1200 (1301<<1) -#define M360_BRG_600 (2603<<1) -#define M360_BRG_300 ((324<<1) | 1) -#define M360_BRG_150 ((650<<1) | 1) -#define M360_BRG_75 ((1301<<1) | 1) - -/* - ************************************************************************* - * MC68360 DUAL-PORT RAM AND REGISTERS * - ************************************************************************* - */ -typedef struct m360_ { - /* - * Dual-port RAM - */ - unsigned char dpram0[0x400]; /* Microcode program */ - unsigned char dpram1[0x200]; - unsigned char dpram2[0x100]; /* Microcode scratch */ - unsigned char dpram3[0x100]; /* Not on REV A or B masks */ - unsigned char _rsv0[0xC00-0x800]; - m360SCCENparms_t scc1p; - unsigned char _rsv1[0xCB0-0xC00-sizeof(m360SCCENparms_t)]; - m360MiscParms_t miscp; - unsigned char _rsv2[0xD00-0xCB0-sizeof(m360MiscParms_t)]; - m360SCCparms_t scc2p; - unsigned char _rsv3[0xD80-0xD00-sizeof(m360SCCparms_t)]; - m360SPIparms_t spip; - unsigned char _rsv4[0xDB0-0xD80-sizeof(m360SPIparms_t)]; - m360TimerParms_t tmp; - unsigned char _rsv5[0xE00-0xDB0-sizeof(m360TimerParms_t)]; - m360SCCparms_t scc3p; - unsigned char _rsv6[0xE70-0xE00-sizeof(m360SCCparms_t)]; - m360IDMAparms_t idma1p; - unsigned char _rsv7[0xE80-0xE70-sizeof(m360IDMAparms_t)]; - m360SMCparms_t smc1p; - unsigned char _rsv8[0xF00-0xE80-sizeof(m360SMCparms_t)]; - m360SCCparms_t scc4p; - unsigned char _rsv9[0xF70-0xF00-sizeof(m360SCCparms_t)]; - m360IDMAparms_t idma2p; - unsigned char _rsv10[0xF80-0xF70-sizeof(m360IDMAparms_t)]; - m360SMCparms_t smc2p; - unsigned char _rsv11[0x1000-0xF80-sizeof(m360SMCparms_t)]; - - /* - * SIM Block - */ - unsigned long mcr; - unsigned long _pad00; - unsigned char avr; - unsigned char rsr; - unsigned short _pad01; - unsigned char clkocr; - unsigned char _pad02; - unsigned short _pad03; - unsigned short pllcr; - unsigned short _pad04; - unsigned short cdvcr; - unsigned short pepar; - unsigned long _pad05[2]; - unsigned short _pad06; - unsigned char sypcr; - unsigned char swiv; - unsigned short _pad07; - unsigned short picr; - unsigned short _pad08; - unsigned short pitr; - unsigned short _pad09; - unsigned char _pad10; - unsigned char swsr; - unsigned long bkar; - unsigned long bcar; - unsigned long _pad11[2]; - - /* - * MEMC Block - */ - unsigned long gmr; - unsigned short mstat; - unsigned short _pad12; - unsigned long _pad13[2]; - m360MEMCRegisters_t memc[8]; - unsigned char _pad14[0xF0-0xD0]; - unsigned char _pad15[0x100-0xF0]; - unsigned char _pad16[0x500-0x100]; - - /* - * IDMA1 Block - */ - unsigned short iccr; - unsigned short _pad17; - unsigned short cmr1; - unsigned short _pad18; - unsigned long sapr1; - unsigned long dapr1; - unsigned long bcr1; - unsigned char fcr1; - unsigned char _pad19; - unsigned char cmar1; - unsigned char _pad20; - unsigned char csr1; - unsigned char _pad21; - unsigned short _pad22; - - /* - * SDMA Block - */ - unsigned char sdsr; - unsigned char _pad23; - unsigned short sdcr; - unsigned long sdar; - - /* - * IDMA2 Block - */ - unsigned short _pad24; - unsigned short cmr2; - unsigned long sapr2; - unsigned long dapr2; - unsigned long bcr2; - unsigned char fcr2; - unsigned char _pad26; - unsigned char cmar2; - unsigned char _pad27; - unsigned char csr2; - unsigned char _pad28; - unsigned short _pad29; - unsigned long _pad30; - - /* - * CPIC Block - */ - unsigned long cicr; - unsigned long cipr; - unsigned long cimr; - unsigned long cisr; - - /* - * Parallel I/O Block - */ - unsigned short padir; - unsigned short papar; - unsigned short paodr; - unsigned short padat; - unsigned long _pad31[2]; - unsigned short pcdir; - unsigned short pcpar; - unsigned short pcso; - unsigned short pcdat; - unsigned short pcint; - unsigned short _pad32; - unsigned long _pad33[5]; - - /* - * TIMER Block - */ - unsigned short tgcr; - unsigned short _pad34; - unsigned long _pad35[3]; - unsigned short tmr1; - unsigned short tmr2; - unsigned short trr1; - unsigned short trr2; - unsigned short tcr1; - unsigned short tcr2; - unsigned short tcn1; - unsigned short tcn2; - unsigned short tmr3; - unsigned short tmr4; - unsigned short trr3; - unsigned short trr4; - unsigned short tcr3; - unsigned short tcr4; - unsigned short tcn3; - unsigned short tcn4; - unsigned short ter1; - unsigned short ter2; - unsigned short ter3; - unsigned short ter4; - unsigned long _pad36[2]; - - /* - * CP Block - */ - unsigned short cr; - unsigned short _pad37; - unsigned short rccr; - unsigned short _pad38; - unsigned long _pad39[3]; - unsigned short _pad40; - unsigned short rter; - unsigned short _pad41; - unsigned short rtmr; - unsigned long _pad42[5]; - - /* - * BRG Block - */ - unsigned long brgc1; - unsigned long brgc2; - unsigned long brgc3; - unsigned long brgc4; - - /* - * SCC Block - */ - m360SCCRegisters_t scc1; - m360SCCRegisters_t scc2; - m360SCCRegisters_t scc3; - m360SCCRegisters_t scc4; - - /* - * SMC Block - */ - m360SMCRegisters_t smc1; - m360SMCRegisters_t smc2; - - /* - * SPI Block - */ - unsigned short spmode; - unsigned short _pad43[2]; - unsigned char spie; - unsigned char _pad44; - unsigned short _pad45; - unsigned char spim; - unsigned char _pad46[2]; - unsigned char spcom; - unsigned short _pad47[2]; - - /* - * PIP Block - */ - unsigned short pipc; - unsigned short _pad48; - unsigned short ptpr; - unsigned long pbdir; - unsigned long pbpar; - unsigned short _pad49; - unsigned short pbodr; - unsigned long pbdat; - unsigned long _pad50[6]; - - /* - * SI Block - */ - unsigned long simode; - unsigned char sigmr; - unsigned char _pad51; - unsigned char sistr; - unsigned char sicmr; - unsigned long _pad52; - unsigned long sicr; - unsigned short _pad53; - unsigned short sirp[2]; - unsigned short _pad54; - unsigned long _pad55[2]; - unsigned char siram[256]; -} m360_t; - -extern volatile m360_t m360; - -#endif /* __MC68360_h */ diff --git a/cpukit/score/cpu/m68k/rtems/m68k/qsm.h b/cpukit/score/cpu/m68k/rtems/m68k/qsm.h deleted file mode 100644 index 9853978115..0000000000 --- a/cpukit/score/cpu/m68k/rtems/m68k/qsm.h +++ /dev/null @@ -1,205 +0,0 @@ -/* - *------------------------------------------------------------------- - * - * QSM -- Queued Serial Module - * - * The QSM contains two serial interfaces: (a) the queued serial - * peripheral interface (QSPI) and the serial communication interface - * (SCI). The QSPI provides peripheral expansion and/or interprocessor - * communication through a full-duplex, synchronous, three-wire bus. A - * self contained RAM queue permits serial data transfers without CPU - * intervention and automatic continuous sampling. The SCI provides a - * standard non-return to zero mark/space format with wakeup functions - * to allow the CPU to run uninterrupted until woken - * - * For more information, refer to Motorola's "Modular Microcontroller - * Family Queued Serial Module Reference Manual" (Motorola document - * QSMRM/AD). - * - * This file has been created by John S. Gwynne for support of - * Motorola's 68332 MCU in the efi332 project. - * - * Redistribution and use in source and binary forms are permitted - * provided that the following conditions are met: - * 1. Redistribution of source code and documentation must retain - * the above authorship, this list of conditions and the - * following disclaimer. - * 2. The name of the author may not be used to endorse or promote - * products derived from this software without specific prior - * written permission. - * - * This software is provided "AS IS" without warranty of any kind, - * either expressed or implied, including, but not limited to, the - * implied warranties of merchantability, title and fitness for a - * particular purpose. - * - *------------------------------------------------------------------ - * - * $Id$ - */ - -#ifndef _QSM_H_ -#define _QSM_H_ - -/* SAM-- shift and mask */ -#undef SAM -#define SAM(a,b,c) ((a << b) & c) - - -/* QSM_CRB (QSM Control Register Block) base address of the QSM - control registers */ -#if SIM_MM == 0 -#define QSM_CRB 0x7ffc00 -#else -#undef SIM_MM -#define SIM_MM 1 -#define QSM_CRB 0xfffc00 -#endif - - -#define QSMCR (volatile unsigned short int * const)(0x00 + QSM_CRB) - /* QSM Configuration Register */ -#define STOP 0x8000 /* Stop Enable */ -#define FRZ 0x6000 /* Freeze Control */ -#define SUPV 0x0080 /* Supervisor/Unrestricted */ -#define IARB 0x000f /* Inerrupt Arbitration */ - - -#define QTEST (volatile unsigned short int * const)(0x02 + QSM_CRB) - /* QSM Test Register */ -/* Used only for factor testing */ - - -#define QILR (volatile unsigned char * const)(0x04 + QSM_CRB) - /* QSM Interrupt Level Register */ -#define ILQSPI 0x38 /* Interrupt Level for QSPI */ -#define ILSCI 0x07 /* Interrupt Level for SCI */ - - -#define QIVR (volatile unsigned char * const)(0x05 + QSM_CRB) - /* QSM Interrupt Vector Register */ -#define INTV 0xff /* Interrupt Vector Number */ - - -#define SCCR0 (volatile unsigned short int * const)(0x08 + QSM_CRB) - /* SCI Control Register 0 */ -#define SCBR 0x1fff /* SCI Baud Rate */ - - -#define SCCR1 (volatile unsigned short int * const)(0x0a + QSM_CRB) - /* SCI Control Register 1 */ -#define LOOPS 0x4000 /* Loop Mode */ -#define WOMS 0x2000 /* Wired-OR Mode for SCI Pins */ -#define ILT 0x1000 /* Idle-Line Detect Type */ -#define PT 0x0800 /* Parity Type */ -#define PE 0x0400 /* Parity Enable */ -#define M 0x0200 /* Mode Select */ -#define WAKE 0x0100 /* Wakeup by Address Mark */ -#define TIE 0x0080 /* Transmit Complete Interrupt Enable */ -#define TCIE 0x0040 /* Transmit Complete Interrupt Enable */ -#define RIE 0x0020 /* Receiver Interrupt Enable */ -#define ILIE 0x0010 /* Idle-Line Interrupt Enable */ -#define TE 0x0008 /* Transmitter Enable */ -#define RE 0x0004 /* Receiver Enable */ -#define RWU 0x0002 /* Receiver Wakeup */ -#define SBK 0x0001 /* Send Break */ - - -#define SCSR (volatile unsigned short int * const)(0x0c + QSM_CRB) - /* SCI Status Register */ -#define TDRE 0x0100 /* Transmit Data Register Empty */ -#define TC 0x0080 /* Transmit Complete */ -#define RDRF 0x0040 /* Receive Data Register Full */ -#define RAF 0x0020 /* Receiver Active */ -#define IDLE 0x0010 /* Idle-Line Detected */ -#define OR 0x0008 /* Overrun Error */ -#define NF 0x0004 /* Noise Error Flag */ -#define FE 0x0002 /* Framing Error */ -#define PF 0x0001 /* Parity Error */ - - -#define SCDR (volatile unsigned short int * const)(0x0e + QSM_CRB) - /* SCI Data Register */ - - -#define PORTQS (volatile unsigned char * const)(0x15 + QSM_CRB) - /* Port QS Data Register */ - -#define PQSPAR (volatile unsigned char * const)(0x16 + QSM_CRB) - /* PORT QS Pin Assignment Rgister */ -/* Any bit cleared (zero) defines the corresponding pin to be an I/O - pin. Any bit set defines the corresponding pin to be a QSPI - signal. */ -/* note: PQS2 is a digital I/O pin unless the SPI is enabled in which - case it becomes the SPI serial clock SCK. */ -/* note: PQS7 is a digital I/O pin unless the SCI transmitter is - enabled in which case it becomes the SCI serial output TxD. */ -#define QSMFun 0x0 -#define QSMDis 0x1 -/* - * PQSPAR Field | QSM Function | Discrete I/O pin - *------------------+--------------+------------------ */ -#define PQSPA0 0 /* MISO | PQS0 */ -#define PQSPA1 1 /* MOSI | PQS1 */ -#define PQSPA2 2 /* SCK | PQS2 (see note)*/ -#define PQSPA3 3 /* PCSO/!SS | PQS3 */ -#define PQSPA4 4 /* PCS1 | PQS4 */ -#define PQSPA5 5 /* PCS2 | PQS5 */ -#define PQSPA6 6 /* PCS3 | PQS6 */ -#define PQSPA7 7 /* TxD | PQS7 (see note)*/ - - -#define DDRQS (volatile unsigned char * const)(0x17 + QSM_CRB) - /* PORT QS Data Direction Register */ -/* Clearing a bit makes the corresponding pin an input; setting a bit - makes the pin an output. */ - - -#define SPCR0 (volatile unsigned short int * const)(0x18 + QSM_CRB) - /* QSPI Control Register 0 */ -#define MSTR 0x8000 /* Master/Slave Mode Select */ -#define WOMQ 0x4000 /* Wired-OR Mode for QSPI Pins */ -#define BITS 0x3c00 /* Bits Per Transfer */ -#define CPOL 0x0200 /* Clock Polarity */ -#define CPHA 0x0100 /* Clock Phase */ -#define SPBR 0x00ff /* Serial Clock Baud Rate */ - - -#define SPCR1 (volatile unsigned short int * const)(0x1a + QSM_CRB) - /* QSPI Control Register 1 */ -#define SPE 0x8000 /* QSPI Enable */ -#define DSCKL 0x7f00 /* Delay before SCK */ -#define DTL 0x00ff /* Length of Delay after Transfer */ - - -#define SPCR2 (volatile unsigned short int * const)(0x1c + QSM_CRB) - /* QSPI Control Register 2 */ -#define SPIFIE 0x8000 /* SPI Finished Interrupt Enable */ -#define WREN 0x4000 /* Wrap Enable */ -#define WRTO 0x2000 /* Wrap To */ -#define ENDQP 0x0f00 /* Ending Queue Pointer */ -#define NEWQP 0x000f /* New Queue Pointer Value */ - - -#define SPCR3 (volatile unsigned char * const)(0x1e + QSM_CRB) - /* QSPI Control Register 3 */ -#define LOOPQ 0x0400 /* QSPI Loop Mode */ -#define HMIE 0x0200 /* HALTA and MODF Interrupt Enable */ -#define HALT 0x0100 /* Halt */ - - -#define SPSR (volatile unsigned char * const)(0x1f + QSM_CRB) - /* QSPI Status Register */ -#define SPIF 0x0080 /* QSPI Finished Flag */ -#define MODF 0x0040 /* Mode Fault Flag */ -#define HALTA 0x0020 /* Halt Acknowlwdge Flag */ -#define CPTQP x0000f /* Completed Queue Pointer */ - -#define QSPIRR (volatile unsigned char * const)(0x100 + QSM_CRB) - /* QSPI Receive Data RAM */ -#define QSPITR (volatile unsigned char * const)(0x120 + QSM_CRB) - /* QSPI Transmit Data RAM */ -#define QSPIcR (volatile unsigned char * const)(0x140 + QSM_CRB) - /* QSPI Command RAM */ - -#endif /* _QSM_H_ */ diff --git a/cpukit/score/cpu/m68k/rtems/m68k/sim.h b/cpukit/score/cpu/m68k/rtems/m68k/sim.h deleted file mode 100644 index db2ec89d3a..0000000000 --- a/cpukit/score/cpu/m68k/rtems/m68k/sim.h +++ /dev/null @@ -1,334 +0,0 @@ -/* - *------------------------------------------------------------------- - * - * SIM -- System Integration Module - * - * The system integration module (SIM) is used on many Motorola 16- - * and 32-bit MCUs for the following functions: - * - * () System configuration and protection. Bus and software watchdog - * monitors are provided in addition to periodic interrupt generators. - * - * () Clock signal generation for other intermodule bus (IMB) members - * and external devices. - * - * () The generation of chip-select signals that simplify external - * circuitry interface. - * - * () Data ports that are available for general purpose input and - * output. - * - * () A system test block that is intended only for factory tests. - * - * For more information, refer to Motorola's "Modular Microcontroller - * Family System Integration Module Reference Manual" (Motorola document - * SIMRM/AD). - * - * This file has been created by John S. Gwynne for support of - * Motorola's 68332 MCU in the efi332 project. - * - * Redistribution and use in source and binary forms are permitted - * provided that the following conditions are met: - * 1. Redistribution of source code and documentation must retain - * the above authorship, this list of conditions and the - * following disclaimer. - * 2. The name of the author may not be used to endorse or promote - * products derived from this software without specific prior - * written permission. - * - * This software is provided "AS IS" without warranty of any kind, - * either expressed or implied, including, but not limited to, the - * implied warranties of merchantability, title and fitness for a - * particular purpose. - * - *------------------------------------------------------------------ - * - * $Id$ - */ - -#ifndef _SIM_H_ -#define _SIM_H_ - - -/* SAM-- shift and mask */ -#undef SAM -#define SAM(a,b,c) ((a << b) & c) - -/* - * These macros make this file usable from assembly. - */ - -#ifdef ASM -#define SIM_VOLATILE_USHORT_POINTER -#define SIM_VOLATILE_UCHAR_POINTER -#else -#define SIM_VOLATILE_USHORT_POINTER (volatile unsigned short int * const) -#define SIM_VOLATILE_UCHAR_POINTER (volatile unsigned char * const) -#endif - -/* SIM_CRB (SIM Control Register Block) base address of the SIM - control registers */ -#ifndef SIM_CRB -#if SIM_MM == 0 -#define SIM_CRB 0x7ffa00 -#else /* SIM_MM */ -#undef SIM_MM -#define SIM_MM 1 -#define SIM_CRB 0xfffa00 -#endif /* SIM_MM */ -#endif /* SIM_CRB */ - - -#define SIMCR SIM_VOLATILE_USHORT_POINTER(0x00 + SIM_CRB) - /* Module Configuration Register */ -#define EXOFF 0x8000 /* External Clock Off */ -#define FRZSW 0x4000 /* Freeze Software Enable */ -#define FRZBM 0x2000 /* Freeze Bus Monitor Enable */ -#define SLVEN 0x0800 /* Factory Test Model Enabled (ro)*/ -#define SHEN 0x0300 /* Show Cycle Enable */ -#define SUPV 0x0080 /* Supervisor/Unrestricted Data Space */ -#define MM 0x0040 /* Module Mapping */ -#define IARB 0x000f /* Interrupt Arbitration Field */ - - - -#define SIMTR SIM_VOLATILE_USHORT_POINTER(0x02 + SIM_CRB) - /* SIM Test Register */ -/* Used only for factor testing */ - - - -#define SYNCR SIM_VOLATILE_USHORT_POINTER(0x04 + SIM_CRB) - /* Clock Synthesizer Control Register */ -#define VCO 0x8000 /* Frequency Control (VCO) */ -#define PRESCALE 0x4000 /* Frequency Control Bit (Prescale) */ -#define COUNTER 0x3f00 /* Frequency Control Counter */ -#define EDIV 0x0080 /* ECLK Divide Rate */ -#define SLIMP 0x0010 /* Limp Mode Status */ -#define SLOCK 0x0008 /* Synthesizer Lock */ -#define RSTEN 0x0004 /* Reset Enable */ -#define STSIM 0x0002 /* Stop Mode SIM Clock */ -#define STEXT 0x0001 /* Stop Mode External Clock */ - - - -#define RSR SIM_VOLATILE_UCHAR_POINTER(0x07 + SIM_CRB) - /* Reset Status Register */ -#define EXT 0x0080 /* External Reset */ -#define POW 0x0040 /* Power-On Reset */ -#define SW 0x0020 /* Software Watchdog Reset */ -#define DBF 0x0010 /* Double Bus Fault Reset */ -#define LOC 0x0004 /* Loss of Clock Reset */ -#define SYS 0x0002 /* System Reset */ -#define TST 0x0001 /* Test Submodule Reset */ - - - -#define SIMTRE SIM_VOLATILE_USHORT_POINTER(0x08 + SIM_CRB) - /* System Integration Test Register */ -/* Used only for factor testing */ - - - -#define PORTE0 SIM_VOLATILE_UCHAR_POINTER(0x11 + SIM_CRB) -#define PORTE1 SIM_VOLATILE_UCHAR_POINTER(0x13 + SIM_CRB) - /* Port E Data Register */ -#define DDRE SIM_VOLATILE_UCHAR_POINTER(0x15 + SIM_CRB) - /* Port E Data Direction Register */ -#define PEPAR SIM_VOLATILE_UCHAR_POINTER(0x17 + SIM_CRB) - /* Port E Pin Assignment Register */ -/* Any bit cleared (zero) defines the corresponding pin to be an I/O - pin. Any bit set defines the corresponding pin to be a bus control - signal. */ - - - -#define PORTF0 SIM_VOLATILE_UCHAR_POINTER(0x19 + SIM_CRB) -#define PORTF1 SIM_VOLATILE_UCHAR_POINTER(0x1b + SIM_CRB) - /* Port F Data Register */ -#define DDRF SIM_VOLATILE_UCHAR_POINTER(0x1d + SIM_CRB) - /* Port E Data Direction Register */ -#define PFPAR SIM_VOLATILE_UCHAR_POINTER(0x1f + SIM_CRB) -/* Any bit cleared (zero) defines the corresponding pin to be an I/O - pin. Any bit set defines the corresponding pin to be a bus control - signal. */ - - - -#define SYPCR SIM_VOLATILE_UCHAR_POINTER(0x21 + SIM_CRB) -/* !!! can write to only once after reset !!! */ - /* System Protection Control Register */ -#define SWE 0x80 /* Software Watch Enable */ -#define SWP 0x40 /* Software Watchdog Prescale */ -#define SWT 0x30 /* Software Watchdog Timing */ -#define HME 0x08 /* Halt Monitor Enable */ -#define BME 0x04 /* Bus Monitor External Enable */ -#define BMT 0x03 /* Bus Monitor Timing */ - - - -#define PICR SIM_VOLATILE_USHORT_POINTER(0x22 + SIM_CRB) - /* Periodic Interrupt Control Reg. */ -#define PIRQL 0x0700 /* Periodic Interrupt Request Level */ -#define PIV 0x00ff /* Periodic Interrupt Level */ - - - -#define PITR SIM_VOLATILE_USHORT_POINTER(0x24 + SIM_CRB) - /* Periodic Interrupt Timer Register */ -#define PTP 0x0100 /* Periodic Timer Prescaler Control */ -#define PITM 0x00ff /* Periodic Interrupt Timing Modulus */ - - - -#define SWSR SIM_VOLATILE_UCHAR_POINTER(0x27 + SIM_CRB) - /* Software Service Register */ -/* write 0x55 then 0xaa to service the software watchdog */ - - - -#define TSTMSRA SIM_VOLATILE_USHORT_POINTER(0x30 + SIM_CRB) - /* Test Module Master Shift A */ -#define TSTMSRB SIM_VOLATILE_USHORT_POINTER(0x32 + SIM_CRB) - /* Test Module Master Shift A */ -#define TSTSC SIM_VOLATILE_USHORT_POINTER(0x34 + SIM_CRB) - /* Test Module Shift Count */ -#define TSTRC SIM_VOLATILE_USHORT_POINTER(0x36 + SIM_CRB) - /* Test Module Repetition Counter */ -#define CREG SIM_VOLATILE_USHORT_POINTER(0x38 + SIM_CRB) - /* Test Module Control */ -#define DREG SIM_VOLATILE_USHORT_POINTER(0x3a + SIM_CRB) - /* Test Module Distributed */ -/* Used only for factor testing */ - - - -#define PORTC SIM_VOLATILE_UCHAR_POINTER(0x41 + SIM_CRB) - /* Port C Data */ - - - -#define CSPAR0 SIM_VOLATILE_USHORT_POINTER(0x44 + SIM_CRB) - /* Chip Select Pin Assignment - Resgister 0 */ -/* CSPAR0 contains seven two-bit fields that determine the functions - of corresponding chip-select pins. CSPAR0[15:14] are not - used. These bits always read zero; write have no effect. CSPAR0 bit - 1 always reads one; writes to CSPAR0 bit 1 have no effect. */ -#define CSPAR1 SIM_VOLATILE_USHORT_POINTER(0x46 + SIM_CRB) - /* Chip Select Pin Assignment - Register 1 */ -/* CSPAR1 contains five two-bit fields that determine the finctions of - corresponding chip-select pins. CSPAR1[15:10] are not used. These - bits always read zero; writes have no effect. */ -/* - * - * Bit Field | Description - * ------------+--------------- - * 00 | Discrete Output - * 01 | Alternate Function - * 10 | Chip Select (8-bit port) - * 11 | Chip Select (16-bit port) - */ -#define DisOut 0x0 -#define AltFun 0x1 -#define CS8bit 0x2 -#define CS16bit 0x3 -/* - * - * CSPARx Field |Chip Select Signal | Alternate Signal | Discrete Output - *-----------------+--------------------+--------------------+---------------*/ -#define CS_5 12 /* !CS5 | FC2 | PC2 */ -#define CS_4 10 /* !CS4 | FC1 | PC1 */ -#define CS_3 8 /* !CS3 | FC0 | PC0 */ -#define CS_2 6 /* !CS2 | !BGACK | */ -#define CS_1 4 /* !CS1 | !BG | */ -#define CS_0 2 /* !CS0 | !BR | */ -#define CSBOOT 0 /* !CSBOOT | | */ -/* | | | */ -#define CS_10 8 /* !CS10 | ADDR23 | ECLK */ -#define CS_9 6 /* !CS9 | ADDR22 | PC6 */ -#define CS_8 4 /* !CS8 | ADDR21 | PC5 */ -#define CS_7 2 /* !CS7 | ADDR20 | PC4 */ -#define CS_6 0 /* !CS6 | ADDR19 | PC3 */ - -#define BS_2K 0x0 -#define BS_8K 0x1 -#define BS_16K 0x2 -#define BS_64K 0x3 -#define BS_128K 0x4 -#define BS_256K 0x5 -#define BS_512K 0x6 -#define BS_1M 0x7 - -#define CSBARBT SIM_VOLATILE_USHORT_POINTER(0x48 + SIM_CRB) -#define CSBAR0 SIM_VOLATILE_USHORT_POINTER(0x4c + SIM_CRB) -#define CSBAR1 SIM_VOLATILE_USHORT_POINTER(0x50 + SIM_CRB) -#define CSBAR2 SIM_VOLATILE_USHORT_POINTER(0x54 + SIM_CRB) -#define CSBAR3 SIM_VOLATILE_USHORT_POINTER(0x58 + SIM_CRB) -#define CSBAR4 SIM_VOLATILE_USHORT_POINTER(0x5c + SIM_CRB) -#define CSBAR5 SIM_VOLATILE_USHORT_POINTER(0x60 + SIM_CRB) -#define CSBAR6 SIM_VOLATILE_USHORT_POINTER(0x64 + SIM_CRB) -#define CSBAR7 SIM_VOLATILE_USHORT_POINTER(0x68 + SIM_CRB) -#define CSBAR8 SIM_VOLATILE_USHORT_POINTER(0x6c + SIM_CRB) -#define CSBAR9 SIM_VOLATILE_USHORT_POINTER(0x70 + SIM_CRB) -#define CSBAR10 SIM_VOLATILE_USHORT_POINTER(0x74 + SIM_CRB) - -#define MODE 0x8000 -#define Disable 0 -#define LowerByte 0x2000 -#define UpperByte 0x4000 -#define BothBytes 0x6000 -#define ReadOnly 0x0800 -#define WriteOnly 0x1000 -#define ReadWrite 0x1800 -#define SyncAS 0x0 -#define SyncDS 0x0400 - -#define WaitStates_0 (0x0 << 6) -#define WaitStates_1 (0x1 << 6) -#define WaitStates_2 (0x2 << 6) -#define WaitStates_3 (0x3 << 6) -#define WaitStates_4 (0x4 << 6) -#define WaitStates_5 (0x5 << 6) -#define WaitStates_6 (0x6 << 6) -#define WaitStates_7 (0x7 << 6) -#define WaitStates_8 (0x8 << 6) -#define WaitStates_9 (0x9 << 6) -#define WaitStates_10 (0xa << 6) -#define WaitStates_11 (0xb << 6) -#define WaitStates_12 (0xc << 6) -#define WaitStates_13 (0xd << 6) -#define FastTerm (0xe << 6) -#define External (0xf << 6) - -#define CPUSpace (0x0 << 4) -#define UserSpace (0x1 << 4) -#define SupSpace (0x2 << 4) -#define UserSupSpace (0x3 << 4) - -#define IPLevel_any 0x0 -#define IPLevel_1 0x2 -#define IPLevel_2 0x4 -#define IPLevel_3 0x6 -#define IPLevel_4 0x8 -#define IPLevel_5 0xa -#define IPLevel_6 0xc -#define IPLevel_7 0xe - -#define AVEC 1 - -#define CSORBT SIM_VOLATILE_USHORT_POINTER(0x4a + SIM_CRB) -#define CSOR0 SIM_VOLATILE_USHORT_POINTER(0x4e + SIM_CRB) -#define CSOR1 SIM_VOLATILE_USHORT_POINTER(0x52 + SIM_CRB) -#define CSOR2 SIM_VOLATILE_USHORT_POINTER(0x56 + SIM_CRB) -#define CSOR3 SIM_VOLATILE_USHORT_POINTER(0x5a + SIM_CRB) -#define CSOR4 SIM_VOLATILE_USHORT_POINTER(0x5e + SIM_CRB) -#define CSOR5 SIM_VOLATILE_USHORT_POINTER(0x62 + SIM_CRB) -#define CSOR6 SIM_VOLATILE_USHORT_POINTER(0x66 + SIM_CRB) -#define CSOR7 SIM_VOLATILE_USHORT_POINTER(0x6a + SIM_CRB) -#define CSOR8 SIM_VOLATILE_USHORT_POINTER(0x6e + SIM_CRB) -#define CSOR9 SIM_VOLATILE_USHORT_POINTER(0x72 + SIM_CRB) -#define CSOR10 SIM_VOLATILE_USHORT_POINTER(0x76 + SIM_CRB) - -#endif /* _SIM_h_ */ diff --git a/cpukit/score/cpu/mips/rtems/asm.h b/cpukit/score/cpu/mips/rtems/asm.h deleted file mode 100644 index 509678fad3..0000000000 --- a/cpukit/score/cpu/mips/rtems/asm.h +++ /dev/null @@ -1,159 +0,0 @@ -/* asm.h - * - * This include file attempts to address the problems - * caused by incompatible flavors of assemblers and - * toolsets. It primarily addresses variations in the - * use of leading underscores on symbols and the requirement - * that register names be preceded by a %. - * - * - * NOTE: The spacing in the use of these macros - * is critical to them working as advertised. - * - * COPYRIGHT: - * - * This file is based on similar code found in newlib available - * from ftp.cygnus.com. The file which was used had no copyright - * notice. This file is freely distributable as long as the source - * of the file is noted. This file is: - * - * COPYRIGHT (c) 1994-1997. - * On-Line Applications Research Corporation (OAR). - * - * $Id$ - */ -/* @(#)asm.h 03/15/96 1.1 */ - -#ifndef __NO_CPU_ASM_h -#define __NO_CPU_ASM_h - -/* - * Indicate we are in an assembly file and get the basic CPU definitions. - */ - -#ifndef ASM -#define ASM -#endif -#include -#include - -/* - * Recent versions of GNU cpp define variables which indicate the - * need for underscores and percents. If not using GNU cpp or - * the version does not support this, then you will obviously - * have to define these as appropriate. - */ - -#ifndef __USER_LABEL_PREFIX__ -#define __USER_LABEL_PREFIX__ _ -#endif - -#ifndef __REGISTER_PREFIX__ -#define __REGISTER_PREFIX__ -#endif - -/* ANSI concatenation macros. */ - -#define CONCAT1(a, b) CONCAT2(a, b) -#define CONCAT2(a, b) a ## b - -/* Use the right prefix for global labels. */ - -#define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x) - -/* Use the right prefix for registers. */ - -#define REG(x) CONCAT1 (__REGISTER_PREFIX__, x) - -/* - * define macros for all of the registers on this CPU - * - * EXAMPLE: #define d0 REG (d0) - */ - -/* - * Define macros to handle section beginning and ends. - */ - - -#define BEGIN_CODE_DCL .text -#define END_CODE_DCL -#define BEGIN_DATA_DCL .data -#define END_DATA_DCL -#define BEGIN_CODE .text -#define END_CODE -#define BEGIN_DATA -#define END_DATA -#define BEGIN_BSS -#define END_BSS -#define END - -/* - * Following must be tailor for a particular flavor of the C compiler. - * They may need to put underscores in front of the symbols. - */ - -#define PUBLIC(sym) .globl SYM (sym) -#define EXTERN(sym) .globl SYM (sym) - -/* - * Debugger macros for assembly language routines. Allows the - * programmer to set up the necessary stack frame info - * required by debuggers to do stack traces. - */ - -#ifndef XDS -#define FRAME(name,frm_reg,offset,ret_reg) \ - .globl name; \ - .ent name; \ -name:; \ - .frame frm_reg,offset,ret_reg -#define ENDFRAME(name) \ - .end name -#else -#define FRAME(name,frm_reg,offset,ret_reg) \ - .globl _##name;\ -_##name: -#define ENDFRAME(name) -#endif XDS - -/* - * Hardware Floating Point Registers - */ - -#define R_FP0 0 -#define R_FP1 1 -#define R_FP2 2 -#define R_FP3 3 -#define R_FP4 4 -#define R_FP5 5 -#define R_FP6 6 -#define R_FP7 7 -#define R_FP8 8 -#define R_FP9 9 -#define R_FP10 10 -#define R_FP11 11 -#define R_FP12 12 -#define R_FP13 13 -#define R_FP14 14 -#define R_FP15 15 -#define R_FP16 16 -#define R_FP17 17 -#define R_FP18 18 -#define R_FP19 19 -#define R_FP20 20 -#define R_FP21 21 -#define R_FP22 22 -#define R_FP23 23 -#define R_FP24 24 -#define R_FP25 25 -#define R_FP26 26 -#define R_FP27 27 -#define R_FP28 28 -#define R_FP29 29 -#define R_FP30 30 -#define R_FP31 31 - -#endif -/* end of include file */ - diff --git a/cpukit/score/cpu/mips/rtems/mips/idtcpu.h b/cpukit/score/cpu/mips/rtems/mips/idtcpu.h deleted file mode 100644 index 435fad35a2..0000000000 --- a/cpukit/score/cpu/mips/rtems/mips/idtcpu.h +++ /dev/null @@ -1,478 +0,0 @@ -/* - -Based upon IDT provided code with the following release: - -This source code has been made available to you by IDT on an AS-IS -basis. Anyone receiving this source is licensed under IDT copyrights -to use it in any way he or she deems fit, including copying it, -modifying it, compiling it, and redistributing it either with or -without modifications. No license under IDT patents or patent -applications is to be implied by the copyright license. - -Any user of this software should understand that IDT cannot provide -technical support for this software and will not be responsible for -any consequences resulting from the use of this software. - -Any person who transfers this source code or any derivative work must -include the IDT copyright notice, this paragraph, and the preceeding -two paragraphs in the transferred software. - -COPYRIGHT IDT CORPORATION 1996 -LICENSED MATERIAL - PROGRAM PROPERTY OF IDT - - $Id$ -*/ - -/* -** idtcpu.h -- cpu related defines -*/ - -#ifndef _IDTCPU_H__ -#define _IDTCPU_H__ - -/* - * 950313: Ketan added Register definition for XContext reg. - * added define for WAIT instruction. - * 950421: Ketan added Register definition for Config reg (R3081) - */ - -/* -** memory configuration and mapping -*/ -#define K0BASE 0x80000000 -#define K0SIZE 0x20000000 -#define K1BASE 0xa0000000 -#define K1SIZE 0x20000000 -#define K2BASE 0xc0000000 -#define K2SIZE 0x20000000 -#if __mips == 3 -#define KSBASE 0xe0000000 -#define KSSIZE 0x20000000 -#endif - -#define KUBASE 0 -#define KUSIZE 0x80000000 - -/* -** Exception Vectors -*/ -#if __mips == 1 -#define UT_VEC K0BASE /* utlbmiss vector */ -#define DB_VEC (K0BASE+0x40) /* debug vector */ -#define E_VEC (K0BASE+0x80) /* exception vector */ -#elif __mips == 3 -#define T_VEC (K0BASE+0x000) /* tlbmiss vector */ -#define X_VEC (K0BASE+0x080) /* xtlbmiss vector */ -#define C_VEC (K0BASE+0x100) /* cache error vector */ -#define E_VEC (K0BASE+0x180) /* exception vector */ -#else -#error "EXCEPTION VECTORS: unknown ISA level" -#endif -#define R_VEC (K1BASE+0x1fc00000) /* reset vector */ - -/* -** Address conversion macros -*/ -#ifdef CLANGUAGE -#define CAST(as) (as) -#else -#define CAST(as) -#endif -#define K0_TO_K1(x) (CAST(unsigned)(x)|0xA0000000) /* kseg0 to kseg1 */ -#define K1_TO_K0(x) (CAST(unsigned)(x)&0x9FFFFFFF) /* kseg1 to kseg0 */ -#define K0_TO_PHYS(x) (CAST(unsigned)(x)&0x1FFFFFFF) /* kseg0 to physical */ -#define K1_TO_PHYS(x) (CAST(unsigned)(x)&0x1FFFFFFF) /* kseg1 to physical */ -#define PHYS_TO_K0(x) (CAST(unsigned)(x)|0x80000000) /* physical to kseg0 */ -#define PHYS_TO_K1(x) (CAST(unsigned)(x)|0xA0000000) /* physical to kseg1 */ - -/* -** Cache size constants -*/ -#define MINCACHE 0x200 /* 512 For 3041. */ -#define MAXCACHE 0x40000 /* 256*1024 256k */ - -#if __mips == 3 -/* R4000 configuration register definitions */ -#define CFG_CM 0x80000000 /* Master-Checker mode */ -#define CFG_ECMASK 0x70000000 /* System Clock Ratio */ -#define CFG_ECBY2 0x00000000 /* divide by 2 */ -#define CFG_ECBY3 0x10000000 /* divide by 3 */ -#define CFG_ECBY4 0x20000000 /* divide by 4 */ -#define CFG_EPMASK 0x0f000000 /* Transmit data pattern */ -#define CFG_EPD 0x00000000 /* D */ -#define CFG_EPDDX 0x01000000 /* DDX */ -#define CFG_EPDDXX 0x02000000 /* DDXX */ -#define CFG_EPDXDX 0x03000000 /* DXDX */ -#define CFG_EPDDXXX 0x04000000 /* DDXXX */ -#define CFG_EPDDXXXX 0x05000000 /* DDXXXX */ -#define CFG_EPDXXDXX 0x06000000 /* DXXDXX */ -#define CFG_EPDDXXXXX 0x07000000 /* DDXXXXX */ -#define CFG_EPDXXXDXXX 0x08000000 /* DXXXDXXX */ -#define CFG_SBMASK 0x00c00000 /* Secondary cache block size */ -#define CFG_SBSHIFT 22 -#define CFG_SB4 0x00000000 /* 4 words */ -#define CFG_SB8 0x00400000 /* 8 words */ -#define CFG_SB16 0x00800000 /* 16 words */ -#define CFG_SB32 0x00c00000 /* 32 words */ -#define CFG_SS 0x00200000 /* Split secondary cache */ -#define CFG_SW 0x00100000 /* Secondary cache port width */ -#define CFG_EWMASK 0x000c0000 /* System port width */ -#define CFG_EWSHIFT 18 -#define CFG_EW64 0x00000000 /* 64 bit */ -#define CFG_EW32 0x00010000 /* 32 bit */ -#define CFG_SC 0x00020000 /* Secondary cache absent */ -#define CFG_SM 0x00010000 /* Dirty Shared mode disabled */ -#define CFG_BE 0x00008000 /* Big Endian */ -#define CFG_EM 0x00004000 /* ECC mode enable */ -#define CFG_EB 0x00002000 /* Block ordering */ -#define CFG_ICMASK 0x00000e00 /* Instruction cache size */ -#define CFG_ICSHIFT 9 -#define CFG_DCMASK 0x000001c0 /* Data cache size */ -#define CFG_DCSHIFT 6 -#define CFG_IB 0x00000020 /* Instruction cache block size */ -#define CFG_DB 0x00000010 /* Data cache block size */ -#define CFG_CU 0x00000008 /* Update on Store Conditional */ -#define CFG_K0MASK 0x00000007 /* KSEG0 coherency algorithm */ - -/* - * R4000 primary cache mode - */ -#define CFG_C_UNCACHED 2 -#define CFG_C_NONCOHERENT 3 -#define CFG_C_COHERENTXCL 4 -#define CFG_C_COHERENTXCLW 5 -#define CFG_C_COHERENTUPD 6 - -/* - * R4000 cache operations (should be in assembler...?) - */ -#define Index_Invalidate_I 0x0 /* 0 0 */ -#define Index_Writeback_Inv_D 0x1 /* 0 1 */ -#define Index_Invalidate_SI 0x2 /* 0 2 */ -#define Index_Writeback_Inv_SD 0x3 /* 0 3 */ -#define Index_Load_Tag_I 0x4 /* 1 0 */ -#define Index_Load_Tag_D 0x5 /* 1 1 */ -#define Index_Load_Tag_SI 0x6 /* 1 2 */ -#define Index_Load_Tag_SD 0x7 /* 1 3 */ -#define Index_Store_Tag_I 0x8 /* 2 0 */ -#define Index_Store_Tag_D 0x9 /* 2 1 */ -#define Index_Store_Tag_SI 0xA /* 2 2 */ -#define Index_Store_Tag_SD 0xB /* 2 3 */ -#define Create_Dirty_Exc_D 0xD /* 3 1 */ -#define Create_Dirty_Exc_SD 0xF /* 3 3 */ -#define Hit_Invalidate_I 0x10 /* 4 0 */ -#define Hit_Invalidate_D 0x11 /* 4 1 */ -#define Hit_Invalidate_SI 0x12 /* 4 2 */ -#define Hit_Invalidate_SD 0x13 /* 4 3 */ -#define Hit_Writeback_Inv_D 0x15 /* 5 1 */ -#define Hit_Writeback_Inv_SD 0x17 /* 5 3 */ -#define Fill_I 0x14 /* 5 0 */ -#define Hit_Writeback_D 0x19 /* 6 1 */ -#define Hit_Writeback_SD 0x1B /* 6 3 */ -#define Hit_Writeback_I 0x18 /* 6 0 */ -#define Hit_Set_Virtual_SI 0x1E /* 7 2 */ -#define Hit_Set_Virtual_SD 0x1F /* 7 3 */ - -#ifndef WAIT -#define WAIT .word 0x42000020 -#endif /* WAIT */ - -/* Disabled by joel -- horrible overload of common word. -#ifndef wait -#define wait .word 0x42000020 -#endif wait -*/ - -#endif - -/* -** TLB resource defines -*/ -#if __mips == 1 -#define N_TLB_ENTRIES 64 -#define TLB_PGSIZE 0x1000 -#define RANDBASE 8 -#define TLBLO_PFNMASK 0xfffff000 -#define TLBLO_PFNSHIFT 12 -#define TLBLO_N 0x800 /* non-cacheable */ -#define TLBLO_D 0x400 /* writeable */ -#define TLBLO_V 0x200 /* valid bit */ -#define TLBLO_G 0x100 /* global access bit */ - -#define TLBHI_VPNMASK 0xfffff000 -#define TLBHI_VPNSHIFT 12 -#define TLBHI_PIDMASK 0xfc0 -#define TLBHI_PIDSHIFT 6 -#define TLBHI_NPID 64 - -#define TLBINX_PROBE 0x80000000 -#define TLBINX_INXMASK 0x00003f00 -#define TLBINX_INXSHIFT 8 - -#define TLBRAND_RANDMASK 0x00003f00 -#define TLBRAND_RANDSHIFT 8 - -#define TLBCTXT_BASEMASK 0xffe00000 -#define TLBCTXT_BASESHIFT 21 - -#define TLBCTXT_VPNMASK 0x001ffffc -#define TLBCTXT_VPNSHIFT 2 -#endif -#if __mips == 3 -#define N_TLB_ENTRIES 48 - -#define TLBHI_VPN2MASK 0xffffe000 -#define TLBHI_PIDMASK 0x000000ff -#define TLBHI_NPID 256 - -#define TLBLO_PFNMASK 0x3fffffc0 -#define TLBLO_PFNSHIFT 6 -#define TLBLO_D 0x00000004 /* writeable */ -#define TLBLO_V 0x00000002 /* valid bit */ -#define TLBLO_G 0x00000001 /* global access bit */ -#define TLBLO_CMASK 0x00000038 /* cache algorithm mask */ -#define TLBLO_CSHIFT 3 - -#define TLBLO_UNCACHED (CFG_C_UNCACHED< k, 1 => u */ -#define SR_IEO 0x00000010 /* old interrupt enable, 1 => enable */ -#define SR_KUP 0x00000008 /* prev kernel/user, 0 => k, 1 => u */ -#define SR_IEP 0x00000004 /* prev interrupt enable, 1 => enable */ -#define SR_KUC 0x00000002 /* cur kernel/user, 0 => k, 1 => u */ -#define SR_IEC 0x00000001 /* cur interrupt enable, 1 => enable */ -#endif - -#if __mips == 3 -#define SR_CUMASK 0xf0000000 /* coproc usable bits */ -#define SR_CU3 0x80000000 /* Coprocessor 3 usable */ -#define SR_CU2 0x40000000 /* Coprocessor 2 usable */ -#define SR_CU1 0x20000000 /* Coprocessor 1 usable */ -#define SR_CU0 0x10000000 /* Coprocessor 0 usable */ - -#define SR_RP 0x08000000 /* Reduced power operation */ -#define SR_FR 0x04000000 /* Additional floating point registers */ -#define SR_RE 0x02000000 /* Reverse endian in user mode */ - -#define SR_BEV 0x00400000 /* Use boot exception vectors */ -#define SR_TS 0x00200000 /* TLB shutdown */ -#define SR_SR 0x00100000 /* Soft reset */ -#define SR_CH 0x00040000 /* Cache hit */ -#define SR_CE 0x00020000 /* Use cache ECC */ -#define SR_DE 0x00010000 /* Disable cache exceptions */ - -/* -** status register interrupt masks and bits -*/ - -#define SR_IMASK 0x0000ff00 /* Interrupt mask */ -#define SR_IMASK8 0x00000000 /* mask level 8 */ -#define SR_IMASK7 0x00008000 /* mask level 7 */ -#define SR_IMASK6 0x0000c000 /* mask level 6 */ -#define SR_IMASK5 0x0000e000 /* mask level 5 */ -#define SR_IMASK4 0x0000f000 /* mask level 4 */ -#define SR_IMASK3 0x0000f800 /* mask level 3 */ -#define SR_IMASK2 0x0000fc00 /* mask level 2 */ -#define SR_IMASK1 0x0000fe00 /* mask level 1 */ -#define SR_IMASK0 0x0000ff00 /* mask level 0 */ - -#define SR_IMASKSHIFT 8 - -#define SR_IBIT8 0x00008000 /* bit level 8 */ -#define SR_IBIT7 0x00004000 /* bit level 7 */ -#define SR_IBIT6 0x00002000 /* bit level 6 */ -#define SR_IBIT5 0x00001000 /* bit level 5 */ -#define SR_IBIT4 0x00000800 /* bit level 4 */ -#define SR_IBIT3 0x00000400 /* bit level 3 */ -#define SR_IBIT2 0x00000200 /* bit level 2 */ -#define SR_IBIT1 0x00000100 /* bit level 1 */ - -#define SR_KSMASK 0x00000018 /* Kernel mode mask */ -#define SR_KSUSER 0x00000010 /* User mode */ -#define SR_KSSUPER 0x00000008 /* Supervisor mode */ -#define SR_KSKERNEL 0x00000000 /* Kernel mode */ -#define SR_ERL 0x00000004 /* Error level */ -#define SR_EXL 0x00000002 /* Exception level */ -#define SR_IE 0x00000001 /* Interrupts enabled */ -#endif - - - -/* - * Cause Register - */ -#define CAUSE_BD 0x80000000 /* Branch delay slot */ -#define CAUSE_BT 0x40000000 /* Branch Taken */ -#define CAUSE_CEMASK 0x30000000 /* coprocessor error */ -#define CAUSE_CESHIFT 28 - - -#define CAUSE_IPMASK 0x0000FF00 /* Pending interrupt mask */ -#define CAUSE_IPSHIFT 8 - -#define CAUSE_EXCMASK 0x0000003C /* Cause code bits */ -#define CAUSE_EXCSHIFT 2 - -#ifndef XDS -/* -** Coprocessor 0 registers -*/ -#define C0_INX $0 /* tlb index */ -#define C0_RAND $1 /* tlb random */ -#if __mips == 1 -#define C0_TLBLO $2 /* tlb entry low */ -#endif -#if __mips == 3 -#define C0_TLBLO0 $2 /* tlb entry low 0 */ -#define C0_TLBLO1 $3 /* tlb entry low 1 */ -#endif - -#define C0_CTXT $4 /* tlb context */ - -#if __mips == 3 -#define C0_PAGEMASK $5 /* tlb page mask */ -#define C0_WIRED $6 /* number of wired tlb entries */ -#endif - -#if __mips == 1 -#define C0_TAR $6 -#endif - -#define C0_BADVADDR $8 /* bad virtual address */ - -#if __mips == 3 -#define C0_COUNT $9 /* cycle count */ -#endif - -#define C0_TLBHI $10 /* tlb entry hi */ - -#if __mips == 3 -#define C0_COMPARE $11 /* cyccle count comparator */ -#endif - -#define C0_SR $12 /* status register */ -#define C0_CAUSE $13 /* exception cause */ -#define C0_EPC $14 /* exception pc */ -#define C0_PRID $15 /* revision identifier */ - -#if __mips == 1 -#define C0_CONFIG $3 /* configuration register R3081*/ -#endif - -#if __mips == 3 -#define C0_CONFIG $16 /* configuration register */ -#define C0_LLADDR $17 /* linked load address */ -#define C0_WATCHLO $18 /* watchpoint trap register */ -#define C0_WATCHHI $19 /* watchpoint trap register */ -#define C0_XCTXT $20 /* extended tlb context */ -#define C0_ECC $26 /* secondary cache ECC control */ -#define C0_CACHEERR $27 /* cache error status */ -#define C0_TAGLO $28 /* cache tag lo */ -#define C0_TAGHI $29 /* cache tag hi */ -#define C0_ERRPC $30 /* cache error pc */ -#endif - -#define C1_REVISION $0 -#define C1_STATUS $31 - -#endif /* XDS */ - -#ifdef R4650 -#define IWATCH $18 -#define DWATCH $19 -#define IBASE $0 -#define IBOUND $1 -#define DBASE $2 -#define DBOUND $3 -#define CALG $17 -#endif - -#endif /* _IDTCPU_H__ */ - diff --git a/cpukit/score/cpu/mips/rtems/mips/iregdef.h b/cpukit/score/cpu/mips/rtems/mips/iregdef.h deleted file mode 100644 index 3584325e07..0000000000 --- a/cpukit/score/cpu/mips/rtems/mips/iregdef.h +++ /dev/null @@ -1,332 +0,0 @@ -/* - -Based upon IDT provided code with the following release: - -This source code has been made available to you by IDT on an AS-IS -basis. Anyone receiving this source is licensed under IDT copyrights -to use it in any way he or she deems fit, including copying it, -modifying it, compiling it, and redistributing it either with or -without modifications. No license under IDT patents or patent -applications is to be implied by the copyright license. - -Any user of this software should understand that IDT cannot provide -technical support for this software and will not be responsible for -any consequences resulting from the use of this software. - -Any person who transfers this source code or any derivative work must -include the IDT copyright notice, this paragraph, and the preceeding -two paragraphs in the transferred software. - -COPYRIGHT IDT CORPORATION 1996 -LICENSED MATERIAL - PROGRAM PROPERTY OF IDT - - $Id$ -*/ - -/* -** iregdef.h - IDT R3000 register structure header file -** -** Copyright 1989 Integrated Device Technology, Inc -** All Rights Reserved -** -*/ -#ifndef __IREGDEF_H__ -#define __IREGDEF_H__ - -/* - * 950313: Ketan added sreg/lreg and R_SZ for 64-bit saves - * added Register definition for XContext reg. - * Look towards end of this file. - */ -/* -** register names -*/ -#define r0 $0 -#define r1 $1 -#define r2 $2 -#define r3 $3 -#define r4 $4 -#define r5 $5 -#define r6 $6 -#define r7 $7 -#define r8 $8 -#define r9 $9 -#define r10 $10 -#define r11 $11 -#define r12 $12 -#define r13 $13 - -#define r14 $14 -#define r15 $15 -#define r16 $16 -#define r17 $17 -#define r18 $18 -#define r19 $19 -#define r20 $20 -#define r21 $21 -#define r22 $22 -#define r23 $23 -#define r24 $24 -#define r25 $25 -#define r26 $26 -#define r27 $27 -#define r28 $28 -#define r29 $29 -#define r30 $30 -#define r31 $31 - -#define fp0 $f0 -#define fp1 $f1 -#define fp2 $f2 -#define fp3 $f3 -#define fp4 $f4 -#define fp5 $f5 -#define fp6 $f6 -#define fp7 $f7 -#define fp8 $f8 -#define fp9 $f9 -#define fp10 $f10 -#define fp11 $f11 -#define fp12 $f12 -#define fp13 $f13 -#define fp14 $f14 -#define fp15 $f15 -#define fp16 $f16 -#define fp17 $f17 -#define fp18 $f18 -#define fp19 $f19 -#define fp20 $f20 -#define fp21 $f21 -#define fp22 $f22 -#define fp23 $f23 -#define fp24 $f24 -#define fp25 $f25 -#define fp26 $f26 -#define fp27 $f27 -#define fp28 $f28 -#define fp29 $f29 -#define fp30 $f30 -#define fp31 $f31 - -#define fcr0 $0 -#define fcr30 $30 -#define fcr31 $31 - -#define zero $0 /* wired zero */ -#define AT $at /* assembler temp */ -#define v0 $2 /* return value */ -#define v1 $3 -#define a0 $4 /* argument registers a0-a3 */ -#define a1 $5 -#define a2 $6 -#define a3 $7 -#define t0 $8 /* caller saved t0-t9 */ -#define t1 $9 -#define t2 $10 -#define t3 $11 -#define t4 $12 -#define t5 $13 -#define t6 $14 -#define t7 $15 -#define s0 $16 /* callee saved s0-s8 */ -#define s1 $17 -#define s2 $18 -#define s3 $19 -#define s4 $20 -#define s5 $21 -#define s6 $22 -#define s7 $23 -#define t8 $24 -#define t9 $25 -#define k0 $26 /* kernel usage */ -#define k1 $27 /* kernel usage */ -#define gp $28 /* sdata pointer */ -#define sp $29 /* stack pointer */ -#define s8 $30 /* yet another saved reg for the callee */ -#define fp $30 /* frame pointer - this is being phased out by MIPS */ -#define ra $31 /* return address */ - - -/* -** relative position of registers in interrupt/exception frame -*/ -#define R_R0 0 -#define R_R1 1 -#define R_R2 2 -#define R_R3 3 -#define R_R4 4 -#define R_R5 5 -#define R_R6 6 -#define R_R7 7 -#define R_R8 8 -#define R_R9 9 -#define R_R10 10 -#define R_R11 11 -#define R_R12 12 -#define R_R13 13 -#define R_R14 14 -#define R_R15 15 -#define R_R16 16 -#define R_R17 17 -#define R_R18 18 -#define R_R19 19 -#define R_R20 20 -#define R_R21 21 -#define R_R22 22 -#define R_R23 23 -#define R_R24 24 -#define R_R25 25 -#define R_R26 26 -#define R_R27 27 -#define R_R28 28 -#define R_R29 29 -#define R_R30 30 -#define R_R31 31 - -#define R_SR 32 -#define R_MDLO 33 -#define R_MDHI 34 -#define R_BADVADDR 35 -#define R_CAUSE 36 -#define R_EPC 37 - -#define R_F0 38 -#define R_F1 39 -#define R_F2 40 -#define R_F3 41 -#define R_F4 42 -#define R_F5 43 -#define R_F6 44 -#define R_F7 45 -#define R_F8 46 -#define R_F9 47 -#define R_F10 48 -#define R_F11 49 -#define R_F12 50 -#define R_F13 41 -#define R_F14 42 -#define R_F15 43 -#define R_F16 44 -#define R_F17 45 -#define R_F18 56 -#define R_F19 57 -#define R_F20 58 -#define R_F21 59 -#define R_F22 60 -#define R_F23 61 -#define R_F24 62 -#define R_F25 63 -#define R_F26 64 -#define R_F27 65 -#define R_F28 66 -#define R_F29 67 -#define R_F30 68 -#define R_F31 69 -#define R_FCSR 70 -#define R_FEIR 71 -#define R_TLBHI 72 - -#if __mips == 1 -#define R_TLBLO 73 -#endif -#if __mips == 3 -#define R_TLBLO0 73 -#endif - -#define R_INX 74 -#define R_RAND 75 -#define R_CTXT 76 -#define R_EXCTYPE 77 -#define R_MODE 78 -#define R_PRID 79 -#define R_TAR 80 -#if __mips == 1 -#define NREGS 81 -#endif -#if __mips == 3 -#define R_TLBLO1 81 -#define R_PAGEMASK 82 -#define R_WIRED 83 -#define R_COUNT 84 -#define R_COMPARE 85 -#define R_CONFIG 86 -#define R_LLADDR 87 -#define R_WATCHLO 88 -#define R_WATCHHI 89 -#define R_ECC 90 -#define R_CACHEERR 91 -#define R_TAGLO 92 -#define R_TAGHI 93 -#define R_ERRPC 94 -#define R_XCTXT 95 /* Ketan added from SIM64bit */ - -#define NREGS 96 -#endif - -/* -** For those who like to think in terms of the compiler names for the regs -*/ -#define R_ZERO R_R0 -#define R_AT R_R1 -#define R_V0 R_R2 -#define R_V1 R_R3 -#define R_A0 R_R4 -#define R_A1 R_R5 -#define R_A2 R_R6 -#define R_A3 R_R7 -#define R_T0 R_R8 -#define R_T1 R_R9 -#define R_T2 R_R10 -#define R_T3 R_R11 -#define R_T4 R_R12 -#define R_T5 R_R13 -#define R_T6 R_R14 -#define R_T7 R_R15 -#define R_S0 R_R16 -#define R_S1 R_R17 -#define R_S2 R_R18 -#define R_S3 R_R19 -#define R_S4 R_R20 -#define R_S5 R_R21 -#define R_S6 R_R22 -#define R_S7 R_R23 -#define R_T8 R_R24 -#define R_T9 R_R25 -#define R_K0 R_R26 -#define R_K1 R_R27 -#define R_GP R_R28 -#define R_SP R_R29 -#define R_FP R_R30 -#define R_RA R_R31 - -/* disabled for RTEMS */ -#if 0 -/* Ketan added the following */ -#if __mips == 1 -#define sreg sw -#define lreg lw -#define rmfc0 mfc0 -#define rmtc0 mtc0 -#define R_SZ 4 -#endif /* __mips == 1 */ - -/* #ifdef __mips == 3 */ -#if __mips < 3 -#define sreg sw -#define lreg lw -#define rmfc0 mfc0 -#define rmtc0 mtc0 -#define R_SZ 4 -#else -#define sreg sd -#define lreg ld -#define rmfc0 dmfc0 -#define rmtc0 dmtc0 -#define R_SZ 8 -#endif -/* #endif __mips == 3 */ -/* Ketan till here */ -#endif - -#endif /* __IREGDEF_H__ */ - diff --git a/cpukit/score/cpu/no_cpu/rtems/asm.h b/cpukit/score/cpu/no_cpu/rtems/asm.h deleted file mode 100644 index 3e9164a28c..0000000000 --- a/cpukit/score/cpu/no_cpu/rtems/asm.h +++ /dev/null @@ -1,101 +0,0 @@ -/* asm.h - * - * This include file attempts to address the problems - * caused by incompatible flavors of assemblers and - * toolsets. It primarily addresses variations in the - * use of leading underscores on symbols and the requirement - * that register names be preceded by a %. - * - * - * NOTE: The spacing in the use of these macros - * is critical to them working as advertised. - * - * COPYRIGHT: - * - * This file is based on similar code found in newlib available - * from ftp.cygnus.com. The file which was used had no copyright - * notice. This file is freely distributable as long as the source - * of the file is noted. This file is: - * - * COPYRIGHT (c) 1994-1997. - * On-Line Applications Research Corporation (OAR). - * - * $Id$ - */ - -#ifndef __NO_CPU_ASM_h -#define __NO_CPU_ASM_h - -/* - * Indicate we are in an assembly file and get the basic CPU definitions. - */ - -#ifndef ASM -#define ASM -#endif -#include -#include - -/* - * Recent versions of GNU cpp define variables which indicate the - * need for underscores and percents. If not using GNU cpp or - * the version does not support this, then you will obviously - * have to define these as appropriate. - */ - -#ifndef __USER_LABEL_PREFIX__ -#define __USER_LABEL_PREFIX__ _ -#endif - -#ifndef __REGISTER_PREFIX__ -#define __REGISTER_PREFIX__ -#endif - -/* ANSI concatenation macros. */ - -#define CONCAT1(a, b) CONCAT2(a, b) -#define CONCAT2(a, b) a ## b - -/* Use the right prefix for global labels. */ - -#define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x) - -/* Use the right prefix for registers. */ - -#define REG(x) CONCAT1 (__REGISTER_PREFIX__, x) - -/* - * define macros for all of the registers on this CPU - * - * EXAMPLE: #define d0 REG (d0) - */ - -/* - * Define macros to handle section beginning and ends. - */ - - -#define BEGIN_CODE_DCL .text -#define END_CODE_DCL -#define BEGIN_DATA_DCL .data -#define END_DATA_DCL -#define BEGIN_CODE .text -#define END_CODE -#define BEGIN_DATA -#define END_DATA -#define BEGIN_BSS -#define END_BSS -#define END - -/* - * Following must be tailor for a particular flavor of the C compiler. - * They may need to put underscores in front of the symbols. - */ - -#define PUBLIC(sym) .globl SYM (sym) -#define EXTERN(sym) .globl SYM (sym) - -#endif -/* end of include file */ - - diff --git a/cpukit/score/cpu/or32/rtems/asm.h b/cpukit/score/cpu/or32/rtems/asm.h deleted file mode 100644 index ddb6264d6f..0000000000 --- a/cpukit/score/cpu/or32/rtems/asm.h +++ /dev/null @@ -1,101 +0,0 @@ -/* asm.h - * - * This include file attempts to address the problems - * caused by incompatible flavors of assemblers and - * toolsets. It primarily addresses variations in the - * use of leading underscores on symbols and the requirement - * that register names be preceded by a %. - * - * - * NOTE: The spacing in the use of these macros - * is critical to them working as advertised. - * - * COPYRIGHT: - * - * This file is based on similar code found in newlib available - * from ftp.cygnus.com. The file which was used had no copyright - * notice. This file is freely distributable as long as the source - * of the file is noted. This file is: - * - * COPYRIGHT (c) 1994-1997. - * On-Line Applications Research Corporation (OAR). - * - * $Id$ - */ - -#ifndef __OR1K_ASM_h -#define __OR1K_ASM_h - -/* - * Indicate we are in an assembly file and get the basic CPU definitions. - */ - -#ifndef ASM -#define ASM -#endif -#include -#include - -/* - * Recent versions of GNU cpp define variables which indicate the - * need for underscores and percents. If not using GNU cpp or - * the version does not support this, then you will obviously - * have to define these as appropriate. - */ - -#ifndef __USER_LABEL_PREFIX__ -#define __USER_LABEL_PREFIX__ _ -#endif - -#ifndef __REGISTER_PREFIX__ -#define __REGISTER_PREFIX__ -#endif - -/* ANSI concatenation macros. */ - -#define CONCAT1(a, b) CONCAT2(a, b) -#define CONCAT2(a, b) a ## b - -/* Use the right prefix for global labels. */ - -#define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x) - -/* Use the right prefix for registers. */ - -#define REG(x) CONCAT1 (__REGISTER_PREFIX__, x) - -/* - * define macros for all of the registers on this CPU - * - * EXAMPLE: #define d0 REG (d0) - */ - -/* - * Define macros to handle section beginning and ends. - */ - - -#define BEGIN_CODE_DCL .text -#define END_CODE_DCL -#define BEGIN_DATA_DCL .data -#define END_DATA_DCL -#define BEGIN_CODE .text -#define END_CODE -#define BEGIN_DATA -#define END_DATA -#define BEGIN_BSS -#define END_BSS -#define END - -/* - * Following must be tailor for a particular flavor of the C compiler. - * They may need to put underscores in front of the symbols. - */ - -#define PUBLIC(sym) .global SYM (sym) -#define EXTERN(sym) .global SYM (sym) - -#endif -/* end of include file */ - - diff --git a/cpukit/score/cpu/powerpc/rtems/asm.h b/cpukit/score/cpu/powerpc/rtems/asm.h deleted file mode 100644 index 419202eb26..0000000000 --- a/cpukit/score/cpu/powerpc/rtems/asm.h +++ /dev/null @@ -1,292 +0,0 @@ -/* asm.h - * - * This include file attempts to address the problems - * caused by incompatible flavors of assemblers and - * toolsets. It primarily addresses variations in the - * use of leading underscores on symbols and the requirement - * that register names be preceded by a %. - * - * - * NOTE: The spacing in the use of these macros - * is critical to them working as advertised. - * - * COPYRIGHT: - * - * This file is based on similar code found in newlib available - * from ftp.cygnus.com. The file which was used had no copyright - * notice. This file is freely distributable as long as the source - * of the file is noted. This file is: - * - * COPYRIGHT (c) 1995. - * i-cubed ltd. - * - * COPYRIGHT (c) 1994. - * On-Line Applications Research Corporation (OAR). - * - * $Id$ - */ - -#ifndef __PPC_ASM_h -#define __PPC_ASM_h - -/* - * Indicate we are in an assembly file and get the basic CPU definitions. - */ - -#ifndef ASM -#define ASM -#endif -#include -#include - -/* - * Recent versions of GNU cpp define variables which indicate the - * need for underscores and percents. If not using GNU cpp or - * the version does not support this, then you will obviously - * have to define these as appropriate. - */ - -#ifndef __USER_LABEL_PREFIX__ -#define __USER_LABEL_PREFIX__ -#endif - -#ifndef __REGISTER_PREFIX__ -#define __REGISTER_PREFIX__ -#endif - -#ifndef __FLOAT_REGISTER_PREFIX__ -#define __FLOAT_REGISTER_PREFIX__ __REGISTER_PREFIX__ -#endif - -#if (PPC_ABI == PPC_ABI_POWEROPEN) -#ifndef __PROC_LABEL_PREFIX__ -#define __PROC_LABEL_PREFIX__ . -#endif -#endif - -#ifndef __PROC_LABEL_PREFIX__ -#define __PROC_LABEL_PREFIX__ __USER_LABEL_PREFIX__ -#endif - -/* ANSI concatenation macros. */ - -#define CONCAT1(a, b) CONCAT2(a, b) -#define CONCAT2(a, b) a ## b - -/* Use the right prefix for global labels. */ - -#define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x) - -/* Use the right prefix for procedure labels. */ - -#define PROC(x) CONCAT1 (__PROC_LABEL_PREFIX__, x) - -/* Use the right prefix for registers. */ - -#define REG(x) CONCAT1 (__REGISTER_PREFIX__, x) - -/* Use the right prefix for floating point registers. */ - -#define FREG(x) CONCAT1 (__FLOAT_REGISTER_PREFIX__, x) - -/* - * define macros for all of the registers on this CPU - * - * EXAMPLE: #define d0 REG (d0) - */ -#define r0 REG(0) -#define r1 REG(1) -#define r2 REG(2) -#define r3 REG(3) -#define r4 REG(4) -#define r5 REG(5) -#define r6 REG(6) -#define r7 REG(7) -#define r8 REG(8) -#define r9 REG(9) -#define r10 REG(10) -#define r11 REG(11) -#define r12 REG(12) -#define r13 REG(13) -#define r14 REG(14) -#define r15 REG(15) -#define r16 REG(16) -#define r17 REG(17) -#define r18 REG(18) -#define r19 REG(19) -#define r20 REG(20) -#define r21 REG(21) -#define r22 REG(22) -#define r23 REG(23) -#define r24 REG(24) -#define r25 REG(25) -#define r26 REG(26) -#define r27 REG(27) -#define r28 REG(28) -#define r29 REG(29) -#define r30 REG(30) -#define r31 REG(31) -#define f0 FREG(0) -#define f1 FREG(1) -#define f2 FREG(2) -#define f3 FREG(3) -#define f4 FREG(4) -#define f5 FREG(5) -#define f6 FREG(6) -#define f7 FREG(7) -#define f8 FREG(8) -#define f9 FREG(9) -#define f10 FREG(10) -#define f11 FREG(11) -#define f12 FREG(12) -#define f13 FREG(13) -#define f14 FREG(14) -#define f15 FREG(15) -#define f16 FREG(16) -#define f17 FREG(17) -#define f18 FREG(18) -#define f19 FREG(19) -#define f20 FREG(20) -#define f21 FREG(21) -#define f22 FREG(22) -#define f23 FREG(23) -#define f24 FREG(24) -#define f25 FREG(25) -#define f26 FREG(26) -#define f27 FREG(27) -#define f28 FREG(28) -#define f29 FREG(29) -#define f30 FREG(30) -#define f31 FREG(31) - -/* - * Some special purpose registers (SPRs). - */ -#define srr0 0x01a -#define srr1 0x01b -#if defined(ppc403) || defined(ppc405) -#define srr2 0x3de /* IBM 400 series only */ -#define srr3 0x3df /* IBM 400 series only */ -#endif /* ppc403 or ppc405 */ - -#define sprg0 0x110 -#define sprg1 0x111 -#define sprg2 0x112 -#define sprg3 0x113 - -#define dar 0x013 /* Data Address Register */ -#define dec 0x016 /* Decrementer Register */ - -#if defined(ppc403) || defined(ppc405) -/* the following SPR/DCR registers exist only in IBM 400 series */ -#define dear 0x3d5 -#define evpr 0x3d6 /* SPR: exception vector prefix register */ -#define iccr 0x3fb /* SPR: instruction cache control reg. */ -#define dccr 0x3fa /* SPR: data cache control reg. */ - -#if defined (ppc403) -#define exisr 0x040 /* DCR: external interrupt status register */ -#define exier 0x042 /* DCR: external interrupt enable register */ -#endif /* ppc403 */ -#if defined(ppc405) -#define exisr 0x0C0 /* DCR: external interrupt status register */ -#define exier 0x0C2 /* DCR: external interrupt enable register */ -#endif /* ppc405 */ - -#define br0 0x080 /* DCR: memory bank register 0 */ -#define br1 0x081 /* DCR: memory bank register 1 */ -#define br2 0x082 /* DCR: memory bank register 2 */ -#define br3 0x083 /* DCR: memory bank register 3 */ -#define br4 0x084 /* DCR: memory bank register 4 */ -#define br5 0x085 /* DCR: memory bank register 5 */ -#define br6 0x086 /* DCR: memory bank register 6 */ -#define br7 0x087 /* DCR: memory bank register 7 */ -/* end of IBM400 series register definitions */ - -#elif defined(mpc860) || defined(mpc821) -/* The following registers are for the MPC8x0 */ -#define der 0x095 /* Debug Enable Register */ -#define ictrl 0x09E /* Instruction Support Control Register */ -#define immr 0x27E /* Internal Memory Map Register */ -/* end of MPC8x0 registers */ -#endif - -/* - * Following must be tailor for a particular flavor of the C compiler. - * They may need to put underscores in front of the symbols. - */ - -#define PUBLIC_VAR(sym) .globl SYM (sym) -#define EXTERN_VAR(sym) .extern SYM (sym) -#define PUBLIC_PROC(sym) .globl PROC (sym) -#define EXTERN_PROC(sym) .extern PROC (sym) - -/* Other potentially assembler specific operations */ -#if PPC_ASM == PPC_ASM_ELF -#define ALIGN(n,p) .align p -#define DESCRIPTOR(x) \ - .section .descriptors,"aw"; \ - PUBLIC_VAR (x); \ -SYM (x):; \ - .long PROC (x); \ - .long s.got; \ - .long 0 - -#define EXT_SYM_REF(x) .long x -#define EXT_PROC_REF(x) .long x - -/* - * Define macros to handle section beginning and ends. - */ - -#define BEGIN_CODE_DCL .text -#define END_CODE_DCL -#define BEGIN_DATA_DCL .data -#define END_DATA_DCL -#define BEGIN_CODE .text -#define END_CODE -#define BEGIN_DATA .data -#define END_DATA -#define BEGIN_BSS .bss -#define END_BSS -#define END - -#elif PPC_ASM == PPC_ASM_XCOFF -#define ALIGN(n,p) .align p -#define DESCRIPTOR(x) \ - .csect x[DS]; \ - .globl x[DS]; \ - .long PROC (x)[PR]; \ - .long TOC[tc0] - -#define EXT_SYM_REF(x) .long x[RW] -#define EXT_PROC_REF(x) .long x[DS] - -/* - * Define macros to handle section beginning and ends. - */ - -#define BEGIN_CODE_DCL .csect .text[PR] -#define END_CODE_DCL -#define BEGIN_DATA_DCL .csect .data[RW] -#define END_DATA_DCL -#define BEGIN_CODE .csect .text[PR] -#define END_CODE -#define BEGIN_DATA .csect .data[RW] -#define END_DATA -#define BEGIN_BSS .bss -#define END_BSS -#define END - -#else -#error "PPC_ASM_TYPE is not properly defined" -#endif -#ifndef PPC_ASM -#error "PPC_ASM_TYPE is not properly defined" -#endif - - -#endif -/* end of include file */ - - diff --git a/cpukit/score/cpu/sh/rtems/asm.h b/cpukit/score/cpu/sh/rtems/asm.h deleted file mode 100644 index d4882bd4ba..0000000000 --- a/cpukit/score/cpu/sh/rtems/asm.h +++ /dev/null @@ -1,136 +0,0 @@ -/* asm.h - * - * This include file attempts to address the problems - * caused by incompatible flavors of assemblers and - * toolsets. It primarily addresses variations in the - * use of leading underscores on symbols and the requirement - * that register names be preceded by a %. - * - * Authors: Ralf Corsepius (corsepiu@faw.uni-ulm.de) and - * Bernd Becker (becker@faw.uni-ulm.de) - * - * NOTE: The spacing in the use of these macros - * is critical to them working as advertised. - * - * COPYRIGHT: - * - * This file is based on similar code found in newlib available - * from ftp.cygnus.com. The file which was used had no copyright - * notice. This file is freely distributable as long as the source - * of the file is noted. This file is: - * - * - * COPYRIGHT (c) 1997-1998, FAW Ulm, Germany - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * - * COPYRIGHT (c) 1998-2001. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#ifndef __CPU_SH_ASM_h -#define __CPU_SH_ASM_h - -/* - * Indicate we are in an assembly file and get the basic CPU definitions. - */ - -#ifndef ASM -#define ASM -#endif - -#include -#include - -/* - * Recent versions of GNU cpp define variables which indicate the - * need for underscores and percents. If not using GNU cpp or - * the version does not support this, then you will obviously - * have to define these as appropriate. - */ - -#ifndef __USER_LABEL_PREFIX__ -#define __USER_LABEL_PREFIX__ _ -#endif - -#ifndef __REGISTER_PREFIX__ -#define __REGISTER_PREFIX__ -#endif - -/* ANSI concatenation macros. */ - -#define CONCAT1(a, b) CONCAT2(a, b) -#define CONCAT2(a, b) a ## b - -/* Use the right prefix for global labels. */ - -#define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x) - -/* Use the right prefix for registers. */ - -#define REG(x) CONCAT1 (__REGISTER_PREFIX__, x) - -/* - * define macros for all of the registers on this CPU - * - * EXAMPLE: #define d0 REG (d0) - */ -#define r0 REG (r0) -#define r1 REG (r1) -#define r2 REG (r2) -#define r3 REG (r3) -#define r4 REG (r4) -#define r5 REG (r5) -#define r6 REG (r6) -#define r7 REG (r7) -#define r8 REG (r8) -#define r9 REG (r9) -#define r10 REG (r10) -#define r11 REG (r11) -#define r12 REG (r12) -#define r13 REG (r13) -#define r14 REG (r14) -#define r15 REG (r15) -#define vbr REG (vbr) -#define gbr REG (gbr) -#define pr REG (pr) -#define mach REG (mach) -#define macl REG (macl) -#define sr REG (sr) -#define pc REG (pc) - -/* - * Define macros to handle section beginning and ends. - */ - - -#define BEGIN_CODE_DCL .text -#define END_CODE_DCL -#define BEGIN_DATA_DCL .data -#define END_DATA_DCL -#define BEGIN_CODE .text -#define END_CODE -#define BEGIN_DATA -#define END_DATA -#define BEGIN_BSS -#define END_BSS -#define END - -/* - * Following must be tailor for a particular flavor of the C compiler. - * They may need to put underscores in front of the symbols. - */ - -#define PUBLIC(sym) .global SYM (sym) -#define EXTERN(sym) .global SYM (sym) - -#endif diff --git a/cpukit/score/cpu/sparc/rtems/asm.h b/cpukit/score/cpu/sparc/rtems/asm.h deleted file mode 100644 index c89f19e050..0000000000 --- a/cpukit/score/cpu/sparc/rtems/asm.h +++ /dev/null @@ -1,123 +0,0 @@ -/* asm.h - * - * This include file attempts to address the problems - * caused by incompatible flavors of assemblers and - * toolsets. It primarily addresses variations in the - * use of leading underscores on symbols and the requirement - * that register names be preceded by a %. - * - * - * NOTE: The spacing in the use of these macros - * is critical to them working as advertised. - * - * COPYRIGHT: - * - * This file is based on similar code found in newlib available - * from ftp.cygnus.com. The file which was used had no copyright - * notice. This file is freely distributable as long as the source - * of the file is noted. - * - * $Id$ - */ - -#ifndef __SPARC_ASM_h -#define __SPARC_ASM_h - -/* - * Indicate we are in an assembly file and get the basic CPU definitions. - */ - -#ifndef ASM -#define ASM -#endif - -#include -#include - -/* - * Recent versions of GNU cpp define variables which indicate the - * need for underscores and percents. If not using GNU cpp or - * the version does not support this, then you will obviously - * have to define these as appropriate. - */ - -/* XXX __USER_LABEL_PREFIX__ and __REGISTER_PREFIX__ do not work on gcc 2.7.0 */ -/* XXX The following ifdef magic fixes the problem but results in a warning */ -/* XXX when compiling assembly code. */ - -#ifndef __USER_LABEL_PREFIX__ -#define __USER_LABEL_PREFIX__ _ -#endif - -#ifndef __REGISTER_PREFIX__ -#define __REGISTER_PREFIX__ -#endif - -/* ANSI concatenation macros. */ - -#define CONCAT1(a, b) CONCAT2(a, b) -#define CONCAT2(a, b) a ## b - -/* Use the right prefix for global labels. */ - -#define SYM(x) CONCAT1 (__USER_LABEL_PREFIX__, x) - -/* Use the right prefix for registers. */ - -#define REG(x) CONCAT1 (__REGISTER_PREFIX__, x) - -/* - * define macros for all of the registers on this CPU - * - * EXAMPLE: #define d0 REG (d0) - */ - -/* - * Define macros to handle section beginning and ends. - */ - - -#define BEGIN_CODE_DCL .text -#define END_CODE_DCL -#define BEGIN_DATA_DCL .data -#define END_DATA_DCL -#define BEGIN_CODE .text -#define END_CODE -#define BEGIN_DATA -#define END_DATA -#define BEGIN_BSS -#define END_BSS -#define END - -/* - * Following must be tailor for a particular flavor of the C compiler. - * They may need to put underscores in front of the symbols. - */ - -#define PUBLIC(sym) .globl SYM (sym) -#define EXTERN(sym) .globl SYM (sym) - -/* - * Entry for traps which jump to a programmer-specified trap handler. - */ - -#define TRAP(_vector, _handler) \ - mov %psr, %l0 ; \ - sethi %hi(_handler), %l4 ; \ - jmp %l4+%lo(_handler); \ - mov _vector, %l3 - -/* - * Used for the reset trap to avoid a supervisor instruction - */ - -#define RTRAP(_vector, _handler) \ - mov %g0, %l0 ; \ - sethi %hi(_handler), %l4 ; \ - jmp %l4+%lo(_handler); \ - mov _vector, %l3 - -#endif -/* end of include file */ - - diff --git a/cpukit/telnetd/Makefile.am b/cpukit/telnetd/Makefile.am deleted file mode 100644 index d03d4272d5..0000000000 --- a/cpukit/telnetd/Makefile.am +++ /dev/null @@ -1,39 +0,0 @@ -## -## $Id$ -## - -include_rtemsdir = $(includedir)/rtems - -LIBNAME = libtelnetd-tmp -LIB = $(ARCH)/$(LIBNAME).a - -C_FILES = pty.c telnetd.c icmds.c -OBJS = $(C_FILES:%.c=$(ARCH)/%.$(OBJEXT)) - -include_rtems_HEADERS = pty.h telnetd.h - -include $(top_srcdir)/../../../automake/compile.am -include $(top_srcdir)/../../../automake/lib.am - -$(PROJECT_INCLUDE)/rtems: - @$(mkinstalldirs) $@ -$(PROJECT_INCLUDE)/rtems/%.h: %.h - $(INSTALL_DATA) $< $@ - -# -# (OPTIONAL) Add local stuff here using += -# - -$(LIB): $(OBJS) - $(make-library) - -PREINSTALL_FILES = $(PROJECT_INCLUDE)/rtems \ - $(include_rtems_HEADERS:%=$(PROJECT_INCLUDE)/rtems/%) - -all-local: $(ARCH) $(PREINSTALL_FILES) $(OBJS) $(LIB) - -.PRECIOUS: $(LIB) - -EXTRA_DIST = README pty.c telnetd.c pty.h icmds.c telnetd.h - -include $(top_srcdir)/../../../automake/local.am diff --git a/cpukit/telnetd/README b/cpukit/telnetd/README deleted file mode 100644 index 0c964c412d..0000000000 --- a/cpukit/telnetd/README +++ /dev/null @@ -1,28 +0,0 @@ -# -# $Id$ -# - -Author: fernando.ruiz@ctv.es (correo@fernando-ruiz.com) - -This directory contains a telnetd server -primary features: - - + create a user shell pseudo-terminal task. - -This code has not been extensively tested. It is provided as a tool -for RTEMS users to open more shell tcp/ip pseudo-terminal. -Suggestions and comments are appreciated. - -Read libmisc/shell for more information. - -NOTES: - -1. OOB not yet implemented. Only a reduced negotiation is implemented. - -2. If you have tcp/ip inited you can start telnetd daemon. - You need register pseudo-terminals driver into device drivers table. - 16 ptyX termios device terminales are created into /dev/. - Calling rtems_initialize_telnetd() starts the daemon. - Enjoy it. - -FUTURE: diff --git a/cpukit/telnetd/icmds.c b/cpukit/telnetd/icmds.c deleted file mode 100644 index 1ac6820f39..0000000000 --- a/cpukit/telnetd/icmds.c +++ /dev/null @@ -1,48 +0,0 @@ -#include -#include -/*+++++++++++++++++++++++++++++++++++++++++++++*/ -int main_inet(int argc,char * argv[]) { - rtems_bsdnet_show_inet_routes (); - return 0; -} -/*+++++++++++++++++++++++++++++++++++++++++++++*/ -int main_mbuf(int argc,char * argv[]) { - rtems_bsdnet_show_mbuf_stats (); - return 0; -} -/*+++++++++++++++++++++++++++++++++++++++++++++*/ -int main_if(int argc,char * argv[]) { - rtems_bsdnet_show_if_stats (); - return 0; -} -/*+++++++++++++++++++++++++++++++++++++++++++++*/ -int main_ip(int argc,char * argv[]) { - rtems_bsdnet_show_ip_stats (); - return 0; -} -/*+++++++++++++++++++++++++++++++++++++++++++++*/ -int main_icmp(int argc,char * argv[]) { - rtems_bsdnet_show_icmp_stats (); - return 0; -} -/*+++++++++++++++++++++++++++++++++++++++++++++*/ -int main_tcp(int argc,char * argv[]) { - rtems_bsdnet_show_tcp_stats (); - return 0; -} -/*+++++++++++++++++++++++++++++++++++++++++++++*/ -int main_udp(int argc,char * argv[]) { - rtems_bsdnet_show_udp_stats (); - return 0; -} -/*+++++++++++++++++++++++++++++++++++++++++++++*/ -void register_icmds(void) { - shell_add_cmd("inet" ,"net","inet routes" ,main_inet); - shell_add_cmd("mbuf" ,"net","mbuf stats" ,main_mbuf); - shell_add_cmd("if" ,"net","if stats" ,main_if ); - shell_add_cmd("ip" ,"net","ip stats" ,main_ip ); - shell_add_cmd("icmp" ,"net","icmp stats" ,main_icmp); - shell_add_cmd("tcp" ,"net","tcp stats" ,main_tcp ); - shell_add_cmd("udp" ,"net","udp stats" ,main_udp ); -} - diff --git a/cpukit/telnetd/pty.c b/cpukit/telnetd/pty.c deleted file mode 100644 index c19d05db37..0000000000 --- a/cpukit/telnetd/pty.c +++ /dev/null @@ -1,407 +0,0 @@ -/* - * /dev/ptyXX (A first version for pseudo-terminals) - * - * Author: Fernando RUIZ CASAS (fernando.ruiz@ctv.es) - * May 2001 - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * $Id$ - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -/*-----------------------------------------*/ -#include -#include -#include -#include -#include -/*-----------------------------------------*/ -#include -#include -#include -#include -/*-----------------------------------------*/ -#define IAC_ESC 255 -#define IAC_DONT 254 -#define IAC_DO 253 -#define IAC_WONT 252 -#define IAC_WILL 251 -#define IAC_SB 250 -#define IAC_GA 249 -#define IAC_EL 248 -#define IAC_EC 247 -#define IAC_AYT 246 -#define IAC_AO 245 -#define IAC_IP 244 -#define IAC_BRK 243 -#define IAC_DMARK 242 -#define IAC_NOP 241 -#define IAC_SE 240 -#define IAC_EOR 239 - -struct pty_tt; -typedef struct pty_tt pty_t; - -struct pty_tt { - char *devname; - struct rtems_termios_tty *ttyp; - tcflag_t c_cflag; - int opened; - int socket; - - int last_cr; - int iac_mode; -}; - - -int ptys_initted=FALSE; -pty_t ptys[MAX_PTYS]; - -/* This procedure returns the devname for a pty slot free. - * If not slot availiable (field socket>=0) - * then the socket argument is closed - */ - -char * get_pty(int socket) { - int ndx; - if (!ptys_initted) return NULL; - for (ndx=0;ndxc_cflag; - } else { - return -1; - }; - return 0; -} -/*-----------------------------------------------------------*/ -static int -ptyPollInitialize(int major,int minor,void * arg) { - rtems_libio_open_close_args_t * args = arg; - struct termios t; - if (minoriop->data1; - t.c_cflag=B9600|CS8;/* termios default */ - return ptySetAttributes(minor,&t); - } else { - return -1; - }; -} -/*-----------------------------------------------------------*/ -static int -ptyShutdown(int major,int minor,void * arg) { - if (minor=0) close(ptys[minor].socket); - ptys[minor].socket=-1; - chown(ptys[minor].devname,2,0); - } else { - return -1; - }; - return 0; -} -/*-----------------------------------------------------------*/ -/* Write Characters into pty device */ -/*-----------------------------------------------------------*/ -static int -ptyPollWrite(int minor, const char * buf,int len) { - int count; - if (minor - -#ifndef MAX_PTYS -#define MAX_PTYS 16 -#endif - -char * get_pty(int socket); - -rtems_device_driver pty_initialize( - rtems_device_major_number major, - rtems_device_minor_number minor, - void *arg); -rtems_device_driver pty_open( - rtems_device_major_number major, - rtems_device_minor_number minor, - void * arg); -rtems_device_driver pty_close( - rtems_device_major_number major, - rtems_device_minor_number minor, - void * arg); -rtems_device_driver pty_read( - rtems_device_major_number major, - rtems_device_minor_number minor, - void * arg); -rtems_device_driver pty_write( - rtems_device_major_number major, - rtems_device_minor_number minor, - void * arg); -rtems_device_driver pty_control( - rtems_device_major_number major, - rtems_device_minor_number minor, - void * arg); - - -#define PTY_DRIVER_TABLE_ENTRY \ - { pty_initialize , pty_open , pty_close , \ - pty_read , pty_write , pty_control } - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/cpukit/telnetd/telnetd.c b/cpukit/telnetd/telnetd.c deleted file mode 100644 index bc8449ae96..0000000000 --- a/cpukit/telnetd/telnetd.c +++ /dev/null @@ -1,133 +0,0 @@ -/***********************************************************/ -/* - * - * The telnet DAEMON - * - * Author: 17,may 2001 - * - * WORK: fernando.ruiz@ctv.es - * HOME: correo@fernando-ruiz.com - * - * After start the net you can start this daemon. - * It uses the previously inited pseudo-terminales (pty.c) - * getting a new terminal with getpty(). This function - * gives a terminal name passing a opened socket like parameter. - * - * With register_telnetd() you add a new command in the shell to start - * this daemon interactively. (Login in /dev/console of course) - * - * Sorry but OOB is not still implemented. (This is the first version) - */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include /* memset */ -#include -/***********************************************************/ -rtems_id telnetd_task_id =0; -rtems_unsigned32 telnetd_stack_size =16384; -rtems_task_priority telnetd_task_priority=100; -/***********************************************************/ -rtems_task rtems_task_telnetd(rtems_task_argument task_argument) { - int des_socket, - acp_socket; - struct sockaddr_in srv; - char * devname; - int i=1; - int size_adr; - if ((des_socket=socket(PF_INET,SOCK_STREAM,0))<0) { - perror("telnetd:socket"); - rtems_task_delete(RTEMS_SELF); - }; - setsockopt(des_socket,SOL_SOCKET,0,&i,sizeof(i)); - memset(&srv,0,sizeof(srv)); - srv.sin_family=AF_INET; - srv.sin_port=htons(23); - size_adr=sizeof(srv); - if ((bind(des_socket,(struct sockaddr *)&srv,size_adr))<0) { - perror("telnetd:bind"); - close(des_socket); - rtems_task_delete(RTEMS_SELF); - }; - if ((listen(des_socket,5))<0) { - perror("telnetd:listen"); - close(des_socket); - rtems_task_delete(RTEMS_SELF); - }; - do { - acp_socket=accept(des_socket,(struct sockaddr*)&srv,&size_adr); - if (acp_socket<0) { - perror("telnetd:accept"); - break; - }; - if ((devname = get_pty(acp_socket)) ) { - shell_init(&devname[5], - telnetd_stack_size, - telnetd_task_priority, - devname,B9600|CS8,FALSE); - } else { - close(acp_socket); - }; - } while(1); - close(des_socket); - rtems_task_delete(RTEMS_SELF); -} -/***********************************************************/ -int rtems_initialize_telnetd(void) { - void register_icmds(void); - rtems_status_code sc; - - register_icmds(); /* stats for tcp/ip */ - - if (telnetd_task_id ) return RTEMS_RESOURCE_IN_USE; - if (telnetd_stack_size<=0 ) telnetd_stack_size =16384; - if (telnetd_task_priority<=2) telnetd_task_priority=100; - sc=rtems_task_create(new_rtems_name("tlnd"), - 100,RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &telnetd_task_id); - if (sc!=RTEMS_SUCCESSFUL) { - rtems_error(sc,"creating task telnetd"); - return (int)sc; - }; - sc=rtems_task_start(telnetd_task_id, - rtems_task_telnetd, - (rtems_task_argument)NULL); - if (sc!=RTEMS_SUCCESSFUL) { - rtems_error(sc,"starting task telnetd"); - }; - return (int)sc; -} -/***********************************************************/ -int main_telnetd(int argc,char * argv[]) { - rtems_status_code sc; - if (telnetd_task_id) { - printf("ERROR:telnetd already started\n"); - return 1; - }; - if (argc>1) telnetd_stack_size =str2int(argv[1]); - if (argc>2) telnetd_task_priority=str2int(argv[2]); - sc=rtems_initialize_telnetd(); - if (sc!=RTEMS_SUCCESSFUL) return sc; - printf("rtems_telnetd() started with stacksize=%u,priority=%d\n", - telnetd_stack_size,telnetd_task_priority); - return 0; -} -/***********************************************************/ -int register_telnetd(void) { - shell_add_cmd("telnetd","telnet","telnetd [stacksize [tsk_priority]]",main_telnetd); - return 0; -} -/***********************************************************/ diff --git a/cpukit/telnetd/telnetd.h b/cpukit/telnetd/telnetd.h deleted file mode 100644 index 1bb99ebc1b..0000000000 --- a/cpukit/telnetd/telnetd.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * (A first version for telnetd) - * - * Author: Fernando RUIZ CASAS (fernando.ruiz@ctv.es) - * May 2001 - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * rtems_initialize_telnetd() starts the daemon. - * main_telnetd() is the main_proc for the command telnetd in the shell - * register_telnetd() add a new command in the shell to start - * interactively the telnetd daemon. - * - * $Id$ - */ - -#ifndef __TELNETD_H -#define __TELNETD_H - -#ifdef __cplusplus -extern "C" { -#endif - -int rtems_initialize_telnetd(void); -int main_telnetd(int argc,char * argv[]); -int register_telnetd(void); - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/cpukit/zlib/doc/rfc1950.txt b/cpukit/zlib/doc/rfc1950.txt deleted file mode 100644 index ce6428a0f2..0000000000 --- a/cpukit/zlib/doc/rfc1950.txt +++ /dev/null @@ -1,619 +0,0 @@ - - - - - - -Network Working Group P. Deutsch -Request for Comments: 1950 Aladdin Enterprises -Category: Informational J-L. Gailly - Info-ZIP - May 1996 - - - ZLIB Compressed Data Format Specification version 3.3 - -Status of This Memo - - This memo provides information for the Internet community. This memo - does not specify an Internet standard of any kind. Distribution of - this memo is unlimited. - -IESG Note: - - The IESG takes no position on the validity of any Intellectual - Property Rights statements contained in this document. - -Notices - - Copyright (c) 1996 L. Peter Deutsch and Jean-Loup Gailly - - Permission is granted to copy and distribute this document for any - purpose and without charge, including translations into other - languages and incorporation into compilations, provided that the - copyright notice and this notice are preserved, and that any - substantive changes or deletions from the original are clearly - marked. - - A pointer to the latest version of this and related documentation in - HTML format can be found at the URL - . - -Abstract - - This specification defines a lossless compressed data format. The - data can be produced or consumed, even for an arbitrarily long - sequentially presented input data stream, using only an a priori - bounded amount of intermediate storage. The format presently uses - the DEFLATE compression method but can be easily extended to use - other compression methods. It can be implemented readily in a manner - not covered by patents. This specification also defines the ADLER-32 - checksum (an extension and improvement of the Fletcher checksum), - used for detection of data corruption, and provides an algorithm for - computing it. - - - - -Deutsch & Gailly Informational [Page 1] - -RFC 1950 ZLIB Compressed Data Format Specification May 1996 - - -Table of Contents - - 1. Introduction ................................................... 2 - 1.1. Purpose ................................................... 2 - 1.2. Intended audience ......................................... 3 - 1.3. Scope ..................................................... 3 - 1.4. Compliance ................................................ 3 - 1.5. Definitions of terms and conventions used ................ 3 - 1.6. Changes from previous versions ............................ 3 - 2. Detailed specification ......................................... 3 - 2.1. Overall conventions ....................................... 3 - 2.2. Data format ............................................... 4 - 2.3. Compliance ................................................ 7 - 3. References ..................................................... 7 - 4. Source code .................................................... 8 - 5. Security Considerations ........................................ 8 - 6. Acknowledgements ............................................... 8 - 7. Authors' Addresses ............................................. 8 - 8. Appendix: Rationale ............................................ 9 - 9. Appendix: Sample code ..........................................10 - -1. Introduction - - 1.1. Purpose - - The purpose of this specification is to define a lossless - compressed data format that: - - * Is independent of CPU type, operating system, file system, - and character set, and hence can be used for interchange; - - * Can be produced or consumed, even for an arbitrarily long - sequentially presented input data stream, using only an a - priori bounded amount of intermediate storage, and hence can - be used in data communications or similar structures such as - Unix filters; - - * Can use a number of different compression methods; - - * Can be implemented readily in a manner not covered by - patents, and hence can be practiced freely. - - The data format defined by this specification does not attempt to - allow random access to compressed data. - - - - - - - -Deutsch & Gailly Informational [Page 2] - -RFC 1950 ZLIB Compressed Data Format Specification May 1996 - - - 1.2. Intended audience - - This specification is intended for use by implementors of software - to compress data into zlib format and/or decompress data from zlib - format. - - The text of the specification assumes a basic background in - programming at the level of bits and other primitive data - representations. - - 1.3. Scope - - The specification specifies a compressed data format that can be - used for in-memory compression of a sequence of arbitrary bytes. - - 1.4. Compliance - - Unless otherwise indicated below, a compliant decompressor must be - able to accept and decompress any data set that conforms to all - the specifications presented here; a compliant compressor must - produce data sets that conform to all the specifications presented - here. - - 1.5. Definitions of terms and conventions used - - byte: 8 bits stored or transmitted as a unit (same as an octet). - (For this specification, a byte is exactly 8 bits, even on - machines which store a character on a number of bits different - from 8.) See below, for the numbering of bits within a byte. - - 1.6. Changes from previous versions - - Version 3.1 was the first public release of this specification. - In version 3.2, some terminology was changed and the Adler-32 - sample code was rewritten for clarity. In version 3.3, the - support for a preset dictionary was introduced, and the - specification was converted to RFC style. - -2. Detailed specification - - 2.1. Overall conventions - - In the diagrams below, a box like this: - - +---+ - | | <-- the vertical bars might be missing - +---+ - - - - -Deutsch & Gailly Informational [Page 3] - -RFC 1950 ZLIB Compressed Data Format Specification May 1996 - - - represents one byte; a box like this: - - +==============+ - | | - +==============+ - - represents a variable number of bytes. - - Bytes stored within a computer do not have a "bit order", since - they are always treated as a unit. However, a byte considered as - an integer between 0 and 255 does have a most- and least- - significant bit, and since we write numbers with the most- - significant digit on the left, we also write bytes with the most- - significant bit on the left. In the diagrams below, we number the - bits of a byte so that bit 0 is the least-significant bit, i.e., - the bits are numbered: - - +--------+ - |76543210| - +--------+ - - Within a computer, a number may occupy multiple bytes. All - multi-byte numbers in the format described here are stored with - the MOST-significant byte first (at the lower memory address). - For example, the decimal number 520 is stored as: - - 0 1 - +--------+--------+ - |00000010|00001000| - +--------+--------+ - ^ ^ - | | - | + less significant byte = 8 - + more significant byte = 2 x 256 - - 2.2. Data format - - A zlib stream has the following structure: - - 0 1 - +---+---+ - |CMF|FLG| (more-->) - +---+---+ - - - - - - - - -Deutsch & Gailly Informational [Page 4] - -RFC 1950 ZLIB Compressed Data Format Specification May 1996 - - - (if FLG.FDICT set) - - 0 1 2 3 - +---+---+---+---+ - | DICTID | (more-->) - +---+---+---+---+ - - +=====================+---+---+---+---+ - |...compressed data...| ADLER32 | - +=====================+---+---+---+---+ - - Any data which may appear after ADLER32 are not part of the zlib - stream. - - CMF (Compression Method and flags) - This byte is divided into a 4-bit compression method and a 4- - bit information field depending on the compression method. - - bits 0 to 3 CM Compression method - bits 4 to 7 CINFO Compression info - - CM (Compression method) - This identifies the compression method used in the file. CM = 8 - denotes the "deflate" compression method with a window size up - to 32K. This is the method used by gzip and PNG (see - references [1] and [2] in Chapter 3, below, for the reference - documents). CM = 15 is reserved. It might be used in a future - version of this specification to indicate the presence of an - extra field before the compressed data. - - CINFO (Compression info) - For CM = 8, CINFO is the base-2 logarithm of the LZ77 window - size, minus eight (CINFO=7 indicates a 32K window size). Values - of CINFO above 7 are not allowed in this version of the - specification. CINFO is not defined in this specification for - CM not equal to 8. - - FLG (FLaGs) - This flag byte is divided as follows: - - bits 0 to 4 FCHECK (check bits for CMF and FLG) - bit 5 FDICT (preset dictionary) - bits 6 to 7 FLEVEL (compression level) - - The FCHECK value must be such that CMF and FLG, when viewed as - a 16-bit unsigned integer stored in MSB order (CMF*256 + FLG), - is a multiple of 31. - - - - -Deutsch & Gailly Informational [Page 5] - -RFC 1950 ZLIB Compressed Data Format Specification May 1996 - - - FDICT (Preset dictionary) - If FDICT is set, a DICT dictionary identifier is present - immediately after the FLG byte. The dictionary is a sequence of - bytes which are initially fed to the compressor without - producing any compressed output. DICT is the Adler-32 checksum - of this sequence of bytes (see the definition of ADLER32 - below). The decompressor can use this identifier to determine - which dictionary has been used by the compressor. - - FLEVEL (Compression level) - These flags are available for use by specific compression - methods. The "deflate" method (CM = 8) sets these flags as - follows: - - 0 - compressor used fastest algorithm - 1 - compressor used fast algorithm - 2 - compressor used default algorithm - 3 - compressor used maximum compression, slowest algorithm - - The information in FLEVEL is not needed for decompression; it - is there to indicate if recompression might be worthwhile. - - compressed data - For compression method 8, the compressed data is stored in the - deflate compressed data format as described in the document - "DEFLATE Compressed Data Format Specification" by L. Peter - Deutsch. (See reference [3] in Chapter 3, below) - - Other compressed data formats are not specified in this version - of the zlib specification. - - ADLER32 (Adler-32 checksum) - This contains a checksum value of the uncompressed data - (excluding any dictionary data) computed according to Adler-32 - algorithm. This algorithm is a 32-bit extension and improvement - of the Fletcher algorithm, used in the ITU-T X.224 / ISO 8073 - standard. See references [4] and [5] in Chapter 3, below) - - Adler-32 is composed of two sums accumulated per byte: s1 is - the sum of all bytes, s2 is the sum of all s1 values. Both sums - are done modulo 65521. s1 is initialized to 1, s2 to zero. The - Adler-32 checksum is stored as s2*65536 + s1 in most- - significant-byte first (network) order. - - - - - - - - -Deutsch & Gailly Informational [Page 6] - -RFC 1950 ZLIB Compressed Data Format Specification May 1996 - - - 2.3. Compliance - - A compliant compressor must produce streams with correct CMF, FLG - and ADLER32, but need not support preset dictionaries. When the - zlib data format is used as part of another standard data format, - the compressor may use only preset dictionaries that are specified - by this other data format. If this other format does not use the - preset dictionary feature, the compressor must not set the FDICT - flag. - - A compliant decompressor must check CMF, FLG, and ADLER32, and - provide an error indication if any of these have incorrect values. - A compliant decompressor must give an error indication if CM is - not one of the values defined in this specification (only the - value 8 is permitted in this version), since another value could - indicate the presence of new features that would cause subsequent - data to be interpreted incorrectly. A compliant decompressor must - give an error indication if FDICT is set and DICTID is not the - identifier of a known preset dictionary. A decompressor may - ignore FLEVEL and still be compliant. When the zlib data format - is being used as a part of another standard format, a compliant - decompressor must support all the preset dictionaries specified by - the other format. When the other format does not use the preset - dictionary feature, a compliant decompressor must reject any - stream in which the FDICT flag is set. - -3. References - - [1] Deutsch, L.P.,"GZIP Compressed Data Format Specification", - available in ftp://ftp.uu.net/pub/archiving/zip/doc/ - - [2] Thomas Boutell, "PNG (Portable Network Graphics) specification", - available in ftp://ftp.uu.net/graphics/png/documents/ - - [3] Deutsch, L.P.,"DEFLATE Compressed Data Format Specification", - available in ftp://ftp.uu.net/pub/archiving/zip/doc/ - - [4] Fletcher, J. G., "An Arithmetic Checksum for Serial - Transmissions," IEEE Transactions on Communications, Vol. COM-30, - No. 1, January 1982, pp. 247-252. - - [5] ITU-T Recommendation X.224, Annex D, "Checksum Algorithms," - November, 1993, pp. 144, 145. (Available from - gopher://info.itu.ch). ITU-T X.244 is also the same as ISO 8073. - - - - - - - -Deutsch & Gailly Informational [Page 7] - -RFC 1950 ZLIB Compressed Data Format Specification May 1996 - - -4. Source code - - Source code for a C language implementation of a "zlib" compliant - library is available at ftp://ftp.uu.net/pub/archiving/zip/zlib/. - -5. Security Considerations - - A decoder that fails to check the ADLER32 checksum value may be - subject to undetected data corruption. - -6. Acknowledgements - - Trademarks cited in this document are the property of their - respective owners. - - Jean-Loup Gailly and Mark Adler designed the zlib format and wrote - the related software described in this specification. Glenn - Randers-Pehrson converted this document to RFC and HTML format. - -7. Authors' Addresses - - L. Peter Deutsch - Aladdin Enterprises - 203 Santa Margarita Ave. - Menlo Park, CA 94025 - - Phone: (415) 322-0103 (AM only) - FAX: (415) 322-1734 - EMail: - - - Jean-Loup Gailly - - EMail: - - Questions about the technical content of this specification can be - sent by email to - - Jean-Loup Gailly and - Mark Adler - - Editorial comments on this specification can be sent by email to - - L. Peter Deutsch and - Glenn Randers-Pehrson - - - - - - -Deutsch & Gailly Informational [Page 8] - -RFC 1950 ZLIB Compressed Data Format Specification May 1996 - - -8. Appendix: Rationale - - 8.1. Preset dictionaries - - A preset dictionary is specially useful to compress short input - sequences. The compressor can take advantage of the dictionary - context to encode the input in a more compact manner. The - decompressor can be initialized with the appropriate context by - virtually decompressing a compressed version of the dictionary - without producing any output. However for certain compression - algorithms such as the deflate algorithm this operation can be - achieved without actually performing any decompression. - - The compressor and the decompressor must use exactly the same - dictionary. The dictionary may be fixed or may be chosen among a - certain number of predefined dictionaries, according to the kind - of input data. The decompressor can determine which dictionary has - been chosen by the compressor by checking the dictionary - identifier. This document does not specify the contents of - predefined dictionaries, since the optimal dictionaries are - application specific. Standard data formats using this feature of - the zlib specification must precisely define the allowed - dictionaries. - - 8.2. The Adler-32 algorithm - - The Adler-32 algorithm is much faster than the CRC32 algorithm yet - still provides an extremely low probability of undetected errors. - - The modulo on unsigned long accumulators can be delayed for 5552 - bytes, so the modulo operation time is negligible. If the bytes - are a, b, c, the second sum is 3a + 2b + c + 3, and so is position - and order sensitive, unlike the first sum, which is just a - checksum. That 65521 is prime is important to avoid a possible - large class of two-byte errors that leave the check unchanged. - (The Fletcher checksum uses 255, which is not prime and which also - makes the Fletcher check insensitive to single byte changes 0 <-> - 255.) - - The sum s1 is initialized to 1 instead of zero to make the length - of the sequence part of s2, so that the length does not have to be - checked separately. (Any sequence of zeroes has a Fletcher - checksum of zero.) - - - - - - - - -Deutsch & Gailly Informational [Page 9] - -RFC 1950 ZLIB Compressed Data Format Specification May 1996 - - -9. Appendix: Sample code - - The following C code computes the Adler-32 checksum of a data buffer. - It is written for clarity, not for speed. The sample code is in the - ANSI C programming language. Non C users may find it easier to read - with these hints: - - & Bitwise AND operator. - >> Bitwise right shift operator. When applied to an - unsigned quantity, as here, right shift inserts zero bit(s) - at the left. - << Bitwise left shift operator. Left shift inserts zero - bit(s) at the right. - ++ "n++" increments the variable n. - % modulo operator: a % b is the remainder of a divided by b. - - #define BASE 65521 /* largest prime smaller than 65536 */ - - /* - Update a running Adler-32 checksum with the bytes buf[0..len-1] - and return the updated checksum. The Adler-32 checksum should be - initialized to 1. - - Usage example: - - unsigned long adler = 1L; - - while (read_buffer(buffer, length) != EOF) { - adler = update_adler32(adler, buffer, length); - } - if (adler != original_adler) error(); - */ - unsigned long update_adler32(unsigned long adler, - unsigned char *buf, int len) - { - unsigned long s1 = adler & 0xffff; - unsigned long s2 = (adler >> 16) & 0xffff; - int n; - - for (n = 0; n < len; n++) { - s1 = (s1 + buf[n]) % BASE; - s2 = (s2 + s1) % BASE; - } - return (s2 << 16) + s1; - } - - /* Return the adler32 of the bytes buf[0..len-1] */ - - - - -Deutsch & Gailly Informational [Page 10] - -RFC 1950 ZLIB Compressed Data Format Specification May 1996 - - - unsigned long adler32(unsigned char *buf, int len) - { - return update_adler32(1L, buf, len); - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Deutsch & Gailly Informational [Page 11] - diff --git a/cpukit/zlib/doc/rfc1951.txt b/cpukit/zlib/doc/rfc1951.txt deleted file mode 100644 index 403c8c722f..0000000000 --- a/cpukit/zlib/doc/rfc1951.txt +++ /dev/null @@ -1,955 +0,0 @@ - - - - - - -Network Working Group P. Deutsch -Request for Comments: 1951 Aladdin Enterprises -Category: Informational May 1996 - - - DEFLATE Compressed Data Format Specification version 1.3 - -Status of This Memo - - This memo provides information for the Internet community. This memo - does not specify an Internet standard of any kind. Distribution of - this memo is unlimited. - -IESG Note: - - The IESG takes no position on the validity of any Intellectual - Property Rights statements contained in this document. - -Notices - - Copyright (c) 1996 L. Peter Deutsch - - Permission is granted to copy and distribute this document for any - purpose and without charge, including translations into other - languages and incorporation into compilations, provided that the - copyright notice and this notice are preserved, and that any - substantive changes or deletions from the original are clearly - marked. - - A pointer to the latest version of this and related documentation in - HTML format can be found at the URL - . - -Abstract - - This specification defines a lossless compressed data format that - compresses data using a combination of the LZ77 algorithm and Huffman - coding, with efficiency comparable to the best currently available - general-purpose compression methods. The data can be produced or - consumed, even for an arbitrarily long sequentially presented input - data stream, using only an a priori bounded amount of intermediate - storage. The format can be implemented readily in a manner not - covered by patents. - - - - - - - - -Deutsch Informational [Page 1] - -RFC 1951 DEFLATE Compressed Data Format Specification May 1996 - - -Table of Contents - - 1. Introduction ................................................... 2 - 1.1. Purpose ................................................... 2 - 1.2. Intended audience ......................................... 3 - 1.3. Scope ..................................................... 3 - 1.4. Compliance ................................................ 3 - 1.5. Definitions of terms and conventions used ................ 3 - 1.6. Changes from previous versions ............................ 4 - 2. Compressed representation overview ............................. 4 - 3. Detailed specification ......................................... 5 - 3.1. Overall conventions ....................................... 5 - 3.1.1. Packing into bytes .................................. 5 - 3.2. Compressed block format ................................... 6 - 3.2.1. Synopsis of prefix and Huffman coding ............... 6 - 3.2.2. Use of Huffman coding in the "deflate" format ....... 7 - 3.2.3. Details of block format ............................. 9 - 3.2.4. Non-compressed blocks (BTYPE=00) ................... 11 - 3.2.5. Compressed blocks (length and distance codes) ...... 11 - 3.2.6. Compression with fixed Huffman codes (BTYPE=01) .... 12 - 3.2.7. Compression with dynamic Huffman codes (BTYPE=10) .. 13 - 3.3. Compliance ............................................... 14 - 4. Compression algorithm details ................................. 14 - 5. References .................................................... 16 - 6. Security Considerations ....................................... 16 - 7. Source code ................................................... 16 - 8. Acknowledgements .............................................. 16 - 9. Author's Address .............................................. 17 - -1. Introduction - - 1.1. Purpose - - The purpose of this specification is to define a lossless - compressed data format that: - * Is independent of CPU type, operating system, file system, - and character set, and hence can be used for interchange; - * Can be produced or consumed, even for an arbitrarily long - sequentially presented input data stream, using only an a - priori bounded amount of intermediate storage, and hence - can be used in data communications or similar structures - such as Unix filters; - * Compresses data with efficiency comparable to the best - currently available general-purpose compression methods, - and in particular considerably better than the "compress" - program; - * Can be implemented readily in a manner not covered by - patents, and hence can be practiced freely; - - - -Deutsch Informational [Page 2] - -RFC 1951 DEFLATE Compressed Data Format Specification May 1996 - - - * Is compatible with the file format produced by the current - widely used gzip utility, in that conforming decompressors - will be able to read data produced by the existing gzip - compressor. - - The data format defined by this specification does not attempt to: - - * Allow random access to compressed data; - * Compress specialized data (e.g., raster graphics) as well - as the best currently available specialized algorithms. - - A simple counting argument shows that no lossless compression - algorithm can compress every possible input data set. For the - format defined here, the worst case expansion is 5 bytes per 32K- - byte block, i.e., a size increase of 0.015% for large data sets. - English text usually compresses by a factor of 2.5 to 3; - executable files usually compress somewhat less; graphical data - such as raster images may compress much more. - - 1.2. Intended audience - - This specification is intended for use by implementors of software - to compress data into "deflate" format and/or decompress data from - "deflate" format. - - The text of the specification assumes a basic background in - programming at the level of bits and other primitive data - representations. Familiarity with the technique of Huffman coding - is helpful but not required. - - 1.3. Scope - - The specification specifies a method for representing a sequence - of bytes as a (usually shorter) sequence of bits, and a method for - packing the latter bit sequence into bytes. - - 1.4. Compliance - - Unless otherwise indicated below, a compliant decompressor must be - able to accept and decompress any data set that conforms to all - the specifications presented here; a compliant compressor must - produce data sets that conform to all the specifications presented - here. - - 1.5. Definitions of terms and conventions used - - Byte: 8 bits stored or transmitted as a unit (same as an octet). - For this specification, a byte is exactly 8 bits, even on machines - - - -Deutsch Informational [Page 3] - -RFC 1951 DEFLATE Compressed Data Format Specification May 1996 - - - which store a character on a number of bits different from eight. - See below, for the numbering of bits within a byte. - - String: a sequence of arbitrary bytes. - - 1.6. Changes from previous versions - - There have been no technical changes to the deflate format since - version 1.1 of this specification. In version 1.2, some - terminology was changed. Version 1.3 is a conversion of the - specification to RFC style. - -2. Compressed representation overview - - A compressed data set consists of a series of blocks, corresponding - to successive blocks of input data. The block sizes are arbitrary, - except that non-compressible blocks are limited to 65,535 bytes. - - Each block is compressed using a combination of the LZ77 algorithm - and Huffman coding. The Huffman trees for each block are independent - of those for previous or subsequent blocks; the LZ77 algorithm may - use a reference to a duplicated string occurring in a previous block, - up to 32K input bytes before. - - Each block consists of two parts: a pair of Huffman code trees that - describe the representation of the compressed data part, and a - compressed data part. (The Huffman trees themselves are compressed - using Huffman encoding.) The compressed data consists of a series of - elements of two types: literal bytes (of strings that have not been - detected as duplicated within the previous 32K input bytes), and - pointers to duplicated strings, where a pointer is represented as a - pair . The representation used in the - "deflate" format limits distances to 32K bytes and lengths to 258 - bytes, but does not limit the size of a block, except for - uncompressible blocks, which are limited as noted above. - - Each type of value (literals, distances, and lengths) in the - compressed data is represented using a Huffman code, using one code - tree for literals and lengths and a separate code tree for distances. - The code trees for each block appear in a compact form just before - the compressed data for that block. - - - - - - - - - - -Deutsch Informational [Page 4] - -RFC 1951 DEFLATE Compressed Data Format Specification May 1996 - - -3. Detailed specification - - 3.1. Overall conventions In the diagrams below, a box like this: - - +---+ - | | <-- the vertical bars might be missing - +---+ - - represents one byte; a box like this: - - +==============+ - | | - +==============+ - - represents a variable number of bytes. - - Bytes stored within a computer do not have a "bit order", since - they are always treated as a unit. However, a byte considered as - an integer between 0 and 255 does have a most- and least- - significant bit, and since we write numbers with the most- - significant digit on the left, we also write bytes with the most- - significant bit on the left. In the diagrams below, we number the - bits of a byte so that bit 0 is the least-significant bit, i.e., - the bits are numbered: - - +--------+ - |76543210| - +--------+ - - Within a computer, a number may occupy multiple bytes. All - multi-byte numbers in the format described here are stored with - the least-significant byte first (at the lower memory address). - For example, the decimal number 520 is stored as: - - 0 1 - +--------+--------+ - |00001000|00000010| - +--------+--------+ - ^ ^ - | | - | + more significant byte = 2 x 256 - + less significant byte = 8 - - 3.1.1. Packing into bytes - - This document does not address the issue of the order in which - bits of a byte are transmitted on a bit-sequential medium, - since the final data format described here is byte- rather than - - - -Deutsch Informational [Page 5] - -RFC 1951 DEFLATE Compressed Data Format Specification May 1996 - - - bit-oriented. However, we describe the compressed block format - in below, as a sequence of data elements of various bit - lengths, not a sequence of bytes. We must therefore specify - how to pack these data elements into bytes to form the final - compressed byte sequence: - - * Data elements are packed into bytes in order of - increasing bit number within the byte, i.e., starting - with the least-significant bit of the byte. - * Data elements other than Huffman codes are packed - starting with the least-significant bit of the data - element. - * Huffman codes are packed starting with the most- - significant bit of the code. - - In other words, if one were to print out the compressed data as - a sequence of bytes, starting with the first byte at the - *right* margin and proceeding to the *left*, with the most- - significant bit of each byte on the left as usual, one would be - able to parse the result from right to left, with fixed-width - elements in the correct MSB-to-LSB order and Huffman codes in - bit-reversed order (i.e., with the first bit of the code in the - relative LSB position). - - 3.2. Compressed block format - - 3.2.1. Synopsis of prefix and Huffman coding - - Prefix coding represents symbols from an a priori known - alphabet by bit sequences (codes), one code for each symbol, in - a manner such that different symbols may be represented by bit - sequences of different lengths, but a parser can always parse - an encoded string unambiguously symbol-by-symbol. - - We define a prefix code in terms of a binary tree in which the - two edges descending from each non-leaf node are labeled 0 and - 1 and in which the leaf nodes correspond one-for-one with (are - labeled with) the symbols of the alphabet; then the code for a - symbol is the sequence of 0's and 1's on the edges leading from - the root to the leaf labeled with that symbol. For example: - - - - - - - - - - - -Deutsch Informational [Page 6] - -RFC 1951 DEFLATE Compressed Data Format Specification May 1996 - - - /\ Symbol Code - 0 1 ------ ---- - / \ A 00 - /\ B B 1 - 0 1 C 011 - / \ D 010 - A /\ - 0 1 - / \ - D C - - A parser can decode the next symbol from an encoded input - stream by walking down the tree from the root, at each step - choosing the edge corresponding to the next input bit. - - Given an alphabet with known symbol frequencies, the Huffman - algorithm allows the construction of an optimal prefix code - (one which represents strings with those symbol frequencies - using the fewest bits of any possible prefix codes for that - alphabet). Such a code is called a Huffman code. (See - reference [1] in Chapter 5, references for additional - information on Huffman codes.) - - Note that in the "deflate" format, the Huffman codes for the - various alphabets must not exceed certain maximum code lengths. - This constraint complicates the algorithm for computing code - lengths from symbol frequencies. Again, see Chapter 5, - references for details. - - 3.2.2. Use of Huffman coding in the "deflate" format - - The Huffman codes used for each alphabet in the "deflate" - format have two additional rules: - - * All codes of a given bit length have lexicographically - consecutive values, in the same order as the symbols - they represent; - - * Shorter codes lexicographically precede longer codes. - - - - - - - - - - - - -Deutsch Informational [Page 7] - -RFC 1951 DEFLATE Compressed Data Format Specification May 1996 - - - We could recode the example above to follow this rule as - follows, assuming that the order of the alphabet is ABCD: - - Symbol Code - ------ ---- - A 10 - B 0 - C 110 - D 111 - - I.e., 0 precedes 10 which precedes 11x, and 110 and 111 are - lexicographically consecutive. - - Given this rule, we can define the Huffman code for an alphabet - just by giving the bit lengths of the codes for each symbol of - the alphabet in order; this is sufficient to determine the - actual codes. In our example, the code is completely defined - by the sequence of bit lengths (2, 1, 3, 3). The following - algorithm generates the codes as integers, intended to be read - from most- to least-significant bit. The code lengths are - initially in tree[I].Len; the codes are produced in - tree[I].Code. - - 1) Count the number of codes for each code length. Let - bl_count[N] be the number of codes of length N, N >= 1. - - 2) Find the numerical value of the smallest code for each - code length: - - code = 0; - bl_count[0] = 0; - for (bits = 1; bits <= MAX_BITS; bits++) { - code = (code + bl_count[bits-1]) << 1; - next_code[bits] = code; - } - - 3) Assign numerical values to all codes, using consecutive - values for all codes of the same length with the base - values determined at step 2. Codes that are never used - (which have a bit length of zero) must not be assigned a - value. - - for (n = 0; n <= max_code; n++) { - len = tree[n].Len; - if (len != 0) { - tree[n].Code = next_code[len]; - next_code[len]++; - } - - - -Deutsch Informational [Page 8] - -RFC 1951 DEFLATE Compressed Data Format Specification May 1996 - - - } - - Example: - - Consider the alphabet ABCDEFGH, with bit lengths (3, 3, 3, 3, - 3, 2, 4, 4). After step 1, we have: - - N bl_count[N] - - ----------- - 2 1 - 3 5 - 4 2 - - Step 2 computes the following next_code values: - - N next_code[N] - - ------------ - 1 0 - 2 0 - 3 2 - 4 14 - - Step 3 produces the following code values: - - Symbol Length Code - ------ ------ ---- - A 3 010 - B 3 011 - C 3 100 - D 3 101 - E 3 110 - F 2 00 - G 4 1110 - H 4 1111 - - 3.2.3. Details of block format - - Each block of compressed data begins with 3 header bits - containing the following data: - - first bit BFINAL - next 2 bits BTYPE - - Note that the header bits do not necessarily begin on a byte - boundary, since a block does not necessarily occupy an integral - number of bytes. - - - - - -Deutsch Informational [Page 9] - -RFC 1951 DEFLATE Compressed Data Format Specification May 1996 - - - BFINAL is set if and only if this is the last block of the data - set. - - BTYPE specifies how the data are compressed, as follows: - - 00 - no compression - 01 - compressed with fixed Huffman codes - 10 - compressed with dynamic Huffman codes - 11 - reserved (error) - - The only difference between the two compressed cases is how the - Huffman codes for the literal/length and distance alphabets are - defined. - - In all cases, the decoding algorithm for the actual data is as - follows: - - do - read block header from input stream. - if stored with no compression - skip any remaining bits in current partially - processed byte - read LEN and NLEN (see next section) - copy LEN bytes of data to output - otherwise - if compressed with dynamic Huffman codes - read representation of code trees (see - subsection below) - loop (until end of block code recognized) - decode literal/length value from input stream - if value < 256 - copy value (literal byte) to output stream - otherwise - if value = end of block (256) - break from loop - otherwise (value = 257..285) - decode distance from input stream - - move backwards distance bytes in the output - stream, and copy length bytes from this - position to the output stream. - end loop - while not last block - - Note that a duplicated string reference may refer to a string - in a previous block; i.e., the backward distance may cross one - or more block boundaries. However a distance cannot refer past - the beginning of the output stream. (An application using a - - - -Deutsch Informational [Page 10] - -RFC 1951 DEFLATE Compressed Data Format Specification May 1996 - - - preset dictionary might discard part of the output stream; a - distance can refer to that part of the output stream anyway) - Note also that the referenced string may overlap the current - position; for example, if the last 2 bytes decoded have values - X and Y, a string reference with - adds X,Y,X,Y,X to the output stream. - - We now specify each compression method in turn. - - 3.2.4. Non-compressed blocks (BTYPE=00) - - Any bits of input up to the next byte boundary are ignored. - The rest of the block consists of the following information: - - 0 1 2 3 4... - +---+---+---+---+================================+ - | LEN | NLEN |... LEN bytes of literal data...| - +---+---+---+---+================================+ - - LEN is the number of data bytes in the block. NLEN is the - one's complement of LEN. - - 3.2.5. Compressed blocks (length and distance codes) - - As noted above, encoded data blocks in the "deflate" format - consist of sequences of symbols drawn from three conceptually - distinct alphabets: either literal bytes, from the alphabet of - byte values (0..255), or pairs, - where the length is drawn from (3..258) and the distance is - drawn from (1..32,768). In fact, the literal and length - alphabets are merged into a single alphabet (0..285), where - values 0..255 represent literal bytes, the value 256 indicates - end-of-block, and values 257..285 represent length codes - (possibly in conjunction with extra bits following the symbol - code) as follows: - - - - - - - - - - - - - - - - -Deutsch Informational [Page 11] - -RFC 1951 DEFLATE Compressed Data Format Specification May 1996 - - - Extra Extra Extra - Code Bits Length(s) Code Bits Lengths Code Bits Length(s) - ---- ---- ------ ---- ---- ------- ---- ---- ------- - 257 0 3 267 1 15,16 277 4 67-82 - 258 0 4 268 1 17,18 278 4 83-98 - 259 0 5 269 2 19-22 279 4 99-114 - 260 0 6 270 2 23-26 280 4 115-130 - 261 0 7 271 2 27-30 281 5 131-162 - 262 0 8 272 2 31-34 282 5 163-194 - 263 0 9 273 3 35-42 283 5 195-226 - 264 0 10 274 3 43-50 284 5 227-257 - 265 1 11,12 275 3 51-58 285 0 258 - 266 1 13,14 276 3 59-66 - - The extra bits should be interpreted as a machine integer - stored with the most-significant bit first, e.g., bits 1110 - represent the value 14. - - Extra Extra Extra - Code Bits Dist Code Bits Dist Code Bits Distance - ---- ---- ---- ---- ---- ------ ---- ---- -------- - 0 0 1 10 4 33-48 20 9 1025-1536 - 1 0 2 11 4 49-64 21 9 1537-2048 - 2 0 3 12 5 65-96 22 10 2049-3072 - 3 0 4 13 5 97-128 23 10 3073-4096 - 4 1 5,6 14 6 129-192 24 11 4097-6144 - 5 1 7,8 15 6 193-256 25 11 6145-8192 - 6 2 9-12 16 7 257-384 26 12 8193-12288 - 7 2 13-16 17 7 385-512 27 12 12289-16384 - 8 3 17-24 18 8 513-768 28 13 16385-24576 - 9 3 25-32 19 8 769-1024 29 13 24577-32768 - - 3.2.6. Compression with fixed Huffman codes (BTYPE=01) - - The Huffman codes for the two alphabets are fixed, and are not - represented explicitly in the data. The Huffman code lengths - for the literal/length alphabet are: - - Lit Value Bits Codes - --------- ---- ----- - 0 - 143 8 00110000 through - 10111111 - 144 - 255 9 110010000 through - 111111111 - 256 - 279 7 0000000 through - 0010111 - 280 - 287 8 11000000 through - 11000111 - - - -Deutsch Informational [Page 12] - -RFC 1951 DEFLATE Compressed Data Format Specification May 1996 - - - The code lengths are sufficient to generate the actual codes, - as described above; we show the codes in the table for added - clarity. Literal/length values 286-287 will never actually - occur in the compressed data, but participate in the code - construction. - - Distance codes 0-31 are represented by (fixed-length) 5-bit - codes, with possible additional bits as shown in the table - shown in Paragraph 3.2.5, above. Note that distance codes 30- - 31 will never actually occur in the compressed data. - - 3.2.7. Compression with dynamic Huffman codes (BTYPE=10) - - The Huffman codes for the two alphabets appear in the block - immediately after the header bits and before the actual - compressed data, first the literal/length code and then the - distance code. Each code is defined by a sequence of code - lengths, as discussed in Paragraph 3.2.2, above. For even - greater compactness, the code length sequences themselves are - compressed using a Huffman code. The alphabet for code lengths - is as follows: - - 0 - 15: Represent code lengths of 0 - 15 - 16: Copy the previous code length 3 - 6 times. - The next 2 bits indicate repeat length - (0 = 3, ... , 3 = 6) - Example: Codes 8, 16 (+2 bits 11), - 16 (+2 bits 10) will expand to - 12 code lengths of 8 (1 + 6 + 5) - 17: Repeat a code length of 0 for 3 - 10 times. - (3 bits of length) - 18: Repeat a code length of 0 for 11 - 138 times - (7 bits of length) - - A code length of 0 indicates that the corresponding symbol in - the literal/length or distance alphabet will not occur in the - block, and should not participate in the Huffman code - construction algorithm given earlier. If only one distance - code is used, it is encoded using one bit, not zero bits; in - this case there is a single code length of one, with one unused - code. One distance code of zero bits means that there are no - distance codes used at all (the data is all literals). - - We can now define the format of the block: - - 5 Bits: HLIT, # of Literal/Length codes - 257 (257 - 286) - 5 Bits: HDIST, # of Distance codes - 1 (1 - 32) - 4 Bits: HCLEN, # of Code Length codes - 4 (4 - 19) - - - -Deutsch Informational [Page 13] - -RFC 1951 DEFLATE Compressed Data Format Specification May 1996 - - - (HCLEN + 4) x 3 bits: code lengths for the code length - alphabet given just above, in the order: 16, 17, 18, - 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 - - These code lengths are interpreted as 3-bit integers - (0-7); as above, a code length of 0 means the - corresponding symbol (literal/length or distance code - length) is not used. - - HLIT + 257 code lengths for the literal/length alphabet, - encoded using the code length Huffman code - - HDIST + 1 code lengths for the distance alphabet, - encoded using the code length Huffman code - - The actual compressed data of the block, - encoded using the literal/length and distance Huffman - codes - - The literal/length symbol 256 (end of data), - encoded using the literal/length Huffman code - - The code length repeat codes can cross from HLIT + 257 to the - HDIST + 1 code lengths. In other words, all code lengths form - a single sequence of HLIT + HDIST + 258 values. - - 3.3. Compliance - - A compressor may limit further the ranges of values specified in - the previous section and still be compliant; for example, it may - limit the range of backward pointers to some value smaller than - 32K. Similarly, a compressor may limit the size of blocks so that - a compressible block fits in memory. - - A compliant decompressor must accept the full range of possible - values defined in the previous section, and must accept blocks of - arbitrary size. - -4. Compression algorithm details - - While it is the intent of this document to define the "deflate" - compressed data format without reference to any particular - compression algorithm, the format is related to the compressed - formats produced by LZ77 (Lempel-Ziv 1977, see reference [2] below); - since many variations of LZ77 are patented, it is strongly - recommended that the implementor of a compressor follow the general - algorithm presented here, which is known not to be patented per se. - The material in this section is not part of the definition of the - - - -Deutsch Informational [Page 14] - -RFC 1951 DEFLATE Compressed Data Format Specification May 1996 - - - specification per se, and a compressor need not follow it in order to - be compliant. - - The compressor terminates a block when it determines that starting a - new block with fresh trees would be useful, or when the block size - fills up the compressor's block buffer. - - The compressor uses a chained hash table to find duplicated strings, - using a hash function that operates on 3-byte sequences. At any - given point during compression, let XYZ be the next 3 input bytes to - be examined (not necessarily all different, of course). First, the - compressor examines the hash chain for XYZ. If the chain is empty, - the compressor simply writes out X as a literal byte and advances one - byte in the input. If the hash chain is not empty, indicating that - the sequence XYZ (or, if we are unlucky, some other 3 bytes with the - same hash function value) has occurred recently, the compressor - compares all strings on the XYZ hash chain with the actual input data - sequence starting at the current point, and selects the longest - match. - - The compressor searches the hash chains starting with the most recent - strings, to favor small distances and thus take advantage of the - Huffman encoding. The hash chains are singly linked. There are no - deletions from the hash chains; the algorithm simply discards matches - that are too old. To avoid a worst-case situation, very long hash - chains are arbitrarily truncated at a certain length, determined by a - run-time parameter. - - To improve overall compression, the compressor optionally defers the - selection of matches ("lazy matching"): after a match of length N has - been found, the compressor searches for a longer match starting at - the next input byte. If it finds a longer match, it truncates the - previous match to a length of one (thus producing a single literal - byte) and then emits the longer match. Otherwise, it emits the - original match, and, as described above, advances N bytes before - continuing. - - Run-time parameters also control this "lazy match" procedure. If - compression ratio is most important, the compressor attempts a - complete second search regardless of the length of the first match. - In the normal case, if the current match is "long enough", the - compressor reduces the search for a longer match, thus speeding up - the process. If speed is most important, the compressor inserts new - strings in the hash table only when no match was found, or when the - match is not "too long". This degrades the compression ratio but - saves time since there are both fewer insertions and fewer searches. - - - - - -Deutsch Informational [Page 15] - -RFC 1951 DEFLATE Compressed Data Format Specification May 1996 - - -5. References - - [1] Huffman, D. A., "A Method for the Construction of Minimum - Redundancy Codes", Proceedings of the Institute of Radio - Engineers, September 1952, Volume 40, Number 9, pp. 1098-1101. - - [2] Ziv J., Lempel A., "A Universal Algorithm for Sequential Data - Compression", IEEE Transactions on Information Theory, Vol. 23, - No. 3, pp. 337-343. - - [3] Gailly, J.-L., and Adler, M., ZLIB documentation and sources, - available in ftp://ftp.uu.net/pub/archiving/zip/doc/ - - [4] Gailly, J.-L., and Adler, M., GZIP documentation and sources, - available as gzip-*.tar in ftp://prep.ai.mit.edu/pub/gnu/ - - [5] Schwartz, E. S., and Kallick, B. "Generating a canonical prefix - encoding." Comm. ACM, 7,3 (Mar. 1964), pp. 166-169. - - [6] Hirschberg and Lelewer, "Efficient decoding of prefix codes," - Comm. ACM, 33,4, April 1990, pp. 449-459. - -6. Security Considerations - - Any data compression method involves the reduction of redundancy in - the data. Consequently, any corruption of the data is likely to have - severe effects and be difficult to correct. Uncompressed text, on - the other hand, will probably still be readable despite the presence - of some corrupted bytes. - - It is recommended that systems using this data format provide some - means of validating the integrity of the compressed data. See - reference [3], for example. - -7. Source code - - Source code for a C language implementation of a "deflate" compliant - compressor and decompressor is available within the zlib package at - ftp://ftp.uu.net/pub/archiving/zip/zlib/. - -8. Acknowledgements - - Trademarks cited in this document are the property of their - respective owners. - - Phil Katz designed the deflate format. Jean-Loup Gailly and Mark - Adler wrote the related software described in this specification. - Glenn Randers-Pehrson converted this document to RFC and HTML format. - - - -Deutsch Informational [Page 16] - -RFC 1951 DEFLATE Compressed Data Format Specification May 1996 - - -9. Author's Address - - L. Peter Deutsch - Aladdin Enterprises - 203 Santa Margarita Ave. - Menlo Park, CA 94025 - - Phone: (415) 322-0103 (AM only) - FAX: (415) 322-1734 - EMail: - - Questions about the technical content of this specification can be - sent by email to: - - Jean-Loup Gailly and - Mark Adler - - Editorial comments on this specification can be sent by email to: - - L. Peter Deutsch and - Glenn Randers-Pehrson - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -Deutsch Informational [Page 17] - diff --git a/cpukit/zlib/doc/rfc1952.txt b/cpukit/zlib/doc/rfc1952.txt deleted file mode 100644 index a8e51b4567..0000000000 --- a/cpukit/zlib/doc/rfc1952.txt +++ /dev/null @@ -1,675 +0,0 @@ - - - - - - -Network Working Group P. Deutsch -Request for Comments: 1952 Aladdin Enterprises -Category: Informational May 1996 - - - GZIP file format specification version 4.3 - -Status of This Memo - - This memo provides information for the Internet community. This memo - does not specify an Internet standard of any kind. Distribution of - this memo is unlimited. - -IESG Note: - - The IESG takes no position on the validity of any Intellectual - Property Rights statements contained in this document. - -Notices - - Copyright (c) 1996 L. Peter Deutsch - - Permission is granted to copy and distribute this document for any - purpose and without charge, including translations into other - languages and incorporation into compilations, provided that the - copyright notice and this notice are preserved, and that any - substantive changes or deletions from the original are clearly - marked. - - A pointer to the latest version of this and related documentation in - HTML format can be found at the URL - . - -Abstract - - This specification defines a lossless compressed data format that is - compatible with the widely used GZIP utility. The format includes a - cyclic redundancy check value for detecting data corruption. The - format presently uses the DEFLATE method of compression but can be - easily extended to use other compression methods. The format can be - implemented readily in a manner not covered by patents. - - - - - - - - - - -Deutsch Informational [Page 1] - -RFC 1952 GZIP File Format Specification May 1996 - - -Table of Contents - - 1. Introduction ................................................... 2 - 1.1. Purpose ................................................... 2 - 1.2. Intended audience ......................................... 3 - 1.3. Scope ..................................................... 3 - 1.4. Compliance ................................................ 3 - 1.5. Definitions of terms and conventions used ................. 3 - 1.6. Changes from previous versions ............................ 3 - 2. Detailed specification ......................................... 4 - 2.1. Overall conventions ....................................... 4 - 2.2. File format ............................................... 5 - 2.3. Member format ............................................. 5 - 2.3.1. Member header and trailer ........................... 6 - 2.3.1.1. Extra field ................................... 8 - 2.3.1.2. Compliance .................................... 9 - 3. References .................................................. 9 - 4. Security Considerations .................................... 10 - 5. Acknowledgements ........................................... 10 - 6. Author's Address ........................................... 10 - 7. Appendix: Jean-Loup Gailly's gzip utility .................. 11 - 8. Appendix: Sample CRC Code .................................. 11 - -1. Introduction - - 1.1. Purpose - - The purpose of this specification is to define a lossless - compressed data format that: - - * Is independent of CPU type, operating system, file system, - and character set, and hence can be used for interchange; - * Can compress or decompress a data stream (as opposed to a - randomly accessible file) to produce another data stream, - using only an a priori bounded amount of intermediate - storage, and hence can be used in data communications or - similar structures such as Unix filters; - * Compresses data with efficiency comparable to the best - currently available general-purpose compression methods, - and in particular considerably better than the "compress" - program; - * Can be implemented readily in a manner not covered by - patents, and hence can be practiced freely; - * Is compatible with the file format produced by the current - widely used gzip utility, in that conforming decompressors - will be able to read data produced by the existing gzip - compressor. - - - - -Deutsch Informational [Page 2] - -RFC 1952 GZIP File Format Specification May 1996 - - - The data format defined by this specification does not attempt to: - - * Provide random access to compressed data; - * Compress specialized data (e.g., raster graphics) as well as - the best currently available specialized algorithms. - - 1.2. Intended audience - - This specification is intended for use by implementors of software - to compress data into gzip format and/or decompress data from gzip - format. - - The text of the specification assumes a basic background in - programming at the level of bits and other primitive data - representations. - - 1.3. Scope - - The specification specifies a compression method and a file format - (the latter assuming only that a file can store a sequence of - arbitrary bytes). It does not specify any particular interface to - a file system or anything about character sets or encodings - (except for file names and comments, which are optional). - - 1.4. Compliance - - Unless otherwise indicated below, a compliant decompressor must be - able to accept and decompress any file that conforms to all the - specifications presented here; a compliant compressor must produce - files that conform to all the specifications presented here. The - material in the appendices is not part of the specification per se - and is not relevant to compliance. - - 1.5. Definitions of terms and conventions used - - byte: 8 bits stored or transmitted as a unit (same as an octet). - (For this specification, a byte is exactly 8 bits, even on - machines which store a character on a number of bits different - from 8.) See below for the numbering of bits within a byte. - - 1.6. Changes from previous versions - - There have been no technical changes to the gzip format since - version 4.1 of this specification. In version 4.2, some - terminology was changed, and the sample CRC code was rewritten for - clarity and to eliminate the requirement for the caller to do pre- - and post-conditioning. Version 4.3 is a conversion of the - specification to RFC style. - - - -Deutsch Informational [Page 3] - -RFC 1952 GZIP File Format Specification May 1996 - - -2. Detailed specification - - 2.1. Overall conventions - - In the diagrams below, a box like this: - - +---+ - | | <-- the vertical bars might be missing - +---+ - - represents one byte; a box like this: - - +==============+ - | | - +==============+ - - represents a variable number of bytes. - - Bytes stored within a computer do not have a "bit order", since - they are always treated as a unit. However, a byte considered as - an integer between 0 and 255 does have a most- and least- - significant bit, and since we write numbers with the most- - significant digit on the left, we also write bytes with the most- - significant bit on the left. In the diagrams below, we number the - bits of a byte so that bit 0 is the least-significant bit, i.e., - the bits are numbered: - - +--------+ - |76543210| - +--------+ - - This document does not address the issue of the order in which - bits of a byte are transmitted on a bit-sequential medium, since - the data format described here is byte- rather than bit-oriented. - - Within a computer, a number may occupy multiple bytes. All - multi-byte numbers in the format described here are stored with - the least-significant byte first (at the lower memory address). - For example, the decimal number 520 is stored as: - - 0 1 - +--------+--------+ - |00001000|00000010| - +--------+--------+ - ^ ^ - | | - | + more significant byte = 2 x 256 - + less significant byte = 8 - - - -Deutsch Informational [Page 4] - -RFC 1952 GZIP File Format Specification May 1996 - - - 2.2. File format - - A gzip file consists of a series of "members" (compressed data - sets). The format of each member is specified in the following - section. The members simply appear one after another in the file, - with no additional information before, between, or after them. - - 2.3. Member format - - Each member has the following structure: - - +---+---+---+---+---+---+---+---+---+---+ - |ID1|ID2|CM |FLG| MTIME |XFL|OS | (more-->) - +---+---+---+---+---+---+---+---+---+---+ - - (if FLG.FEXTRA set) - - +---+---+=================================+ - | XLEN |...XLEN bytes of "extra field"...| (more-->) - +---+---+=================================+ - - (if FLG.FNAME set) - - +=========================================+ - |...original file name, zero-terminated...| (more-->) - +=========================================+ - - (if FLG.FCOMMENT set) - - +===================================+ - |...file comment, zero-terminated...| (more-->) - +===================================+ - - (if FLG.FHCRC set) - - +---+---+ - | CRC16 | - +---+---+ - - +=======================+ - |...compressed blocks...| (more-->) - +=======================+ - - 0 1 2 3 4 5 6 7 - +---+---+---+---+---+---+---+---+ - | CRC32 | ISIZE | - +---+---+---+---+---+---+---+---+ - - - - -Deutsch Informational [Page 5] - -RFC 1952 GZIP File Format Specification May 1996 - - - 2.3.1. Member header and trailer - - ID1 (IDentification 1) - ID2 (IDentification 2) - These have the fixed values ID1 = 31 (0x1f, \037), ID2 = 139 - (0x8b, \213), to identify the file as being in gzip format. - - CM (Compression Method) - This identifies the compression method used in the file. CM - = 0-7 are reserved. CM = 8 denotes the "deflate" - compression method, which is the one customarily used by - gzip and which is documented elsewhere. - - FLG (FLaGs) - This flag byte is divided into individual bits as follows: - - bit 0 FTEXT - bit 1 FHCRC - bit 2 FEXTRA - bit 3 FNAME - bit 4 FCOMMENT - bit 5 reserved - bit 6 reserved - bit 7 reserved - - If FTEXT is set, the file is probably ASCII text. This is - an optional indication, which the compressor may set by - checking a small amount of the input data to see whether any - non-ASCII characters are present. In case of doubt, FTEXT - is cleared, indicating binary data. For systems which have - different file formats for ascii text and binary data, the - decompressor can use FTEXT to choose the appropriate format. - We deliberately do not specify the algorithm used to set - this bit, since a compressor always has the option of - leaving it cleared and a decompressor always has the option - of ignoring it and letting some other program handle issues - of data conversion. - - If FHCRC is set, a CRC16 for the gzip header is present, - immediately before the compressed data. The CRC16 consists - of the two least significant bytes of the CRC32 for all - bytes of the gzip header up to and not including the CRC16. - [The FHCRC bit was never set by versions of gzip up to - 1.2.4, even though it was documented with a different - meaning in gzip 1.2.4.] - - If FEXTRA is set, optional extra fields are present, as - described in a following section. - - - -Deutsch Informational [Page 6] - -RFC 1952 GZIP File Format Specification May 1996 - - - If FNAME is set, an original file name is present, - terminated by a zero byte. The name must consist of ISO - 8859-1 (LATIN-1) characters; on operating systems using - EBCDIC or any other character set for file names, the name - must be translated to the ISO LATIN-1 character set. This - is the original name of the file being compressed, with any - directory components removed, and, if the file being - compressed is on a file system with case insensitive names, - forced to lower case. There is no original file name if the - data was compressed from a source other than a named file; - for example, if the source was stdin on a Unix system, there - is no file name. - - If FCOMMENT is set, a zero-terminated file comment is - present. This comment is not interpreted; it is only - intended for human consumption. The comment must consist of - ISO 8859-1 (LATIN-1) characters. Line breaks should be - denoted by a single line feed character (10 decimal). - - Reserved FLG bits must be zero. - - MTIME (Modification TIME) - This gives the most recent modification time of the original - file being compressed. The time is in Unix format, i.e., - seconds since 00:00:00 GMT, Jan. 1, 1970. (Note that this - may cause problems for MS-DOS and other systems that use - local rather than Universal time.) If the compressed data - did not come from a file, MTIME is set to the time at which - compression started. MTIME = 0 means no time stamp is - available. - - XFL (eXtra FLags) - These flags are available for use by specific compression - methods. The "deflate" method (CM = 8) sets these flags as - follows: - - XFL = 2 - compressor used maximum compression, - slowest algorithm - XFL = 4 - compressor used fastest algorithm - - OS (Operating System) - This identifies the type of file system on which compression - took place. This may be useful in determining end-of-line - convention for text files. The currently defined values are - as follows: - - - - - - -Deutsch Informational [Page 7] - -RFC 1952 GZIP File Format Specification May 1996 - - - 0 - FAT filesystem (MS-DOS, OS/2, NT/Win32) - 1 - Amiga - 2 - VMS (or OpenVMS) - 3 - Unix - 4 - VM/CMS - 5 - Atari TOS - 6 - HPFS filesystem (OS/2, NT) - 7 - Macintosh - 8 - Z-System - 9 - CP/M - 10 - TOPS-20 - 11 - NTFS filesystem (NT) - 12 - QDOS - 13 - Acorn RISCOS - 255 - unknown - - XLEN (eXtra LENgth) - If FLG.FEXTRA is set, this gives the length of the optional - extra field. See below for details. - - CRC32 (CRC-32) - This contains a Cyclic Redundancy Check value of the - uncompressed data computed according to CRC-32 algorithm - used in the ISO 3309 standard and in section 8.1.1.6.2 of - ITU-T recommendation V.42. (See http://www.iso.ch for - ordering ISO documents. See gopher://info.itu.ch for an - online version of ITU-T V.42.) - - ISIZE (Input SIZE) - This contains the size of the original (uncompressed) input - data modulo 2^32. - - 2.3.1.1. Extra field - - If the FLG.FEXTRA bit is set, an "extra field" is present in - the header, with total length XLEN bytes. It consists of a - series of subfields, each of the form: - - +---+---+---+---+==================================+ - |SI1|SI2| LEN |... LEN bytes of subfield data ...| - +---+---+---+---+==================================+ - - SI1 and SI2 provide a subfield ID, typically two ASCII letters - with some mnemonic value. Jean-Loup Gailly - is maintaining a registry of subfield - IDs; please send him any subfield ID you wish to use. Subfield - IDs with SI2 = 0 are reserved for future use. The following - IDs are currently defined: - - - -Deutsch Informational [Page 8] - -RFC 1952 GZIP File Format Specification May 1996 - - - SI1 SI2 Data - ---------- ---------- ---- - 0x41 ('A') 0x70 ('P') Apollo file type information - - LEN gives the length of the subfield data, excluding the 4 - initial bytes. - - 2.3.1.2. Compliance - - A compliant compressor must produce files with correct ID1, - ID2, CM, CRC32, and ISIZE, but may set all the other fields in - the fixed-length part of the header to default values (255 for - OS, 0 for all others). The compressor must set all reserved - bits to zero. - - A compliant decompressor must check ID1, ID2, and CM, and - provide an error indication if any of these have incorrect - values. It must examine FEXTRA/XLEN, FNAME, FCOMMENT and FHCRC - at least so it can skip over the optional fields if they are - present. It need not examine any other part of the header or - trailer; in particular, a decompressor may ignore FTEXT and OS - and always produce binary output, and still be compliant. A - compliant decompressor must give an error indication if any - reserved bit is non-zero, since such a bit could indicate the - presence of a new field that would cause subsequent data to be - interpreted incorrectly. - -3. References - - [1] "Information Processing - 8-bit single-byte coded graphic - character sets - Part 1: Latin alphabet No.1" (ISO 8859-1:1987). - The ISO 8859-1 (Latin-1) character set is a superset of 7-bit - ASCII. Files defining this character set are available as - iso_8859-1.* in ftp://ftp.uu.net/graphics/png/documents/ - - [2] ISO 3309 - - [3] ITU-T recommendation V.42 - - [4] Deutsch, L.P.,"DEFLATE Compressed Data Format Specification", - available in ftp://ftp.uu.net/pub/archiving/zip/doc/ - - [5] Gailly, J.-L., GZIP documentation, available as gzip-*.tar in - ftp://prep.ai.mit.edu/pub/gnu/ - - [6] Sarwate, D.V., "Computation of Cyclic Redundancy Checks via Table - Look-Up", Communications of the ACM, 31(8), pp.1008-1013. - - - - -Deutsch Informational [Page 9] - -RFC 1952 GZIP File Format Specification May 1996 - - - [7] Schwaderer, W.D., "CRC Calculation", April 85 PC Tech Journal, - pp.118-133. - - [8] ftp://ftp.adelaide.edu.au/pub/rocksoft/papers/crc_v3.txt, - describing the CRC concept. - -4. Security Considerations - - Any data compression method involves the reduction of redundancy in - the data. Consequently, any corruption of the data is likely to have - severe effects and be difficult to correct. Uncompressed text, on - the other hand, will probably still be readable despite the presence - of some corrupted bytes. - - It is recommended that systems using this data format provide some - means of validating the integrity of the compressed data, such as by - setting and checking the CRC-32 check value. - -5. Acknowledgements - - Trademarks cited in this document are the property of their - respective owners. - - Jean-Loup Gailly designed the gzip format and wrote, with Mark Adler, - the related software described in this specification. Glenn - Randers-Pehrson converted this document to RFC and HTML format. - -6. Author's Address - - L. Peter Deutsch - Aladdin Enterprises - 203 Santa Margarita Ave. - Menlo Park, CA 94025 - - Phone: (415) 322-0103 (AM only) - FAX: (415) 322-1734 - EMail: - - Questions about the technical content of this specification can be - sent by email to: - - Jean-Loup Gailly and - Mark Adler - - Editorial comments on this specification can be sent by email to: - - L. Peter Deutsch and - Glenn Randers-Pehrson - - - -Deutsch Informational [Page 10] - -RFC 1952 GZIP File Format Specification May 1996 - - -7. Appendix: Jean-Loup Gailly's gzip utility - - The most widely used implementation of gzip compression, and the - original documentation on which this specification is based, were - created by Jean-Loup Gailly . Since this - implementation is a de facto standard, we mention some more of its - features here. Again, the material in this section is not part of - the specification per se, and implementations need not follow it to - be compliant. - - When compressing or decompressing a file, gzip preserves the - protection, ownership, and modification time attributes on the local - file system, since there is no provision for representing protection - attributes in the gzip file format itself. Since the file format - includes a modification time, the gzip decompressor provides a - command line switch that assigns the modification time from the file, - rather than the local modification time of the compressed input, to - the decompressed output. - -8. Appendix: Sample CRC Code - - The following sample code represents a practical implementation of - the CRC (Cyclic Redundancy Check). (See also ISO 3309 and ITU-T V.42 - for a formal specification.) - - The sample code is in the ANSI C programming language. Non C users - may find it easier to read with these hints: - - & Bitwise AND operator. - ^ Bitwise exclusive-OR operator. - >> Bitwise right shift operator. When applied to an - unsigned quantity, as here, right shift inserts zero - bit(s) at the left. - ! Logical NOT operator. - ++ "n++" increments the variable n. - 0xNNN 0x introduces a hexadecimal (base 16) constant. - Suffix L indicates a long value (at least 32 bits). - - /* Table of CRCs of all 8-bit messages. */ - unsigned long crc_table[256]; - - /* Flag: has the table been computed? Initially false. */ - int crc_table_computed = 0; - - /* Make the table for a fast CRC. */ - void make_crc_table(void) - { - unsigned long c; - - - -Deutsch Informational [Page 11] - -RFC 1952 GZIP File Format Specification May 1996 - - - int n, k; - for (n = 0; n < 256; n++) { - c = (unsigned long) n; - for (k = 0; k < 8; k++) { - if (c & 1) { - c = 0xedb88320L ^ (c >> 1); - } else { - c = c >> 1; - } - } - crc_table[n] = c; - } - crc_table_computed = 1; - } - - /* - Update a running crc with the bytes buf[0..len-1] and return - the updated crc. The crc should be initialized to zero. Pre- and - post-conditioning (one's complement) is performed within this - function so it shouldn't be done by the caller. Usage example: - - unsigned long crc = 0L; - - while (read_buffer(buffer, length) != EOF) { - crc = update_crc(crc, buffer, length); - } - if (crc != original_crc) error(); - */ - unsigned long update_crc(unsigned long crc, - unsigned char *buf, int len) - { - unsigned long c = crc ^ 0xffffffffL; - int n; - - if (!crc_table_computed) - make_crc_table(); - for (n = 0; n < len; n++) { - c = crc_table[(c ^ buf[n]) & 0xff] ^ (c >> 8); - } - return c ^ 0xffffffffL; - } - - /* Return the CRC of the bytes buf[0..len-1]. */ - unsigned long crc(unsigned char *buf, int len) - { - return update_crc(0L, buf, len); - } - - - - -Deutsch Informational [Page 12] - diff --git a/testsuites/.cvsignore b/testsuites/.cvsignore deleted file mode 100644 index bfdfd995be..0000000000 --- a/testsuites/.cvsignore +++ /dev/null @@ -1,14 +0,0 @@ -aclocal.m4 -autom4te*.cache -config.cache -config.guess -config.log -config.status -config.sub -configure -depcomp -install-sh -Makefile -Makefile.in -missing -mkinstalldirs diff --git a/testsuites/ChangeLog b/testsuites/ChangeLog deleted file mode 100644 index f145c11896..0000000000 --- a/testsuites/ChangeLog +++ /dev/null @@ -1,57 +0,0 @@ -2003-02-11 Ralf Corsepius - - * configure.ac: AM_INIT_AUTOMAKE([1.7.2]). - -2003-02-11 Ralf Corsepius - - * configure.ac: AC_PREREQ(2.57). - -2002-10-21 Ralf Corsepius - - * .cvsignore: Reformat. - Add autom4te*cache. - Remove autom4te.cache. - -2002-04-14 Ralf Corsepius - - * configure.ac: Remove ENABLE_GCC28. - -2002-03-27 Ralf Corsepius - - * configure.ac: - AC_INIT(package,_RTEMS_VERSION,_RTEMS_BUGS). - AM_INIT_AUTOMAKE([no-define foreign 1.6]). - * Makefile.am: Remove AUTOMAKE_OPTIONS. - -2001-10-11 Ralf Corsepius - - * .cvsignore: Add autom4te.cache for autoconf > 2.52. - * configure.in: Remove. - * configure.ac: New file, generated from configure.in by autoupdate. - -2001-09-13 Ralf Corsepius - - * configure.in: autoupdate to autoconf-2.52, new CONFIG_SUBDIRS - handling. - -2001-05-10 Ralf Corsepius - - * configure.in: Remove RTEMS_PROG_CC_FOR_TARGET, - RTEMS_PROG_CXX_FOR_TARGET, RTEMS_CANONICALIZE_TOOLS. - -2000-11-09 Ralf Corsepius - - * Makefile.am: Use ... instead of RTEMS_TOPdir in ACLOCAL_AMFLAGS. - -2000-11-02 Ralf Corsepius - - * Makefile.am: Switch to ACLOCAL_AMFLAGS = -I $(RTEMS_TOPdir)/aclocal. - -2000-10-27 Ralf Corsepius - - * Makefile.am: ACLOCAL_AMFLAGS= -I $(RTEMS_TOPdir)/macros. - Switch to GNU canonicalization. - -2000-08-10 Joel Sherrill - - * ChangeLog: New file. diff --git a/testsuites/Makefile.am b/testsuites/Makefile.am deleted file mode 100644 index aa3c38c820..0000000000 --- a/testsuites/Makefile.am +++ /dev/null @@ -1,12 +0,0 @@ -## -## $Id$ -## - -ACLOCAL_AMFLAGS = -I ../../../aclocal - -SUBDIRS = @subdirs@ - -EXTRA_DIST = PROBLEMS - -include $(top_srcdir)/../../../automake/subdirs.am -include $(top_srcdir)/../../../automake/local.am diff --git a/testsuites/PROBLEMS b/testsuites/PROBLEMS deleted file mode 100644 index 6f3e2920be..0000000000 --- a/testsuites/PROBLEMS +++ /dev/null @@ -1,42 +0,0 @@ -# -# $Id$ -# - -The tests were designed to operate in a very controlled environment. If -one uses interrupt-driven console output, then tasks will block unexpectedly -when a buffer filles and interrupts will perturb with the task execution order. - -The tmtests should only be run with all interrupt sources disabled using -polled IO. - -The following is a list of reported failures from running the tests on -a board with interrupt driven console IO. These problems do not -occur when using polled IO. - -tm03, tm04, tm05, tm07, tm11, tm12, tm13, tm14, tm15, tm16, tm17, -tm19, tm22, tm23, tm24 - All hit my breakpoint at -_Internal_error_Occurred. - -tm20, tm27 - hang in middle of tests. -tm26 - hangs at end of tests. - -sp02 - Gets through some tests, then attempts to execute code at -location 0. -sp04 - hangs at end of tests. -sp06 - rtems_task_restart of TA3 FAILED -- expected (0) got (4) -sp07, sp14 - hang in middle of tests -sp13, sp15 - terminate properly, but output at end is missing. -sp16 - _Internal_error_Occurred. -sp19 - rtems_clock_get FAILED -- expected (0) got (11), and hangs in -middle of test. - -cpuuse - hangs in middle of tests -malloctest - prints nothing - -psx05 - Init: pthread_mutex_init - EINVAL (bad protocol) -../../../../../../../src/rtems-981001/c/src/tests/psxtests/psx05/../../../../../ -../../src/rtems-981001/c/src/tests/psxtests/psx05/task.c:35: -failed assertion `status == EBUSY' -N\: pthread_mutex_init - EINVAL (bad priority ceiling) - - diff --git a/testsuites/README b/testsuites/README deleted file mode 100644 index f799370569..0000000000 --- a/testsuites/README +++ /dev/null @@ -1,44 +0,0 @@ -# -# $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. - - mptests - - 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. - - psxtests - - This directory contains the RTEMS POSIX API Test Suite. - The tests in this directory test the POSIX API support in RTEMS. - - sptests - - 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. - - tmtests - - 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/configure.ac b/testsuites/configure.ac deleted file mode 100644 index 9f9b90b939..0000000000 --- a/testsuites/configure.ac +++ /dev/null @@ -1,63 +0,0 @@ -## Process this file with autoconf to produce a configure script. -## -## $Id$ - -AC_PREREQ(2.57) -AC_INIT([rtems-c-src-tests],[_RTEMS_VERSION],[rtems-bugs@OARcorp.com]) -AC_CONFIG_SRCDIR([samples]) -RTEMS_TOP(../../..) -AC_CONFIG_AUX_DIR(../../..) - -RTEMS_CANONICAL_TARGET_CPU - -AM_INIT_AUTOMAKE([no-define foreign 1.7.2]) -AM_MAINTAINER_MODE - -RTEMS_ENABLE_POSIX -RTEMS_ENABLE_ITRON -RTEMS_ENABLE_NETWORKING -RTEMS_ENABLE_CXX -RTEMS_ENABLE_BARE -RTEMS_ENABLE_TESTS - -RTEMS_ENV_RTEMSBSP -RTEMS_CHECK_CPU -RTEMS_CANONICAL_HOST - -RTEMS_PROJECT_ROOT - -RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP) -RTEMS_CHECK_MULTIPROCESSING(RTEMS_BSP) -RTEMS_CHECK_POSIX_API(RTEMS_BSP) -RTEMS_CHECK_ITRON_API(RTEMS_BSP) - -AC_CONFIG_SUBDIRS(tools) -AC_CONFIG_SUBDIRS(support) -AC_CONFIG_SUBDIRS(samples) - -if test "$tests_enabled" = "yes"; then - # do functionality tests first, then performance tests - AC_CONFIG_SUBDIRS(libtests sptests) - if test "$HAS_MP" = "yes"; then - AC_CONFIG_SUBDIRS(mptests) - fi - if test "$HAS_POSIX_API" = "yes"; then - AC_CONFIG_SUBDIRS(psxtests) - fi - if test "$HAS_ITRON_API" = "yes"; then - AC_CONFIG_SUBDIRS(itrontests) - fi - # Now do performance tests - AC_CONFIG_SUBDIRS(tmtests) - if test "$HAS_ITRON_API" = "yes"; then - AC_CONFIG_SUBDIRS(tmitrontests) - fi -fi - -AC_SUBST(BARE_CPU_CFLAGS) -AC_SUBST(BARE_CPU_MODEL) - -# Explicitly list all Makefiles here -AC_CONFIG_FILES([Makefile -]) -AC_OUTPUT diff --git a/testsuites/itrontests/.cvsignore b/testsuites/itrontests/.cvsignore deleted file mode 100644 index bfdfd995be..0000000000 --- a/testsuites/itrontests/.cvsignore +++ /dev/null @@ -1,14 +0,0 @@ -aclocal.m4 -autom4te*.cache -config.cache -config.guess -config.log -config.status -config.sub -configure -depcomp -install-sh -Makefile -Makefile.in -missing -mkinstalldirs diff --git a/testsuites/itrontests/ChangeLog b/testsuites/itrontests/ChangeLog deleted file mode 100644 index 9dcc92720f..0000000000 --- a/testsuites/itrontests/ChangeLog +++ /dev/null @@ -1,120 +0,0 @@ -2003-02-11 Ralf Corsepius - - * configure.ac: AM_INIT_AUTOMAKE([1.7.2]). - -2003-02-11 Ralf Corsepius - - * configure.ac: AC_PREREQ(2.57). - -2002-10-21 Ralf Corsepius - - * .cvsignore: Reformat. - Add autom4te*cache. - Remove autom4te.cache. - -2002-08-11 Ralf Corsepius - - * itronhello/Makefile.am: Use .$(OBJEXT) instead of .o. - * itronmbf01/Makefile.am: Use .$(OBJEXT) instead of .o. - * itronmbox01/Makefile.am: Use .$(OBJEXT) instead of .o. - * itronsem01/Makefile.am: Use .$(OBJEXT) instead of .o. - * itrontask01/Makefile.am: Use .$(OBJEXT) instead of .o. - * itrontask02/Makefile.am: Use .$(OBJEXT) instead of .o. - * itrontask03/Makefile.am: Use .$(OBJEXT) instead of .o. - * itrontask04/Makefile.am: Use .$(OBJEXT) instead of .o. - * itrontime01/Makefile.am: Use .$(OBJEXT) instead of .o. - -2002-08-01 Joel Sherrill - - * Per PR47 add support for buffered test output. This involved - adding defines to redirect output to a buffer and dump it when - full, at "test pause", and at exit. To avoid problems when redefining - exit(), all tests were modified to call rtems_test_exit(). - Some tests, notable psxtests, had to be modified to include - the standard test macro .h file (pmacros.h or tmacros.h) to - enable this support. - * itronhello/init.c, itronmbf01/init.c, itronmbox01/init.c, - itronsem01/init.c, itrontask01/task1.c, itrontask02/init.c, - itrontask03/task1.c, itrontask04/task3.c, itrontime01/init.c: Modified. - -2002-04-14 Ralf Corsepius - - * configure.ac: Remove ENABLE_GCC28. - -2002-03-27 Ralf Corsepius - - * configure.ac: - AC_INIT(package,_RTEMS_VERSION,_RTEMS_BUGS). - AM_INIT_AUTOMAKE([no-define foreign 1.6]). - * itronhello/Makefile.am: Remove AUTOMAKE_OPTIONS. - * Makefile.am: Remove AUTOMAKE_OPTIONS. - * itronmbf01/Makefile.am: Remove AUTOMAKE_OPTIONS. - * itronmbox01/Makefile.am: Remove AUTOMAKE_OPTIONS. - * itronsem01/Makefile.am: Remove AUTOMAKE_OPTIONS. - * itrontask01/Makefile.am: Remove AUTOMAKE_OPTIONS. - * itrontask02/Makefile.am: Remove AUTOMAKE_OPTIONS. - * itrontask03/Makefile.am: Remove AUTOMAKE_OPTIONS. - * itrontask04/Makefile.am: Remove AUTOMAKE_OPTIONS. - * itrontime01/Makefile.am: Remove AUTOMAKE_OPTIONS. - -2001-10-11 Ralf Corsepius - - * .cvsignore: Add autom4te.cache for autoconf > 2.52. - * configure.in: Remove. - * configure.ac: New file, generated from configure.in by autoupdate. - -2001-09-22 Ralf Corsepius - - * itrontests.am: Use TMPINSTALL_FILES = to make automake-1.5 happy. - -2001-09-19 Ralf Corsepius - - * itrontask03/Makefile.am: include leaf.am instead of leaf.cfg. - * itrontask04/Makefile.am: include leaf.am instead of leaf.cfg. - * itronmbf01/Makefile.am: include leaf.am instead of leaf.cfg. - * itronsem01/Makefile.am: include leaf.am instead of leaf.cfg. - * itronhello/Makefile.am: include leaf.am instead of leaf.cfg. - * itrontime01/Makefile.am: include leaf.am instead of leaf.cfg. - * itrontask01/Makefile.am: include leaf.am instead of leaf.cfg. - * itrontask02/Makefile.am: include leaf.am instead of leaf.cfg. - * itronmbox01/Makefile.am: include leaf.am instead of leaf.cfg. - -2001-05-10 Ralf Corsepius - - * configure.in: Use RTEMS_PROG_CC_FOR_TARGET([-ansi -fasm]). - -2001-04-20 Joel Sherrill - - * itronmbf01/itronmbf01.scn, itronmbox01/init.c, - itronsem01/itronsem01.scn, itrontime01/init.c: Various - adjustments so test output matches screens more reliably. - -2000-11-20 Joel Sherrill - - * itrontask01/system.h: Configure enough stack memory. - -2000-11-09 Ralf Corsepius - - * Makefile.am: Use ... instead of RTEMS_TOPdir in ACLOCAL_AMFLAGS. - -2000-11-02 Ralf Corsepius - - * Makefile.am: Switch to ACLOCAL_AMFLAGS = -I $(RTEMS_TOPdir)/aclocal. - -2000-10-27 Ralf Corsepius - - * Makefile.am: ACLOCAL_AMFLAGS= -I $(RTEMS_TOPdir)/macros. - Switch to GNU canonicalization. - * itrontests.am: Remove DEFS. - -2000-09-04 Ralf Corsepius - - * itronhello/Makefile.am, itronmbf01/Makefile.am, - itronmbox01/Makefile.am, itronsem01/Makefile.am, - itrontask01/Makefile.am, itrontask02/Makefile.am, - itrontask03/Makefile.am, itrontask04/Makefile.am, - itrontime01/Makefile.am: Include compile.am - -2000-08-10 Joel Sherrill - - * ChangeLog: New file. diff --git a/testsuites/itrontests/Makefile.am b/testsuites/itrontests/Makefile.am deleted file mode 100644 index 476f4aff8a..0000000000 --- a/testsuites/itrontests/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -## -## $Id$ -## - -ACLOCAL_AMFLAGS = -I ../../../../aclocal - -SUBDIRS = itronhello itrontask01 itrontask02 itrontask03 itrontask04 \ - itronmbf01 itronmbox01 itronsem01 itrontime01 - -EXTRA_DIST = itrontests.am - -include $(top_srcdir)/../../../../automake/subdirs.am -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/itrontests/README b/testsuites/itrontests/README deleted file mode 100644 index 65c5d4165d..0000000000 --- a/testsuites/itrontests/README +++ /dev/null @@ -1,6 +0,0 @@ -# -# $Id$ -# - -This directory contains the functionality tests for the ITRON 3.0 API -implementation. diff --git a/testsuites/itrontests/configure.ac b/testsuites/itrontests/configure.ac deleted file mode 100644 index 881ad25bdf..0000000000 --- a/testsuites/itrontests/configure.ac +++ /dev/null @@ -1,49 +0,0 @@ -## Process this file with autoconf to produce a configure script. -## -## $Id$ - -AC_PREREQ(2.57) -AC_INIT([rtems-c-src-tests-itrontests],[_RTEMS_VERSION],[rtems-bugs@OARcorp.com]) -AC_CONFIG_SRCDIR([itronhello]) -RTEMS_TOP(../../../..) -AC_CONFIG_AUX_DIR(../../../..) - -RTEMS_CANONICAL_TARGET_CPU - -AM_INIT_AUTOMAKE([no-define foreign 1.7.2]) -AM_MAINTAINER_MODE - -RTEMS_ENABLE_BARE - -RTEMS_ENV_RTEMSBSP -RTEMS_CHECK_CPU -RTEMS_CANONICAL_HOST - -RTEMS_PROJECT_ROOT - -RTEMS_PROG_CC_FOR_TARGET([-ansi -fasm]) - -RTEMS_CANONICALIZE_TOOLS - -RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP) - -AC_SUBST(BARE_CPU_CFLAGS) -AC_SUBST(BARE_CPU_MODEL) -AC_SUBST(CC_CFLAGS_DEFAULT) -AC_SUBST(CC_CFLAGS_DEBUG_V) -AC_SUBST(CC_CFLAGS_PROFILE_V) -AC_SUBST(CC_LDFLAGS_PROFILE_V) - -# Explicitly list all Makefiles here -AC_CONFIG_FILES([Makefile -itronhello/Makefile -itronmbf01/Makefile -itronmbox01/Makefile -itronsem01/Makefile -itrontask01/Makefile -itrontask02/Makefile -itrontask03/Makefile -itrontask04/Makefile -itrontime01/Makefile -]) -AC_OUTPUT diff --git a/testsuites/itrontests/itronhello/.cvsignore b/testsuites/itrontests/itronhello/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/itrontests/itronhello/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/itrontests/itronhello/Makefile.am b/testsuites/itrontests/itronhello/Makefile.am deleted file mode 100644 index 2a353f93b6..0000000000 --- a/testsuites/itrontests/itronhello/Makefile.am +++ /dev/null @@ -1,41 +0,0 @@ -## -## $Id$ -## - - -TEST = itronhello -PGM = ${ARCH}/$(TEST).exe - -MANAGERS = all - -C_FILES = init.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/itrontests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/itrontests/itronhello/init.c b/testsuites/itrontests/itronhello/init.c deleted file mode 100644 index 425623ff5e..0000000000 --- a/testsuites/itrontests/itronhello/init.c +++ /dev/null @@ -1,33 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" -#include - -void ITRON_Init( void ) -{ - printf( "\n\n*** ITRON HELLO WORLD TEST ***\n" ); - printf( "Hello World\n" ); - printf( "*** END OF ITRON HELLO WORLD TEST ***\n" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/itrontests/itronhello/itronhello.doc b/testsuites/itrontests/itronhello/itronhello.doc deleted file mode 100644 index 988364bf45..0000000000 --- a/testsuites/itrontests/itronhello/itronhello.doc +++ /dev/null @@ -1,23 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - -This file describes the directives and concepts tested by this test set. - -test set name: itronhello - -directives: - cre_tsk, sta_tsk - -concepts: - - a. Verifies the initial itron task can be created and started. - - diff --git a/testsuites/itrontests/itronhello/itronhello.scn b/testsuites/itrontests/itronhello/itronhello.scn deleted file mode 100644 index 7acacc083b..0000000000 --- a/testsuites/itrontests/itronhello/itronhello.scn +++ /dev/null @@ -1,3 +0,0 @@ -*** ITRON HELLO WORLD TEST *** -Hello World -*** END OF ITRON HELLO WORLD TEST *** diff --git a/testsuites/itrontests/itronhello/system.h b/testsuites/itrontests/itronhello/system.h deleted file mode 100644 index f74b1d985a..0000000000 --- a/testsuites/itrontests/itronhello/system.h +++ /dev/null @@ -1,39 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include - -/* functions */ - -void ITRON_Init( void ); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER - -#define CONFIGURE_MAXIMUM_ITRON_TASKS 1 - -#define CONFIGURE_ITRON_INIT_TASK_TABLE - -#define CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM - -#include - -/* global variables */ - -TEST_EXTERN rtems_id Global_variable; /* example global variable */ - -/* end of include file */ diff --git a/testsuites/itrontests/itronmbf01/.cvsignore b/testsuites/itrontests/itronmbf01/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/itrontests/itronmbf01/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/itrontests/itronmbf01/Makefile.am b/testsuites/itrontests/itronmbf01/Makefile.am deleted file mode 100644 index 88e2db3ccf..0000000000 --- a/testsuites/itrontests/itronmbf01/Makefile.am +++ /dev/null @@ -1,41 +0,0 @@ -## -## $Id$ -## - - -TEST = itronmbf01 -PGM = ${ARCH}/$(TEST).exe - -MANAGERS = all - -C_FILES = init.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/itrontests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/itrontests/itronmbf01/init.c b/testsuites/itrontests/itronmbf01/init.c deleted file mode 100644 index 575d1b61f2..0000000000 --- a/testsuites/itrontests/itronmbf01/init.c +++ /dev/null @@ -1,367 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" -#include -#include - -/* - * The following is hopefully temporary. - */ - -#include - -#define put_time(_s) \ -do { \ - time_t a_time_t; \ - a_time_t = time( 0 ); \ - printf( "%s%s", _s, ctime( &a_time_t ) ); \ -} while(0) - - - -void TestCre(); -void TestDel(); -void TestPsnd(); -void TestRef(); -void TestTrcv(); -void TestRcv(); -void TestPrcv(); - -void ITRON_Init( void ) -{ - printf( "\n\n*** ITRONMBF01 -- ITRON MESSAGE BUFFER TEST ***\n" ); - - TestCre(); - TestDel(); - TestPsnd(); - TestRef(); - TestRcv(); - TestRef(); - TestPrcv(); - TestTrcv(); - - printf("\n\n*** ITRONMBF01 --- ITRON MESSAGE BUFFER TEST ***\n"); - rtems_test_exit(0); -} - -void TestCre() -{ - ER status; - T_CMBF pk_cmbf; - - /* - * Exercise cre_mbf - this code seems to exercise every path. - */ - - puts( "Init - cre_mbf - NULL pk_cmbf returns E_PAR" ); - status = cre_mbf( 1, NULL ); - assert( status == E_PAR ); - - puts( "Init - cre_mbf - negative values for bufsz returns E_PAR" ); - pk_cmbf.bufsz = -1; - pk_cmbf.maxmsz = 100; - pk_cmbf.mbfatr = 0; - pk_cmbf.exinf = NULL; - status = cre_mbf( 1, &pk_cmbf ); - assert( status == E_PAR ); - - puts( "Init - cre_mbf - negative values for maxmsz returns E_PAR" ); - pk_cmbf.bufsz = 100; - pk_cmbf.maxmsz = -1; - status = cre_mbf( 1, &pk_cmbf ); - assert( status == E_PAR ); - - puts( "Init - cre_mbf - bufsz < maxmsz returns E_PAR" ); - pk_cmbf.bufsz = 100; - pk_cmbf.maxmsz = 101; - status = cre_mbf( 1, &pk_cmbf ); - assert( status == E_PAR ); - - /* - * Now run through all the bad ID errors - */ - - pk_cmbf.bufsz = 200; - pk_cmbf.maxmsz = 30; - puts( "Init - cre_mbf - bad id (less than -4) - E_OACV" ); - status = cre_mbf( -5, &pk_cmbf ); - assert( status == E_OACV ); - - puts( "Init - cre_mbf - bad id (between 0 and -4) - E_ID" ); - status = cre_mbf( -4, &pk_cmbf ); - assert( status == E_ID ); - - puts( "Init - cre_mbf - bad id (0) - E_ID" ); - status = cre_mbf( 0, &pk_cmbf ); - assert( status == E_ID ); - - puts( "Init - cre_mbf - bad id (too great) - E_ID" ); - status = cre_mbf( CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS + 1, &pk_cmbf ); - assert( status == E_ID ); - - puts( "Init - cre_mbf - create mbf 1 TA_TFIFO - E_OK" ); - pk_cmbf.bufsz = 600; - pk_cmbf.maxmsz = 200; - pk_cmbf.mbfatr = TA_TFIFO; - status = cre_mbf( 1, &pk_cmbf ); - assert( status == E_OK ); - - puts( "Init - cre_mbf - create mbf 1 again - E_OBJ" ); - status = cre_mbf( 1, &pk_cmbf ); - assert( status == E_OBJ ); - - puts( "Init - cre_mbf - create mbf 2 TA_TPRI - E_OK" ); - pk_cmbf.bufsz = 600; - pk_cmbf.maxmsz = 200; - pk_cmbf.mbfatr = TA_TPRI; - status = cre_mbf( 2, &pk_cmbf ); - assert( status == E_OK ); -} - -void TestDel() -{ - ER status; - - /* - * Generate all the bad id errors for del_mbf - */ - - puts( "Init - del_mbf - bad id (less than -4) - E_OACV" ); - status = del_mbf( -5 ); - assert( status == E_OACV ); - - puts( "Init - del_mbf - bad id (between 0 and -4) - E_ID" ); - status = del_mbf( -4 ); - assert( status == E_ID ); - - puts( "Init - del_mbf - bad id (0) - E_ID" ); - status = del_mbf( 0 ); - assert( status == E_ID ); - - puts( "Init - del_mbf - bad id (too great) - E_ID" ); - status = del_mbf( CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS + 1 ); - assert( status == E_ID ); - - - puts("Init - del_mbf - E_OK" ); - status = del_mbf(2); - assert(status == E_OK); -} - -void TestPsnd() -{ - ER status; - char msg[100] = "This is test message 1"; - - /* - * Generate all the bad id errors for psnd_mbf - */ - - puts( "Init - psnd_mbf - bad id (less than -4) - E_OACV" ); - status = psnd_mbf(-5, msg, sizeof(msg)); - assert( status == E_OACV ); - - puts( "Init - psnd_mbf - bad id (between 0 and -4) - E_ID" ); - status = psnd_mbf(-4, msg, sizeof(msg)); - assert( status == E_ID ); - - puts( "Init - psnd_mbf - bad id (0) - E_ID" ); - status = psnd_mbf(0, msg, sizeof(msg)); - assert( status == E_ID ); - - puts( "Init - psnd_mbf - bad id (too great) - E_ID" ); - status = psnd_mbf(CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS + 1, msg, - sizeof(msg)); - assert( status == E_ID ); - - puts( "Init - psnd_mbf - msg == 0, E_PAR" ); - status = psnd_mbf(1, 0, sizeof(msg)); - assert( status == E_PAR ); - - puts( "Init - psnd_mbf - msgsz too big - E_PAR" ); - status = psnd_mbf(1, msg, 300); - assert( status == E_PAR ); - - puts( "Init - psnd_mbf - msgsz <0 - E_PAR" ); - status = psnd_mbf(1, msg, -10); - assert( status == E_PAR ); - - puts( "Init - psnd_mbf - E_OK" ); - status = psnd_mbf(1, msg, sizeof(msg)); - assert( status == E_OK ); -} - -void TestRef() -{ - ER status; - T_RMBF pk_rmbf; - - puts( "Init - ref_mbf - bad id (less than -4) - E_OACV" ); - status = ref_mbf(&pk_rmbf, -5); - assert( status == E_OACV ); - - puts( "Init - ref_mbf - bad id (between 0 and -4) - E_ID" ); - status = ref_mbf(&pk_rmbf, -4); - assert( status == E_ID ); - - puts( "Init - ref_mbf - bad id (0) - E_ID" ); - status = ref_mbf(&pk_rmbf, 0); - assert( status == E_ID ); - - puts( "Init - ref_mbf - bad id (too great) - E_ID" ); - status = ref_mbf(&pk_rmbf, - CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS + 1); - assert( status == E_ID ); - - puts( "Init - ref_mbf - NULL pk_mbf returns E_PAR" ); - status = ref_mbf( NULL, 1 ); - assert( status == E_PAR ); - - puts( "Init - ref_mbf - mbf 1 - E_OK" ); - status = ref_mbf( &pk_rmbf, 1 ); - assert( status == E_OK ); - - printf( "Init - mbf 1 msgsz = %d\n", pk_rmbf.msgsz ); - printf( "Init - mbf 1 frbufsz = %d\n", pk_rmbf.frbufsz ); - printf( "Init - mbf 1 waiting tasks = %d\n", pk_rmbf.wtsk ); - printf( "Init - mbf 1 sending tasks = %d\n", pk_rmbf.stsk); -} - -void TestRcv() -{ - ER status; - char buffer[200]; - int s; - - puts( "Init - rcv_mbf - bad id (less than -4) - E_OACV" ); - status = rcv_mbf(buffer, &s, -5); - assert( status == E_OACV ); - - puts( "Init - rcv_mbf - bad id (between 0 and -4) - E_ID" ); - status = rcv_mbf(buffer, &s, -4); - assert( status == E_ID ); - - puts( "Init - rcv_mbf - bad id (0) - E_ID" ); - status = rcv_mbf(buffer, &s, 0); - assert( status == E_ID ); - - puts( "Init - rcv_mbf - bad id (too great) - E_ID" ); - status = rcv_mbf(buffer, &s, CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS + 1); - assert( status == E_ID ); - - puts( "Init - rcv_mbf - NULL msg returns E_PAR" ); - status = rcv_mbf(NULL, &s, 1); - assert( status == E_PAR ); - - puts( "Init - rcv_mbf - NULL p_msgsz returns E_PAR" ); - status = rcv_mbf(buffer, 0, 1); - assert( status == E_PAR ); - - puts("Init - rcv_mbf -- OK"); - status = rcv_mbf(buffer, &s, 1); - assert(status == E_OK); - printf("Message:[%s], length:%d\n", buffer, s); -} - - -void TestPrcv() -{ - ER status; - char buffer[200]; - int s; - - puts( "Init - prcv_mbf - bad id (less than -4) - E_OACV" ); - status = prcv_mbf(buffer, &s, -5); - assert( status == E_OACV ); - - puts( "Init - prcv_mbf - bad id (between 0 and -4) - E_ID" ); - status = prcv_mbf(buffer, &s, -4); - assert( status == E_ID ); - - puts( "Init - prcv_mbf - bad id (0) - E_ID" ); - status = prcv_mbf(buffer, &s, 0); - assert( status == E_ID ); - - puts( "Init - prcv_mbf - bad id (too great) - E_ID" ); - status = prcv_mbf(buffer, &s, CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS + 1); - assert( status == E_ID ); - - puts( "Init - prcv_mbf - NULL msg returns E_PAR" ); - status = prcv_mbf(NULL, &s, 1); - assert( status == E_PAR ); - - puts( "Init - prcv_mbf - NULL p_msgsz returns E_PAR" ); - status = prcv_mbf(buffer, 0, 1); - assert( status == E_PAR ); - - puts("Init - prcv_mbf -- E_TMOUT"); - status = prcv_mbf(buffer, &s, 1); - assert(status == E_TMOUT); -} - - -void TestTrcv() -{ - ER status; - char buffer[200]; - int s; - - puts( "Init - trcv_mbf - bad id (less than -4) - E_OACV" ); - status = trcv_mbf(buffer, &s, -5, 5000); - assert( status == E_OACV ); - - puts( "Init - trcv_mbf - bad id (between 0 and -4) - E_ID" ); - status = trcv_mbf(buffer, &s, -4, 5000); - assert( status == E_ID ); - - puts( "Init - trcv_mbf - bad id (0) - E_ID" ); - status = trcv_mbf(buffer, &s, 0, 5000); - assert( status == E_ID ); - - puts( "Init - trcv_mbf - bad id (too great) - E_ID" ); - status = trcv_mbf(buffer, &s, - CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS + 1, - 5000); - assert( status == E_ID ); - - puts( "Init - trcv_mbf - NULL msg returns E_PAR" ); - status = trcv_mbf(NULL, &s, 1, 5000); - assert( status == E_PAR ); - - puts( "Init - trcv_mbf - NULL p_msgsz returns E_PAR" ); - status = trcv_mbf(buffer, 0, 1, 5000); - assert( status == E_PAR ); - - puts( "Init - trcv_mbf - tmout <-2 returns E_PAR" ); - status = trcv_mbf(buffer, &s, 1, -2); - assert( status == E_PAR ); - - puts("\nInit - trcv_mbf -- E_TMOUT"); - put_time( "Init - starting to block at "); - status = trcv_mbf(buffer, &s, 1, 1000); - assert(status == E_TMOUT); - put_time( "Init - time out at "); -} - - diff --git a/testsuites/itrontests/itronmbf01/itronmbf01.doc b/testsuites/itrontests/itronmbf01/itronmbf01.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/itrontests/itronmbf01/itronmbf01.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/itrontests/itronmbf01/itronmbf01.scn b/testsuites/itrontests/itronmbf01/itronmbf01.scn deleted file mode 100644 index 011c133caf..0000000000 --- a/testsuites/itrontests/itronmbf01/itronmbf01.scn +++ /dev/null @@ -1,71 +0,0 @@ -*** ITRONMBF01 -- ITRON MESSAGE BUFFER TEST *** -Init - cre_mbf - NULL pk_cmbf returns E_PAR -Init - cre_mbf - negative values for bufsz returns E_PAR -Init - cre_mbf - negative values for maxmsz returns E_PAR -Init - cre_mbf - bufsz < maxmsz returns E_PAR -Init - cre_mbf - bad id (less than -4) - E_OACV -Init - cre_mbf - bad id (between 0 and -4) - E_ID -Init - cre_mbf - bad id (0) - E_ID -Init - cre_mbf - bad id (too great) - E_ID -Init - cre_mbf - create mbf 1 TA_TFIFO - E_OK -Init - cre_mbf - create mbf 1 again - E_OBJ -Init - cre_mbf - create mbf 2 TA_TPRI - E_OK -Init - del_mbf - bad id (less than -4) - E_OACV -Init - del_mbf - bad id (between 0 and -4) - E_ID -Init - del_mbf - bad id (0) - E_ID -Init - del_mbf - bad id (too great) - E_ID -Init - del_mbf - E_OK -Init - psnd_mbf - bad id (less than -4) - E_OACV -Init - psnd_mbf - bad id (between 0 and -4) - E_ID -Init - psnd_mbf - bad id (0) - E_ID -Init - psnd_mbf - bad id (too great) - E_ID -Init - psnd_mbf - msg == 0, E_PAR -Init - psnd_mbf - msgsz too big - E_PAR -Init - psnd_mbf - msgsz <0 - E_PAR -Init - psnd_mbf - E_OK -Init - ref_mbf - bad id (less than -4) - E_OACV -Init - ref_mbf - bad id (between 0 and -4) - E_ID -Init - ref_mbf - bad id (0) - E_ID -Init - ref_mbf - bad id (too great) - E_ID -Init - ref_mbf - NULL pk_mbf returns E_PAR -Init - ref_mbf - mbf 1 - E_OK -Init - mbf 1 msgsz = 100 -Init - mbf 1 frbufsz = 400 -Init - mbf 1 waiting tasks = 0 -Init - mbf 1 sending tasks = 0 -Init - rcv_mbf - bad id (less than -4) - E_OACV -Init - rcv_mbf - bad id (between 0 and -4) - E_ID -Init - rcv_mbf - bad id (0) - E_ID -Init - rcv_mbf - bad id (too great) - E_ID -Init - rcv_mbf - NULL msg returns E_PAR -Init - rcv_mbf - NULL p_msgsz returns E_PAR -Init - rcv_mbf -- OK -Message:[This is test message 1], length:100 -Init - ref_mbf - bad id (less than -4) - E_OACV -Init - ref_mbf - bad id (between 0 and -4) - E_ID -Init - ref_mbf - bad id (0) - E_ID -Init - ref_mbf - bad id (too great) - E_ID -Init - ref_mbf - NULL pk_mbf returns E_PAR -Init - ref_mbf - mbf 1 - E_OK -Init - mbf 1 msgsz = 0 -Init - mbf 1 frbufsz = 600 -Init - mbf 1 waiting tasks = 0 -Init - mbf 1 sending tasks = 0 -Init - prcv_mbf - bad id (less than -4) - E_OACV -Init - prcv_mbf - bad id (between 0 and -4) - E_ID -Init - prcv_mbf - bad id (0) - E_ID -Init - prcv_mbf - bad id (too great) - E_ID -Init - prcv_mbf - NULL msg returns E_PAR -Init - prcv_mbf - NULL p_msgsz returns E_PAR -Init - prcv_mbf -- E_TMOUT -Init - trcv_mbf - bad id (less than -4) - E_OACV -Init - trcv_mbf - bad id (between 0 and -4) - E_ID -Init - trcv_mbf - bad id (0) - E_ID -Init - trcv_mbf - bad id (too great) - E_ID -Init - trcv_mbf - NULL msg returns E_PAR -Init - trcv_mbf - NULL p_msgsz returns E_PAR -Init - trcv_mbf - tmout <-2 returns E_PAR -Init - trcv_mbf -- E_TMOUT -Init - starting to block at Fri Jan 1 00:00:00 1988 -Init - time out at Fri Jan 1 00:00:01 1988 -*** ITRONMBF01 --- ITRON MESSAGE BUFFER TEST *** diff --git a/testsuites/itrontests/itronmbf01/system.h b/testsuites/itrontests/itronmbf01/system.h deleted file mode 100644 index 0aa53f784a..0000000000 --- a/testsuites/itrontests/itronmbf01/system.h +++ /dev/null @@ -1,40 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include - -/* functions */ - -void ITRON_Init( void ); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_ITRON_TASKS 1 -#define CONFIGURE_MAXIMUM_ITRON_MESSAGE_BUFFERS 10 - -#define CONFIGURE_ITRON_INIT_TASK_TABLE -#define CONFIGURE_ITRON_INIT_TASK_STACK_SIZE (4 * RTEMS_MINIMUM_STACK_SIZE) - -#include - -/* global variables */ - -TEST_EXTERN rtems_id Global_variable; /* example global variable */ - -/* end of include file */ diff --git a/testsuites/itrontests/itronmbox01/.cvsignore b/testsuites/itrontests/itronmbox01/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/itrontests/itronmbox01/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/itrontests/itronmbox01/Makefile.am b/testsuites/itrontests/itronmbox01/Makefile.am deleted file mode 100644 index 22a29e6a86..0000000000 --- a/testsuites/itrontests/itronmbox01/Makefile.am +++ /dev/null @@ -1,41 +0,0 @@ -## -## $Id$ -## - - -TEST = itronmbox01 -PGM = ${ARCH}/$(TEST).exe - -MANAGERS = all - -C_FILES = init.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/itrontests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/itrontests/itronmbox01/init.c b/testsuites/itrontests/itronmbox01/init.c deleted file mode 100644 index 41fa8566ee..0000000000 --- a/testsuites/itrontests/itronmbox01/init.c +++ /dev/null @@ -1,36 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" -#include -#include - -void ITRON_Init( void ) -{ - printf( "\n\n*** ITRON MBOX TEST 01 ***\n" ); - printf( "ITRON Mailboxes are implemented but there is currently no test.\n" ); - printf( "*** END OF ITRON MBOX TEST 01 ***\n" ); - rtems_test_exit( 0 ); -} - - diff --git a/testsuites/itrontests/itronmbox01/itronmbox01.doc b/testsuites/itrontests/itronmbox01/itronmbox01.doc deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/testsuites/itrontests/itronmbox01/itronmbox01.scn b/testsuites/itrontests/itronmbox01/itronmbox01.scn deleted file mode 100644 index 89329090ba..0000000000 --- a/testsuites/itrontests/itronmbox01/itronmbox01.scn +++ /dev/null @@ -1,3 +0,0 @@ -*** ITRON MBOX TEST 01 *** -ITRON Mailboxes are implemented but there is currently no test. -*** END OF ITRON MBOX TEST 01 *** diff --git a/testsuites/itrontests/itronmbox01/system.h b/testsuites/itrontests/itronmbox01/system.h deleted file mode 100644 index 3482ffa2a1..0000000000 --- a/testsuites/itrontests/itronmbox01/system.h +++ /dev/null @@ -1,37 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include - -/* functions */ - -void ITRON_Init( void ); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER - -#define CONFIGURE_MAXIMUM_ITRON_TASKS 1 - -#define CONFIGURE_ITRON_INIT_TASK_TABLE - -#include - -/* global variables */ - -TEST_EXTERN rtems_id Global_variable; /* example global variable */ - -/* end of include file */ diff --git a/testsuites/itrontests/itronsem01/.cvsignore b/testsuites/itrontests/itronsem01/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/itrontests/itronsem01/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/itrontests/itronsem01/Makefile.am b/testsuites/itrontests/itronsem01/Makefile.am deleted file mode 100644 index f73ef1c2ce..0000000000 --- a/testsuites/itrontests/itronsem01/Makefile.am +++ /dev/null @@ -1,41 +0,0 @@ -## -## $Id$ -## - - -TEST = itronsem01 -PGM = ${ARCH}/$(TEST).exe - -MANAGERS = all - -C_FILES = init.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/itrontests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/itrontests/itronsem01/init.c b/testsuites/itrontests/itronsem01/init.c deleted file mode 100644 index 64e3229f3f..0000000000 --- a/testsuites/itrontests/itronsem01/init.c +++ /dev/null @@ -1,332 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" -#include - -/* - * The following is hopefully temporary. - */ - -#include - -#define put_time(_s) \ - do { \ - time_t a_time_t; \ - a_time_t = time( 0 ); \ - printf( "%s%s", _s, ctime( &a_time_t ) ); \ - } while(0) - -void ITRON_Init( void ) -{ - ER status; - T_CSEM pk_csem; - T_RSEM pk_rsem; - - printf( "\n\n*** ITRONSEM01 -- ITRON SEMAPHORE TEST ***\n" ); - - /* - * Exercise cre_sem - this code seems to exercise every path. - */ - - puts( "Init - cre_sem - NULL pk_sem returns E_PAR" ); - status = cre_sem( 1, NULL ); - assert( status == E_PAR ); - - puts( "Init - cre_sem - isemcnt > maxsem returns E_PAR" ); - pk_csem.sematr = 0; - pk_csem.isemcnt = 3; - pk_csem.maxsem = 2; - status = cre_sem( 1, &pk_csem ); - assert( status == E_PAR ); - - puts( "Init - cre_sem - maxsem of 0 returns E_PAR" ); - pk_csem.isemcnt = 0; - pk_csem.maxsem = 0; - status = cre_sem( 1, &pk_csem ); - assert( status == E_PAR ); - - /* - * Now run through all the bad ID errors - */ - - pk_csem.isemcnt = 2; - pk_csem.maxsem = 3; - puts( "Init - cre_sem - bad id (less than -4) - E_OACV" ); - status = cre_sem( -5, &pk_csem ); - assert( status == E_OACV ); - - puts( "Init - cre_sem - bad id (between 0 and -4) - E_ID" ); - status = cre_sem( -4, &pk_csem ); - assert( status == E_ID ); - - puts( "Init - cre_sem - bad id (0) - E_ID" ); - status = cre_sem( 0, &pk_csem ); - assert( status == E_ID ); - - puts( "Init - cre_sem - bad id (too great) - E_ID" ); - status = cre_sem( CONFIGURE_MAXIMUM_ITRON_SEMAPHORES + 1, &pk_csem ); - assert( status == E_ID ); - - puts( "Init - cre_sem - create semaphore 1 TA_TFIFO - E_OK" ); - pk_csem.isemcnt = 2; - pk_csem.maxsem = 3; - pk_csem.sematr = TA_TFIFO; - status = cre_sem( 1, &pk_csem ); - assert( status == E_OK ); - - puts( "Init - cre_sem - create semaphore 1 again - E_OBJ" ); - status = cre_sem( 1, &pk_csem ); - assert( status == E_OBJ ); - - puts( "Init - cre_sem - create semaphore 2 TA_TPRI - E_OK" ); - pk_csem.isemcnt = 2; - pk_csem.maxsem = 3; - pk_csem.sematr = TA_TPRI; - status = cre_sem( 2, &pk_csem ); - assert( status == E_OK ); - - /* - * Generate all the bad id errors for del_sem - */ - - puts( "Init - del_sem - bad id (less than -4) - E_OACV" ); - status = del_sem( -5 ); - assert( status == E_OACV ); - - puts( "Init - del_sem - bad id (between 0 and -4) - E_ID" ); - status = del_sem( -4 ); - assert( status == E_ID ); - - puts( "Init - del_sem - bad id (0) - E_ID" ); - status = del_sem( 0 ); - assert( status == E_ID ); - - puts( "Init - del_sem - bad id (too great) - E_ID" ); - status = del_sem( CONFIGURE_MAXIMUM_ITRON_SEMAPHORES + 1 ); - assert( status == E_ID ); - - /* - * Generate all the bad id errors for sig_sem - */ - - puts( "Init - sig_sem - bad id (less than -4) - E_OACV" ); - status = sig_sem( -5 ); - assert( status == E_OACV ); - - puts( "Init - sig_sem - bad id (between 0 and -4) - E_ID" ); - status = sig_sem( -4 ); - assert( status == E_ID ); - - puts( "Init - sig_sem - bad id (0) - E_ID" ); - status = sig_sem( 0 ); - assert( status == E_ID ); - - puts( "Init - sig_sem - bad id (too great) - E_ID" ); - status = wai_sem( CONFIGURE_MAXIMUM_ITRON_SEMAPHORES + 1 ); - assert( status == E_ID ); - - /* - * Generate all the bad id errors for preq_sem - */ - - puts( "Init - preq_sem - bad id (less than -4) - E_OACV" ); - status = preq_sem( -5 ); - assert( status == E_OACV ); - - puts( "Init - preq_sem - bad id (between 0 and -4) - E_ID" ); - status = preq_sem( -4 ); - assert( status == E_ID ); - - puts( "Init - preq_sem - bad id (0) - E_ID" ); - status = preq_sem( 0 ); - assert( status == E_ID ); - - puts( "Init - preq_sem - bad id (too great) - E_ID" ); - status = preq_sem( CONFIGURE_MAXIMUM_ITRON_SEMAPHORES + 1 ); - assert( status == E_ID ); - - /* - * Generate all the bad id errors for wai_sem - */ - - puts( "Init - wai_sem - bad id (less than -4) - E_OACV" ); - status = wai_sem( -5 ); - assert( status == E_OACV ); - - puts( "Init - wai_sem - bad id (between 0 and -4) - E_ID" ); - status = wai_sem( -4 ); - assert( status == E_ID ); - - puts( "Init - wai_sem - bad id (0) - E_ID" ); - status = wai_sem( 0 ); - assert( status == E_ID ); - - puts( "Init - wai_sem - bad id (too great) - E_ID" ); - status = wai_sem( CONFIGURE_MAXIMUM_ITRON_SEMAPHORES + 1 ); - assert( status == E_ID ); - - /* - * Generate all the bad id errors for twai_sem - */ - - puts( "Init - twai_sem - bad id (less than -4) - E_OACV" ); - status = twai_sem( -5, 1000 ); - assert( status == E_OACV ); - - puts( "Init - twai_sem - bad id (between 0 and -4) - E_ID" ); - status = twai_sem( -4, 1000 ); - assert( status == E_ID ); - - puts( "Init - twai_sem - bad id (0) - E_ID" ); - status = twai_sem( 0, 1000 ); - assert( status == E_ID ); - - puts( "Init - twai_sem - bad id (too great) - E_ID" ); - status = twai_sem( CONFIGURE_MAXIMUM_ITRON_SEMAPHORES + 1, 1000 ); - assert( status == E_ID ); - - /* - * Generate all the bad id errors for ref_sem - */ - - puts( "Init - ref_sem - bad id (less than -4) - E_OACV" ); - status = ref_sem( -5, &pk_rsem ); - assert( status == E_OACV ); - - puts( "Init - ref_sem - bad id (between 0 and -4) - E_ID" ); - status = ref_sem( -4, &pk_rsem ); - assert( status == E_ID ); - - puts( "Init - ref_sem - bad id (0) - E_ID" ); - status = ref_sem( 0, &pk_rsem ); - assert( status == E_ID ); - - puts( "Init - ref_sem - bad id (too great) - E_ID" ); - status = ref_sem( CONFIGURE_MAXIMUM_ITRON_SEMAPHORES + 1, &pk_rsem ); - assert( status == E_ID ); - - /* - * Exercise preq_sem (and sig_sem a little) - */ - - - puts( "Init - preq_sem - semaphore 1 available (count --> 1) - E_OK" ); - status = preq_sem( 1 ); - assert( status == E_OK ); - - puts( "Init - preq_sem - semaphore 1 available (count --> 0) - E_OK" ); - status = preq_sem( 1 ); - assert( status == E_OK ); - - puts( "Init - preq_sem - semaphore 1 unavailable - E_TMOUT" ); - status = preq_sem( 1 ); - assert( status == E_TMOUT ); - - puts( "Init - sig_sem - semaphore 1 (count --> 1) - E_OK" ); - status = sig_sem( 1 ); - assert( status == E_OK ); - - puts("Init - twai_sem(TMO_POL) - semaphore 1 available (count --> 0) - E_OK"); - status = twai_sem( 1, TMO_POL ); - assert( status == E_OK ); - - puts( "Init - twai_sem(TMO_POL) - semaphore 1 available - E_TMOUT" ); - status = twai_sem( 1, TMO_POL ); - assert( status == E_TMOUT ); - - /* - * Exercise twai_sem - */ - - puts( "Init - twai_sem - semaphore 1 unavailable - 1 second E_TMOUT" ); - put_time( "Init - starting to block at "); - status = twai_sem( 1, 1000 ); - assert( status == E_TMOUT ); - put_time( "Init - timed out at "); - puts( "Init - twai_sem - semaphore 1 unavailable - timeout completed" ); - - /* - * Now let's test exceed the maximum count of semaphore 1 - */ - - puts( "Init - sig_sem - semaphore 1 (count --> 1) - E_OK" ); - status = sig_sem( 1 ); - assert( status == E_OK ); - - puts( "Init - sig_sem - semaphore 1 (count --> 2) - E_OK" ); - status = sig_sem( 1 ); - assert( status == E_OK ); - - puts( "Init - sig_sem - semaphore 1 (count --> 3) - E_OK" ); - status = sig_sem( 1 ); - assert( status == E_OK ); - - puts( "Init - sig_sem - semaphore 1 (count > maximum) - E_QOVR" ); - status = sig_sem( 1 ); - assert( status == E_OK ); - - /* - * Exercise ref_sem - */ - - puts( "Init - ref_sem - NULL pk_sem returns E_PAR" ); - status = ref_sem( 1, NULL ); - assert( status == E_PAR ); - - puts( "Init - ref_sem - semaphore 1 - E_OK" ); - status = ref_sem( 1, &pk_rsem ); - assert( status == E_OK ); - printf( "Init - semaphore 1 count = %d\n", pk_rsem.semcnt ); - printf( "Init - semaphore 1 waiting tasks = %d\n", pk_rsem.wtsk ); - - puts( "Init - preq_sem - semaphore 1 (count --> 2) - E_OK" ); - status = preq_sem( 1 ); - assert( status == E_OK ); - - puts( "Init - ref_sem - semaphore 1 - E_OK" ); - status = ref_sem( 1, &pk_rsem ); - assert( status == E_OK ); - printf( "Init - semaphore 1 count = %d\n", pk_rsem.semcnt ); - printf( "Init - semaphore 1 waiting tasks = %d\n", pk_rsem.wtsk ); - - - /* - * Exercise del_sem - */ - - /* XXX really want another task blocking on the semaphore XXX */ - - puts( "Init - del_sem - semaphore 1 deleted - E_OK" ); - status = del_sem( 1 ); - assert( status == E_OK ); - - puts( "Init - XXX need other tasks to complete the test XXX" ); - - puts( "Init - dly_tsk - 1 second to let other task run" ); - status = dly_tsk( 1000 ); - assert( status == E_OK ); - - printf( "*** END OF ITRONSEM01 -- ITRON SEMAPHORE TEST ***\n" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/itrontests/itronsem01/itronsem01.doc b/testsuites/itrontests/itronsem01/itronsem01.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/itrontests/itronsem01/itronsem01.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/itrontests/itronsem01/itronsem01.scn b/testsuites/itrontests/itronsem01/itronsem01.scn deleted file mode 100644 index 33b81e2570..0000000000 --- a/testsuites/itrontests/itronsem01/itronsem01.scn +++ /dev/null @@ -1,61 +0,0 @@ -*** ITRONSEM01 -- ITRON SEMAPHORE TEST *** -Init - cre_sem - NULL pk_sem returns E_PAR -Init - cre_sem - isemcnt > maxsem returns E_PAR -Init - cre_sem - maxsem of 0 returns E_PAR -Init - cre_sem - bad id (less than -4) - E_OACV -Init - cre_sem - bad id (between 0 and -4) - E_ID -Init - cre_sem - bad id (0) - E_ID -Init - cre_sem - bad id (too great) - E_ID -Init - cre_sem - create semaphore 1 TA_TFIFO - E_OK -Init - cre_sem - create semaphore 1 again - E_OBJ -Init - cre_sem - create semaphore 2 TA_TPRI - E_OK -Init - del_sem - bad id (less than -4) - E_OACV -Init - del_sem - bad id (between 0 and -4) - E_ID -Init - del_sem - bad id (0) - E_ID -Init - del_sem - bad id (too great) - E_ID -Init - sig_sem - bad id (less than -4) - E_OACV -Init - sig_sem - bad id (between 0 and -4) - E_ID -Init - sig_sem - bad id (0) - E_ID -Init - sig_sem - bad id (too great) - E_ID -Init - preq_sem - bad id (less than -4) - E_OACV -Init - preq_sem - bad id (between 0 and -4) - E_ID -Init - preq_sem - bad id (0) - E_ID -Init - preq_sem - bad id (too great) - E_ID -Init - wai_sem - bad id (less than -4) - E_OACV -Init - wai_sem - bad id (between 0 and -4) - E_ID -Init - wai_sem - bad id (0) - E_ID -Init - wai_sem - bad id (too great) - E_ID -Init - twai_sem - bad id (less than -4) - E_OACV -Init - twai_sem - bad id (between 0 and -4) - E_ID -Init - twai_sem - bad id (0) - E_ID -Init - twai_sem - bad id (too great) - E_ID -Init - ref_sem - bad id (less than -4) - E_OACV -Init - ref_sem - bad id (between 0 and -4) - E_ID -Init - ref_sem - bad id (0) - E_ID -Init - ref_sem - bad id (too great) - E_ID -Init - preq_sem - semaphore 1 available (count --> 1) - E_OK -Init - preq_sem - semaphore 1 available (count --> 0) - E_OK -Init - preq_sem - semaphore 1 unavailable - E_TMOUT -Init - sig_sem - semaphore 1 (count --> 1) - E_OK -Init - twai_sem(TMO_POL) - semaphore 1 available (count --> 0) - E_OK -Init - twai_sem(TMO_POL) - semaphore 1 available - E_TMOUT -Init - twai_sem - semaphore 1 unavailable - 1 second E_TMOUT -Init - starting to block at Fri Jan 1 00:00:00 1988 -Init - timed out at Fri Jan 1 00:00:01 1988 -Init - twai_sem - semaphore 1 unavailable - timeout completed -Init - sig_sem - semaphore 1 (count --> 1) - E_OK -Init - sig_sem - semaphore 1 (count --> 2) - E_OK -Init - sig_sem - semaphore 1 (count --> 3) - E_OK -Init - sig_sem - semaphore 1 (count > maximum) - E_QOVR -Init - ref_sem - NULL pk_sem returns E_PAR -Init - ref_sem - semaphore 1 - E_OK -Init - semaphore 1 count = 4 -Init - semaphore 1 waiting tasks = 0 -Init - preq_sem - semaphore 1 (count --> 2) - E_OK -Init - ref_sem - semaphore 1 - E_OK -Init - semaphore 1 count = 3 -Init - semaphore 1 waiting tasks = 0 -Init - del_sem - semaphore 1 deleted - E_OK -Init - XXX need other tasks to complete the test XXX -Init - dly_tsk - 1 second to let other task run -*** END OF ITRONSEM01 -- ITRON SEMAPHORE TEST *** diff --git a/testsuites/itrontests/itronsem01/system.h b/testsuites/itrontests/itronsem01/system.h deleted file mode 100644 index ad7fe1fb12..0000000000 --- a/testsuites/itrontests/itronsem01/system.h +++ /dev/null @@ -1,40 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include -#include - -/* functions */ - -void ITRON_Init( void ); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER - -#define CONFIGURE_MAXIMUM_ITRON_TASKS 1 -#define CONFIGURE_MAXIMUM_ITRON_SEMAPHORES 10 - -#define CONFIGURE_ITRON_INIT_TASK_TABLE - -#include - -/* global variables */ - -TEST_EXTERN rtems_id Global_variable; /* example global variable */ - -/* end of include file */ diff --git a/testsuites/itrontests/itrontask01/.cvsignore b/testsuites/itrontests/itrontask01/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/itrontests/itrontask01/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/itrontests/itrontask01/Makefile.am b/testsuites/itrontests/itrontask01/Makefile.am deleted file mode 100644 index 0da95176bd..0000000000 --- a/testsuites/itrontests/itrontask01/Makefile.am +++ /dev/null @@ -1,41 +0,0 @@ -## -## $Id$ -## - - -TEST = itrontask01 -PGM = ${ARCH}/$(TEST).exe - -MANAGERS = all - -C_FILES = init.c task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/itrontests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/itrontests/itrontask01/init.c b/testsuites/itrontests/itrontask01/init.c deleted file mode 100644 index 73a53c84c4..0000000000 --- a/testsuites/itrontests/itrontask01/init.c +++ /dev/null @@ -1,71 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" -#include - -void ITRON_Init( void ) -{ - rtems_time_of_day time; - ER status; - T_CTSK pk_ctsk; - - puts( "\n\n*** ITRON TASK TEST 1 ***" ); - - /* - * XXX - Change this to an itron clock !! - */ - - build_time( &time, 12, 31, 1988, 9, 0, 0, 0 ); - status = rtems_clock_set( &time ); - directive_failed( status, "rtems_clock_set" ); - - pk_ctsk.exinf = NULL; - pk_ctsk.tskatr = TA_HLNG; - pk_ctsk.itskpri = 1; - pk_ctsk.task = Task_2_through_4; - - pk_ctsk.stksz = RTEMS_MINIMUM_STACK_SIZE * 2; - status = cre_tsk( 2, &pk_ctsk ); - directive_failed( status, "cre_tsk of TA1" ); - - pk_ctsk.stksz = RTEMS_MINIMUM_STACK_SIZE * 2; - status = cre_tsk( 3, &pk_ctsk ); - directive_failed( status, "cre_tsk of TA2" ); - - pk_ctsk.stksz = RTEMS_MINIMUM_STACK_SIZE * 3; - status = cre_tsk( 4, &pk_ctsk ); - directive_failed( status, "cre_tsk of TA3" ); - - status = sta_tsk( 2, 0 ); - directive_failed( status, "sta_tsk of TA1" ); - - status = sta_tsk( 3, 0 ); - directive_failed( status, "sta_tsk of TA1" ); - - status = sta_tsk( 4, 0 ); - directive_failed( status, "sta_tsk of TA1" ); - - exd_tsk(); - directive_failed( 0, "exd_tsk" ); -} diff --git a/testsuites/itrontests/itrontask01/itrontask01.doc b/testsuites/itrontests/itrontask01/itrontask01.doc deleted file mode 100644 index 8e5e884f34..0000000000 --- a/testsuites/itrontests/itrontask01/itrontask01.doc +++ /dev/null @@ -1,61 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - -This file describes the directives and concepts tested by this test set. -This test is based upon the test in sp01. - -test set name: itrontask01 - -directives: - cre_tsk, exd_tsk, get_tid, sta_tsk - -concepts: XXX verify - - 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. - - a. Verifies exd_tsk - - b. Verifies get_tid - -notes: - - rtems clock directives should change to itron clock directives when - the clock directives are merged. - - change rtems task wake after to itron routines. - -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/itrontests/itrontask01/itrontask01.scn b/testsuites/itrontests/itrontask01/itrontask01.scn deleted file mode 100644 index 7ccefcbda4..0000000000 --- a/testsuites/itrontests/itrontask01/itrontask01.scn +++ /dev/null @@ -1,18 +0,0 @@ -*** ITRON TASK 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 ITRON TASK TEST 1 *** - -NOTE: The order of the prints at each time interval is irrelevant. diff --git a/testsuites/itrontests/itrontask01/system.h b/testsuites/itrontests/itrontask01/system.h deleted file mode 100644 index ed7f79d97a..0000000000 --- a/testsuites/itrontests/itrontask01/system.h +++ /dev/null @@ -1,42 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include - -/* functions */ - -void ITRON_Init( void ); -void Task_2_through_4(); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_ITRON_TASKS 4 -#define CONFIGURE_EXTRA_TASK_STACKS (RTEMS_MINIMUM_STACK_SIZE * 4) - - -#define CONFIGURE_ITRON_INIT_TASK_TABLE - -#include - -/* global variables */ - -/* end of include file */ - - - diff --git a/testsuites/itrontests/itrontask01/task1.c b/testsuites/itrontests/itrontask01/task1.c deleted file mode 100644 index 72d09afff7..0000000000 --- a/testsuites/itrontests/itrontask01/task1.c +++ /dev/null @@ -1,54 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -void Task_2_through_4() -{ - ID tid; - int tid_index; - rtems_time_of_day time; - ER status; - char name[30]; - - status = get_tid( &tid ); - directive_failed( status, "get_tid"); - - tid_index = tid - 1; /* account for init tasks */ - - sprintf(name, "TA%d", tid_index); - - while( FOREVER ) { - status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time ); - directive_failed( status, "rtems_clock_get" ); - - if ( time.second >= 35 ) { - puts( "*** END OF ITRON TASK TEST 1 ***" ); - rtems_test_exit( 0 ); - } - - printf(name); - print_time( " - rtems_clock_get - ", &time, "\n" ); - - status = rtems_task_wake_after( tid_index * 5 * TICKS_PER_SECOND ); - directive_failed( status, "rtems_task_wake_after" ); - } -} - diff --git a/testsuites/itrontests/itrontask02/.cvsignore b/testsuites/itrontests/itrontask02/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/itrontests/itrontask02/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/itrontests/itrontask02/Makefile.am b/testsuites/itrontests/itrontask02/Makefile.am deleted file mode 100644 index 2ea4a72fd4..0000000000 --- a/testsuites/itrontests/itrontask02/Makefile.am +++ /dev/null @@ -1,41 +0,0 @@ -## -## $Id$ -## - - -TEST = itrontask02 -PGM = ${ARCH}/$(TEST).exe - -MANAGERS = all - -C_FILES = init.c dormant.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/itrontests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/itrontests/itrontask02/dormant.c b/testsuites/itrontests/itrontask02/dormant.c deleted file mode 100644 index 69cb694e7e..0000000000 --- a/testsuites/itrontests/itrontask02/dormant.c +++ /dev/null @@ -1,44 +0,0 @@ -/* Dormant - * - * This routine serves as two test tasks. - * It has one dormant and one sleeping tasks. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include "system.h" - -void Dormant_task() -{ - puts( "DORMANT - ext_tsk - going to DORMANT state" ); - ext_tsk( ); - - puts( "ERROR==>ext_tsk of DORMANT returned" ); - assert(0); -} - - -void Non_Dormant_task() -{ - ER status; - - while (TRUE) { - puts( "NON-DORMANT - Sleep for 2 minutes" ); - status = rtems_task_wake_after( 120*TICKS_PER_SECOND ); - directive_failed( status, "rtems_task_wake_after" ); - } -} - diff --git a/testsuites/itrontests/itrontask02/init.c b/testsuites/itrontests/itrontask02/init.c deleted file mode 100644 index b00ef69d18..0000000000 --- a/testsuites/itrontests/itrontask02/init.c +++ /dev/null @@ -1,580 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" -#include -#include - -void ITRON_Init( void ) -{ - - /* - * Status Codes for these errors - * - * - * E_OK - Normal Completion - * - * E_NOMEM - Insufficient memory (Memory for control block and/or user - * stack cannot be allocated) - * - * E_ID - Invalid ID Number (tskid was invalid or could not be used) - * - * E_RSATR - Reserved attribute (tskatr was invalid or could not be used) - * - * E_OBJ - Invalid object state (a task of the same ID already exists) - * - * E_OACV - Object access violation (A tskid less than -4 was specified - * from a user task. This is implementation dependent.) - * - * E_PAR - Parameter error (pk_ctsk, task, itskpri and/or stksz is invalid) - * - * E_NOEXS - Object does not exist (the task specified by tskid does not - * exist) - * - * E_CTX - Context error (issued from task-independent portions or a task - * in dispatch disabled state) - * - * - * - * Network Specific Errors (ITRON calls these Connection Function Errors) - * - * EN_OBJNO - An object number which could not be accessed on the target - * node is specified. - * - * EN_CTXID - Specified an object on another node when the system call - * was issued from a task in dispatch disabled state or from - * a task-independent portion - * - * EN_PAR - A value outside the range supported by the target node and/or - * transmission packet format was specified as a parameter - * (a value outside supported range was specified for exinf, - * tskatr, task, itskpri and/or stksz) - * - * EN_RPAR - A value outside the range supported by the requesting node - * and/or transmission packet format was returned as a return - * parameter (a value outside supported range was returned for - * exinf, tskpri and/or tskstat) - * - */ - - - rtems_time_of_day time; - ER status; - T_CTSK pk_ctsk; - T_RTSK pk_rtsk; /* Reference Task Packet */ - - - puts( "\n\n*** ITRON TASK TEST 2 ***\n" ); - - build_time( &time, 12, 31, 1988, 9, 0, 0, 0 ); - status = rtems_clock_set( &time ); - directive_failed( status, "rtems_clock_set" ); - - - /* - * Set My priority to 8 so that dummy tasks will be - * forced to run when started. - */ - - status = chg_pri( TSK_SELF, 8 ); - fatal_directive_status( status, E_OK, "chg_pri of TSK_SELF"); - status = ref_tsk( &pk_rtsk, TSK_SELF ); - fatal_directive_status( status, E_OK, "ref_tsk of TSK_SELF"); - fatal_directive_status( pk_rtsk.tskpri, 8, "task priority of SELF"); - - /* - * Create and verify a DORMANT task. - */ - - pk_ctsk.exinf = NULL; - pk_ctsk.tskatr = TA_HLNG; - pk_ctsk.itskpri = 1; - pk_ctsk.task = Dormant_task; - pk_ctsk.stksz = RTEMS_MINIMUM_STACK_SIZE; - - puts( "Init - cre_tsk - Dormant Task" ); - status = cre_tsk( DORMANT_TASK_ID, &pk_ctsk ); - fatal_directive_status( status, E_OK, "cre_tsk of DORMANT"); - status = ref_tsk( &pk_rtsk, DORMANT_TASK_ID ); - fatal_directive_status( status, E_OK, "ref_tsk of DORMANT"); - fatal_directive_status( pk_rtsk.tskstat, TTS_DMT, "task state of DORMANT"); - - /* - * Create, Start and verify a not DORMANT task. - */ - - pk_ctsk.task = Non_Dormant_task; - puts( "Init - cre_tsk - Non-Dormant Task" ); - status = cre_tsk( NON_DORMANT_TASK_ID, &pk_ctsk ); - fatal_directive_status( status, E_OK, "cre_tsk of NON_DORMANT"); - status = sta_tsk( NON_DORMANT_TASK_ID, 1 ); - status = ref_tsk( &pk_rtsk, NON_DORMANT_TASK_ID ); - fatal_directive_status( status, E_OK, "ref_tsk of NON_DORMANT"); - fatal_directive_status( pk_rtsk.tskstat,TTS_WAI,"task state of NON_DORMANT"); - - - /* - * Bad ID errors - */ - - puts( "\n*** Create Task Errors ***" ); - - puts( "Init - cre_tsk - access violation ( id less than -4) - E_OACV" ); - status = cre_tsk( -5, &pk_ctsk ); - fatal_directive_status( status, E_OACV, "cre_tsk of -5"); - - puts( "Init - cre_tsk - bad id (between 0 and -4) - E_ID" ); - status = cre_tsk( -2, &pk_ctsk ); - fatal_directive_status( status, E_ID, "cre_tsk of -2"); - - puts( "Init - cre_tsk - cannot create TSK_SELF - E_ID" ); - status = cre_tsk( TSK_SELF, &pk_ctsk ); - fatal_directive_status( status, E_ID, "cre_tsk of TSK_SELF"); - - puts( "Init - cre_tsk - invalid id; id already exists - E_OBJ" ); - status = cre_tsk( 1, &pk_ctsk ); - fatal_directive_status( status, E_OBJ, "cre_tsk of 1"); - - /* - * Bad task attribute errors - */ - - pk_ctsk.tskatr = -1; - puts( "Init - cre_tsk - tskatr is invalid - E_RSATR" ); - status = cre_tsk( 5, &pk_ctsk ); - fatal_directive_status( status, E_RSATR, "cre_tsk with tskatr of -1"); - - puts( "Init - cre_tsk - pk_ctsk is invalid - E_PAR" ); - status = cre_tsk( 5, NULL ); - fatal_directive_status( status, E_PAR, "cre_tsk with NULL discription"); - - pk_ctsk.tskatr = TA_HLNG; - pk_ctsk.itskpri = 0; - puts( "Init - cre_tsk - itskpri is 0 - E_PAR" ); - status = cre_tsk( 5, &pk_ctsk ); - fatal_directive_status( status, E_PAR, "cre_tsk with priority of 0"); - pk_ctsk.itskpri = 257; /* XXX Design parameter not requirement. */ - puts( "Init - cre_tsk - itskpri is 257 - E_PAR" ); - status = cre_tsk( 5, &pk_ctsk ); - fatal_directive_status( status, E_PAR, "cre_tsk with priority of 257"); - - pk_ctsk.stksz = -1; - puts( "Init - cre_tsk - stksz is invalid - E_PAR" ); - status = cre_tsk( 5, &pk_ctsk ); - fatal_directive_status( status, E_PAR, "cre_tsk with size of -1"); - - pk_ctsk.task = NULL; - puts( "Init - cre_tsk - task is invalid - E_PAR" ); - status = cre_tsk( 5, &pk_ctsk ); - fatal_directive_status( status, E_PAR, "cre_tsk with null task identifier"); - - -#if (0) - /* these errors can not be generated for cre_tsk at this time */ - fatal_directive_status( status, E_NOMEM, ""); - fatal_directive_status( status, EN_OBJNO, ""); - fatal_directive_status( status, EN_CTXID, ""); - fatal_directive_status( status, EN_PAR, ""); -#endif - - puts( "\n\n*** Delete Task Errors ***" ); - - /* - * Reset structure - */ - - pk_ctsk.exinf = NULL; - pk_ctsk.tskatr = TA_HLNG; - pk_ctsk.itskpri = 1; - pk_ctsk.task = Dormant_task; - pk_ctsk.stksz = RTEMS_MINIMUM_STACK_SIZE; - - - puts( "Init - del_tsk - cannot delete TSK_SELF - E_OBJ" ); - status = del_tsk( TSK_SELF ); - fatal_directive_status( status, E_OBJ, "del_tsk with SELF"); - - puts( "Init - del_tsk - task is not DORMANT - E_OBJ" ); - status = del_tsk( NON_DORMANT_TASK_ID ); - fatal_directive_status( status, E_OBJ, "del_tsk NON_DORMANT"); - - puts( "Init - del_tsk - task does not exist - E_NOEXS" ); - status = del_tsk( 5 ); - fatal_directive_status( status, E_NOEXS, "del_tsk 5"); - - puts( "Init - del_tsk - access violation ( id less than -4) - E_OACV" ); - status = del_tsk( -5 ); - fatal_directive_status( status, E_OACV, "del_tsk -5"); - - puts( "Init - del_tsk - cannot delete TSK_SELF - E_OBJ" ); - status = del_tsk( TSK_SELF ); - fatal_directive_status( status, E_OBJ, "del_tsk self"); - - puts( "Init - del_tsk - bad id (between 0 and -4) - E_ID" ); - status = del_tsk( -3 ); - fatal_directive_status( status, E_ID, "del_tsk -3"); - -#if (0) - /* these errors can not be generated for del_tsk at this time */ - fatal_directive_status( status, EN_OBJNO, "del_tsk "); - fatal_directive_status( status, EN_CTXID, "del_tsk "); -#endif - - - puts( "\n\n*** Start Task Errors ***" ); - - puts( "Init - sta_tsk - access violation ( id less than -4) - E_OACV" ); - status = sta_tsk( -5, 1 ); - fatal_directive_status( status, E_OACV, "sta_tsk of -5"); - - puts( "Init - sta_tsk - bad id (between 0 and -4) - E_ID" ); - status = sta_tsk( -2, 1 ); - fatal_directive_status( status, E_ID, "sta_tsk of -2"); - - puts( "Init - sta_tsk - cannot start TSK_SELF - E_OBJ" ); - status = sta_tsk( TSK_SELF, 1 ); - fatal_directive_status( status, E_OBJ, "sta_tsk of self"); - - puts( "Init - sta_tsk - task is not DORMANT - E_OBJ" ); - status = sta_tsk( NON_DORMANT_TASK_ID, 1 ); - fatal_directive_status( status, E_OBJ, "sta_tsk NON_DORMANT"); - - puts( "Init - sta_tsk - task does not exist - E_NOEXS" ); - status = sta_tsk( 5, 1 ); - fatal_directive_status( status, E_NOEXS, "5"); - -#if (0) - /* these errors can not be generated for sta_tsk at this time */ - fatal_directive_status( status, EN_OBJNO, "sta_tsk"); - fatal_directive_status( status, EN_CTXID, "sta_tsk"); - fatal_directive_status( status, EN_PAR, "sta_tsk"); -#endif - - -#if (0) - /* these errors can not be tested at this time */ - puts( "\n\n*** Exit Task Errors ***" ); - puts( "Init - ext_tsk - context error - E_CTX" ); - status = ext_tsk( ); - fatal_directive_status( status, E_CTX, "ext_tsk "); - - puts( "\n\n*** Exit and Delete Task Errors ***" ); - puts( "Init - exd_tsk - context error - E_CTX" ); - status = exd_tsk( ); - fatal_directive_status( status, E_CTX, "exd_tsk"); -#endif - - - puts( "\n\n*** Terminate Other Task Errors ***" ); - - puts( "Init - ter_tsk - bad id (between 0 and -4) - E_ID" ); - status = ter_tsk( -2 ); - fatal_directive_status( status, E_ID, "ter_tsk of -2"); - - puts( "Init - ter_tsk - cannot terminate TSK_SELF (0) - E_OBJ" ); - status = ter_tsk( TSK_SELF ); - fatal_directive_status( status, E_OBJ, "ter_tsk of self"); - - puts( "Init - ter_tsk - task is not DORMANT - E_OBJ" ); - status = ter_tsk( DORMANT_TASK_ID ); - fatal_directive_status( status, E_OBJ, "ter_tsk DORMANT"); - - puts( "Init - ter_tsk - task does not exist - E_NOEXS" ); - status = ter_tsk( 5 ); - fatal_directive_status( status, E_NOEXS, "ter_tsk of 5"); - - puts( "Init - ter_tsk - access violation ( id less than -4) - E_OACV" ); - status = ter_tsk( -5 ); - fatal_directive_status( status, E_OACV, "ter_tsk of -5"); - -#if (0) - /* these errors can not be generated for ter_tsk at this time */ - fatal_directive_status( status, EN_OBJNO, "ter_tsk"); - fatal_directive_status( status, EN_CTXID, "ter_tsk"); -#endif - - -#if (0) - status = dis_dsp( ); - fatal_directive_status( status, E_CTX, "dis_dsp"); - - status = ena_dsp( ); - fatal_directive_status( status, E_CTX, "ena_dsp"); -#endif - - puts( "\n\n*** Change Priority Task Errors ***" ); - - puts( "Init - chg_pri - bad id (between 0 and -4) - E_ID" ); - status = chg_pri( -2, 1 ); - fatal_directive_status( status, E_ID, "chg_pri of -2"); - - /* Call from task independent portion to cause E_OBJ - puts( "Init - chg_pri - change priority of TSK_SELF - E_OBJ" ); - status = chg_pri( XXX - INTERRUPT, 1 ); - assert( status == E_OBJ ); - */ - - puts( "Init - chg_pri - task is DORMANT - E_OBJ" ); - status = chg_pri( DORMANT_TASK_ID, 1 ); - fatal_directive_status( status, E_OBJ, "chg_pri of DORMANT"); - - puts( "Init - chg_pri - task does not exist - E_NOEXS" ); - status = chg_pri( 5, 1 ); - fatal_directive_status( status, E_NOEXS, "chg_pri of 5"); - - puts( "Init - chg_pri - access violation ( id less than -4) - E_OACV" ); - status = chg_pri( -5, 1 ); - fatal_directive_status( status, E_OACV, "chg_pri of -5"); - - puts( "Init - chg_pri - invalid priority - E_PAR" ); - status = chg_pri( 1, -1 ); - fatal_directive_status( status, E_PAR, "chg_pri with priority of -1"); - -#if (0) - /* these errors can not be generated for chg_pri at this time */ - fatal_directive_status( status, EN_OBJNO, "chg_pri"); - fatal_directive_status( status, EN_CTXID, "chg_pri"); - fatal_directive_status( status, EN_PAR, "chg_pri"); -#endif - - /* This gave me a nasty-gram - * "core_find_mapping() - access to unmaped address, attach a default map - * to handle this - addr=0x80002098 nr_bytes=0x4 processor=0x40134008 - * cia=0xc744" - */ - - puts( "\n\n*** Rotate Ready Queue Errors ***" ); - puts( "Init - rot_rdq - priority -1 - E_PAR" ); - status = rot_rdq( -1 ); - fatal_directive_status( status, E_PAR, "rot_rdq -1"); - puts( "Init - rot_rdq - priority 257 - E_PAR" ); - status = rot_rdq( 257 ); - fatal_directive_status( status, E_PAR, "rot_rdq 256"); - - /* XXX - This routine is not coded */ - - puts( "Init - rel_rdq - XXX Add when rel_wai coded - E_OK" ); - status = rel_wai( 1 ); - fatal_directive_status( status, E_OK, "rel_wai"); - - puts( "Init - rel_rdq - XXX Add when rel_wai coded - E_ID" ); - status = E_ID; - fatal_directive_status( status, E_ID, "rel_wai"); - - puts( "Init - rel_rdq - XXX Add when rel_wai coded - E_NOEXS" ); - status = E_NOEXS; - fatal_directive_status( status, E_NOEXS, "rel_wai"); - - puts( "Init - rel_rdq - XXX Add when rel_wai coded - E_OACV" ); - status = E_OACV; - fatal_directive_status( status, E_OACV, "rel_wai"); - - puts( "Init - rel_rdq - XXX Add when rel_wai coded - E_OBJ" ); - status = E_OBJ; - fatal_directive_status( status, E_OBJ, "rel_wai"); - - puts( "Init - rel_rdq - XXX Add when rel_wai coded - EN_OBJNO" ); - status = EN_OBJNO; - fatal_directive_status( status, EN_OBJNO, "rel_wai"); - - puts( "Init - rel_rdq - XXX Add when rel_wai coded - EN_CTXID" ); - status = EN_CTXID; - fatal_directive_status( status, EN_CTXID, "rel_wai"); - - - puts( "\n\n*** Reference Task Status Errors ***" ); - puts( "Init - ref_tsk - bad id (between 0 and -4) - E_ID" ); - status = ref_tsk( &pk_rtsk, -2 ); - fatal_directive_status( status, E_ID, "ref_tsk -2"); - - /* XXX Call from task independent portion to cause E_ID - puts( "Init - ref_tsk - reference INTERRUPT - E_ID" ); - status = ref_tsk( &pk_rtsk, TSK_SELF ); - assert( status == E_ID ); - */ - - puts( "Init - ref_tsk - task does not exist - E_NOEXS" ); - status = ref_tsk( &pk_rtsk, 5 ); - fatal_directive_status( status, E_NOEXS, "ref_tsk 5"); - - puts( "Init - ref_tsk - access violation ( id less than -4) - E_OACV" ); - status = ref_tsk( &pk_rtsk, -5 ); - fatal_directive_status( status, E_OACV, "ref_tsk -5"); - - puts( "Init - ref_tsk - packet address is bad - E_PAR" ); - status = ref_tsk( NULL, 1 ); - fatal_directive_status( status, E_PAR, "ref_tsk SELF with NULL descriptor"); - -#if (0) - /* these errors can not be generated for ref_tsk at this time */ - fatal_directive_status( status, EN_OBJNO, "ref_tsk"); - fatal_directive_status( status, EN_CTXID, "ref_tsk"); - fatal_directive_status( status, EN_RPAR, "ref_tsk"); -#endif - - puts( "\n\n*** Suspend Task Errors ***" ); - - puts( "Init - sus_tsk - access violation ( id less than -4) - E_OACV" ); - status = sus_tsk( -5 ); - fatal_directive_status( status, E_OACV, "sus_tsk of -5"); - - puts( "Init - sus_tsk - bad id (between 0 and -4) - E_ID" ); - status = sus_tsk( -2 ); - fatal_directive_status( status, E_ID, "sus_tsk of -2"); - - puts( "Init - sus_tsk - cannot suspend SELF - E_OBJ" ); - status = sus_tsk( TSK_SELF ); - fatal_directive_status( status, E_OBJ, "sus_tsk of self"); - - puts( "Init - sus_tsk - task does not exist - E_NOEXS" ); - status = sus_tsk( 5 ); - fatal_directive_status( status, E_NOEXS, "sus_tsk of 5"); - - /* XXX - We support nested suspends and will never return this error. - puts( "Init - sus_tsk - no support for nested SUSPENDS - E_QOVR" ); - status = sus_tsk( 1 ); - fatal_directive_status( status, E_QOVR, "sus_tsk"); - */ - - /* XXX - Can not test this. - puts( "Init - sus_tsk - exceeded limit for nested SUSPENDS - E_QOVR" ); - status = sus_tsk( 1 ); - fatal_directive_status( status, E_QOVR, "sus_tsk"); - */ - -#if (0) - /* these errors can not be generated for sus_tsk at this time */ - fatal_directive_status( status, EN_OBJNO, "sus_tsk"); - fatal_directive_status( status, EN_CTXID, "sus_tsk"); -#endif - - - puts( "\n\n*** Resume Task Errors ***" ); - - puts( "Init - rsm_tsk - access violation ( id less than -4) - E_OACV" ); - status = rsm_tsk( -5 ); - fatal_directive_status( status, E_OACV, "rsm_tsk -5"); - - puts( "Init - rsm_tsk - bad id (between 0 and -4) - E_ID" ); - status = rsm_tsk( -2 ); - fatal_directive_status( status, E_ID, "rsm_tsk -2"); - - puts( "Init - rsm_tsk - cannot resume SELF - E_OBJ" ); - status = rsm_tsk( TSK_SELF ); - fatal_directive_status( status, E_OBJ, "rsm_tsk self"); - - puts( "Init - rsm_tsk - task is DORMANT - E_OBJ" ); - status = rsm_tsk( DORMANT_TASK_ID ); - fatal_directive_status( status, E_OBJ, "rsm_tsk DORMANT"); - - puts( "Init - rsm_tsk - task is NON_DORMANT not suspended - E_OK" ); - status = rsm_tsk( NON_DORMANT_TASK_ID ); - fatal_directive_status( status, E_OK, "rsm_tsk NON_DORMANT"); - - puts( "Init - rsm_tsk - task does not exist - E_NOEXS" ); - status = rsm_tsk( 5 ); - fatal_directive_status( status, E_NOEXS, "rms_tsk 5"); - -#if (0) - /* these errors can not be generated for rsm_tsk at this time */ - fatal_directive_status( status, EN_OBJNO, "rsm_tsk"); - fatal_directive_status( status, EN_CTXID, "rsm_tsk"); -#endif - - - puts( "\n\n*** Forcibly Resume Task Errors ***" ); - - puts( "Init - frsm_tsk - access violation ( id less than -4) - E_OACV" ); - status = frsm_tsk( -5 ); - fatal_directive_status( status, E_OACV, "frsm_tsk -5"); - - puts( "Init - frsm_tsk - bad id (between 0 and -4) - E_ID" ); - status = frsm_tsk( -2 ); - fatal_directive_status( status, E_ID, "frsm_tsk -2"); - - puts( "Init - frsm_tsk - cannot forcibly resume SELF - E_OBJ" ); - status = frsm_tsk( TSK_SELF ); - fatal_directive_status( status, E_OBJ, "frsm_tsk self"); - - puts( "Init - frsm_tsk - task is DORMANT - E_OBJ" ); - status = frsm_tsk( DORMANT_TASK_ID ); - fatal_directive_status( status, E_OBJ, "frsm_tsk DORMANT"); - - puts( "Init - frsm_tsk - task does not exist - E_NOEXS" ); - status = frsm_tsk( 5 ); - fatal_directive_status( status, E_NOEXS, "frsm_tsk 5"); - - puts( "Init - frsm_tsk - task is NON_DORMANT not suspended - E_OK" ); - status = frsm_tsk( NON_DORMANT_TASK_ID ); - fatal_directive_status( status, E_OK, "frsm_tsk NON_DORMANT"); - -#if (0) - /* these errors can not be generated for frsm_tsk at this time */ - fatal_directive_status( status, EN_OBJNO, "frsm_tsk"); - fatal_directive_status( status, EN_CTXID, "frsm_tsk"); -#endif - - -#if (0) -XXXXX - FIX ME - /* these directives are not coded */ - slp_tsk( ); - fatal_directive_status( status, E_OK, ""); - fatal_directive_status( status, E_PAR, ""); - fatal_directive_status( status, E_RLWAI, ""); - fatal_directive_status( status, E_TMOUT, ""); - fatal_directive_status( status, E_CTX, ""); - - - tslp_tsk( TMO ); - fatal_directive_status( status, E_OK, ""); - fatal_directive_status( status, E_PAR, ""); - fatal_directive_status( status, E_RLWAI, ""); - fatal_directive_status( status, E_TMOUT, ""); - fatal_directive_status( status, E_CTX, ""); - - wup_tsk( ID ); - fatal_directive_status( status, E_OK, ""); - fatal_directive_status( status, E_ID, ""); - fatal_directive_status( status, E_NOEXS, ""); - fatal_directive_status( status, E_OACV, ""); - fatal_directive_status( status, E_OBJ, ""); - fatal_directive_status( status, E_QOVR, ""); - fatal_directive_status( status, EN_OBJNO, ""); - fatal_directive_status( status, EN_CTXID, ""); - - - can_tsk( INT, ID ); - fatal_directive_status( status, E_OK, ""); - fatal_directive_status( status, E_ID, ""); - fatal_directive_status( status, E_NOEXS, ""); - fatal_directive_status( status, E_OACV, ""); - fatal_directive_status( status, E_OBJ, ""); - fatal_directive_status( status, EN_OBJNO, ""); - fatal_directive_status( status, EN_CTXID, ""); - fatal_directive_status( status, EN_RPAR, ""); -#endif - - puts( "*** END OF ITRON TASK TEST 2 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/itrontests/itrontask02/itrontask02.doc b/testsuites/itrontests/itrontask02/itrontask02.doc deleted file mode 100644 index 677399e1dc..0000000000 --- a/testsuites/itrontests/itrontask02/itrontask02.doc +++ /dev/null @@ -1,34 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - -This file describes the directives and concepts tested by this test set. -This test forces and verifies error conditions for the task and task -synchronization managers.. - -test set name: itrontask02 - -directives: - chg_pri cre_tsk del_tsk dis_dsp ena_dsp exd_tsk ext_tsk - frsm_tsk get_tid ref_tsk rel_wai rot_rdq rsm_tsk slp_tsk - sta_tsk sus_tsk ter_tsk tslp_tsk wup_tsk - -concepts: - - a. Verification of error codes from all task and task synchronization - commands. - -notes: - Unimplementted functions are stubbed out and should be added when - the functions are finished. - -output: - Name of command and expected error code. - Test asserts when an unexpected error code or an error does not occur. diff --git a/testsuites/itrontests/itrontask02/itrontask02.scn b/testsuites/itrontests/itrontask02/itrontask02.scn deleted file mode 100644 index a7a7aca31b..0000000000 --- a/testsuites/itrontests/itrontask02/itrontask02.scn +++ /dev/null @@ -1,80 +0,0 @@ -*** ITRON TASK TEST 2 *** -Init - cre_tsk - Dormant Task -Init - cre_tsk - Non-Dormant Task -NON-DORMANT - Sleep for 2 minutes - -*** Create Task Errors *** -Init - cre_tsk - access violation ( id less than -4) - E_OACV -Init - cre_tsk - bad id (between 0 and -4) - E_ID -Init - cre_tsk - cannot create TSK_SELF - E_ID -Init - cre_tsk - invalid id; id already exists - E_OBJ -Init - cre_tsk - tskatr is invalid - E_RSATR -Init - cre_tsk - pk_ctsk is invalid - E_PAR -Init - cre_tsk - itskpri is 0 - E_PAR -Init - cre_tsk - itskpri is 257 - E_PAR -Init - cre_tsk - stksz is invalid - E_PAR -Init - cre_tsk - task is invalid - E_PAR - -*** Delete Task Errors *** -Init - del_tsk - cannot delete TSK_SELF - E_OBJ -Init - del_tsk - task is not DORMANT - E_OBJ -Init - del_tsk - task does not exist - E_NOEXS -Init - del_tsk - access violation ( id less than -4) - E_OACV -Init - del_tsk - cannot delete TSK_SELF - E_OBJ -Init - del_tsk - bad id (between 0 and -4) - E_ID - -*** Start Task Errors *** -Init - sta_tsk - access violation ( id less than -4) - E_OACV -Init - sta_tsk - bad id (between 0 and -4) - E_ID -Init - sta_tsk - cannot start TSK_SELF - E_OBJ -Init - sta_tsk - task is not DORMANT - E_OBJ -Init - sta_tsk - task does not exist - E_NOEXS - -*** Terminate Other Task Errors *** -Init - ter_tsk - bad id (between 0 and -4) - E_ID -Init - ter_tsk - cannot terminate TSK_SELF (0) - E_OBJ -Init - ter_tsk - task is not DORMANT - E_OBJ -Init - ter_tsk - task does not exist - E_NOEXS -Init - ter_tsk - access violation ( id less than -4) - E_OACV - -*** Change Priority Task Errors *** -Init - chg_pri - bad id (between 0 and -4) - E_ID -Init - chg_pri - task is DORMANT - E_OBJ -Init - chg_pri - task does not exist - E_NOEXS -Init - chg_pri - access violation ( id less than -4) - E_OACV -Init - chg_pri - invalid priority - E_PAR - -*** Rotate Ready Queue Errors *** -Init - rot_rdq - priority -1 - E_PAR -Init - rot_rdq - priority 257 - E_PAR - -*** Reference Task Status Errors *** -Init - ref_tsk - bad id (between 0 and -4) - E_ID -Init - ref_tsk - task does not exist - E_NOEXS -Init - ref_tsk - access violation ( id less than -4) - E_OACV -Init - ref_tsk - packet address is bad - E_PAR - -*** Suspend Task Errors *** -Init - sus_tsk - access violation ( id less than -4) - E_OACV -Init - sus_tsk - bad id (between 0 and -4) - E_ID -Init - sus_tsk - cannot suspend SELF - E_OBJ -Init - sus_tsk - task does not exist - E_NOEXS - -*** Resume Task Errors *** -Init - rsm_tsk - access violation ( id less than -4) - E_OACV -Init - rsm_tsk - bad id (between 0 and -4) - E_ID -Init - rsm_tsk - cannot resume SELF - E_OBJ -Init - rsm_tsk - task is DORMANT - E_OBJ -Init - rsm_tsk - task is NON_DORMANT not suspended - E_OK -Init - rsm_tsk - task does not exist - E_NOEXS - -*** Forcibly Resume Task Errors *** -Init - frsm_tsk - access violation ( id less than -4) - E_OACV -Init - frsm_tsk - bad id (between 0 and -4) - E_ID -Init - frsm_tsk - cannot forcibly resume SELF - E_OBJ -Init - frsm_tsk - task is DORMANT - E_OBJ -Init - frsm_tsk - task does not exist - E_NOEXS -Init - frsm_tsk - task is NON_DORMANT not suspended - E_OK - -*** END OF ITRON TASK TEST 2 *** - diff --git a/testsuites/itrontests/itrontask02/system.h b/testsuites/itrontests/itrontask02/system.h deleted file mode 100644 index 31498a5d3a..0000000000 --- a/testsuites/itrontests/itrontask02/system.h +++ /dev/null @@ -1,47 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include - -/* functions */ - -void ITRON_Init( void ); -void Dormant_task(); -void Non_Dormant_task(); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER - -#define CONFIGURE_MAXIMUM_ITRON_TASKS 5 - -#define CONFIGURE_ITRON_INIT_TASK_TABLE - -#include - -/* global variables */ - -#define DORMANT_TASK_ID 2 -#define NON_DORMANT_TASK_ID 3 - -TEST_EXTERN rtems_id Global_variable; /* example global variable */ - -/* end of include file */ - - - - - diff --git a/testsuites/itrontests/itrontask03/.cvsignore b/testsuites/itrontests/itrontask03/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/itrontests/itrontask03/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/itrontests/itrontask03/Makefile.am b/testsuites/itrontests/itrontask03/Makefile.am deleted file mode 100644 index da44b4f11d..0000000000 --- a/testsuites/itrontests/itrontask03/Makefile.am +++ /dev/null @@ -1,41 +0,0 @@ -## -## $Id$ -## - - -TEST = itrontask03 -PGM = ${ARCH}/$(TEST).exe - -MANAGERS = all - -C_FILES = init.c preempt.c task1.c task2.c task3.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/itrontests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/itrontests/itrontask03/init.c b/testsuites/itrontests/itrontask03/init.c deleted file mode 100644 index 503a776a41..0000000000 --- a/testsuites/itrontests/itrontask03/init.c +++ /dev/null @@ -1,144 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" -#include -#include - -void ITRON_Init( void ) -{ - ER status; - T_CTSK pk_ctsk; - T_RTSK pk_rtsk; - - pk_ctsk.exinf = NULL; - pk_ctsk.tskatr = TA_HLNG; - pk_ctsk.stksz = RTEMS_MINIMUM_STACK_SIZE; - pk_ctsk.itskpri = PREEMPT_PRIORITY; - pk_ctsk.task = Preempt_task; - - puts( "\n\n*** ITRON TASK TEST 3 ***" ); - - /* - * Create and start the Preempt task the first time. - * Verify that it is dormant when it comes back. - */ - - puts( "INIT - Create and Start PREEMPT" ); - status = chg_pri( TSK_SELF, (PREEMPT_PRIORITY+2) ); - directive_failed( status, "chg_pri of SELF" ); - - status = cre_tsk( PREEMPT_TASK_ID, &pk_ctsk ); - directive_failed( status, "cre_tsk of RTEMS_PREEMPT" ); - - status = sta_tsk( PREEMPT_TASK_ID, 0 ); - directive_failed( status, "sta_tsk of RTEMS_PREEMPT" ); - puts( "INIT - rot_rdq - no tasks at this priority" ); - status = rot_rdq( 1 ); - directive_failed( status, "rot_rdq" ); - - puts( "INIT - ref_tsk PREEMPT - Validate DORMANT STATE" ); - status = ref_tsk( &pk_rtsk, PREEMPT_TASK_ID ); - directive_failed( status, "INIT - ref_tsk of RTEMS_PREEMPT"); - fatal_directive_status(pk_rtsk.tskstat,TTS_DMT,"tskstat of PREEMPT"); - - /* - * Restart the Preempt Task. - */ - - status = sta_tsk( PREEMPT_TASK_ID, 0 ); - directive_failed( status, "sta_tsk of RTEMS_PREEMPT" ); - puts( "INIT - rot_rdq - yielding processor" ); - status = rot_rdq( 1 ); - directive_failed( status, "rot_rdq" ); - puts( "INIT - ref_tsk PREEMPT - Validate no longer exists" ); - status = ref_tsk( &pk_rtsk, PREEMPT_TASK_ID ); - fatal_directive_status( status, E_NOEXS, "tskstat of PREEMPT"); - status = chg_pri( TSK_SELF, PREEMPT_PRIORITY ); - directive_failed( status, "chg_pri of SELF" ); - - /* - * XXX - */ - - pk_ctsk.itskpri = 3; - pk_ctsk.task = Task_1; - status = cre_tsk( TA1_ID, &pk_ctsk ); - directive_failed( status, "cre_tsk of TA1" ); - - pk_ctsk.task = Task_2; - status = cre_tsk( TA2_ID, &pk_ctsk ); - directive_failed( status, "cre_tsk of TA2" ); - - pk_ctsk.task = Task_3; - status = cre_tsk( TA3_ID, &pk_ctsk ); - directive_failed( status, "cre_tsk of TA3" ); - - status = sta_tsk( TA1_ID, 0 ); - directive_failed( status, "sta_tsk of TA1" ); - status = sta_tsk( TA2_ID, 0 ); - directive_failed( status, "sta_tsk of TA2" ); - status = sta_tsk( TA3_ID, 0 ); - directive_failed( status, "sta_tsk of TA3" ); - - status = ref_tsk( &pk_rtsk, TA1_ID); - directive_failed( status, "INIT - ref_tsk of TA1"); - fatal_directive_status( pk_rtsk.tskstat, TTS_RDY , "tskstat of TA1"); - - puts( "INIT - suspending TA2 while middle task on a ready chain" ); - status = sus_tsk( TA2_ID ); - directive_failed( status, "sus_tsk of TA2" ); - status = ref_tsk( &pk_rtsk, TA2_ID); - directive_failed( status, "INIT - ref_tsk of TA2"); - fatal_directive_status( pk_rtsk.tskstat, TTS_SUS, "tskstat of TA2"); - - status = ter_tsk( TA1_ID ); - directive_failed( status, "ter_tsk of TA1" ); - status = del_tsk( TA1_ID ); - directive_failed( status, "del_tsk of TA1" ); - status = ter_tsk( TA2_ID ); - directive_failed( status, "ter_tsk of TA2" ); - status = ter_tsk( TA3_ID ); - directive_failed( status, "ter_tsk of TA3" ); - - pk_ctsk.itskpri = 1; - pk_ctsk.task = Task_1; - status = cre_tsk( TA1_ID, &pk_ctsk ); - directive_failed( status, "cre_tsk of TA1 at priority 1" ); - - status = sta_tsk( TA1_ID, 0 ); - directive_failed( status, "sta_tsk of TA1" ); - status = sta_tsk( TA2_ID, 0 ); - directive_failed( status, "sta_tsk of TA2" ); - status = sta_tsk( TA3_ID, 0 ); - directive_failed( status, "sta_tsk of TA3" ); - - exd_tsk(); - assert(0); -} - - - - - - diff --git a/testsuites/itrontests/itrontask03/itrontask03.doc b/testsuites/itrontests/itrontask03/itrontask03.doc deleted file mode 100644 index 0382de6f1f..0000000000 --- a/testsuites/itrontests/itrontask03/itrontask03.doc +++ /dev/null @@ -1,54 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - -This file describes the directives and concepts tested by this test set. -This test is based upon the test in sp0. - -test set name: itrontask03 - -directives: - chg_pri cre_tsk del_tsk exd_tsk rot_rdq sta_tsk sus_tsk ter_tsk - -concepts: XXX - Verify - - a. verifies rot_rdq can be used by equal priority tasks to correctly yeild the processor - - b. Verifies sus_tsk suspends another task. - - c. Verifies rot_rdq with a yeild process response. - - 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. - -notes: - - rtems_wake_after calls should be replaced with itron calls when - the time functionality is added. - -output: - - - - - - diff --git a/testsuites/itrontests/itrontask03/itrontask03.scn b/testsuites/itrontests/itrontask03/itrontask03.scn deleted file mode 100644 index f933bf7161..0000000000 --- a/testsuites/itrontests/itrontask03/itrontask03.scn +++ /dev/null @@ -1,21 +0,0 @@ -*** ITRON TASK TEST 3 *** -INIT - Create and Start PREEMPT -PREEMPT - ref_tsk validation -PREEMPT - chg_pri increment priority -PREEMPT - ext_tsk - going to DORMANT state -INIT - rot_rdq - no tasks at this priority -INIT - ref_tsk PREEMPT - Validate DORMANT STATE -PREEMPT - ref_tsk validation -PREEMPT - exd_tsk - Exit and Delete task -INIT - rot_rdq - yielding processor -INIT - ref_tsk PREEMPT - Validate no longer exists -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 - chg_pri - set TA3's priority to 2 -TA1 - sus_tsk - suspend TA2 -TA1 - - delete TA2 -TA1 - rtems_task_wake_after - sleep for 5 seconds -TA3 - exd_tsk - exit and delete self -*** ITRON TASK TEST 3 *** diff --git a/testsuites/itrontests/itrontask03/preempt.c b/testsuites/itrontests/itrontask03/preempt.c deleted file mode 100644 index 7c2bafbee8..0000000000 --- a/testsuites/itrontests/itrontask03/preempt.c +++ /dev/null @@ -1,54 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include "system.h" - -int Preempt_task_Count; - -void Preempt_task() -{ - ER status; - T_RTSK pk_rtsk; - - puts( "PREEMPT - ref_tsk validation" ); - status = ref_tsk( &pk_rtsk, PREEMPT_TASK_ID ); - fatal_directive_status( status, E_OK , "ref_tsk of PREEMPT"); - assert( pk_rtsk.tskpri == PREEMPT_PRIORITY ); - assert( pk_rtsk.itskpri == PREEMPT_PRIORITY ); - assert( pk_rtsk.task == Preempt_task ); - assert( pk_rtsk.stksz >= RTEMS_MINIMUM_STACK_SIZE ); - assert( pk_rtsk.tskstat == (TTS_RUN | TTS_RDY) ); - - if ( Preempt_task_Count == 0 ) { - Preempt_task_Count ++; - puts( "PREEMPT - chg_pri increment priority "); - status = chg_pri( PREEMPT_TASK_ID, (PREEMPT_PRIORITY+1) ); - directive_failed( status, "chg_pri" ); - puts( "PREEMPT - ext_tsk - going to DORMANT state" ); - ext_tsk( ); - assert( 0 ); - } else { - Preempt_task_Count ++; - puts( "PREEMPT - exd_tsk - Exit and Delete task" ); - exd_tsk( ); - assert( 0 ); - } -} - diff --git a/testsuites/itrontests/itrontask03/system.h b/testsuites/itrontests/itrontask03/system.h deleted file mode 100644 index 762fc95d8c..0000000000 --- a/testsuites/itrontests/itrontask03/system.h +++ /dev/null @@ -1,49 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include - -/* functions */ - -void ITRON_Init( void ); -void Preempt_task(); -void Task_1(); -void Task_2(); -void Task_3(); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_ITRON_TASKS 6 - -#define CONFIGURE_ITRON_INIT_TASK_TABLE - -#include - -/* global variables */ - -#define PREEMPT_TASK_ID 2 -#define TA1_ID 3 -#define TA2_ID 4 -#define TA3_ID 5 - - -#define PREEMPT_PRIORITY 1 -TEST_EXTERN rtems_id Global_variable; /* example global variable */ - -/* end of include file */ diff --git a/testsuites/itrontests/itrontask03/task1.c b/testsuites/itrontests/itrontask03/task1.c deleted file mode 100644 index 9bd44f54e9..0000000000 --- a/testsuites/itrontests/itrontask03/task1.c +++ /dev/null @@ -1,57 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -void Task_1() -{ - ER status; - - /* - * XXX - Change to itron routine. - */ - - 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 = chg_pri( TA3_ID , 2 ); - directive_failed( status, "chg_pri" ); - - puts( "TA1 - chg_pri - set TA3's priority to 2" ); - - puts( "TA1 - sus_tsk - suspend TA2" ); - status = sus_tsk( TA2_ID ); - directive_failed( status, "sus_tsk of TA2" ); - - puts( "TA1 - - delete TA2" ); - status = ter_tsk( TA2_ID ); - directive_failed( status, "ter_tsk of TA2" ); - - /* - * XXX - Change to itron routine. - */ - - 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( "*** ITRON TASK TEST 3 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/itrontests/itrontask03/task2.c b/testsuites/itrontests/itrontask03/task2.c deleted file mode 100644 index b85bc527c4..0000000000 --- a/testsuites/itrontests/itrontask03/task2.c +++ /dev/null @@ -1,31 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -void Task_2() -{ - 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/itrontests/itrontask03/task3.c b/testsuites/itrontests/itrontask03/task3.c deleted file mode 100644 index 05b92ec280..0000000000 --- a/testsuites/itrontests/itrontask03/task3.c +++ /dev/null @@ -1,39 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -void Task_3() -{ - rtems_status_code status; - - /* - * XXX - Convert Later. - */ - - 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 - exd_tsk - exit and delete self" ); - exd_tsk(); - directive_failed( 0, "exd_tsk" ); -} diff --git a/testsuites/itrontests/itrontask04/.cvsignore b/testsuites/itrontests/itrontask04/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/itrontests/itrontask04/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/itrontests/itrontask04/Makefile.am b/testsuites/itrontests/itrontask04/Makefile.am deleted file mode 100644 index 4907bd68ce..0000000000 --- a/testsuites/itrontests/itrontask04/Makefile.am +++ /dev/null @@ -1,41 +0,0 @@ -## -## $Id$ -## - - -TEST = itrontask04 -PGM = ${ARCH}/$(TEST).exe - -MANAGERS = all - -C_FILES = init.c task1.c task2.c task3.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/itrontests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/itrontests/itrontask04/init.c b/testsuites/itrontests/itrontask04/init.c deleted file mode 100644 index 56d251d15c..0000000000 --- a/testsuites/itrontests/itrontask04/init.c +++ /dev/null @@ -1,93 +0,0 @@ - /* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" -#include - -void ITRON_Init( void ) -{ - ER status; - T_CTSK pk_ctsk; - - puts( "\n\n*** ITRON TASK TEST 4 ***" ); - - status = chg_pri( 0, 20 ); - directive_failed( status, "chg_pri to 20" ); - - pk_ctsk.exinf = NULL; - pk_ctsk.tskatr = TA_HLNG; - pk_ctsk.stksz = RTEMS_MINIMUM_STACK_SIZE; - pk_ctsk.itskpri = 2; - - pk_ctsk.task = Task_1; - status = cre_tsk( TA1_ID, &pk_ctsk ); - directive_failed( status, "cre_tsk of TA1" ); - - pk_ctsk.task = Task_2; - status = cre_tsk( TA2_ID, &pk_ctsk ); - directive_failed( status, "cre_tsk of TA2" ); - - pk_ctsk.itskpri = 1; - pk_ctsk.task = Task_3; - status = cre_tsk( TA3_ID, &pk_ctsk ); - directive_failed( status, "cre_tsk of TA3" ); - - puts("INIT - dis_dsp while starting tasks"); - status = dis_dsp( ); - - /* dispatching disabled */ - - directive_failed_with_level( status, "dis_dsp from ITRON_Init", 1 ); - status = sta_tsk( TA1_ID, 0 ); - directive_failed_with_level( status, "sta_tsk of TA1", 1 ); - status = sta_tsk( TA2_ID, 0 ); - directive_failed_with_level( status, "sta_tsk of TA2", 1 ); - status = sta_tsk( TA3_ID, 0 ); - directive_failed_with_level( status, "sta_tsk of TA3", 1 ); - - puts( "INIT - suspending TA2 3 times" ); - status = sus_tsk( TA2_ID ); - directive_failed_with_level( status, "sus_tsk of TA2", 1 ); - status = sus_tsk( TA2_ID ); - directive_failed_with_level( status, "sus_tsk of TA2", 1 ); - status = sus_tsk( TA2_ID ); - directive_failed_with_level( status, "sus_tsk of TA2", 1 ); - - puts("INIT - ena_dsp while starting tasks"); - status = ena_dsp( ); - - /* dispatching enabled again */ - - puts( "INIT - suspending TA1 3 times" ); - status = sus_tsk( TA1_ID ); - directive_failed( status, "sus_tsk of TA2" ); - status = sus_tsk( TA1_ID ); - directive_failed( status, "sus_tsk of TA2" ); - status = sus_tsk( TA1_ID ); - directive_failed( status, "sus_tsk of TA2" ); - - puts("INIT - exd_tsk"); - exd_tsk(); - directive_failed( 0, "exd_tsk" ); -} - diff --git a/testsuites/itrontests/itrontask04/itrontask04.doc b/testsuites/itrontests/itrontask04/itrontask04.doc deleted file mode 100644 index 7119c520f8..0000000000 --- a/testsuites/itrontests/itrontask04/itrontask04.doc +++ /dev/null @@ -1,49 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - -This file describes the directives and concepts tested by this test set. - -test set name: itrontask04 - -directives: - chg_pri cre_tsk dis_dsp ena_dsp exd_tsk frsm_tsk rot_rdq rsm_tsk - sta_tsk sus_tsk - -concepts: - - a. This test check task suspend and resume functionality. - - b. Verifies the suspend count works correctly. - - c. Verifies the forced resume works correctly - - d. Verifies the rotate ready queue works correctly - - e. Verifies a task called with rtems suspend can be resumed - with an itron resume call. ( XXX - May not be necessary. ) - - f. verifies rot_rdq can be used by non-equal priority tasks to correctly rotate ready queue. - - g. Verifies enable dispatch and disable dispatch work. - -notes: - - This verision of ITRON does not provide a way for a task to - suspend itself (only another task can suspend it). Therefore, - the test calls rtems_task_suspend to suspend it. - - rtems_task_wake_after calls should be replaced with itron call - when the ITRON functionality is finished. - -output: - - XXX - Verify the output messages on this test. It looks like - the suspend count doesn't look correct. ??? Nov 10, 99 diff --git a/testsuites/itrontests/itrontask04/itrontask04.scn b/testsuites/itrontests/itrontask04/itrontask04.scn deleted file mode 100644 index 76959b88c0..0000000000 --- a/testsuites/itrontests/itrontask04/itrontask04.scn +++ /dev/null @@ -1,35 +0,0 @@ -*** ITRON TASK TEST 4 *** -INIT - dis_dsp while starting tasks -INIT - suspending TA2 3 times -INIT - ena_dsp while starting tasks -TA3 - frsm_tsk TA1 -TA3 - rsm_tsk TA2 -TA3 - rot_rdq priority 2 queue -TA3 - rtems_task_wake_after - sleep 1 second -TA2 - rtems_task_suspend RTEMS_SELF -INIT - suspending TA1 3 times -INIT - exd_tsk -TA3 - frsm_tsk TA1 -TA3 - rsm_tsk TA2 -TA3 - rot_rdq priority 2 queue -TA3 - rtems_task_wake_after - sleep 1 second -TA2 - rtems_task_suspend RTEMS_SELF -TA3 - frsm_tsk TA1 -TA3 - rsm_tsk TA2 -TA3 - rot_rdq priority 2 queue -TA3 - rtems_task_wake_after - sleep 1 second -TA2 - rtems_task_suspend RTEMS_SELF -TA2 - rtems_task_suspend RTEMS_SELF -TA3 - frsm_tsk TA1 -TA3 - rsm_tsk TA2 -TA3 - rot_rdq priority 2 queue -TA3 - rtems_task_wake_after - sleep 1 second -TA2 - rtems_task_suspend RTEMS_SELF -TA2 - rtems_task_suspend RTEMS_SELF -TA3 - frsm_tsk TA1 -TA3 - rsm_tsk TA2 -TA3 - rot_rdq priority 2 queue -TA3 - rtems_task_wake_after - sleep 1 second -TA2 - rtems_task_suspend RTEMS_SELF -TA2 - rtems_task_suspend RTEMS_SELF -*** ITRON TASK TEST 4 *** diff --git a/testsuites/itrontests/itrontask04/system.h b/testsuites/itrontests/itrontask04/system.h deleted file mode 100644 index d0715d08e2..0000000000 --- a/testsuites/itrontests/itrontask04/system.h +++ /dev/null @@ -1,47 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include - -/* functions */ - -void ITRON_Init( void ); -void Preempt_task(); -void Task_1(); -void Task_2(); -void Task_3(); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_ITRON_TASKS 5 - -#define CONFIGURE_ITRON_INIT_TASK_TABLE - -#include - -/* global variables */ - -#define PREEMPT_TASK_ID 2 -#define TA1_ID 3 -#define TA2_ID 4 -#define TA3_ID 5 - -TEST_EXTERN rtems_id Global_variable; /* example global variable */ - -/* end of include file */ diff --git a/testsuites/itrontests/itrontask04/task1.c b/testsuites/itrontests/itrontask04/task1.c deleted file mode 100644 index ac7f9cc49b..0000000000 --- a/testsuites/itrontests/itrontask04/task1.c +++ /dev/null @@ -1,44 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -/* - * XXX - This test requires tasks to suspend self, yet ITRON defines - * this as an error. - */ - -void Task_1() -{ - rtems_status_code status; - - while (1) { - - puts( "TA2 - rtems_task_suspend RTEMS_SELF" ); - status = rtems_task_suspend( RTEMS_SELF ); - directive_failed( status, "TA2 rtems_task_suspend RTEMS_SELF" ); - - } -} - - - - - - diff --git a/testsuites/itrontests/itrontask04/task2.c b/testsuites/itrontests/itrontask04/task2.c deleted file mode 100644 index f47225dba6..0000000000 --- a/testsuites/itrontests/itrontask04/task2.c +++ /dev/null @@ -1,40 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -/* - * XXX - This test requires tasks to suspend self, yet ITRON defines - * this as an error. - */ - -void Task_2() -{ - rtems_status_code status; - - while (1) { - - puts( "TA2 - rtems_task_suspend RTEMS_SELF" ); - status = rtems_task_suspend( RTEMS_SELF ); - directive_failed( status, "TA2 rtems_task_suspend RTEMS_SELF" ); - - } -} diff --git a/testsuites/itrontests/itrontask04/task3.c b/testsuites/itrontests/itrontask04/task3.c deleted file mode 100644 index 58988ac6fb..0000000000 --- a/testsuites/itrontests/itrontask04/task3.c +++ /dev/null @@ -1,53 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -void Task_3() -{ - rtems_status_code status; - int i; - - for(i=0; i<5; i++) { - puts("TA3 - frsm_tsk TA1"); - status = frsm_tsk( TA1_ID ); - directive_failed( status, "TA3 - frsm_tsk TA1" ); - - puts("TA3 - rsm_tsk TA2"); - status = rsm_tsk( TA2_ID ); - directive_failed( status, "TA3 - rsm_tsk TA2" ); - - puts( "TA3 - rot_rdq priority 2 queue"); - status = rot_rdq( 2 ); - directive_failed( status, "rot_rdq for 2" ); - - /* - * XXX - Convert Later. - */ - - puts( "TA3 - rtems_task_wake_after - sleep 1 second" ); - status = rtems_task_wake_after( TICKS_PER_SECOND ); - directive_failed( status, "rtems_task_wake_after in TA3" ); - } - - puts( "*** ITRON TASK TEST 4 ***" ); - rtems_test_exit( 0 ); -} - diff --git a/testsuites/itrontests/itrontests.am b/testsuites/itrontests/itrontests.am deleted file mode 100644 index 5c42df4f19..0000000000 --- a/testsuites/itrontests/itrontests.am +++ /dev/null @@ -1,25 +0,0 @@ -## $Id$ - -project_bspdir=$(PROJECT_ROOT)/@RTEMS_BSP@ - -$(project_bspdir)/tests: - @$(mkinstalldirs) $@ - -$(project_bspdir)/tests/$(TEST)$(LIB_VARIANT).exe: $(PGM) - $(INSTALL_PROGRAM) $< $@ - -$(project_bspdir)/tests/screens: - @$(mkinstalldirs) $@ - -$(project_bspdir)/tests/screens/itrontests: - @$(mkinstalldirs) $@ - -$(project_bspdir)/tests/screens/itrontests/$(TEST).scn: $(TEST).scn - $(INSTALL_DATA) $< $@ - -TMPINSTALL_FILES = \ -$(project_bspdir)/tests \ -$(project_bspdir)/tests/$(TEST)$(LIB_VARIANT).exe \ -$(project_bspdir)/tests/screens \ -$(project_bspdir)/tests/screens/itrontests \ -$(project_bspdir)/tests/screens/itrontests/$(TEST).scn diff --git a/testsuites/itrontests/itrontime01/.cvsignore b/testsuites/itrontests/itrontime01/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/itrontests/itrontime01/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/itrontests/itrontime01/Makefile.am b/testsuites/itrontests/itrontime01/Makefile.am deleted file mode 100644 index 88b7acdffa..0000000000 --- a/testsuites/itrontests/itrontime01/Makefile.am +++ /dev/null @@ -1,41 +0,0 @@ -## -## $Id$ -## - - -TEST = itrontime01 -PGM = ${ARCH}/$(TEST).exe - -MANAGERS = all - -C_FILES = init.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/itrontests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/itrontests/itrontime01/init.c b/testsuites/itrontests/itrontime01/init.c deleted file mode 100644 index 10f91f0436..0000000000 --- a/testsuites/itrontests/itrontime01/init.c +++ /dev/null @@ -1,62 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" -#include -#include - -/* - * get the current time in second since epoch (1970), change it since 1985, - * compute the time in millisecond - * - */ - -int time_sec_epoch( void ) { - -int s_time,t_time,r_time; -long m_sec; - -t_time = time(NULL); -s_time = (1985-1970)*365*24*60*60; -r_time = t_time - s_time; -m_sec = r_time*1000; - -printf( "Time from 1970: %d\n", t_time ); -printf( "Time between 1970 and 1985: %d\n", s_time ); -printf( "Time from 1985: %d\n", r_time ); -printf("milliseconds: %ld\n",m_sec); - -return 0; -} - - - -void ITRON_Init( void ) -{ - printf( "\n\n*** ITRON TIME TEST 01 ***\n" ); - printf( "The Time Services are not completely implemented.\n" ); - printf( "*** END OF ITRON TIME TEST 01 ***\n" ); - rtems_test_exit( 0 ); -} - - diff --git a/testsuites/itrontests/itrontime01/itrontime01.doc b/testsuites/itrontests/itrontime01/itrontime01.doc deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/testsuites/itrontests/itrontime01/itrontime01.scn b/testsuites/itrontests/itrontime01/itrontime01.scn deleted file mode 100644 index c76eb631fd..0000000000 --- a/testsuites/itrontests/itrontime01/itrontime01.scn +++ /dev/null @@ -1,4 +0,0 @@ -*** ITRON TIME TEST 01 *** -The Time Services are not completely implemented. -*** END OF ITRON TIME TEST 01 *** - diff --git a/testsuites/itrontests/itrontime01/system.h b/testsuites/itrontests/itrontime01/system.h deleted file mode 100644 index 3482ffa2a1..0000000000 --- a/testsuites/itrontests/itrontime01/system.h +++ /dev/null @@ -1,37 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include - -/* functions */ - -void ITRON_Init( void ); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER - -#define CONFIGURE_MAXIMUM_ITRON_TASKS 1 - -#define CONFIGURE_ITRON_INIT_TASK_TABLE - -#include - -/* global variables */ - -TEST_EXTERN rtems_id Global_variable; /* example global variable */ - -/* end of include file */ diff --git a/testsuites/libtests/.cvsignore b/testsuites/libtests/.cvsignore deleted file mode 100644 index bfdfd995be..0000000000 --- a/testsuites/libtests/.cvsignore +++ /dev/null @@ -1,14 +0,0 @@ -aclocal.m4 -autom4te*.cache -config.cache -config.guess -config.log -config.status -config.sub -configure -depcomp -install-sh -Makefile -Makefile.in -missing -mkinstalldirs diff --git a/testsuites/libtests/ChangeLog b/testsuites/libtests/ChangeLog deleted file mode 100644 index ba72a4d087..0000000000 --- a/testsuites/libtests/ChangeLog +++ /dev/null @@ -1,124 +0,0 @@ -2003-02-03 Ralf Corsepius - - * configure.ac: Unconditionally check for CXX. - Require autoconf-2.57, automake-1.7.2. - * rtems++: Eliminate CC_O_FILES. - -2002-12-02 Joel Sherrill - - * malloctest/init.c: Tasks should be floating point. - -2002-10-21 Ralf Corsepius - - * .cvsignore: Reformat. - Add autom4te*cache. - Remove autom4te.cache. - -2002-08-11 Ralf Corsepius - - * cpuuse/Makefile.am: Use $(OBJEXT) instead of .o. - * malloctest/Makefile.am: Use $(OBJEXT) instead of .o. - * monitor/Makefile.am: Use $(OBJEXT) instead of .o. - * putenvtest/Makefile.am: Use $(OBJEXT) instead of .o. - * rtems++/Makefile.am: Use $(OBJEXT) instead of .o. - * rtmonuse/Makefile.am: Use $(OBJEXT) instead of .o. - * stackchk/Makefile.am: Use $(OBJEXT) instead of .o. - * termios/Makefile.am: Use $(OBJEXT) instead of .o. - -2002-08-01 Joel Sherrill - - * Per PR47 add support for buffered test output. This involved - adding defines to redirect output to a buffer and dump it when - full, at "test pause", and at exit. To avoid problems when redefining - exit(), all tests were modified to call rtems_test_exit(). - Some tests, notable psxtests, had to be modified to include - the standard test macro .h file (pmacros.h or tmacros.h) to - enable this support. - * cpuuse/task2.c, malloctest/task1.c, putenvtest/init.c, - rtmonuse/task1.c, termios/init.c: Modified. - -2002-04-14 Ralf Corsepius - - * configure.ac: Remove ENABLE_GCC28. - -2002-03-27 Ralf Corsepius - - * configure.ac: - AC_INIT(package,_RTEMS_VERSION,_RTEMS_BUGS). - AM_INIT_AUTOMAKE([no-define foreign 1.6]). - * cpuuse/Makefile.am: Remove AUTOMAKE_OPTIONS. - * Makefile.am: Remove AUTOMAKE_OPTIONS. - * malloctest/Makefile.am: Remove AUTOMAKE_OPTIONS. - * monitor/Makefile.am: Remove AUTOMAKE_OPTIONS. - * putenvtest/Makefile.am: Remove AUTOMAKE_OPTIONS. - * rtems++/Makefile.am: Remove AUTOMAKE_OPTIONS. - * rtmonuse/Makefile.am: Remove AUTOMAKE_OPTIONS. - * stackchk/Makefile.am: Remove AUTOMAKE_OPTIONS. - * termios/Makefile.am: Remove AUTOMAKE_OPTIONS. - -2001-11-01 Joel Sherrill - - * rtems++/Makefile.am: Make sure debug variant of librtems++ - is linked against. Reported by Jerry Needell - and processed as PR78. - -2001-10-25 Joel Sherrill - - * rtems++/Makefile.am: Pick up -lrtems++ even when debug. - -2001-10-11 Ralf Corsepius - - * .cvsignore: Add autom4te.cache for autoconf > 2.52. - * configure.in: Remove. - * configure.ac: New file, generated from configure.in by autoupdate. - -2001-09-22 Ralf Corsepius - - * libtests.am: Use TMPINSTALL_FILES = to make automake-1.5 happy. - * rtems++/Makefile.am: LD_FLAGS = -lrtems++. - -2001-09-19 Ralf Corsepius - - * malloctest/Makefile.am: include leaf.am instead of leaf.cfg. - * monitor/Makefile.am: include leaf.am instead of leaf.cfg. - * termios/Makefile.am: include leaf.am instead of leaf.cfg. - * putenvtest/Makefile.am: include leaf.am instead of leaf.cfg. - * rtems++/Makefile.am: include leaf.am instead of leaf.cfg, use - make-cxx-exe. - * stackchk/Makefile.am: include leaf.am instead of leaf.cfg. - * rtmonuse/Makefile.am: include leaf.am instead of leaf.cfg. - * cpuuse/Makefile.am: include leaf.am instead of leaf.cfg. - -2001-05-10 Ralf Corsepius - - * configure.in: Use RTEMS_PROG_CC_FOR_TARGET([-ansi -fasm]). - -2000-11-09 Ralf Corsepius - - * Makefile.am: Use ... instead of RTEMS_TOPdir in ACLOCAL_AMFLAGS. - -2000-11-02 Ralf Corsepius - - * Makefile.am: Switch to ACLOCAL_AMFLAGS = -I $(RTEMS_TOPdir)/aclocal. - -2000-11-01 Joel Sherrill - - * malloctest/task1.c: assoc.h, error.h, libio_.h, libio.h, and - libcsupport.h moved from libc to lib/include/rtems and now must - be referenced as . - -2000-10-27 Ralf Corsepius - - * Makefile.am: ACLOCAL_AMFLAGS= -I $(RTEMS_TOPdir)/macros. - Switch to GNU canonicalization. - * libtests.am: Remove DEFS. - -2000-09-04 Ralf Corsepius - - * cpuuse/Makefile.am, malloctest/Makefile.am, monitor/Makefile.am, - putenvtest/Makefile.am, rtems++/Makefile.am, rtmonuse/Makefile.am, - stackchk/Makefile.am, termios/Makefile.am: Include compile.am - -2000-08-10 Joel Sherrill - - * ChangeLog: New file. diff --git a/testsuites/libtests/Makefile.am b/testsuites/libtests/Makefile.am deleted file mode 100644 index daa6574d02..0000000000 --- a/testsuites/libtests/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -## -## $Id$ -## - -ACLOCAL_AMFLAGS = -I ../../../../aclocal - -SUBDIRS = cpuuse malloctest putenvtest monitor rtmonuse stackchk termios \ - rtems++ - -EXTRA_DIST = libtests.am - -include $(top_srcdir)/../../../../automake/subdirs.am -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/libtests/README b/testsuites/libtests/README deleted file mode 100644 index bc4b217832..0000000000 --- a/testsuites/libtests/README +++ /dev/null @@ -1,10 +0,0 @@ -# -# $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/configure.ac b/testsuites/libtests/configure.ac deleted file mode 100644 index 712b0b05ad..0000000000 --- a/testsuites/libtests/configure.ac +++ /dev/null @@ -1,51 +0,0 @@ -## Process this file with autoconf to produce a configure script. -## -## $Id$ - -AC_PREREQ(2.57) -AC_INIT([rtems-c-src-tests-libtests],[_RTEMS_VERSION],[rtems-bugs@OARcorp.com]) -AC_CONFIG_SRCDIR([cpuuse]) -RTEMS_TOP(../../../..) -AC_CONFIG_AUX_DIR(../../../..) - -RTEMS_CANONICAL_TARGET_CPU - -AM_INIT_AUTOMAKE([no-define foreign 1.7.2]) -AM_MAINTAINER_MODE - -RTEMS_ENABLE_CXX -RTEMS_ENABLE_BARE - -RTEMS_ENV_RTEMSBSP -RTEMS_CHECK_RTEMS_TEST_NO_PAUSE -RTEMS_CHECK_CPU -RTEMS_CANONICAL_HOST - -RTEMS_PROJECT_ROOT - -RTEMS_PROG_CC_FOR_TARGET([-ansi -fasm]) - -RTEMS_PROG_CXX_FOR_TARGET - -RTEMS_CANONICALIZE_TOOLS - -RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP) -RTEMS_CHECK_CXX(RTEMS_BSP) - -AC_SUBST(BARE_CPU_CFLAGS) -AC_SUBST(BARE_CPU_MODEL) - -AM_CONDITIONAL(HAS_CXX,test "$HAS_CPLUSPLUS" = "yes") - -# Explicitly list all Makefiles here -AC_CONFIG_FILES([Makefile -cpuuse/Makefile -malloctest/Makefile -monitor/Makefile -putenvtest/Makefile -rtems++/Makefile -rtmonuse/Makefile -stackchk/Makefile -termios/Makefile -]) -AC_OUTPUT diff --git a/testsuites/libtests/cpuuse/.cvsignore b/testsuites/libtests/cpuuse/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/libtests/cpuuse/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/libtests/cpuuse/Makefile.am b/testsuites/libtests/cpuuse/Makefile.am deleted file mode 100644 index 7e13f1beb9..0000000000 --- a/testsuites/libtests/cpuuse/Makefile.am +++ /dev/null @@ -1,42 +0,0 @@ -## -## $Id$ -## - - -TEST = cpuuse - -MANAGERS = io rate_monotonic - -C_FILES = init.c task1.c task2.c task3.c tswitch.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/libtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/libtests/cpuuse/cpuuse.scn b/testsuites/libtests/cpuuse/cpuuse.scn deleted file mode 100644 index b45cf91136..0000000000 --- a/testsuites/libtests/cpuuse/cpuuse.scn +++ /dev/null @@ -1,34 +0,0 @@ -*** CPU USAGE LIBRARY TEST *** -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 -TA1 - rtems_task_mode - change mode to NO RTEMS_PREEMPT -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 - 09:15:15 12/31/1988 -TA1 - rtems_task_mode - change mode to RTEMS_PREEMPT -TA1 - 09:15:00 12/31/1988 -TA2 - 09:15:04 12/31/1988 -TA3 - 09:15:05 12/31/1988 -TA1 - 09:15:06 12/31/1988 -TA2 - 09:15:07 12/31/1988 -TA3 - 09:15:08 12/31/1988 -TA1 - 09:15:09 12/31/1988 -TA2 - 09:15:16 12/31/1988 -CPU Usage by thread - ID NAME TICKS PERCENT -0x04010001 IDLE 0 0.000 -0x08010002 TA1 1203 0.748 -0x08010003 TA2 204 0.127 -0x08010004 TA3 202 0.126 - -Ticks since last reset = 1601 - -Total Units = 1609 -*** END OF CPU USAGE LIBRARY TEST *** -NOTE: Actual time per task will vary but there should be no IDLE time. diff --git a/testsuites/libtests/cpuuse/init.c b/testsuites/libtests/cpuuse/init.c deleted file mode 100644 index 3f7538ab92..0000000000 --- a/testsuites/libtests/cpuuse/init.c +++ /dev/null @@ -1,105 +0,0 @@ -/* - * This is a clone of sp04 which has been modified to use the cpu monitoring - * library. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.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*** CPU USAGE LIBRARY TEST ***" ); - 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, - RTEMS_MINIMUM_STACK_SIZE * 2, - RTEMS_TIMESLICE, - RTEMS_FLOATING_POINT, - &Task_id[ 1 ] - ); - directive_failed( status, "rtems_task_create of TA1" ); - - status = rtems_task_create( - Task_name[ 2 ], - 1, - RTEMS_MINIMUM_STACK_SIZE * 2, - RTEMS_TIMESLICE, - RTEMS_FLOATING_POINT, - &Task_id[ 2 ] - ); - directive_failed( status, "rtems_task_create of TA2" ); - - status = rtems_task_create( - Task_name[ 3 ], - 1, - RTEMS_MINIMUM_STACK_SIZE * 2, - RTEMS_TIMESLICE, - RTEMS_FLOATING_POINT, - &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/libtests/cpuuse/system.h b/testsuites/libtests/cpuuse/system.h deleted file mode 100644 index f99c6eb647..0000000000 --- a/testsuites/libtests/cpuuse/system.h +++ /dev/null @@ -1,81 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_task Task_1( - rtems_task_argument argument -); - -rtems_task Task_2( - rtems_task_argument argument -); - -rtems_task Task_3( - rtems_task_argument argument -); - -void Task_switch( - rtems_tcb *unused, - rtems_tcb *heir -); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_USER_EXTENSIONS 1 -#define CONFIGURE_MAXIMUM_TASKS 4 -#define CONFIGURE_TICKS_PER_TIMESLICE 100 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_EXTRA_TASK_STACKS (6 * RTEMS_MINIMUM_STACK_SIZE) - -#include - -/* global variables */ - -TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */ - -TEST_EXTERN rtems_id Extension_id[ 4 ]; -TEST_EXTERN rtems_name Extension_name[ 4 ]; /* array of task names */ - -/* array of task run counts */ -TEST_EXTERN volatile rtems_unsigned32 Run_count[ 4 ]; - -/* - * Keep track of task switches - */ - -struct taskSwitchLog { - int taskIndex; - rtems_time_of_day when; -}; - -extern struct taskSwitchLog taskSwitchLog[]; -extern int taskSwitchLogIndex; -volatile extern int testsFinished; - - -/* end of include file */ diff --git a/testsuites/libtests/cpuuse/task1.c b/testsuites/libtests/cpuuse/task1.c deleted file mode 100644 index 8819803f55..0000000000 --- a/testsuites/libtests/cpuuse/task1.c +++ /dev/null @@ -1,102 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.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_time; - rtems_unsigned32 end_time; - - 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_time ); - directive_failed( status, "rtems_clock_get" ); - - puts( "TA1 - killing time" ); - - for ( ; ; ) { - status = rtems_clock_get( RTEMS_CLOCK_GET_SECONDS_SINCE_EPOCH, &end_time ); - directive_failed( status, "rtems_clock_get" ); - - if ( end_time > (start_time + 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/libtests/cpuuse/task2.c b/testsuites/libtests/cpuuse/task2.c deleted file mode 100644 index 888ee8062e..0000000000 --- a/testsuites/libtests/cpuuse/task2.c +++ /dev/null @@ -1,47 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -#include - -static void -showTaskSwitches (void) -{ - int i; - int switches = taskSwitchLogIndex; - - for (i = 0 ; i < switches ; i++) { - put_name( Task_name[taskSwitchLog[i].taskIndex], FALSE ); - print_time( "- ", &taskSwitchLog[i].when, "\n" ); - } -} - -rtems_task Task_2( - rtems_task_argument argument -) -{ - while ( !testsFinished ); - - showTaskSwitches (); - CPU_usage_Dump(); - puts( "*** END OF CPU USAGE LIBRARY TEST ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/libtests/cpuuse/task3.c b/testsuites/libtests/cpuuse/task3.c deleted file mode 100644 index 829f52820f..0000000000 --- a/testsuites/libtests/cpuuse/task3.c +++ /dev/null @@ -1,28 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -rtems_task Task_3( - rtems_task_argument argument -) -{ - while( FOREVER ); -} diff --git a/testsuites/libtests/cpuuse/tswitch.c b/testsuites/libtests/cpuuse/tswitch.c deleted file mode 100644 index 56a53770a7..0000000000 --- a/testsuites/libtests/cpuuse/tswitch.c +++ /dev/null @@ -1,65 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -struct taskSwitchLog taskSwitchLog[1000]; -int taskSwitchLogIndex; -volatile int testsFinished;; - -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 ); - fatal_directive_status_with_level( status, RTEMS_SUCCESSFUL, - "rtems_clock_get", 1 ); - - if (taskSwitchLogIndex < - (sizeof taskSwitchLog / sizeof taskSwitchLog[0])) { - taskSwitchLog[taskSwitchLogIndex].taskIndex = index; - taskSwitchLog[taskSwitchLogIndex].when = time; - taskSwitchLogIndex++; - } - if ( time.second >= 16 ) - testsFinished = 1; - - break; - - case 0: - default: - break; - } -} diff --git a/testsuites/libtests/libtests.am b/testsuites/libtests/libtests.am deleted file mode 100644 index c17e0fac5f..0000000000 --- a/testsuites/libtests/libtests.am +++ /dev/null @@ -1,13 +0,0 @@ -## $Id$ - -project_bspdir=$(PROJECT_ROOT)/@RTEMS_BSP@ - -$(project_bspdir)/tests: - @$(mkinstalldirs) $@ - -$(project_bspdir)/tests/$(TEST)$(LIB_VARIANT).exe: $(PGM) - $(INSTALL_PROGRAM) $< $@ - -TMPINSTALL_FILES = \ -$(project_bspdir)/tests \ -$(project_bspdir)/tests/$(TEST)$(LIB_VARIANT).exe diff --git a/testsuites/libtests/malloctest/.cvsignore b/testsuites/libtests/malloctest/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/libtests/malloctest/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/libtests/malloctest/Makefile.am b/testsuites/libtests/malloctest/Makefile.am deleted file mode 100644 index d9ea742c9e..0000000000 --- a/testsuites/libtests/malloctest/Makefile.am +++ /dev/null @@ -1,42 +0,0 @@ -## -## $Id$ -## - - -TEST = malloctest - -MANAGERS = io - -C_FILES = init.c task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES) -OBJS = $(C_O_FILES) $(CC_O_FILES) $(S_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/libtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/libtests/malloctest/init.c b/testsuites/libtests/malloctest/init.c deleted file mode 100644 index 5c54332ad5..0000000000 --- a/testsuites/libtests/malloctest/init.c +++ /dev/null @@ -1,113 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_time_of_day time; - rtems_status_code status; - - puts( "\n\n*** MALLOC TEST ***" ); - - 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', ' ' ); - Task_name[ 4 ] = rtems_build_name( 'T', 'A', '4', ' ' ); - Task_name[ 5 ] = rtems_build_name( 'T', 'A', '5', ' ' ); - - status = rtems_task_create( - Task_name[ 1 ], - 1, - TASK_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_FLOATING_POINT, - &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_FLOATING_POINT, - &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_FLOATING_POINT, - &Task_id[ 3 ] - ); - directive_failed( status, "rtems_task_create of TA3" ); - - status = rtems_task_create( - Task_name[ 4 ], - 1, - TASK_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_FLOATING_POINT, - &Task_id[ 4 ] - ); - directive_failed( status, "rtems_task_create of TA4" ); - - status = rtems_task_create( - Task_name[ 5 ], - 1, - TASK_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_FLOATING_POINT, - &Task_id[ 5 ] - ); - directive_failed( status, "rtems_task_create of TA5" ); - - status = rtems_task_start( Task_id[ 1 ], Task_1_through_5, 0 ); - directive_failed( status, "rtems_task_start of TA1" ); - - status = rtems_task_start( Task_id[ 2 ], Task_1_through_5, 0 ); - directive_failed( status, "rtems_task_start of TA2" ); - - status = rtems_task_start( Task_id[ 3 ], Task_1_through_5, 0 ); - directive_failed( status, "rtems_task_start of TA3" ); - - status = rtems_task_start( Task_id[ 4 ], Task_1_through_5, 0 ); - directive_failed( status, "rtems_task_start of TA4" ); - - status = rtems_task_start( Task_id[ 5 ], Task_1_through_5, 0 ); - directive_failed( status, "rtems_task_start of TA5" ); - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} diff --git a/testsuites/libtests/malloctest/malloctest.scn b/testsuites/libtests/malloctest/malloctest.scn deleted file mode 100644 index 1e75d9a8f7..0000000000 --- a/testsuites/libtests/malloctest/malloctest.scn +++ /dev/null @@ -1,468 +0,0 @@ -*** MALLOC TEST *** -TA1 - rtems_clock_get - 09:00:00 12/31/1988 -mallocing 513 bytes -TA2 - rtems_clock_get - 09:00:00 12/31/1988 -mallocing 513 bytes -TA3 - rtems_clock_get - 09:00:00 12/31/1988 -mallocing 513 bytes -TA4 - rtems_clock_get - 09:00:00 12/31/1988 -mallocing 513 bytes -TA5 - rtems_clock_get - 09:00:00 12/31/1988 -mallocing 513 bytes -TA1 - rtems_clock_get - 09:00:00 12/31/1988 -mallocing 175 bytes -TA2 - rtems_clock_get - 09:00:00 12/31/1988 -mallocing 175 bytes -TA1 - rtems_clock_get - 09:00:00 12/31/1988 -mallocing 308 bytes -TA3 - rtems_clock_get - 09:00:00 12/31/1988 -mallocing 175 bytes -TA1 - rtems_clock_get - 09:00:00 12/31/1988 -mallocing 534 bytes -TA2 - rtems_clock_get - 09:00:01 12/31/1988 -mallocing 308 bytes -TA4 - rtems_clock_get - 09:00:01 12/31/1988 -mallocing 175 bytes -TA1 - rtems_clock_get - 09:00:01 12/31/1988 -mallocing 947 bytes -TA5 - rtems_clock_get - 09:00:01 12/31/1988 -mallocing 175 bytes -TA1 - rtems_clock_get - 09:00:01 12/31/1988 -mallocing 171 bytes -TA2 - rtems_clock_get - 09:00:01 12/31/1988 -mallocing 534 bytes -TA3 - rtems_clock_get - 09:00:01 12/31/1988 -mallocing 308 bytes -TA1 - rtems_clock_get - 09:00:01 12/31/1988 -mallocing 702 bytes -TA1 - rtems_clock_get - 09:00:01 12/31/1988 -mallocing 226 bytes -TA2 - rtems_clock_get - 09:00:02 12/31/1988 -mallocing 947 bytes -TA4 - rtems_clock_get - 09:00:02 12/31/1988 -mallocing 308 bytes -TA1 - rtems_clock_get - 09:00:02 12/31/1988 -mallocing 494 bytes -TA3 - rtems_clock_get - 09:00:02 12/31/1988 -mallocing 534 bytes -TA1 - rtems_clock_get - 09:00:02 12/31/1988 -mallocing 124 bytes -TA2 - rtems_clock_get - 09:00:02 12/31/1988 -mallocing 171 bytes -TA5 - rtems_clock_get - 09:00:02 12/31/1988 -mallocing 308 bytes -TA1 - rtems_clock_get - 09:00:02 12/31/1988 -mallocing 83 bytes -TA1 - rtems_clock_get - 09:00:02 12/31/1988 -mallocing 389 bytes -TA2 - rtems_clock_get - 09:00:03 12/31/1988 -mallocing 702 bytes -TA4 - rtems_clock_get - 09:00:03 12/31/1988 -mallocing 534 bytes -TA3 - rtems_clock_get - 09:00:03 12/31/1988 -mallocing 947 bytes -TA1 - rtems_clock_get - 09:00:03 12/31/1988 -mallocing 277 bytes -TA1 - rtems_clock_get - 09:00:03 12/31/1988 -mallocing 368 bytes -TA2 - rtems_clock_get - 09:00:03 12/31/1988 -mallocing 226 bytes -TA1 - rtems_clock_get - 09:00:03 12/31/1988 -mallocing 983 bytes -TA5 - rtems_clock_get - 09:00:03 12/31/1988 -mallocing 534 bytes -TA3 - rtems_clock_get - 09:00:03 12/31/1988 -mallocing 171 bytes -TA1 - rtems_clock_get - 09:00:03 12/31/1988 -mallocing 535 bytes -TA2 - rtems_clock_get - 09:00:04 12/31/1988 -mallocing 494 bytes -TA4 - rtems_clock_get - 09:00:04 12/31/1988 -mallocing 947 bytes -TA1 - rtems_clock_get - 09:00:04 12/31/1988 -mallocing 765 bytes -TA1 - rtems_clock_get - 09:00:04 12/31/1988 -mallocing 646 bytes -TA2 - rtems_clock_get - 09:00:04 12/31/1988 -mallocing 124 bytes -TA3 - rtems_clock_get - 09:00:04 12/31/1988 -mallocing 702 bytes -TA1 - rtems_clock_get - 09:00:04 12/31/1988 -mallocing 767 bytes -TA1 - rtems_clock_get - 09:00:04 12/31/1988 -mallocing 780 bytes -TA2 - rtems_clock_get - 09:00:05 12/31/1988 -mallocing 83 bytes -TA4 - rtems_clock_get - 09:00:05 12/31/1988 -mallocing 171 bytes -TA5 - rtems_clock_get - 09:00:05 12/31/1988 -mallocing 947 bytes -TA1 - rtems_clock_get - 09:00:05 12/31/1988 -mallocing 822 bytes -TA3 - rtems_clock_get - 09:00:05 12/31/1988 -mallocing 226 bytes -TA1 - rtems_clock_get - 09:00:05 12/31/1988 -mallocing 151 bytes -TA2 - rtems_clock_get - 09:00:05 12/31/1988 -mallocing 389 bytes -TA1 - rtems_clock_get - 09:00:05 12/31/1988 -mallocing 625 bytes -TA1 - rtems_clock_get - 09:00:05 12/31/1988 -mallocing 314 bytes -TA2 - rtems_clock_get - 09:00:06 12/31/1988 -mallocing 277 bytes -TA4 - rtems_clock_get - 09:00:06 12/31/1988 -mallocing 702 bytes -TA3 - rtems_clock_get - 09:00:06 12/31/1988 -mallocing 494 bytes -TA1 - rtems_clock_get - 09:00:06 12/31/1988 -mallocing 346 bytes -TA5 - rtems_clock_get - 09:00:06 12/31/1988 -mallocing 171 bytes -TA1 - rtems_clock_get - 09:00:06 12/31/1988 -mallocing 917 bytes -TA2 - rtems_clock_get - 09:00:06 12/31/1988 -mallocing 368 bytes -TA1 - rtems_clock_get - 09:00:06 12/31/1988 -mallocing 519 bytes -TA3 - rtems_clock_get - 09:00:06 12/31/1988 -mallocing 124 bytes -TA1 - rtems_clock_get - 09:00:06 12/31/1988 -mallocing 401 bytes -TA2 - rtems_clock_get - 09:00:07 12/31/1988 -mallocing 983 bytes -TA4 - rtems_clock_get - 09:00:07 12/31/1988 -mallocing 226 bytes -TA1 - rtems_clock_get - 09:00:07 12/31/1988 -mallocing 606 bytes -TA1 - rtems_clock_get - 09:00:07 12/31/1988 -mallocing 785 bytes -TA2 - rtems_clock_get - 09:00:07 12/31/1988 -mallocing 535 bytes -TA5 - rtems_clock_get - 09:00:07 12/31/1988 -mallocing 702 bytes -TA3 - rtems_clock_get - 09:00:07 12/31/1988 -mallocing 83 bytes -TA1 - rtems_clock_get - 09:00:07 12/31/1988 -mallocing 931 bytes -TA1 - rtems_clock_get - 09:00:07 12/31/1988 -mallocing 869 bytes -TA2 - rtems_clock_get - 09:00:08 12/31/1988 -mallocing 765 bytes -TA4 - rtems_clock_get - 09:00:08 12/31/1988 -mallocing 494 bytes -TA1 - rtems_clock_get - 09:00:08 12/31/1988 -mallocing 866 bytes -TA3 - rtems_clock_get - 09:00:08 12/31/1988 -mallocing 389 bytes -TA1 - rtems_clock_get - 09:00:08 12/31/1988 -mallocing 674 bytes -TA2 - rtems_clock_get - 09:00:08 12/31/1988 -mallocing 646 bytes -TA1 - rtems_clock_get - 09:00:08 12/31/1988 -mallocing 758 bytes -TA5 - rtems_clock_get - 09:00:08 12/31/1988 -mallocing 226 bytes -TA1 - rtems_clock_get - 09:00:08 12/31/1988 -mallocing 581 bytes -TA2 - rtems_clock_get - 09:00:09 12/31/1988 -mallocing 767 bytes -TA4 - rtems_clock_get - 09:00:09 12/31/1988 -mallocing 124 bytes -TA3 - rtems_clock_get - 09:00:09 12/31/1988 -mallocing 277 bytes -TA1 - rtems_clock_get - 09:00:09 12/31/1988 -mallocing 389 bytes -TA1 - rtems_clock_get - 09:00:09 12/31/1988 -mallocing 355 bytes -TA2 - rtems_clock_get - 09:00:09 12/31/1988 -mallocing 780 bytes -TA1 - rtems_clock_get - 09:00:09 12/31/1988 -mallocing 200 bytes -TA3 - rtems_clock_get - 09:00:09 12/31/1988 -mallocing 368 bytes -TA1 - rtems_clock_get - 09:00:09 12/31/1988 -mallocing 826 bytes -TA2 - rtems_clock_get - 09:00:10 12/31/1988 -mallocing 822 bytes -TA4 - rtems_clock_get - 09:00:10 12/31/1988 -mallocing 83 bytes -TA5 - rtems_clock_get - 09:00:10 12/31/1988 -mallocing 494 bytes -TA1 - rtems_clock_get - 09:00:10 12/31/1988 -mallocing 415 bytes -TA1 - rtems_clock_get - 09:00:10 12/31/1988 -mallocing 463 bytes -TA2 - rtems_clock_get - 09:00:10 12/31/1988 -mallocing 151 bytes -TA3 - rtems_clock_get - 09:00:10 12/31/1988 -mallocing 983 bytes -TA1 - rtems_clock_get - 09:00:10 12/31/1988 -mallocing 979 bytes -TA1 - rtems_clock_get - 09:00:10 12/31/1988 -mallocing 126 bytes -TA2 - rtems_clock_get - 09:00:11 12/31/1988 -mallocing 625 bytes -TA4 - rtems_clock_get - 09:00:11 12/31/1988 -mallocing 389 bytes -TA1 - rtems_clock_get - 09:00:11 12/31/1988 -mallocing 212 bytes -TA5 - rtems_clock_get - 09:00:11 12/31/1988 -mallocing 124 bytes -TA3 - rtems_clock_get - 09:00:11 12/31/1988 -mallocing 535 bytes -TA1 - rtems_clock_get - 09:00:11 12/31/1988 -mallocing 958 bytes -TA2 - rtems_clock_get - 09:00:11 12/31/1988 -mallocing 314 bytes -TA1 - rtems_clock_get - 09:00:11 12/31/1988 -mallocing 737 bytes -TA1 - rtems_clock_get - 09:00:11 12/31/1988 -mallocing 409 bytes -TA2 - rtems_clock_get - 09:00:12 12/31/1988 -mallocing 346 bytes -TA4 - rtems_clock_get - 09:00:12 12/31/1988 -mallocing 277 bytes -TA3 - rtems_clock_get - 09:00:12 12/31/1988 -mallocing 765 bytes -TA1 - rtems_clock_get - 09:00:12 12/31/1988 -mallocing 780 bytes -TA1 - rtems_clock_get - 09:00:12 12/31/1988 -mallocing 757 bytes -TA2 - rtems_clock_get - 09:00:12 12/31/1988 -mallocing 917 bytes -TA5 - rtems_clock_get - 09:00:12 12/31/1988 -mallocing 83 bytes -TA1 - rtems_clock_get - 09:00:12 12/31/1988 -mallocing 956 bytes -TA3 - rtems_clock_get - 09:00:12 12/31/1988 -mallocing 646 bytes -TA1 - rtems_clock_get - 09:00:12 12/31/1988 -mallocing 28 bytes -TA2 - rtems_clock_get - 09:00:13 12/31/1988 -mallocing 519 bytes -TA4 - rtems_clock_get - 09:00:13 12/31/1988 -mallocing 368 bytes -TA1 - rtems_clock_get - 09:00:13 12/31/1988 -mallocing 318 bytes -TA1 - rtems_clock_get - 09:00:13 12/31/1988 -mallocing 756 bytes -TA2 - rtems_clock_get - 09:00:13 12/31/1988 -mallocing 401 bytes -TA3 - rtems_clock_get - 09:00:13 12/31/1988 -mallocing 767 bytes -TA1 - rtems_clock_get - 09:00:13 12/31/1988 -mallocing 242 bytes -TA5 - rtems_clock_get - 09:00:13 12/31/1988 -mallocing 389 bytes -TA1 - rtems_clock_get - 09:00:13 12/31/1988 -mallocing 589 bytes -TA2 - rtems_clock_get - 09:00:14 12/31/1988 -mallocing 606 bytes -TA4 - rtems_clock_get - 09:00:14 12/31/1988 -mallocing 983 bytes -TA1 - rtems_clock_get - 09:00:14 12/31/1988 -mallocing 43 bytes -TA3 - rtems_clock_get - 09:00:14 12/31/1988 -mallocing 780 bytes -TA1 - rtems_clock_get - 09:00:14 12/31/1988 -mallocing 956 bytes -TA2 - rtems_clock_get - 09:00:14 12/31/1988 -mallocing 785 bytes -TA1 - rtems_clock_get - 09:00:14 12/31/1988 -mallocing 319 bytes -TA1 - rtems_clock_get - 09:00:14 12/31/1988 -mallocing 59 bytes -TA2 - rtems_clock_get - 09:00:15 12/31/1988 -mallocing 931 bytes -TA4 - rtems_clock_get - 09:00:15 12/31/1988 -mallocing 535 bytes -TA5 - rtems_clock_get - 09:00:15 12/31/1988 -mallocing 277 bytes -TA3 - rtems_clock_get - 09:00:15 12/31/1988 -mallocing 822 bytes -TA1 - rtems_clock_get - 09:00:15 12/31/1988 -mallocing 441 bytes -TA1 - rtems_clock_get - 09:00:15 12/31/1988 -mallocing 915 bytes -TA2 - rtems_clock_get - 09:00:15 12/31/1988 -mallocing 869 bytes -TA1 - rtems_clock_get - 09:00:15 12/31/1988 -mallocing 572 bytes -TA3 - rtems_clock_get - 09:00:15 12/31/1988 -mallocing 151 bytes -TA1 - rtems_clock_get - 09:00:15 12/31/1988 -mallocing 118 bytes -TA2 - rtems_clock_get - 09:00:16 12/31/1988 -mallocing 866 bytes -TA4 - rtems_clock_get - 09:00:16 12/31/1988 -mallocing 765 bytes -TA1 - rtems_clock_get - 09:00:16 12/31/1988 -mallocing 569 bytes -TA5 - rtems_clock_get - 09:00:16 12/31/1988 -mallocing 368 bytes -TA1 - rtems_clock_get - 09:00:16 12/31/1988 -mallocing 252 bytes -TA2 - rtems_clock_get - 09:00:16 12/31/1988 -mallocing 674 bytes -TA3 - rtems_clock_get - 09:00:16 12/31/1988 -mallocing 625 bytes -TA1 - rtems_clock_get - 09:00:16 12/31/1988 -mallocing 495 bytes -TA1 - rtems_clock_get - 09:00:16 12/31/1988 -mallocing 236 bytes -TA2 - rtems_clock_get - 09:00:17 12/31/1988 -mallocing 758 bytes -TA4 - rtems_clock_get - 09:00:17 12/31/1988 -mallocing 646 bytes -TA1 - rtems_clock_get - 09:00:17 12/31/1988 -mallocing 476 bytes -TA3 - rtems_clock_get - 09:00:17 12/31/1988 -mallocing 314 bytes -TA1 - rtems_clock_get - 09:00:17 12/31/1988 -mallocing 406 bytes -TA2 - rtems_clock_get - 09:00:17 12/31/1988 -mallocing 581 bytes -TA5 - rtems_clock_get - 09:00:17 12/31/1988 -mallocing 983 bytes -TA1 - rtems_clock_get - 09:00:17 12/31/1988 -mallocing 872 bytes -TA1 - rtems_clock_get - 09:00:17 12/31/1988 -mallocing 426 bytes -TA2 - rtems_clock_get - 09:00:18 12/31/1988 -mallocing 389 bytes -TA4 - rtems_clock_get - 09:00:18 12/31/1988 -mallocing 767 bytes -TA3 - rtems_clock_get - 09:00:18 12/31/1988 -mallocing 346 bytes -TA1 - rtems_clock_get - 09:00:18 12/31/1988 -mallocing 358 bytes -TA1 - rtems_clock_get - 09:00:18 12/31/1988 -mallocing 381 bytes -TA2 - rtems_clock_get - 09:00:18 12/31/1988 -mallocing 355 bytes -TA1 - rtems_clock_get - 09:00:18 12/31/1988 -mallocing 43 bytes -TA5 - rtems_clock_get - 09:00:18 12/31/1988 -mallocing 535 bytes -TA3 - rtems_clock_get - 09:00:18 12/31/1988 -mallocing 917 bytes -TA1 - rtems_clock_get - 09:00:18 12/31/1988 -mallocing 160 bytes -TA2 - rtems_clock_get - 09:00:19 12/31/1988 -mallocing 200 bytes -TA4 - rtems_clock_get - 09:00:19 12/31/1988 -mallocing 780 bytes -TA1 - rtems_clock_get - 09:00:19 12/31/1988 -mallocing 522 bytes -TA1 - rtems_clock_get - 09:00:19 12/31/1988 -mallocing 696 bytes -TA2 - rtems_clock_get - 09:00:19 12/31/1988 -mallocing 826 bytes -TA3 - rtems_clock_get - 09:00:19 12/31/1988 -mallocing 519 bytes -TA1 - rtems_clock_get - 09:00:19 12/31/1988 -mallocing 97 bytes -TA1 - rtems_clock_get - 09:00:19 12/31/1988 -mallocing 400 bytes -TA2 - rtems_clock_get - 09:00:20 12/31/1988 -mallocing 415 bytes -TA4 - rtems_clock_get - 09:00:20 12/31/1988 -mallocing 822 bytes -TA5 - rtems_clock_get - 09:00:20 12/31/1988 -mallocing 765 bytes -TA1 - rtems_clock_get - 09:00:20 12/31/1988 -mallocing 773 bytes -TA3 - rtems_clock_get - 09:00:20 12/31/1988 -mallocing 401 bytes -TA1 - rtems_clock_get - 09:00:20 12/31/1988 -mallocing 244 bytes -TA2 - rtems_clock_get - 09:00:20 12/31/1988 -mallocing 463 bytes -TA1 - rtems_clock_get - 09:00:20 12/31/1988 -mallocing 342 bytes -TA1 - rtems_clock_get - 09:00:20 12/31/1988 -mallocing 229 bytes -TA2 - rtems_clock_get - 09:00:21 12/31/1988 -mallocing 979 bytes -TA4 - rtems_clock_get - 09:00:21 12/31/1988 -mallocing 151 bytes -TA3 - rtems_clock_get - 09:00:21 12/31/1988 -mallocing 606 bytes -TA1 - rtems_clock_get - 09:00:21 12/31/1988 -mallocing 297 bytes -TA5 - rtems_clock_get - 09:00:21 12/31/1988 -mallocing 646 bytes -TA1 - rtems_clock_get - 09:00:21 12/31/1988 -mallocing 304 bytes -TA2 - rtems_clock_get - 09:00:21 12/31/1988 -mallocing 126 bytes -TA1 - rtems_clock_get - 09:00:21 12/31/1988 -mallocing 887 bytes -TA3 - rtems_clock_get - 09:00:21 12/31/1988 -mallocing 785 bytes -TA1 - rtems_clock_get - 09:00:21 12/31/1988 -mallocing 36 bytes -TA2 - rtems_clock_get - 09:00:22 12/31/1988 -mallocing 212 bytes -TA4 - rtems_clock_get - 09:00:22 12/31/1988 -mallocing 625 bytes -TA1 - rtems_clock_get - 09:00:22 12/31/1988 -mallocing 651 bytes -TA1 - rtems_clock_get - 09:00:22 12/31/1988 -mallocing 398 bytes -TA2 - rtems_clock_get - 09:00:22 12/31/1988 -mallocing 958 bytes -TA5 - rtems_clock_get - 09:00:22 12/31/1988 -mallocing 767 bytes -TA3 - rtems_clock_get - 09:00:22 12/31/1988 -mallocing 931 bytes -TA1 - rtems_clock_get - 09:00:22 12/31/1988 -mallocing 676 bytes -TA1 - rtems_clock_get - 09:00:22 12/31/1988 -mallocing 732 bytes -TA2 - rtems_clock_get - 09:00:23 12/31/1988 -mallocing 737 bytes -TA4 - rtems_clock_get - 09:00:23 12/31/1988 -mallocing 314 bytes -TA1 - rtems_clock_get - 09:00:23 12/31/1988 -mallocing 937 bytes -TA3 - rtems_clock_get - 09:00:23 12/31/1988 -mallocing 869 bytes -TA1 - rtems_clock_get - 09:00:23 12/31/1988 -mallocing 233 bytes -TA2 - rtems_clock_get - 09:00:23 12/31/1988 -mallocing 409 bytes -TA1 - rtems_clock_get - 09:00:23 12/31/1988 -mallocing 838 bytes -TA5 - rtems_clock_get - 09:00:23 12/31/1988 -mallocing 780 bytes -TA1 - rtems_clock_get - 09:00:23 12/31/1988 -mallocing 967 bytes -TA2 - rtems_clock_get - 09:00:24 12/31/1988 -mallocing 780 bytes -TA4 - rtems_clock_get - 09:00:24 12/31/1988 -mallocing 346 bytes -TA3 - rtems_clock_get - 09:00:24 12/31/1988 -mallocing 866 bytes -TA1 - rtems_clock_get - 09:00:24 12/31/1988 -mallocing 778 bytes -TA1 - rtems_clock_get - 09:00:24 12/31/1988 -mallocing 431 bytes -TA2 - rtems_clock_get - 09:00:24 12/31/1988 -mallocing 757 bytes -TA1 - rtems_clock_get - 09:00:24 12/31/1988 -mallocing 674 bytes -TA3 - rtems_clock_get - 09:00:24 12/31/1988 -mallocing 674 bytes -TA1 - rtems_clock_get - 09:00:24 12/31/1988 -mallocing 809 bytes -TA2 - rtems_clock_get - 09:00:25 12/31/1988 -mallocing 956 bytes -TA4 - rtems_clock_get - 09:00:25 12/31/1988 -mallocing 917 bytes -TA5 - rtems_clock_get - 09:00:25 12/31/1988 -mallocing 822 bytes -TA1 - rtems_clock_get - 09:00:25 12/31/1988 -mallocing 158 bytes -*** END OF MALLOC TEST *** diff --git a/testsuites/libtests/malloctest/system.h b/testsuites/libtests/malloctest/system.h deleted file mode 100644 index c275d9ce7d..0000000000 --- a/testsuites/libtests/malloctest/system.h +++ /dev/null @@ -1,51 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* macros */ - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_task Task_1_through_5( - rtems_task_argument argument -); - -void blow_stack( void ); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define TASK_STACK_SIZE (RTEMS_MINIMUM_STACK_SIZE*3) - -#define CONFIGURE_EXTRA_TASK_STACKS ((RTEMS_MINIMUM_STACK_SIZE*2)*5) -#define CONFIGURE_MAXIMUM_TASKS 6 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* global variables */ - -TEST_EXTERN rtems_id Task_id[ 6 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 6 ]; /* array of task names */ - -/* end of include file */ diff --git a/testsuites/libtests/malloctest/task1.c b/testsuites/libtests/malloctest/task1.c deleted file mode 100644 index 0b21c6adec..0000000000 --- a/testsuites/libtests/malloctest/task1.c +++ /dev/null @@ -1,72 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" -#include /* for malloc_dump, malloc_walk */ -#include /* for memset */ -#include - -#define NUM_PASSES 100 - -rtems_task Task_1_through_5( - rtems_task_argument argument -) -{ - int i; - unsigned int passes = 0; - rtems_id tid; - rtems_time_of_day time; - rtems_status_code status; - unsigned char *mem_ptr; - int mem_amt; - - status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid ); - directive_failed( status, "rtems_task_ident" ); - - while (TRUE) - { - if ( passes++ > NUM_PASSES ) { - puts("*** END OF MALLOC TEST ***"); - rtems_test_exit(0); - } - - 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" ); - - mem_amt = ((int)((float)rand()*1000.0/(float)RAND_MAX)); - while (!(mem_ptr = malloc ( mem_amt))) { - printf("out of memory... trying again.\n"); - mem_amt = ((int)((float)rand()*1000.0/(float)RAND_MAX)); - } - printf("mallocing %d bytes\n",mem_amt); - memset( mem_ptr, mem_amt, mem_amt ); - malloc_dump(); - malloc_walk(1,FALSE); - status = rtems_task_wake_after( task_number( tid ) * 1 * TICKS_PER_SECOND/4 ); - for (i=0; i < mem_amt; i++) - { - if ( mem_ptr[i] != (mem_amt & 0xff)) - { - printf("failed %d, %d, 0x%x, 0x%x\n",i,mem_amt,mem_ptr[i],mem_amt&0xff); - rtems_test_exit(1); - } - } - directive_failed( status, "rtems_task_wake_after" ); - free( mem_ptr ); - } -} diff --git a/testsuites/libtests/monitor/.cvsignore b/testsuites/libtests/monitor/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/libtests/monitor/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/libtests/monitor/Makefile.am b/testsuites/libtests/monitor/Makefile.am deleted file mode 100644 index 6d058c7359..0000000000 --- a/testsuites/libtests/monitor/Makefile.am +++ /dev/null @@ -1,43 +0,0 @@ -## -## $Id$ -## - - -TEST = monitor - -MANAGERS = dpmem event io msg mp part region sem signal timer rate_monotonic \ - ext - -C_FILES = init.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn -DOCS = #$(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/libtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/libtests/monitor/init.c b/testsuites/libtests/monitor/init.c deleted file mode 100644 index 2d62df856f..0000000000 --- a/testsuites/libtests/monitor/init.c +++ /dev/null @@ -1,73 +0,0 @@ -/* - * This is a simple test whose only purpose is to start the Monitor - * task. The Monitor task can be used to obtain information about - * a variety of RTEMS objects. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -#include - -rtems_task_priority Priorities[6] = { 0, 1, 1, 3, 4, 5 }; - -rtems_task Task_1_through_5( - rtems_unsigned32 argument -) -{ - rtems_status_code status; - - for ( ; ; ) { - status = rtems_task_wake_after( 100 ); - directive_failed( status, "rtems_task_wake_after" ); - } -} - - - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_unsigned32 index; - rtems_status_code status; - - puts( "\n\n*** MONITOR TASK TEST ***" ); - - 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', ' ' ); - - for ( index = 1 ; index <= 5 ; index++ ) { - status = rtems_task_create( - Task_name[ index ], - Priorities[ index ], - RTEMS_MINIMUM_STACK_SIZE * 4, - RTEMS_DEFAULT_MODES, - (index == 5) ? RTEMS_FLOATING_POINT : RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ index ] - ); - directive_failed( status, "rtems_task_create loop" ); - } - - for ( index = 1 ; index <= 5 ; index++ ) { - status = rtems_task_start( Task_id[ index ], Task_1_through_5, index ); - directive_failed( status, "rtems_task_start loop" ); - } - - rtems_monitor_init( 0 ); - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} diff --git a/testsuites/libtests/monitor/system.h b/testsuites/libtests/monitor/system.h deleted file mode 100644 index a3a538f584..0000000000 --- a/testsuites/libtests/monitor/system.h +++ /dev/null @@ -1,59 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* types */ - -struct counters { - rtems_unsigned32 count[6]; -}; - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_task Task_1_through_5( - rtems_task_argument argument -); - -void Get_all_counters( void ); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 7 -#define CONFIGURE_MAXIMUM_PERIODS 10 - -#define CONFIGURE_INIT_TASK_PRIORITY 10 -#define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_DEFAULT_MODES -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_EXTRA_TASK_STACKS \ - (6 * (3 * RTEMS_MINIMUM_STACK_SIZE)) /* our tasks */ + \ - (1 * RTEMS_MINIMUM_STACK_SIZE) /* monitor tasks */ - -#include - -/* global variables */ - -TEST_EXTERN rtems_id Task_id[ 6 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 6 ]; /* array of task names */ - -/* end of include file */ diff --git a/testsuites/libtests/putenvtest/.cvsignore b/testsuites/libtests/putenvtest/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/libtests/putenvtest/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/libtests/putenvtest/Makefile.am b/testsuites/libtests/putenvtest/Makefile.am deleted file mode 100644 index a266ed7991..0000000000 --- a/testsuites/libtests/putenvtest/Makefile.am +++ /dev/null @@ -1,42 +0,0 @@ -## -## $Id$ -## - - -TEST = putenvtest - -MANAGERS = io - -C_FILES = init.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = -noinst_HEADERS = $(H_FILES) - -DOCTYPES = -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES) -OBJS = $(C_O_FILES) $(CC_O_FILES) $(S_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/libtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/libtests/putenvtest/init.c b/testsuites/libtests/putenvtest/init.c deleted file mode 100644 index 15061265c2..0000000000 --- a/testsuites/libtests/putenvtest/init.c +++ /dev/null @@ -1,61 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include -#include -#include - -/* putenv is beyond ANSI so prototype it here */ -int putenv(const char *string); - -rtems_task Init( - rtems_task_argument argument -); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define TASK_STACK_SIZE (RTEMS_MINIMUM_STACK_SIZE*3) - -#define CONFIGURE_MAXIMUM_TASKS 1 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -rtems_task Init( - rtems_task_argument argument -) -{ - puts( "\n\n*** PUTENV/GETENV TEST ***" ); - - puts( "putenv(\"FOO=BAR\") - expected to work" ); - putenv ("FOO=BAR"); - printf ("getenv(\"FOO\") ==> \"%s\"\n", getenv ("FOO")); - - puts( "*** END OF PUTENV/GETENV TEST ***" ); - rtems_test_exit(0); -} diff --git a/testsuites/libtests/rtems++/.cvsignore b/testsuites/libtests/rtems++/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/libtests/rtems++/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/libtests/rtems++/Init.cc b/testsuites/libtests/rtems++/Init.cc deleted file mode 100644 index b1d14efa68..0000000000 --- a/testsuites/libtests/rtems++/Init.cc +++ /dev/null @@ -1,62 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1997 - * Objective Design Systems Ltd Pty (ODS) - * All rights reserved (R) Objective Design Systems Ltd Pty - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "System.h" - -// make global so it lasts past the Init task's stack's life time -Task1 task_1; - -rtems_task Init(rtems_task_argument ) -{ - puts( "\n\n*** RTEMS++ TEST ***" ); - - printf( "INIT - Task.create() - " ); - task_1.create("TA1 ", 0, RTEMS_MINIMUM_STACK_SIZE); - printf("%s\n", task_1.last_status_string()); - - printf( "INIT - Task.create() - " ); - task_1.create("TA1 ", 10, RTEMS_MINIMUM_STACK_SIZE * 6); - printf("%s\n", task_1.last_status_string()); - - printf( "INIT - Task.create() - " ); - task_1.create("TA1 ", 10, RTEMS_MINIMUM_STACK_SIZE * 6); - printf("%s\n", task_1.last_status_string()); - - printf( "INIT - Task.restart() - " ); - task_1.restart(0); - printf("%s\n", task_1.last_status_string()); - - printf( "INIT - Task.start(0xDEADDEAD) - " ); - task_1.start(0xDEADDEAD); - printf("%s\n", task_1.last_status_string()); - - printf("INIT - Destroy it's self\n"); - - // needs to be in C, no C++ object owns the Init task - rtems_status_code status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} - - - diff --git a/testsuites/libtests/rtems++/Makefile.am b/testsuites/libtests/rtems++/Makefile.am deleted file mode 100644 index abddb9ee00..0000000000 --- a/testsuites/libtests/rtems++/Makefile.am +++ /dev/null @@ -1,48 +0,0 @@ -## -## $Id$ -## - - -TEST = rtems++ - -MANAGERS = event io msg sem signal timer rate_monotonic - -CC_FILES = Init.cc Task1.cc Task2.cc Task3.cc -OBJS = $(CC_FILES:%.cc=${ARCH}/%.$(OBJEXT)) - -H_FILES = System.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/libtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -LD_LIBS = -lrtems++$(LIB_VARIANT) - -if HAS_CXX - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-cxx-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) -else -all-local: -endif - -EXTRA_DIST = $(CC_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/libtests/rtems++/System.h b/testsuites/libtests/rtems++/System.h deleted file mode 100644 index 50d6ee13df..0000000000 --- a/testsuites/libtests/rtems++/System.h +++ /dev/null @@ -1,135 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include -#include -#include -#include - -/* functions */ - -extern "C" -{ - rtems_task Init( - rtems_task_argument argument - ); -} - -rtems_timer_service_routine Delayed_routine( - rtems_id ignored_id, - void *ignored_address -); - -class Task1 - : public rtemsTask -{ - void print_mode(rtems_mode mode, rtems_mode mask); - - void screen1(void); - void screen2(void); - void screen3(void); - void screen4(void); - void screen5(void); - void screen6(void); - -protected: - virtual void body(rtems_task_argument argument); - -public: -}; - -class Task2 - : public rtemsTask -{ - void screen4(void); - -protected: - virtual void body(rtems_task_argument argument); - -public: - Task2(const char* name, - const rtems_task_priority initial_priority, - const rtems_unsigned32 stack_size); -}; - -class Task3 - : public rtemsTask -{ - void screen6(void); - -protected: - virtual void body(rtems_task_argument argument); - -public: - Task3(const char* name, - const rtems_task_priority initial_priority, - const rtems_unsigned32 stack_size); -}; - -class EndTask - : public rtemsTask -{ -protected: - virtual void body(rtems_task_argument argument); - -public: - EndTask(const char* name, - const rtems_task_priority initial_priority, - const rtems_unsigned32 stack_size); -}; - -#if 0 - -// -// Not sure this can be tested in a generic manner, any ideas anyone !! -// - -class Service_routine - : public rtemsInterrupt -{ -}; - -class Io_during_interrupt - : pubic rtemsTimer -{ - -}; - -#endif - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 8 -#define CONFIGURE_MAXIMUM_TIMERS 1 -#define CONFIGURE_MAXIMUM_SEMAPHORES 2 -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 -#define CONFIGURE_MAXIMUM_PARTITIONS 1 -#define CONFIGURE_MAXIMUM_REGIONS 1 -#define CONFIGURE_MAXIMUM_PERIODS 1 -#define CONFIGURE_MAXIMUM_USER_EXTENSIONS 0 -#define CONFIGURE_TICKS_PER_TIMESLICE 100 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE -#define CONFIGURE_INIT_TASK_STACK_SIZE (4 * RTEMS_MINIMUM_STACK_SIZE) - -#define CONFIGURE_EXTRA_TASK_STACKS (3 * RTEMS_MINIMUM_STACK_SIZE) - -#include - -/* end of include file */ diff --git a/testsuites/libtests/rtems++/Task1.cc b/testsuites/libtests/rtems++/Task1.cc deleted file mode 100644 index 07d2179077..0000000000 --- a/testsuites/libtests/rtems++/Task1.cc +++ /dev/null @@ -1,681 +0,0 @@ -/* Task1 - * - * This task is the main line for the test. It creates other - * tasks which can create - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1997 - * Objective Design Systems Ltd Pty (ODS) - * All rights reserved (R) Objective Design Systems Ltd Pty - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include -#include "System.h" - -void Task1::body(rtems_task_argument argument) -{ - rtems_test_pause_and_screen_number(1); - - printf(" * START Task Class test *\n"); - - printf("%s - test argument - ", name_string()); - if (argument != 0xDEADDEAD) - printf("argument is not 0xDEADDEAD\n"); - else - printf("argument matched\n"); - - screen1(); - rtems_test_pause_and_screen_number(2); - - screen2(); - rtems_test_pause_and_screen_number(3); - - screen3(); - rtems_test_pause_and_screen_number(4); - - screen4(); - rtems_test_pause_and_screen_number(5); - - screen5(); - rtems_test_pause_and_screen_number(6); - - screen6(); - - // do not call exit(0) from this thread as this object is static - // the static destructor call delete the task which is calling exit - // so exit never completes - - EndTask end_task("ENDT", (rtems_task_priority) 1, RTEMS_MINIMUM_STACK_SIZE * 6); - end_task.start(0); - - rtemsEvent block_me; - rtems_event_set out; - - block_me.receive(RTEMS_SIGNAL_0, out); - - printf("**** TASK 1 did not block ????\n"); -} - -void Task1::screen1(void) -{ - // create two local task objects to connect to this task - rtemsTask local_task_1 = *this; - rtemsTask local_task_2; - - local_task_2 = *this; - - // check the copy constructor works - printf("%s - copy constructor - ", name_string()); - if (local_task_1.id_is() == id_is()) - printf("local and this id's match\n"); - else - printf("local and this id's do not match\n"); - - printf("%s - copy constructor - ", name_string()); - if (local_task_1.name_is() == name_is()) - printf("local and this name's match\n"); - else - printf("local and this name's do not match\n"); - - // check the copy operator works - printf("%s - copy operator - ", name_string()); - if (local_task_2.id_is() == id_is()) - printf("local and this id's match\n"); - else - printf("local and this id's do not match\n"); - printf("%s - copy operator - ", name_string()); - if (local_task_2.name_is() == name_is()) - printf("local and this name's match\n"); - else - printf("local and this name's do not match\n"); - - // check that the owner of the id cannot delete this task - printf("%s - not owner destroy's task - ", local_task_1.name_string()); - local_task_1.destroy(); - printf("%s\n", local_task_1.last_status_string()); - - // connect to a valid task - printf("%s - connect to a local valid task name - ", local_task_2.name_string()); - local_task_2.connect("TA1 ", RTEMS_SEARCH_ALL_NODES); - printf("%s\n", local_task_2.last_status_string()); - - // connect to an invalid task - printf("%s - connect to an invalid task name - ", local_task_2.name_string()); - local_task_2.connect("BADT", RTEMS_SEARCH_ALL_NODES); - printf("%s\n", local_task_2.last_status_string()); - - // connect to a task an invalid node - printf("%s - connect to a task on an invalid node - ", local_task_2.name_string()); - local_task_2.connect("BADT", 10); - printf("%s\n", local_task_2.last_status_string()); - - // restart this task - printf("%s - restart from a non-owner - ", name_string()); - local_task_1.restart(0); - printf("%s\n", local_task_1.last_status_string()); -} - -void Task1::screen2(void) -{ - // wake after using this object - - printf("%s - wake after 0 secs - ", name_string()); - wake_after(0); - printf("%s\n", last_status_string()); - - printf("%s - wake after 500 msecs - ", name_string()); - wake_after(500000); - printf("%s\n", last_status_string()); - - printf("%s - wake after 5 secs - ", name_string()); - wake_after(5000000); - printf("%s\n", last_status_string()); - - printf("%s - wake when - to do\n", name_string()); - - rtemsTask task_1 = *this; - - // wake after using a connected object - - printf("%s - connected object wake after 0 secs - ", task_1.name_string()); - task_1.wake_after(0); - printf("%s\n", task_1.last_status_string()); - - printf("%s - connected object wake after 500 msecs - ", task_1.name_string()); - task_1.wake_after(500000); - printf("%s\n", task_1.last_status_string()); - - printf("%s - connected object wake after 5 secs - ", task_1.name_string()); - task_1.wake_after(5000000); - printf("%s\n", task_1.last_status_string()); - - printf("%s - connected object wake when - to do\n", task_1.name_string()); - - rtemsTask task_2; - - // wake after using a self object - - printf("%s - self object wake after 0 secs - ", task_2.name_string()); - task_2.wake_after(0); - printf("%s\n", task_2.last_status_string()); - - printf("%s - self object wake after 500 msecs - ", task_2.name_string()); - task_2.wake_after(500000); - printf("%s\n", task_2.last_status_string()); - - printf("%s - self object wake after 5 secs - ", task_2.name_string()); - task_2.wake_after(5000000); - printf("%s\n", task_2.last_status_string()); - - printf("%s - self object wake when - to do\n", task_2.name_string()); - - rtems_task_priority current_priority; - rtems_task_priority priority; - - // priorities with this object - - printf("%s - get priority - ", name_string()); - get_priority(current_priority); - printf("%s, priority is %i\n", last_status_string(), current_priority); - - printf("%s - set priority to 512 - ", name_string()); - set_priority(512); - printf("%s\n", last_status_string()); - - printf("%s - set priority to 25 - ", name_string()); - set_priority(25); - printf("%s\n", last_status_string()); - - printf("%s - set priority to original - ", name_string()); - set_priority(current_priority, priority); - printf("%s, priority was %i\n", last_status_string(), priority); - - // priorities with connected object - - printf("%s - connected object get priority - ", task_1.name_string()); - task_1.get_priority(current_priority); - printf("%s, priority is %i\n", task_1.last_status_string(), current_priority); - - printf("%s - connected object set priority to 512 - ", task_1.name_string()); - task_1.set_priority(512); - printf("%s\n", task_1.last_status_string()); - - printf("%s - connected object set priority to 25 - ", task_1.name_string()); - task_1.set_priority(25); - printf("%s\n", task_1.last_status_string()); - - printf("%s - connected object set priority to original - ", task_1.name_string()); - task_1.set_priority(current_priority, priority); - printf("%s, priority was %i\n", task_1.last_status_string(), priority); - - // priorities with self object - - printf("%s - self object get priority - ", task_2.name_string()); - task_2.get_priority(current_priority); - printf("%s, priority is %i\n", task_2.last_status_string(), current_priority); - - printf("%s - self object set priority to 512 - ", task_2.name_string()); - task_2.set_priority(512); - printf("%s\n", task_2.last_status_string()); - - printf("%s - self object set priority to 25 - ", task_2.name_string()); - task_2.set_priority(25); - printf("%s\n", task_2.last_status_string()); - - printf("%s - self object set priority to original - ", task_2.name_string()); - task_2.set_priority(current_priority, priority); - printf("%s, priority was %i\n", task_2.last_status_string(), priority); - - rtems_unsigned32 current_note; - rtems_unsigned32 note; - - // notepad registers for this object - - printf("%s - get note - ", name_string()); - get_note(0, current_note); - printf("%s, note is %i\n", last_status_string(), current_note); - - printf("%s - get with bad notepad number - ", name_string()); - get_note(100, current_note); - printf("%s, note is %i\n", last_status_string(), current_note); - - printf("%s - set note to 0xDEADBEEF - ", name_string()); - set_note(0, 0xDEADBEEF); - printf("%s\n", last_status_string()); - - printf("%s - get note - ", name_string()); - get_note(0, note); - printf("%s, note is 0x%08X\n", last_status_string(), note); - - printf("%s - set note to original value - ", name_string()); - set_note(0, current_note); - printf("%s\n", last_status_string()); - - // notepad registers for connected object - - printf("%s - connected object get note - ", task_1.name_string()); - task_1.get_note(0, current_note); - printf("%s, notepad is %i\n", task_1.last_status_string(), current_note); - - printf("%s - connected object get with bad notepad number - ", task_1.name_string()); - task_1.get_note(100, current_note); - printf("%s, note is %i\n", task_1.last_status_string(), current_note); - - printf("%s - connected object set note to 0xDEADBEEF - ", task_1.name_string()); - task_1.set_note(0, 0xDEADBEEF); - printf("%s\n", task_1.last_status_string()); - - printf("%s - connected object get note - ", task_1.name_string()); - task_1.get_note(0, note); - printf("%s, note is 0x%08X\n", task_1.last_status_string(), note); - - printf("%s - connected object set note to original value - ", task_1.name_string()); - task_1.set_note(0, current_note); - printf("%s\n", task_1.last_status_string()); - - // notepad registers for self object - - printf("%s - self object get note - ", task_2.name_string()); - task_2.get_note(0, current_note); - printf("%s, note is %i\n", task_2.last_status_string(), current_note); - - printf("%s - self object get with bad notepad number - ", task_2.name_string()); - task_2.get_note(100, current_note); - printf("%s, note is %i\n", task_2.last_status_string(), current_note); - - printf("%s - self object set note to 0xDEADBEEF - ", task_2.name_string()); - task_2.set_note(0, 0xDEADBEEF); - printf("%s\n", task_2.last_status_string()); - - printf("%s - self object get note - ", task_2.name_string()); - task_2.get_note(0, note); - printf("%s, notepad is 0x%08X\n", task_2.last_status_string(), note); - - printf("%s - self object set note to original value - ", task_2.name_string()); - task_2.set_note(0, current_note); - printf("%s\n", task_2.last_status_string()); - - printf(" * END Task Class test *\n"); -} - -#define RTEMS_ALL_MODES (RTEMS_PREEMPT_MASK | \ - RTEMS_TIMESLICE_MASK | \ - RTEMS_ASR_MASK | \ - RTEMS_INTERRUPT_MASK) - -void Task1::screen3(void) -{ - printf(" * START TaskMode Class test *\n"); - - rtemsTask self; - rtemsTaskMode task_mode; - rtems_mode current_mode; - rtems_mode mode; - - printf("%s - get mode - ", self.name_string()); - task_mode.get_mode(current_mode); - printf("%s,\n\t mode is 0x%08X, ", task_mode.last_status_string(), current_mode); - print_mode(current_mode, RTEMS_ALL_MODES); - printf("\n"); - - // PREEMPTION mode control - - printf("%s - get preemption state - ", self.name_string()); - task_mode.get_preemption_state(mode); - printf("%s,\n\t mode is 0x%08X, ", task_mode.last_status_string(), mode); - print_mode(mode, RTEMS_PREEMPT_MASK); - printf("\n"); - - printf("%s - set preemption state to RTEMS_PREEMPT - ", self.name_string()); - task_mode.set_preemption_state(RTEMS_PREEMPT); - task_mode.get_mode(mode); - printf("%s,\n\t mode is 0x%08X, ", task_mode.last_status_string(), mode); - print_mode(mode, RTEMS_ALL_MODES); - printf("\n"); - - printf("%s - set preemption state to RTEMS_NO_PREEMPT - ", self.name_string()); - task_mode.set_preemption_state(RTEMS_NO_PREEMPT); - task_mode.get_mode(mode); - printf("%s,\n\t mode is 0x%08X, ", task_mode.last_status_string(), mode); - print_mode(mode, RTEMS_ALL_MODES); - printf("\n"); - - // TIMESLICE mode control - - printf("%s - get timeslice state - ", self.name_string()); - task_mode.get_timeslice_state(mode); - printf("%s,\n\t mode is 0x%08X, ", task_mode.last_status_string(), mode); - print_mode(mode, RTEMS_TIMESLICE_MASK); - printf("\n"); - - printf("%s - set timeslice state to RTEMS_TIMESLICE - ", self.name_string()); - task_mode.set_timeslice_state(RTEMS_TIMESLICE); - task_mode.get_mode(mode); - printf("%s,\n\t mode is 0x%08X, ", task_mode.last_status_string(), mode); - print_mode(mode, RTEMS_ALL_MODES); - printf("\n"); - - printf("%s - set timeslice state to RTEMS_NO_TIMESLICE - ", self.name_string()); - task_mode.set_timeslice_state(RTEMS_NO_TIMESLICE); - task_mode.get_mode(mode); - printf("%s,\n\t mode is 0x%08X, ", task_mode.last_status_string(), mode); - print_mode(mode, RTEMS_ALL_MODES); - printf("\n"); - - // ASR mode control - - printf("%s - get asr state - ", self.name_string()); - task_mode.get_asr_state(mode); - printf("%s,\n\t mode is 0x%08X, ", task_mode.last_status_string(), mode); - print_mode(mode, RTEMS_ASR_MASK); - printf("\n"); - - printf("%s - set asr state to RTEMS_ASR - ", self.name_string()); - task_mode.set_asr_state(RTEMS_ASR); - task_mode.get_mode(mode); - printf("%s,\n\t mode is 0x%08X, ", task_mode.last_status_string(), mode); - print_mode(mode, RTEMS_ALL_MODES); - printf("\n"); - - printf("%s - set asr state to RTEMS_NO_ASR - ", self.name_string()); - task_mode.set_asr_state(RTEMS_NO_ASR); - task_mode.get_mode(mode); - printf("%s,\n\t mode is 0x%08X, ", task_mode.last_status_string(), mode); - print_mode(mode, RTEMS_ALL_MODES); - printf("\n"); - - // interrupt level control - - rtems_interrupt_level current_level; - rtems_interrupt_level level; - - printf("%s - get current interrupt level - ", self.name_string()); - task_mode.get_interrupt_level(current_level); - printf("%s, level is %i\n", task_mode.last_status_string(), current_level); - - printf("%s - set interrupt level to 102 - ", self.name_string()); - task_mode.set_interrupt_level(102); - printf("%s\n", task_mode.last_status_string()); - - printf("%s - set interrupt level to original level - ", self.name_string()); - task_mode.set_interrupt_level(current_level, level); - printf("%s, level was %i\n", task_mode.last_status_string(), level); - - printf("%s - set mode to original mode - ", self.name_string()); - task_mode.set_mode(current_mode, - RTEMS_PREEMPT_MASK | RTEMS_TIMESLICE_MASK | - RTEMS_ASR_MASK | RTEMS_INTERRUPT_MASK); - task_mode.get_mode(mode); - printf("%s,\n\t mode is 0x%08X, ", task_mode.last_status_string(), mode); - print_mode(mode, RTEMS_ALL_MODES); - printf("\n"); - - printf(" * END TaskMode Class test *\n"); -} - -void Task1::screen4(void) -{ - printf(" * START Event Class test *\n"); - - printf("%s - create task 2 - ", name_string()); - Task2 task_2("TA2", (rtems_task_priority) 9, RTEMS_MINIMUM_STACK_SIZE * 6); - printf("%s\n", task_2.last_status_string()); - - printf("%s - start task 2 - ", name_string()); - task_2.start(0); - printf("%s\n", task_2.last_status_string()); - - printf("%s - construct event connecting to task 2 - ", name_string()); - rtemsEvent event_2("TA2 "); - printf("%s\n", event_2.last_status_string()); - - // wait for task 2 to complete its timeout tests - wake_after(7000000); - - printf("%s - send event signal 0 using the task id - ", name_string()); - event_2.send(task_2.id_is(), RTEMS_SIGNAL_0); - printf("%s\n", event_2.last_status_string()); - - wake_after(1000000); - - printf("%s - send event signal 0 using the task object reference - ", name_string()); - event_2.send(task_2, RTEMS_SIGNAL_0); - printf("%s\n", event_2.last_status_string()); - - wake_after(1000000); - - printf("%s - send event signal 31 using connected id - ", name_string()); - event_2.send(RTEMS_SIGNAL_31); - printf("%s\n", event_2.last_status_string()); - - wake_after(1000000); - - rtemsEvent event_2_2; - - event_2_2.connect("TA2"); - - printf("%s - send event signal 0 and 31 - ", name_string()); - event_2_2.send(task_2, RTEMS_SIGNAL_0 | RTEMS_SIGNAL_31); - printf("%s\n", event_2_2.last_status_string()); - - printf("%s - waiting 5 secs for TA2 to finish\n", name_string()); - wake_after(500000); - - printf(" * END Event Class test *\n"); -} - -void Task1::screen5(void) -{ - printf(" * START Interrupt Class test *\n"); - - printf(" do not know a portable BSP type interrupt test\n"); - - printf(" * END Interrupt Class test *\n"); -} - -void Task1::screen6(void) -{ - printf(" * START MessageQueue Class test *\n"); - - printf("%s - construct message queue 1 with no memory error - ", name_string()); - rtemsMessageQueue mq_1("MQ1", 1000000, 1000); - printf("%s\n", mq_1.last_status_string()); - - printf("%s - construct/create message queue 2 - ", name_string()); - rtemsMessageQueue mq_2("MQ2", 4, 50); - printf("%s\n", mq_2.last_status_string()); - - char *u1 = "normal send"; - char *u2 = "urgent send"; - char in[100]; - rtems_unsigned32 size; - - printf("%s - send u1 to mq_2 - ", name_string()); - mq_2.send(u1, strlen(u1) + 1); - printf("%s\n", mq_2.last_status_string()); - - printf("%s - urgent send u2 to mq_2 - ", name_string()); - mq_2.urgent(u2, strlen(u2) + 1); - printf("%s\n", mq_2.last_status_string()); - - printf("%s - create task 3_1 - ", name_string()); - Task3 task_3_1("TA31", 9, RTEMS_MINIMUM_STACK_SIZE * 6); - printf("%s\n", task_3_1.last_status_string()); - - printf("%s - start task 3_1 - ", name_string()); - task_3_1.start(0); - printf("%s\n", task_3_1.last_status_string()); - - printf("%s - create task 3_2 - ", name_string()); - Task3 task_3_2("TA32", 9, RTEMS_MINIMUM_STACK_SIZE * 6); - printf("%s\n", task_3_2.last_status_string()); - - printf("%s - start task 3_2 - ", name_string()); - task_3_2.start(0); - printf("%s\n", task_3_1.last_status_string()); - - wake_after(1000000); - - printf("%s - receive u2 on mq_2 ...\n", name_string()); fflush(stdout); - mq_2.receive(in, size, 5000000); - printf("%s - %s\n", name_string(), mq_2.last_status_string()); - - if (size == (strlen(u2) + 5)) - { - if ((strncmp(in, task_3_1.name_string(), 4) == 0) && - (strcmp(in + 4, u2) == 0)) - { - printf("%s - message u2 received correctly\n", name_string()); - } - else - { - printf("%s - message u2 received incorrectly, message='%s', size=%i\n", - name_string(), in, size); - } - } - else - printf("%s - message u2 size incorrect, size=%i\n", name_string(), size); - - printf("%s - receive u1 on mq_2 ...\n", name_string()); fflush(stdout); - mq_2.receive(in, size, 5000000); - printf("%s - %s\n", name_string(), mq_2.last_status_string()); - - if (size == (strlen(u1) + 5)) - { - if ((strncmp(in, task_3_2.name_string(), 4) == 0) && - (strcmp(in + 4, u1) == 0)) - { - printf("%s - message u1 received correctly\n", name_string()); - } - else - { - printf("%s - message u1 received incorrectly, message='%s', size=%i\n", - name_string(), in, size); - } - } - else - printf("%s - message u1 size incorrect, size=%i\n", name_string(), size); - - wake_after(3000000); - - char *b1 = "broadcast message"; - rtems_unsigned32 count; - - printf("%s - broadcast send b1 ...\n", name_string()); - mq_2.broadcast(b1, strlen(b1) + 1, count); - printf("%s - mq_2 broadcast send - %s, count=%i\n", - name_string(), mq_2.last_status_string(), count); - - wake_after(1000000); - - printf("%s - receive message b1 on mq_2 from %s...\n", - name_string(), task_3_1.name_string()); fflush(stdout); - mq_2.receive(in, size, 5000000); - printf("%s - %s\n", name_string(), mq_2.last_status_string()); - - if (size == (strlen(b1) + 5)) - { - if ((strncmp(in, task_3_1.name_string(), 4) == 0) && - (strcmp(in + 4, b1) == 0)) - { - printf("%s - message b1 received correctly\n", name_string()); - } - else - { - printf("%s - message b1 received incorrectly, message='%s'\n", - name_string(), in); - } - } - else - printf("%s - message b1 size incorrect, size=%i\n", name_string(), size); - - printf("%s - receive message b1 on mq_2 from %s...\n", - name_string(), task_3_1.name_string()); fflush(stdout); - mq_2.receive(in, size, 5000000); - printf("%s - %s\n", name_string(), mq_2.last_status_string()); - - if (size == (strlen(b1) + 5)) - { - if ((strncmp(in, task_3_2.name_string(), 4) == 0) && - (strcmp(in + 4, b1) == 0)) - { - printf("%s - message b1 received correctly\n", name_string()); - } - else - { - printf("%s - message b1 received incorrectly, message='%s', size=%i\n", - name_string(), in, size); - } - } - else - printf("%s - message b1 size incorrect, size=%i\n", name_string(), size); - - // wait for task 3_1, and 3_2 to complete their timeout tests, will - // start these after getting the broadcast message - wake_after(7000000); - - char *f1 = "flush message"; - - printf("%s - send f1 to mq_2 - ", name_string()); - mq_2.send(f1, strlen(f1) + 1); - printf("%s\n", mq_2.last_status_string()); - - printf("%s - send f1 to mq_2 - ", name_string()); - mq_2.send(f1, strlen(f1) + 1); - printf("%s\n", mq_2.last_status_string()); - - printf("%s - send f1 to mq_2 - ", name_string()); - mq_2.send(f1, strlen(f1) + 1); - printf("%s\n", mq_2.last_status_string()); - - printf("%s - flush mq_2 - ", name_string()); - mq_2.flush(size); - printf("%s, flushed=%i\n", mq_2.last_status_string(), size); - - printf(" * END MessageQueue Class test *\n"); -} - -void Task1::print_mode(rtems_mode mode, rtems_mode mask) -{ - rtemsTaskMode task_mode; - if (mask & RTEMS_PREEMPT_MASK) - printf("RTEMS_%sPREEMPT ", - task_mode.preemption_set(mode) ? "" : "NO_"); - if (mask & RTEMS_TIMESLICE_MASK) - printf("RTEMS_%sTIMESLICE ", - task_mode.preemption_set(mode) ? "" : "NO_"); - if (mask & RTEMS_ASR_MASK) - printf("RTEMS_%sASR ", - task_mode.asr_set(mode) ? "" : "NO_"); - if (mask & RTEMS_INTERRUPT_MASK) - printf("INTMASK=%i", - mode & RTEMS_INTERRUPT_MASK); -} - -EndTask::EndTask(const char* name, - const rtems_task_priority initial_priority, - const rtems_unsigned32 stack_size) - : rtemsTask(name, initial_priority, stack_size, RTEMS_NO_PREEMPT) -{ -} - -void EndTask::body(rtems_task_argument) -{ - printf("*** END OF RTEMS++ TEST ***\n"); - exit(0); -} - diff --git a/testsuites/libtests/rtems++/Task2.cc b/testsuites/libtests/rtems++/Task2.cc deleted file mode 100644 index 1a44f4b0ef..0000000000 --- a/testsuites/libtests/rtems++/Task2.cc +++ /dev/null @@ -1,80 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "System.h" - -Task2::Task2(const char* name, - const rtems_task_priority initial_priority, - const rtems_unsigned32 stack_size) - : rtemsTask(name, initial_priority, stack_size, RTEMS_NO_PREEMPT) -{ -} - -void Task2::body(rtems_task_argument ) -{ - screen4(); - - printf("%s - destroy itself\n", name_string()); - destroy(); -} - -void Task2::screen4() -{ - rtemsEvent event; - - // block waiting for any event - rtems_event_set out; - - printf("%s - event no wait - ", name_string()); - event.receive(RTEMS_SIGNAL_0, out, 0, rtemsEvent::no_wait); - printf("%s\n", event.last_status_string()); - - printf("%s - event 5 secs timeout - ", name_string()); fflush(stdout); - event.receive(RTEMS_SIGNAL_0, out, 5000000); - printf("%s\n", event.last_status_string()); - - // send using task id - printf("%s - event wait forever for signal 0 from TA1 ....\n", name_string()); - event.receive(RTEMS_SIGNAL_0, out); - printf("%s - %s, signals out are 0x%08X\n", name_string(), event.last_status_string(), out); - - // send using task object reference - printf("%s - event wait forever for signal 0 from TA1 ....\n", name_string()); - event.receive(RTEMS_SIGNAL_0, out); - printf("%s - %s, signals out are 0x%08X\n", name_string(), event.last_status_string(), out); - - printf("%s - event wait forever for signal 31 from TA1 ....\n", name_string()); - event.receive(RTEMS_SIGNAL_31, out); - printf("%s - %s, signals out are 0x%08X\n", name_string(), event.last_status_string(), out); - - printf("%s - event wait forever for signal 0 and 31 from TA1 ....\n", name_string()); - event.receive(RTEMS_SIGNAL_0 | RTEMS_SIGNAL_31, out, 0, rtemsEvent::wait, rtemsEvent::all); - printf("%s - %s, signals out are 0x%08X\n", name_string(), event.last_status_string(), out); - - printf("%s - send event signal 1 - ", name_string()); - event.send(RTEMS_SIGNAL_1); - printf("%s\n", event.last_status_string()); - - printf("%s - event wait forever for signal 1 from TA2 - ", name_string()); - event.receive(RTEMS_SIGNAL_1, out, 0, rtemsEvent::wait, rtemsEvent::all); - printf("%s, signals out are 0x%08X\n", event.last_status_string(), out); -} - - diff --git a/testsuites/libtests/rtems++/Task3.cc b/testsuites/libtests/rtems++/Task3.cc deleted file mode 100644 index b1a0595757..0000000000 --- a/testsuites/libtests/rtems++/Task3.cc +++ /dev/null @@ -1,80 +0,0 @@ -/* Task_3 - * - * This routine serves as a test task. Loopback the messages and test - * timeouts - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "System.h" - -Task3::Task3(const char* name, - const rtems_task_priority initial_priority, - const rtems_unsigned32 stack_size) - : rtemsTask(name, initial_priority, stack_size, RTEMS_NO_PREEMPT) -{ -} - -void Task3::body(rtems_task_argument ) -{ - screen6(); - - printf("%s - destroy itself\n", name_string()); - destroy(); -} - -void Task3::screen6() -{ - rtemsMessageQueue mq_2("MQ2"); - printf("%s - construction connect mq_2 - %s\n", name_string(), mq_2.last_status_string()); - - if (mq_2.successful()) - { - char in[100]; - char out[100]; - rtems_unsigned32 size; - bool loopback = true; - - while (loopback) - { - printf("%s - loopback from mq_2 to mq_2 ...\n", name_string()); fflush(stdout); - - mq_2.receive(in, size); - printf("%s - mq_2 receive - %s, size=%i, message string size=%i\n", - name_string(), mq_2.last_status_string(), size, (int) strlen(in)); - if (mq_2.successful()) - { - if (size > (100 - 5)) - printf("%s - size to large\n", name_string()); - else - { - strcpy(out, name_string()); - strcpy(out + 4, in); - - printf("%s - loopback to mq_2 - ", name_string()); - mq_2.send(out, strlen(out) + 1); - printf("%s\n", mq_2.last_status_string()); - } - - if (strcmp(in, "broadcast message") == 0) - loopback = false; - else - wake_after(1500000); - } - } - } -} - - diff --git a/testsuites/libtests/rtems++/rtems++.doc b/testsuites/libtests/rtems++/rtems++.doc deleted file mode 100644 index 5834b4077d..0000000000 --- a/testsuites/libtests/rtems++/rtems++.doc +++ /dev/null @@ -1,29 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1997 -# Objective Design Systems Ltd Pty (ODS) -# All rights reserved (R) Objective Design Systems Ltd Pty -# -# The license and distribution terms for this file may be found in the -# file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - -The file describes the directives and concepts tested by this test set. - -test set name: rtems++ - -classes: - rtemsTask, rtemsTaskMode, rtemsEvent, rtemsMessageQueue - -concepts: - - a. Verify each class tested can be constructed using each of the constructors. - - b. Verify each class can be an owner of an object id if capable. - - c. Verify each class can connect to an existing object id if capable. - - d. Verify the operation of each method of each class. - diff --git a/testsuites/libtests/rtems++/rtems++.scn b/testsuites/libtests/rtems++/rtems++.scn deleted file mode 100644 index 2b3682d6b6..0000000000 --- a/testsuites/libtests/rtems++/rtems++.scn +++ /dev/null @@ -1,161 +0,0 @@ -*** RTEMS++ TEST *** -INIT - Task.create() - RTEMS[19] invalid thread priority -INIT - Task.create() - RTEMS[00] successful completion -INIT - Task.create() - RTEMS[16] illegal on calling thread -INIT - Task.restart() - RTEMS[14] thread is in wrong state -INIT - Task.start(0xDEADDEAD) - RTEMS[00] successful completion - - * START Task Class test * -TA1 - test argument - argument matched -TA1 - copy constructor - local and this id's match -TA1 - copy constructor - local and this name's match -TA1 - copy operator - local and this id's match -TA1 - copy operator - local and this name's match -TA1 - not owner destroy's task - RTEMS[23] not owner of resource -TA1 - connect to a local valid task name - RTEMS[00] successful completion -TA1 - connect to an invalid task name - RTEMS[03] invalid object name -SELF - connect to a task on an invalid node - RTEMS[21] invalid node id -TA1 - restart from a non-owner - RTEMS[23] not owner of resource - -TA1 - wake after 0 secs - RTEMS[00] successful completion -TA1 - wake after 500 msecs - RTEMS[00] successful completion -TA1 - wake after 5 secs - RTEMS[00] successful completion -TA1 - wake when - to do -TA1 - connected object wake after 0 secs - RTEMS[00] successful completion -TA1 - connected object wake after 500 msecs - RTEMS[00] successful completion -TA1 - connected object wake after 5 secs - RTEMS[00] successful completion -TA1 - connected object wake when - to do -SELF - self object wake after 0 secs - RTEMS[00] successful completion -SELF - self object wake after 500 msecs - RTEMS[00] successful completion -SELF - self object wake after 5 secs - RTEMS[00] successful completion -SELF - self object wake when - to do -TA1 - get priority - RTEMS[00] successful completion, priority is 10 -TA1 - set priority to 512 - RTEMS[19] invalid thread priority -TA1 - set priority to 25 - RTEMS[00] successful completion -TA1 - set priority to original - RTEMS[00] successful completion, priority was 25 -TA1 - connected object get priority - RTEMS[00] successful completion, priority is 10 -TA1 - connected object set priority to 512 - RTEMS[19] invalid thread priority -TA1 - connected object set priority to 25 - RTEMS[00] successful completion -TA1 - connected object set priority to original - RTEMS[00] successful completion, priority was 25 -SELF - self object get priority - RTEMS[00] successful completion, priority is 10 -SELF - self object set priority to 512 - RTEMS[19] invalid thread priority -SELF - self object set priority to 25 - RTEMS[00] successful completion -SELF - self object set priority to original - RTEMS[00] successful completion, priority was 25 -TA1 - get note - RTEMS[00] successful completion, note is 0 -TA1 - get with bad notepad number - RTEMS[10] number was invalid, note is 0 -TA1 - set note to 0xDEADBEEF - RTEMS[00] successful completion -TA1 - get note - RTEMS[00] successful completion, note is 0xDEADBEEF -TA1 - set note to original value - RTEMS[00] successful completion -TA1 - connected object get note - RTEMS[00] successful completion, notepad is 0 -TA1 - connected object get with bad notepad number - RTEMS[10] number was invalid, note is 0 -TA1 - connected object set note to 0xDEADBEEF - RTEMS[00] successful completion -TA1 - connected object get note - RTEMS[00] successful completion, note is 0xDEADBEEF -TA1 - connected object set note to original value - RTEMS[00] successful completion -SELF - self object get note - RTEMS[00] successful completion, note is 0 -SELF - self object get with bad notepad number - RTEMS[10] number was invalid, note is 0 -SELF - self object set note to 0xDEADBEEF - RTEMS[00] successful completion -SELF - self object get note - RTEMS[00] successful completion, notepad is 0xDEADBEEF -SELF - self object set note to original value - RTEMS[00] successful completion - * END Task Class test * - - * START TaskMode Class test * -SELF - get mode - RTEMS[00] successful completion, - mode is 0x00000100, RTEMS_NO_PREEMPT RTEMS_NO_TIMESLICE RTEMS_NO_ASR INTMASK=0 -SELF - get preemption state - RTEMS[00] successful completion, - mode is 0x00000100, RTEMS_NO_PREEMPT -SELF - set preemption state to RTEMS_PREEMPT - RTEMS[00] successful completion, - mode is 0x00000000, RTEMS_PREEMPT RTEMS_TIMESLICE RTEMS_NO_ASR INTMASK=0 -SELF - set preemption state to RTEMS_NO_PREEMPT - RTEMS[00] successful completion, - mode is 0x00000100, RTEMS_NO_PREEMPT RTEMS_NO_TIMESLICE RTEMS_NO_ASR INTMASK=0 -SELF - get timeslice state - RTEMS[00] successful completion, - mode is 0x00000000, RTEMS_TIMESLICE -SELF - set timeslice state to RTEMS_TIMESLICE - RTEMS[00] successful completion, - mode is 0x00000300, RTEMS_NO_PREEMPT RTEMS_NO_TIMESLICE RTEMS_NO_ASR INTMASK=0 -SELF - set timeslice state to RTEMS_NO_TIMESLICE - RTEMS[00] successful completion, - mode is 0x00000100, RTEMS_NO_PREEMPT RTEMS_NO_TIMESLICE RTEMS_NO_ASR INTMASK=0 -SELF - get asr state - RTEMS[00] successful completion, - mode is 0x00000000, RTEMS_NO_ASR -SELF - set asr state to RTEMS_ASR - RTEMS[00] successful completion, - mode is 0x00000100, RTEMS_NO_PREEMPT RTEMS_NO_TIMESLICE RTEMS_NO_ASR INTMASK=0 -SELF - set asr state to RTEMS_NO_ASR - RTEMS[00] successful completion, - mode is 0x00000500, RTEMS_NO_PREEMPT RTEMS_NO_TIMESLICE RTEMS_ASR INTMASK=0 -SELF - get current interrupt level - RTEMS[00] successful completion, level is 0 -SELF - set interrupt level to 102 - RTEMS[00] successful completion -SELF - set interrupt level to original level - RTEMS[00] successful completion, level was 0 -SELF - set mode to original mode - RTEMS[00] successful completion, - mode is 0x00000100, RTEMS_NO_PREEMPT RTEMS_NO_TIMESLICE RTEMS_NO_ASR INTMASK=0 - * END TaskMode Class test * - - * START Event Class test * -TA1 - create task 2 - RTEMS[00] successful completion -TA1 - start task 2 - RTEMS[00] successful completion -TA1 - construct event connecting to task 2 - RTEMS[00] successful completion -TA2 - event no wait - RTEMS[13] request not satisfied -TA2 - event 5 secs timeout - RTEMS[06] timed out waiting -TA2 - event wait forever for signal 0 from TA1 .... -TA1 - send event signal 0 using the task id - RTEMS[00] successful completion -TA2 - RTEMS[00] successful completion, signals out are 0x00000001 -TA2 - event wait forever for signal 0 from TA1 .... -TA1 - send event signal 0 using the task object reference - RTEMS[00] successful completion -TA2 - RTEMS[00] successful completion, signals out are 0x00000001 -TA2 - event wait forever for signal 31 from TA1 .... -TA1 - send event signal 31 using connected id - RTEMS[00] successful completion -TA2 - RTEMS[00] successful completion, signals out are 0x80000000 -TA2 - event wait forever for signal 0 and 31 from TA1 .... -TA1 - send event signal 0 and 31 - RTEMS[00] successful completion -TA1 - waiting 5 secs for TA2 to finish -TA2 - RTEMS[00] successful completion, signals out are 0x80000001 -TA2 - send event signal 1 - RTEMS[00] successful completion -TA2 - event wait forever for signal 1 from TA2 - RTEMS[00] successful completion, signals out are 0x00000002 -TA2 - destory itself - * END Event Class test * - - * START Interrupt Class test * - do not know a portable BSP type interrupt test - * END Interrupt Class test * - - * START MessageQueue Class test * -TA1 - construct message queue 1 with no memory error - RTEMS[05] too many -TA1 - construct/create message queue 2 - RTEMS[00] successful completion -TA1 - send u1 to mq_2 - RTEMS[00] successful completion -TA1 - urgent send u2 to mq_2 - RTEMS[00] successful completion -TA1 - create task 3_1 - RTEMS[00] successful completion -TA1 - start task 3_1 - RTEMS[00] successful completion -TA1 - create task 3_2 - RTEMS[00] successful completion -TA1 - start task 3_2 - RTEMS[00] successful completion -TA31 - construction connect mq_2 - RTEMS[00] successful completion -TA31 - loopback from mq_2 to mq_2 ... -TA31 - mq_2 receive - RTEMS[00] successful completion, size=12, message string size=11 -TA31 - loopback to mq_2 - RTEMS[00] successful completion -TA32 - construction connect mq_2 - RTEMS[00] successful completion -TA32 - loopback from mq_2 to mq_2 ... -TA32 - mq_2 receive - RTEMS[00] successful completion, size=12, message string size=11 -TA32 - loopback to mq_2 - RTEMS[00] successful completion -TA1 - receive u2 on mq_2 ... -TA1 - RTEMS[00] successful completion -TA1 - message u2 received correctly -TA1 - receive u1 on mq_2 ... -TA1 - RTEMS[00] successful completion -TA1 - message u1 received correctly -TA31 - loopback from mq_2 to mq_2 ... -TA32 - loopback from mq_2 to mq_2 ... -TA1 - broadcast send b1 ... -TA1 - mq_2 broadcast send - RTEMS[00] successful completion, count=2 -TA31 - mq_2 receive - RTEMS[00] successful completion, size=18, message string size=17 -TA31 - loopback to mq_2 - RTEMS[00] successful completion -TA31 - destory itself -TA32 - mq_2 receive - RTEMS[00] successful completion, size=18, message string size=17 -TA32 - loopback to mq_2 - RTEMS[00] successful completion -TA32 - destory itself -TA1 - receive message b1 on mq_2 from TA31... -TA1 - RTEMS[00] successful completion -TA1 - message b1 received correctly -TA1 - receive message b1 on mq_2 from TA31... -TA1 - RTEMS[00] successful completion -TA1 - message b1 received correctly -TA1 - send f1 to mq_2 - RTEMS[00] successful completion -TA1 - send f1 to mq_2 - RTEMS[00] successful completion -TA1 - send f1 to mq_2 - RTEMS[00] successful completion -TA1 - flush mq_2 - RTEMS[00] successful completion, flushed=3 - * END MessageQueue Class test * - diff --git a/testsuites/libtests/rtmonuse/.cvsignore b/testsuites/libtests/rtmonuse/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/libtests/rtmonuse/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/libtests/rtmonuse/Makefile.am b/testsuites/libtests/rtmonuse/Makefile.am deleted file mode 100644 index 5f35c16a70..0000000000 --- a/testsuites/libtests/rtmonuse/Makefile.am +++ /dev/null @@ -1,42 +0,0 @@ -## -## $Id$ -## - - -TEST = rtmonuse - -MANAGERS = io rate_monotonic - -C_FILES = init.c getall.c task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/libtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/libtests/rtmonuse/getall.c b/testsuites/libtests/rtmonuse/getall.c deleted file mode 100644 index a99ecf3d8c..0000000000 --- a/testsuites/libtests/rtmonuse/getall.c +++ /dev/null @@ -1,42 +0,0 @@ -/* Get_all_counters - * - * This routine allows TA5 to atomically obtain the iteration counters. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -void Get_all_counters() -{ - rtems_mode previous_mode; - rtems_status_code status; - - status = rtems_task_mode( - RTEMS_NO_PREEMPT, - RTEMS_PREEMPT_MASK, - &previous_mode - ); - directive_failed( status, "rtems_task_mode to RTEMS_NO_PREEMPT" ); - - Temporary_count = Count; - Count.count[ 1 ] = 0; - Count.count[ 2 ] = 0; - Count.count[ 3 ] = 0; - Count.count[ 4 ] = 0; - Count.count[ 5 ] = 0; - - status = rtems_task_mode( RTEMS_PREEMPT, RTEMS_PREEMPT_MASK, &previous_mode ); - directive_failed( status, "rtems_task_mode to RTEMS_PREEMPT" ); -} diff --git a/testsuites/libtests/rtmonuse/init.c b/testsuites/libtests/rtmonuse/init.c deleted file mode 100644 index a406a18a35..0000000000 --- a/testsuites/libtests/rtmonuse/init.c +++ /dev/null @@ -1,70 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -#include - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_unsigned32 index; - rtems_status_code status; - - puts( "\n\n*** RATE MONOTONIC PERIOD STATISTICS TEST ***" ); - Period_usage_Initialize(); - - 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', ' ' ); - - for ( index = 1 ; index <= 5 ; index++ ) { - status = rtems_task_create( - Task_name[ index ], - Priorities[ index ], - RTEMS_MINIMUM_STACK_SIZE * 4, - RTEMS_DEFAULT_MODES, - (index == 5) ? RTEMS_FLOATING_POINT : RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ index ] - ); - directive_failed( status, "rtems_task_create loop" ); - } - - for ( index = 1 ; index <= 5 ; index++ ) { - status = rtems_task_start( Task_id[ index ], Task_1_through_5, index ); - directive_failed( status, "rtems_task_start loop" ); - } - - Count.count[ 1 ] = 0; - Count.count[ 2 ] = 0; - Count.count[ 3 ] = 0; - Count.count[ 4 ] = 0; - Count.count[ 5 ] = 0; - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} diff --git a/testsuites/libtests/rtmonuse/rtmonuse.scn b/testsuites/libtests/rtmonuse/rtmonuse.scn deleted file mode 100644 index bb4e8814da..0000000000 --- a/testsuites/libtests/rtmonuse/rtmonuse.scn +++ /dev/null @@ -1,27 +0,0 @@ -*** TEST 20 *** -TA1 - rtems_rate_monotonic_create id = 0x28010001 -TA1 - rtems_rate_monotonic_ident id = 0x28010001 -TA1 - (0x28010001) period 2 -TA2 - rtems_rate_monotonic_create id = 0x28010002 -TA2 - rtems_rate_monotonic_ident id = 0x28010002 -TA2 - (0x28010002) period 2 -TA3 - rtems_rate_monotonic_create id = 0x28010003 -TA3 - rtems_rate_monotonic_ident id = 0x28010003 -TA3 - (0x28010003) period 2 -TA4 - rtems_rate_monotonic_create id = 0x28010004 -TA4 - rtems_rate_monotonic_ident id = 0x28010004 -TA4 - (0x28010004) period 2 -TA5 - rtems_rate_monotonic_create id = 0x28010005 -TA5 - rtems_rate_monotonic_ident id = 0x28010005 -TA5 - (0x28010005) period 100 -TA5 - PERIODS CHECK OK (1) -TA5 - PERIODS CHECK OK (2) -TA5 - PERIODS CHECK OK (3) -TA5 - PERIODS CHECK OK (4) -TA5 - PERIODS CHECK OK (5) -TA5 - PERIODS CHECK OK (6) -TA5 - PERIODS CHECK OK (7) -TA5 - PERIODS CHECK OK (8) -TA5 - PERIODS CHECK OK (9) -TA5 - PERIODS CHECK OK (10) -*** END OF TEST 20 *** diff --git a/testsuites/libtests/rtmonuse/system.h b/testsuites/libtests/rtmonuse/system.h deleted file mode 100644 index e9d1a559de..0000000000 --- a/testsuites/libtests/rtmonuse/system.h +++ /dev/null @@ -1,61 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* types */ - -struct counters { - rtems_unsigned32 count[6]; -}; - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_task Task_1_through_5( - rtems_task_argument argument -); - -void Get_all_counters( void ); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 6 -#define CONFIGURE_MAXIMUM_PERIODS 10 - -#define CONFIGURE_INIT_TASK_PRIORITY 10 -#define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_DEFAULT_MODES - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_EXTRA_TASK_STACKS (15 * RTEMS_MINIMUM_STACK_SIZE) -#include - -/* global variables */ - -TEST_EXTERN rtems_id Task_id[ 6 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 6 ]; /* array of task names */ - -TEST_EXTERN struct counters Count; /* iteration counters */ -TEST_EXTERN struct counters Temporary_count; -extern rtems_task_priority Priorities[ 6 ]; - -/* end of include file */ diff --git a/testsuites/libtests/rtmonuse/task1.c b/testsuites/libtests/rtmonuse/task1.c deleted file mode 100644 index f1959bca70..0000000000 --- a/testsuites/libtests/rtmonuse/task1.c +++ /dev/null @@ -1,123 +0,0 @@ -/* Task_1_through_5 - * - * This routine serves as a test task for the period capabilities of the - * Rate Monotonic Manager. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -#include -#include - -rtems_unsigned32 Periods[6] = { 0, 2, 2, 2, 2, 100 }; -rtems_unsigned32 Iterations[6] = { 0, 50, 50, 50, 50, 1 }; -rtems_task_priority Priorities[6] = { 0, 1, 1, 3, 4, 5 }; - -rtems_task Task_1_through_5( - rtems_unsigned32 argument -) -{ - rtems_id rmid; - rtems_id test_rmid; - rtems_unsigned32 index; - rtems_unsigned32 pass; - rtems_unsigned32 failed; - rtems_status_code status; - - status = rtems_rate_monotonic_create( argument, &rmid ); - directive_failed( status, "rtems_rate_monotonic_create" ); - put_name( Task_name[ argument ], FALSE ); - printf( "- rtems_rate_monotonic_create id = 0x%08x\n", rmid ); - - status = rtems_rate_monotonic_ident( argument, &test_rmid ); - directive_failed( status, "rtems_rate_monotonic_ident" ); - put_name( Task_name[ argument ], FALSE ); - printf( "- rtems_rate_monotonic_ident id = 0x%08x\n", test_rmid ); - - if ( rmid != test_rmid ) { - printf( "RMID's DO NOT MATCH (0x%x and 0x%x)\n", rmid, test_rmid ); - rtems_test_exit( 0 ); - } - - put_name( Task_name[ argument ], FALSE ); - printf( "- (0x%08x) period %d\n", rmid, Periods[ argument ] ); - - status = rtems_task_wake_after( 2 ); - directive_failed( status, "rtems_task_wake_after" ); - - switch ( argument ) { - case 1: - case 2: - case 3: - case 4: - while ( FOREVER ) { - Period_usage_Update( rmid ); - - status = rtems_rate_monotonic_period( rmid, Periods[ argument ] ); - directive_failed( status, "rtems_rate_monotonic_period" ); - Count.count[ argument ]++; - } - break; - case 5: - pass = 0; - failed = 0; - - status = rtems_rate_monotonic_period( rmid, Periods[ argument ] ); - directive_failed( status, "rtems_rate_monotonic_period 1 of TA5" ); - - Get_all_counters(); - - while ( FOREVER ) { - Period_usage_Update( rmid ); - - status = rtems_rate_monotonic_period( rmid, Periods[ argument ] ); - directive_failed( status, "rtems_rate_monotonic_period 2 of TA5" ); - - Get_all_counters(); - - for( index = 1 ; index <= 4 ; index++ ) { - if ( Temporary_count.count[ index ] != Iterations[ index ] ) { - puts_nocr( "FAIL -- " ); - put_name ( Task_name[ index ], FALSE ); - printf ( " Actual=%d, Expected=%d\n", - Temporary_count.count[ index ], - Iterations[ index ] - ); - failed += 1; - } - } - - if ( failed == 5 ) - rtems_test_exit( 0 ); - - pass += 1; - - printf( "TA5 - PERIODS CHECK OK (%d)\n", pass ); - - fflush( stdout ); - - if ( pass == 10 ) { - puts( "*** END OF RATE MONOTONIC PERIOD STATISTICS TEST ***" ); - CPU_usage_Dump(); - Period_usage_Dump(); - rtems_test_exit( 0 ); - } - - } - break; - } -} diff --git a/testsuites/libtests/stackchk/.cvsignore b/testsuites/libtests/stackchk/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/libtests/stackchk/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/libtests/stackchk/Makefile.am b/testsuites/libtests/stackchk/Makefile.am deleted file mode 100644 index 1cdda43dcb..0000000000 --- a/testsuites/libtests/stackchk/Makefile.am +++ /dev/null @@ -1,42 +0,0 @@ -## -## $Id$ -## - - -TEST = stackchk - -MANAGERS = io - -C_FILES = blow.c init.c task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/libtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/libtests/stackchk/blow.c b/testsuites/libtests/stackchk/blow.c deleted file mode 100644 index 944cf9e73c..0000000000 --- a/testsuites/libtests/stackchk/blow.c +++ /dev/null @@ -1,48 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -void b() {} - -void blow_stack( void ) -{ - volatile unsigned32 *low, *high; - unsigned char *area; - -b(); - /* - * Destroy the first and last 16 bytes of our stack... Hope it - * does not cause problems :) - */ - - area = (unsigned char *)_Thread_Executing->Start.Initial_stack.area; - - low = (volatile unsigned32 *) (area + HEAP_OVERHEAD); - high = (volatile unsigned32 *) - (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 deleted file mode 100644 index 7a3a5e9422..0000000000 --- a/testsuites/libtests/stackchk/init.c +++ /dev/null @@ -1,85 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.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 deleted file mode 100644 index 84a5c5e342..0000000000 --- a/testsuites/libtests/stackchk/stackchk.scn +++ /dev/null @@ -1,9 +0,0 @@ -*** 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/system.h b/testsuites/libtests/stackchk/system.h deleted file mode 100644 index 42f0166a3e..0000000000 --- a/testsuites/libtests/stackchk/system.h +++ /dev/null @@ -1,53 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* macros */ - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_task Task_1_through_3( - rtems_task_argument argument -); - -void blow_stack( void ); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define TASK_STACK_SIZE (RTEMS_MINIMUM_STACK_SIZE*3) - -#define CONFIGURE_MAXIMUM_TASKS 4 -#define CONFIGURE_EXTRA_TASK_STACKS (3 * (RTEMS_MINIMUM_STACK_SIZE * 2)) - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define STACK_CHECKER_ON - -#include - -/* global variables */ - -TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */ - -/* end of include file */ diff --git a/testsuites/libtests/stackchk/task1.c b/testsuites/libtests/stackchk/task1.c deleted file mode 100644 index 7a95467485..0000000000 --- a/testsuites/libtests/stackchk/task1.c +++ /dev/null @@ -1,43 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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 >= 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/libtests/termios/.cvsignore b/testsuites/libtests/termios/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/libtests/termios/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/libtests/termios/Makefile.am b/testsuites/libtests/termios/Makefile.am deleted file mode 100644 index d575106acf..0000000000 --- a/testsuites/libtests/termios/Makefile.am +++ /dev/null @@ -1,42 +0,0 @@ -## -## $Id$ -## - - -TEST = termios - -MANAGERS = io - -C_FILES = init.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = -noinst_HEADERS = $(H_FILES) - -DOCTYPES = -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES) -OBJS = $(C_O_FILES) $(CC_O_FILES) $(S_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/libtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/libtests/termios/README b/testsuites/libtests/termios/README deleted file mode 100644 index 2515b2994f..0000000000 --- a/testsuites/libtests/termios/README +++ /dev/null @@ -1,99 +0,0 @@ -# -# $Id$ -# - -These tests are brought to you by the letter `q'. - -When you start the test, you should see: - - You have the following choices: - 1 - Reset the struct termios - 2 - Look at the current termios setting - 3 - Change the line characteristics - 4 - Test canonical input - 5 - Test raw input - 9 - Exit - Enter your choice (1 to 5 or 9, followed by a carriage return): - -The individual tests are briefly described below: - - -1. Reset the struct termios. - -Included just in case you get into trouble. More than likely, if you are in -trouble, neither input nor output are likely to work and this won't help. But -hey, it should give you some warm fuzzy feeling that its there... - - -2. Look at the current termios setting - -Dumps the current state of the termios settings in hex and with symbolic flag -names. - - -3. Change the line characteristics - -Allows you to change the line speed, parity, number of data bits and number of -stop bits. You must supply a delay before the change takes effect. This gives -you time to switch your terminal settings to continue with the test. - -WARNING: Minicom under Linux gets extremely unhappy (as does the /dev/ttyS? -underlying devices) if you change the line characteristics and do not make the -corresponding change in the terminal emulator. - - -4. Test canonical input - -Simple test of canonical or cooked input mode. Try typing some tabs and/or control characters and make sure that you can backspace over them properly. - - -5. Test raw input - -The line is placed into raw mode and four separate test are done: - -VMIN=0, VTIME=0 - Each letter you type should produce a line of output. - The `count' should be quite large, since (as you correctly - pointed out) the read is non-blocking. The time should be - the interval between typing characters. - Type a `q' to finish the test. -VMIN=0, VTIME=20 - Again, each letter should produce a line of output. The - `count' should be much smaller -- the read is non-blocking - but has a timeout of 2 seconds, so the count should be about - half the `interval'. - Type a `q' to finish the test. -VMIN=5, VTIME=0 - A line should be produced for every 5 characters typed. The - count should be 1. This is a blocking read. - Type a `q' as the first character of a group of 5 to finish - the test. -VMIN=5, VTIME=20 - Type a character. Two seconds later a line should be printed. - Count should be 1. Type a character, and another within 2 seconds. - Two seconds after last character (or right after the 5th character) - a line should be printed. - Type a `q' as the first character of a group to finish the test. - - -9. Exit - -Gets you out of the test. - - -Clear??? - - ---- -Eric Norum -eric@skatter.usask.ca -Saskatchewan Accelerator Laboratory -University of Saskatchewan -Saskatoon, Canada. - -Charles-Antoine Gauthier -Software Engineering Group -Institute for Information Technology -National Research Council of Canada -charles.gauthier@nrc.ca - diff --git a/testsuites/libtests/termios/init.c b/testsuites/libtests/termios/init.c deleted file mode 100644 index eb7045bf31..0000000000 --- a/testsuites/libtests/termios/init.c +++ /dev/null @@ -1,781 +0,0 @@ -/* - * RTEMS configuration/initialization - * - * This program may be distributed and used for any purpose. - * I ask only that you: - * 1. Leave this author information intact. - * 2. Document any changes you make. - * - * W. Eric Norum - * Saskatchewan Accelerator Laboratory - * University of Saskatchewan - * Saskatoon, Saskatchewan, CANADA - * eric@skatter.usask.ca - * - * Additions: - * Charles-Antoine Gauthier - * Software Engineering Group - * Institute for Information Technology - * National Research Council of Canada - * charles.gauthier@nrc.ca - * - * $Id$ - */ - -#include - - -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 1 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_MICROSECONDS_PER_TICK 1000 - -#define CONFIGURE_INIT - -rtems_task Init (rtems_task_argument argument); - -#include - -#include -#include -#include -#include -#include - -#include - -#if !defined(fileno) -int fileno( FILE *stream); /* beyond ANSI */ -#endif - -/* Some of the termios dumping code depends on bit positions! */ - -void print_32bits( unsigned long bits, unsigned char size, char * names[] ) -{ - unsigned char i; - - for( i = 0; i < size; i++ ) { - if( (bits >> i) & 0x1 ) - printf( "%s ", names[i] ); - } -} - - -void print_c_iflag( struct termios * tp ) -{ - char * c_iflag_bits [] = { - "IGNBRK", /* 0000001 */ - "BRKINT", /* 0000002 */ - "IGNPAR", /* 0000004 */ - "PARMRK", /* 0000010 */ - "INPCK", /* 0000020 */ - "ISTRIP", /* 0000040 */ - "INLCR", /* 0000100 */ - "IGNCR", /* 0000200 */ - "ICRNL", /* 0000400 */ - "IUCLC", /* 0001000 */ - "IXON", /* 0002000 */ - "IXANY", /* 0004000 */ - "IXOFF", /* 0010000 */ - "IMAXBEL", /* 0020000 */ - "unknown", /* 0040000 */ - "unknown", /* 0100000 */ - "unknown", /* 0200000 */ - "unknown", /* 0400000 */ - "unknown", /* 1000000 */ - "unknown", /* 2000000 */ - "unknown" /* 4000000 */ - }; - - printf( "c_iflag = 0x%08x\n\t", tp->c_iflag ); - print_32bits( tp->c_iflag, sizeof( c_iflag_bits )/sizeof( char * ), c_iflag_bits ); - printf( "\n" ); -} - - -void print_c_oflag( struct termios * tp ) -{ - printf( "c_oflag = 0x%08x\n\t", tp->c_oflag ); - - if( tp->c_oflag & OPOST ) - printf( "OPOST " ); - - if( tp->c_oflag & OLCUC ) - printf( "OLCUC " ); - - if( tp->c_oflag & ONLCR ) - printf( "ONLCR " ); - - if( tp->c_oflag & OCRNL ) - printf( "OCRNL " ); - - if( tp->c_oflag & ONOCR ) - printf( "ONOCR " ); - - if( tp->c_oflag & ONLRET ) - printf( "ONLRET " ); - - if( tp->c_oflag & OFILL ) - printf( "OFILL " ); - - if( tp->c_oflag & OFDEL ) - printf( "OFDEL " ); - - switch( tp->c_oflag & NLDLY ) { - case NL0: - printf( "NL0 " ); - break; - - case NL1: - printf( "NL1 " ); - break; - } - - switch( tp->c_oflag & CRDLY ) { - case CR0: - printf( "CR0 " ); - break; - - case CR1: - printf( "CR1 " ); - break; - - case CR2: - printf( "CR2 " ); - break; - - case CR3: - printf( "CR3 " ); - break; - } - - switch( tp->c_oflag & TABDLY ) { - case TAB0: - printf( "TAB0 " ); - break; - - case TAB1: - printf( "TAB1 " ); - break; - - case TAB2: - printf( "TAB2 " ); - break; - - case TAB3: - printf( "TAB3 " ); - break; - } - - switch( tp->c_oflag & BSDLY ) { - case BS0: - printf( "BS0 " ); - break; - - case BS1: - printf( "BS1 " ); - break; - } - - switch( tp->c_oflag & VTDLY ) { - case VT0: - printf( "VT0 " ); - break; - - case VT1: - printf( "VT1 " ); - break; - } - - switch( tp->c_oflag & FFDLY ) { - case FF0: - printf( "FF0" ); - break; - - case FF1: - printf( "FF1" ); - break; - } - printf( "\n" ); -} - - -void print_c_lflag( struct termios * tp ) -{ - char * c_lflag_bits [] = { - "ISIG", /* 0000001 */ - "ICANON", /* 0000002 */ - "XCASE", /* 0000004 */ - "ECHO", /* 0000010 */ - "ECHOE", /* 0000020 */ - "ECHOK", /* 0000040 */ - "ECHONL", /* 0000100 */ - "NOFLSH", /* 0000200 */ - "TOSTOP", /* 0000400 */ - "ECHOCTL", /* 0001000 */ - "ECHOPRT", /* 0002000 */ - "ECHOKE", /* 0004000 */ - "FLUSHO", /* 0010000 */ - "unknown", /* 0020000 */ - "PENDIN", /* 0040000 */ - "IEXTEN", /* 0100000 */ - "unknown", /* 0200000 */ - "unknown", /* 0400000 */ - "unknown", /* 1000000 */ - "unknown", /* 2000000 */ - "unknown", /* 4000000 */ - }; - - printf( "c_lflag = 0x%08x\n\t", tp->c_lflag ); - print_32bits( tp->c_lflag, sizeof( c_lflag_bits )/sizeof( char * ), c_lflag_bits ); - printf( "\n" ); -} - - -void print_c_cflag( struct termios * tp ) -{ - unsigned int baud; - - printf( "c_cflag = 0x%08x\n", tp->c_cflag ); - - baud = (tp->c_cflag & CBAUD) ; -#if defined(__sh2__) - if ( tp->c_cflag & CBAUDEX ) -#endif - switch( baud ) { - case B0: - printf( "\tCBAUD =\tB0\n" ); - break; - - case B50: - printf( "\tCBAUD =\tB50\n" ); - break; - - case B75: - printf( "\tCBAUD =\tB75\n" ); - break; - - case B110: - printf( "\tCBAUD =\tB110\n" ); - break; - - case B134: - printf( "\tCBAUD =\tB134\n" ); - break; - - case B150: - printf( "\tCBAUD =\tB150\n" ); - break; - - case B200: - printf( "\tCBAUD =\tB200\n" ); - break; - - case B300: - printf( "\tCBAUD =\tB300\n" ); - break; - - case B600: - printf( "\tCBAUD =\tB600\n" ); - break; - - case B1200: - printf( "\tCBAUD =\tB1200\n" ); - break; - - case B1800: - printf( "\tCBAUD =\tB1800\n" ); - break; - - case B2400: - printf( "\tCBAUD =\tB2400\n" ); - break; - - case B4800: - printf( "\tCBAUD =\tB4800\n" ); - break; - - case B9600: - printf( "\tCBAUD =\tB9600\n" ); - break; - - case B19200: - printf( "\tCBAUD =\tB19200\n" ); - break; - - case B38400: - printf( "\tCBAUD =\tB38400\n" ); - break; -#if defined(__sh2__) - } - else - switch ( baud ) - { -#endif - case B57600: - printf( "\tCBAUD =\tB57600\n" ); - break; - - case B115200: - printf( "\tCBAUD =\tB115200\n" ); - break; - - case B230400: - printf( "\tCBAUD =\tB230400\n" ); - break; - - case B460800: - printf( "\tCBAUD =\tB460800\n" ); - break; - - default: - printf( "\tCBAUD =\tunknown (0x%08x)\n", baud ); - break; - } - - switch( tp->c_cflag & CSIZE ) { - case CS5: - printf( "\tCSIZE =\tCS5\n" ); - break; - - case CS6: - printf( "\tCSIZE =\tCS6\n" ); - break; - - case CS7: - printf( "\tCSIZE =\tCS7\n" ); - break; - - case CS8: - printf( "\tCSIZE =\tCS8\n" ); - break; - } - - if( tp->c_cflag & CSTOPB ) - printf( "\tCSTOPB set: send 2 stop bits\n" ); - else - printf( "\tCSTOPB clear: send 1 stop bit\n" ); - - if( tp->c_cflag & PARENB ) - printf( "\tPARENB set: parity enabled\n" ); - else - printf( "\tPARENB clear: parity disabled\n" ); - - if( tp->c_cflag & PARODD ) - printf( "\tPARODD set: parity odd\n" ); - else - printf( "\tPARODD clear: parity even\n" ); - - if( tp->c_cflag & CREAD ) - printf( "\tCREAD set: receiver enabled\n" ); - else - printf( "\tCREAD clear: treceiver disabled\n" ); - - if( tp->c_cflag & HUPCL ) - printf( "\tHUPCL set: enabled\n" ); - else - printf( "\tHUPCL clear: disabled\n" ); - - if( tp->c_cflag & CLOCAL ) - printf( "\tCLOCAL set: ignore modem lines\n" ); - else - printf( "\tCLOCAL clear: don't ignore modem lines\n" ); - -#if defined(CBAUDEX) - if( tp->c_cflag & CBAUDEX ) - printf( "\tCBAUDEX set: What does this do?\n" ); - else - printf( "\tCBAUDEX clear: What does this do?\n" ); -#endif - - if( tp->c_cflag & CRTSCTS ) - printf( "\tCRTSCTS: harware flow control enabled?\n" ); - else - printf( "\tCRTSCTS: hardware flow control disabled?\n" ); -} - - -void print_c_cc( struct termios * tp ) -{ - int i; - char * cc_index_names [NCCS] = { - "[VINTR] ", /* 0 */ - "[VQUIT] ", /* 1 */ - "[VERASE] ", /* 2 */ - "[VKILL] ", /* 3 */ - "[VEOF] ", /* 4 */ - "[VTIME] ", /* 5 */ - "[VMIN] ", /* 6 */ - "[VSWTC ", /* 7 */ - "[VSTART] ", /* 8 */ - "[VSTOP] ", /* 9 */ - "[VSUSP] ", /* 10 */ - "[VEOL] ", /* 11 */ - "[VREPRINT]", /* 12 */ - "[VDISCARD]", /* 13 */ - "[VWERASE] ", /* 14 */ - "[VLNEXT ", /* 15 */ - "[VEOL2] ", /* 16 */ - "unknown ", /* 17 */ - "unknown ", /* 18 */ - }; - - for( i = 0; i < NCCS; i++ ) { - printf( "c_cc%s = 0x%08x\n", cc_index_names[i], tp->c_cc[i] ); - } -} - - -void print_termios( struct termios *tp ) -{ - printf( "\nLooking at the current termios settings:\n\n" ); - print_c_iflag( tp ); - print_c_oflag( tp ); - print_c_cflag( tp ); - print_c_lflag( tp ); - print_c_cc( tp ); - printf( "\n" ); -} - - -unsigned long get_baud_rate( void ) -{ - unsigned long baud_rate; - - while( TRUE ) { - printf( "Enter the numerical value for the new baud rate.\n" ); - printf( "Choices are: 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800\n" ); - printf( "2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400, 460800\n" ); - printf( "\nYour choice: " ); - scanf( "%lu", &baud_rate ); - printf( "\n" ); - switch( baud_rate ) { - case 50: return B50; - case 75: return B75; - case 110: return B110; - case 134: return B134; - case 150: return B150; - case 200: return B200; - case 300: return B300; - case 600: return B600; - case 1200: return B1200; - case 1800: return B1800; - case 2400: return B2400; - case 4800: return B4800; - case 9600: return B9600; - case 19200: return B19200; - case 38400: return B38400; - case 57600: return B57600; - case 115200: return B115200; - case 230400: return B230400; - case 460800: return B460800; - - default: - printf( "%lu is not a valid choice. Try again.\n\n", baud_rate ); - break; - } - } -} - - -unsigned long get_parity() -{ - int parity; - - while( TRUE ) { - printf( "Enter the numerical value for the new parity\n" ); - printf( "Choices are: 0 for no parity, 1 for even parity, 2 for odd parity\n" ); - printf( "\nYour choice: " ); - scanf( "%d", &parity ); - printf( "\n" ); - switch( parity ) { - case 0: - return 0; - - case 1: - return PARENB; - - case 2: - return PARENB | PARODD; - - default: - printf( "%d is not a valid choice. Try again.\n\n", parity ); - break; - } - } -} - - -unsigned long get_stop_bits() -{ - int stop_bits; - - while( TRUE ) { - printf( "Enter the numerical value for the new number of stop bits\n" ); - printf( "Choices are: 1 or 2\n" ); - printf( "\nYour choice: " ); - scanf( "%d", &stop_bits ); - printf( "\n" ); - switch( stop_bits ) { - case 1: - return 0; - - case 2: - return CSTOPB; - - default: - printf( "%d is not a valid choice. Try again.\n\n", stop_bits ); - break; - } - } -} - - -unsigned long get_data_bits() -{ - int data_bits; - - while( TRUE ) { - printf( "Enter the numerical value for the new number of data bits\n" ); - printf( "Choices are: 5, 6, 7 or 8\n" ); - printf( "\nYour choice: " ); - scanf( "%d", &data_bits ); - printf( "\n" ); - switch( data_bits ) { - case 5: - return CS5; - - case 6: - return CS6; - - case 7: - return CS7; - - case 8: - return CS8; - - default: - printf( "%d is not a valid choice. Try again.\n\n", data_bits ); - break; - } - } -} - - -void change_line_settings( struct termios *tp ) -{ - unsigned long baud_rate, parity, stop_bits, data_bits, sleep_time; - - printf( "\nSetting line characteristics\n\n" ); - - baud_rate = get_baud_rate(); - parity = get_parity(); - stop_bits = get_stop_bits(); - data_bits = get_data_bits(); - - printf( "NOTE: You will not see output until you switch your terminal settings!\n" ); - printf( "WARNING: If you do not switch your terminal settings, your terminal may hang.\n" ); - printf( "Enter the number of seconds the test will wait for you to switch your terminal\n" ); - printf( "settings before it continues\n" ); - printf( "Sleep time (in seconds): " ); - scanf( "%lu", &sleep_time ); - printf( "\n" ); - printf( "Setting line to new termios settings in %lu seconds.\n", sleep_time ); - - sleep( sleep_time ); - - tp->c_cflag = CLOCAL | CREAD | parity | stop_bits | data_bits | baud_rate; - if( tcsetattr( fileno( stdin ), TCSADRAIN, tp ) < 0 ) { - perror( "change_line_settings(): tcsetattr() failed" ); - rtems_test_exit( 1 ); - } - printf( "Line settings set.\n" ); -} - - -void canonical_input( struct termios *tp ) -{ - char c, first_time = TRUE; - - printf( "\nTesting canonical input\n\n" ); - - printf( "Setting line to canonical input mode.\n" ); - tp->c_lflag = ISIG | ICANON | ECHO | ECHONL | ECHOK | ECHOE | ECHOPRT | ECHOCTL | IEXTEN; - tp->c_iflag = BRKINT | ICRNL | IXON | IMAXBEL; - if( tcsetattr( fileno( stdin ), TCSADRAIN, tp ) < 0 ) { - perror( "canonical_input(): tcsetattr() failed" ); - rtems_test_exit( 1 ); - } - - while ( ( c = getchar () ) != '\n'); - printf( "Testing getchar(). Type some text followed by carriage return\n" ); - printf( "Each character you entered will be echoed back to you\n\n" ); - while ( ( c = getchar () ) != '\n') { - if( first_time ) { - printf( "\nYou typed:\n"); - first_time = FALSE; - } - printf( "%c", c ); - } - printf( "\n\nCanonical input test done.\n" ); -} - - -/* - * Test raw (ICANON=0) input - */ -void do_raw_input( int vmin, int vtime ) -{ - int i; - struct termios old, new; - rtems_interval ticksPerSecond, then, now; - unsigned int msec; - unsigned long count; - int nread; - unsigned char cbuf[100]; - - printf( "Raw input test with VMIN=%d VTIME=%d\n", vmin, vtime ); - - rtems_clock_get( RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticksPerSecond ); - if ( tcgetattr( fileno ( stdin ), &old ) < 0 ) { - perror( "do_raw_input(): tcgetattr() failed" ); - return; - } - - new = old; - new.c_lflag &= ~( ICANON | ECHO | ECHONL | ECHOK | ECHOE | ECHOPRT | ECHOCTL ); - new.c_cc[VMIN] = vmin; - new.c_cc[VTIME] = vtime; - if( tcsetattr( fileno( stdin ), TCSADRAIN, &new ) < 0 ) { - perror ("do_raw_input(): tcsetattr() failed" ); - return; - } - - do { - rtems_clock_get( RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &then ); - count = 0; - for(;;) { - nread = read( fileno( stdin ), cbuf, sizeof cbuf ); - if( nread < 0 ) { - perror( "do_raw_input(): read() failed" ); - goto out; - } - count++; - if( nread != 0 ) - break; - } - rtems_clock_get( RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &now ); - msec = (now - then) * 1000 / ticksPerSecond; - printf( "Count:%-10lu Interval:%3u.%3.3d Char:", - count, msec / 1000, msec % 1000 ); - - for( i = 0 ; i < nread ; i++ ) - printf (" 0x%2.2x", cbuf[i]); - printf ("\n"); - - } while( cbuf[0] != 'q' ); - -out: - if( tcsetattr( fileno( stdin ), TCSADRAIN, &old) < 0 ) - perror("do_raw_input(): tcsetattr() failed: %s\n" ); - - printf ("*** End of Raw input VMIN=%d VTIME=%d ***\n", vmin, vtime); -} - - -static void raw_input( struct termios *tp ) -{ - printf( "\nTesting raw input input\n\n" ); - printf( "Hit 'q' to terminate the test\n" ); - - do_raw_input( 0, 0 ); - do_raw_input( 0, 20 ); - do_raw_input( 5, 0 ); - do_raw_input( 5, 20 ); - - printf( "\nRaw input test done.\n" ); -} - - -void usage( void ) -{ - printf( "\nYou have the following choices:\n" ); - printf( " 1 - Reset the struct termios\n" ); - printf( " 2 - Look at the current termios setting\n" ); - printf( " 3 - Change the line characteristics\n" ); - printf( " 4 - Test canonical input\n" ); - printf( " 5 - Test raw input\n" ); - printf( " 9 - Exit\n" ); - printf( "Enter your choice (1 to 5 or 9, followed by a carriage return): " ); -} - - -/* - * RTEMS Startup Task - */ -rtems_task -Init (rtems_task_argument ignored) -{ - char c ; - struct termios orig_termios, test_termios; - - printf( "\n\n*** TEST OF TERMIOS INPUT CAPABILITIES ***\n" ); - - if( tcgetattr( fileno( stdin ), &orig_termios ) < 0 ) { - perror( "tcgetattr() failed" ); - rtems_test_exit( 0 ); - } - - test_termios = orig_termios; - - usage(); - for(;;) { - switch( c = getchar() ) { - case '1': - printf( "\nResetting the line to the original termios setting\n\n" ); - test_termios = orig_termios; - if( tcsetattr( fileno( stdin ), TCSADRAIN, &test_termios ) < 0 ) { - perror( "tcsetattr() failed" ); - rtems_test_exit( 1 ); - } - usage(); - break; - - case '2': - print_termios( &test_termios ); - usage(); - break; - - case '3': - change_line_settings( &test_termios ); - usage(); - break; - - case '4': - canonical_input( &test_termios ); - usage(); - break; - - case '5': - raw_input( &test_termios ); - usage(); - break; - - case '9': - rtems_test_exit( 1 ); - - case '\n': - break; - - default: - printf( "\n%c is not a valid choice. Try again\n\n", c ); - usage(); - break; - } - } -} - diff --git a/testsuites/mptests/.cvsignore b/testsuites/mptests/.cvsignore deleted file mode 100644 index bfdfd995be..0000000000 --- a/testsuites/mptests/.cvsignore +++ /dev/null @@ -1,14 +0,0 @@ -aclocal.m4 -autom4te*.cache -config.cache -config.guess -config.log -config.status -config.sub -configure -depcomp -install-sh -Makefile -Makefile.in -missing -mkinstalldirs diff --git a/testsuites/mptests/ChangeLog b/testsuites/mptests/ChangeLog deleted file mode 100644 index 7f5c9697a6..0000000000 --- a/testsuites/mptests/ChangeLog +++ /dev/null @@ -1,197 +0,0 @@ -2003-02-11 Ralf Corsepius - - * configure.ac: AM_INIT_AUTOMAKE([1.7.2]). - -2003-02-11 Ralf Corsepius - - * configure.ac: AC_PREREQ(2.57). - -2002-10-21 Ralf Corsepius - - * .cvsignore: Reformat. - Add autom4te*cache. - Remove autom4te.cache. - -2002-08-11 Ralf Corsepius - - * mp01/node1/Makefile.am: Use $(OBJEXT) instead of .o. - * mp01/node2/Makefile.am: Use $(OBJEXT) instead of .o. - * mp02/node1/Makefile.am: Use $(OBJEXT) instead of .o. - * mp02/node2/Makefile.am: Use $(OBJEXT) instead of .o. - * mp03/node1/Makefile.am: Use $(OBJEXT) instead of .o. - * mp03/node2/Makefile.am: Use $(OBJEXT) instead of .o. - * mp04/node1/Makefile.am: Use $(OBJEXT) instead of .o. - * mp04/node2/Makefile.am: Use $(OBJEXT) instead of .o. - * mp05/node1/Makefile.am: Use $(OBJEXT) instead of .o. - * mp05/node2/Makefile.am: Use $(OBJEXT) instead of .o. - * mp06/node1/Makefile.am: Use $(OBJEXT) instead of .o. - * mp06/node2/Makefile.am: Use $(OBJEXT) instead of .o. - * mp07/node1/Makefile.am: Use $(OBJEXT) instead of .o. - * mp07/node2/Makefile.am: Use $(OBJEXT) instead of .o. - * mp08/node1/Makefile.am: Use $(OBJEXT) instead of .o. - * mp08/node2/Makefile.am: Use $(OBJEXT) instead of .o. - * mp09/node1/Makefile.am: Use $(OBJEXT) instead of .o. - * mp09/node2/Makefile.am: Use $(OBJEXT) instead of .o. - * mp10/node1/Makefile.am: Use $(OBJEXT) instead of .o. - * mp10/node2/Makefile.am: Use $(OBJEXT) instead of .o. - * mp11/node1/Makefile.am: Use $(OBJEXT) instead of .o. - * mp11/node2/Makefile.am: Use $(OBJEXT) instead of .o. - * mp12/node1/Makefile.am: Use $(OBJEXT) instead of .o. - * mp12/node2/Makefile.am: Use $(OBJEXT) instead of .o. - * mp13/node1/Makefile.am: Use $(OBJEXT) instead of .o. - * mp13/node2/Makefile.am: Use $(OBJEXT) instead of .o. - * mp14/node1/Makefile.am: Use $(OBJEXT) instead of .o. - * mp14/node2/Makefile.am: Use $(OBJEXT) instead of .o. - -2002-08-01 Joel Sherrill - - * Per PR47 add support for buffered test output. This involved - adding defines to redirect output to a buffer and dump it when - full, at "test pause", and at exit. To avoid problems when redefining - exit(), all tests were modified to call rtems_test_exit(). - Some tests, notable psxtests, had to be modified to include - the standard test macro .h file (pmacros.h or tmacros.h) to - enable this support. - * mp01/task1.c, mp02/task1.c, mp03/task1.c, mp04/task1.c, mp05/task1.c, - mp06/task1.c, mp07/task1.c, mp08/task1.c, mp09/task1.c, mp10/init.c, - mp11/init.c, mp12/init.c, mp13/init.c, mp13/task2.c: Modified. - -2002-04-14 Ralf Corsepius - - * configure.ac: Remove ENABLE_GCC28. - -2002-03-27 Ralf Corsepius - - * configure.ac: - AC_INIT(package,_RTEMS_VERSION,_RTEMS_BUGS). - AM_INIT_AUTOMAKE([no-define foreign 1.6]). - * mp01/node1/Makefile.am: Remove AUTOMAKE_OPTIONS. - * mp01/Makefile.am: Remove AUTOMAKE_OPTIONS. - * mp01/node2/Makefile.am: Remove AUTOMAKE_OPTIONS. - * mp02/node1/Makefile.am: Remove AUTOMAKE_OPTIONS. - * mp02/Makefile.am: Remove AUTOMAKE_OPTIONS. - * mp02/node2/Makefile.am: Remove AUTOMAKE_OPTIONS. - * Makefile.am: Remove AUTOMAKE_OPTIONS. - * mp03/node1/Makefile.am: Remove AUTOMAKE_OPTIONS. - * mp03/Makefile.am: Remove AUTOMAKE_OPTIONS. - * mp03/node2/Makefile.am: Remove AUTOMAKE_OPTIONS. - * mp04/node1/Makefile.am: Remove AUTOMAKE_OPTIONS. - * mp04/Makefile.am: Remove AUTOMAKE_OPTIONS. - * mp04/node2/Makefile.am: Remove AUTOMAKE_OPTIONS. - * mp05/node1/Makefile.am: Remove AUTOMAKE_OPTIONS. - * mp05/Makefile.am: Remove AUTOMAKE_OPTIONS. - * mp05/node2/Makefile.am: Remove AUTOMAKE_OPTIONS. - * mp06/node1/Makefile.am: Remove AUTOMAKE_OPTIONS. - * mp06/Makefile.am: Remove AUTOMAKE_OPTIONS. - * mp06/node2/Makefile.am: Remove AUTOMAKE_OPTIONS. - * mp07/node1/Makefile.am: Remove AUTOMAKE_OPTIONS. - * mp07/Makefile.am: Remove AUTOMAKE_OPTIONS. - * mp07/node2/Makefile.am: Remove AUTOMAKE_OPTIONS. - * mp08/node1/Makefile.am: Remove AUTOMAKE_OPTIONS. - * mp08/Makefile.am: Remove AUTOMAKE_OPTIONS. - * mp08/node2/Makefile.am: Remove AUTOMAKE_OPTIONS. - * mp09/node1/Makefile.am: Remove AUTOMAKE_OPTIONS. - * mp09/Makefile.am: Remove AUTOMAKE_OPTIONS. - * mp09/node2/Makefile.am: Remove AUTOMAKE_OPTIONS. - * mp10/node1/Makefile.am: Remove AUTOMAKE_OPTIONS. - * mp10/Makefile.am: Remove AUTOMAKE_OPTIONS. - * mp10/node2/Makefile.am: Remove AUTOMAKE_OPTIONS. - * mp11/node1/Makefile.am: Remove AUTOMAKE_OPTIONS. - * mp11/Makefile.am: Remove AUTOMAKE_OPTIONS. - * mp11/node2/Makefile.am: Remove AUTOMAKE_OPTIONS. - * mp12/node1/Makefile.am: Remove AUTOMAKE_OPTIONS. - * mp12/Makefile.am: Remove AUTOMAKE_OPTIONS. - * mp12/node2/Makefile.am: Remove AUTOMAKE_OPTIONS. - * mp13/node1/Makefile.am: Remove AUTOMAKE_OPTIONS. - * mp13/Makefile.am: Remove AUTOMAKE_OPTIONS. - * mp13/node2/Makefile.am: Remove AUTOMAKE_OPTIONS. - * mp14/node1/Makefile.am: Remove AUTOMAKE_OPTIONS. - * mp14/Makefile.am: Remove AUTOMAKE_OPTIONS. - * mp14/node2/Makefile.am: Remove AUTOMAKE_OPTIONS. - -2001-11-07 Joel Sherrill - - Tracked as PR72 but related to the object id problem (PR36) - reported by Todor.Todorov@barco.com. - * mp03/delay.c: Dispatch disable level is actually 1 not 0. - * mp13/system.h: Configure enough tasks (CONFIGURE_MAXIMUM_TASKS=3). - * mp14/delay.c: Dispatch disable level may be arbitrarily > 0. -2001-10-11 Ralf Corsepius - - * .cvsignore: Add autom4te.cache for autoconf > 2.52. - * configure.in: Remove. - * configure.ac: New file, generated from configure.in by autoupdate. - -2001-09-22 Ralf Corsepius - - * mptests.am: Use TMPINSTALL_FILES = to make automake-1.5 happy. - -2001-09-19 Ralf Corsepius - - * mp02/node2/Makefile.am: include leaf.am instead of leaf.cfg. - * mp02/node1/Makefile.am: include leaf.am instead of leaf.cfg. - * mp04/node2/Makefile.am: include leaf.am instead of leaf.cfg. - * mp04/node1/Makefile.am: include leaf.am instead of leaf.cfg. - * mp14/node2/Makefile.am: include leaf.am instead of leaf.cfg. - * mp14/node1/Makefile.am: include leaf.am instead of leaf.cfg. - * mp06/node2/Makefile.am: include leaf.am instead of leaf.cfg. - * mp06/node1/Makefile.am: include leaf.am instead of leaf.cfg. - * mp08/node2/Makefile.am: include leaf.am instead of leaf.cfg. - * mp08/node1/Makefile.am: include leaf.am instead of leaf.cfg. - * mp03/node2/Makefile.am: include leaf.am instead of leaf.cfg. - * mp03/node1/Makefile.am: include leaf.am instead of leaf.cfg. - * mp10/node2/Makefile.am: include leaf.am instead of leaf.cfg. - * mp10/node1/Makefile.am: include leaf.am instead of leaf.cfg. - * mp05/node2/Makefile.am: include leaf.am instead of leaf.cfg. - * mp05/node1/Makefile.am: include leaf.am instead of leaf.cfg. - * mp13/node2/Makefile.am: include leaf.am instead of leaf.cfg. - * mp13/node1/Makefile.am: include leaf.am instead of leaf.cfg. - * mp01/node2/Makefile.am: include leaf.am instead of leaf.cfg. - * mp01/node1/Makefile.am: include leaf.am instead of leaf.cfg. - * mp07/node2/Makefile.am: include leaf.am instead of leaf.cfg. - * mp07/node1/Makefile.am: include leaf.am instead of leaf.cfg. - * mp11/node2/Makefile.am: include leaf.am instead of leaf.cfg. - * mp11/node1/Makefile.am: include leaf.am instead of leaf.cfg. - * mp12/node2/Makefile.am: include leaf.am instead of leaf.cfg. - * mp12/node1/Makefile.am: include leaf.am instead of leaf.cfg. - * mp09/node2/Makefile.am: include leaf.am instead of leaf.cfg. - * mp09/node1/Makefile.am: include leaf.am instead of leaf.cfg. - -2001-05-10 Ralf Corsepius - - * configure.in: Use RTEMS_PROG_CC_FOR_TARGET([-ansi -fasm]). - -2000-11-09 Ralf Corsepius - - * Makefile.am: Use ... instead of RTEMS_TOPdir in ACLOCAL_AMFLAGS. - -2000-11-02 Ralf Corsepius - - * Makefile.am: Switch to ACLOCAL_AMFLAGS = -I $(RTEMS_TOPdir)/aclocal. - -2000-10-27 Ralf Corsepius - - * Makefile.am: ACLOCAL_AMFLAGS= -I $(RTEMS_TOPdir)/macros. - Switch to GNU canonicalization. - * mptests.am: Remove DEFS. - -2000-09-04 Ralf Corsepius - - * mp01/node1/Makefile.am, mp01/node2/Makefile.am, - mp02/node1/Makefile.am, mp02/node2/Makefile.am, - mp03/node1/Makefile.am, mp03/node2/Makefile.am, - mp04/node1/Makefile.am, mp04/node2/Makefile.am, - mp05/node1/Makefile.am, mp05/node2/Makefile.am, - mp06/node1/Makefile.am, mp06/node2/Makefile.am, - mp07/node1/Makefile.am, mp07/node2/Makefile.am, - mp08/node1/Makefile.am, mp08/node2/Makefile.am, - mp09/node1/Makefile.am, mp09/node2/Makefile.am, - mp10/node1/Makefile.am, mp10/node2/Makefile.am, - mp11/node1/Makefile.am, mp11/node2/Makefile.am, - mp12/node1/Makefile.am, mp12/node2/Makefile.am, - mp13/node1/Makefile.am, mp13/node2/Makefile.am, - mp14/node1/Makefile.am, mp14/node2/Makefile.am: Include compile.am - -2000-08-10 Joel Sherrill - - * ChangeLog: New file. diff --git a/testsuites/mptests/Makefile.am b/testsuites/mptests/Makefile.am deleted file mode 100644 index a3aeb6930e..0000000000 --- a/testsuites/mptests/Makefile.am +++ /dev/null @@ -1,13 +0,0 @@ -## -## $Id$ -## - -ACLOCAL_AMFLAGS = -I ../../../../aclocal - -SUBDIRS = mp01 mp02 mp03 mp04 mp05 mp06 mp07 mp08 mp09 mp10 mp11 mp12 mp13 \ - mp14 - -EXTRA_DIST = mptests.am - -include $(top_srcdir)/../../../../automake/subdirs.am -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/mptests/README b/testsuites/mptests/README deleted file mode 100644 index 68cb459b55..0000000000 --- a/testsuites/mptests/README +++ /dev/null @@ -1,10 +0,0 @@ -# -# $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/configure.ac b/testsuites/mptests/configure.ac deleted file mode 100644 index 450b793a64..0000000000 --- a/testsuites/mptests/configure.ac +++ /dev/null @@ -1,85 +0,0 @@ -## Process this file with autoconf to produce a configure script. -## -## $Id$ - -AC_PREREQ(2.57) -AC_INIT([rtems-c-src-tests-mptests],[_RTEMS_VERSION],[rtems-bugs@OARcorp.com]) -AC_CONFIG_SRCDIR([mp01]) -RTEMS_TOP(../../../..) -AC_CONFIG_AUX_DIR(../../../..) - -RTEMS_CANONICAL_TARGET_CPU - -AM_INIT_AUTOMAKE([no-define foreign 1.7.2]) -AM_MAINTAINER_MODE - -RTEMS_ENABLE_BARE - -RTEMS_ENV_RTEMSBSP -RTEMS_CHECK_CPU -RTEMS_CANONICAL_HOST - -RTEMS_PROJECT_ROOT - -RTEMS_PROG_CC_FOR_TARGET([-ansi -fasm]) - -RTEMS_CANONICALIZE_TOOLS - -RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP) -RTEMS_CHECK_MULTIPROCESSING - -AC_SUBST(BARE_CPU_CFLAGS) -AC_SUBST(BARE_CPU_MODEL) -AC_SUBST(CC_CFLAGS_DEFAULT) -AC_SUBST(CC_CFLAGS_DEBUG_V) -AC_SUBST(CC_CFLAGS_PROFILE_V) -AC_SUBST(CC_LDFLAGS_PROFILE_V) - -AM_CONDITIONAL(HAS_MP,test "$HAS_MP" = "yes") - -# Explicitly list all Makefiles here -AC_CONFIG_FILES([Makefile -mp01/Makefile -mp01/node1/Makefile -mp01/node2/Makefile -mp02/Makefile -mp02/node1/Makefile -mp02/node2/Makefile -mp03/Makefile -mp03/node1/Makefile -mp03/node2/Makefile -mp04/Makefile -mp04/node1/Makefile -mp04/node2/Makefile -mp05/Makefile -mp05/node1/Makefile -mp05/node2/Makefile -mp06/Makefile -mp06/node1/Makefile -mp06/node2/Makefile -mp07/Makefile -mp07/node1/Makefile -mp07/node2/Makefile -mp08/Makefile -mp08/node1/Makefile -mp08/node2/Makefile -mp09/Makefile -mp09/node1/Makefile -mp09/node2/Makefile -mp10/Makefile -mp10/node1/Makefile -mp10/node2/Makefile -mp11/Makefile -mp11/node1/Makefile -mp11/node2/Makefile -mp12/Makefile -mp12/node1/Makefile -mp12/node2/Makefile -mp13/Makefile -mp13/node1/Makefile -mp13/node2/Makefile -mp14/Makefile -mp14/node1/Makefile -mp14/node2/Makefile -]) -AC_OUTPUT diff --git a/testsuites/mptests/mp01/.cvsignore b/testsuites/mptests/mp01/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/mptests/mp01/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/mptests/mp01/Makefile.am b/testsuites/mptests/mp01/Makefile.am deleted file mode 100644 index 258666c691..0000000000 --- a/testsuites/mptests/mp01/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ -## -## $Id$ -## - - -SUBDIRS = node1 node2 - -EXTRA_DIST = system.h init.c task1.c - -include $(top_srcdir)/../../../../automake/subdirs.am -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/mptests/mp01/init.c b/testsuites/mptests/mp01/init.c deleted file mode 100644 index 22b7494a6a..0000000000 --- a/testsuites/mptests/mp01/init.c +++ /dev/null @@ -1,95 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.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, - RTEMS_MINIMUM_STACK_SIZE, - 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, - RTEMS_MINIMUM_STACK_SIZE, - 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, - RTEMS_MINIMUM_STACK_SIZE, - 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/.cvsignore b/testsuites/mptests/mp01/node1/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/mptests/mp01/node1/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/mptests/mp01/node1/Makefile.am b/testsuites/mptests/mp01/node1/Makefile.am deleted file mode 100644 index 10fd3b09e2..0000000000 --- a/testsuites/mptests/mp01/node1/Makefile.am +++ /dev/null @@ -1,50 +0,0 @@ -## -## $Id$ -## - - -VPATH = @srcdir@:@srcdir@/.. - -NODE = 1 -TEST = mp01 -PGM = ${ARCH}/$(TEST)-node$(NODE).exe - -MANAGERS = io mp - -C_FILES = init.c task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/mptests.am - -AM_CPPFLAGS += -DNODE_NUMBER=$(NODE) -I$(srcdir)/.. - -if HAS_MP - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) -else -all-local: -endif - -EXTRA_DIST = $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/mptests/mp01/node1/mp01.doc b/testsuites/mptests/mp01/node1/mp01.doc deleted file mode 100644 index 58810185c6..0000000000 --- a/testsuites/mptests/mp01/node1/mp01.doc +++ /dev/null @@ -1,52 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - -This file describes the directives and concepts tested by this test set. - -test set name: 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 deleted file mode 100644 index d399f79b2a..0000000000 --- a/testsuites/mptests/mp01/node1/mp01.scn +++ /dev/null @@ -1,15 +0,0 @@ -*** 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/.cvsignore b/testsuites/mptests/mp01/node2/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/mptests/mp01/node2/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/mptests/mp01/node2/Makefile.am b/testsuites/mptests/mp01/node2/Makefile.am deleted file mode 100644 index 6c3259a8df..0000000000 --- a/testsuites/mptests/mp01/node2/Makefile.am +++ /dev/null @@ -1,50 +0,0 @@ -## -## $Id$ -## - - -VPATH = @srcdir@:@srcdir@/.. - -NODE = 2 -TEST = mp01 -PGM = ${ARCH}/$(TEST)-node$(NODE).exe - -MANAGERS = io mp - -C_FILES = init.c task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/mptests.am - -AM_CPPFLAGS += -DNODE_NUMBER=$(NODE) -I$(srcdir)/.. - -if HAS_MP - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) -else -all-local: -endif - -EXTRA_DIST = $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/mptests/mp01/node2/mp01.doc b/testsuites/mptests/mp01/node2/mp01.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/mptests/mp01/node2/mp01.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/mptests/mp01/node2/mp01.scn b/testsuites/mptests/mp01/node2/mp01.scn deleted file mode 100644 index c9831ff9db..0000000000 --- a/testsuites/mptests/mp01/node2/mp01.scn +++ /dev/null @@ -1,15 +0,0 @@ -*** 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 deleted file mode 100644 index c4f9ac18b2..0000000000 --- a/testsuites/mptests/mp01/system.h +++ /dev/null @@ -1,47 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_task Test_task( - rtems_task_argument argument -); - -/* configuration information */ - -#define CONFIGURE_MP_APPLICATION - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 4 - -#define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_GLOBAL -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* variables */ - -TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */ - -/* end of include file */ diff --git a/testsuites/mptests/mp01/task1.c b/testsuites/mptests/mp01/task1.c deleted file mode 100644 index b41c75582e..0000000000 --- a/testsuites/mptests/mp01/task1.c +++ /dev/null @@ -1,83 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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 ) * 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" ); - 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 ***" ); - rtems_test_exit(0); - } -} diff --git a/testsuites/mptests/mp02/.cvsignore b/testsuites/mptests/mp02/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/mptests/mp02/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/mptests/mp02/Makefile.am b/testsuites/mptests/mp02/Makefile.am deleted file mode 100644 index 258666c691..0000000000 --- a/testsuites/mptests/mp02/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ -## -## $Id$ -## - - -SUBDIRS = node1 node2 - -EXTRA_DIST = system.h init.c task1.c - -include $(top_srcdir)/../../../../automake/subdirs.am -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/mptests/mp02/init.c b/testsuites/mptests/mp02/init.c deleted file mode 100644 index aee81c906c..0000000000 --- a/testsuites/mptests/mp02/init.c +++ /dev/null @@ -1,59 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.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, - RTEMS_MINIMUM_STACK_SIZE, - 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/.cvsignore b/testsuites/mptests/mp02/node1/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/mptests/mp02/node1/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/mptests/mp02/node1/Makefile.am b/testsuites/mptests/mp02/node1/Makefile.am deleted file mode 100644 index 04081b910c..0000000000 --- a/testsuites/mptests/mp02/node1/Makefile.am +++ /dev/null @@ -1,50 +0,0 @@ -## -## $Id$ -## - - -VPATH = @srcdir@:@srcdir@/.. - -NODE = 1 -TEST = mp02 -PGM = ${ARCH}/$(TEST)-node$(NODE).exe - -MANAGERS = io mp - -C_FILES = init.c task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/mptests.am - -AM_CPPFLAGS += -DNODE_NUMBER=$(NODE) -I$(srcdir)/.. - -if HAS_MP - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) -else -all-local: -endif - -EXTRA_DIST = $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/mptests/mp02/node1/mp02.doc b/testsuites/mptests/mp02/node1/mp02.doc deleted file mode 100644 index e8e1fed5fb..0000000000 --- a/testsuites/mptests/mp02/node1/mp02.doc +++ /dev/null @@ -1,46 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - -This file describes the directives and concepts tested by this test set. - -test set name: 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 deleted file mode 100644 index 72fdefe69d..0000000000 --- a/testsuites/mptests/mp02/node1/mp02.scn +++ /dev/null @@ -1,14 +0,0 @@ -*** 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/.cvsignore b/testsuites/mptests/mp02/node2/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/mptests/mp02/node2/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/mptests/mp02/node2/Makefile.am b/testsuites/mptests/mp02/node2/Makefile.am deleted file mode 100644 index 5815c167b1..0000000000 --- a/testsuites/mptests/mp02/node2/Makefile.am +++ /dev/null @@ -1,50 +0,0 @@ -## -## $Id$ -## - - -VPATH = @srcdir@:@srcdir@/.. - -NODE = 2 -TEST = mp02 -PGM = ${ARCH}/$(TEST)-node$(NODE).exe - -MANAGERS = io mp - -C_FILES = init.c task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/mptests.am - -AM_CPPFLAGS += -DNODE_NUMBER=$(NODE) -I$(srcdir)/.. - -if HAS_MP - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) -else -all-local: -endif - -EXTRA_DIST = $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/mptests/mp02/node2/mp02.doc b/testsuites/mptests/mp02/node2/mp02.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/mptests/mp02/node2/mp02.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/mptests/mp02/node2/mp02.scn b/testsuites/mptests/mp02/node2/mp02.scn deleted file mode 100644 index 233a910999..0000000000 --- a/testsuites/mptests/mp02/node2/mp02.scn +++ /dev/null @@ -1,14 +0,0 @@ -*** 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 deleted file mode 100644 index c3a31ce812..0000000000 --- a/testsuites/mptests/mp02/system.h +++ /dev/null @@ -1,46 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_task Test_task( - rtems_task_argument argument -); - -/* configuration information */ - -#define CONFIGURE_MP_APPLICATION - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 2 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* variables */ - -TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */ - -/* end of include file */ diff --git a/testsuites/mptests/mp02/task1.c b/testsuites/mptests/mp02/task1.c deleted file mode 100644 index 2eb7685f83..0000000000 --- a/testsuites/mptests/mp02/task1.c +++ /dev/null @@ -1,117 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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), ¬e ); - 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 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/mptests/mp03/.cvsignore b/testsuites/mptests/mp03/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/mptests/mp03/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/mptests/mp03/Makefile.am b/testsuites/mptests/mp03/Makefile.am deleted file mode 100644 index 96df97c368..0000000000 --- a/testsuites/mptests/mp03/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ -## -## $Id$ -## - - -SUBDIRS = node1 node2 - -EXTRA_DIST = system.h delay.c init.c task1.c - -include $(top_srcdir)/../../../../automake/subdirs.am -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/mptests/mp03/delay.c b/testsuites/mptests/mp03/delay.c deleted file mode 100644 index 666dd3c1e8..0000000000 --- a/testsuites/mptests/mp03/delay.c +++ /dev/null @@ -1,30 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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_with_level( status, "rtems_event_send", 1 ); -} diff --git a/testsuites/mptests/mp03/init.c b/testsuites/mptests/mp03/init.c deleted file mode 100644 index edf1060d92..0000000000 --- a/testsuites/mptests/mp03/init.c +++ /dev/null @@ -1,64 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.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, - RTEMS_MINIMUM_STACK_SIZE, - 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/.cvsignore b/testsuites/mptests/mp03/node1/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/mptests/mp03/node1/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/mptests/mp03/node1/Makefile.am b/testsuites/mptests/mp03/node1/Makefile.am deleted file mode 100644 index 704f4062cd..0000000000 --- a/testsuites/mptests/mp03/node1/Makefile.am +++ /dev/null @@ -1,50 +0,0 @@ -## -## $Id$ -## - - -VPATH = @srcdir@:@srcdir@/.. - -NODE = 1 -TEST = mp03 -PGM = ${ARCH}/$(TEST)-node$(NODE).exe - -MANAGERS = io mp timer event - -C_FILES = init.c task1.c delay.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/mptests.am - -AM_CPPFLAGS += -DNODE_NUMBER=$(NODE) -I$(srcdir)/.. - -if HAS_MP - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) -else -all-local: -endif - -EXTRA_DIST = $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/mptests/mp03/node1/mp03.doc b/testsuites/mptests/mp03/node1/mp03.doc deleted file mode 100644 index da8d744432..0000000000 --- a/testsuites/mptests/mp03/node1/mp03.doc +++ /dev/null @@ -1,44 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - -This file describes the directives and concepts tested by this test set. - -test set name: 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 deleted file mode 100644 index 129e5bccba..0000000000 --- a/testsuites/mptests/mp03/node1/mp03.scn +++ /dev/null @@ -1,24 +0,0 @@ -*** TEST 3 -- NODE 1 *** -Creating Test_task (Global) -Starting Test_task (Global) -Deleting initialization task -Getting TID of remote task -Remote task's name is : 222 -111 - Suspending remote task -111 - Resuming remote task -111 - Suspending remote task -111 - Resuming remote task -111 - Suspending remote task -111 - Resuming remote task -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/.cvsignore b/testsuites/mptests/mp03/node2/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/mptests/mp03/node2/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/mptests/mp03/node2/Makefile.am b/testsuites/mptests/mp03/node2/Makefile.am deleted file mode 100644 index b6e28cf5f5..0000000000 --- a/testsuites/mptests/mp03/node2/Makefile.am +++ /dev/null @@ -1,50 +0,0 @@ -## -## $Id$ -## - - -VPATH = @srcdir@:@srcdir@/.. - -NODE = 2 -TEST = mp03 -PGM = ${ARCH}/$(TEST)-node$(NODE).exe - -MANAGERS = io mp timer event - -C_FILES = init.c delay.c task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/mptests.am - -AM_CPPFLAGS += -DNODE_NUMBER=$(NODE) -I$(srcdir)/.. - -if HAS_MP - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) -else -all-local: -endif - -EXTRA_DIST = $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/mptests/mp03/node2/mp03.doc b/testsuites/mptests/mp03/node2/mp03.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/mptests/mp03/node2/mp03.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/mptests/mp03/node2/mp03.scn b/testsuites/mptests/mp03/node2/mp03.scn deleted file mode 100644 index d77c09e9f7..0000000000 --- a/testsuites/mptests/mp03/node2/mp03.scn +++ /dev/null @@ -1,24 +0,0 @@ -*** TEST 3 -- NODE 2 *** -Creating Test_task (Global) -Starting Test_task (Global) -Deleting initialization task -Getting TID of remote task -Remote task's name is : 111 -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 deleted file mode 100644 index 5d0636bd63..0000000000 --- a/testsuites/mptests/mp03/system.h +++ /dev/null @@ -1,58 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_task Test_task( - rtems_task_argument argument -); - -rtems_timer_service_routine Delayed_send_event( - rtems_id ignored_id, - void *ignored_address -); - -/* configuration information */ - -#define CONFIGURE_MP_APPLICATION - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 2 -#define CONFIGURE_MAXIMUM_TIMERS 1 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* variables */ - -TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */ - -TEST_EXTERN rtems_id Timer_id[ 2 ]; /* array of timer ids */ -TEST_EXTERN rtems_name Timer_name[ 2 ]; /* array of timer names */ - -TEST_EXTERN rtems_unsigned32 remote_node; -TEST_EXTERN rtems_id remote_tid; - -/* end of include file */ diff --git a/testsuites/mptests/mp03/task1.c b/testsuites/mptests/mp03/task1.c deleted file mode 100644 index ebad136dca..0000000000 --- a/testsuites/mptests/mp03/task1.c +++ /dev/null @@ -1,154 +0,0 @@ -/* Test_task - * - * This task suspends and resumes a remote task. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/mptests/mp04/.cvsignore b/testsuites/mptests/mp04/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/mptests/mp04/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/mptests/mp04/Makefile.am b/testsuites/mptests/mp04/Makefile.am deleted file mode 100644 index 258666c691..0000000000 --- a/testsuites/mptests/mp04/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ -## -## $Id$ -## - - -SUBDIRS = node1 node2 - -EXTRA_DIST = system.h init.c task1.c - -include $(top_srcdir)/../../../../automake/subdirs.am -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/mptests/mp04/init.c b/testsuites/mptests/mp04/init.c deleted file mode 100644 index 05d2959e3b..0000000000 --- a/testsuites/mptests/mp04/init.c +++ /dev/null @@ -1,59 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.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, - RTEMS_MINIMUM_STACK_SIZE, - 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/.cvsignore b/testsuites/mptests/mp04/node1/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/mptests/mp04/node1/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/mptests/mp04/node1/Makefile.am b/testsuites/mptests/mp04/node1/Makefile.am deleted file mode 100644 index 91a97ca4cd..0000000000 --- a/testsuites/mptests/mp04/node1/Makefile.am +++ /dev/null @@ -1,50 +0,0 @@ -## -## $Id$ -## - - -VPATH = @srcdir@:@srcdir@/.. - -NODE = 1 -TEST = mp04 -PGM = ${ARCH}/$(TEST)-node$(NODE).exe - -MANAGERS = io mp - -C_FILES = init.c task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/mptests.am - -AM_CPPFLAGS += -DNODE_NUMBER=$(NODE) -I$(srcdir)/.. - -if HAS_MP - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) -else -all-local: -endif - -EXTRA_DIST = $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/mptests/mp04/node1/mp04.doc b/testsuites/mptests/mp04/node1/mp04.doc deleted file mode 100644 index d9330e0799..0000000000 --- a/testsuites/mptests/mp04/node1/mp04.doc +++ /dev/null @@ -1,40 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - -This file describes the directives and concepts tested by this test set. - -test set name: 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 deleted file mode 100644 index e9518f3ac2..0000000000 --- a/testsuites/mptests/mp04/node1/mp04.scn +++ /dev/null @@ -1,8 +0,0 @@ -*** TEST 4 -- NODE 1 *** -Creating Test_task (Global) -Starting Test_task (Global) -Deleting initialization task -Getting TID of remote task -Remote task's name is : 222 -Local task priority has been set -*** END OF TEST 4 *** diff --git a/testsuites/mptests/mp04/node2/.cvsignore b/testsuites/mptests/mp04/node2/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/mptests/mp04/node2/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/mptests/mp04/node2/Makefile.am b/testsuites/mptests/mp04/node2/Makefile.am deleted file mode 100644 index fc6dc1bec9..0000000000 --- a/testsuites/mptests/mp04/node2/Makefile.am +++ /dev/null @@ -1,50 +0,0 @@ -## -## $Id$ -## - - -VPATH = @srcdir@:@srcdir@/.. - -NODE = 2 -TEST = mp04 -PGM = ${ARCH}/$(TEST)-node$(NODE).exe - -MANAGERS = io mp - -C_FILES = init.c task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/mptests.am - -AM_CPPFLAGS += -DNODE_NUMBER=$(NODE) -I$(srcdir)/.. - -if HAS_MP - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) -else -all-local: -endif - -EXTRA_DIST = $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/mptests/mp04/node2/mp04.doc b/testsuites/mptests/mp04/node2/mp04.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/mptests/mp04/node2/mp04.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/mptests/mp04/node2/mp04.scn b/testsuites/mptests/mp04/node2/mp04.scn deleted file mode 100644 index 8ccfcfef79..0000000000 --- a/testsuites/mptests/mp04/node2/mp04.scn +++ /dev/null @@ -1,8 +0,0 @@ -*** TEST 4 -- NODE 2 *** -Creating Test_task (Global) -Starting Test_task (Global) -Deleting initialization task -Getting TID of remote task -Remote task's name is : 111 -Local task priority has been set -*** END OF TEST 4 *** diff --git a/testsuites/mptests/mp04/system.h b/testsuites/mptests/mp04/system.h deleted file mode 100644 index ab91566559..0000000000 --- a/testsuites/mptests/mp04/system.h +++ /dev/null @@ -1,47 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_task Test_task( - rtems_task_argument argument -); - -/* configuration information */ - -#define CONFIGURE_MP_APPLICATION - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 2 -#define CONFIGURE_MAXIMUM_TIMERS 1 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* variables */ - -TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */ - -/* end of include file */ diff --git a/testsuites/mptests/mp04/task1.c b/testsuites/mptests/mp04/task1.c deleted file mode 100644 index c403b864b4..0000000000 --- a/testsuites/mptests/mp04/task1.c +++ /dev/null @@ -1,82 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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 - ); - rtems_test_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 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/mptests/mp05/.cvsignore b/testsuites/mptests/mp05/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/mptests/mp05/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/mptests/mp05/Makefile.am b/testsuites/mptests/mp05/Makefile.am deleted file mode 100644 index 3aef092e1a..0000000000 --- a/testsuites/mptests/mp05/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ -## -## $Id$ -## - - -SUBDIRS = node1 node2 - -EXTRA_DIST = system.h asr.c init.c task1.c - -include $(top_srcdir)/../../../../automake/subdirs.am -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/mptests/mp05/asr.c b/testsuites/mptests/mp05/asr.c deleted file mode 100644 index 793211faf9..0000000000 --- a/testsuites/mptests/mp05/asr.c +++ /dev/null @@ -1,36 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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 deleted file mode 100644 index 63dee28d0b..0000000000 --- a/testsuites/mptests/mp05/init.c +++ /dev/null @@ -1,64 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.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, - RTEMS_MINIMUM_STACK_SIZE * 2, - 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/.cvsignore b/testsuites/mptests/mp05/node1/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/mptests/mp05/node1/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/mptests/mp05/node1/Makefile.am b/testsuites/mptests/mp05/node1/Makefile.am deleted file mode 100644 index 7562caa7b9..0000000000 --- a/testsuites/mptests/mp05/node1/Makefile.am +++ /dev/null @@ -1,50 +0,0 @@ -## -## $Id$ -## - - -VPATH = @srcdir@:@srcdir@/.. - -NODE = 1 -TEST = mp05 -PGM = ${ARCH}/$(TEST)-node$(NODE).exe - -MANAGERS = io mp signal timer - -C_FILES = init.c asr.c task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/mptests.am - -AM_CPPFLAGS += -DNODE_NUMBER=$(NODE) -I$(srcdir)/.. - -if HAS_MP - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) -else -all-local: -endif - -EXTRA_DIST = $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/mptests/mp05/node1/mp05.doc b/testsuites/mptests/mp05/node1/mp05.doc deleted file mode 100644 index f22bd1c204..0000000000 --- a/testsuites/mptests/mp05/node1/mp05.doc +++ /dev/null @@ -1,44 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - -This file describes the directives and concepts tested by this test set. - -test set name: 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 deleted file mode 100644 index 472740ba18..0000000000 --- a/testsuites/mptests/mp05/node1/mp05.scn +++ /dev/null @@ -1,11 +0,0 @@ -*** 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/.cvsignore b/testsuites/mptests/mp05/node2/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/mptests/mp05/node2/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/mptests/mp05/node2/Makefile.am b/testsuites/mptests/mp05/node2/Makefile.am deleted file mode 100644 index e2b2e2e0ea..0000000000 --- a/testsuites/mptests/mp05/node2/Makefile.am +++ /dev/null @@ -1,50 +0,0 @@ -## -## $Id$ -## - - -VPATH = @srcdir@:@srcdir@/.. - -NODE = 2 -TEST = mp05 -PGM = ${ARCH}/$(TEST)-node$(NODE).exe - -MANAGERS = io mp signal timer - -C_FILES = init.c asr.c task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/mptests.am - -AM_CPPFLAGS += -DNODE_NUMBER=$(NODE) -I$(srcdir)/.. - -if HAS_MP - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) -else -all-local: -endif - -EXTRA_DIST = $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/mptests/mp05/node2/mp05.doc b/testsuites/mptests/mp05/node2/mp05.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/mptests/mp05/node2/mp05.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/mptests/mp05/node2/mp05.scn b/testsuites/mptests/mp05/node2/mp05.scn deleted file mode 100644 index 0c4b412f65..0000000000 --- a/testsuites/mptests/mp05/node2/mp05.scn +++ /dev/null @@ -1,10 +0,0 @@ -*** 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 deleted file mode 100644 index e19f049fab..0000000000 --- a/testsuites/mptests/mp05/system.h +++ /dev/null @@ -1,63 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_task Test_task( - rtems_task_argument argument -); - -rtems_asr Process_asr( rtems_signal_set ); - -/* configuration information */ - -#define CONFIGURE_MP_APPLICATION - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 2 -#define CONFIGURE_MAXIMUM_TIMERS 1 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_EXTRA_TASK_STACKS (1 * RTEMS_MINIMUM_STACK_SIZE) - -#include - -/* variables */ - -TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */ - -TEST_EXTERN rtems_id Timer_id[ 2 ]; /* array of timer ids */ -TEST_EXTERN rtems_name Timer_name[ 2 ]; /* array of timer names */ - -TEST_EXTERN volatile rtems_boolean Stop_Test; - -TEST_EXTERN rtems_unsigned32 remote_node; -TEST_EXTERN rtems_id remote_tid; -TEST_EXTERN rtems_signal_set remote_signal; -TEST_EXTERN rtems_signal_set expected_signal; -TEST_EXTERN volatile rtems_unsigned32 signal_count; -TEST_EXTERN volatile rtems_unsigned32 signal_caught; - -/* end of include file */ diff --git a/testsuites/mptests/mp05/task1.c b/testsuites/mptests/mp05/task1.c deleted file mode 100644 index a7a6ada8d4..0000000000 --- a/testsuites/mptests/mp05/task1.c +++ /dev/null @@ -1,105 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/mptests/mp06/.cvsignore b/testsuites/mptests/mp06/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/mptests/mp06/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/mptests/mp06/Makefile.am b/testsuites/mptests/mp06/Makefile.am deleted file mode 100644 index 258666c691..0000000000 --- a/testsuites/mptests/mp06/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ -## -## $Id$ -## - - -SUBDIRS = node1 node2 - -EXTRA_DIST = system.h init.c task1.c - -include $(top_srcdir)/../../../../automake/subdirs.am -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/mptests/mp06/init.c b/testsuites/mptests/mp06/init.c deleted file mode 100644 index a45fac3766..0000000000 --- a/testsuites/mptests/mp06/init.c +++ /dev/null @@ -1,64 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.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, - RTEMS_MINIMUM_STACK_SIZE, - 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/.cvsignore b/testsuites/mptests/mp06/node1/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/mptests/mp06/node1/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/mptests/mp06/node1/Makefile.am b/testsuites/mptests/mp06/node1/Makefile.am deleted file mode 100644 index aada10be37..0000000000 --- a/testsuites/mptests/mp06/node1/Makefile.am +++ /dev/null @@ -1,50 +0,0 @@ -## -## $Id$ -## - - -VPATH = @srcdir@:@srcdir@/.. - -NODE = 1 -TEST = mp06 -PGM = ${ARCH}/$(TEST)-node$(NODE).exe - -MANAGERS = io mp event timer - -C_FILES = init.c task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/mptests.am - -AM_CPPFLAGS += -DNODE_NUMBER=$(NODE) -I$(srcdir)/.. - -if HAS_MP - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) -else -all-local: -endif - -EXTRA_DIST = $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/mptests/mp06/node1/mp06.doc b/testsuites/mptests/mp06/node1/mp06.doc deleted file mode 100644 index d45e24b3bd..0000000000 --- a/testsuites/mptests/mp06/node1/mp06.doc +++ /dev/null @@ -1,44 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - -This file describes the directives and concepts tested by this test set. - -test set name: 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 deleted file mode 100644 index 592777e5d7..0000000000 --- a/testsuites/mptests/mp06/node1/mp06.scn +++ /dev/null @@ -1,11 +0,0 @@ -*** TEST 6 -- NODE 1 *** -Creating Test_task (Global) -Starting Test_task (Global) -Deleting initialization task -Remote task's name is : 222 -Getting TID of remote task -Sending events to remote task -.................................................... -.................................................... -*** END OF TEST 6 *** - diff --git a/testsuites/mptests/mp06/node2/.cvsignore b/testsuites/mptests/mp06/node2/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/mptests/mp06/node2/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/mptests/mp06/node2/Makefile.am b/testsuites/mptests/mp06/node2/Makefile.am deleted file mode 100644 index 227953c6bb..0000000000 --- a/testsuites/mptests/mp06/node2/Makefile.am +++ /dev/null @@ -1,50 +0,0 @@ -## -## $Id$ -## - - -VPATH = @srcdir@:@srcdir@/.. - -NODE = 2 -TEST = mp06 -PGM = ${ARCH}/$(TEST)-node$(NODE).exe - -MANAGERS = io mp event timer - -C_FILES = init.c task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/mptests.am - -AM_CPPFLAGS += -DNODE_NUMBER=$(NODE) -I$(srcdir)/.. - -if HAS_MP - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) -else -all-local: -endif - -EXTRA_DIST = $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/mptests/mp06/node2/mp06.doc b/testsuites/mptests/mp06/node2/mp06.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/mptests/mp06/node2/mp06.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/mptests/mp06/node2/mp06.scn b/testsuites/mptests/mp06/node2/mp06.scn deleted file mode 100644 index 9cb653c2f3..0000000000 --- a/testsuites/mptests/mp06/node2/mp06.scn +++ /dev/null @@ -1,12 +0,0 @@ -*** TEST 6 -- NODE 2 *** -Creating Test_task (Global) -Starting Test_task (Global) -Deleting initialization task -Remote task's name is : 111 -Getting TID of remote task -Receiving events from remote task -.................................................... -.................................................... -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 deleted file mode 100644 index 7a38afcfcb..0000000000 --- a/testsuites/mptests/mp06/system.h +++ /dev/null @@ -1,52 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_task Test_task( - rtems_task_argument argument -); - -/* configuration information */ - -#define CONFIGURE_MP_APPLICATION - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 2 -#define CONFIGURE_MAXIMUM_TIMERS 1 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* variables */ - -TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */ - -TEST_EXTERN rtems_id Timer_id[ 4 ]; /* array of timer ids */ -TEST_EXTERN rtems_name Timer_name[ 4 ]; /* array of timer names */ - -TEST_EXTERN volatile rtems_boolean Stop_Test; - -/* end of include file */ diff --git a/testsuites/mptests/mp06/task1.c b/testsuites/mptests/mp06/task1.c deleted file mode 100644 index 5d7a0686d8..0000000000 --- a/testsuites/mptests/mp06/task1.c +++ /dev/null @@ -1,175 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/mptests/mp07/.cvsignore b/testsuites/mptests/mp07/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/mptests/mp07/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/mptests/mp07/Makefile.am b/testsuites/mptests/mp07/Makefile.am deleted file mode 100644 index 258666c691..0000000000 --- a/testsuites/mptests/mp07/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ -## -## $Id$ -## - - -SUBDIRS = node1 node2 - -EXTRA_DIST = system.h init.c task1.c - -include $(top_srcdir)/../../../../automake/subdirs.am -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/mptests/mp07/init.c b/testsuites/mptests/mp07/init.c deleted file mode 100644 index 20c844fd1b..0000000000 --- a/testsuites/mptests/mp07/init.c +++ /dev/null @@ -1,64 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.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, - RTEMS_MINIMUM_STACK_SIZE, - 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/.cvsignore b/testsuites/mptests/mp07/node1/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/mptests/mp07/node1/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/mptests/mp07/node1/Makefile.am b/testsuites/mptests/mp07/node1/Makefile.am deleted file mode 100644 index 35834ac52c..0000000000 --- a/testsuites/mptests/mp07/node1/Makefile.am +++ /dev/null @@ -1,50 +0,0 @@ -## -## $Id$ -## - - -VPATH = @srcdir@:@srcdir@/.. - -NODE = 1 -TEST = mp07 -PGM = ${ARCH}/$(TEST)-node$(NODE).exe - -MANAGERS = io mp event timer - -C_FILES = init.c task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/mptests.am - -AM_CPPFLAGS += -DNODE_NUMBER=$(NODE) -I$(srcdir)/.. - -if HAS_MP - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) -else -all-local: -endif - -EXTRA_DIST = $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/mptests/mp07/node1/mp07.doc b/testsuites/mptests/mp07/node1/mp07.doc deleted file mode 100644 index a308cce370..0000000000 --- a/testsuites/mptests/mp07/node1/mp07.doc +++ /dev/null @@ -1,45 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - -This file describes the directives and concepts tested by this test set. - -test set name: 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 deleted file mode 100644 index d348f48612..0000000000 --- a/testsuites/mptests/mp07/node1/mp07.scn +++ /dev/null @@ -1,10 +0,0 @@ -*** TEST 7 -- NODE 1 *** -Creating Test_task (Global) -Starting Test_task (Global) -Deleting initialization task -Remote task's name is : 222 -Getting TID of remote task -Sending first event to remote task -.................................................... -.................................................... -*** END OF TEST 7 *** diff --git a/testsuites/mptests/mp07/node2/.cvsignore b/testsuites/mptests/mp07/node2/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/mptests/mp07/node2/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/mptests/mp07/node2/Makefile.am b/testsuites/mptests/mp07/node2/Makefile.am deleted file mode 100644 index 901a7abca6..0000000000 --- a/testsuites/mptests/mp07/node2/Makefile.am +++ /dev/null @@ -1,50 +0,0 @@ -## -## $Id$ -## - - -VPATH = @srcdir@:@srcdir@/.. - -NODE = 2 -TEST = mp07 -PGM = ${ARCH}/$(TEST)-node$(NODE).exe - -MANAGERS = io mp event timer - -C_FILES = init.c task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/mptests.am - -AM_CPPFLAGS += -DNODE_NUMBER=$(NODE) -I$(srcdir)/.. - -if HAS_MP - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) -else -all-local: -endif - -EXTRA_DIST = $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/mptests/mp07/node2/mp07.doc b/testsuites/mptests/mp07/node2/mp07.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/mptests/mp07/node2/mp07.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/mptests/mp07/node2/mp07.scn b/testsuites/mptests/mp07/node2/mp07.scn deleted file mode 100644 index 9e361d713c..0000000000 --- a/testsuites/mptests/mp07/node2/mp07.scn +++ /dev/null @@ -1,9 +0,0 @@ -*** TEST 7 -- NODE 2 *** -Creating Test_task (Global) -Starting Test_task (Global) -Deleting initialization task -Remote task's name is : 111 -Getting TID of remote task -.................................................... -.................................................... -*** END OF TEST 7 *** diff --git a/testsuites/mptests/mp07/system.h b/testsuites/mptests/mp07/system.h deleted file mode 100644 index 7a38afcfcb..0000000000 --- a/testsuites/mptests/mp07/system.h +++ /dev/null @@ -1,52 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_task Test_task( - rtems_task_argument argument -); - -/* configuration information */ - -#define CONFIGURE_MP_APPLICATION - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 2 -#define CONFIGURE_MAXIMUM_TIMERS 1 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* variables */ - -TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */ - -TEST_EXTERN rtems_id Timer_id[ 4 ]; /* array of timer ids */ -TEST_EXTERN rtems_name Timer_name[ 4 ]; /* array of timer names */ - -TEST_EXTERN volatile rtems_boolean Stop_Test; - -/* end of include file */ diff --git a/testsuites/mptests/mp07/task1.c b/testsuites/mptests/mp07/task1.c deleted file mode 100644 index 6c59a7c201..0000000000 --- a/testsuites/mptests/mp07/task1.c +++ /dev/null @@ -1,102 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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 && (Stop_Test == FALSE) ; 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('.'); - } - - /* - * Wait a bit before shutting down so we don't screw up the other node - * when our MPCI shuts down - */ - - rtems_task_wake_after(10); - - puts( "\n*** END OF TEST 7 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/mptests/mp08/.cvsignore b/testsuites/mptests/mp08/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/mptests/mp08/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/mptests/mp08/Makefile.am b/testsuites/mptests/mp08/Makefile.am deleted file mode 100644 index 258666c691..0000000000 --- a/testsuites/mptests/mp08/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ -## -## $Id$ -## - - -SUBDIRS = node1 node2 - -EXTRA_DIST = system.h init.c task1.c - -include $(top_srcdir)/../../../../automake/subdirs.am -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/mptests/mp08/init.c b/testsuites/mptests/mp08/init.c deleted file mode 100644 index e564eac891..0000000000 --- a/testsuites/mptests/mp08/init.c +++ /dev/null @@ -1,73 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.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, - RTEMS_NO_PRIORITY, - &Semaphore_id[ 1 ] - ); - directive_failed( status, "rtems_semaphore_create" ); - } - - puts( "Creating Test_task (Global)" ); - status = rtems_task_create( - Task_name[ Multiprocessing_configuration.node ], - 1, - RTEMS_MINIMUM_STACK_SIZE, - 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/.cvsignore b/testsuites/mptests/mp08/node1/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/mptests/mp08/node1/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/mptests/mp08/node1/Makefile.am b/testsuites/mptests/mp08/node1/Makefile.am deleted file mode 100644 index 0fb608a7b0..0000000000 --- a/testsuites/mptests/mp08/node1/Makefile.am +++ /dev/null @@ -1,50 +0,0 @@ -## -## $Id$ -## - - -VPATH = @srcdir@:@srcdir@/.. - -NODE = 1 -TEST = mp08 -PGM = ${ARCH}/$(TEST)-node$(NODE).exe - -MANAGERS = io mp semaphore - -C_FILES = init.c task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/mptests.am - -AM_CPPFLAGS += -DNODE_NUMBER=$(NODE) -I$(srcdir)/.. - -if HAS_MP - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) -else -all-local: -endif - -EXTRA_DIST = $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/mptests/mp08/node1/mp08.doc b/testsuites/mptests/mp08/node1/mp08.doc deleted file mode 100644 index 9f3b527f04..0000000000 --- a/testsuites/mptests/mp08/node1/mp08.doc +++ /dev/null @@ -1,51 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - -This file describes the directives and concepts tested by this test set. - -test set name: 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 deleted file mode 100644 index cde263420c..0000000000 --- a/testsuites/mptests/mp08/node1/mp08.scn +++ /dev/null @@ -1,11 +0,0 @@ -*** TEST 8 -- NODE 1 *** -Creating Test_task (Global) -Starting Test_task (Global) -Deleting initialization task -Getting SMID of semaphore -pvpvpvpvpvp....... -(continued) pvp - -Deleting global semaphore -*** END OF TEST 8 *** - diff --git a/testsuites/mptests/mp08/node2/.cvsignore b/testsuites/mptests/mp08/node2/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/mptests/mp08/node2/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/mptests/mp08/node2/Makefile.am b/testsuites/mptests/mp08/node2/Makefile.am deleted file mode 100644 index 09509e76b6..0000000000 --- a/testsuites/mptests/mp08/node2/Makefile.am +++ /dev/null @@ -1,50 +0,0 @@ -## -## $Id$ -## - - -VPATH = @srcdir@:@srcdir@/.. - -NODE = 2 -TEST = mp08 -PGM = ${ARCH}/$(TEST)-node$(NODE).exe - -MANAGERS = io mp semaphore - -C_FILES = init.c task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/mptests.am - -AM_CPPFLAGS += -DNODE_NUMBER=$(NODE) -I$(srcdir)/.. - -if HAS_MP - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) -else -all-local: -endif - -EXTRA_DIST = $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/mptests/mp08/node2/mp08.doc b/testsuites/mptests/mp08/node2/mp08.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/mptests/mp08/node2/mp08.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/mptests/mp08/node2/mp08.scn b/testsuites/mptests/mp08/node2/mp08.scn deleted file mode 100644 index 5a613f45e5..0000000000 --- a/testsuites/mptests/mp08/node2/mp08.scn +++ /dev/null @@ -1,12 +0,0 @@ -*** 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 deleted file mode 100644 index 1bfc0d1ae1..0000000000 --- a/testsuites/mptests/mp08/system.h +++ /dev/null @@ -1,51 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_task Test_task( - rtems_task_argument argument -); - -/* configuration information */ - -#define CONFIGURE_MP_APPLICATION - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 2 -#define CONFIGURE_MAXIMUM_TIMERS 1 -#define CONFIGURE_MAXIMUM_SEMAPHORES 1 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* variables */ - -TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */ - -TEST_EXTERN rtems_id Semaphore_id[ 2 ]; /* array of semaphore ids */ -TEST_EXTERN rtems_name Semaphore_name[ 2 ]; /* array of semaphore names */ - -/* end of include file */ diff --git a/testsuites/mptests/mp08/task1.c b/testsuites/mptests/mp08/task1.c deleted file mode 100644 index 0aab711f85..0000000000 --- a/testsuites/mptests/mp08/task1.c +++ /dev/null @@ -1,88 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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 ***" ); - rtems_test_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 ***" ); - rtems_test_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/.cvsignore b/testsuites/mptests/mp09/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/mptests/mp09/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/mptests/mp09/Makefile.am b/testsuites/mptests/mp09/Makefile.am deleted file mode 100644 index c1aa92d6e4..0000000000 --- a/testsuites/mptests/mp09/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ -## -## $Id$ -## - - -SUBDIRS = node1 node2 - -EXTRA_DIST = system.h init.c recvmsg.c sendmsg.c task1.c - -include $(top_srcdir)/../../../../automake/subdirs.am -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/mptests/mp09/init.c b/testsuites/mptests/mp09/init.c deleted file mode 100644 index aa6f70266f..0000000000 --- a/testsuites/mptests/mp09/init.c +++ /dev/null @@ -1,73 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.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, - 16, - RTEMS_GLOBAL, - &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, - RTEMS_MINIMUM_STACK_SIZE, - 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/.cvsignore b/testsuites/mptests/mp09/node1/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/mptests/mp09/node1/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/mptests/mp09/node1/Makefile.am b/testsuites/mptests/mp09/node1/Makefile.am deleted file mode 100644 index edc57eef0d..0000000000 --- a/testsuites/mptests/mp09/node1/Makefile.am +++ /dev/null @@ -1,50 +0,0 @@ -## -## $Id$ -## - - -VPATH = @srcdir@:@srcdir@/.. - -NODE = 1 -TEST = mp09 -PGM = ${ARCH}/$(TEST)-node$(NODE).exe - -MANAGERS = io mp message - -C_FILES = init.c task1.c recvmsg.c sendmsg.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/mptests.am - -AM_CPPFLAGS += -DNODE_NUMBER=$(NODE) -I$(srcdir)/.. - -if HAS_MP - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) -else -all-local: -endif - -EXTRA_DIST = $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/mptests/mp09/node1/mp09.doc b/testsuites/mptests/mp09/node1/mp09.doc deleted file mode 100644 index 16459a47bc..0000000000 --- a/testsuites/mptests/mp09/node1/mp09.doc +++ /dev/null @@ -1,49 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - -This file describes the directives and concepts tested by this test set. - -test set name: 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 deleted file mode 100644 index 74cf06904d..0000000000 --- a/testsuites/mptests/mp09/node1/mp09.scn +++ /dev/null @@ -1,22 +0,0 @@ -*** TEST 9 -- NODE 1 *** -Creating Message Queue (Global) -Creating Test_task (local) -Starting Test_task (local) -Deleting initialization task -Getting QID of message queue -Receiving message ... -Received : 123456789012345 -Receiving message ... -Received : abcdefghijklmno -Receiving message ... -Received : ABCDEFGHIJKLMNO -Receiver delaying for a second -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/.cvsignore b/testsuites/mptests/mp09/node2/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/mptests/mp09/node2/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/mptests/mp09/node2/Makefile.am b/testsuites/mptests/mp09/node2/Makefile.am deleted file mode 100644 index 10642b9623..0000000000 --- a/testsuites/mptests/mp09/node2/Makefile.am +++ /dev/null @@ -1,50 +0,0 @@ -## -## $Id$ -## - - -VPATH = @srcdir@:@srcdir@/.. - -NODE = 2 -TEST = mp09 -PGM = ${ARCH}/$(TEST)-node$(NODE).exe - -MANAGERS = io mp message - -C_FILES = init.c task1.c recvmsg.c sendmsg.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/mptests.am - -AM_CPPFLAGS += -DNODE_NUMBER=$(NODE) -I$(srcdir)/.. - -if HAS_MP - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) -else -all-local: -endif - -EXTRA_DIST = $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/mptests/mp09/node2/mp09.doc b/testsuites/mptests/mp09/node2/mp09.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/mptests/mp09/node2/mp09.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/mptests/mp09/node2/mp09.scn b/testsuites/mptests/mp09/node2/mp09.scn deleted file mode 100644 index 1bd17cecd9..0000000000 --- a/testsuites/mptests/mp09/node2/mp09.scn +++ /dev/null @@ -1,27 +0,0 @@ -*** 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 -Receiver delaying for a second -Flushing remote empty queue -0 messages were flushed on the remote queue -Send messages to be flushed from remote queue -Flushing remote queue -1 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 deleted file mode 100644 index ba9fff9e87..0000000000 --- a/testsuites/mptests/mp09/recvmsg.c +++ /dev/null @@ -1,46 +0,0 @@ -/* Receive_messages - * - * This routine receives and prints three messages. - * an error condition. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -void Receive_messages() -{ - rtems_status_code status; - rtems_unsigned32 index; - rtems_unsigned32 size; - 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, - &size, - 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 deleted file mode 100644 index e798bc1997..0000000000 --- a/testsuites/mptests/mp09/sendmsg.c +++ /dev/null @@ -1,59 +0,0 @@ -/* Send_messages - * - * This routine sends a series of three messages. - * an error condition. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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, 16 ); - 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, 16 ); - 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, - 16, - &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 deleted file mode 100644 index 1b3d425325..0000000000 --- a/testsuites/mptests/mp09/system.h +++ /dev/null @@ -1,60 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_task Test_task( - rtems_task_argument argument -); - -void Receive_messages( void ); - -void Send_messages( void ); - -/* configuration information */ - -#define CONFIGURE_MP_APPLICATION - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 2 -#define CONFIGURE_MAXIMUM_TIMERS 1 -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* variables */ - -TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */ - -TEST_EXTERN rtems_id Queue_id[ 2 ]; /* array of message queue ids */ -TEST_EXTERN rtems_name Queue_name[ 2 ]; /* array of message queue names */ - -extern char buffer1[16]; -extern char buffer2[16]; -extern char buffer3[16]; -extern char buffer4[16]; - -/* end of include file */ diff --git a/testsuites/mptests/mp09/task1.c b/testsuites/mptests/mp09/task1.c deleted file mode 100644 index e4806fbcc3..0000000000 --- a/testsuites/mptests/mp09/task1.c +++ /dev/null @@ -1,108 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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; - rtems_unsigned32 size; - 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( "%d 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, 16 ); - 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( "%d 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, - &size, - 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 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/mptests/mp10/.cvsignore b/testsuites/mptests/mp10/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/mptests/mp10/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/mptests/mp10/Makefile.am b/testsuites/mptests/mp10/Makefile.am deleted file mode 100644 index 582e16526b..0000000000 --- a/testsuites/mptests/mp10/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ -## -## $Id$ -## - - -SUBDIRS = node1 node2 - -EXTRA_DIST = system.h init.c task1.c task2.c task3.c - -include $(top_srcdir)/../../../../automake/subdirs.am -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/mptests/mp10/init.c b/testsuites/mptests/mp10/init.c deleted file mode 100644 index efaefc66fe..0000000000 --- a/testsuites/mptests/mp10/init.c +++ /dev/null @@ -1,142 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.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, - 16, - RTEMS_GLOBAL, - &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, - RTEMS_NO_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, - RTEMS_MINIMUM_STACK_SIZE, - 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, - RTEMS_MINIMUM_STACK_SIZE, - 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, - RTEMS_MINIMUM_STACK_SIZE, - 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 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/mptests/mp10/node1/.cvsignore b/testsuites/mptests/mp10/node1/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/mptests/mp10/node1/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/mptests/mp10/node1/Makefile.am b/testsuites/mptests/mp10/node1/Makefile.am deleted file mode 100644 index 5a1c94014d..0000000000 --- a/testsuites/mptests/mp10/node1/Makefile.am +++ /dev/null @@ -1,50 +0,0 @@ -## -## $Id$ -## - - -VPATH = @srcdir@:@srcdir@/.. - -NODE = 1 -TEST = mp10 -PGM = ${ARCH}/$(TEST)-node$(NODE).exe - -MANAGERS = io mp message semaphore - -C_FILES = init.c task1.c task2.c task3.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/mptests.am - -AM_CPPFLAGS += -DNODE_NUMBER=$(NODE) -I$(srcdir)/.. - -if HAS_MP - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) -else -all-local: -endif - -EXTRA_DIST = $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/mptests/mp10/node1/mp10.doc b/testsuites/mptests/mp10/node1/mp10.doc deleted file mode 100644 index dce783e641..0000000000 --- a/testsuites/mptests/mp10/node1/mp10.doc +++ /dev/null @@ -1,45 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - -This file describes the directives and concepts tested by this test set. - -test set name: 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 deleted file mode 100644 index deeafc0a9a..0000000000 --- a/testsuites/mptests/mp10/node1/mp10.scn +++ /dev/null @@ -1,4 +0,0 @@ -*** TEST 10 -- NODE 1 *** -Creating Message Queue (Global) -Creating Semaphore (Global) -*** END OF TEST 10 *** diff --git a/testsuites/mptests/mp10/node2/.cvsignore b/testsuites/mptests/mp10/node2/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/mptests/mp10/node2/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/mptests/mp10/node2/Makefile.am b/testsuites/mptests/mp10/node2/Makefile.am deleted file mode 100644 index 6c18ff3dc6..0000000000 --- a/testsuites/mptests/mp10/node2/Makefile.am +++ /dev/null @@ -1,50 +0,0 @@ -## -## $Id$ -## - - -VPATH = @srcdir@:@srcdir@/.. - -NODE = 2 -TEST = mp10 -PGM = ${ARCH}/$(TEST)-node$(NODE).exe - -MANAGERS = io mp message semaphore - -C_FILES = init.c task1.c task2.c task3.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/mptests.am - -AM_CPPFLAGS += -DNODE_NUMBER=$(NODE) -I$(srcdir)/.. - -if HAS_MP - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) -else -all-local: -endif - -EXTRA_DIST = $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/mptests/mp10/node2/mp10.doc b/testsuites/mptests/mp10/node2/mp10.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/mptests/mp10/node2/mp10.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/mptests/mp10/node2/mp10.scn b/testsuites/mptests/mp10/node2/mp10.scn deleted file mode 100644 index 25c07e6202..0000000000 --- a/testsuites/mptests/mp10/node2/mp10.scn +++ /dev/null @@ -1,19 +0,0 @@ -*** TEST 10 -- NODE 2 *** -Creating Test_task 1 (local) -Starting Test_task 1 (local) -Creating Test_task 2 (local) -Starting Test_task 2 (local) -Creating Test_task 3 (local) -Starting Test_task 3 (local) -Sleeping for 1 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 deleted file mode 100644 index e101987446..0000000000 --- a/testsuites/mptests/mp10/system.h +++ /dev/null @@ -1,66 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_task Test_task1( - rtems_task_argument argument -); - -rtems_task Test_task2( - rtems_task_argument argument -); - -rtems_task Test_task3( - rtems_task_argument restart -); - -/* configuration information */ - -#define CONFIGURE_MP_APPLICATION - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#if ( NODE_NUMBER == 1 ) -#define CONFIGURE_MAXIMUM_TASKS 1 -#define CONFIGURE_MAXIMUM_SEMAPHORES 1 -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 -#else -#define CONFIGURE_MAXIMUM_TASKS 4 -#endif - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* variables */ - -TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */ - -TEST_EXTERN rtems_id Queue_id[ 2 ]; /* array of message queue ids */ -TEST_EXTERN rtems_name Queue_name[ 2 ]; /* array of message queue names */ - -TEST_EXTERN rtems_id Semaphore_id[ 2 ]; /* array of semaphore ids */ -TEST_EXTERN rtems_name Semaphore_name[ 2 ]; /* array of semaphore names */ - -/* end of include file */ diff --git a/testsuites/mptests/mp10/task1.c b/testsuites/mptests/mp10/task1.c deleted file mode 100644 index 6e87cd4389..0000000000 --- a/testsuites/mptests/mp10/task1.c +++ /dev/null @@ -1,51 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -rtems_task Test_task1( - rtems_task_argument argument -) -{ - char receive_buffer[16]; - rtems_unsigned32 size; - 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, - &size, - 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 deleted file mode 100644 index b2c17a9175..0000000000 --- a/testsuites/mptests/mp10/task2.c +++ /dev/null @@ -1,46 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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 deleted file mode 100644 index 3ab7255253..0000000000 --- a/testsuites/mptests/mp10/task3.c +++ /dev/null @@ -1,49 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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/.cvsignore b/testsuites/mptests/mp11/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/mptests/mp11/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/mptests/mp11/Makefile.am b/testsuites/mptests/mp11/Makefile.am deleted file mode 100644 index 0c8115305b..0000000000 --- a/testsuites/mptests/mp11/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ -## -## $Id$ -## - - -SUBDIRS = node1 node2 - -EXTRA_DIST = system.h init.c - -include $(top_srcdir)/../../../../automake/subdirs.am -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/mptests/mp11/init.c b/testsuites/mptests/mp11/init.c deleted file mode 100644 index 539ed286b2..0000000000 --- a/testsuites/mptests/mp11/init.c +++ /dev/null @@ -1,104 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_unsigned8 my_partition[0x30000] CPU_STRUCTURE_ALIGNMENT; - -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, - RTEMS_MINIMUM_STACK_SIZE, - 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, - 16, - RTEMS_GLOBAL, - &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, - RTEMS_NO_PRIORITY, - &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 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/mptests/mp11/node1/.cvsignore b/testsuites/mptests/mp11/node1/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/mptests/mp11/node1/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/mptests/mp11/node1/Makefile.am b/testsuites/mptests/mp11/node1/Makefile.am deleted file mode 100644 index af1ca83605..0000000000 --- a/testsuites/mptests/mp11/node1/Makefile.am +++ /dev/null @@ -1,50 +0,0 @@ -## -## $Id$ -## - - -VPATH = @srcdir@:@srcdir@/.. - -NODE = 1 -TEST = mp11 -PGM = ${ARCH}/$(TEST)-node$(NODE).exe - -MANAGERS = io mp message partition semaphore - -C_FILES = init.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/mptests.am - -AM_CPPFLAGS += -DNODE_NUMBER=$(NODE) -I$(srcdir)/.. - -if HAS_MP - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) -else -all-local: -endif - -EXTRA_DIST = $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/mptests/mp11/node1/mp11.doc b/testsuites/mptests/mp11/node1/mp11.doc deleted file mode 100644 index 1bb89e8371..0000000000 --- a/testsuites/mptests/mp11/node1/mp11.doc +++ /dev/null @@ -1,41 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - -This file describes the directives and concepts tested by this test set. - -test set name: 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 deleted file mode 100644 index fb26583852..0000000000 --- a/testsuites/mptests/mp11/node1/mp11.scn +++ /dev/null @@ -1,10 +0,0 @@ -*** 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/.cvsignore b/testsuites/mptests/mp11/node2/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/mptests/mp11/node2/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/mptests/mp11/node2/Makefile.am b/testsuites/mptests/mp11/node2/Makefile.am deleted file mode 100644 index be01c89b14..0000000000 --- a/testsuites/mptests/mp11/node2/Makefile.am +++ /dev/null @@ -1,50 +0,0 @@ -## -## $Id$ -## - - -VPATH = @srcdir@:@srcdir@/.. - -NODE = 2 -TEST = mp11 -PGM = ${ARCH}/$(TEST)-node$(NODE).exe - -MANAGERS = io mp message partition semaphore - -C_FILES = init.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/mptests.am - -AM_CPPFLAGS += -DNODE_NUMBER=$(NODE) -I$(srcdir)/.. - -if HAS_MP - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) -else -all-local: -endif - -EXTRA_DIST = $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/mptests/mp11/node2/mp11.doc b/testsuites/mptests/mp11/node2/mp11.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/mptests/mp11/node2/mp11.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/mptests/mp11/node2/mp11.scn b/testsuites/mptests/mp11/node2/mp11.scn deleted file mode 100644 index 49bd8a3219..0000000000 --- a/testsuites/mptests/mp11/node2/mp11.scn +++ /dev/null @@ -1,2 +0,0 @@ -*** TEST 11 -- NODE 2 *** -*** END OF TEST 11 *** diff --git a/testsuites/mptests/mp11/system.h b/testsuites/mptests/mp11/system.h deleted file mode 100644 index 68bbe83f3b..0000000000 --- a/testsuites/mptests/mp11/system.h +++ /dev/null @@ -1,56 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -/* configuration information */ - -#define CONFIGURE_MP_APPLICATION - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS 0 -#define CONFIGURE_MP_MAXIMUM_PROXIES 0 - -#define CONFIGURE_MAXIMUM_TASKS 1 -#if ( NODE_NUMBER == 1 ) -#define CONFIGURE_MAXIMUM_SEMAPHORES 1 -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 -#define CONFIGURE_MAXIMUM_PARTITIONS 1 -#endif - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* variables */ - -TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */ - -TEST_EXTERN rtems_id Queue_id[ 2 ]; /* array of message queue ids */ -TEST_EXTERN rtems_name Queue_name[ 2 ]; /* array of message queue names */ - -TEST_EXTERN rtems_id Semaphore_id[ 2 ]; /* array of semaphore ids */ -TEST_EXTERN rtems_name Semaphore_name[ 2 ]; /* array of semaphore names */ - -/* end of include file */ diff --git a/testsuites/mptests/mp12/.cvsignore b/testsuites/mptests/mp12/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/mptests/mp12/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/mptests/mp12/Makefile.am b/testsuites/mptests/mp12/Makefile.am deleted file mode 100644 index 0c8115305b..0000000000 --- a/testsuites/mptests/mp12/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ -## -## $Id$ -## - - -SUBDIRS = node1 node2 - -EXTRA_DIST = system.h init.c - -include $(top_srcdir)/../../../../automake/subdirs.am -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/mptests/mp12/init.c b/testsuites/mptests/mp12/init.c deleted file mode 100644 index 820bacccbe..0000000000 --- a/testsuites/mptests/mp12/init.c +++ /dev/null @@ -1,112 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_unsigned8 Partition_area[ 1024 ] CPU_STRUCTURE_ALIGNMENT; - -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 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/mptests/mp12/node1/.cvsignore b/testsuites/mptests/mp12/node1/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/mptests/mp12/node1/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/mptests/mp12/node1/Makefile.am b/testsuites/mptests/mp12/node1/Makefile.am deleted file mode 100644 index 7989522b79..0000000000 --- a/testsuites/mptests/mp12/node1/Makefile.am +++ /dev/null @@ -1,50 +0,0 @@ -## -## $Id$ -## - - -VPATH = @srcdir@:@srcdir@/.. - -NODE = 1 -TEST = mp12 -PGM = ${ARCH}/$(TEST)-node$(NODE).exe - -MANAGERS = io mp partition - -C_FILES = init.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/mptests.am - -AM_CPPFLAGS += -DNODE_NUMBER=$(NODE) -I$(srcdir)/.. - -if HAS_MP - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) -else -all-local: -endif - -EXTRA_DIST = $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/mptests/mp12/node1/mp12.doc b/testsuites/mptests/mp12/node1/mp12.doc deleted file mode 100644 index 512bb92934..0000000000 --- a/testsuites/mptests/mp12/node1/mp12.doc +++ /dev/null @@ -1,51 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - -This file describes the directives and concepts tested by this test set. - -test set name: 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 deleted file mode 100644 index 605a2c11db..0000000000 --- a/testsuites/mptests/mp12/node1/mp12.scn +++ /dev/null @@ -1,6 +0,0 @@ -*** 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/.cvsignore b/testsuites/mptests/mp12/node2/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/mptests/mp12/node2/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/mptests/mp12/node2/Makefile.am b/testsuites/mptests/mp12/node2/Makefile.am deleted file mode 100644 index f84bdf7372..0000000000 --- a/testsuites/mptests/mp12/node2/Makefile.am +++ /dev/null @@ -1,50 +0,0 @@ -## -## $Id$ -## - - -VPATH = @srcdir@:@srcdir@/.. - -NODE = 2 -TEST = mp12 -PGM = ${ARCH}/$(TEST)-node$(NODE).exe - -MANAGERS = io mp partition - -C_FILES = init.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/mptests.am - -AM_CPPFLAGS += -DNODE_NUMBER=$(NODE) -I$(srcdir)/.. - -if HAS_MP - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) -else -all-local: -endif - -EXTRA_DIST = $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/mptests/mp12/node2/mp12.doc b/testsuites/mptests/mp12/node2/mp12.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/mptests/mp12/node2/mp12.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/mptests/mp12/node2/mp12.scn b/testsuites/mptests/mp12/node2/mp12.scn deleted file mode 100644 index ad65e9cb32..0000000000 --- a/testsuites/mptests/mp12/node2/mp12.scn +++ /dev/null @@ -1,10 +0,0 @@ -*** 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 deleted file mode 100644 index a9f7f11dd8..0000000000 --- a/testsuites/mptests/mp12/system.h +++ /dev/null @@ -1,55 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#define PT_NAME rtems_build_name( 'P', 'A', 'R', '\0' ) - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -/* configuration information */ - -#define CONFIGURE_MP_APPLICATION - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MP_MAXIMUM_GLOBAL_OBJECTS 1 -#define CONFIGURE_MP_MAXIMUM_PROXIES 0 - -#define CONFIGURE_MAXIMUM_TASKS 1 -#if ( NODE_NUMBER == 1 ) -#define CONFIGURE_MAXIMUM_PARTITIONS 1 -#elif ( NODE_NUMBER == 2 ) -#define CONFIGURE_MAXIMUM_PARTITIONS 2 -#endif - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* variables */ - -TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */ - -TEST_EXTERN rtems_id Partition_id[ 2 ]; /* array of partition ids */ -TEST_EXTERN rtems_name Partition_name[ 2 ]; /* array of partition names */ - -/* end of include file */ diff --git a/testsuites/mptests/mp13/.cvsignore b/testsuites/mptests/mp13/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/mptests/mp13/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/mptests/mp13/Makefile.am b/testsuites/mptests/mp13/Makefile.am deleted file mode 100644 index d235c7e518..0000000000 --- a/testsuites/mptests/mp13/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ -## -## $Id$ -## - - -SUBDIRS = node1 node2 - -EXTRA_DIST = system.h init.c task1.c task2.c - -include $(top_srcdir)/../../../../automake/subdirs.am -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/mptests/mp13/init.c b/testsuites/mptests/mp13/init.c deleted file mode 100644 index 1bcd23e8c9..0000000000 --- a/testsuites/mptests/mp13/init.c +++ /dev/null @@ -1,114 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.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, - 16, - RTEMS_GLOBAL, - &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, - RTEMS_NO_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, - RTEMS_MINIMUM_STACK_SIZE, - 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, - RTEMS_MINIMUM_STACK_SIZE, - 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 ***" ); - rtems_test_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/.cvsignore b/testsuites/mptests/mp13/node1/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/mptests/mp13/node1/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/mptests/mp13/node1/Makefile.am b/testsuites/mptests/mp13/node1/Makefile.am deleted file mode 100644 index 63a5259ac0..0000000000 --- a/testsuites/mptests/mp13/node1/Makefile.am +++ /dev/null @@ -1,50 +0,0 @@ -## -## $Id$ -## - - -VPATH = @srcdir@:@srcdir@/.. - -NODE = 1 -TEST = mp13 -PGM = ${ARCH}/$(TEST)-node$(NODE).exe - -MANAGERS = io mp message semaphore - -C_FILES = init.c task1.c task2.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/mptests.am - -AM_CPPFLAGS += -DNODE_NUMBER=$(NODE) -I$(srcdir)/.. - -if HAS_MP - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) -else -all-local: -endif - -EXTRA_DIST = $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/mptests/mp13/node1/mp13.doc b/testsuites/mptests/mp13/node1/mp13.doc deleted file mode 100644 index dfd983fceb..0000000000 --- a/testsuites/mptests/mp13/node1/mp13.doc +++ /dev/null @@ -1,47 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - -This file describes the directives and concepts tested by this test set. - -test set name: 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 deleted file mode 100644 index d3bd11f65e..0000000000 --- a/testsuites/mptests/mp13/node1/mp13.scn +++ /dev/null @@ -1,14 +0,0 @@ -*** TEST 13 -- NODE 1 *** -Creating Message Queue (Global) -Creating Semaphore (Global) -Creating Test_task 1 (local) -Starting Test_task 1 (local) -Creating Test_task 2 (local) -Starting Test_task 2 (local) -Getting QID of message queue -Receiving message ... -Getting SMID of semaphore -Releasing semaphore ... -Getting semaphore ... -Getting semaphore ... -*** END OF TEST 13 *** diff --git a/testsuites/mptests/mp13/node2/.cvsignore b/testsuites/mptests/mp13/node2/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/mptests/mp13/node2/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/mptests/mp13/node2/Makefile.am b/testsuites/mptests/mp13/node2/Makefile.am deleted file mode 100644 index 362ca1173f..0000000000 --- a/testsuites/mptests/mp13/node2/Makefile.am +++ /dev/null @@ -1,50 +0,0 @@ -## -## $Id$ -## - - -VPATH = @srcdir@:@srcdir@/.. - -NODE = 2 -TEST = mp13 -PGM = ${ARCH}/$(TEST)-node$(NODE).exe - -MANAGERS = io mp message semaphore - -C_FILES = init.c task1.c task2.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/mptests.am - -AM_CPPFLAGS += -DNODE_NUMBER=$(NODE) -I$(srcdir)/.. - -if HAS_MP - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) -else -all-local: -endif - -EXTRA_DIST = $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/mptests/mp13/node2/mp13.doc b/testsuites/mptests/mp13/node2/mp13.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/mptests/mp13/node2/mp13.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/mptests/mp13/node2/mp13.scn b/testsuites/mptests/mp13/node2/mp13.scn deleted file mode 100644 index e9df202a94..0000000000 --- a/testsuites/mptests/mp13/node2/mp13.scn +++ /dev/null @@ -1,16 +0,0 @@ -*** TEST 13 -- NODE 2 *** -Creating Test_task 1 (local) -Starting Test_task 1 (local) -Creating Test_task 2 (local) -Starting Test_task 2 (local) -Deleting initialization task -Getting QID of message queue -Getting SMID of semaphore -Getting semaphore ... -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 deleted file mode 100644 index a056882b02..0000000000 --- a/testsuites/mptests/mp13/system.h +++ /dev/null @@ -1,60 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_task Test_task1( - rtems_task_argument argument -); - -rtems_task Test_task2( - rtems_task_argument argument -); - -/* configuration information */ - -#define CONFIGURE_MP_APPLICATION - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 3 -#if ( NODE_NUMBER == 1 ) -#define CONFIGURE_MAXIMUM_SEMAPHORES 1 -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 -#endif - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* variables */ - -TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */ - -TEST_EXTERN rtems_id Queue_id[ 2 ]; /* array of message queue ids */ -TEST_EXTERN rtems_name Queue_name[ 2 ]; /* array of message queue names */ - -TEST_EXTERN rtems_id Semaphore_id[ 2 ]; /* array of semaphore ids */ -TEST_EXTERN rtems_name Semaphore_name[ 2 ]; /* array of semaphore names */ - -/* end of include file */ diff --git a/testsuites/mptests/mp13/task1.c b/testsuites/mptests/mp13/task1.c deleted file mode 100644 index e83c24ce0a..0000000000 --- a/testsuites/mptests/mp13/task1.c +++ /dev/null @@ -1,72 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -rtems_task Test_task1( - rtems_task_argument argument -) -{ - char receive_buffer[16]; - rtems_unsigned32 size; - 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, - &size, - 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, - &size, - 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 deleted file mode 100644 index df4c337b04..0000000000 --- a/testsuites/mptests/mp13/task2.c +++ /dev/null @@ -1,105 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/mptests/mp14/.cvsignore b/testsuites/mptests/mp14/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/mptests/mp14/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/mptests/mp14/Makefile.am b/testsuites/mptests/mp14/Makefile.am deleted file mode 100644 index 2b98c578e8..0000000000 --- a/testsuites/mptests/mp14/Makefile.am +++ /dev/null @@ -1,12 +0,0 @@ -## -## $Id$ -## - - -SUBDIRS = node1 node2 - -EXTRA_DIST = system.h delay.c evtask1.c evtmtask.c exit.c init.c msgtask1.c \ - pttask1.c smtask1.c - -include $(top_srcdir)/../../../../automake/subdirs.am -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/mptests/mp14/delay.c b/testsuites/mptests/mp14/delay.c deleted file mode 100644 index f6814aad2c..0000000000 --- a/testsuites/mptests/mp14/delay.c +++ /dev/null @@ -1,33 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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 - ); - fatal_directive_check_status_only( status, RTEMS_SUCCESSFUL, "rtems_event_send" ); -} diff --git a/testsuites/mptests/mp14/evtask1.c b/testsuites/mptests/mp14/evtask1.c deleted file mode 100644 index ea4c5e3d22..0000000000 --- a/testsuites/mptests/mp14/evtask1.c +++ /dev/null @@ -1,86 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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 FAILED!!" ); - rtems_task_wake_after(2); - } - - 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 deleted file mode 100644 index 520b47a4d7..0000000000 --- a/testsuites/mptests/mp14/evtmtask.c +++ /dev/null @@ -1,64 +0,0 @@ -/* Delayed_events_task - * - * This task continuously sends itself events at one tick - * intervals. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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 deleted file mode 100644 index e186a4cafb..0000000000 --- a/testsuites/mptests/mp14/exit.c +++ /dev/null @@ -1,39 +0,0 @@ -/* Exit_test - * - * This routine safely stops the test and prints some information - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -void Exit_test( void ) -{ - rtems_status_code status; - rtems_mode old_mode; - - /* - * Wait a bit before shutting down so we don't screw up the other node - * when our MPCI shuts down - */ - - rtems_task_wake_after(20); - - 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 deleted file mode 100644 index e894db7a92..0000000000 --- a/testsuites/mptests/mp14/init.c +++ /dev/null @@ -1,190 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.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, - RTEMS_NO_PRIORITY, - &Semaphore_id[ 1 ] - ); - directive_failed( status, "rtems_semaphore_create" ); - - puts( "Creating Message Queue (Global)" ); - status = rtems_message_queue_create( - Queue_name[ 1 ], - 1, - 16, - 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, - RTEMS_MINIMUM_STACK_SIZE, - 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, - RTEMS_MINIMUM_STACK_SIZE, - 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, - RTEMS_MINIMUM_STACK_SIZE, - 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, - RTEMS_MINIMUM_STACK_SIZE * 2, - 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 deleted file mode 100644 index 254fb5c928..0000000000 --- a/testsuites/mptests/mp14/msgtask1.c +++ /dev/null @@ -1,106 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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; - rtems_unsigned32 size; - - 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!!" ); - rtems_task_wake_after(2); - } - - if ( Multiprocessing_configuration.node == 1 ) { - status = rtems_message_queue_send( - Queue_id[ 1 ], - (long (*)[4])Msg_buffer[ index ], - 16 - ); - 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 ], - &size, - 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 ], - 16 - ); - 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/.cvsignore b/testsuites/mptests/mp14/node1/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/mptests/mp14/node1/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/mptests/mp14/node1/Makefile.am b/testsuites/mptests/mp14/node1/Makefile.am deleted file mode 100644 index ee76355882..0000000000 --- a/testsuites/mptests/mp14/node1/Makefile.am +++ /dev/null @@ -1,51 +0,0 @@ -## -## $Id$ -## - - -VPATH = @srcdir@:@srcdir@/.. - -NODE = 1 -TEST = mp14 -PGM = ${ARCH}/$(TEST)-node$(NODE).exe - -MANAGERS = io mp event partition semaphore timer message - -C_FILES = exit.c init.c delay.c evtask1.c evtmtask.c pttask1.c smtask1.c \ - msgtask1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/mptests.am - -AM_CPPFLAGS += -DNODE_NUMBER=$(NODE) -I$(srcdir)/.. - -if HAS_MP - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) -else -all-local: -endif - -EXTRA_DIST = $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/mptests/mp14/node1/mp14.doc b/testsuites/mptests/mp14/node1/mp14.doc deleted file mode 100644 index 33635998b8..0000000000 --- a/testsuites/mptests/mp14/node1/mp14.doc +++ /dev/null @@ -1,49 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - -This file describes the directives and concepts tested by this test set. - -test set name: 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 deleted file mode 100644 index f57c4f47b3..0000000000 --- a/testsuites/mptests/mp14/node1/mp14.scn +++ /dev/null @@ -1,41 +0,0 @@ -*** TEST 14 -- NODE 1 *** -Creating Semaphore (Global) -Creating Message Queue (Global) -Creating Partition (Global) -Creating Event task (Global) -Starting Event task (Global) -Creating Semaphore task (Global) -About to go to sleep! -Starting Semaphore task (Global) -Creating Message Queue task (Global) -Getting SMID of semaphore -Starting Message Queue task (Global) -Creating Partition task (Global) -Getting ID of msg queue -Starting Partition task (Global) -Getting ID of partition -Waking up! -Remote task's name is : 222 -Getting TID of remote task -Sending events to remote task - - -. - indicates 100 iterations of - tm_evafter of 1 tick and 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. - -NOTES: 1. The messages could be interspersed. - 2. If one of the nodes exits first, the other may report - timeout errors on blocking directives. - diff --git a/testsuites/mptests/mp14/node2/.cvsignore b/testsuites/mptests/mp14/node2/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/mptests/mp14/node2/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/mptests/mp14/node2/Makefile.am b/testsuites/mptests/mp14/node2/Makefile.am deleted file mode 100644 index 4ce2a84899..0000000000 --- a/testsuites/mptests/mp14/node2/Makefile.am +++ /dev/null @@ -1,51 +0,0 @@ -## -## $Id$ -## - - -VPATH = @srcdir@:@srcdir@/.. - -NODE = 2 -TEST = mp14 -PGM = ${ARCH}/$(TEST)-node$(NODE).exe - -MANAGERS = io mp event partition semaphore timer message - -C_FILES = exit.c init.c delay.c evtask1.c evtmtask.c pttask1.c smtask1.c \ - msgtask1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/mptests.am - -AM_CPPFLAGS += -DNODE_NUMBER=$(NODE) -I$(srcdir)/.. - -if HAS_MP - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) -else -all-local: -endif - -EXTRA_DIST = $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/mptests/mp14/node2/mp14.doc b/testsuites/mptests/mp14/node2/mp14.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/mptests/mp14/node2/mp14.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/mptests/mp14/node2/mp14.scn b/testsuites/mptests/mp14/node2/mp14.scn deleted file mode 100644 index d128c870e9..0000000000 --- a/testsuites/mptests/mp14/node2/mp14.scn +++ /dev/null @@ -1,38 +0,0 @@ -*** TEST 14 -- NODE 2 *** -Creating Event task (Global) -Starting Event task (Global) -Creating Semaphore task (Global) -About to go to sleep! -Starting Semaphore task (Global) -Creating Message Queue task (Global) -Getting SMID of semaphore -Starting Message Queue task (Global) -Creating Partition task (Global) -Getting ID of msg queue -Starting Partition task (Global) -Getting ID of partition -Waking up! -Remote task's name is : 111 -Getting TID of remote task -Receiving events from remote task - - -. - indicates 100 iterations of - tm_evafter of 1 tick and 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. - -NOTES: 1. The messages could be interspersed. - 2. If one of the nodes exits first, the other may report - timeout errors on blocking directives. - diff --git a/testsuites/mptests/mp14/pttask1.c b/testsuites/mptests/mp14/pttask1.c deleted file mode 100644 index 520f7a6066..0000000000 --- a/testsuites/mptests/mp14/pttask1.c +++ /dev/null @@ -1,70 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -extern rtems_multiprocessing_table Multiprocessing_configuration; - -rtems_task Partition_task( - rtems_task_argument argument -) -{ - rtems_unsigned32 count; - rtems_status_code status; - rtems_unsigned32 yield_count; - 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!!" ); - rtems_task_wake_after(2); - } - - yield_count = 100; - - 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 (Stop_Test == FALSE) - if ( Multiprocessing_configuration.node == 1 && --yield_count == 0 ) { - status = rtems_task_wake_after( 1 ); - directive_failed( status, "rtems_task_wake_after" ); - yield_count = 100; - } - } - put_dot( 'p' ); - } - - Exit_test(); -} diff --git a/testsuites/mptests/mp14/smtask1.c b/testsuites/mptests/mp14/smtask1.c deleted file mode 100644 index d9e2865e9d..0000000000 --- a/testsuites/mptests/mp14/smtask1.c +++ /dev/null @@ -1,72 +0,0 @@ -/* Sm_test_task - * - * This task continuously obtains and releases a global semaphore. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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!!" ); - rtems_task_wake_after(2); - } - - yield_count = 100; - - while ( Stop_Test == FALSE ) { - - 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 ( 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( 's' ); - } - - Exit_test(); -} diff --git a/testsuites/mptests/mp14/system.h b/testsuites/mptests/mp14/system.h deleted file mode 100644 index 6eacde2662..0000000000 --- a/testsuites/mptests/mp14/system.h +++ /dev/null @@ -1,119 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_timer_service_routine Delayed_send_event( - rtems_id timer_id, - void *ignored_address -); - -rtems_task Init( - rtems_task_argument argument -); - -rtems_task Test_task( - rtems_task_argument argument -); - -rtems_task Delayed_events_task( - rtems_task_argument argument -); - -rtems_task Message_queue_task( - rtems_task_argument index -); - -rtems_task Partition_task( - rtems_task_argument argument -); - -rtems_task Semaphore_task( - rtems_task_argument argument -); - -void Exit_test( void ); - -/* configuration information */ - -#define CONFIGURE_MP_APPLICATION - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_TICKS_PER_TIMESLICE 1 -#define CONFIGURE_MICROSECONDS_PER_TICK RTEMS_MILLISECONDS_TO_MICROSECONDS(1) - -#define CONFIGURE_MAXIMUM_TASKS 5 -#if ( NODE_NUMBER == 1 ) -#define CONFIGURE_MAXIMUM_TIMERS 12 -#define CONFIGURE_MAXIMUM_SEMAPHORES 1 -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 -#define CONFIGURE_MAXIMUM_PARTITIONS 1 -#elif ( NODE_NUMBER == 2 ) -#define CONFIGURE_MAXIMUM_TIMERS 2 -#endif - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_EXTRA_TASK_STACKS (1 * RTEMS_MINIMUM_STACK_SIZE) - -#include - -/* variables */ - -TEST_EXTERN rtems_id Event_task_id[ 2 ]; /* event task ids */ - -TEST_EXTERN rtems_id Semaphore_task_id[ 2 ]; /* semaphore task ids */ -TEST_EXTERN rtems_name Semaphore_task_name[ 2 ]; /* semaphore task names */ - -TEST_EXTERN rtems_id Queue_task_id[ 3 ]; /* message queue task ids */ -TEST_EXTERN rtems_name Queue_task_name[ 3 ]; /* message queue task names */ - -TEST_EXTERN rtems_id Partition_task_id[ 4 ]; /* partition task ids */ -TEST_EXTERN rtems_name Partition_task_name[ 4 ]; /* partition task names */ - -TEST_EXTERN rtems_id Partition_id[ 3 ]; /* partition ids */ -TEST_EXTERN rtems_name Partition_name[ 3 ]; /* partition names */ - -TEST_EXTERN rtems_id Semaphore_id[ 3 ]; /* semaphore ids */ -TEST_EXTERN rtems_name Semaphore_name[ 3 ]; /* semaphore names */ - -TEST_EXTERN rtems_id Queue_id[ 3 ]; /* message queue ids */ -TEST_EXTERN rtems_name Queue_name[ 3 ]; /* message queue names */ - -TEST_EXTERN rtems_id Task_id[ 4 ]; /* remote event task ids */ -TEST_EXTERN rtems_name Task_name[ 4 ]; /* remote event task names */ - -TEST_EXTERN rtems_id Timer_id[ 4 ]; /* event timer ids */ -TEST_EXTERN rtems_name Timer_name[ 4 ]; /* event timer names */ - -TEST_EXTERN rtems_unsigned32 Msg_buffer[ 4 ][ 4 ]; - -extern rtems_multiprocessing_table Multiprocessing_configuration; - -TEST_EXTERN volatile rtems_boolean Stop_Test; -TEST_EXTERN rtems_id timer_id; - -#define EVENT_TASK_DOT_COUNT 100 -#define EVENT_SEND_DOT_COUNT 100 -#define DELAYED_EVENT_DOT_COUNT 1000 -#define MESSAGE_DOT_COUNT 200 -#define PARTITION_DOT_COUNT 200 -#define SEMAPHORE_DOT_COUNT 200 - -/* end of include file */ diff --git a/testsuites/mptests/mptests.am b/testsuites/mptests/mptests.am deleted file mode 100644 index 789e4efaa2..0000000000 --- a/testsuites/mptests/mptests.am +++ /dev/null @@ -1,29 +0,0 @@ -## $Id$ - -project_bspdir=$(PROJECT_ROOT)/@RTEMS_BSP@ - -$(project_bspdir)/tests: - @$(mkinstalldirs) $@ - -$(project_bspdir)/tests/$(TEST)-node$(NODE)$(LIB_VARIANT).exe: $(PGM) - $(INSTALL_PROGRAM) $< $@ - -$(project_bspdir)/tests/screens: - @$(mkinstalldirs) $@ - -$(project_bspdir)/tests/screens/mptests: - @$(mkinstalldirs) $@ - -$(project_bspdir)/tests/screens/mptests/node$(NODE): - @$(mkinstalldirs) $@ - -$(project_bspdir)/tests/screens/mptests/node$(NODE)/$(TEST).scn: $(TEST).scn - $(INSTALL_DATA) $< $@ - -TMPINSTALL_FILES = \ -$(project_bspdir)/tests \ -$(project_bspdir)/tests/$(TEST)-node$(NODE)$(LIB_VARIANT).exe \ -$(project_bspdir)/tests/screens \ -$(project_bspdir)/tests/screens/mptests \ -$(project_bspdir)/tests/screens/mptests/node$(NODE) \ -$(project_bspdir)/tests/screens/mptests/node$(NODE)/$(TEST).scn diff --git a/testsuites/psxtests/.cvsignore b/testsuites/psxtests/.cvsignore deleted file mode 100644 index bfdfd995be..0000000000 --- a/testsuites/psxtests/.cvsignore +++ /dev/null @@ -1,14 +0,0 @@ -aclocal.m4 -autom4te*.cache -config.cache -config.guess -config.log -config.status -config.sub -configure -depcomp -install-sh -Makefile -Makefile.in -missing -mkinstalldirs diff --git a/testsuites/psxtests/ChangeLog b/testsuites/psxtests/ChangeLog deleted file mode 100644 index e90da9e2c5..0000000000 --- a/testsuites/psxtests/ChangeLog +++ /dev/null @@ -1,261 +0,0 @@ -2003-02-11 Ralf Corsepius - - * configure.ac: AM_INIT_AUTOMAKE([1.7.2]). - -2003-02-11 Ralf Corsepius - - * configure.ac: AC_PREREQ(2.57). - -2002-11-14 Joel Sherrill - - * psx01/psx01.scn, psx02/psx02.scn, psx03/psx03.scn, psx04/psx04.scn, - psx05/psx05.scn, psx06/psx06.scn, psx07/psx07.scn, psx08/psx08.scn, - psx09/psx09.scn, psx10/psx10.scn, psx11/psx11.scn, psx12/psx12.scn: - Per PR239 update the IDs in the various screens. - -2002-10-21 Ralf Corsepius - - * .cvsignore: Reformat. - Add autom4te*cache. - Remove autom4te.cache. - -2002-08-11 Ralf Corsepius - - * psx01/Makefile.am: Use .$(OBJEXT) instead of .o. - * psx02/Makefile.am: Use .$(OBJEXT) instead of .o. - * psx03/Makefile.am: Use .$(OBJEXT) instead of .o. - * psx04/Makefile.am: Use .$(OBJEXT) instead of .o. - * psx05/Makefile.am: Use .$(OBJEXT) instead of .o. - * psx06/Makefile.am: Use .$(OBJEXT) instead of .o. - * psx07/Makefile.am: Use .$(OBJEXT) instead of .o. - * psx08/Makefile.am: Use .$(OBJEXT) instead of .o. - * psx09/Makefile.am: Use .$(OBJEXT) instead of .o. - * psx10/Makefile.am: Use .$(OBJEXT) instead of .o. - * psx11/Makefile.am: Use .$(OBJEXT) instead of .o. - * psx12/Makefile.am: Use .$(OBJEXT) instead of .o. - * psx13/Makefile.am: Use .$(OBJEXT) instead of .o. - * psxcancel/Makefile.am: Use .$(OBJEXT) instead of .o. - * psxchroot01/Makefile.am: Use .$(OBJEXT) instead of .o. - * psxfile01/Makefile.am: Use .$(OBJEXT) instead of .o. - * psxhdrs/Makefile.am: Use .$(OBJEXT) instead of .o. - * psxmount/Makefile.am: Use .$(OBJEXT) instead of .o. - * psxmsgq01/Makefile.am: Use .$(OBJEXT) instead of .o. - * psxreaddir/Makefile.am: Use .$(OBJEXT) instead of .o. - * psxsem01/Makefile.am: Use .$(OBJEXT) instead of .o. - * psxstat/Makefile.am: Use .$(OBJEXT) instead of .o. - * psxtime/Makefile.am: Use .$(OBJEXT) instead of .o. - * psxtimer/Makefile.am: Use .$(OBJEXT) instead of .o. - -2002-08-01 Joel Sherrill - - * Per PR47 add support for buffered test output. This involved - adding defines to redirect output to a buffer and dump it when - full, at "test pause", and at exit. To avoid problems when redefining - exit(), all tests were modified to call rtems_test_exit(). - Some tests, notable psxtests, had to be modified to include - the standard test macro .h file (pmacros.h or tmacros.h) to - enable this support. - * include/pmacros.h, psx01/task.c, psx02/init.c, psx02/task.c, - psx03/init.c, psx04/init.c, psx05/init.c, psx06/init.c, psx07/init.c, - psx08/task3.c, psx09/init.c, psx10/init.c, psx11/init.c, - psx12/init.c, psx13/Makefile.am, psx13/main.c, psx13/test.c, - psxcancel/init.c, psxchroot01/Makefile.am, psxchroot01/main.c, - psxchroot01/test.c, psxfile01/Makefile.am, psxfile01/main.c, - psxfile01/test.c, psxfile01/test_cat.c, psxfile01/test_extend.c, - psxfile01/test_write.c, psxmount/Makefile.am, psxmount/main.c, - psxmount/test.c, psxmsgq01/init.c, psxreaddir/Makefile.am, - psxreaddir/main.c, psxreaddir/test.c, psxsem01/init.c, - psxstat/Makefile.am, psxstat/main.c, psxstat/test.c, psxtime/main.c, - psxtime/test.c, psxtimer/psxtimer.c: Modified. - -2002-07-05 Joel Sherrill - - * psxcancel/Makefile.am, psxcancel/init.c, psxcancel/psxcancel.scn: - Updated as part of PR164 which reported problems with the RTEMS - implementation of pthread_cancel. - -2001-04-26 Joel Sherrill - - * psxmsgq01/init.c: Reflect changes made to address PR81 that - reworked POSIX message queues to add a descriptor separate from - the underlying message queue. This allows non-blocking to follow - the "open" not the underlying queue. - -2002-04-14 Ralf Corsepius - - * configure.ac: Remove ENABLE_GCC28. - -2002-03-27 Ralf Corsepius - - * configure.ac: - AC_INIT(package,_RTEMS_VERSION,_RTEMS_BUGS). - AM_INIT_AUTOMAKE([no-define foreign 1.6]). - * Makefile.am: Remove AUTOMAKE_OPTIONS. - * include/Makefile.am: Remove AUTOMAKE_OPTIONS. - * psx01/Makefile.am: Remove AUTOMAKE_OPTIONS. - * psx02/Makefile.am: Remove AUTOMAKE_OPTIONS. - * psx03/Makefile.am: Remove AUTOMAKE_OPTIONS. - * psx04/Makefile.am: Remove AUTOMAKE_OPTIONS. - * psx05/Makefile.am: Remove AUTOMAKE_OPTIONS. - * psx06/Makefile.am: Remove AUTOMAKE_OPTIONS. - * psx07/Makefile.am: Remove AUTOMAKE_OPTIONS. - * psx08/Makefile.am: Remove AUTOMAKE_OPTIONS. - * psx09/Makefile.am: Remove AUTOMAKE_OPTIONS. - * psx10/Makefile.am: Remove AUTOMAKE_OPTIONS. - * psx11/Makefile.am: Remove AUTOMAKE_OPTIONS. - * psx12/Makefile.am: Remove AUTOMAKE_OPTIONS. - * psx13/Makefile.am: Remove AUTOMAKE_OPTIONS. - * psxcancel/Makefile.am: Remove AUTOMAKE_OPTIONS. - * psxchroot01/Makefile.am: Remove AUTOMAKE_OPTIONS. - * psxfile01/Makefile.am: Remove AUTOMAKE_OPTIONS. - * psxhdrs/Makefile.am: Remove AUTOMAKE_OPTIONS. - * psxmount/Makefile.am: Remove AUTOMAKE_OPTIONS. - * psxmsgq01/Makefile.am: Remove AUTOMAKE_OPTIONS. - * psxreaddir/Makefile.am: Remove AUTOMAKE_OPTIONS. - * psxsem01/Makefile.am: Remove AUTOMAKE_OPTIONS. - * psxstat/Makefile.am: Remove AUTOMAKE_OPTIONS. - * psxtime/Makefile.am: Remove AUTOMAKE_OPTIONS. - * psxtimer/Makefile.am: Remove AUTOMAKE_OPTIONS. - -2001-11-07 Jennifer Averett - - Reported by Ibragimov Ilya and tracked as PR63. - * psxstat/test.c: Fix test ENOTDIR to correspond to chdir() change. - Since we check permissions before evaluating enough to see if it - a regular file or directory, this hack is needed to make the regular - file executable. - -2001-10-11 Ralf Corsepius - - * .cvsignore: Add autom4te.cache for autoconf > 2.52. - * configure.in: Remove. - * configure.ac: New file, generated from configure.in by autoupdate. - -2001-09-22 Ralf Corsepius - - * psxtests.am: Use TMPINSTALL_FILES = to make automake-1.5 happy. - -2001-09-19 Ralf Corsepius - - * psx01/Makefile.am: include leaf.am instead of leaf.cfg. - * psx11/Makefile.am: include leaf.am instead of leaf.cfg. - * psxcancel/Makefile.am: include leaf.am instead of leaf.cfg. - * psx02/Makefile.am: include leaf.am instead of leaf.cfg. - * psx13/Makefile.am: include leaf.am instead of leaf.cfg. - * psxtime/Makefile.am: include leaf.am instead of leaf.cfg. - * psxchroot01/Makefile.am: include leaf.am instead of leaf.cfg. - * psx07/Makefile.am: include leaf.am instead of leaf.cfg. - * psxmsgq01/Makefile.am: include leaf.am instead of leaf.cfg. - * psxtimer/Makefile.am: include leaf.am instead of leaf.cfg. - * psx10/Makefile.am: include leaf.am instead of leaf.cfg. - * psx08/Makefile.am: include leaf.am instead of leaf.cfg. - * psxhdrs/Makefile.am: include leaf.am instead of leaf.cfg. - * psxfile01/Makefile.am: include leaf.am instead of leaf.cfg. - * psx05/Makefile.am: include leaf.am instead of leaf.cfg. - * psx09/Makefile.am: include leaf.am instead of leaf.cfg. - * psxmount/Makefile.am: include leaf.am instead of leaf.cfg. - * psxstat/Makefile.am: include leaf.am instead of leaf.cfg. - * psx12/Makefile.am: include leaf.am instead of leaf.cfg. - * psxreaddir/Makefile.am: include leaf.am instead of leaf.cfg. - * psxsem01/Makefile.am: include leaf.am instead of leaf.cfg. - * psx03/Makefile.am: include leaf.am instead of leaf.cfg. - * psx04/Makefile.am: include leaf.am instead of leaf.cfg. - * psx06/Makefile.am: include leaf.am instead of leaf.cfg. - -2001-08-09 Fernando-Ruiz Casas - - * psxchroot01/.cvsignore, psxchroot01/Makefile.am, psxchroot01/main.c, - psxchroot01/psxchroot01.scn, psxchroot01/test.c: Implemented the - psxchroot01 test. - -2001-05-25 Joel Sherrill - - * Added once version of psxchroot01 test for user review. - * psxchroot01: New directory. - * psxchroot01/Makefile.am, psxchroot01/main.c, psxchroot01/test.c, - psxchroot01/psxchroot01.scn, psxchroot01/.cvsignore: New files. - * configure.in, Makefile.am: Modified to reflect above. - -2001-05-10 Ralf Corsepius - - * configure.in: Use RTEMS_PROG_CC_FOR_TARGET([-ansi -fasm]). - -2001-04-24 Joel Sherrill - - * psxfile01/test.c, psxfile01/psxfile01.scn : Added test case for - open, write, reopen, append twice from Andrew Bythell - that tripped an initialization - problem in the IMFS. - -2001-04-20 Joel Sherrill - - * psx04/init.c, psx04/psx04.scn, psx07/init.c, psx07/psx07.scn, - psxfile01/psxfile01.scn, psxmsgq01/psxmsgq01.scn, - psxreaddir/test.c, psxstat/psxstat.scn, psxstat/test.c, - psxtime/psxtime.scn, psxtimer/psxtimer.scn: - Various adjustments so test output matches screens more reliably. - -2001-01-25 Joel Sherrill - - * psx01/psx01.scn: Corrected to reflect clock_getres() now working. - -2000-11-17 Jennifer Averett - - * psxstat/test.c, psxstat/psxstat.scn: Forced inode numbers - to remain consistant across platforms and bsps by forcing - a mount point in front of all paths. - -2000-11-17 Jennifer Averret - - * psxmount/test.c, psxmount/psxmount.scn: Improve output to report - expected error condition in one case. - * psxreaddir/test.c, psxreaddir.scn: Added test cases to exercise - readdir() of root of mounted filesystem. Also corrected the screen - file for some mistakes noticed in this effort. - -2000-11-13 Joel Sherrill - - * psxmount/psxmount.scn, psxmount/test.c: Correct spelling. - -2000-11-09 Ralf Corsepius - - * Makefile.am: Use ... instead of RTEMS_TOPdir in ACLOCAL_AMFLAGS. - -2000-11-02 Ralf Corsepius - - * Makefile.am: Switch to ACLOCAL_AMFLAGS = -I $(RTEMS_TOPdir)/aclocal. - -2000-10-27 Ralf Corsepius - - * Makefile.am: ACLOCAL_AMFLAGS= -I $(RTEMS_TOPdir)/macros. - Switch to GNU canonicalization. - * psxtests.am: Remove DEFS. - -2000-10-24 Joel Sherrill - - * psxmount/test.c, psxstat/test.c: Include to get IMFS_ops. - It was formerly incorrectly prototyped in . - -2000-09-04 Ralf Corsepius - - * psx01/Makefile.am, psx02/Makefile.am, psx03/Makefile.am, - psx04/Makefile.am, psx05/Makefile.am, psx06/Makefile.am, - psx07/Makefile.am, psx08/Makefile.am, psx09/Makefile.am, - psx10/Makefile.am, psx11/Makefile.am, psx12/Makefile.am, - psx13/Makefile.am, psxcancel/Makefile.am, psxfile01/Makefile.am, - psxhdrs/Makefile.am, psxmount/Makefile.am, psxmsgq01/Makefile.am, - psxreaddir/Makefile.am, psxsem01/Makefile.am, psxstat/Makefile.am, - psxtime/Makefile.am, psxtimer/Makefile.am: Include compile.am - -2000-08-31 Ralf Corsepius - * psx01/Makefile.am, psx02/Makefile.am, psx03/Makefile.am, - psx04/Makefile.am, psx05/Makefile.am, psx06/Makefile.am, - psx07/Makefile.am, psx08/Makefile.am, psx09/Makefile.am, - psx10/Makefile.am, psx11/Makefile.am, psx11/Makefile.am, - psx12/Makefile.am, psxcancel/Makefile.am, psxmsgq01/Makefile.am, - psxsem01/Makefile.am, psxsem01/Makefile.am, psxtimer/Makefile.am: - Use AM_CPPFLAGS += instead of AM_CPPFLAGS = - -2000-08-10 Joel Sherrill - - * ChangeLog: New file. diff --git a/testsuites/psxtests/Makefile.am b/testsuites/psxtests/Makefile.am deleted file mode 100644 index 50763cacbb..0000000000 --- a/testsuites/psxtests/Makefile.am +++ /dev/null @@ -1,21 +0,0 @@ -## -## $Id$ -## - -ACLOCAL_AMFLAGS = -I ../../../../aclocal - -SHARED_DIRS = - -POSIX_DIRS = include psxhdrs psx01 psx02 psx03 psx04 psx05 psx06 psx07 psx08 \ - psx09 psx10 psx11 psx12 psxtime psxtimer psxcancel psxmsgq01 psxsem01 - -POSIX_FILES_DIRS = psxfile01 psxreaddir psxstat psxmount psx13 psxchroot01 - -UNUSED_DIRS = - -SUBDIRS = $(SHARED_DIRS) $(POSIX_DIRS) $(POSIX_FILES_DIRS) $(UNUSED_DIRS) - -EXTRA_DIST = psxtests.am - -include $(top_srcdir)/../../../../automake/subdirs.am -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/psxtests/configure.ac b/testsuites/psxtests/configure.ac deleted file mode 100644 index ad50cf129f..0000000000 --- a/testsuites/psxtests/configure.ac +++ /dev/null @@ -1,65 +0,0 @@ -## Process this file with autoconf to produce a configure script. -## -## $Id$ - -AC_PREREQ(2.57) -AC_INIT([rtems-c-src-tests-psxtests],[_RTEMS_VERSION],[rtems-bugs@OARcorp.com]) -AC_CONFIG_SRCDIR([psx01]) -RTEMS_TOP(../../../..) -AC_CONFIG_AUX_DIR(../../../..) - -RTEMS_CANONICAL_TARGET_CPU - -AM_INIT_AUTOMAKE([no-define foreign 1.7.2]) -AM_MAINTAINER_MODE - -RTEMS_ENABLE_BARE - -RTEMS_ENV_RTEMSBSP -RTEMS_CHECK_CPU -RTEMS_CANONICAL_HOST - -RTEMS_PROJECT_ROOT - -RTEMS_PROG_CC_FOR_TARGET([-ansi -fasm]) - -RTEMS_CANONICALIZE_TOOLS - -RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP) - -AC_SUBST(BARE_CPU_CFLAGS) -AC_SUBST(BARE_CPU_MODEL) -AC_SUBST(CC_CFLAGS_DEFAULT) -AC_SUBST(CC_CFLAGS_DEBUG_V) -AC_SUBST(CC_CFLAGS_PROFILE_V) -AC_SUBST(CC_LDFLAGS_PROFILE_V) - -# Explicitly list all Makefiles here -AC_CONFIG_FILES([Makefile -include/Makefile -psx01/Makefile -psx02/Makefile -psx03/Makefile -psx04/Makefile -psx05/Makefile -psx06/Makefile -psx07/Makefile -psx08/Makefile -psx09/Makefile -psx10/Makefile -psx11/Makefile -psx12/Makefile -psx13/Makefile -psxcancel/Makefile -psxchroot01/Makefile -psxfile01/Makefile -psxhdrs/Makefile -psxmount/Makefile -psxmsgq01/Makefile -psxreaddir/Makefile -psxsem01/Makefile -psxstat/Makefile -psxtime/Makefile -psxtimer/Makefile -]) -AC_OUTPUT diff --git a/testsuites/psxtests/include/.cvsignore b/testsuites/psxtests/include/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/psxtests/include/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/psxtests/include/Makefile.am b/testsuites/psxtests/include/Makefile.am deleted file mode 100644 index cb6f48b060..0000000000 --- a/testsuites/psxtests/include/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -## -## $Id$ -## - - -noinst_HEADERS = pmacros.h - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/psxtests/include/pmacros.h b/testsuites/psxtests/include/pmacros.h deleted file mode 100644 index 0338038d51..0000000000 --- a/testsuites/psxtests/include/pmacros.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * $Id$ - */ - -#ifndef __POSIX_TEST_MACROS_h -#define __POSIX_TEST_MACROS_h - -#include -#include -#include -#include -#include -#include -#include - -#include - -/* - * These help manipulate the "struct tm" form of time - */ - -#define TM_SUNDAY 0 -#define TM_MONDAY 1 -#define TM_TUESDAY 2 -#define TM_WEDNESDAY 3 -#define TM_THURSDAY 4 -#define TM_FRIDAY 5 -#define TM_SATURDAY 6 - -#define TM_JANUARY 0 -#define TM_FEBRUARY 1 -#define TM_MARCH 2 -#define TM_APRIL 3 -#define TM_MAY 4 -#define TM_JUNE 5 -#define TM_JULY 6 -#define TM_AUGUST 7 -#define TM_SEPTEMBER 8 -#define TM_OCTOBER 10 -#define TM_NOVEMBER 12 -#define TM_DECEMBER 12 - -#ifndef build_time -#define build_time( TM, WEEKDAY, MON, DAY, YR, HR, MIN, SEC ) \ - { (TM)->tm_year = YR; \ - (TM)->tm_mon = MON; \ - (TM)->tm_mday = DAY; \ - (TM)->tm_wday = WEEKDAY; \ - (TM)->tm_hour = HR; \ - (TM)->tm_min = MIN; \ - (TM)->tm_sec = SEC; } -#endif - -#define set_time( WEEKDAY, MON, DAY, YR, HR, MIN, SEC ) \ - do { \ - struct tm tm; \ - struct timespec tv; \ - int status; \ - \ - build_time( &tm, WEEKDAY, MON, DAY, YR, HR, MIN, SEC ); \ - \ - tv.tv_sec = mktime( &tm ); \ - tv.tv_nsec = 0; \ - assert( tv.tv_sec != -1 ); \ - \ - status = clock_settime( CLOCK_REALTIME, &tv ); \ - assert( !status ); \ - } while ( 0 ) - -#define print_current_time(s1, s2) \ - do { \ - char _time_buffer[32]; \ - int _status; \ - struct timespec _tv; \ - \ - _status = clock_gettime( CLOCK_REALTIME, &_tv ); \ - assert( !_status ); \ - \ - (void) ctime_r( &_tv.tv_sec, _time_buffer ); \ - _time_buffer[ strlen( _time_buffer ) - 1 ] = 0; \ - printf( "%s%s%s\n", s1, _time_buffer, s2 ); \ - fflush(stdout); \ - } while ( 0 ) - -#define empty_line() puts( "" ) - -#endif - -/* end of file */ diff --git a/testsuites/psxtests/psx01/.cvsignore b/testsuites/psxtests/psx01/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/psxtests/psx01/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/psxtests/psx01/Makefile.am b/testsuites/psxtests/psx01/Makefile.am deleted file mode 100644 index 2462265c1e..0000000000 --- a/testsuites/psxtests/psx01/Makefile.am +++ /dev/null @@ -1,44 +0,0 @@ -## -## $Id$ -## - - -TEST = psx01 - -MANAGERS = all - -C_FILES = init.c task.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/psxtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -AM_CPPFLAGS += -I$(top_srcdir)/include - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/psxtests/psx01/init.c b/testsuites/psxtests/psx01/init.c deleted file mode 100644 index 47d30c8aa4..0000000000 --- a/testsuites/psxtests/psx01/init.c +++ /dev/null @@ -1,242 +0,0 @@ -/* - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define CONFIGURE_INIT -#include "system.h" -#include -#include - -void *POSIX_Init( - void *argument -) -{ - struct timespec tv; - struct timespec tr; - int status; - int priority; - pthread_t thread_id; - time_t seconds; - time_t seconds1; - time_t remaining; - struct tm tm; - struct utsname uts; - - puts( "\n\n*** POSIX TEST 1 ***" ); - - build_time( &tm, TM_FRIDAY, TM_MAY, 24, 96, 11, 5, 0 ); - - /* print some system information */ - - puts( "Init: uname - EFAULT (invalid uts pointer argument)" ); - status = uname( NULL ); - assert( status == -1 ); - assert( errno == EFAULT ); - - status = uname( &uts ); - assert( !status ); - printf( "Init: uts.sysname: %s\n", uts.sysname ); - printf( "Init: uts.nodename: %s\n", uts.nodename ); - printf( "Init: uts.release: %s\n", uts.release ); - printf( "Init: uts.version: %s\n", uts.version ); - printf( "Init: uts.machine: %s\n", uts.machine ); - puts(""); - - /* error cases in clock_gettime and clock_settime */ - - puts( "Init: clock_gettime - EINVAL (invalid clockid)" ); - status = clock_settime( -1, &tv ); - assert( status == -1 ); - assert( errno == EINVAL ); - - puts( "Init: clock_settime - EINVAL (invalid clockid)" ); - status = clock_settime( -1, &tv ); - assert( status == -1 ); - assert( errno == EINVAL ); - - /* exercise clock_getres */ - - puts( "Init: clock_getres - EINVAL (invalid clockid)" ); - status = clock_getres( -1, &tv ); - assert( status == -1 ); - assert( errno == EINVAL ); - - puts( "Init: clock_getres - EINVAL (NULL resolution)" ); - status = clock_getres( CLOCK_REALTIME, NULL ); - assert( status == -1 ); - assert( errno == EINVAL ); - - puts( "Init: clock_getres - SUCCESSFUL" ); - status = clock_getres( CLOCK_REALTIME, &tv ); - printf( "Init: resolution = sec (%ld), nsec (%ld)\n", tv.tv_sec, tv.tv_nsec ); - assert( !status ); - - /* set the time of day, and print our buffer in multiple ways */ - - tv.tv_sec = mktime( &tm ); - assert( tv.tv_sec != -1 ); - - tv.tv_nsec = 0; - - /* now set the time of day */ - - empty_line(); - - printf( asctime( &tm ) ); - puts( "Init: clock_settime - SUCCESSFUL" ); - status = clock_settime( CLOCK_REALTIME, &tv ); - assert( !status ); - - printf( asctime( &tm ) ); - printf( ctime( &tv.tv_sec ) ); - - /* use sleep to delay */ - - remaining = sleep( 3 ); - assert( !remaining ); - - /* print new times to make sure it has changed and we can get the realtime */ - - status = clock_gettime( CLOCK_REALTIME, &tv ); - assert( !status ); - - printf( ctime( &tv.tv_sec ) ); - - seconds = time( NULL ); - printf( ctime( &seconds ) ); - - /* just to have the value copied out through the parameter */ - - seconds = time( &seconds1 ); - assert( seconds == seconds1 ); - - /* check the time remaining */ - - printf( "Init: seconds remaining (%d)\n", (int)remaining ); - assert( !remaining ); - - /* error cases in nanosleep */ - - empty_line(); - puts( "Init: nanosleep - EINVAL (NULL time)" ); - status = nanosleep ( NULL, &tr ); - assert( status == -1 ); - assert( errno == EINVAL ); - - tv.tv_sec = 0; - tv.tv_nsec = TOD_NANOSECONDS_PER_SECOND * 2; - puts( "Init: nanosleep - EINVAL (too many nanoseconds)" ); - status = nanosleep ( &tv, &tr ); - assert( status == -1 ); - assert( errno == EINVAL ); - - /* this is actually a small delay or yield */ - tv.tv_sec = -1; - tv.tv_nsec = 0; - puts( "Init: nanosleep - negative seconds small delay " ); - status = nanosleep ( &tv, &tr ); - assert( !status ); - - /* use nanosleep to yield */ - - tv.tv_sec = 0; - tv.tv_nsec = 0; - - puts( "Init: nanosleep - yield" ); - status = nanosleep ( &tv, &tr ); - assert( !status ); - assert( !tr.tv_sec ); - assert( !tr.tv_nsec ); - - /* use nanosleep to delay */ - - tv.tv_sec = 3; - tv.tv_nsec = 500000; - - puts( "Init: nanosleep - 3.05 seconds" ); - status = nanosleep ( &tv, &tr ); - assert( !status ); - - /* print the current real time again */ - - status = clock_gettime( CLOCK_REALTIME, &tv ); - assert( !status ); - - printf( ctime( &tv.tv_sec ) ); - - /* check the time remaining */ - - printf( "Init: sec (%ld), nsec (%ld) remaining\n", tr.tv_sec, tr.tv_nsec ); - assert( !tr.tv_sec && !tr.tv_nsec ); - - /* get id of this thread */ - - Init_id = pthread_self(); - printf( "Init: ID is 0x%08x\n", Init_id ); - - /* exercise get minimum priority */ - - priority = sched_get_priority_min( SCHED_FIFO ); - printf( "Init: sched_get_priority_min (SCHED_FIFO) -- %d\n", priority ); - assert( priority != -1 ); - - puts( "Init: sched_get_priority_min -- EINVAL (invalid policy)" ); - priority = sched_get_priority_min( -1 ); - assert( priority == -1 ); - assert( errno == EINVAL ); - - /* exercise get maximum priority */ - - priority = sched_get_priority_max( SCHED_FIFO ); - printf( "Init: sched_get_priority_max (SCHED_FIFO) -- %d\n", priority ); - assert( priority != -1 ); - - puts( "Init: sched_get_priority_min -- EINVAL (invalid policy)" ); - priority = sched_get_priority_min( -1 ); - assert( priority == -1 ); - assert( errno == EINVAL ); - - /* print the round robin time quantum */ - - status = sched_rr_get_interval( getpid(), &tr ); - printf( - "Init: Round Robin quantum is %ld seconds, %ld nanoseconds\n", - tr.tv_sec, - tr.tv_nsec - ); - assert( !status ); - - /* create a thread */ - - puts( "Init: pthread_create - SUCCESSFUL" ); - status = pthread_create( &thread_id, NULL, Task_1_through_3, NULL ); - assert( !status ); - - /* too may threads error */ - - puts( "Init: pthread_create - EAGAIN (too many threads)" ); - status = pthread_create( &thread_id, NULL, Task_1_through_3, NULL ); - assert( status == EAGAIN ); - - puts( "Init: sched_yield to Task_1" ); - status = sched_yield(); - assert( !status ); - - /* switch to Task_1 */ - - /* exit this thread */ - - puts( "Init: pthread_exit" ); - pthread_exit( NULL ); - - /* switch to Task_1 */ - - return NULL; /* just so the compiler thinks we returned something */ -} diff --git a/testsuites/psxtests/psx01/psx01.scn b/testsuites/psxtests/psx01/psx01.scn deleted file mode 100644 index 7633a05d89..0000000000 --- a/testsuites/psxtests/psx01/psx01.scn +++ /dev/null @@ -1,53 +0,0 @@ -*** POSIX TEST 1 *** -Init: uname - EFAULT (invalid uts pointer argument) -Init: uts.sysname: RTEMS -Init: uts.nodename: Node 1 -Init: uts.release: rtems-VERSION -NOTE: VERSION will vary. -Init: uts.version: -Init: uts.machine: CPU/CPU Model -NOTE: CPU/CPU Model will vary. -Init: clock_gettime - EINVAL (invalid clockid) -Init: clock_settime - EINVAL (invalid clockid) -Init: clock_getres - EINVAL (invalid clockid) -Init: clock_getres - EINVAL (NULL resolution) -Init: clock_getres - SUCCESSFUL -Init: resolution = sec (0), nsec (10000000) -Fri May 24 11:05:00 1996 -Init: clock_settime - SUCCESSFUL -Fri May 24 11:05:00 1996 -Fri May 24 11:05:00 1996 -Fri May 24 11:05:03 1996 -Fri May 24 11:05:03 1996 -Init: seconds remaining (0) - -Init: nanosleep - EINVAL (NULL time) -Init: nanosleep - EINVAL (too many nanoseconds) -Init: nanosleep - negative seconds small delay -Init: nanosleep - yield -Init: nanosleep - 3.05 seconds -Fri May 24 11:05:06 1996 -Init: sec (0), nsec (0) remaining -Init: ID is 0x0b010001 -Init: sched_get_priority_min (SCHED_FIFO) -- 1 -Init: sched_get_priority_min -- EINVAL (invalid policy) -Init: sched_get_priority_max (SCHED_FIFO) -- 254 -Init: sched_get_priority_min -- EINVAL (invalid policy) -Init: Round Robin quantum is 0 seconds, 500000000 nanoseconds -Init: pthread_create - SUCCESSFUL -Init: pthread_create - EAGAIN (too many threads) -Init: sched_yield to Task_1 -Task_1: sched_yield to Init -Init: pthread_exit - -Task_1: ID is 0x0b010002 -Task_1: pthread_equal - match case passed -Task_1: pthread_equal - different case passed -Task_1: pthread_equal - first id bad -Task_1: pthread_equal - second id bad -Task_1: pthread_once - EINVAL (NULL once_control) -Task_1: pthread_once - EINVAL (NULL init_routine) -Task_1: pthread_once - SUCCESSFUL (init_routine executes) -Test_init_routine: invoked -Task_1: pthread_once - SUCCESSFUL (init_routine does not execute) -*** END OF POSIX TEST 1 *** diff --git a/testsuites/psxtests/psx01/system.h b/testsuites/psxtests/psx01/system.h deleted file mode 100644 index 919521ed63..0000000000 --- a/testsuites/psxtests/psx01/system.h +++ /dev/null @@ -1,53 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -/* functions */ - -#include -#include -#include -#include - -void *POSIX_Init( - void *argument -); - -void *Task_1_through_3( - void *argument -); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 2 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#include - -/* global variables */ - -#ifdef CONFIGURE_INIT -#define TEST_EXTERN -#else -#define TEST_EXTERN extern -#endif - -TEST_EXTERN pthread_t Init_id; -TEST_EXTERN pthread_t Task_id; - -/* end of include file */ diff --git a/testsuites/psxtests/psx01/task.c b/testsuites/psxtests/psx01/task.c deleted file mode 100644 index affafd2dca..0000000000 --- a/testsuites/psxtests/psx01/task.c +++ /dev/null @@ -1,93 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -void Test_init_routine( void ) -{ - puts( "Test_init_routine: invoked" ); -} - - -void *Task_1_through_3( - void *argument -) -{ - int status; - pthread_once_t once = PTHREAD_ONCE_INIT; - - puts( "Task_1: sched_yield to Init" ); - status = sched_yield(); - assert( !status ); - - /* switch to Task_1 */ - - /* now do some real testing */ - - empty_line(); - - /* get id of this thread */ - - Task_id = pthread_self(); - printf( "Task_1: ID is 0x%08x\n", Task_id ); - - /* exercise pthread_equal */ - - status = pthread_equal( Task_id, Task_id ); - if ( status ) - puts( "Task_1: pthread_equal - match case passed" ); - assert( status ); - - status = pthread_equal( Init_id, Task_id ); - if ( !status ) - puts( "Task_1: pthread_equal - different case passed" ); - assert( !status ); - - puts( "Task_1: pthread_equal - first id bad" ); - status = pthread_equal( -1, Task_id ); - assert( !status ); - - puts( "Task_1: pthread_equal - second id bad" ); - status = pthread_equal( Init_id, -1 ); - assert( !status ); - - /* exercise pthread_once */ - - puts( "Task_1: pthread_once - EINVAL (NULL once_control)" ); - status = pthread_once( NULL, Test_init_routine ); - assert( status == EINVAL ); - - puts( "Task_1: pthread_once - EINVAL (NULL init_routine)" ); - status = pthread_once( &once, NULL ); - assert( status == EINVAL ); - - puts( "Task_1: pthread_once - SUCCESSFUL (init_routine executes)" ); - status = pthread_once( &once, Test_init_routine ); - assert( !status ); - - puts( "Task_1: pthread_once - SUCCESSFUL (init_routine does not execute)" ); - status = pthread_once( &once, Test_init_routine ); - assert( !status ); - - puts( "*** END OF POSIX TEST 1 ***" ); - rtems_test_exit( 0 ); - - return NULL; /* just so the compiler thinks we returned something */ -} diff --git a/testsuites/psxtests/psx02/.cvsignore b/testsuites/psxtests/psx02/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/psxtests/psx02/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/psxtests/psx02/Makefile.am b/testsuites/psxtests/psx02/Makefile.am deleted file mode 100644 index fcbe5f1f16..0000000000 --- a/testsuites/psxtests/psx02/Makefile.am +++ /dev/null @@ -1,44 +0,0 @@ -## -## $Id$ -## - - -TEST = psx02 - -MANAGERS = all - -C_FILES = init.c task.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/psxtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -AM_CPPFLAGS += -I$(top_srcdir)/include - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/psxtests/psx02/init.c b/testsuites/psxtests/psx02/init.c deleted file mode 100644 index 48060fd7ae..0000000000 --- a/testsuites/psxtests/psx02/init.c +++ /dev/null @@ -1,145 +0,0 @@ -/* - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define CONFIGURE_INIT -#include "system.h" -#include - -volatile int Signal_occurred; -volatile int Signal_count; - -void Signal_handler( - int signo -) -{ - Signal_count++; - printf( - "Signal: %d caught by 0x%x (%d)\n", - signo, - pthread_self(), - Signal_count - ); - Signal_occurred = 1; -} - -void *POSIX_Init( - void *argument -) -{ - int status; - struct timespec tv; - struct timespec tr; - struct sigaction act; - sigset_t mask; - sigset_t pending_set; - - puts( "\n\n*** POSIX TEST 2 ***" ); - - /* set the time of day, and print our buffer in multiple ways */ - - set_time( TM_FRIDAY, TM_MAY, 24, 96, 11, 5, 0 ); - - /* get id of this thread */ - - Init_id = pthread_self(); - printf( "Init's ID is 0x%08x\n", Init_id ); - - /* install a signal handler */ - - status = sigemptyset( &act.sa_mask ); - assert( !status ); - - act.sa_handler = Signal_handler; - act.sa_flags = 0; - - sigaction( SIGUSR1, &act, NULL ); - - /* simple signal to self */ - - Signal_count = 0; - Signal_occurred = 0; - - status = pthread_kill( Init_id, SIGUSR1 ); - assert( !status ); - - Signal_occurred = 0; - - /* now block the signal, send it, see if it is pending, and unblock it */ - - status = sigemptyset( &mask ); - assert( !status ); - - status = sigaddset( &mask, SIGUSR1 ); - assert( !status ); - - printf( "Init: Block SIGUSR1\n" ); - status = sigprocmask( SIG_BLOCK, &mask, NULL ); - assert( !status ); - - status = sigpending( &pending_set ); - assert( !status ); - printf( "Init: Signals pending 0x%08x\n", pending_set ); - - - printf( "Init: send SIGUSR1 to self\n" ); - status = pthread_kill( Init_id, SIGUSR1 ); - assert( !status ); - - status = sigpending( &pending_set ); - assert( !status ); - printf( "Init: Signals pending 0x%08x\n", pending_set ); - - printf( "Init: Unblock SIGUSR1\n" ); - status = sigprocmask( SIG_UNBLOCK, &mask, NULL ); - assert( !status ); - - /* create a thread */ - - status = pthread_create( &Task_id, NULL, Task_1_through_3, NULL ); - assert( !status ); - - /* - * Loop for 5 seconds seeing how many signals we catch - */ - - tr.tv_sec = 5; - tr.tv_nsec = 0; - - do { - tv = tr; - - Signal_occurred = 0; - - status = nanosleep ( &tv, &tr ); - - if ( status == -1 ) { - assert( errno == EINTR ); - assert( tr.tv_nsec || tr.tv_sec ); - } else if ( !status ) { - assert( !tr.tv_nsec && !tr.tv_sec ); - } - - printf( - "Init: signal was %sprocessed with %d:%d time remaining\n", - (Signal_occurred) ? "" : "not ", - (int) tr.tv_sec, - (int) tr.tv_nsec - ); - - } while ( tr.tv_sec || tr.tv_nsec ); - - /* exit this thread */ - - puts( "*** END OF POSIX TEST 2 ***" ); - rtems_test_exit( 0 ); - - return NULL; /* just so the compiler thinks we returned something */ -} diff --git a/testsuites/psxtests/psx02/psx02.scn b/testsuites/psxtests/psx02/psx02.scn deleted file mode 100644 index 573bfee91a..0000000000 --- a/testsuites/psxtests/psx02/psx02.scn +++ /dev/null @@ -1,26 +0,0 @@ -*** POSIX TEST 2 *** -Init's ID is 0x0b010001 -Signal: 16 caught by 0xc010001 (1) -Init: Block SIGUSR1 -Init: Signals pending 0x00000000 -Init: send SIGUSR1 to self -Init: Signals pending 0x00008000 -Init: Unblock SIGUSR1 -Signal: 16 caught by 0xc010001 (2) -Task1: Fri May 24 11:05:00 1996 -Signal: 16 caught by 0xc010001 (3) -Init: signal was processed with 5:0 time remaining -Task1: Fri May 24 11:05:01 1996 -Signal: 16 caught by 0xc010001 (4) -Init: signal was processed with 3:990000000 time remaining -Task1: Fri May 24 11:05:02 1996 -Signal: 16 caught by 0xc010001 (5) -Init: signal was processed with 2:980000000 time remaining -Task1: Fri May 24 11:05:03 1996 -Signal: 16 caught by 0xc010001 (6) -Init: signal was processed with 1:970000000 time remaining -Task1: Fri May 24 11:05:04 1996 -Signal: 16 caught by 0xc010001 (7) -Init: signal was processed with 0:960000000 time remaining -Init: signal was not processed with 0:0 time remaining -*** END OF POSIX TEST 2 *** diff --git a/testsuites/psxtests/psx02/system.h b/testsuites/psxtests/psx02/system.h deleted file mode 100644 index 47e5d0c91f..0000000000 --- a/testsuites/psxtests/psx02/system.h +++ /dev/null @@ -1,51 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -/* functions */ - -#include -#include - -void *POSIX_Init( - void *argument -); - -void *Task_1_through_3( - void *argument -); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 2 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#include - -/* global variables */ - -#ifdef CONFIGURE_INIT -#define TEST_EXTERN -#else -#define TEST_EXTERN extern -#endif - -TEST_EXTERN pthread_t Init_id; -TEST_EXTERN pthread_t Task_id; - -/* end of include file */ diff --git a/testsuites/psxtests/psx02/task.c b/testsuites/psxtests/psx02/task.c deleted file mode 100644 index 8d0a711c21..0000000000 --- a/testsuites/psxtests/psx02/task.c +++ /dev/null @@ -1,44 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" -#include - -void *Task_1_through_3( - void *argument -) -{ - int seconds; - int i; - int status; - - for ( i=0 ; i<5 ; i++ ) { - print_current_time( "Task1: ", "" ); - status = pthread_kill( Init_id, SIGUSR1 ); - assert( !status ); - - seconds = sleep( 1 ); - assert( !seconds ); - } - puts( "*** END OF POSIX TEST 2 ***" ); - rtems_test_exit( 0 ); - - return NULL; /* just so the compiler thinks we returned something */ -} diff --git a/testsuites/psxtests/psx03/.cvsignore b/testsuites/psxtests/psx03/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/psxtests/psx03/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/psxtests/psx03/Makefile.am b/testsuites/psxtests/psx03/Makefile.am deleted file mode 100644 index 2d411447de..0000000000 --- a/testsuites/psxtests/psx03/Makefile.am +++ /dev/null @@ -1,44 +0,0 @@ -## -## $Id$ -## - - -TEST = psx03 - -MANAGERS = all - -C_FILES = init.c task.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/psxtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -AM_CPPFLAGS += -I$(top_srcdir)/include - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/psxtests/psx03/init.c b/testsuites/psxtests/psx03/init.c deleted file mode 100644 index 7ea046b94a..0000000000 --- a/testsuites/psxtests/psx03/init.c +++ /dev/null @@ -1,203 +0,0 @@ -/* - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define CONFIGURE_INIT -#include "system.h" -#include -#include - -volatile int Signal_occurred; -volatile int Signal_count; - -void Signal_handler( - int signo -) -{ - Signal_count++; - printf( - "Signal: %d caught by 0x%x (%d)\n", - signo, - pthread_self(), - Signal_count - ); - Signal_occurred = 1; -} - -void *POSIX_Init( - void *argument -) -{ - int status; - struct timespec timeout; - struct sigaction act; - sigset_t mask; - sigset_t waitset; - int signo; - siginfo_t siginfo; - - puts( "\n\n*** POSIX TEST 3 ***" ); - - /* set the time of day, and print our buffer in multiple ways */ - - set_time( TM_FRIDAY, TM_MAY, 24, 96, 11, 5, 0 ); - - /* get id of this thread */ - - Init_id = pthread_self(); - printf( "Init's ID is 0x%08x\n", Init_id ); - - /* install a signal handler */ - - status = sigemptyset( &act.sa_mask ); - assert( !status ); - - act.sa_handler = Signal_handler; - act.sa_flags = 0; - - sigaction( SIGUSR1, &act, NULL ); - - /* initialize signal handler variables */ - - Signal_count = 0; - Signal_occurred = 0; - - /* - * wait on SIGUSR1 for 3 seconds, will timeout - */ - - /* initialize the signal set we will wait for to SIGUSR1 */ - - status = sigemptyset( &waitset ); - assert( !status ); - - status = sigaddset( &waitset, SIGUSR1 ); - assert( !status ); - - timeout.tv_sec = 3; - timeout.tv_nsec = 0; - - puts( "Init: waiting on any signal for 3 seconds." ); - signo = sigtimedwait( &waitset, &siginfo, &timeout ); - assert( signo == -1 ); - - if ( errno == EAGAIN ) - puts( "Init: correctly timed out waiting for SIGUSR1." ); - else - printf( "sigtimedwait returned wrong errno - %d\n", errno ); - - Signal_occurred = 0; - - /* - * wait on SIGUSR1 for 3 seconds, will timeout because Task_1 sends SIGUSR2 - */ - - empty_line(); - - /* initialize a mask to block SIGUSR2 */ - - status = sigemptyset( &mask ); - assert( !status ); - - status = sigaddset( &mask, SIGUSR2 ); - assert( !status ); - - printf( "Init: Block SIGUSR2\n" ); - status = sigprocmask( SIG_BLOCK, &mask, NULL ); - assert( !status ); - - /* create a thread */ - - status = pthread_create( &Task_id, NULL, Task_1, NULL ); - assert( !status ); - - /* signal handler is still installed, waitset is still set for SIGUSR1 */ - - timeout.tv_sec = 3; - timeout.tv_nsec = 0; - - puts( "Init: waiting on any signal for 3 seconds." ); - signo = sigtimedwait( &waitset, &siginfo, &timeout ); - - /* switch to Task 1 */ - - if ( errno == EAGAIN ) - puts( "Init: correctly timed out waiting for SIGUSR1." ); - else - printf( "sigtimedwait returned wrong errno - %d\n", errno ); - assert( signo == -1 ); - - /* - * wait on SIGUSR1 for 3 seconds, Task_2 will send it to us - */ - - empty_line(); - - /* create a thread */ - - status = pthread_create( &Task_id, NULL, Task_2, NULL ); - assert( !status ); - - /* signal handler is still installed, waitset is still set for SIGUSR1 */ - - /* wait on SIGUSR1 for 3 seconds, will receive SIGUSR1 from Task_2 */ - - timeout.tv_sec = 3; - timeout.tv_nsec = 0; - - /* just so we can check that these were altered */ - - siginfo.si_code = -1; - siginfo.si_signo = -1; - siginfo.si_value.sival_int = -1; - - puts( "Init: waiting on any signal for 3 seconds." ); - signo = sigtimedwait( &waitset, &siginfo, &timeout ); - printf( "Init: received (%d) SIGUSR1=%d\n", siginfo.si_signo, SIGUSR1 ); - assert( signo == SIGUSR1 ); - assert( siginfo.si_signo == SIGUSR1 ); - assert( siginfo.si_code == SI_USER ); - assert( siginfo.si_value.sival_int != -1 ); /* rtems does always set this */ - - /* try out a process signal */ - - empty_line(); - puts( "Init: kill with SIGUSR2." ); - status = kill( getpid(), SIGUSR2 ); - assert( !status ); - - siginfo.si_code = -1; - siginfo.si_signo = -1; - siginfo.si_value.sival_int = -1; - - status = sigemptyset( &waitset ); - assert( !status ); - - status = sigaddset( &waitset, SIGUSR1 ); - assert( !status ); - - status = sigaddset( &waitset, SIGUSR2 ); - assert( !status ); - - puts( "Init: waiting on any signal for 3 seconds." ); - signo = sigtimedwait( &waitset, &siginfo, &timeout ); - printf( "Init: received (%d) SIGUSR2=%d\n", siginfo.si_signo, SIGUSR2 ); - assert( signo == SIGUSR2 ); - assert( siginfo.si_signo == SIGUSR2 ); - assert( siginfo.si_code == SI_USER ); - assert( siginfo.si_value.sival_int != -1 ); /* rtems does always set this */ - - /* exit this thread */ - - puts( "*** END OF POSIX TEST 3 ***" ); - rtems_test_exit( 0 ); - - return NULL; /* just so the compiler thinks we returned something */ -} diff --git a/testsuites/psxtests/psx03/psx03.scn b/testsuites/psxtests/psx03/psx03.scn deleted file mode 100644 index 2436910302..0000000000 --- a/testsuites/psxtests/psx03/psx03.scn +++ /dev/null @@ -1,21 +0,0 @@ -*** POSIX TEST 3 *** -Init's ID is 0x0b010001 -Init: waiting on any signal for 3 seconds. -Init: correctly timed out waiting for SIGUSR1. - -Init: Block SIGUSR2 -Init: waiting on any signal for 3 seconds. -Task_1: Fri May 24 11:05:03 1996 -Task_1: pthread_kill - SIGUSR2 to Init -Init: correctly timed out waiting for SIGUSR1. - -Init: waiting on any signal for 3 seconds. -Task_2: Fri May 24 11:05:06 1996 -Task_1: pthread_kill - SIGUSR1 to Init -Signal: 16 caught by 0xc010001 (1) -Init: received (16) SIGUSR1=16 - -Init: kill with SIGUSR2. -Init: waiting on any signal for 3 seconds. -Init: received (17) SIGUSR2=17 -*** END OF POSIX TEST 3 *** diff --git a/testsuites/psxtests/psx03/system.h b/testsuites/psxtests/psx03/system.h deleted file mode 100644 index cf5c7370a7..0000000000 --- a/testsuites/psxtests/psx03/system.h +++ /dev/null @@ -1,54 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -/* functions */ - -#include - -void *POSIX_Init( - void *argument -); - -void *Task_1( - void *argument -); - -void *Task_2( - void *argument -); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 3 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#include - -/* global variables */ - -#ifdef CONFIGURE_INIT -#define TEST_EXTERN -#else -#define TEST_EXTERN extern -#endif - -TEST_EXTERN pthread_t Init_id; -TEST_EXTERN pthread_t Task_id; - -/* end of include file */ diff --git a/testsuites/psxtests/psx03/task.c b/testsuites/psxtests/psx03/task.c deleted file mode 100644 index 88eb7469cd..0000000000 --- a/testsuites/psxtests/psx03/task.c +++ /dev/null @@ -1,64 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" -#include - -void *Task_1( - void *argument -) -{ - int status; - - /* send SIGUSR2 to Init which is waiting on SIGUSR1 */ - - print_current_time( "Task_1: ", "" ); - - puts( "Task_1: pthread_kill - SIGUSR2 to Init" ); - status = pthread_kill( Init_id, SIGUSR2 ); - assert( !status ); - - pthread_exit( NULL ); - - /* switch to Init */ - - return NULL; /* just so the compiler thinks we returned something */ -} - -void *Task_2( - void *argument -) -{ - int status; - - /* send SIGUSR1 to Init which is waiting on SIGUSR1 */ - - print_current_time( "Task_2: ", "" ); - - puts( "Task_1: pthread_kill - SIGUSR1 to Init" ); - status = pthread_kill( Init_id, SIGUSR1 ); - assert( !status ); - - pthread_exit( NULL ); - - /* switch to Init */ - - return NULL; /* just so the compiler thinks we returned something */ -} diff --git a/testsuites/psxtests/psx04/.cvsignore b/testsuites/psxtests/psx04/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/psxtests/psx04/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/psxtests/psx04/Makefile.am b/testsuites/psxtests/psx04/Makefile.am deleted file mode 100644 index 1f4ee8a0a6..0000000000 --- a/testsuites/psxtests/psx04/Makefile.am +++ /dev/null @@ -1,44 +0,0 @@ -## -## $Id$ -## - - -TEST = psx04 - -MANAGERS = all - -C_FILES = init.c task1.c task2.c task3.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/psxtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -AM_CPPFLAGS += -I$(top_srcdir)/include - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/psxtests/psx04/init.c b/testsuites/psxtests/psx04/init.c deleted file mode 100644 index b6b160ef21..0000000000 --- a/testsuites/psxtests/psx04/init.c +++ /dev/null @@ -1,557 +0,0 @@ -/* - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define CONFIGURE_INIT -#include "system.h" -#include -#include - -volatile int Signal_occurred; -volatile int Signal_count; - -void Signal_handler( - int signo -) -{ - Signal_count++; - printf( - "Signal: %d caught by 0x%x (%d)\n", - signo, - pthread_self(), - Signal_count - ); - Signal_occurred = 1; -} - -void Signal_info_handler( - int signo, - siginfo_t *info, - void *context -) -{ - Signal_count++; - printf( - "Signal_info: %d caught by 0x%x (%d) si_signo= %d si_code= %d value= %d\n", - signo, - pthread_self(), - Signal_count, - info->si_signo, - info->si_code, - info->si_value.sival_int - ); - Signal_occurred = 1; -} - -void *POSIX_Init( - void *argument -) -{ - int status; - struct sigaction act; - sigset_t mask; - sigset_t pending_set; - sigset_t oset; - struct timespec timeout; - siginfo_t info; - - puts( "\n\n*** POSIX TEST 4 ***" ); - - /* set the time of day, and print our buffer in multiple ways */ - - set_time( TM_FRIDAY, TM_MAY, 24, 96, 11, 5, 0 ); - - /* get id of this thread */ - - Init_id = pthread_self(); - printf( "Init's ID is 0x%08x\n", Init_id ); - -/* install a signal handler for SIGUSR1 */ - - status = sigemptyset( &act.sa_mask ); - assert( !status ); - printf( "Init: sigemptyset - set= 0x%08x\n", act.sa_mask ); - - /* test sigfillset following the above sigemptyset */ - - status = sigfillset( &act.sa_mask ); - assert( !status ); - printf( "Init: sigfillset - set= 0x%08x\n", act.sa_mask ); - - /* test sigdelset */ - - status = sigdelset( &act.sa_mask, SIGUSR1 ); - assert( !status ); - printf( "Init: sigdelset - delete SIGUSR1 set= 0x%08x\n", act.sa_mask ); - - /* test sigismember - FALSE */ - - status = sigismember( &act.sa_mask, SIGUSR1 ); - assert( !status ); - puts( "Init: sigismember - FALSE since SIGUSR1 is not a member" ); - - /* test sigismember - TRUE */ - - status = sigismember( &act.sa_mask, SIGUSR2 ); - assert( status ); - puts( "Init: sigismember - TRUE since SIGUSR2 is a member" ); - - /* return the set to empty */ - - act.sa_handler = Signal_handler; - act.sa_flags = 0; - - sigaction( SIGUSR1, &act, NULL ); - - /* simple signal to process */ - - Signal_count = 0; - Signal_occurred = 0; - - puts( "Init: send SIGUSR1 to process" ); - status = kill( getpid(), SIGUSR1 ); - assert( !status ); - -/* end of install a signal handler for SIGUSR1 */ - - Signal_occurred = 0; - - /* now block the signal, send it, see if it is pending, and unblock it */ - - empty_line(); - - status = sigemptyset( &mask ); - assert( !status ); - - status = sigaddset( &mask, SIGUSR1 ); - assert( !status ); - - puts( "Init: Block SIGUSR1" ); - act.sa_handler = Signal_handler; - act.sa_flags = 0; - - sigaction( SIGUSR1, &act, NULL ); - - /* simple signal to process */ - - Signal_count = 0; - Signal_occurred = 0; - - puts( "Init: send SIGUSR1 to process" ); - status = kill( getpid(), SIGUSR1 ); - assert( !status ); - - Signal_occurred = 0; - - /* now block the signal, send it, see if it is pending, and unblock it */ - - empty_line(); - - status = sigemptyset( &mask ); - assert( !status ); - - status = sigaddset( &mask, SIGUSR1 ); - assert( !status ); - - puts( "Init: Block SIGUSR1" ); - status = sigprocmask( SIG_BLOCK, &mask, NULL ); - assert( !status ); - - status = sigpending( &pending_set ); - assert( !status ); - printf( "Init: Signals pending 0x%08x\n", pending_set ); - - puts( "Init: send SIGUSR1 to process" ); - status = kill( getpid(), SIGUSR1 ); - assert( !status ); - - status = sigpending( &pending_set ); - assert( !status ); - printf( "Init: Signals pending 0x%08x\n", pending_set ); - - puts( "Init: Unblock SIGUSR1" ); - status = sigprocmask( SIG_UNBLOCK, &mask, NULL ); - assert( !status ); - - /* now let another task get interrupted by a signal */ - - empty_line(); - - puts( "Init: create a thread interested in SIGUSR1" ); - status = pthread_create( &Task1_id, NULL, Task_1, NULL ); - assert( !status ); - - puts( "Init: Block SIGUSR1" ); - status = sigprocmask( SIG_BLOCK, &mask, NULL ); - assert( !status ); - - status = sigpending( &pending_set ); - assert( !status ); - printf( "Init: Signals pending 0x%08x\n", pending_set ); - - puts( "Init: sleep so the other task can block" ); - status = sleep( 1 ); - assert( !status ); - - /* switch to task 1 */ - - puts( "Init: send SIGUSR1 to process" ); - status = kill( getpid(), SIGUSR1 ); - assert( !status ); - - status = sigpending( &pending_set ); - assert( !status ); - printf( "Init: Signals pending 0x%08x\n", pending_set ); - - puts( "Init: sleep so the other task can catch signal" ); - status = sleep( 1 ); - assert( !status ); - - /* switch to task 1 */ - - /* test alarm */ - - empty_line(); - - /* install a signal handler for SIGALRM and unblock it */ - - status = sigemptyset( &act.sa_mask ); - assert( !status ); - - act.sa_handler = Signal_handler; - act.sa_flags = 0; - - sigaction( SIGALRM, &act, NULL ); - - status = sigemptyset( &mask ); - assert( !status ); - - status = sigaddset( &mask, SIGALRM ); - assert( !status ); - - puts( "Init: Unblock SIGALRM" ); - status = sigprocmask( SIG_UNBLOCK, &mask, NULL ); - assert( !status ); - - /* schedule the alarm */ - - puts( "Init: Firing alarm in 5 seconds" ); - status = alarm( 5 ); - printf( "Init: %d seconds left on previous alarm\n", status ); - assert( !status ); - - puts( "Init: Firing alarm in 2 seconds" ); - status = alarm( 2 ); - printf( "Init: %d seconds left on previous alarm\n", status ); - assert( status ); - - puts( "Init: Wait 4 seconds for alarm" ); - status = sleep( 4 ); - printf( "Init: %d seconds left in sleep\n", status ); - assert( status ); - - /* test SIG_SETMASK case and returning oset of pthread_sigmask */ - - empty_line(); - - status = sigemptyset( &mask ); - assert( !status ); - - status = sigaddset( &mask, SIGUSR1 ); - assert( !status ); - - status = sigaddset( &mask, SIGUSR2 ); - assert( !status ); - - puts( "Init: Block SIGUSR1 and SIGUSR2 only" ); - status = pthread_sigmask( SIG_SETMASK, &mask, &oset ); - printf( "Init: Previous blocked set was 0x%08x\n", oset ); - assert( !status ); - - /* test inquiry about current blocked set with pthread_sigmask */ - - status = pthread_sigmask( 0, NULL, &oset ); - printf( "Init: Current blocked set is 0x%08x\n", oset ); - assert( !status ); - - /* return blocked mask to no signals blocked */ - - status = sigemptyset( &mask ); - assert( !status ); - - puts( "Init: Unblock all signals" ); - status = pthread_sigmask( SIG_SETMASK, &mask, &oset ); - printf( "Init: Previous blocked set was 0x%08x\n", oset ); - assert( !status ); - - /* test sigsuspend */ - - empty_line(); - - puts( "Init: create a thread to send Init SIGUSR1" ); - status = pthread_create( &Task2_id, NULL, Task_2, NULL ); - assert( !status ); - - status = sigemptyset( &mask ); - assert( !status ); - - puts( "Init: sigsuspend for any signal" ); - status = sigsuspend( &mask ); - assert( status ); - printf( "Init: awakended from sigsuspend status=%08d \n", status ); - - /* test a SIGINFO case, these are signals sent to a process only */ - - empty_line(); - - puts( "Init: create a thread to sent Process SIGUSR1 with SA_SIGINFO" ); - status = pthread_create( &Task3_id, NULL, Task_3, NULL ); - assert( !status ); - - /* set action on SIGUSR1 to an info case */ - act.sa_handler = Signal_handler; - act.sa_flags = SA_SIGINFO; - act.sa_sigaction = Signal_info_handler; - - sigaction( SIGUSR1, &act, NULL ); - - puts( "Init: sleep so the Task_3 can sigqueue SIGUSR1" ); - status = sleep( 1 ); - assert( !status ); - - /* switch to task 1 */ - - puts( "Init: sigqueue occurred" ); - - /* Send SIGUSR1, Task_3 has issued a sigwaitinfo */ - - status = sigemptyset( &mask ); - assert( !status ); - - status = sigaddset( &mask, SIGUSR1 ); - assert( !status ); - - puts( "Init: Block SIGUSR1" ); - status = sigprocmask( SIG_BLOCK, &mask, NULL ); - assert( !status ); - - puts( "Init: send SIGUSR1 to process" ); - status = kill( getpid(), SIGUSR1 ); - assert( !status ); - - puts( "Init: sleep so the Task_3 can receive SIGUSR1" ); - status = sleep( 1 ); - assert( !status ); - - /* Send SIGUSR1, Task_3 has issued a sigwait */ - - status = sigemptyset( &mask ); - assert( !status ); - - status = sigaddset( &mask, SIGUSR1 ); - assert( !status ); - - puts( "Init: Block SIGUSR1" ); - status = sigprocmask( SIG_BLOCK, &mask, NULL ); - assert( !status ); - - puts( "Init: send SIGUSR1 to process" ); - status = kill( getpid(), SIGUSR1 ); - assert( !status ); - - puts( "Init: sleep so the Task_3 can receive SIGUSR1" ); - status = sleep( 1 ); - assert( !status ); - - /* Send SIGUSR1, Task_3 has issued a sigwaitinfo */ - - status = sigemptyset( &mask ); - assert( !status ); - - status = sigaddset( &mask, SIGUSR2 ); - assert( !status ); - - puts( "Init: Block SIGUSR2" ); - status = sigprocmask( SIG_BLOCK, &mask, NULL ); - assert( !status ); - - puts( "Init: send SIGUSR2 to process" ); - status = kill( getpid(), SIGUSR2 ); - assert( !status ); - - puts( "Init: sleep so the Task_3 can receive SIGUSR2" ); - status = sleep( 1 ); - assert( !status ); - - /* Suspend for signal that has already be sent */ - - puts( "Init: sigsuspend for any signal" ); - status = sigsuspend( &mask ); - assert( status ); - printf( "Init: awakended from sigsuspend status=%d \n", status ); - - /* generate error cases for psignal */ - - empty_line(); - - status = sigemptyset( NULL ); - if ( status != -1 ) - printf( "status = %d\n", status ); - assert( errno == EINVAL ); - puts( "Init: sigemptyset - EINVAL (set invalid)" ); - - status = sigfillset( NULL ); - if ( status != -1 ) - printf( "status = %d\n", status ); - assert( errno == EINVAL ); - puts( "Init: sigfillset - EINVAL (set invalid)" ); - - status = sigaddset( NULL, SIGUSR1 ); - if ( status != -1 ) - printf( "status = %d\n", status ); - assert( errno == EINVAL ); - puts( "Init: sigaddset - EINVAL (set invalid)" ); - - status = sigaddset( &mask, 0 ); - assert( !status ); - puts( "Init: sigaddset - SUCCESSFUL (signal = 0)" ); - - status = sigaddset( &mask, 999 ); - if ( status != -1 ) - printf( "status = %d\n", status ); - assert( errno == EINVAL ); - puts( "Init: sigaddset - EINVAL (set invalid)" ); - - status = sigdelset( NULL, SIGUSR1 ); - if ( status != -1 ) - printf( "status = %d\n", status ); - assert( errno == EINVAL ); - puts( "Init: sigdelset - EINVAL (set invalid)" ); - - status = sigdelset( &mask, 0 ); - assert( !status ); - puts( "Init: sigdelset - SUCCESSFUL (signal = 0)" ); - - status = sigdelset( &mask, 999 ); - if ( status != -1 ) - printf( "status = %d\n", status ); - assert( errno == EINVAL ); - puts( "Init: sigdelset - EINVAL (set invalid)" ); - - status = sigismember( NULL, SIGUSR1 ); - if ( status != -1 ) - printf( "status = %d\n", status ); - assert( errno == EINVAL ); - puts( "Init: sigismember - EINVAL (set invalid)" ); - - status = sigismember( &mask, 0 ); - assert( !status ); - puts( "Init: sigismember - SUCCESSFUL (signal = 0)" ); - - status = sigismember( &mask, 999 ); - if ( status != -1 ) - printf( "status = %d\n", status ); - assert( errno == EINVAL ); - puts( "Init: sigismember - EINVAL (signal invalid)" ); - - status = sigaction( 0, &act, 0 ); - assert( !status ); - puts( "Init: sigaction - SUCCESSFUL (signal = 0)" ); - - status = sigaction( 999, &act, NULL ); - if ( status != -1 ) - printf( "status = %d\n", status ); - assert( errno == EINVAL ); - puts( "Init: sigaction - EINVAL (signal invalid)" ); - - status = sigaction( SIGKILL, &act, NULL ); - if ( status != -1 ) - printf( "status = %d\n", status ); - assert( errno == EINVAL ); - puts( "Init: sigaction - EINVAL (SIGKILL)" ); - - status = pthread_sigmask( SIG_BLOCK, NULL, NULL ); - if ( status != -1 ) - printf( "status = %d\n", status ); - assert( errno == EINVAL ); - puts( "Init: pthread_sigmask - EINVAL (set and oset invalid)" ); - - status = pthread_sigmask( 999, &pending_set, NULL ); - if ( status != -1 ) - printf( "status = %d\n", status ); - assert( errno == EINVAL ); - puts( "Init: pthread_sigmask - EINVAL (how invalid)" ); - - status = sigpending( NULL ); - if ( status != -1 ) - printf( "status = %d\n", status ); - assert( errno == EINVAL ); - puts( "Init: sigpending - EINVAL (set invalid)" ); - - timeout.tv_nsec = -1; - status = sigtimedwait( &mask, &info, &timeout ); - if ( status != -1 ) - printf( "status = %d\n", status ); - assert( errno == EINVAL ); - puts( "Init: pthread_sigmask - EINVAL (timout->nsec invalid < 0)" ); - - timeout.tv_nsec = 0x7fffffff; - status = sigtimedwait( &mask, &info, &timeout ); - if ( status != -1 ) - printf( "status = %d\n", status ); - assert( errno == EINVAL ); - puts( "Init: pthread_sigmask - EINVAL (timout->nsec invalid to large)" ); - - status = pthread_kill( Init_id, 999 ); - if ( status != -1 ) - printf( "status = %d\n", status ); - assert( errno == EINVAL ); - puts( "Init: pthread_kill - EINVAL (sig invalid)" ); - - status = pthread_kill( 0, SIGUSR2 ); - if ( status != -1 ) - printf( "status = %d\n", status ); - assert( errno == ESRCH ); - puts( "Init: pthread_kill - ESRCH (signal SA_SIGINFO)" ); - - status = pthread_kill( Init_id, 0 ); - assert( !status ); - puts( "Init: pthread_kill - SUCCESSFUL (signal = 0)" ); - - act.sa_handler = SIG_IGN; - act.sa_flags = 0; - sigaction( SIGUSR2, &act, NULL ); - status = pthread_kill( Init_id, SIGUSR2 ); - assert( !status ); - puts( "Init: pthread_kill - SUCCESSFUL (signal = SIG_IGN)" ); - - status = kill( 0x7fffffff, SIGUSR1 ); - if ( status != -1 ) - printf( "status = %d\n", status ); - assert( errno == ESRCH ); - puts( "Init: kill - ESRCH (pid invalid)" ); - - status = kill( getpid(), 0 ); - assert( !status ); - puts( "Init: kill - SUCCESSFUL (signal = 0)" ); - - status = kill( getpid(), 999 ); - if ( status != -1 ) - printf( "status = %d\n", status ); - assert( errno == EINVAL ); - puts( "Init: kill - EINVAL (sig invalid)" ); - - /* exit this thread */ - - puts( "*** END OF POSIX TEST 4 ***" ); - rtems_test_exit( 0 ); - - return NULL; /* just so the compiler thinks we returned something */ -} diff --git a/testsuites/psxtests/psx04/psx04.scn b/testsuites/psxtests/psx04/psx04.scn deleted file mode 100644 index 9c78c445ef..0000000000 --- a/testsuites/psxtests/psx04/psx04.scn +++ /dev/null @@ -1,99 +0,0 @@ -*** POSIX TEST 4 *** -Init's ID is 0x0b010001 -Init: sigemptyset - set= 0x00000000 -Init: sigfillset - set= 0xffffffff -Init: sigdelset - delete SIGUSR1 set= 0xffff7fff -Init: sigismember - FALSE since SIGUSR1 is not a member -Init: sigismember - TRUE since SIGUSR2 is a member -Init: send SIGUSR1 to process -Signal: 16 caught by 0xc010001 (1) -Init: Block SIGUSR1 -Init: send SIGUSR1 to process -Signal: 16 caught by 0xc010001 (1) -Init: Block SIGUSR1 -Init: Signals pending 0x00000000 -Init: send SIGUSR1 to process -Init: Signals pending 0x00008000 -Init: Unblock SIGUSR1 -Signal: 16 caught by 0xc010001 (2) -Init: create a thread interested in SIGUSR1 -Init: Block SIGUSR1 -Init: Signals pending 0x00000000 -Init: sleep so the other task can block -Task_1: sleeping for 5 seconds -Init: send SIGUSR1 to process -Init: Signals pending 0x00008000 -Init: sleep so the other task can catch signal -Signal: 16 caught by 0xc010002 (3) -Task_1: 4 seconds left -Task_1: exit -Init: Unblock SIGALRM -Init: Firing alarm in 5 seconds -Init: 0 seconds left on previous alarm -Init: Firing alarm in 2 seconds -Init: 4 seconds left on previous alarm - MAY BE 5 SECONDS ALSO -Init: Wait 4 seconds for alarm -Signal: 14 caught by 0xc010001 (4) -Init: 2 seconds left in sleep -Init: Block SIGUSR1 and SIGUSR2 only -Init: Previous blocked set was 0x00008000 -Init: Current blocked set is 0x00018000 -Init: Unblock all signals -Init: Previous blocked set was 0x00018000 -Init: create a thread to send Init SIGUSR1 -Init: sigsuspend for any signal -Task_2: sending SIGUSR1 -Task_2: exit -Signal: 16 caught by 0xc010001 (5) -Init: awakended from sigsuspend status=00000016 -Init: create a thread to sent Process SIGUSR1 with SA_SIGINFO -Init: sleep so the Task_3 can sigqueue SIGUSR1 -Task_3: sigqueue SIGUSR1 with value= 16 -Signal_info: 16 caught by 0xc010004 (6) si_signo= 16 si_code= 1 value= 16 -Task_3: sigwaitinfo SIGUSR1 with value= 16 -Init: sigqueue occurred -Init: Block SIGUSR1 -Init: send SIGUSR1 to process -Init: sleep so the Task_3 can receive SIGUSR1 -Task_3: si_signo= 16 si_code= 1 value= 0 -Task_3: sigwait SIGUSR1 -Init: Block SIGUSR1 -Init: send SIGUSR1 to process -Init: sleep so the Task_3 can receive SIGUSR1 -Task_3: signo= 16 -Task_3: pause -Init: Block SIGUSR2 -Init: send SIGUSR2 to process -Init: sleep so the Task_3 can receive SIGUSR2 -Task_3: pause= 17 -Task_3: sending SIGUSR2 -Task_3: sleep so the Init task can reguest a signal -Init: sigsuspend for any signal -Init: awakended from sigsuspend status=17 -Init: sigemptyset - EINVAL (set invalid) -Init: sigfillset - EINVAL (set invalid) -Init: sigaddset - EINVAL (set invalid) -Init: sigaddset - SUCCESSFUL (signal = 0) -Init: sigaddset - EINVAL (set invalid) -Init: sigdelset - EINVAL (set invalid) -Init: sigdelset - SUCCESSFUL (signal = 0) -Init: sigdelset - EINVAL (set invalid) -Init: sigismember - EINVAL (set invalid) -Init: sigismember - SUCCESSFUL (signal = 0) -Init: sigismember - EINVAL (signal invalid) -Init: sigaction - SUCCESSFUL (signal = 0) -Init: sigaction - EINVAL (signal invalid) -Init: sigaction - EINVAL (SIGKILL) -Init: pthread_sigmask - EINVAL (set and oset invalid) -Init: pthread_sigmask - EINVAL (how invalid) -Init: sigpending - EINVAL (set invalid) -Init: pthread_sigmask - EINVAL (timout->nsec invalid < 0) -Init: pthread_sigmask - EINVAL (timout->nsec invalid to large) -Init: pthread_kill - EINVAL (sig invalid) -Init: pthread_kill - ESRCH (signal SA_SIGINFO) -Init: pthread_kill - SUCCESSFUL (signal = 0) -Init: pthread_kill - SUCCESSFUL (signal = SIG_IGN) -Init: kill - ESRCH (pid invalid) -Init: kill - SUCCESSFUL (signal = 0) -Init: kill - EINVAL (sig invalid) -*** END OF POSIX TEST 4 *** diff --git a/testsuites/psxtests/psx04/system.h b/testsuites/psxtests/psx04/system.h deleted file mode 100644 index 0619a921a1..0000000000 --- a/testsuites/psxtests/psx04/system.h +++ /dev/null @@ -1,63 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -/* functions */ - -#include - -void *POSIX_Init( - void *argument -); - -void *Task_1( - void *argument -); - -void *Task_2( - void *argument -); - -void *Task_3( - void *argument -); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 4 -#define CONFIGURE_MAXIMUM_POSIX_QUEUED_SIGNALS 5 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE -#define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE \ - (RTEMS_MINIMUM_STACK_SIZE * 4) - -#include - -/* global variables */ - -#ifdef CONFIGURE_INIT -#define TEST_EXTERN -#else -#define TEST_EXTERN extern -#endif - -TEST_EXTERN pthread_t Init_id; -TEST_EXTERN pthread_t Task1_id; -TEST_EXTERN pthread_t Task2_id; -TEST_EXTERN pthread_t Task3_id; - -/* end of include file */ diff --git a/testsuites/psxtests/psx04/task1.c b/testsuites/psxtests/psx04/task1.c deleted file mode 100644 index 78adc87007..0000000000 --- a/testsuites/psxtests/psx04/task1.c +++ /dev/null @@ -1,43 +0,0 @@ -/* Task_1 - * - * This routine serves as a test task. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" -#include - -void *Task_1( - void *argument -) -{ - int seconds; - - printf( "Task_1: sleeping for 5 seconds\n" ); - - seconds = sleep( 5 ); - printf( "Task_1: %d seconds left\n", seconds ); - assert( seconds ); - - /* switch to Init */ - - printf( "Task_1: exit\n" ); - pthread_exit( NULL ); - - /* switch to Init */ - - return NULL; /* just so the compiler thinks we returned something */ -} diff --git a/testsuites/psxtests/psx04/task2.c b/testsuites/psxtests/psx04/task2.c deleted file mode 100644 index 8bec7dc43b..0000000000 --- a/testsuites/psxtests/psx04/task2.c +++ /dev/null @@ -1,41 +0,0 @@ -/* Task_2 - * - * This routine serves as a test task. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" -#include - -void *Task_2( - void *argument -) -{ - int status; - - printf( "Task_2: sending SIGUSR1\n" ); - status = pthread_kill( Init_id, SIGUSR1 ); - assert( !status ); - - /* switch to Init */ - - printf( "Task_2: exit\n" ); - pthread_exit( NULL ); - - /* switch to Init */ - - return NULL; /* just so the compiler thinks we returned something */ -} diff --git a/testsuites/psxtests/psx04/task3.c b/testsuites/psxtests/psx04/task3.c deleted file mode 100644 index b2019b109a..0000000000 --- a/testsuites/psxtests/psx04/task3.c +++ /dev/null @@ -1,118 +0,0 @@ -/* Task_3 - * - * This routine serves as a test task. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" -#include - -void *Task_3( - void *argument -) -{ - int status; - int sig; - union sigval value; - sigset_t mask; - siginfo_t info; - - value.sival_int = SIGUSR1; - - printf( "Task_3: sigqueue SIGUSR1 with value= %d\n", value.sival_int ); - status = sigqueue( getpid(), SIGUSR1, value ); - assert( !status ); - - /* catch signal with sigwaitinfo */ - - empty_line(); - - status = sigemptyset( &mask ); - assert( !status ); - - status = sigaddset( &mask, SIGUSR1 ); - assert( !status ); - - printf( "Task_3: sigwaitinfo SIGUSR1 with value= %d\n", value.sival_int ); - status = sigwaitinfo( &mask, &info ); - - /* switch to Init */ - - assert( !(status==-1) ); - printf( - "Task_3: si_signo= %d si_code= %d value= %d\n", - info.si_signo, - info.si_code, - info.si_value.sival_int - ); - - /* catch signal with sigwait */ - - empty_line(); - - status = sigemptyset( &mask ); - assert( !status ); - - status = sigaddset( &mask, SIGUSR1 ); - assert( !status ); - - printf( "Task_3: sigwait SIGUSR1\n" ); - status = sigwait( &mask, &sig ); - - /* switch to Init */ - - assert( !status ); - printf( "Task_3: signo= %d\n", sig ); - - /* catch signal with pause */ - - empty_line(); - - status = sigemptyset( &mask ); - assert( !status ); - - status = sigaddset( &mask, SIGUSR1 ); - assert( !status ); - - printf( "Task_3: pause\n" ); - status = pause( ); - - /* switch to Init */ - - assert( !(status==-1) ); - printf( "Task_3: pause= %d\n", status ); - - - /* send signal to Init task before it has pended for a signal */ - - empty_line(); - - printf( "Task_3: sending SIGUSR2\n" ); - status = pthread_kill( Init_id, SIGUSR2 ); - assert( !status ); - - printf( "Task_3: sleep so the Init task can reguest a signal\n" ); - status = sleep( 1 ); - assert( !status ); - - /* end of task 3 */ - printf( "Task_3: exit\n" ); - pthread_exit( NULL ); - - /* switch to Init */ - - return NULL; /* just so the compiler thinks we returned something */ -} diff --git a/testsuites/psxtests/psx05/.cvsignore b/testsuites/psxtests/psx05/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/psxtests/psx05/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/psxtests/psx05/Makefile.am b/testsuites/psxtests/psx05/Makefile.am deleted file mode 100644 index df33acdc01..0000000000 --- a/testsuites/psxtests/psx05/Makefile.am +++ /dev/null @@ -1,44 +0,0 @@ -## -## $Id$ -## - - -TEST = psx05 - -MANAGERS = all - -C_FILES = init.c task.c task2.c task3.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/psxtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -AM_CPPFLAGS += -I$(top_srcdir)/include - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/psxtests/psx05/init.c b/testsuites/psxtests/psx05/init.c deleted file mode 100644 index 836aa927bc..0000000000 --- a/testsuites/psxtests/psx05/init.c +++ /dev/null @@ -1,583 +0,0 @@ -/* - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define CONFIGURE_INIT -#include "system.h" -#include - -#define MUTEX_BAD_ID 0xfffffffe - -void Print_mutexattr( - char *msg, - pthread_mutexattr_t *attr -) -{ - int status; - int protocol; - int prioceiling; - int pshared; - - /* protocol */ - - status = pthread_mutexattr_getprotocol( attr, &protocol ); - assert( !status ); - - printf( "%smutex protocol is (%d) -- ", msg, protocol ); - switch ( protocol ) { - case PTHREAD_PRIO_NONE: - puts( "PTHREAD_PRIO_NONE" ); - break; - case PTHREAD_PRIO_INHERIT: - puts( "PTHREAD_PRIO_INHERIT" ); - break; - case PTHREAD_PRIO_PROTECT: - puts( "PTHREAD_PRIO_PROTECT" ); - break; - default: - puts( "UNKNOWN" ); - assert( 0 ); - break; - } - - /* priority ceiling */ - - status = pthread_mutexattr_getprioceiling( attr, &prioceiling ); - assert( !status ); - printf( "%smutex priority ceiling is %d\n", msg, prioceiling ); - - /* process shared */ - - status = pthread_mutexattr_getpshared( attr, &pshared ); - assert( !status ); - printf( "%smutex process shared is (%d) -- ", msg, pshared ); - switch ( pshared ) { - case PTHREAD_PROCESS_PRIVATE: - puts( "PTHREAD_PROCESS_PRIVATE" ); - break; - case PTHREAD_PROCESS_SHARED: - puts( "PTHREAD_PROCESS_SHARED" ); - break; - default: - puts( "UNKNOWN" ); - assert( 0 ); - break; - } -} - -void *POSIX_Init( - void *argument -) -{ - int status; - pthread_mutexattr_t attr; - pthread_mutexattr_t destroyed_attr; - struct timespec times; - struct sched_param param; - int pshared; - int policy; - int protocol; - int ceiling; - int old_ceiling; - - assert( MUTEX_BAD_ID != PTHREAD_MUTEX_INITIALIZER ); - Mutex_bad_id = MUTEX_BAD_ID; - - puts( "\n\n*** POSIX TEST 5 ***" ); - - /* set the time of day, and print our buffer in multiple ways */ - - set_time( TM_FRIDAY, TM_MAY, 24, 96, 11, 5, 0 ); - - /* get id of this thread */ - - Init_id = pthread_self(); - printf( "Init's ID is 0x%08x\n", Init_id ); - - /* tes pthread_mutex_attr_init */ - - puts( "Init: pthread_mutexattr_init - EINVAL (NULL attr)" ); - status = pthread_mutexattr_init( NULL ); - assert( status == EINVAL ); - - puts( "Init: pthread_mutexattr_init - SUCCESSFUL" ); - status = pthread_mutexattr_init( &attr ); - assert( !status ); - - Print_mutexattr( "Init: ", &attr ); - - /* create an "uninitialized" attribute structure */ - - status = pthread_mutexattr_init( &destroyed_attr ); - assert( !status ); - - puts( "Init: pthread_mutexattr_destroy - SUCCESSFUL" ); - status = pthread_mutexattr_destroy( &destroyed_attr ); - assert( !status ); - - puts( "Init: pthread_mutexattr_destroy - EINVAL (NULL attr)" ); - status = pthread_mutexattr_destroy( NULL ); - assert( status == EINVAL ); - - puts( "Init: pthread_mutexattr_destroy - EINVAL (not initialized)" ); - status = pthread_mutexattr_destroy( &destroyed_attr ); - assert( status == EINVAL ); - - /* error cases for set and get pshared attribute */ - - empty_line(); - - puts( "Init: pthread_mutexattr_getpshared - EINVAL (NULL attr)" ); - status = pthread_mutexattr_getpshared( NULL, &pshared ); - assert( status == EINVAL ); - - puts( "Init: pthread_mutexattr_getpshared - EINVAL (NULL pshared)" ); - status = pthread_mutexattr_getpshared( &attr, NULL ); - assert( status == EINVAL ); - - puts( "Init: pthread_mutexattr_getpshared - EINVAL (not initialized)" ); - status = pthread_mutexattr_getpshared( &destroyed_attr, &pshared ); - assert( status == EINVAL ); - - pshared = PTHREAD_PROCESS_PRIVATE; - puts( "Init: pthread_mutexattr_setpshared - EINVAL (NULL attr)" ); - status = pthread_mutexattr_setpshared( NULL, pshared ); - assert( status == EINVAL ); - - pshared = PTHREAD_PROCESS_PRIVATE; - puts( "Init: pthread_mutexattr_setpshared - EINVAL (not initialized)" ); - status = pthread_mutexattr_setpshared( &destroyed_attr, pshared ); - assert( status == EINVAL ); - - /* error cases for set and get protocol attribute */ - - empty_line(); - - puts( "Init: pthread_mutexattr_getprotocol - EINVAL (NULL attr)" ); - status = pthread_mutexattr_getprotocol( NULL, &protocol ); - assert( status == EINVAL ); - - puts( "Init: pthread_mutexattr_getprotocol - EINVAL (NULL protocol)" ); - status = pthread_mutexattr_getprotocol( &attr, NULL ); - assert( status == EINVAL ); - - puts( "Init: pthread_mutexattr_getprotocol - EINVAL (not initialized)" ); - status = pthread_mutexattr_getprotocol( &destroyed_attr, &protocol ); - assert( status == EINVAL ); - - puts( "Init: pthread_mutexattr_setprotocol - EINVAL (NULL attr)" ); - status = pthread_mutexattr_setprotocol( NULL, PTHREAD_PRIO_NONE ); - assert( status == EINVAL ); - - puts( "Init: pthread_mutexattr_setprotocol - EINVAL (invalid protocol)" ); - status = pthread_mutexattr_setprotocol( &attr, -1 ); - assert( status == EINVAL ); - - puts( "Init: pthread_mutexattr_setprotocol - EINVAL (not initialized)" ); - status = pthread_mutexattr_setprotocol( &destroyed_attr, -1 ); - assert( status == EINVAL ); - - /* error cases for set and get prioceiling attribute */ - - empty_line(); - - puts( "Init: pthread_mutexattr_getprioceiling - EINVAL (NULL attr)" ); - status = pthread_mutexattr_getprioceiling( NULL, &ceiling ); - assert( status == EINVAL ); - - puts( "Init: pthread_mutexattr_getprioceiling - EINVAL (NULL prioceiling)" ); - status = pthread_mutexattr_getprioceiling( &attr, NULL ); - assert( status == EINVAL ); - - puts( "Init: pthread_mutexattr_getprioceiling - EINVAL (not initialized)" ); - status = pthread_mutexattr_getprioceiling( &destroyed_attr, &ceiling ); - assert( status == EINVAL ); - - puts( "Init: pthread_mutexattr_setprioceiling - EINVAL (NULL attr)" ); - status = pthread_mutexattr_setprioceiling( NULL, 128 ); - assert( status == EINVAL ); - - puts( "Init: pthread_mutexattr_setprioceiling - EINVAL (invalid priority)" ); - status = pthread_mutexattr_setprioceiling( &attr, 512 ); - if ( status != EINVAL ) - printf( "status = %d\n", status ); - assert( status == EINVAL ); - - puts( "Init: pthread_mutexattr_setprioceiling - EINVAL (not initialized)" ); - status = pthread_mutexattr_setprioceiling( &destroyed_attr, -1 ); - assert( status == EINVAL ); - - /* create a thread */ - - status = pthread_create( &Task_id, NULL, Task_1, NULL ); - assert( !status ); - - /* now try some basic mutex operations */ - - empty_line(); - - puts( "Init: pthread_mutex_init - EINVAL (NULL mutex_id)" ); - status = pthread_mutex_init( NULL, &attr ); - assert( status == EINVAL ); - - puts( "Init: pthread_mutex_init - EINVAL (not initialized attr)" ); - status = pthread_mutex_init( &Mutex_id, &destroyed_attr ); - assert( status == EINVAL ); - - /* must get around error checks in attribute set routines */ - attr.protocol = -1; - - puts( "Init: pthread_mutex_init - EINVAL (bad protocol)" ); - status = pthread_mutex_init( &Mutex_id, &attr ); - assert( status == EINVAL ); - - /* must get around error checks in attribute set routines */ - attr.protocol = PTHREAD_PRIO_INHERIT; - attr.prio_ceiling = -1; - - puts( "Init: pthread_mutex_init - EINVAL (bad priority ceiling)" ); - status = pthread_mutex_init( &Mutex_id, &attr ); - assert( status == EINVAL ); - - /* now set up for a success pthread_mutex_init */ - - puts( "Init: Resetting mutex attributes" ); - status = pthread_mutexattr_init( &attr ); - assert( !status ); - - puts( "Init: Changing mutex attributes" ); - status = pthread_mutexattr_setprotocol( &attr, PTHREAD_PRIO_INHERIT ); - assert( !status ); - - status = pthread_mutexattr_setprioceiling( &attr, 128 ); - assert( !status ); - - status = pthread_mutexattr_setpshared( &attr, PTHREAD_PROCESS_SHARED ); - assert( !status ); - - Print_mutexattr( "Init: ", &attr ); - - puts( "Init: Resetting mutex attributes" ); - status = pthread_mutexattr_init( &attr ); - assert( !status ); - - /* - * Set the protocol to priority ceiling so the owner check happens - * and the EPERM test (later) will work. - */ - - status = pthread_mutexattr_setprotocol( &attr, PTHREAD_PRIO_INHERIT ); - assert( !status ); - - puts( "Init: pthread_mutex_init - SUCCESSFUL" ); - status = pthread_mutex_init( &Mutex_id, &attr ); - if ( status ) - printf( "status = %d\n", status ); - assert( !status ); - - /* - * This is not required to be an error and when it is, there are - * behavioral conflicts with other implementations. - */ - puts( "Init: pthread_mutex_init - EBUSY (reinitialize an existing mutex) - skipped" ); - -#if 0 - status = pthread_mutex_init( &Mutex_id, &attr ); - if ( !status ) - printf( "status = %d\n", status ); - assert( status == EBUSY ); -#endif - - puts( "Init: pthread_mutex_trylock - EINVAL (illegal ID)" ); - status = pthread_mutex_trylock( &Mutex_bad_id ); - if ( status != EINVAL ) - printf( "status = %d\n", status ); - assert( status == EINVAL ); - - puts( "Init: pthread_mutex_trylock - SUCCESSFUL" ); - status = pthread_mutex_trylock( &Mutex_id ); - if ( status ) - printf( "status = %d\n", status ); - assert( !status ); - - puts( "Init: pthread_mutex_trylock - EDEADLK (already locked)" ); - status = pthread_mutex_trylock( &Mutex_id ); - if ( status != EDEADLK ) - printf( "status = %d\n", status ); - assert( status == EDEADLK ); - - puts( "Init: pthread_mutex_lock - EDEADLK (already locked)" ); - status = pthread_mutex_lock( &Mutex_id ); - if ( status != EDEADLK ) - printf( "status = %d\n", status ); - assert( status == EDEADLK ); - - puts( "Init: Sleep 1 second" ); - - sleep( 1 ); - - /* switch to task 1 */ - - puts( "Init: pthread_mutex_unlock - EINVAL (invalid id)" ); - status = pthread_mutex_unlock( &Mutex_bad_id ); - if ( status != EINVAL ) - printf( "status = %d\n", status ); - assert( status == EINVAL ); - - puts( "Init: pthread_mutex_unlock - SUCCESSFUL" ); - status = pthread_mutex_unlock( &Mutex_id ); - if ( status ) - printf( "status = %d\n", status ); - assert( !status ); - - puts( "Init: pthread_mutex_unlock - EPERM (not owner)" ); - status = pthread_mutex_unlock( &Mutex_id ); - if ( status != EPERM ) - printf( "status = %d\n", status ); - assert( status == EPERM ); - - times.tv_sec = 0; - times.tv_nsec = 500000000; - puts( "Init: pthread_mutex_timedlock - time out in 1/2 second" ); - status = pthread_mutex_timedlock( &Mutex_id, × ); - if ( status != EAGAIN ) - printf( "status = %d\n", status ); - assert( status == EAGAIN ); - - /* switch to idle */ - - puts( "Init: pthread_mutex_timedlock - EAGAIN (timeout)" ); - - /* destroy a mutex */ - - empty_line(); - - puts( "Init: pthread_mutex_init - SUCCESSFUL" ); - status = pthread_mutex_init( &Mutex2_id, &attr ); - if ( status ) - printf( "status = %d\n", status ); - assert( !status ); - - puts( "Init: pthread_mutex_init - EAGAIN (too many)" ); - status = pthread_mutex_init( &Mutex3_id, &attr ); - assert( status == EAGAIN ); - - puts( "Init: pthread_mutexattr_destroy - SUCCESSFUL" ); - status = pthread_mutexattr_destroy( &attr ); - assert( !status ); - - puts( "Init: pthread_mutex_destroy - SUCCESSFUL" ); - status = pthread_mutex_destroy( &Mutex2_id ); - assert( !status ); - - puts( "Init: pthread_mutex_destroy - EINVAL (invalid id)" ); - status = pthread_mutex_destroy( &Mutex_bad_id ); - assert( status == EINVAL ); - - /* destroy a busy mutex */ - - empty_line(); - - puts( "Init: pthread_mutexattr_init - SUCCESSFUL" ); - status = pthread_mutexattr_init( &attr ); - assert( !status ); - - puts( "Init: pthread_mutex_init - SUCCESSFUL" ); - status = pthread_mutex_init( &Mutex2_id, &attr ); - assert( !status ); - - puts( "Init: pthread_mutex_trylock - SUCCESSFUL" ); - status = pthread_mutex_trylock( &Mutex2_id ); - if ( status ) - printf( "status = %d\n", status ); - assert( !status ); - - puts( "Init: pthread_mutex_destroy - EBUSY (already locked)" ); - status = pthread_mutex_destroy( &Mutex2_id ); - if ( status != EBUSY ) - printf( "status = %d\n", status ); - assert( status == EBUSY ); - - puts( "Init: pthread_mutex_unlock - SUCCESSFUL" ); - status = pthread_mutex_unlock( &Mutex2_id ); - assert( !status ); - - puts( "Init: pthread_mutex_destroy - SUCCESSFUL" ); - status = pthread_mutex_destroy( &Mutex2_id ); - assert( !status ); - - /* priority inherit mutex */ - - empty_line(); - - puts( "Init: pthread_mutexattr_init - SUCCESSFUL" ); - status = pthread_mutexattr_init( &attr ); - assert( !status ); - - puts( - "Init: pthread_mutexattr_setprotocol - SUCCESSFUL (PTHREAD_PRIO_INHERIT)" - ); - status = pthread_mutexattr_setprotocol( &attr, PTHREAD_PRIO_INHERIT ); - assert( !status ); - - puts( "Init: pthread_mutex_init - SUCCESSFUL" ); - status = pthread_mutex_init( &Mutex2_id, &attr ); - assert( !status ); - - puts( "Init: pthread_mutex_trylock - SUCCESSFUL" ); - status = pthread_mutex_trylock( &Mutex2_id ); - assert( !status ); - - /* create a thread at a lower priority */ - - status = pthread_create( &Task2_id, NULL, Task_2, NULL ); - assert( !status ); - - /* set priority of Task2 to highest priority */ - - param.sched_priority = 254; - - puts( "Init: pthread_setschedparam - Setting Task2 priority to highest" ); - status = pthread_setschedparam( Task2_id, SCHED_FIFO, ¶m ); - assert( !status ); - - /* switching to Task2 */ - - status = pthread_getschedparam( pthread_self(), &policy, ¶m ); - assert( !status ); - printf( "Init: pthread_getschedparam - priority = %d\n", param.sched_priority); - - puts( "Init: pthread_mutex_unlock - SUCCESSFUL" ); - status = pthread_mutex_unlock( &Mutex2_id ); - assert( !status ); - - puts( "Init: pthread_mutexattr_destroy - SUCCESSFUL" ); - status = pthread_mutexattr_destroy( &attr ); - assert( !status ); - - puts( "Init: pthread_mutex_destroy - SUCCESSFUL" ); - status = pthread_mutex_destroy( &Mutex2_id ); - assert( !status ); - - /* priority ceiling mutex */ - - empty_line(); - - puts( "Init: pthread_mutexattr_init - SUCCESSFUL" ); - status = pthread_mutexattr_init( &attr ); - assert( !status ); - - puts( - "Init: pthread_mutexattr_setprotocol - SUCCESSFUL (PTHREAD_PRIO_PROTECT)" - ); - status = pthread_mutexattr_setprotocol( &attr, PTHREAD_PRIO_PROTECT ); - assert( !status ); - - puts( "Init: pthread_mutex_init - SUCCESSFUL" ); - status = pthread_mutex_init( &Mutex2_id, &attr ); - assert( !status ); - - puts( "Init: pthread_mutex_getprioceiling - EINVAL (invalid id)" ); - status = pthread_mutex_getprioceiling( &Mutex_bad_id, &ceiling ); - assert( status == EINVAL ); - - puts( "Init: pthread_mutex_getprioceiling - EINVAL (NULL ceiling)" ); - status = pthread_mutex_getprioceiling( &Mutex2_id, NULL ); - assert( status == EINVAL ); - - status = pthread_mutex_getprioceiling( &Mutex2_id, &ceiling ); - assert( !status ); - printf( "Init: pthread_mutex_getprioceiling - %d\n", ceiling ); - - puts( "Init: pthread_mutex_setprioceiling - EINVAL (invalid id)" ); - status = pthread_mutex_setprioceiling( &Mutex_bad_id, 200, &old_ceiling ); - assert( status == EINVAL ); - - puts( "Init: pthread_mutex_setprioceiling - EINVAL (illegal priority)" ); - status = pthread_mutex_setprioceiling( &Mutex2_id, 512, &old_ceiling ); - assert( status == EINVAL ); - - puts( "Init: pthread_mutex_setprioceiling - EINVAL (NULL ceiling)" ); - status = pthread_mutex_setprioceiling( &Mutex2_id, 128, NULL ); - assert( status == EINVAL ); - - /* normal cases of set priority ceiling */ - - puts( "Init: pthread_mutex_setprioceiling - new ceiling = 200" ); - status = pthread_mutex_setprioceiling( &Mutex2_id, 200, &old_ceiling ); - assert( !status ); - printf( - "Init: pthread_mutex_setprioceiling - old ceiling = %d\n",old_ceiling - ); - - status = pthread_getschedparam( pthread_self(), &policy, ¶m ); - assert( !status ); - printf( - "Init: pthread_getschedparam - priority = %d\n", param.sched_priority - ); - - puts( "Init: pthread_mutex_trylock - SUCCESSFUL" ); - status = pthread_mutex_trylock( &Mutex2_id ); - assert( !status ); - - status = pthread_getschedparam( pthread_self(), &policy, ¶m ); - assert( !status ); - printf( - "Init: pthread_getschedparam - priority = %d\n", param.sched_priority - ); - - /* create a thread at a higher priority */ - - status = pthread_create( &Task3_id, NULL, Task_3, NULL ); - assert( !status ); - - /* set priority of Task3 to highest priority */ - - param.sched_priority = 199; - - status = pthread_setschedparam( Task3_id, SCHED_FIFO, ¶m ); - assert( !status ); - puts( "Init: pthread_setschedparam - set Task3 priority to highest" ); - - /* DOES NOT SWITCH to Task3 */ - - puts( "Init: Sleep 1 second" ); - assert( !status ); - sleep( 1 ); - - /* switch to task 3 */ - - puts( "Init: pthread_mutex_unlock - SUCCESSFUL" ); - status = pthread_mutex_unlock( &Mutex2_id ); - assert( !status ); - - status = pthread_mutex_getprioceiling( &Mutex2_id, &ceiling ); - assert( !status ); - printf( "Init: pthread_mutex_getprioceiling- ceiling = %d\n", ceiling ); - - /* set priority of Init to highest priority */ - - param.sched_priority = 254; - - status = pthread_setschedparam( Init_id, SCHED_FIFO, ¶m ); - assert( !status ); - puts( "Init: pthread_setschedparam - set Init priority to highest" ); - - puts( "Init: pthread_mutex_lock - EINVAL (priority ceiling violation)" ); - status = pthread_mutex_lock( &Mutex2_id ); - if ( status != EINVAL ) - printf( "status = %d\n", status ); - assert( status == EINVAL ); - - puts( "*** END OF POSIX TEST 5 ***" ); - rtems_test_exit( 0 ); - - return NULL; /* just so the compiler thinks we returned something */ -} diff --git a/testsuites/psxtests/psx05/psx05.scn b/testsuites/psxtests/psx05/psx05.scn deleted file mode 100644 index bc93da60b8..0000000000 --- a/testsuites/psxtests/psx05/psx05.scn +++ /dev/null @@ -1,103 +0,0 @@ -*** POSIX TEST 5 *** -Init's ID is 0x0b010001 -Init: pthread_mutexattr_init - EINVAL (NULL attr) -Init: pthread_mutexattr_init - SUCCESSFUL -Init: mutex protocol is (0) -- PTHREAD_PRIO_NONE -Init: mutex priority ceiling is 254 -Init: mutex process shared is (0) -- PTHREAD_PROCESS_PRIVATE -Init: pthread_mutexattr_destroy - SUCCESSFUL -Init: pthread_mutexattr_destroy - EINVAL (NULL attr) -Init: pthread_mutexattr_destroy - EINVAL (not initialized) -Init: pthread_mutexattr_getpshared - EINVAL (NULL attr) -Init: pthread_mutexattr_getpshared - EINVAL (NULL pshared) -Init: pthread_mutexattr_getpshared - EINVAL (not initialized) -Init: pthread_mutexattr_setpshared - EINVAL (NULL attr) -Init: pthread_mutexattr_setpshared - EINVAL (not initialized) -Init: pthread_mutexattr_getprotocol - EINVAL (NULL attr) -Init: pthread_mutexattr_getprotocol - EINVAL (NULL protocol) -Init: pthread_mutexattr_getprotocol - EINVAL (not initialized) -Init: pthread_mutexattr_setprotocol - EINVAL (NULL attr) -Init: pthread_mutexattr_setprotocol - EINVAL (invalid protocol) -Init: pthread_mutexattr_setprotocol - EINVAL (not initialized) -Init: pthread_mutexattr_getprioceiling - EINVAL (NULL attr) -Init: pthread_mutexattr_getprioceiling - EINVAL (NULL prioceiling) -Init: pthread_mutexattr_getprioceiling - EINVAL (not initialized) -Init: pthread_mutexattr_setprioceiling - EINVAL (NULL attr) -Init: pthread_mutexattr_setprioceiling - EINVAL (invalid priority) -Init: pthread_mutexattr_setprioceiling - EINVAL (not initialized) -Init: pthread_mutex_init - EINVAL (NULL mutex_id) -Init: pthread_mutex_init - EINVAL (not initialized attr) -Init: pthread_mutex_init - EINVAL (bad protocol) -Init: pthread_mutex_init - EINVAL (bad priority ceiling) -Init: Resetting mutex attributes -Init: Changing mutex attributes -Init: mutex protocol is (1) -- PTHREAD_PRIO_INHERIT -Init: mutex priority ceiling is 128 -Init: mutex process shared is (1) -- PTHREAD_PROCESS_SHARED -Init: Resetting mutex attributes -Init: pthread_mutex_init - SUCCESSFUL -Init: pthread_mutex_init - EBUSY (reinitialize an existing mutex) - skipped -Init: pthread_mutex_trylock - EINVAL (illegal ID) -Init: pthread_mutex_trylock - SUCCESSFUL -Init: pthread_mutex_trylock - EDEADLK (already locked) -Init: pthread_mutex_lock - EDEADLK (already locked) -Init: Sleep 1 second -Task: pthread_mutex_trylock already locked -Task: pthread_mutex_lock unavailable -Init: pthread_mutex_unlock - EINVAL (invalid id) -Init: pthread_mutex_unlock - SUCCESSFUL -Init: pthread_mutex_unlock - EPERM (not owner) -Init: pthread_mutex_timedlock - time out in 1/2 second -Task: mutex acquired -Task: sleep for 2 seconds -Init: pthread_mutex_timedlock - EAGAIN (timeout) -Init: pthread_mutex_init - SUCCESSFUL -Init: pthread_mutex_init - EAGAIN (too many) -Init: pthread_mutexattr_destroy - SUCCESSFUL -Init: pthread_mutex_destroy - SUCCESSFUL -Init: pthread_mutex_destroy - EINVAL (invalid id) -Init: pthread_mutexattr_init - SUCCESSFUL -Init: pthread_mutex_init - SUCCESSFUL -Init: pthread_mutex_trylock - SUCCESSFUL -Init: pthread_mutex_destroy - EBUSY (already locked) -Init: pthread_mutex_unlock - SUCCESSFUL -Init: pthread_mutex_destroy - SUCCESSFUL -Init: pthread_mutexattr_init - SUCCESSFUL -Init: pthread_mutexattr_setprotocol - SUCCESSFUL (PTHREAD_PRIO_INHERIT) -Init: pthread_mutex_init - SUCCESSFUL -Init: pthread_mutex_trylock - SUCCESSFUL -Init: pthread_setschedparam - Setting Task2 priority to highest -Task 2: pthread_mutex_lock unavailable (inherit case) -Init: pthread_getschedparam - priority = 254 -Init: pthread_mutex_unlock - SUCCESSFUL -Task 2: mutex acquired -Task 2: unlock Mutex 2 -Task 2: exit -Init: pthread_mutexattr_destroy - SUCCESSFUL -Init: pthread_mutex_destroy - SUCCESSFUL -Init: pthread_mutexattr_init - SUCCESSFUL -Init: pthread_mutexattr_setprotocol - SUCCESSFUL (PTHREAD_PRIO_PROTECT) -Init: pthread_mutex_init - SUCCESSFUL -Init: pthread_mutex_getprioceiling - EINVAL (invalid id) -Init: pthread_mutex_getprioceiling - EINVAL (NULL ceiling) -Init: pthread_mutex_getprioceiling - 254 -Init: pthread_mutex_setprioceiling - EINVAL (invalid id) -Init: pthread_mutex_setprioceiling - EINVAL (illegal priority) -Init: pthread_mutex_setprioceiling - EINVAL (NULL ceiling) -Init: pthread_mutex_setprioceiling - new ceiling = 200 -Init: pthread_mutex_setprioceiling - old ceiling = 254 -Init: pthread_getschedparam - priority = 2 -Init: pthread_mutex_trylock - SUCCESSFUL -Init: pthread_getschedparam - priority = 200 -Init: pthread_setschedparam - set Task3 priority to highest -Init: Sleep 1 second -Task 3: pthread_mutex_lock unavailable (inherit case) -Init: pthread_mutex_unlock - SUCCESSFUL -Task 3: mutex acquired -Task 3: unlock Mutex 2 -Task 3: pthread_getschedparam priority = 199 -Task 3: exit -Init: pthread_mutex_getprioceiling- ceiling = 200 -Init: pthread_setschedparam - set Init priority to highest -Init: pthread_mutex_lock - EINVAL (priority ceiling violation) -*** END OF POSIX TEST 5 *** diff --git a/testsuites/psxtests/psx05/system.h b/testsuites/psxtests/psx05/system.h deleted file mode 100644 index 92e010ef78..0000000000 --- a/testsuites/psxtests/psx05/system.h +++ /dev/null @@ -1,65 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -/* functions */ - -#include - -void *POSIX_Init( - void *argument -); - -void *Task_1( - void *argument -); - -void *Task_2( - void *argument -); - -void *Task_3( - void *argument -); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 4 -#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 2 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#include - -/* global variables */ - -#ifdef CONFIGURE_INIT -#define TEST_EXTERN -#else -#define TEST_EXTERN extern -#endif - -TEST_EXTERN pthread_t Init_id; -TEST_EXTERN pthread_t Task_id; -TEST_EXTERN pthread_t Task2_id; -TEST_EXTERN pthread_t Task3_id; -TEST_EXTERN pthread_mutex_t Mutex_id; -TEST_EXTERN pthread_mutex_t Mutex2_id; -TEST_EXTERN pthread_mutex_t Mutex3_id; -TEST_EXTERN pthread_mutex_t Mutex_bad_id; - -/* end of include file */ diff --git a/testsuites/psxtests/psx05/task.c b/testsuites/psxtests/psx05/task.c deleted file mode 100644 index 64f6d4403a..0000000000 --- a/testsuites/psxtests/psx05/task.c +++ /dev/null @@ -1,57 +0,0 @@ -/* Task_1 - * - * 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" -#include - -void *Task_1( - void *argument -) -{ - int status; - - printf( "Task: pthread_mutex_trylock already locked\n" ); - status = pthread_mutex_trylock( &Mutex_id ); - if ( status != EBUSY ) - printf( "status = %d\n", status ); - assert( status == EBUSY ); - - printf( "Task: pthread_mutex_lock unavailable\n" ); - status = pthread_mutex_lock( &Mutex_id ); - if ( status ) - printf( "status = %d\n", status ); - assert( !status ); - - /* switch to init */ - - printf( "Task: mutex acquired\n" ); - - printf( "Task: sleep for 2 seconds\n" ); - sleep( 2 ); - - /* switch to init */ - - printf( "Task: exit\n" ); - pthread_exit( NULL ); - - /* switch to Init */ - - return NULL; /* just so the compiler thinks we returned something */ -} diff --git a/testsuites/psxtests/psx05/task2.c b/testsuites/psxtests/psx05/task2.c deleted file mode 100644 index 57b891a422..0000000000 --- a/testsuites/psxtests/psx05/task2.c +++ /dev/null @@ -1,48 +0,0 @@ -/* Task_2 - * - * This routine serves as a test task. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" -#include - -void *Task_2( - void *argument -) -{ - int status; - - printf( "Task 2: pthread_mutex_lock unavailable (inherit case)\n" ); - status = pthread_mutex_lock( &Mutex2_id ); - if ( status ) - printf( "status =%d\n", status ); - assert( !status ); - printf( "Task 2: mutex acquired\n" ); - - /* switch to init */ - - printf( "Task 2: unlock Mutex 2\n" ); - status = pthread_mutex_unlock( &Mutex2_id ); - assert( !status ); - - printf( "Task 2: exit\n" ); - pthread_exit( NULL ); - - /* switch to Init */ - - return NULL; /* just so the compiler thinks we returned something */ -} diff --git a/testsuites/psxtests/psx05/task3.c b/testsuites/psxtests/psx05/task3.c deleted file mode 100644 index 3049d78ee7..0000000000 --- a/testsuites/psxtests/psx05/task3.c +++ /dev/null @@ -1,50 +0,0 @@ -/* Task_3 - * - * This routine serves as a test task. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" -#include - -void *Task_3( - void *argument -) -{ - int status; - struct sched_param param; - int policy; - - printf( "Task 3: pthread_mutex_lock unavailable (inherit case)\n" ); - status = pthread_mutex_lock( &Mutex2_id ); - printf( "Task 3: mutex acquired\n" ); - assert( !status ); - - printf( "Task 3: unlock Mutex 2\n" ); - status = pthread_mutex_unlock( &Mutex2_id ); - assert( !status ); - - status = pthread_getschedparam( pthread_self(), &policy, ¶m ); - assert( !status ); - printf( "Task 3: pthread_getschedparam priority = %d\n", param.sched_priority ); - - printf( "Task 3: exit\n" ); - pthread_exit( NULL ); - - /* switch to Init */ - - return NULL; /* just so the compiler thinks we returned something */ -} diff --git a/testsuites/psxtests/psx06/.cvsignore b/testsuites/psxtests/psx06/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/psxtests/psx06/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/psxtests/psx06/Makefile.am b/testsuites/psxtests/psx06/Makefile.am deleted file mode 100644 index 68f1f4d05b..0000000000 --- a/testsuites/psxtests/psx06/Makefile.am +++ /dev/null @@ -1,44 +0,0 @@ -## -## $Id$ -## - - -TEST = psx06 - -MANAGERS = all - -C_FILES = init.c task.c task2.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/psxtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -AM_CPPFLAGS += -I$(top_srcdir)/include - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/psxtests/psx06/init.c b/testsuites/psxtests/psx06/init.c deleted file mode 100644 index f1a4ec6906..0000000000 --- a/testsuites/psxtests/psx06/init.c +++ /dev/null @@ -1,120 +0,0 @@ -/* - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define CONFIGURE_INIT -#include "system.h" -#include - -void Key_destructor( - void *key_data -) -{ - Destructor_invoked++; - - /* - * This checks out that we only run the destructor multiple times - * when the key data is non null. - */ - - if ( Destructor_invoked == 5 ) - (void) pthread_setspecific( Key_id, NULL ); -} - -void *POSIX_Init( - void *argument -) -{ - int status; - unsigned int remaining; - rtems_unsigned32 *key_data; - - puts( "\n\n*** POSIX TEST 6 ***" ); - - /* set the time of day, and print our buffer in multiple ways */ - - set_time( TM_FRIDAY, TM_MAY, 24, 96, 11, 5, 0 ); - - /* get id of this thread */ - - Init_id = pthread_self(); - printf( "Init's ID is 0x%08x\n", Init_id ); - - /* create a couple of threads */ - - status = pthread_create( &Task_id, NULL, Task_1, NULL ); - assert( !status ); - - status = pthread_create( &Task2_id, NULL, Task_2, NULL ); - assert( !status ); - - /* create a key */ - - empty_line(); - - Destructor_invoked = 0; - puts( "Init: pthread_key_create - SUCCESSFUL" ); - status = pthread_key_create( &Key_id, Key_destructor ); - if ( status ) - printf( "status = %d\n", status ); - assert( !status ); - - printf( "Destructor invoked %d times\n", Destructor_invoked ); - - puts( "Init: pthread_key_create - EAGAIN (too many keys)" ); - status = pthread_key_create( &Key_id, Key_destructor ); - assert( status == EAGAIN ); - - puts( "Init: pthread_setspecific - EINVAL (invalid key)" ); - status = pthread_setspecific( -1, &Data_array[ 0 ] ); - assert( status == EINVAL ); - - puts( "Init: pthread_getspecific - EINVAL (invalid key)" ); - key_data = pthread_getspecific( -1 ); - assert( !key_data ); - - puts( "Init: pthread_key_delete - EINVAL (invalid key)" ); - status = pthread_key_delete( -1 ); - assert( status == EINVAL ); - - printf( "Init: Setting the key to %d\n", 0 ); - status = pthread_setspecific( Key_id, &Data_array[ 0 ] ); - if ( status ) - printf( "status = %d\n", status ); - assert( !status ); - - /* switch to task 1 */ - - key_data = pthread_getspecific( Key_id ); - printf( "Init: Got the key value of %ld\n", - (unsigned long) ((rtems_unsigned32 *)key_data - Data_array) ); - - remaining = sleep( 3 ); - if ( remaining ) - printf( "seconds remaining = %d\n", remaining ); - assert( !remaining ); - - /* switch to task 1 */ - - /* delete the key */ - - puts( "Init: pthread_key_delete - SUCCESSFUL" ); - status = pthread_key_delete( Key_id ); - if ( status ) - printf( "status = %d\n", status ); - assert( !status ); - - printf( "Destructor invoked %d times\n", Destructor_invoked ); - - puts( "*** END OF POSIX TEST 6 ***" ); - rtems_test_exit( 0 ); - - return NULL; /* just so the compiler thinks we returned something */ -} diff --git a/testsuites/psxtests/psx06/psx06.scn b/testsuites/psxtests/psx06/psx06.scn deleted file mode 100644 index 4e16ee4e37..0000000000 --- a/testsuites/psxtests/psx06/psx06.scn +++ /dev/null @@ -1,20 +0,0 @@ -*** POSIX TEST 6 *** -Init's ID is 0x0b010001 -Init: pthread_key_create - SUCCESSFUL -Destructor invoked 0 times -Init: pthread_key_create - EAGAIN (too many keys) -Init: pthread_setspecific - EINVAL (invalid key) -Init: pthread_getspecific - EINVAL (invalid key) -Init: pthread_key_delete - EINVAL (invalid key) -Init: Setting the key to 0 -Init: Got the key value of 0 -Task_1: Setting the key to 1 -Task_1: Got the key value of 1 -Task_1: exitting -Destructor invoked 4 times -Task_2: Setting the key to 2 -Task_2: Got the key value of 2 -Task2: exitting -Init: pthread_key_delete - SUCCESSFUL -Destructor invoked 5 times -*** END OF POSIX TEST 6 *** diff --git a/testsuites/psxtests/psx06/system.h b/testsuites/psxtests/psx06/system.h deleted file mode 100644 index 3aeef9bc67..0000000000 --- a/testsuites/psxtests/psx06/system.h +++ /dev/null @@ -1,59 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -/* functions */ - -#include - -void *POSIX_Init( - void *argument -); - -void *Task_1( - void *argument -); - -void *Task_2( - void *argument -); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 3 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 1 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#include - -/* global variables */ - -#ifdef CONFIGURE_INIT -#define TEST_EXTERN -#else -#define TEST_EXTERN extern -#endif - -TEST_EXTERN pthread_t Init_id; -TEST_EXTERN pthread_t Task_id; -TEST_EXTERN pthread_t Task2_id; -TEST_EXTERN pthread_key_t Key_id; -TEST_EXTERN rtems_unsigned32 Data_array[ CONFIGURE_MAXIMUM_POSIX_THREADS ]; -TEST_EXTERN rtems_unsigned32 Destructor_invoked; - -/* end of include file */ diff --git a/testsuites/psxtests/psx06/task.c b/testsuites/psxtests/psx06/task.c deleted file mode 100644 index 99fcf2f859..0000000000 --- a/testsuites/psxtests/psx06/task.c +++ /dev/null @@ -1,50 +0,0 @@ -/* Task_1 - * - * 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" -#include - -void *Task_1( - void *argument -) -{ - int status; - rtems_unsigned32 *key_data; - - printf( "Task_1: Setting the key to %d\n", 1 ); - status = pthread_setspecific( Key_id, &Data_array[ 1 ] ); - if ( status ) - printf( "status = %d\n", status ); - assert( !status ); - - key_data = pthread_getspecific( Key_id ); - printf( "Task_1: Got the key value of %ld\n", - (unsigned long) ((rtems_unsigned32 *)key_data - Data_array) ); - if ( status ) - printf( "status = %d\n", status ); - assert( !status ); - - puts( "Task_1: exitting" ); - pthread_exit( NULL ); - - /* switch to task 2 */ - - return NULL; /* just so the compiler thinks we returned something */ -} diff --git a/testsuites/psxtests/psx06/task2.c b/testsuites/psxtests/psx06/task2.c deleted file mode 100644 index af6c1d4b6d..0000000000 --- a/testsuites/psxtests/psx06/task2.c +++ /dev/null @@ -1,51 +0,0 @@ -/* Task_2 - * - * This routine serves as a test task. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" -#include - -void *Task_2( - void *argument -) -{ - int status; - rtems_unsigned32 *key_data; - - printf( "Destructor invoked %d times\n", Destructor_invoked ); - - printf( "Task_2: Setting the key to %d\n", 2 ); - status = pthread_setspecific( Key_id, &Data_array[ 2 ] ); - if ( status ) - printf( "status = %d\n", status ); - assert( !status ); - - key_data = pthread_getspecific( Key_id ); - printf( "Task_2: Got the key value of %ld\n", - (unsigned long) ((rtems_unsigned32 *)key_data - Data_array) ); - if ( status ) - printf( "status = %d\n", status ); - assert( !status ); - - puts( "Task2: exitting" ); - pthread_exit( NULL ); - - /* switch to init task */ - - return NULL; /* just so the compiler thinks we returned something */ -} diff --git a/testsuites/psxtests/psx07/.cvsignore b/testsuites/psxtests/psx07/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/psxtests/psx07/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/psxtests/psx07/Makefile.am b/testsuites/psxtests/psx07/Makefile.am deleted file mode 100644 index d1b09bea48..0000000000 --- a/testsuites/psxtests/psx07/Makefile.am +++ /dev/null @@ -1,44 +0,0 @@ -## -## $Id$ -## - - -TEST = psx07 - -MANAGERS = all - -C_FILES = init.c task.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/psxtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -AM_CPPFLAGS += -I$(top_srcdir)/include - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/psxtests/psx07/init.c b/testsuites/psxtests/psx07/init.c deleted file mode 100644 index aa506f8a71..0000000000 --- a/testsuites/psxtests/psx07/init.c +++ /dev/null @@ -1,493 +0,0 @@ -/* - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define CONFIGURE_INIT -#include "system.h" -#include - -void print_schedparam( - char *prefix, - struct sched_param *schedparam -) -{ - printf( "%ssched priority = %d\n", prefix, schedparam->sched_priority ); -#if defined(_POSIX_SPORADIC_SERVER) - printf( "%sss_low_priority = %d\n", prefix, schedparam->ss_low_priority ); - printf( "%sss_replenish_period = (%ld, %ld)\n", prefix, - schedparam->ss_replenish_period.tv_sec, - schedparam->ss_replenish_period.tv_nsec ); - printf( "%sss_initial_budget = (%ld, %ld)\n", prefix, - schedparam->ss_initial_budget.tv_sec, - schedparam->ss_initial_budget.tv_nsec ); -#else - printf( "%s_POSIX_SPORADIC_SERVER is not defined\n" ); -#endif -} - -void *POSIX_Init( - void *argument -) -{ - int status; - int scope; - int inheritsched; - int schedpolicy; - size_t stacksize; - void *stackaddr; - int detachstate; - struct sched_param schedparam; - pthread_attr_t attr; - pthread_attr_t destroyed_attr; - - puts( "\n\n*** POSIX TEST 7 ***" ); - - /* set the time of day, and print our buffer in multiple ways */ - - set_time( TM_FRIDAY, TM_MAY, 24, 96, 11, 5, 0 ); - - /* get id of this thread */ - - Init_id = pthread_self(); - printf( "Init's ID is 0x%08x\n", Init_id ); - - /* exercise init and destroy */ - - puts( "Init: pthread_attr_init - EINVAL (NULL attr)" ); - status = pthread_attr_init( NULL ); - assert( status == EINVAL ); - - puts( "Init: pthread_attr_init - SUCCESSFUL" ); - status = pthread_attr_init( &attr ); - assert( !status ); - - puts( "Init: initialize and destroy an attribute - SUCCESSFUL" ); - status = pthread_attr_init( &destroyed_attr ); - assert( !status ); - - status = pthread_attr_destroy( &destroyed_attr ); - assert( !status ); - - puts( "Init: pthread_attr_destroy - EINVAL (NULL attr)" ); - status = pthread_attr_destroy( NULL ); - assert( status == EINVAL ); - - puts( "Init: pthread_attr_destroy - EINVAL (not initialized)" ); - status = pthread_attr_destroy( &destroyed_attr ); - assert( status == EINVAL ); - - /* check some errors in pthread_create */ - - puts( "Init: pthread_create - EINVAL (attr not initialized)" ); - status = pthread_create( &Task_id, &destroyed_attr, Task_1, NULL ); - assert( status == EINVAL ); - - /* junk stack address */ - status = pthread_attr_setstackaddr( &attr, (void *)&schedparam ); - assert( !status ); - - /* must go around pthread_attr_setstacksize to set a bad stack size */ - attr.stacksize = 0; - - puts( "Init: pthread_create - EINVAL (stacksize too small)" ); - status = pthread_create( &Task_id, &attr, Task_1, NULL ); - assert( status == EINVAL ); - - /* reset all the fields */ - status = pthread_attr_init( &attr ); - assert( !status ); - - attr.stacksize = rtems_configuration_get_work_space_size() * 10; - puts( "Init: pthread_create - EAGAIN (stacksize too large)" ); - status = pthread_create( &Task_id, &attr, Task_1, NULL ); - assert( status == EAGAIN ); - - status = pthread_attr_init( &attr ); - assert( !status ); - - /* must go around pthread_attr_set routines to set a bad value */ - attr.inheritsched = -1; - - puts( "Init: pthread_create - EINVAL (invalid inherit scheduler)" ); - status = pthread_create( &Task_id, &attr, Task_1, NULL ); - assert( status == EINVAL ); - - /* check out the error case for system scope not supported */ - - status = pthread_attr_init( &attr ); - assert( !status ); - - /* must go around pthread_attr_set routines to set a bad value */ - attr.contentionscope = PTHREAD_SCOPE_SYSTEM; - - puts( "Init: pthread_create - ENOTSUP (unsupported system contention scope)" ); - status = pthread_create( &Task_id, &attr, Task_1, NULL ); - assert( status == ENOTSUP ); - - status = pthread_attr_init( &attr ); - assert( !status ); - - /* now check out pthread_create for inherit scheduler */ - - status = pthread_attr_setinheritsched( &attr, PTHREAD_INHERIT_SCHED ); - assert( !status ); - - puts( "Init: pthread_create - SUCCESSFUL (inherit scheduler)" ); - status = pthread_create( &Task_id, &attr, Task_1, NULL ); - assert( !status ); - - status = pthread_join( Task_id, NULL ); - assert( !status ); - - /* switch to Task_1 */ - - /* exercise get and set scope */ - - empty_line(); - - status = pthread_attr_init( &attr ); - assert( !status ); - - puts( "Init: pthread_attr_setscope - EINVAL (NULL attr)" ); - status = pthread_attr_setscope( NULL, PTHREAD_SCOPE_PROCESS ); - assert( status == EINVAL ); - - puts( "Init: pthread_attr_setscope - ENOTSUP" ); - status = pthread_attr_setscope( &attr, PTHREAD_SCOPE_SYSTEM ); - assert( status == ENOTSUP ); - - puts( "Init: pthread_attr_setscope - EINVAL (not initialized attr)" ); - status = pthread_attr_setscope( &destroyed_attr, PTHREAD_SCOPE_PROCESS ); - assert( status == EINVAL ); - - puts( "Init: pthread_attr_setscope - EINVAL (invalid scope)" ); - status = pthread_attr_setscope( &attr, -1 ); - assert( status == EINVAL ); - - puts( "Init: pthread_attr_setscope - SUCCESSFUL" ); - status = pthread_attr_setscope( &attr, PTHREAD_SCOPE_PROCESS ); - assert( !status ); - - puts( "Init: pthread_attr_getscope - EINVAL (NULL attr)" ); - status = pthread_attr_getscope( NULL, &scope ); - assert( status == EINVAL ); - - puts( "Init: pthread_attr_getscope - EINVAL (NULL scope)" ); - status = pthread_attr_getscope( &attr, NULL ); - assert( status == EINVAL ); - - puts( "Init: pthread_attr_getscope - EINVAL (not initialized attr)" ); - status = pthread_attr_getscope( &destroyed_attr, &scope ); - assert( status == EINVAL ); - - puts( "Init: pthread_attr_getscope - SUCCESSFUL" ); - status = pthread_attr_getscope( &attr, &scope ); - assert( !status ); - printf( "Init: current scope attribute = %d\n", scope ); - - /* exercise get and set inherit scheduler */ - - empty_line(); - - puts( "Init: pthread_attr_setinheritsched - EINVAL (NULL attr)" ); - status = pthread_attr_setinheritsched( NULL, PTHREAD_INHERIT_SCHED ); - assert( status == EINVAL ); - - puts( "Init: pthread_attr_setinheritsched - EINVAL (not initialized attr)" ); - status = - pthread_attr_setinheritsched( &destroyed_attr, PTHREAD_INHERIT_SCHED ); - assert( status == EINVAL ); - - puts( "Init: pthread_attr_setinheritsched - ENOTSUP (invalid inheritsched)" ); - status = pthread_attr_setinheritsched( &attr, -1 ); - assert( status == ENOTSUP ); - - puts( "Init: pthread_attr_setinheritsched - SUCCESSFUL" ); - status = pthread_attr_setinheritsched( &attr, PTHREAD_INHERIT_SCHED ); - assert( !status ); - - puts( "Init: pthread_attr_getinheritsched - EINVAL (NULL attr)" ); - status = pthread_attr_getinheritsched( NULL, &inheritsched ); - assert( status == EINVAL ); - - puts( "Init: pthread_attr_getinheritsched - EINVAL (NULL inheritsched)" ); - status = pthread_attr_getinheritsched( &attr, NULL ); - assert( status == EINVAL ); - - puts( "Init: pthread_attr_getinheritsched - EINVAL (not initialized attr)" ); - status = pthread_attr_getinheritsched( &destroyed_attr, &inheritsched ); - assert( status == EINVAL ); - - puts( "Init: pthread_attr_getinheritsched - SUCCESSFUL" ); - status = pthread_attr_getinheritsched( &attr, &inheritsched ); - assert( !status ); - printf( "Init: current inherit scheduler attribute = %d\n", inheritsched ); - - /* exercise get and set inherit scheduler */ - - empty_line(); - - puts( "Init: pthread_attr_setschedpolicy - EINVAL (NULL attr)" ); - status = pthread_attr_setschedpolicy( NULL, SCHED_FIFO ); - assert( status == EINVAL ); - - puts( "Init: pthread_attr_setschedpolicy - EINVAL (not initialized attr)" ); - status = - pthread_attr_setschedpolicy( &destroyed_attr, SCHED_OTHER ); - assert( status == EINVAL ); - - puts( "Init: pthread_attr_setschedpolicy - ENOTSUP (invalid schedpolicy)" ); - status = pthread_attr_setschedpolicy( &attr, -1 ); - assert( status == ENOTSUP ); - - puts( "Init: pthread_attr_setschedpolicy - SUCCESSFUL" ); - status = pthread_attr_setschedpolicy( &attr, SCHED_RR ); - assert( !status ); - - puts( "Init: pthread_attr_getschedpolicy - EINVAL (NULL attr)" ); - status = pthread_attr_getschedpolicy( NULL, &schedpolicy ); - assert( status == EINVAL ); - - puts( "Init: pthread_attr_getschedpolicy - EINVAL (NULL schedpolicy)" ); - status = pthread_attr_getschedpolicy( &attr, NULL ); - assert( status == EINVAL ); - - puts( "Init: pthread_attr_getschedpolicy - EINVAL (not initialized attr)" ); - status = pthread_attr_getschedpolicy( &destroyed_attr, &schedpolicy ); - assert( status == EINVAL ); - - puts( "Init: pthread_attr_getschedpolicy - SUCCESSFUL" ); - status = pthread_attr_getschedpolicy( &attr, &schedpolicy ); - assert( !status ); - printf( "Init: current scheduler policy attribute = %d\n", schedpolicy ); - - /* exercise get and set stack size */ - - empty_line(); - - puts( "Init: pthread_attr_setstacksize - EINVAL (NULL attr)" ); - status = pthread_attr_setstacksize( NULL, 0 ); - assert( status == EINVAL ); - - puts( "Init: pthread_attr_setstacksize - EINVAL (not initialized attr)" ); - status = - pthread_attr_setstacksize( &destroyed_attr, 0 ); - assert( status == EINVAL ); - - puts( "Init: pthread_attr_setstacksize - SUCCESSFUL (low stacksize)" ); - status = pthread_attr_setstacksize( &attr, 0 ); - assert( !status ); - - puts( "Init: pthread_attr_setstacksize - SUCCESSFUL (high stacksize)" ); - status = pthread_attr_setstacksize( &attr, STACK_MINIMUM_SIZE * 2 ); - assert( !status ); - - puts( "Init: pthread_attr_getstacksize - EINVAL (NULL attr)" ); - status = pthread_attr_getstacksize( NULL, &stacksize ); - assert( status == EINVAL ); - - puts( "Init: pthread_attr_getstacksize - EINVAL (NULL stacksize)" ); - status = pthread_attr_getstacksize( &attr, NULL ); - assert( status == EINVAL ); - - puts( "Init: pthread_attr_getstacksize - EINVAL (not initialized attr)" ); - status = pthread_attr_getstacksize( &destroyed_attr, &stacksize ); - assert( status == EINVAL ); - - puts( "Init: pthread_attr_getstacksize - SUCCESSFUL" ); - status = pthread_attr_getstacksize( &attr, &stacksize ); - assert( !status ); - if ( stacksize == (STACK_MINIMUM_SIZE * 2) ) - printf( "Init: current stack size attribute is OK\n" ); - - /* exercise get and set stack address */ - - empty_line(); - - puts( "Init: pthread_attr_setstackaddr - EINVAL (NULL attr)" ); - status = pthread_attr_setstackaddr( NULL, NULL ); - assert( status == EINVAL ); - - puts( "Init: pthread_attr_setstackaddr - EINVAL (not initialized attr)" ); - status = - pthread_attr_setstackaddr( &destroyed_attr, NULL ); - assert( status == EINVAL ); - - puts( "Init: pthread_attr_setstackaddr - SUCCESSFUL" ); - status = pthread_attr_setstackaddr( &attr, 0 ); - assert( !status ); - - puts( "Init: pthread_attr_getstackaddr - EINVAL (NULL attr)" ); - status = pthread_attr_getstackaddr( NULL, &stackaddr ); - assert( status == EINVAL ); - - puts( "Init: pthread_attr_getstackaddr - EINVAL (NULL stackaddr)" ); - status = pthread_attr_getstackaddr( &attr, NULL ); - assert( status == EINVAL ); - - puts( "Init: pthread_attr_getstackaddr - EINVAL (not initialized attr)" ); - status = pthread_attr_getstackaddr( &destroyed_attr, &stackaddr ); - assert( status == EINVAL ); - - puts( "Init: pthread_attr_getstackaddr - SUCCESSFUL" ); - status = pthread_attr_getstackaddr( &attr, &stackaddr ); - assert( !status ); - printf( "Init: current stack address attribute = %p\n", stackaddr ); - - /* exercise get and set detach state */ - - empty_line(); - - puts( "Init: pthread_attr_setdetachstate - EINVAL (NULL attr)" ); - status = pthread_attr_setdetachstate( NULL, PTHREAD_CREATE_DETACHED ); - assert( status == EINVAL ); - - puts( "Init: pthread_attr_setdetachstate - EINVAL (not initialized attr)" ); - status = - pthread_attr_setdetachstate( &destroyed_attr, PTHREAD_CREATE_JOINABLE ); - assert( status == EINVAL ); - - puts( "Init: pthread_attr_setdetachstate - EINVAL (invalid detachstate)" ); - status = pthread_attr_setdetachstate( &attr, -1 ); - assert( status == EINVAL ); - - puts( "Init: pthread_attr_setdetachstate - SUCCESSFUL" ); - status = pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_JOINABLE ); - assert( !status ); - - puts( "Init: pthread_attr_getdetachstate - EINVAL (NULL attr)" ); - status = pthread_attr_getdetachstate( NULL, &detachstate ); - assert( status == EINVAL ); - - puts( "Init: pthread_attr_getdetachstate - EINVAL (NULL detatchstate)" ); - status = pthread_attr_getdetachstate( &attr, NULL ); - assert( status == EINVAL ); - - puts( "Init: pthread_attr_getdetachstate - EINVAL (not initialized attr)" ); - status = pthread_attr_getdetachstate( &destroyed_attr, &detachstate ); - assert( status == EINVAL ); - - puts( "Init: pthread_attr_getdetachstate - SUCCESSFUL" ); - status = pthread_attr_getdetachstate( &attr, &detachstate ); - assert( !status ); - printf( "Init: current detach state attribute = %d\n", detachstate ); - - /* exercise get and set scheduling parameters */ - - empty_line(); - - puts( "Init: pthread_attr_getschedparam - SUCCESSFUL" ); - status = pthread_attr_getschedparam( &attr, &schedparam ); - assert( !status ); - - print_schedparam( "Init: ", &schedparam ); - - puts( "Init: pthread_attr_setschedparam - EINVAL (NULL attr)" ); - status = pthread_attr_setschedparam( NULL, &schedparam ); - assert( status == EINVAL ); - - puts( "Init: pthread_attr_setschedparam - EINVAL (not initialized attr)" ); - status = pthread_attr_setschedparam( &destroyed_attr, &schedparam ); - assert( status == EINVAL ); - - puts( "Init: pthread_attr_setschedparam - EINVAL (NULL schedparam)" ); - status = pthread_attr_setschedparam( &attr, NULL ); - assert( status == EINVAL ); - - puts( "Init: pthread_attr_setschedparam - SUCCESSFUL" ); - status = pthread_attr_setschedparam( &attr, &schedparam ); - assert( !status ); - - puts( "Init: pthread_attr_getschedparam - EINVAL (NULL attr)" ); - status = pthread_attr_getschedparam( NULL, &schedparam ); - assert( status == EINVAL ); - - puts( "Init: pthread_attr_getschedparam - EINVAL (not initialized attr)" ); - status = pthread_attr_getschedparam( &destroyed_attr, &schedparam ); - assert( status == EINVAL ); - - puts( "Init: pthread_attr_getschedparam - EINVAL (NULL schedparam)" ); - status = pthread_attr_getschedparam( &attr, NULL ); - assert( status == EINVAL ); - - /* exercise pthread_getschedparam */ - - empty_line(); - - puts( "Init: pthread_getschedparam - EINVAL (NULL policy)" ); - status = pthread_getschedparam( pthread_self(), NULL, &schedparam ); - assert( status == EINVAL ); - - puts( "Init: pthread_getschedparam - EINVAL (NULL schedparam)" ); - status = pthread_getschedparam( pthread_self(), &schedpolicy, NULL ); - assert( status == EINVAL ); - - puts( "Init: pthread_getschedparam - ESRCH (bad thread)" ); - status = pthread_getschedparam( -1, &schedpolicy, &schedparam ); - assert( status == ESRCH ); - - puts( "Init: pthread_getschedparam - SUCCESSFUL" ); - status = pthread_getschedparam( pthread_self(), &schedpolicy, &schedparam ); - assert( !status ); - - printf( "Init: policy = %d\n", schedpolicy ); - - print_schedparam( "Init: ", &schedparam ); - - /* exercise pthread_setschedparam */ - - empty_line(); - - puts( "Init: pthread_setschedparam - EINVAL (NULL schedparam)" ); - status = pthread_setschedparam( pthread_self(), SCHED_OTHER, NULL ); - assert( status == EINVAL ); - - schedparam.sched_priority = -1; - - puts( "Init: pthread_setschedparam - EINVAL (invalid priority)" ); - status = pthread_setschedparam( pthread_self(), SCHED_OTHER, NULL ); - assert( status == EINVAL ); - - schedparam.sched_priority = 128; - - puts( "Init: pthread_setschedparam - EINVAL (invalid policy)" ); - status = pthread_setschedparam( pthread_self(), -1, &schedparam ); - assert( status == EINVAL ); - - puts( "Init: pthread_setschedparam - ESRCH (invalid thread)" ); - status = pthread_setschedparam( -1, SCHED_OTHER, &schedparam ); - assert( status == ESRCH ); - - /* now get sporadic server errors */ - - schedparam.ss_replenish_period.tv_sec = 1; - schedparam.ss_replenish_period.tv_nsec = 0; - schedparam.ss_initial_budget.tv_sec = 1; - schedparam.ss_initial_budget.tv_nsec = 1; - - puts( "Init: pthread_setschedparam - EINVAL (replenish < budget)" ); - status = pthread_setschedparam( pthread_self(), SCHED_SPORADIC, &schedparam ); - assert( status == EINVAL ); - - schedparam.ss_replenish_period.tv_sec = 2; - schedparam.ss_replenish_period.tv_nsec = 0; - schedparam.ss_initial_budget.tv_sec = 1; - schedparam.ss_initial_budget.tv_nsec = 0; - schedparam.ss_low_priority = -1; - - puts( "Init: pthread_setschedparam - EINVAL (invalid priority)" ); - status = pthread_setschedparam( pthread_self(), SCHED_SPORADIC, &schedparam ); - assert( status == EINVAL ); - - puts( "*** END OF POSIX TEST 7 ***" ); - rtems_test_exit( 0 ); - - return NULL; /* just so the compiler thinks we returned something */ -} diff --git a/testsuites/psxtests/psx07/psx07.scn b/testsuites/psxtests/psx07/psx07.scn deleted file mode 100644 index 4237c4791b..0000000000 --- a/testsuites/psxtests/psx07/psx07.scn +++ /dev/null @@ -1,96 +0,0 @@ -*** POSIX TEST 7 *** -Init's ID is 0x0b010001 -Init: pthread_attr_init - EINVAL (NULL attr) -Init: pthread_attr_init - SUCCESSFUL -Init: initialize and destroy an attribute - SUCCESSFUL -Init: pthread_attr_destroy - EINVAL (NULL attr) -Init: pthread_attr_destroy - EINVAL (not initialized) -Init: pthread_create - EINVAL (attr not initialized) -Init: pthread_create - EINVAL (stacksize too small) -Init: pthread_create - EAGAIN (stacksize too large) -Init: pthread_create - EINVAL (invalid inherit scheduler) -Init: pthread_create - ENOTSUP (unsupported system contention scope) -Init: pthread_create - SUCCESSFUL (inherit scheduler) -Task_1: exitting -Init: pthread_attr_setscope - EINVAL (NULL attr) -Init: pthread_attr_setscope - ENOTSUP -Init: pthread_attr_setscope - EINVAL (not initialized attr) -Init: pthread_attr_setscope - EINVAL (invalid scope) -Init: pthread_attr_setscope - SUCCESSFUL -Init: pthread_attr_getscope - EINVAL (NULL attr) -Init: pthread_attr_getscope - EINVAL (NULL scope) -Init: pthread_attr_getscope - EINVAL (not initialized attr) -Init: pthread_attr_getscope - SUCCESSFUL -Init: current scope attribute = 0 -Init: pthread_attr_setinheritsched - EINVAL (NULL attr) -Init: pthread_attr_setinheritsched - EINVAL (not initialized attr) -Init: pthread_attr_setinheritsched - ENOTSUP (invalid inheritsched) -Init: pthread_attr_setinheritsched - SUCCESSFUL -Init: pthread_attr_getinheritsched - EINVAL (NULL attr) -Init: pthread_attr_getinheritsched - EINVAL (NULL inheritsched) -Init: pthread_attr_getinheritsched - EINVAL (not initialized attr) -Init: pthread_attr_getinheritsched - SUCCESSFUL -Init: current inherit scheduler attribute = 1 -Init: pthread_attr_setschedpolicy - EINVAL (NULL attr) -Init: pthread_attr_setschedpolicy - EINVAL (not initialized attr) -Init: pthread_attr_setschedpolicy - ENOTSUP (invalid schedpolicy) -Init: pthread_attr_setschedpolicy - SUCCESSFUL -Init: pthread_attr_getschedpolicy - EINVAL (NULL attr) -Init: pthread_attr_getschedpolicy - EINVAL (NULL schedpolicy) -Init: pthread_attr_getschedpolicy - EINVAL (not initialized attr) -Init: pthread_attr_getschedpolicy - SUCCESSFUL -Init: current scheduler policy attribute = 2 -Init: pthread_attr_setstacksize - EINVAL (NULL attr) -Init: pthread_attr_setstacksize - EINVAL (not initialized attr) -Init: pthread_attr_setstacksize - SUCCESSFUL (low stacksize) -Init: pthread_attr_setstacksize - SUCCESSFUL (high stacksize) -Init: pthread_attr_getstacksize - EINVAL (NULL attr) -Init: pthread_attr_getstacksize - EINVAL (NULL stacksize) -Init: pthread_attr_getstacksize - EINVAL (not initialized attr) -Init: pthread_attr_getstacksize - SUCCESSFUL -Init: current stack size attribute is OK -Init: pthread_attr_setstackaddr - EINVAL (NULL attr) -Init: pthread_attr_setstackaddr - EINVAL (not initialized attr) -Init: pthread_attr_setstackaddr - SUCCESSFUL -Init: pthread_attr_getstackaddr - EINVAL (NULL attr) -Init: pthread_attr_getstackaddr - EINVAL (NULL stackaddr) -Init: pthread_attr_getstackaddr - EINVAL (not initialized attr) -Init: pthread_attr_getstackaddr - SUCCESSFUL -Init: current stack address attribute = 0x0 -Init: pthread_attr_setdetachstate - EINVAL (NULL attr) -Init: pthread_attr_setdetachstate - EINVAL (not initialized attr) -Init: pthread_attr_setdetachstate - EINVAL (invalid detachstate) -Init: pthread_attr_setdetachstate - SUCCESSFUL -Init: pthread_attr_getdetachstate - EINVAL (NULL attr) -Init: pthread_attr_getdetachstate - EINVAL (NULL detatchstate) -Init: pthread_attr_getdetachstate - EINVAL (not initialized attr) -Init: pthread_attr_getdetachstate - SUCCESSFUL -Init: current detach state attribute = 1 -Init: pthread_attr_getschedparam - SUCCESSFUL -Init: sched priority = 2 -Init: ss_low_priority = 0 -Init: ss_replenish_period = (0, 0) -Init: ss_initial_budget = (0, 0) -Init: pthread_attr_setschedparam - EINVAL (NULL attr) -Init: pthread_attr_setschedparam - EINVAL (not initialized attr) -Init: pthread_attr_setschedparam - EINVAL (NULL schedparam) -Init: pthread_attr_setschedparam - SUCCESSFUL -Init: pthread_attr_getschedparam - EINVAL (NULL attr) -Init: pthread_attr_getschedparam - EINVAL (not initialized attr) -Init: pthread_attr_getschedparam - EINVAL (NULL schedparam) -Init: pthread_getschedparam - EINVAL (NULL policy) -Init: pthread_getschedparam - EINVAL (NULL schedparam) -Init: pthread_getschedparam - ESRCH (bad thread) -Init: pthread_getschedparam - SUCCESSFUL -Init: policy = 1 -Init: sched priority = 2 -Init: ss_low_priority = 0 -Init: ss_replenish_period = (0, 0) -Init: ss_initial_budget = (0, 0) -Init: pthread_setschedparam - EINVAL (NULL schedparam) -Init: pthread_setschedparam - EINVAL (invalid priority) -Init: pthread_setschedparam - EINVAL (invalid policy) -Init: pthread_setschedparam - ESRCH (invalid thread) -Init: pthread_setschedparam - EINVAL (replenish < budget) -Init: pthread_setschedparam - EINVAL (invalid priority) -*** END OF POSIX TEST 7 *** diff --git a/testsuites/psxtests/psx07/system.h b/testsuites/psxtests/psx07/system.h deleted file mode 100644 index 654a65713d..0000000000 --- a/testsuites/psxtests/psx07/system.h +++ /dev/null @@ -1,50 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -/* functions */ - -#include - -void *POSIX_Init( - void *argument -); - -void *Task_1( - void *argument -); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 3 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#include - -/* global variables */ - -#ifdef CONFIGURE_INIT -#define TEST_EXTERN -#else -#define TEST_EXTERN extern -#endif - -TEST_EXTERN pthread_t Init_id; -TEST_EXTERN pthread_t Task_id; - -/* end of include file */ diff --git a/testsuites/psxtests/psx07/task.c b/testsuites/psxtests/psx07/task.c deleted file mode 100644 index 8f04b1285f..0000000000 --- a/testsuites/psxtests/psx07/task.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Task_1 - * - * 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" -#include -#include - -void *Task_1( - void *argument -) -{ - puts( "Task_1: exitting" ); - pthread_exit( NULL ); - - return NULL; /* just so the compiler thinks we returned something */ -} diff --git a/testsuites/psxtests/psx08/.cvsignore b/testsuites/psxtests/psx08/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/psxtests/psx08/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/psxtests/psx08/Makefile.am b/testsuites/psxtests/psx08/Makefile.am deleted file mode 100644 index 221c16f184..0000000000 --- a/testsuites/psxtests/psx08/Makefile.am +++ /dev/null @@ -1,44 +0,0 @@ -## -## $Id$ -## - - -TEST = psx08 - -MANAGERS = all - -C_FILES = init.c task1.c task2.c task3.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/psxtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -AM_CPPFLAGS += -I$(top_srcdir)/include - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/psxtests/psx08/init.c b/testsuites/psxtests/psx08/init.c deleted file mode 100644 index ae478f8a86..0000000000 --- a/testsuites/psxtests/psx08/init.c +++ /dev/null @@ -1,97 +0,0 @@ -/* - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define CONFIGURE_INIT -#include "system.h" -#include - -void *POSIX_Init( - void *argument -) -{ - int status; - void *return_pointer; - - puts( "\n\n*** POSIX TEST 8 ***" ); - - /* set the time of day, and print our buffer in multiple ways */ - - set_time( TM_FRIDAY, TM_MAY, 24, 96, 11, 5, 0 ); - - /* get id of this thread */ - - Init_id = pthread_self(); - printf( "Init's ID is 0x%08x\n", Init_id ); - - puts( "Init: pthread_detach - ESRCH (invalid id)" ); - status = pthread_detach( -1 ); - assert( status == ESRCH ); - - /* detach this thread */ - - puts( "Init: pthread_detach self" ); - status = pthread_detach( pthread_self() ); - assert( !status ); - - /* create thread */ - - status = pthread_create( &Task1_id, NULL, Task_1, NULL ); - assert( !status ); - - puts( "Init: pthread_join - ESRCH (invalid id)" ); - status = pthread_join( -1, &return_pointer ); - assert( status == ESRCH ); - - puts( "Init: pthread_join - SUCCESSFUL" ); - status = pthread_join( Task1_id, &return_pointer ); - - puts( "Init: returned from pthread_join through return" ); - if ( status ) - printf( "status = %d\n", status ); - assert( !status ); - - if ( return_pointer == &Task1_id ) - puts( "Init: pthread_join returned correct pointer" ); - else - printf( - "Init: pthread_join returned incorrect pointer (%p != %p)\n", - return_pointer, - &Task1_id - ); - - puts( "Init: creating two pthreads" ); - status = pthread_create( &Task2_id, NULL, Task_2, NULL ); - assert( !status ); - - status = pthread_create( &Task3_id, NULL, Task_3, NULL ); - assert( !status ); - - puts( "Init: pthread_join - SUCCESSFUL" ); - status = pthread_join( Task2_id, &return_pointer ); - /* assert is below comment */ - - puts( "Init: returned from pthread_join through pthread_exit" ); - if ( status ) - printf( "status = %d\n", status ); - assert( !status ); - - if ( return_pointer == &Task2_id ) - puts( "Init: pthread_join returned correct pointer" ); - else - printf( - "Init: pthread_join returned incorrect pointer (%p != %p)\n", - return_pointer, - &Task2_id - ); - - puts( "Init: exitting" ); - return NULL; -} diff --git a/testsuites/psxtests/psx08/psx08.scn b/testsuites/psxtests/psx08/psx08.scn deleted file mode 100644 index 9b76f51a2f..0000000000 --- a/testsuites/psxtests/psx08/psx08.scn +++ /dev/null @@ -1,22 +0,0 @@ -*** POSIX TEST 8 *** -Init's ID is 0x0b010001 -Init: pthread_detach - ESRCH (invalid id) -Init: pthread_detach self -Init: pthread_join - ESRCH (invalid id) -Init: pthread_join - SUCCESSFUL -Task_1: exitting -Init: returned from pthread_join through return -Init: pthread_join returned correct pointer -Init: creating two pthreads -Init: pthread_join - SUCCESSFUL -Task_2: sleep 1 second -Task_3: join to Task_2 -Task_2: join to detached task (Init) -- EINVAL -Task_2: join to self task (Init) -- EDEADLK -Task_2: exitting -Init: returned from pthread_join through pthread_exit -Init: pthread_join returned correct pointer -Init: exitting -Task_3: returned from pthread_join -Task_3: pthread_join returned correct pointer -*** END OF POSIX TEST 8 *** diff --git a/testsuites/psxtests/psx08/system.h b/testsuites/psxtests/psx08/system.h deleted file mode 100644 index c09e2585d2..0000000000 --- a/testsuites/psxtests/psx08/system.h +++ /dev/null @@ -1,60 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -/* functions */ - -#include - -void *POSIX_Init( - void *argument -); - -void *Task_1( - void *argument -); - -void *Task_2( - void *argument -); - -void *Task_3( - void *argument -); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 4 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#include - -/* global variables */ - -#ifdef CONFIGURE_INIT -#define TEST_EXTERN -#else -#define TEST_EXTERN extern -#endif - -TEST_EXTERN pthread_t Init_id; -TEST_EXTERN pthread_t Task1_id; -TEST_EXTERN pthread_t Task2_id; -TEST_EXTERN pthread_t Task3_id; - -/* end of include file */ diff --git a/testsuites/psxtests/psx08/task1.c b/testsuites/psxtests/psx08/task1.c deleted file mode 100644 index e1e37ee67e..0000000000 --- a/testsuites/psxtests/psx08/task1.c +++ /dev/null @@ -1,31 +0,0 @@ -/* Task_1 - * - * 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" -#include - -void *Task_1( - void *argument -) -{ - puts( "Task_1: exitting" ); - - return( &Task1_id ); -} diff --git a/testsuites/psxtests/psx08/task2.c b/testsuites/psxtests/psx08/task2.c deleted file mode 100644 index 08e7dd3f7e..0000000000 --- a/testsuites/psxtests/psx08/task2.c +++ /dev/null @@ -1,55 +0,0 @@ -/* Task_2 - * - * 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" -#include - -void *Task_2( - void *argument -) -{ - int status; - - puts( "Task_2: sleep 1 second" ); - - sleep( 1 ); - - /* switch to task 3 */ - - puts( "Task_2: join to detached task (Init) -- EINVAL" ); - status = pthread_join( Init_id, NULL ); - if ( status != EINVAL ) - printf( "status = %d\n", status ); - assert( status == EINVAL ); - - puts( "Task_2: join to self task (Init) -- EDEADLK" ); - status = pthread_join( pthread_self(), NULL ); - if ( status != EDEADLK ) - printf( "status = %d\n", status ); - assert( status == EDEADLK ); - - puts( "Task_2: exitting" ); - - pthread_exit( &Task2_id ); - - /* switch to init task */ - - return NULL; /* just so the compiler thinks we returned something */ -} diff --git a/testsuites/psxtests/psx08/task3.c b/testsuites/psxtests/psx08/task3.c deleted file mode 100644 index cb80de9c09..0000000000 --- a/testsuites/psxtests/psx08/task3.c +++ /dev/null @@ -1,51 +0,0 @@ -/* Task_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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" -#include - -void *Task_3( - void *argument -) -{ - int status; - void *return_pointer; - - puts( "Task_3: join to Task_2" ); - status = pthread_join( Task2_id, &return_pointer ); - puts( "Task_3: returned from pthread_join" ); - if ( status ) - printf( "status = %d\n", status ); - assert( !status ); - - if ( return_pointer == &Task2_id ) - puts( "Task_3: pthread_join returned correct pointer" ); - else - printf( - "Task_3: pthread_join returned incorrect pointer (%p != %p)\n", - return_pointer, - &Task2_id - ); - - puts( "*** END OF POSIX TEST 8 ***" ); - rtems_test_exit( 0 ); - - return NULL; /* just so the compiler thinks we returned something */ -} diff --git a/testsuites/psxtests/psx09/.cvsignore b/testsuites/psxtests/psx09/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/psxtests/psx09/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/psxtests/psx09/Makefile.am b/testsuites/psxtests/psx09/Makefile.am deleted file mode 100644 index 0868614d03..0000000000 --- a/testsuites/psxtests/psx09/Makefile.am +++ /dev/null @@ -1,44 +0,0 @@ -## -## $Id$ -## - - -TEST = psx09 - -MANAGERS = all - -C_FILES = init.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/psxtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -AM_CPPFLAGS += -I$(top_srcdir)/include - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/psxtests/psx09/init.c b/testsuites/psxtests/psx09/init.c deleted file mode 100644 index b1a79ef832..0000000000 --- a/testsuites/psxtests/psx09/init.c +++ /dev/null @@ -1,225 +0,0 @@ -/* - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define CONFIGURE_INIT -#include "system.h" -#include - -void print_schedparam( - char *prefix, - struct sched_param *schedparam -) -{ - printf( "%ssched priority = %d\n", prefix, schedparam->sched_priority ); -#if defined(_POSIX_SPORADIC_SERVER) - printf( "%sss_low_priority = %d\n", prefix, schedparam->ss_low_priority ); - printf( "%sss_replenish_period = (%ld, %ld)\n", prefix, - schedparam->ss_replenish_period.tv_sec, - schedparam->ss_replenish_period.tv_nsec ); - printf( "%sss_initial_budget = (%ld, %ld)\n", prefix, - schedparam->ss_initial_budget.tv_sec, - schedparam->ss_initial_budget.tv_nsec ); -#else - printf( "%s_POSIX_SPORADIC_SERVER is not defined\n" ); -#endif -} - -void *POSIX_Init( - void *argument -) -{ - int status; - int passes; - int schedpolicy; - int priority; - struct sched_param schedparam; - char buffer[ 80 ]; - pthread_mutexattr_t attr; - - puts( "\n\n*** POSIX TEST 9 ***" ); - - /* set the time of day, and print our buffer in multiple ways */ - - set_time( TM_FRIDAY, TM_MAY, 24, 96, 11, 5, 0 ); - - /* get id of this thread */ - - Init_id = pthread_self(); - printf( "Init's ID is 0x%08x\n", Init_id ); - - /* try to use this thread as a sporadic server */ - - puts( "Init: pthread_getschedparam - SUCCESSFUL" ); - status = pthread_getschedparam( pthread_self(), &schedpolicy, &schedparam ); - assert( !status ); - - priority = schedparam.sched_priority; - sprintf( buffer, " - current priority = %d", priority ); - print_current_time( "Init: ", buffer ); - - schedparam.ss_replenish_period.tv_sec = 0; - schedparam.ss_replenish_period.tv_nsec = 500000000; /* 1/2 second */ - schedparam.ss_initial_budget.tv_sec = 0; - schedparam.ss_initial_budget.tv_nsec = 250000000; /* 1/4 second */ - - schedparam.sched_priority = 200; - schedparam.ss_low_priority = 100; - - puts( "Init: pthread_setschedparam - SUCCESSFUL (sporadic server)" ); - status = pthread_setschedparam( pthread_self(), SCHED_SPORADIC, &schedparam ); - assert( !status ); - - status = pthread_getschedparam( pthread_self(), &schedpolicy, &schedparam ); - assert( !status ); - - priority = schedparam.sched_priority; - sprintf( buffer, " - new priority = %d", priority ); - print_current_time( "Init: ", buffer ); - - /* go into a loop consuming CPU time to watch our priority change */ - - for ( passes=0 ; passes <= 3 ; ) { - status = pthread_getschedparam( pthread_self(), &schedpolicy, &schedparam ); - assert( !status ); - - if ( priority != schedparam.sched_priority ) { - priority = schedparam.sched_priority; - sprintf( buffer, " - new priority = %d", priority ); - print_current_time( "Init: ", buffer ); - passes++; - } - } - - /* now see if this works if we are holding a priority ceiling mutex */ - - empty_line(); - - - status = pthread_getschedparam( pthread_self(), &schedpolicy, &schedparam ); - assert( !status ); - - schedparam.ss_replenish_period.tv_sec = 0; - schedparam.ss_replenish_period.tv_nsec = 500000000; /* 1/2 second */ - schedparam.ss_initial_budget.tv_sec = 0; - schedparam.ss_initial_budget.tv_nsec = 250000000; /* 1/4 second */ - -#define HIGH_PRIORITY 150 -#define MEDIUM_PRIORITY 131 -#define LOW_PRIORITY 100 - - schedparam.sched_priority = HIGH_PRIORITY; - schedparam.ss_low_priority = LOW_PRIORITY; - - puts( "Init: pthread_setschedparam - SUCCESSFUL (sporadic server)" ); - status = pthread_setschedparam( pthread_self(), SCHED_SPORADIC, &schedparam ); - assert( !status ); - - puts( "Init: Initializing mutex attributes for priority ceiling" ); - status = pthread_mutexattr_init( &attr ); - assert( !status ); - - status = pthread_mutexattr_setprotocol( &attr, PTHREAD_PRIO_PROTECT ); - assert( !status ); - - status = pthread_mutexattr_setprioceiling( &attr, MEDIUM_PRIORITY ); - assert( !status ); - - puts( "Init: Creating a mutex" ); - status = pthread_mutex_init( &Mutex_id, &attr ); - if ( status ) - printf( "status = %d\n", status ); - assert( !status ); - - status = pthread_getschedparam( pthread_self(), &schedpolicy, &schedparam ); - assert( !status ); - - priority = schedparam.sched_priority; - sprintf( buffer, " - new priority = %d", priority ); - print_current_time( "Init: ", buffer ); - - /* go into a loop consuming CPU time to watch our priority lower */ - - for ( ; ; ) { - status = pthread_getschedparam( pthread_self(), &schedpolicy, &schedparam ); - assert( !status ); - - if ( schedparam.sched_priority != LOW_PRIORITY ) - continue; - - priority = schedparam.sched_priority; - sprintf( buffer, " - new priority = %d", priority ); - print_current_time( "Init: ", buffer ); - - puts( "Init: pthread_mutex_lock acquire the lock" ); - status = pthread_mutex_lock( &Mutex_id ); - if ( status ) - printf( "status = %d\n", status ); - assert( !status ); - - status = pthread_getschedparam( pthread_self(), &schedpolicy, &schedparam ); - assert( !status ); - - priority = schedparam.sched_priority; - sprintf( buffer, " - new priority = %d", priority ); - print_current_time( "Init: ", buffer ); - - break; - } - - /* now spin waiting for our budget to be replenished */ - - for ( ; ; ) { - status = pthread_getschedparam( pthread_self(), &schedpolicy, &schedparam ); - assert( !status ); - - if ( schedparam.sched_priority == HIGH_PRIORITY ) - break; - } - - priority = schedparam.sched_priority; - sprintf( buffer, " - new priority = %d", priority ); - print_current_time( "Init: ", buffer ); - - /* with this unlock we should be able to go to low priority */ - - puts( "Init: unlock mutex" ); - status = pthread_mutex_unlock( &Mutex_id ); - if ( status ) - printf( "status = %d\n", status ); - assert( !status ); - - status = pthread_getschedparam( pthread_self(), &schedpolicy, &schedparam ); - assert( !status ); - - priority = schedparam.sched_priority; - sprintf( buffer, " - new priority = %d", priority ); - print_current_time( "Init: ", buffer ); - - for ( ; ; ) { - status = pthread_getschedparam( pthread_self(), &schedpolicy, &schedparam ); - assert( !status ); - - if ( schedparam.sched_priority == LOW_PRIORITY ) - break; - } - - status = pthread_getschedparam( pthread_self(), &schedpolicy, &schedparam ); - assert( !status ); - - priority = schedparam.sched_priority; - sprintf( buffer, " - new priority = %d", priority ); - print_current_time( "Init: ", buffer ); - - puts( "*** END OF POSIX TEST 9 ***" ); - rtems_test_exit( 0 ); - - return NULL; /* just so the compiler thinks we returned something */ -} diff --git a/testsuites/psxtests/psx09/psx09.scn b/testsuites/psxtests/psx09/psx09.scn deleted file mode 100644 index adf62c5ee3..0000000000 --- a/testsuites/psxtests/psx09/psx09.scn +++ /dev/null @@ -1,22 +0,0 @@ -*** POSIX TEST 9 *** -Init's ID is 0x0b010001 -Init: pthread_getschedparam - SUCCESSFUL -Init: Fri May 24 11:05:00 1996 - current priority = 2 -Init: pthread_setschedparam - SUCCESSFUL (sporadic server) -Init: Fri May 24 11:05:00 1996 - new priority = 200 -Init: Fri May 24 11:05:00 1996 - new priority = 100 -Init: Fri May 24 11:05:00 1996 - new priority = 200 -Init: Fri May 24 11:05:00 1996 - new priority = 100 -Init: Fri May 24 11:05:01 1996 - new priority = 200 -Init: pthread_setschedparam - SUCCESSFUL (sporadic server) -Init: Initializing mutex attributes for priority ceiling -Init: Creating a mutex -Init: Fri May 24 11:05:01 1996 - new priority = 150 -Init: Fri May 24 11:05:01 1996 - new priority = 100 -Init: pthread_mutex_lock acquire the lock -Init: Fri May 24 11:05:01 1996 - new priority = 131 -Init: Fri May 24 11:05:01 1996 - new priority = 150 -Init: unlock mutex -Init: Fri May 24 11:05:01 1996 - new priority = 150 -Init: Fri May 24 11:05:01 1996 - new priority = 100 -*** END OF POSIX TEST 9 *** diff --git a/testsuites/psxtests/psx09/system.h b/testsuites/psxtests/psx09/system.h deleted file mode 100644 index 9e2e590850..0000000000 --- a/testsuites/psxtests/psx09/system.h +++ /dev/null @@ -1,56 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -/* functions */ - -#include - -void *POSIX_Init( - void *argument -); - -void *Task_1( - void *argument -); - -void *Task_2( - void *argument -); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 1 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 -#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 10 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#include - -/* global variables */ - -#ifdef CONFIGURE_INIT -#define TEST_EXTERN -#else -#define TEST_EXTERN extern -#endif - -TEST_EXTERN pthread_t Init_id; -TEST_EXTERN pthread_mutex_t Mutex_id; - -/* end of include file */ diff --git a/testsuites/psxtests/psx10/.cvsignore b/testsuites/psxtests/psx10/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/psxtests/psx10/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/psxtests/psx10/Makefile.am b/testsuites/psxtests/psx10/Makefile.am deleted file mode 100644 index 384deae56e..0000000000 --- a/testsuites/psxtests/psx10/Makefile.am +++ /dev/null @@ -1,44 +0,0 @@ -## -## $Id$ -## - - -TEST = psx10 - -MANAGERS = all - -C_FILES = init.c task.c task2.c task3.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/psxtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -AM_CPPFLAGS += -I$(top_srcdir)/include - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/psxtests/psx10/init.c b/testsuites/psxtests/psx10/init.c deleted file mode 100644 index 37c6912dbb..0000000000 --- a/testsuites/psxtests/psx10/init.c +++ /dev/null @@ -1,311 +0,0 @@ -/* - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define CONFIGURE_INIT -#include "system.h" -#include - - -void *POSIX_Init( - void *argument -) -{ - int status; - pthread_condattr_t attr; - pthread_condattr_t attr_error; - int pshared; - pthread_cond_t cond; - struct timespec timeout; - - puts( "\n\n*** POSIX TEST 10 ***" ); - - puts( "Init: pthread_condattr_init" ); - status = pthread_condattr_init( &attr ); - assert( !status ); - - puts( "Init: pthread_condattr_init - EINVAL (attribute invalid)" ); - status = pthread_condattr_init( NULL ); - if ( status != EINVAL ) - printf( "status = %d\n", status ); - assert( status == EINVAL ); - - puts( "Init: pthread_condattr_destroy" ); - status = pthread_condattr_destroy( &attr ); - assert( !status ); - - puts( "Init: pthread_condattr_destroy - EINVAL (attribute invalid)" ); - status = pthread_condattr_destroy( NULL ); - if ( status != EINVAL ) - printf( "status = %d\n", status ); - assert( status == EINVAL ); - - puts( "Init: pthread_condattr_init" ); - status = pthread_condattr_init( &attr ); - assert( !status ); - - puts( "Init: pthread_condattr_setpshared - PTHREAD_PROCESS_SHARED" ); - status = pthread_condattr_setpshared( &attr, PTHREAD_PROCESS_SHARED ); - assert( !status ); - - puts( "Init: pthread_condattr_setpshared - PTHREAD_PROCESS_PRIVATE" ); - status = pthread_condattr_setpshared( &attr, PTHREAD_PROCESS_PRIVATE ); - assert( !status ); - - status = pthread_condattr_setpshared( NULL, PTHREAD_PROCESS_PRIVATE ); - if ( status != EINVAL ) - printf( "status = %d\n", status ); - assert( status == EINVAL ); - puts( "Init: pthread_condattr_setpshared - EINVAL (attribute invalid)" ); - - status = pthread_condattr_setpshared( &attr, 0xFFFFFF ); - if ( status != EINVAL ) - printf( "status = %d\n", status ); - assert( status == EINVAL ); - puts( "Init: pthread_condattr_setpshared - EINVAL (pshared invalid)" ); - - status = pthread_condattr_getpshared( &attr, &pshared ); - assert( !status ); - printf( "Init: pthread_condattr_getpshared - %d\n", pshared ); - - status = pthread_condattr_getpshared( NULL, &pshared ); - if ( status != EINVAL ) - printf( "status = %d\n", status ); - assert( status == EINVAL ); - puts( "Init: pthread_condattr_getpshared - EINVAL (attribute invalid)" ); - - puts( "Init: pthread_cond_init - NULL attr" ); - status = pthread_cond_init( &cond, NULL ); - assert( !status ); - -/* error for attribute not initialized */ - - attr_error.is_initialized = FALSE; - status = pthread_cond_init( &cond, &attr_error ); - if ( status != EINVAL ) - printf( "status = %d\n", status ); - assert( status == EINVAL ); - puts( "Init: pthread_cond_init - EINVAL (attr not initialized)" ); - - status = pthread_cond_init( &cond, NULL ); - if ( status != ENOMEM ) - printf( "status = %d\n", status ); - assert( status == ENOMEM ); - puts( "Init: pthread_cond_init - ENOMEM (too many conds)" ); - - puts( "Init: pthread_cond_destroy" ); - status = pthread_cond_destroy( &cond ); - assert( !status ); - -/* error for bad condition variable passed */ - - status = pthread_cond_destroy( NULL ); - if ( status != EINVAL ) - printf( "status = %d\n", status ); - assert( status == EINVAL ); - puts( "Init: pthread_cond_destroy - EINVAL (cond invalid)" ); - -/* initiailize the attribute for the rest of the test */ - - puts( "Init: pthread_cond_init - attr" ); - status = pthread_cond_init( &Cond1_id, &attr ); - assert( !status ); - -/* signal task1 with a condition variable */ - - empty_line(); - - status = pthread_create( &Task_id, NULL, Task_1, NULL ); - assert( !status ); - -/* switch to task1 to allow it to wait for a condition variable */ - - puts( "Init: sleep to switch to Task_1" ); - sleep( 1 ); - - status = pthread_cond_destroy( &Cond1_id ); - if ( status != EBUSY ) - printf( "status = %d\n", status ); - assert( status == EBUSY ); - puts( "Init: pthread_cond_destroy - EBUSY (task1 waiting)" ); - - puts( "Init: pthread_cond_signal" ); - status = pthread_cond_signal( &Cond1_id ); - assert( !status ); - - empty_line(); - - status = pthread_create( &Task2_id, NULL, Task_2, NULL ); - assert( !status ); - -/* switch to task1 and task2 to allow them to wait for broadcast signal */ - - puts( "Init: sleep - switch to Task_1 and Task_2" ); - sleep( 1 ); - -/* broadcast a condition variable to task1 and task2 */ - - puts( "Init: pthread_cond_broadcast" ); - status = pthread_cond_broadcast( &Cond1_id ); - assert( !status ); - - puts( "Init: sleep - switch to Task_1" ); - sleep( 0 ); - -/* timedwait case - timeout */ - - status = pthread_mutex_lock( &Mutex_id ); - assert( !status ); - -/* set timeout to 3 seconds */ - - status = clock_gettime( CLOCK_REALTIME, &timeout ); - assert( !status ); - timeout.tv_sec += 3; - timeout.tv_nsec = 0; - - puts( "Init: pthread_cond_timedwait for 3 seconds" ); - status = pthread_cond_timedwait( &Cond1_id, &Mutex_id, &timeout ); - if ( status != ETIMEDOUT ) - printf( "status = %d\n", status ); - assert( status == ETIMEDOUT ); - puts( "Init: pthread_cond_timedwait - ETIMEDOUT - (mutex not acquired)" ); - - status = pthread_mutex_unlock( &Mutex_id ); - assert( !status ); - -/* remaining error messages */ - - empty_line(); - -/* errors for bad variable passed */ - - status = pthread_cond_signal( NULL ); - if ( status != EINVAL ) - printf( "status = %d\n", status ); - assert( status == EINVAL ); - puts( "Init: pthread_cond_signal - EINVAL (cond invalid)" ); - - status = pthread_cond_broadcast( NULL ); - if ( status != EINVAL ) - printf( "status = %d\n", status ); - assert( status == EINVAL ); - puts( "Init: pthread_cond_broadcast - EINVAL (cond invalid)" ); - -/* acquire mutex so errors will occur */ - - status = pthread_mutex_lock( &Mutex_id ); - assert( !status ); - - status = pthread_cond_wait( NULL, &Mutex_id ); - if ( status != EINVAL ) - printf( "status = %d\n", status ); - assert( status == EINVAL ); - puts( "Init: pthread_cond_wait - EINVAL (cond invalid)" ); - - status = pthread_cond_timedwait( NULL, &Mutex_id, &timeout ); - if ( status != EINVAL ) - printf( "status = %d\n", status ); - assert( status == EINVAL ); - puts( "Init: pthread_cond_timedwait - EINVAL (cond invalid)" ); - - status = pthread_cond_wait( &Cond1_id, NULL ); - if ( status != EINVAL ) - printf( "status = %d\n", status ); - assert( status == EINVAL ); - puts( "Init: pthread_cond_wait - EINVAL (mutex invalid)" ); - - status = pthread_cond_timedwait( &Cond1_id, NULL, &timeout ); - if ( status != EINVAL ) - printf( "status = %d\n", status ); - assert( status == EINVAL ); - puts( "Init: pthread_cond_timedwait - EINVAL (mutex invalid)" ); - - status = pthread_cond_timedwait( &Cond1_id, &Mutex_id, NULL ); - if ( status != EINVAL ) - printf( "status = %d\n", status ); - assert( status == EINVAL ); - puts( "Init: pthread_cond_timedwait - EINVAL (abstime NULL)" ); - - status = clock_gettime( CLOCK_REALTIME, &timeout ); - assert( !status ); - timeout.tv_sec -= 1; - status = pthread_cond_timedwait( &Cond1_id, &Mutex_id, &timeout ); - if ( status != ETIMEDOUT ) - printf( "status = %d\n", status ); - assert( status == ETIMEDOUT ); - puts( "Init: pthread_cond_timedwait - ETIMEDOUT (abstime->tv_sec < current time)" ); - status = pthread_mutex_unlock( &Mutex_id ); - assert( !status ); - - status = pthread_mutex_lock( &Mutex_id ); - assert( !status ); - status = clock_gettime( CLOCK_REALTIME, &timeout ); - assert( !status ); - timeout.tv_nsec -= 1; - status = pthread_cond_timedwait( &Cond1_id, &Mutex_id, &timeout ); - if ( status != ETIMEDOUT ) - printf( "status = %d\n", status ); - assert( status == ETIMEDOUT ); - puts( "Init: pthread_cond_timedwait - ETIMEDOUT (abstime->tv_nsec < current time)" ); - status = pthread_mutex_unlock( &Mutex_id ); - assert( !status ); - -/* wait and timedwait without mutex */ - -/* XXX - this case is commented out in the code pending review - * - * status = pthread_cond_wait( &Cond1_id, &Mutex_id ); - * if ( status != EINVAL ) - * printf( "status = %d\n", status ); - * assert( status == EINVAL ); - */ - puts( "Init: pthread_cond_wait - EINVAL (mutex not locked before call)" ); - -/* XXX - this case is commented out in the code pending review - * - * status = clock_gettime( CLOCK_REALTIME, &timeout ); - * assert( !status ); - * timeout.tv_sec += 1; - * status = pthread_cond_timedwait( &Cond1_id, &Mutex_id, &timeout ); - * if ( status != EINVAL ) - * printf( "status = %d\n", status ); - * assert( status == EINVAL ); - */ - puts( "Init: pthread_cond_timedwait - EINVAL (mutex not locked before call)"); - - empty_line(); - - status = pthread_create( &Task3_id, NULL, Task_3, NULL ); - assert( !status ); - -/* switch to task3 to allow it to wait for broadcast signal */ - - puts( "Init: sleep - switch to Task_3" ); - sleep( 1 ); - -/* destroy the mutex so Task3 can not acguire at the end of Wait_support */ - - status = pthread_mutex_destroy( &Mutex_id ); - assert( !status ); - -/* signal a condition variable to task3 */ - - puts( "Init: pthread_cond_signal" ); - status = pthread_cond_signal( &Cond1_id ); - - puts( "Init: sleep - switch to Task_3" ); - sleep( 1 ); - - puts( "*** END OF POSIX TEST 10 ***" ); - rtems_test_exit( 0 ); - - return NULL; /* just so the compiler thinks we returned something */ -} diff --git a/testsuites/psxtests/psx10/psx10.scn b/testsuites/psxtests/psx10/psx10.scn deleted file mode 100644 index 962540d6e4..0000000000 --- a/testsuites/psxtests/psx10/psx10.scn +++ /dev/null @@ -1,55 +0,0 @@ -*** POSIX TEST 10 *** -Init: pthread_condattr_init -Init: pthread_condattr_init - EINVAL (attribute invalid) -Init: pthread_condattr_destroy -Init: pthread_condattr_destroy - EINVAL (attribute invalid) -Init: pthread_condattr_init -Init: pthread_condattr_setpshared - PTHREAD_PROCESS_SHARED -Init: pthread_condattr_setpshared - PTHREAD_PROCESS_PRIVATE -Init: pthread_condattr_setpshared - EINVAL (attribute invalid) -Init: pthread_condattr_setpshared - EINVAL (pshared invalid) -Init: pthread_condattr_getpshared - 0 -Init: pthread_condattr_getpshared - EINVAL (attribute invalid) -Init: pthread_cond_init - NULL attr -Init: pthread_cond_init - EINVAL (attr not initialized) -Init: pthread_cond_init - ENOMEM (too many conds) -Init: pthread_cond_destroy -Init: pthread_cond_destroy - EINVAL (cond invalid) -Init: pthread_cond_init - attr -Init: sleep to switch to Task_1 -Task_1: ID is 0x0b010002 -Task_1: pthread_cond_wait -Init: pthread_cond_destroy - EBUSY (task1 waiting) -Init: pthread_cond_signal -Init: sleep - switch to Task_1 and Task_2 -Task_1: back from pthread_cond_wait release mutex -Task_1: pthread_cond_wait -Task_2: ID is 0x0b010003 -Task_2: pthread_cond_wait -Init: pthread_cond_broadcast -Init: sleep - switch to Task_1 -Task_1: back from pthread_cond_wait release mutex -Task_1: task exit -Task_2: back from pthread_cond_wait release mutex -Task_2: task exit -Init: pthread_cond_timedwait for 3 seconds -Init: pthread_cond_timedwait - ETIMEDOUT - (mutex not acquired) -Init: pthread_cond_signal - EINVAL (cond invalid) -Init: pthread_cond_broadcast - EINVAL (cond invalid) -Init: pthread_cond_wait - EINVAL (cond invalid) -Init: pthread_cond_timedwait - EINVAL (cond invalid) -Init: pthread_cond_wait - EINVAL (mutex invalid) -Init: pthread_cond_timedwait - EINVAL (mutex invalid) -Init: pthread_cond_timedwait - EINVAL (abstime NULL) -Init: pthread_cond_timedwait - ETIMEDOUT (abstime->tv_sec < current time) -Init: pthread_cond_timedwait - ETIMEDOUT (abstime->tv_nsec < current time) -Init: pthread_cond_wait - EINVAL (mutex not locked before call) -Init: pthread_cond_timedwait - EINVAL (mutex not locked before call) -Init: sleep - switch to Task_3 -Task_3: ID is 0x0b010004 -Task_3: pthread_cond_wait -Init: pthread_cond_signal -Init: sleep - switch to Task_3 -Task_3: pthread_cond_wait - EINVAL (mutex not locked after signal) -Task_3: task exit -*** END OF POSIX TEST 10 *** diff --git a/testsuites/psxtests/psx10/system.h b/testsuites/psxtests/psx10/system.h deleted file mode 100644 index 4662201e08..0000000000 --- a/testsuites/psxtests/psx10/system.h +++ /dev/null @@ -1,66 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -/* functions */ - -#include -#include -#include - -void *POSIX_Init( - void *argument -); - -void *Task_1( - void *argument -); - -void *Task_2( - void *argument -); - -void *Task_3( - void *argument -); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 4 -#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 1 -#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 2 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#include - -/* global variables */ - -#ifdef CONFIGURE_INIT -#define TEST_EXTERN -#else -#define TEST_EXTERN extern -#endif - -TEST_EXTERN pthread_t Init_id; -TEST_EXTERN pthread_t Task_id; -TEST_EXTERN pthread_t Task2_id; -TEST_EXTERN pthread_t Task3_id; -TEST_EXTERN pthread_cond_t Cond1_id; -TEST_EXTERN pthread_mutex_t Mutex_id; - -/* end of include file */ diff --git a/testsuites/psxtests/psx10/task.c b/testsuites/psxtests/psx10/task.c deleted file mode 100644 index f7c1fac1f2..0000000000 --- a/testsuites/psxtests/psx10/task.c +++ /dev/null @@ -1,64 +0,0 @@ -/* Task_1 - * - * This routine serves as a test task. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -void *Task_1( - void *argument -) -{ - int status; - -/* wait for a condition variable signal from Init */ - - Task_id = pthread_self(); - printf( "Task_1: ID is 0x%08x\n", Task_id ); - - status = pthread_mutex_init( &Mutex_id, NULL ); - assert( !status ); - - status = pthread_mutex_lock( &Mutex_id ); - assert( !status ); - - puts( "Task_1: pthread_cond_wait" ); - status = pthread_cond_wait( &Cond1_id, &Mutex_id ); - assert( !status ); - - puts( "Task_1: back from pthread_cond_wait release mutex" ); - status = pthread_mutex_unlock( &Mutex_id ); - assert( !status ); - -/* wait for a condition variable broadcast from Init */ - - status = pthread_mutex_lock( &Mutex_id ); - assert( !status ); - - puts( "Task_1: pthread_cond_wait" ); - status = pthread_cond_wait( &Cond1_id, &Mutex_id ); - assert( !status ); - - puts( "Task_1: back from pthread_cond_wait release mutex" ); - status = pthread_mutex_unlock( &Mutex_id ); - assert( !status ); - - puts( "Task_1: task exit" ); - pthread_exit( NULL ); - - return NULL; /* just so the compiler thinks we returned something */ -} diff --git a/testsuites/psxtests/psx10/task2.c b/testsuites/psxtests/psx10/task2.c deleted file mode 100644 index 404fabcc55..0000000000 --- a/testsuites/psxtests/psx10/task2.c +++ /dev/null @@ -1,46 +0,0 @@ -/* Task_2 - * - * This routine serves as a test task. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -void *Task_2( - void *argument -) -{ - int status; - - Task_id = pthread_self(); - printf( "Task_2: ID is 0x%08x\n", Task_id ); - - status = pthread_mutex_lock( &Mutex_id ); - assert( !status ); - - puts( "Task_2: pthread_cond_wait" ); - status = pthread_cond_wait( &Cond1_id, &Mutex_id ); - assert( !status ); - - puts( "Task_2: back from pthread_cond_wait release mutex" ); - status = pthread_mutex_unlock( &Mutex_id ); - assert( !status ); - - puts( "Task_2: task exit" ); - pthread_exit( NULL ); - - return NULL; /* just so the compiler thinks we returned something */ -} diff --git a/testsuites/psxtests/psx10/task3.c b/testsuites/psxtests/psx10/task3.c deleted file mode 100644 index 4531072c0e..0000000000 --- a/testsuites/psxtests/psx10/task3.c +++ /dev/null @@ -1,45 +0,0 @@ -/* Task_3 - * - * This routine serves as a test task. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -void *Task_3( - void *argument -) -{ - int status; - - Task_id = pthread_self(); - printf( "Task_3: ID is 0x%08x\n", Task_id ); - - status = pthread_mutex_lock( &Mutex_id ); - assert( !status ); - - puts( "Task_3: pthread_cond_wait" ); - status = pthread_cond_wait( &Cond1_id, &Mutex_id ); - if ( status != EINVAL ) - printf( "status = %d\n", status ); - assert( status == EINVAL ); - puts( "Task_3: pthread_cond_wait - EINVAL (mutex not locked after signal)"); - - puts( "Task_3: task exit" ); - pthread_exit( NULL ); - - return NULL; /* just so the compiler thinks we returned something */ -} diff --git a/testsuites/psxtests/psx11/.cvsignore b/testsuites/psxtests/psx11/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/psxtests/psx11/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/psxtests/psx11/Makefile.am b/testsuites/psxtests/psx11/Makefile.am deleted file mode 100644 index d6c25e50cc..0000000000 --- a/testsuites/psxtests/psx11/Makefile.am +++ /dev/null @@ -1,44 +0,0 @@ -## -## $Id$ -## - - -TEST = psx11 - -MANAGERS = all - -C_FILES = init.c task.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/psxtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -AM_CPPFLAGS += -I$(top_srcdir)/include - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/psxtests/psx11/init.c b/testsuites/psxtests/psx11/init.c deleted file mode 100644 index aedb0429d2..0000000000 --- a/testsuites/psxtests/psx11/init.c +++ /dev/null @@ -1,107 +0,0 @@ -/* - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define CONFIGURE_INIT -#include "system.h" -#include - -void *POSIX_Init( - void *argument -) -{ - int status; - struct sched_param param; - pthread_attr_t attr; - - puts( "\n\n*** POSIX TEST 11 ***" ); - - /* set the time of day, and print our buffer in multiple ways */ - - set_time( TM_FRIDAY, TM_MAY, 24, 96, 11, 5, 0 ); - - /* get id of this thread */ - - Init_id = pthread_self(); - printf( "Init's ID is 0x%08x\n", Init_id ); - - /* exercise pthread_setschedparam */ - - param.sched_priority = 127; - - puts( "Init: Setting scheduling parameters to FIFO with priority 127" ); - status = pthread_setschedparam( Init_id, SCHED_FIFO, ¶m ); - assert( !status ); - - param.sched_priority = 125; - - puts( "Init: Setting scheduling parameters to RR with priority 125" ); - status = pthread_setschedparam( Init_id, SCHED_RR, ¶m ); - assert( !status ); - - param.sched_priority = 121; - - puts( "Init: Setting scheduling parameters to OTHER with priority 121" ); - status = pthread_setschedparam( Init_id, SCHED_OTHER, ¶m ); - assert( !status ); - - /* create a thread as SCHED_FIFO */ - - puts( "Init: create a thread of SCHED_FIFO with priority 120" ); - status = pthread_attr_init( &attr ); - assert( !status ); - - attr.schedpolicy = SCHED_FIFO; - attr.schedparam.sched_priority = 120; - - status = pthread_create( &Task_id, &attr, Task_1, NULL ); - assert( !status ); - - puts( "Init: join with the other thread" ); - status = pthread_join( Task_id, NULL ); - assert( !status ); - - /* create a thread as SCHED_RR */ - - puts( "Init: create a thread of SCHED_RR with priority 120" ); - status = pthread_attr_init( &attr ); - assert( !status ); - - attr.schedpolicy = SCHED_RR; - attr.schedparam.sched_priority = 120; - - status = pthread_create( &Task_id, &attr, Task_1, NULL ); - assert( !status ); - - puts( "Init: join with the other thread" ); - status = pthread_join( Task_id, NULL ); - assert( !status ); - - /* create a thread as SCHED_OTHER */ - - puts( "Init: create a thread of SCHED_OTHER with priority 120" ); - status = pthread_attr_init( &attr ); - assert( !status ); - - attr.schedpolicy = SCHED_OTHER; - attr.schedparam.sched_priority = 120; - - status = pthread_create( &Task_id, &attr, Task_1, NULL ); - assert( !status ); - - puts( "Init: join with the other thread" ); - status = pthread_join( Task_id, NULL ); - assert( !status ); - - puts( "*** END OF POSIX TEST 11 ***" ); - rtems_test_exit( 0 ); - - return NULL; /* just so the compiler thinks we returned something */ -} diff --git a/testsuites/psxtests/psx11/psx11.scn b/testsuites/psxtests/psx11/psx11.scn deleted file mode 100644 index ecf69edf61..0000000000 --- a/testsuites/psxtests/psx11/psx11.scn +++ /dev/null @@ -1,18 +0,0 @@ -*** POSIX TEST 11 *** -Init's ID is 0x0b010001 -Init: Setting scheduling parameters to FIFO with priority 127 -Init: Setting scheduling parameters to RR with priority 125 -Init: Setting scheduling parameters to OTHER with priority 121 -Init: create a thread of SCHED_FIFO with priority 120 -Init: join with the other thread -Task_1: killing time -Task_1: exitting -Init: create a thread of SCHED_RR with priority 120 -Init: join with the other thread -Task_1: killing time -Task_1: exitting -Init: create a thread of SCHED_OTHER with priority 120 -Init: join with the other thread -Task_1: killing time -Task_1: exitting -*** END OF POSIX TEST 11 *** diff --git a/testsuites/psxtests/psx11/system.h b/testsuites/psxtests/psx11/system.h deleted file mode 100644 index ff5591c15c..0000000000 --- a/testsuites/psxtests/psx11/system.h +++ /dev/null @@ -1,50 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -/* functions */ - -#include - -void *POSIX_Init( - void *argument -); - -void *Task_1( - void *argument -); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 4 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#include - -/* global variables */ - -#ifdef CONFIGURE_INIT -#define TEST_EXTERN -#else -#define TEST_EXTERN extern -#endif - -TEST_EXTERN pthread_t Init_id; -TEST_EXTERN pthread_t Task_id; - -/* end of include file */ diff --git a/testsuites/psxtests/psx11/task.c b/testsuites/psxtests/psx11/task.c deleted file mode 100644 index d6faf6b64a..0000000000 --- a/testsuites/psxtests/psx11/task.c +++ /dev/null @@ -1,91 +0,0 @@ -/* Task_1 - * - * 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" -#include -#include - -void diff_timespec( - struct timespec *start, - struct timespec *stop, - struct timespec *result -) -{ - int nsecs_per_sec = 1000000000; - - result->tv_sec = stop->tv_sec - start->tv_sec; - if ( stop->tv_nsec < start->tv_nsec ) { - result->tv_nsec = nsecs_per_sec - start->tv_nsec + stop->tv_nsec; - result->tv_sec--; - } else - result->tv_nsec = stop->tv_nsec - start->tv_nsec; - -} - -void *Task_1( - void *argument -) -{ - int status; - struct timespec start; - struct timespec current; - struct timespec difference; - struct timespec delay; - - status = clock_gettime( CLOCK_REALTIME, &start ); - assert( !status ); - - status = sched_rr_get_interval( getpid(), &delay ); - assert( !status ); - - /* double the rr interval for confidence */ - - delay.tv_sec *= 2; - delay.tv_nsec *= 2; - if ( delay.tv_nsec >= 1000000000 ) { /* handle overflow/carry */ - delay.tv_nsec -= 1000000000; - delay.tv_sec++; - } - - - puts( "Task_1: killing time" ); - for ( ; ; ) { - - status = clock_gettime( CLOCK_REALTIME, ¤t ); - assert( !status ); - - diff_timespec( &start, ¤t, &difference ); - - if ( difference.tv_sec < delay.tv_sec ) - continue; - - if ( difference.tv_sec > delay.tv_sec ) - break; - - if ( difference.tv_nsec > delay.tv_nsec ) - break; - - } - - puts( "Task_1: exitting" ); - pthread_exit( NULL ); - - return NULL; /* just so the compiler thinks we returned something */ -} diff --git a/testsuites/psxtests/psx12/.cvsignore b/testsuites/psxtests/psx12/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/psxtests/psx12/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/psxtests/psx12/Makefile.am b/testsuites/psxtests/psx12/Makefile.am deleted file mode 100644 index c10bff0e73..0000000000 --- a/testsuites/psxtests/psx12/Makefile.am +++ /dev/null @@ -1,44 +0,0 @@ -## -## $Id$ -## - - -TEST = psx12 - -MANAGERS = all - -C_FILES = init.c task.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/psxtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -AM_CPPFLAGS += -I$(top_srcdir)/include - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/psxtests/psx12/init.c b/testsuites/psxtests/psx12/init.c deleted file mode 100644 index 656bf11641..0000000000 --- a/testsuites/psxtests/psx12/init.c +++ /dev/null @@ -1,139 +0,0 @@ -/* - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define CONFIGURE_INIT -#include "system.h" -#include - -void print_schedparam( - char *prefix, - struct sched_param *schedparam -) -{ - printf( "%ssched priority = %d\n", prefix, schedparam->sched_priority ); -#if defined(_POSIX_SPORADIC_SERVER) - printf( "%sss_low_priority = %d\n", prefix, schedparam->ss_low_priority ); - printf( "%sss_replenish_period = (%ld, %ld)\n", prefix, - schedparam->ss_replenish_period.tv_sec, - schedparam->ss_replenish_period.tv_nsec ); - printf( "%sss_initial_budget = (%ld, %ld)\n", prefix, - schedparam->ss_initial_budget.tv_sec, - schedparam->ss_initial_budget.tv_nsec ); -#else - printf( "%s_POSIX_SPORADIC_SERVER is not defined\n" ); -#endif -} - -void *POSIX_Init( - void *argument -) -{ - int status; - pthread_attr_t attr; - struct sched_param schedparam; - - puts( "\n\n*** POSIX TEST 12 ***" ); - - /* set the time of day, and print our buffer in multiple ways */ - - set_time( TM_FRIDAY, TM_MAY, 24, 96, 11, 5, 0 ); - - /* get id of this thread */ - - Init_id = pthread_self(); - printf( "Init's ID is 0x%08x\n", Init_id ); - - /* invalid scheduling policy error */ - - puts( "Init: pthread_attr_init - SUCCESSFUL" ); - status = pthread_attr_init( &attr ); - assert( !status ); - - status = pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); - assert( !status ); - attr.schedpolicy = -1; - - puts( "Init: pthread_create - EINVAL (invalid scheduling policy)" ); - status = pthread_create( &Task_id, &attr, Task_1, NULL ); - assert( status == EINVAL ); - - /* replenish period < budget error */ - - puts( "Init: pthread_attr_init - SUCCESSFUL" ); - status = pthread_attr_init( &attr ); - assert( !status ); - - puts( "Init: set scheduling parameter attributes for sporadic server" ); - status = pthread_attr_setschedpolicy( &attr, SCHED_SPORADIC ); - assert( !status ); - - schedparam.ss_replenish_period.tv_sec = 1; - schedparam.ss_replenish_period.tv_nsec = 0; - schedparam.ss_initial_budget.tv_sec = 2; - schedparam.ss_initial_budget.tv_nsec = 0; - - schedparam.sched_priority = 200; - schedparam.ss_low_priority = 100; - - status = pthread_attr_setschedparam( &attr, &schedparam ); - assert( !status ); - - status = pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); - assert( !status ); - - puts( "Init: pthread_create - EINVAL (replenish < budget)" ); - status = pthread_create( &Task_id, &attr, Task_1, NULL ); - assert( status == EINVAL ); - - /* invalid ss_low_priority error */ - - schedparam.ss_replenish_period.tv_sec = 2; - schedparam.ss_replenish_period.tv_nsec = 0; - schedparam.ss_initial_budget.tv_sec = 1; - schedparam.ss_initial_budget.tv_nsec = 0; - - schedparam.sched_priority = 200; - schedparam.ss_low_priority = -1; - - status = pthread_attr_setschedparam( &attr, &schedparam ); - assert( !status ); - - puts( "Init: pthread_create - EINVAL (invalid ss_low_priority)" ); - status = pthread_create( &Task_id, &attr, Task_1, NULL ); - assert( status == EINVAL ); - - /* create a thread as a sporadic server */ - - schedparam.ss_replenish_period.tv_sec = 2; - schedparam.ss_replenish_period.tv_nsec = 0; - schedparam.ss_initial_budget.tv_sec = 1; - schedparam.ss_initial_budget.tv_nsec = 0; - - schedparam.sched_priority = 200; - schedparam.ss_low_priority = 100; - - status = pthread_attr_setschedparam( &attr, &schedparam ); - assert( !status ); - - puts( "Init: pthread_create - SUCCESSFUL" ); - status = pthread_create( &Task_id, &attr, Task_1, NULL ); - assert( !status ); - - status = pthread_join( Task_id, NULL ); - assert( status ); - - /* switch to Task_1 */ - - puts( "*** END OF POSIX TEST 12 ***" ); - rtems_test_exit( 0 ); - - return NULL; /* just so the compiler thinks we returned something */ -} diff --git a/testsuites/psxtests/psx12/psx12.scn b/testsuites/psxtests/psx12/psx12.scn deleted file mode 100644 index e35bdab6ae..0000000000 --- a/testsuites/psxtests/psx12/psx12.scn +++ /dev/null @@ -1,11 +0,0 @@ -*** POSIX TEST 12 *** -Init's ID is 0x0b010001 -Init: pthread_attr_init - SUCCESSFUL -Init: pthread_create - EINVAL (invalid scheduling policy) -Init: pthread_attr_init - SUCCESSFUL -Init: set scheduling parameter attributes for sporadic server -Init: pthread_create - EINVAL (replenish < budget) -Init: pthread_create - EINVAL (invalid ss_low_priority) -Init: pthread_create - SUCCESSFUL -Task_1: exitting -*** END OF POSIX TEST 12 *** diff --git a/testsuites/psxtests/psx12/system.h b/testsuites/psxtests/psx12/system.h deleted file mode 100644 index fc627665b3..0000000000 --- a/testsuites/psxtests/psx12/system.h +++ /dev/null @@ -1,52 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -/* functions */ - -#include - -void *POSIX_Init( - void *argument -); - -void *Task_1( - void *argument -); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 2 -#define CONFIGURE_MAXIMUM_POSIX_KEYS 10 -#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 10 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#include - -/* global variables */ - -#ifdef CONFIGURE_INIT -#define TEST_EXTERN -#else -#define TEST_EXTERN extern -#endif - -TEST_EXTERN pthread_t Init_id; -TEST_EXTERN pthread_t Task_id; - -/* end of include file */ diff --git a/testsuites/psxtests/psx12/task.c b/testsuites/psxtests/psx12/task.c deleted file mode 100644 index 8f04b1285f..0000000000 --- a/testsuites/psxtests/psx12/task.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Task_1 - * - * 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" -#include -#include - -void *Task_1( - void *argument -) -{ - puts( "Task_1: exitting" ); - pthread_exit( NULL ); - - return NULL; /* just so the compiler thinks we returned something */ -} diff --git a/testsuites/psxtests/psx13/.cvsignore b/testsuites/psxtests/psx13/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/psxtests/psx13/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/psxtests/psx13/Makefile.am b/testsuites/psxtests/psx13/Makefile.am deleted file mode 100644 index 3ef5eb2e7a..0000000000 --- a/testsuites/psxtests/psx13/Makefile.am +++ /dev/null @@ -1,41 +0,0 @@ -## -## $Id$ -## - - -TEST = psx13 - -MANAGERS = all - -C_FILES = main.c test.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -DOCTYPES = scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/psxtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -AM_CPPFLAGS += -I$(top_srcdir)/include - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/psxtests/psx13/main.c b/testsuites/psxtests/psx13/main.c deleted file mode 100644 index 6590cc2f24..0000000000 --- a/testsuites/psxtests/psx13/main.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Simple test program -- simplified version of sample test hello. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT - -#include -#include - -void test_main( void ); - -rtems_task Init( - rtems_task_argument ignored -) -{ - test_main(); - rtems_test_exit( 0 ); -} - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM -#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 6 - -#define CONFIGURE_MAXIMUM_TASKS 1 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_INIT - -#include - -/* end of file */ diff --git a/testsuites/psxtests/psx13/psx13.scn b/testsuites/psxtests/psx13/psx13.scn deleted file mode 100644 index 4a012eceaa..0000000000 --- a/testsuites/psxtests/psx13/psx13.scn +++ /dev/null @@ -1,16 +0,0 @@ -*** POSIX TEST 13 *** - -Files initialized successfully. -Testing device_lseek()... Success. -Testing dup()............ Success. ( Add when dup flags resolved ) -Testing dup2()........... Success. -Testing fdatasync()...... Success. -Testing umask().......... Success. -Testing utime().......... Success. -Testing pipe()........... Success. -Testing fsync().......... Success. -Testing pathconf()....... Success. -Testing fpathconf()...... Success. - - -*** END OF TEST PSX13 *** diff --git a/testsuites/psxtests/psx13/test.c b/testsuites/psxtests/psx13/test.c deleted file mode 100644 index e871b11689..0000000000 --- a/testsuites/psxtests/psx13/test.c +++ /dev/null @@ -1,688 +0,0 @@ -/* - * Psx13 - * Chris Bond (working under Jennifer's account) - * - * This test exercises the following routines: - * - * device_lseek - test implemented - * dup - test implemented - * dup2 - test implemented - * fdatasync - test implemented - * fsync - test implemented - * pathconf - test implemented - * fpathconf - test implemented - * pipe - test implemented - * umask - test implemented - * utime - test implemented - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include -#include -#include -#include -#include - -#include - -#include - -/*------------------------------------------------------------------- - * InitFiles function - * - * Initializes the three files to be used in the test. - * - * arguments: none - * assumptions: fopen, fprintf, fwrite, FILE are available - * actions: creates testfile1, a text file with 'a'..'z' listed 4 times. - * creates testfile2, a text file with 'a'..'z' listed 4 times. - * creates testfile3, a binary file with 0..9 listed 4 times. - * returns: TRUE if files opened successfully. - * FALSE if fail on file open for write. - * - * ------------------------------------------------------------------ - */ - -int InitFiles (void) { - - int count; - FILE *fp1, *fp2, *fp3; - char letter; - int number; - int retval; - - fp1 = fopen("testfile1.tst", "wt"); - fp2 = fopen("testfile2.tst", "wt"); - fp3 = fopen("testfile4.tst", "wb"); - - if ((fp1 != NULL) && (fp2 != NULL) && (fp3 !=NULL)) { - - letter = 'a'; - - for (count=0 ; count<(26*4); ++count) { - fprintf (fp1, "%c", letter); - fprintf (fp2, "%c", letter); - - ++letter; - if (letter > 'z') - letter = 'a'; - } - - number = 0; - - for (count = 0; count <40; ++count) { - - fwrite (&number, 1, sizeof(int), fp3); - - ++number; - if (number > 9) - number = 0; - } - - fclose(fp1); - fclose(fp2); - fclose(fp3); - - retval = TRUE; - } - - else - retval = FALSE; - - /* assert (retval == TRUE);*/ - - return (retval); -} - -/* --------------------------------------------------------------- - * DeviceLSeekTest function - * - * Hits the device_lseek code by lseeking on the console. - * - * arguments: none - * assumptions: lseek available - * actions: hits lseek with some dummy arguments. - * returns: value of return from lseek. - * - * --------------------------------------------------------------- - */ - -int DeviceLSeekTest (void) { - - int error = -1, retval = FALSE; - - int fd = open ("/dev/console", O_RDONLY); - - error = lseek(fd, 5, SEEK_SET); - - if (error == 0) - retval = TRUE; - else - retval = FALSE; - - /* assert (retval == TRUE);*/ - - return (retval); - -} - -/* --------------------------------------------------------------- - * DupTest function - * - * Hits the dup code. - * - * arguments: none - * assumptions: dup, open, close, fcntl available. - * actions: Gets a file descriptor(fd1) for test file1. - * dups fd1 to fd2. - * sets fd1 to append mode - * checks fd2 to ensure it's in append mode, also. - * returns: success if fd2 is indeed a copy of fd1. - * - * --------------------------------------------------------------- - */ - -int DupTest(void) { - - int fd1, fd2; - - int flags = 0, retval = FALSE; - - fd1 = open ("testfile1.tst", O_RDONLY); - fd2 = dup(fd1); - - if (fd2 != -1) { - - fcntl(fd1, F_SETFL, O_APPEND); - flags = fcntl(fd2, F_GETFL); - - close (fd1); - - flags = (flags & O_APPEND); - - retval = (flags == O_APPEND); - } - - else - retval = FALSE; - - /* assert (retval == TRUE);*/ - - return (retval); - -} - -/* --------------------------------------------------------------- - * Dup2Test function - * - * Hits the dup2 code. - * - * arguments: none - * assumptions: dup, dup2, open, close, fcntl available. - * actions: Gets a file descriptor(fd1) for test file1. - * dups fd1 to fd2. - * sets fd1 to append mode - * checks fd2 to ensure it's in append mode, also. - * sets fd1 to invalid value, fd2 to valid, tries to dup2. - * sets fd2 to invalid value, fd1 to valid tries to dup2. - * returns: success if fd2 is a copy of fd1, and invalid fd1 or fd2 produce errors. - * - * --------------------------------------------------------------- - */ - -int Dup2Test(void) { - - int fd1, fd2; - - int flags = 0, retval = FALSE; - - int error = 0; - - fd1 = open ("testfile1.tst", O_RDONLY); - fd2 = open ("testfile2.tst", O_RDONLY); - error = dup2(fd1, fd2); - - /* make sure dup2 works if both fd1 and fd2 are valid file descriptors. */ - - if (error != -1) { - - fcntl(fd1, F_SETFL, O_APPEND); - flags = fcntl(fd1, F_GETFL); - - flags = (flags & O_APPEND); - retval = (flags == O_APPEND); - } - - else { - retval = FALSE; - close(fd2); - } - - if (retval == TRUE) { - - /* make sure dup2 fails correctly if one or the other arguments are invalid. */ - /* this assumes -1 is an invalid value for a file descriptor!!! (POSIX book, p.135) */ - - fd1 = -1; - - if (dup2 (fd1, fd2) != -1) - retval = FALSE; - else { - fd1 = dup(fd2); - fd2 = -1; - - if (dup2(fd1, fd2) != -1) - retval = FALSE; - } - } - - close (fd1); - - /* assert (retval == TRUE);*/ - - return (retval); - -} - -/* --------------------------------------------------------------- - * FDataSyncTest function - * - * Hits the fdatasync code. Does NOT test the functionality of the - * underlying fdatasync entry in the IMFS op table. - * - * arguments: none - * assumptions: open, close, fdatasync functions available. - * actions: attempts to fdatasync a file descriptor flagged as read-only. - * attempts to fdatasync an invalid file descriptor (-1). - * attempts to fdatasync a perfectly valid fd opened as RDWR - * - * returns: TRUE if attempt to fdatasync invalid and read-only filed escriptor fail, and fdatasync succeeds on valid fd. - * FALSE otherwise. - * - * --------------------------------------------------------------- - */ - -int FDataSyncTest(void) { - - int fd = -1; - int error = 0, retval = TRUE; - - /* Try it with a RD_ONLY file. */ - - fd = open ("testfile1.tst", O_RDONLY); - - error = fdatasync(fd); - if ((error == -1) && (errno == EINVAL)) - retval = TRUE; - else - retval = FALSE; - - close (fd); - - if (retval == TRUE) { - - /* Try it with a bad file descriptor */ - - fd = -1; - - error = fdatasync(fd); - if ((errno == EBADF) && (error == -1)) - retval = TRUE; - else - retval = FALSE; - } - - /* Okay - now the success case... */ - - if (retval == TRUE) { - fd = open ("testfile1.tst", O_RDWR); - error = fdatasync(fd); - - if (error == 0) - retval = TRUE; - else - retval = FALSE; - - close (fd); - - } - - /* assert (retval == TRUE);*/ - - return (retval); -} - -/* --------------------------------------------------------------- - * UMaskTest function - * - * Hits the umask code. - * - * arguments: none - * assumptions: umask function available. - * actions: set umask to 0ctal 23. - * set umask to Octal 22, retrieve the old value. - * - * returns: TRUE if old value is 23, - * FALSE otherwise. - * - * --------------------------------------------------------------- - */ - -int UMaskTest (void) { - - int error = 0, retval = FALSE; - - umask (023); - error = umask(022); - - if (error == 023) - retval = TRUE; - else - retval = FALSE; - - /* assert (retval == TRUE);*/ - - return(retval); - -} - -/* --------------------------------------------------------------- - * UTimeTest function - * - * Hits the utime code. Does NOT test the functionality of the underlying utime - * entry in the IMFS op table. - * - * arguments: none - * assumptions: utime function available. - * actions: set utime for an invalid filename. - * set utime for a valid filename. - * - * returns: TRUE if time on valid file is set correctly and utime failed on an invaid filename. - * FALSE otherwise. - * - * --------------------------------------------------------------- - */ - -int UTimeTest (void) { - - int error = 0, retval = FALSE; - struct utimbuf time; - struct stat fstat; - - /* First, an invalid filename. */ - error = utime("!This is an =invalid p@thname!!! :)", NULL); - - if (error == -1) - retval = TRUE; - else - retval = FALSE; - - /* Now, the success test. */ - if (retval == TRUE) { - - time.actime = 12345; - time.modtime = 54321; - - error = utime("testfile1.tst", &time); - - if (error == 0) { - - /* But, did it set the time? */ - stat ("testfile1.tst", &fstat); - - if ((fstat.st_atime == 12345) && (fstat.st_mtime == 54321 )) - retval = TRUE; - else - retval = FALSE; - } - - else - retval = FALSE; - } - - /* assert (retval == TRUE);*/ - - return (retval); - -} - -/* --------------------------------------------------------------- - * PipeTest function - * - * Hits the pipe code. - * - * arguments: none - * assumptions: pipe function available. - * actions: call pipe. - * - * returns: TRUE if pipe retuens ENOSYS, - * FALSE otherwise. - * - * --------------------------------------------------------------- - */ - -int PipeTest (void) { - - int error = 0, retval = FALSE; - int fd[2]; - - error = pipe(fd); - - if ((error == -1) && (errno == ENOSYS)) - retval = TRUE; - else - retval = FALSE; - - /* assert (retval == TRUE);*/ - - return(retval); - -} - -/* --------------------------------------------------------------- - * PathConfTest function - * - * Hits the pathconf code. - * - * arguments: none - * assumptions: pathconf function available. - * actions: Try to pathconf a bad filename. - * Try to pathconf a good filename. - * - * returns: TRUE if pathconf fails on bad file, succeeds on good file. - * FALSE otherwise. - * - * --------------------------------------------------------------- - */ - -int PathConfTest (void) { - - int error = 0, retval = FALSE; - - error = pathconf("thisfiledoesnotexist", _PC_LINK_MAX); - - if (error == -1) { - error = pathconf("testfile1.tst", _PC_LINK_MAX); - - if (error != -1) - retval = TRUE; - else - retval = FALSE; - } - - else - retval = FALSE; - - /* assert (retval == TRUE);*/ - - return(retval); - -} - -/* --------------------------------------------------------------- - * FPathConfTest function - * - * Hits the fpathconf code. - * - * arguments: none - * assumptions: fpathconf function available. - * actions: Call fpathconf with all arguments, plus an invalid. - * - * returns: TRUE always. - * - * --------------------------------------------------------------- - */ - -int FPathConfTest (void) { - - int error = 0, retval = TRUE; - - int fd = -1; - - error = fpathconf(fd, _PC_LINK_MAX); - - if (error == -1) { - fd = open("testfile1.tst", O_RDWR); - - error = fpathconf(fd, _PC_LINK_MAX); - error = fpathconf(fd, _PC_MAX_CANON); - error = fpathconf(fd, _PC_MAX_INPUT); - error = fpathconf(fd, _PC_NAME_MAX); - error = fpathconf(fd, _PC_PATH_MAX); - error = fpathconf(fd, _PC_PIPE_BUF); - error = fpathconf(fd, _PC_CHOWN_RESTRICTED); - error = fpathconf(fd, _PC_NO_TRUNC); - error = fpathconf(fd, _PC_VDISABLE); - error = fpathconf(fd, _PC_ASYNC_IO); - error = fpathconf(fd, _PC_PRIO_IO); - error = fpathconf(fd, _PC_SYNC_IO); - error = fpathconf(fd, 255); - - retval = TRUE; - } - - else - retval = FALSE; - - /* assert (retval == TRUE);*/ - - return(retval); - -} - -/* --------------------------------------------------------------- - * FSyncTest function - * - * Hits the fsync code. - * - * arguments: none - * assumptions: open, fsync functions available. - * actions: open test file, - * try to fsync it. - * - * returns: TRUE if fsync doesn't return -1, - * FALSE otherwise. - * - * --------------------------------------------------------------- - */ - -int FSyncTest (void) { - - int error = 0, retval = FALSE; - int fd = -1; - - fd = open("testfile1.tst", O_RDWR); - - if (fd != -1) { - - error = fsync(fd); - - if (error != -1) - retval = TRUE; - else - retval = FALSE; - - close(fd); - } - - else - retval = FALSE; - - /* assert (retval == TRUE);*/ - - return(retval); - -} - -/* --------------------------------------------------------------- - * Main function - * - * main entry point to the test - * - * --------------------------------------------------------------- - */ - -#if defined(__rtems__) -int test_main(void) -#else -int main( - int argc, - char **argv -) -#endif -{ - puts( "*** POSIX TEST 13 ***" ); - - if (InitFiles() == TRUE) { - printf ("\nFiles initialized successfully.\n"); - - printf ("Testing device_lseek()... "); - if (DeviceLSeekTest() == TRUE) - printf ("Success.\n"); - else - printf ("Failed!!!\n"); - - printf ("Testing dup()............ "); - if (DupTest() == TRUE) - printf ("Success.\n"); - else - printf ("Failed!!!\n"); - - printf ("Testing dup2()........... "); - if (Dup2Test() == TRUE) - printf ("Success.\n"); - else - printf ("Failed!!!\n"); - - printf ("Testing fdatasync()...... "); - if (FDataSyncTest() == TRUE) - printf ("Success.\n"); - else - printf ("Failed!!!\n"); - - printf ("Testing umask().......... "); - if (UMaskTest() == TRUE) - printf ("Success.\n"); - else - printf ("Failed!!!\n"); - - printf ("Testing utime().......... "); - if (UTimeTest() == TRUE) - printf ("Success.\n"); - else - printf ("Failed!!!\n"); - - printf ("Testing pipe()........... "); - if (PipeTest() == TRUE) - printf ("Success.\n"); - else - printf ("Failed!!!\n"); - - printf ("Testing fsync().......... "); - if (FSyncTest() == TRUE) - printf ("Success.\n"); - else - printf ("Failed!!!\n"); - - printf ("Testing pathconf()....... "); - if (PathConfTest() == TRUE) - printf ("Success.\n"); - else - printf ("Failed!!!\n"); - - printf ("Testing fpathconf()...... "); - if (FPathConfTest() == TRUE) - printf ("Success.\n"); - else - printf ("Failed!!!\n"); - } - - - else - printf ("\n\nError opening files for write!!!!\n"); - - printf( "\n\n*** END OF TEST PSX13 ***" ); - rtems_test_exit(0); -} - - - - - - - - - - - - - diff --git a/testsuites/psxtests/psxcancel/.cvsignore b/testsuites/psxtests/psxcancel/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/psxtests/psxcancel/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/psxtests/psxcancel/Makefile.am b/testsuites/psxtests/psxcancel/Makefile.am deleted file mode 100644 index 095c2a1ba7..0000000000 --- a/testsuites/psxtests/psxcancel/Makefile.am +++ /dev/null @@ -1,44 +0,0 @@ -## -## $Id$ -## - - -TEST = psxcancel - -MANAGERS = all - -C_FILES = init.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/psxtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -AM_CPPFLAGS += -I$(top_srcdir)/include - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/psxtests/psxcancel/init.c b/testsuites/psxtests/psxcancel/init.c deleted file mode 100644 index cbd69925b4..0000000000 --- a/testsuites/psxtests/psxcancel/init.c +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Thread Test Program - * - * - test of POSIX's pthread_init() function from rtemstask Init() - * - * ott@linux.thai.net - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - - -#include -#include -#include -#include - -#ifdef __rtems__ -#include -/* configuration information */ - -#define CONFIGURE_INIT - -#include -#include -#include - -#include /* for device driver prototypes */ -#include - -rtems_task Init( rtems_task_argument argument); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 3 -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE -#define CONFIGURE_EXTRA_TASK_STACKS (3 * RTEMS_MINIMUM_STACK_SIZE) - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 5 -#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 5 -#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 5 - -#include -#include - -#endif /* __rtems__ */ - -void countTaskDeferred() { - int i=0; - int type,state; - - pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &type); - pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &state); - while (1) { - printf("countTaskDeferred: elapsed time (second): %2d\n", i++ ); - sleep(1); - pthread_testcancel(); - } -} - -void countTaskAsync() { - int i=0; - int type,state; - - pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &type); - pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &state); - while (1) { - printf("countTaskAsync: elapsed time (second): %2d\n", i++ ); - sleep(1); - } -} - -#ifdef __linux__ -int main(){ -#else - rtems_task Init( rtems_task_argument ignored ) { -#endif - - pthread_t count; - int taskparameter = 0; - - puts( "\n\n*** POSIX CANCEL TEST ***" ); - - /* Start countTask deferred */ - { - int task_ret; - task_ret = pthread_create(&count, NULL, (void *) countTaskDeferred, (void *) &taskparameter); - if (task_ret) { - perror("pthread_create: countTask"); - rtems_test_exit(EXIT_FAILURE); - } - /* sleep for 5 seconds, then cancel it */ - sleep(5); - pthread_cancel(count); - pthread_join(count,NULL); - } - - /* Start countTask asynchronous */ - { - int task_ret; - task_ret = pthread_create(&count, NULL, (void *) countTaskAsync, (void *) &taskparameter); - if (task_ret) { - perror("pthread_create: countTask"); - rtems_test_exit(EXIT_FAILURE); - } - /* sleep for 5 seconds, then cancel it */ - sleep(5); - pthread_cancel(count); - pthread_join(count,NULL); - } - - - puts( "*** END OF POSIX CANCEL TEST ***" ); - -#ifdef __linux__ - return 0; -#else - rtems_test_exit(EXIT_SUCCESS); -#endif -} - diff --git a/testsuites/psxtests/psxcancel/psxcancel.scn b/testsuites/psxtests/psxcancel/psxcancel.scn deleted file mode 100644 index bb5c7d58e0..0000000000 --- a/testsuites/psxtests/psxcancel/psxcancel.scn +++ /dev/null @@ -1,14 +0,0 @@ - - -*** POSIX CANCEL TEST *** -countTaskDeferred: elapsed time (second): 0 -countTaskDeferred: elapsed time (second): 1 -countTaskDeferred: elapsed time (second): 2 -countTaskDeferred: elapsed time (second): 3 -countTaskDeferred: elapsed time (second): 4 -countTaskAsync: elapsed time (second): 0 -countTaskAsync: elapsed time (second): 1 -countTaskAsync: elapsed time (second): 2 -countTaskAsync: elapsed time (second): 3 -countTaskAsync: elapsed time (second): 4 -*** END OF POSIX CANCEL TEST *** diff --git a/testsuites/psxtests/psxchroot01/.cvsignore b/testsuites/psxtests/psxchroot01/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/psxtests/psxchroot01/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/psxtests/psxchroot01/Makefile.am b/testsuites/psxtests/psxchroot01/Makefile.am deleted file mode 100644 index 496a61afa7..0000000000 --- a/testsuites/psxtests/psxchroot01/Makefile.am +++ /dev/null @@ -1,41 +0,0 @@ -## -## $Id$ -## - - -TEST = psxchroot01 - -MANAGERS = all - -C_FILES = main.c test.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -DOCTYPES = scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/psxtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -AM_CPPFLAGS += -I$(top_srcdir)/include - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/psxtests/psxchroot01/main.c b/testsuites/psxtests/psxchroot01/main.c deleted file mode 100644 index 4ce4bae422..0000000000 --- a/testsuites/psxtests/psxchroot01/main.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Simple test program -- simplified version of sample test hello. - */ - -#define TEST_INIT - -#include -#include - -void test_main( void ); - -rtems_task Init( - rtems_task_argument ignored -) -{ - test_main(); - rtems_test_exit( 0 ); -} - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER - -#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM -#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 10 - -#define CONFIGURE_MAXIMUM_TASKS 1 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_INIT - -#include - -/* end of file */ diff --git a/testsuites/psxtests/psxchroot01/psxchroot01.scn b/testsuites/psxtests/psxchroot01/psxchroot01.scn deleted file mode 100644 index 519f2735b8..0000000000 --- a/testsuites/psxtests/psxchroot01/psxchroot01.scn +++ /dev/null @@ -1,9 +0,0 @@ - - -*** CHROOT01 TEST *** -SUCCESS on /one/one.test -SUCCESS on /two/two.test -Reset the private environment -SUCCESS on /one/one.test -SUCCESS on /two/two.test -*** END OF CHROOT01 TEST *** diff --git a/testsuites/psxtests/psxchroot01/test.c b/testsuites/psxtests/psxchroot01/test.c deleted file mode 100644 index 6f7ebb8e89..0000000000 --- a/testsuites/psxtests/psxchroot01/test.c +++ /dev/null @@ -1,123 +0,0 @@ -/* - * This is a native test to explore how the readdir() family works. - * Newlib supports the following readdir() family members: - * - * closedir() - - * readdir() - - * scandir() - - * opendir() - - * rewinddir() - - * telldir() - BSD not in POSIX - * seekdir() - BSD not in POSIX - * - * - * seekdir() takes an offset which is a byte offset. The Linux - * implementation of this appears to seek to the ((off/DIRENT_SIZE) + 1) - * record where DIRENT_SIZE seems to be 12 bytes. - * - * - * - * $Id$ - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -void touch( char *file ) -{ - int fd; - - assert( file ); - - fd = open( file, O_RDWR|O_CREAT, 0777 ); - assert( fd != -1 ); - close( fd ); -} - -int fileexists( char *file ) -{ - int status; - struct stat statbuf; - - assert( file ); - - status = stat( file, &statbuf ); - - if ( status == -1 ) { - /* printf( ": %s\n", strerror( errno ) ); */ - return 0; - } - return 1; -} - -#if defined(__rtems__) -int test_main(void) -#else -int main( - int argc, - char **argv -) -#endif -{ - int fd; - int i; - int status; - struct stat s; - -/* - * This test is the C equivalent of this sequence. -#mkdir /one -#mkdir /one/one -#touch /one/one.test -#touch /one/two/two.test -#chroot /one -#if !fileexists(/one/one.test) echo "SUCCESSFUL" -#if fileexists(/two/two.test) echo "SUCCESSFUL" -#rtems_set_private_env() ! reset at the global environment -#if fileexists(/one/one.test) echo "SUCESSFUL" -#if !fileexists(/two/two.test) echo "SUCCESSFUL" -*/ - - printf( "\n\n*** CHROOT01 TEST ***\n" ); - - status = mkdir( "/one", 0777); - assert( status == 0 ); - - status = mkdir( "/one/one", 0777); - assert( status == 0 ); - - status = mkdir( "/one/two", 0777); - assert( status == 0 ); - - touch( "/one/one.test" ); - touch( "/one/two/two.test" ); - - status = chroot( "/one" ); - assert( status == 0 ); - - status = fileexists( "/one/one.test" ); - printf( "%s on /one/one.test\n", (!status) ? "SUCCESS" : "FAILURE" ); - - status = fileexists( "/two/two.test" ); - printf( "%s on /two/two.test\n", (status) ? "SUCCESS" : "FAILURE" ); - - puts( "Reset the private environment" ); - rtems_libio_set_private_env(); - - status = fileexists( "/one/one.test" ); - printf( "%s on /one/one.test\n", ( status) ? "SUCCESS" : "FAILURE" ); - - status = fileexists( "/two/two.test" ); - printf( "%s on /two/two.test\n", (!status) ? "SUCCESS" : "FAILURE" ); - - printf( "*** END OF CHROOT01 TEST ***\n" ); - rtems_test_exit(0); -} - diff --git a/testsuites/psxtests/psxfile01/.cvsignore b/testsuites/psxtests/psxfile01/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/psxtests/psxfile01/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/psxtests/psxfile01/Makefile.am b/testsuites/psxtests/psxfile01/Makefile.am deleted file mode 100644 index 6245d6c7c5..0000000000 --- a/testsuites/psxtests/psxfile01/Makefile.am +++ /dev/null @@ -1,41 +0,0 @@ -## -## $Id$ -## - - -TEST = psxfile01 - -MANAGERS = all - -C_FILES = main.c test.c test_cat.c test_extend.c test_write.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -DOCTYPES = scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/psxtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -AM_CPPFLAGS += -I$(top_srcdir)/include - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/psxtests/psxfile01/main.c b/testsuites/psxtests/psxfile01/main.c deleted file mode 100644 index 6590cc2f24..0000000000 --- a/testsuites/psxtests/psxfile01/main.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Simple test program -- simplified version of sample test hello. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT - -#include -#include - -void test_main( void ); - -rtems_task Init( - rtems_task_argument ignored -) -{ - test_main(); - rtems_test_exit( 0 ); -} - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM -#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 6 - -#define CONFIGURE_MAXIMUM_TASKS 1 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_INIT - -#include - -/* end of file */ diff --git a/testsuites/psxtests/psxfile01/psxfile01.scn b/testsuites/psxtests/psxfile01/psxfile01.scn deleted file mode 100644 index 6c4e7ef25b..0000000000 --- a/testsuites/psxtests/psxfile01/psxfile01.scn +++ /dev/null @@ -1,208 +0,0 @@ -NOTE: If you get the following assertion, then your target does not -have enough memory in the heap used by malloc to allocate all the -files used during this test: - -assertion "memory" failed: file "...../c/src/lib/libc/memfile.c", line 340 - -*** FILE TEST 1 *** -*************** Dump of Entire IMFS *************** -/ -....dev/ -........console (device 0, 0) -*************** End of Dump *************** -stat of /dev/console -....st_dev (0x0:0x0) -....st_ino 3 may vary by small amount -....mode = 00020771 -....nlink = 1 -....uid = 0 -....gid = 0 -....atime = Fri Jan 1 00:00:00 1988 -....mtime = Fri Jan 1 00:00:00 1988 -....ctime = Fri Jan 1 00:00:00 1988 - -mkdir /dev/tty - -mkdir /usr -mkdir /etc -mkdir /tmp -mkdir /tmp/.. -mkdir /tmp/ -mkdir /j/j1 -mkdir tmp - -rmdir /usr -rmdir /dev -rmdir /fred -mknod /dev/test_console -mknod /dev/tty/S3 -mknod /etc/passwd -mkdir /tmp/my_dir -mkfifo /c/my_dir -mkdir /etc/passwd/j -open /tmp/joel - should fail with ENOENT -open /tmp/j -open returned file descriptor 3 -close /tmp/j -close /tmp/j again -unlink /tmp/j -unlink /tmp -create and close /tmp/tom -Attempt to recreate /tmp/tom -create /tmp/john -tcdrain /tmp/john -mknod /tmp/joel -(0)the first write!!! - -(10)the first write!!! - -stat( /tmp/joel ) returned -....st_dev (0x0:0x0) -....st_ino 10 may vary by small amount -....mode = 00100700 -....nlink = 1 -....uid = 0 -....gid = 0 -....atime = Sat Dec 31 09:00:00 1988 -....mtime = Sat Dec 31 09:00:00 1988 -....ctime = Sat Dec 31 09:00:00 1988 -unlink /tmp/joel -unlink /tmp/joel -mknod /tmp/joel -(514)the first write!!! - -(513)the first write!!! - -(24)the first write!!! - -(2)the first write!!! - -(1)the first write!!! - -(0)the first write!!! - -(0)rst write!!! - -(513)the first write!!! - -(139743) -stat( /tmp/joel ) returned -....st_dev (0x0:0x0) -....st_ino 11 may vary by small amount -....mode = 00100700 -....nlink = 1 -....uid = 0 -....gid = 0 -....atime = Sat Dec 31 09:00:00 1988 -....mtime = Sat Dec 31 09:00:00 1988 -....ctime = Sat Dec 31 09:00:00 1988 -stat of /tmp/j -stat(/tmp/j) returned -1 (errno=2) -....st_dev (0x0:0x0) -....st_ino 3 may vary by small amount -....mode = 00020771 -....nlink = 1 -....uid = 0 -....gid = 0 -....atime = Fri Jan 1 00:00:00 1988 -....mtime = Fri Jan 1 00:00:00 1988 -....ctime = Fri Jan 1 00:00:00 1988 -fopen of /tmp/j -fprintf to /tmp/j -(1) 26 characters written to the file -(2) 26 characters written to the file -(3) 26 characters written to the file -(4) 26 characters written to the file -(5) 26 characters written to the file -....st_dev (0x0:0x0) -....st_ino 12 may vary by small amount -....mode = 00100660 -....nlink = 1 -....uid = 0 -....gid = 0 -....atime = Sat Dec 31 09:00:00 1988 -....mtime = Sat Dec 31 09:00:00 1988 -....ctime = Sat Dec 31 09:00:00 1988 -This is call 1 to fprintf -This is call 2 to fprintf -This is call 3 to fprintf -This is call 4 to fprintf -This is call 5 to fprintf -....st_dev (0x0:0x0) -....st_ino 12 may vary by small amount -....mode = 00100660 -....nlink = 1 -....uid = 0 -....gid = 0 -....atime = Sat Dec 31 09:00:01 1988 -....mtime = Sat Dec 31 09:00:00 1988 -....ctime = Sat Dec 31 09:00:00 1988 -*************** Dump of Entire IMFS *************** -/ -....dev/ -........console (device 0, 0) -........tty/ -............S3 (device 255, 128) -........test_console (device 0, 0) -....etc/ -........passwd (file 0) -....tmp/ -........my_dir/ -........tom (file 0) -........john (file 0) -........joel (file 279487) -........j (file 130) -*************** End of Dump *************** -truncate /tmp/j to length of 40 -....st_dev (0x0:0x0) -....st_ino 12 may vary by small amount -....mode = 00100660 -....nlink = 1 -....uid = 0 -....gid = 0 -....atime = Sat Dec 31 09:00:02 1988 -....mtime = Sat Dec 31 09:00:00 1988 -....ctime = Sat Dec 31 09:00:00 1988 -*************** Dump of Entire IMFS *************** -/ -....dev/ -........console (device 0, 0) -........tty/ -............S3 (device 255, 128) -........test_console (device 0, 0) -....etc/ -........passwd (file 0) -....tmp/ -........my_dir/ -........tom (file 0) -........john (file 0) -........j (file 40) -*************** End of Dump *************** -truncate /tmp/j to length of 0 -truncate /tmp to length of 0 should fail with EISDIR - -21: Is a directory -*************** Dump of Entire IMFS *************** -/ -....dev/ -........console (device 0, 0) -........tty/ -............S3 (device 255, 128) -........test_console (device 0, 0) -....etc/ -........passwd (file 0) -....tmp/ -........my_dir/ -........tom (file 0) -........john (file 0) -........j (file 0) -*************** End of Dump *************** -Writing First File -Writing Second File -(0)this is a test line -this is a test line - -(0)this is a test line -this is a test line -*** END OF FILE TEST 1 *** - diff --git a/testsuites/psxtests/psxfile01/test.c b/testsuites/psxtests/psxfile01/test.c deleted file mode 100644 index eb23ff5667..0000000000 --- a/testsuites/psxtests/psxfile01/test.c +++ /dev/null @@ -1,547 +0,0 @@ -/* - * Simple test program to exercise some of the basic functionality of - * POSIX Files and Directories Support. - * - * This test assumes that the file system is initialized with the - * following directory structure: - * - * XXXX fill this in. - * / - * /dev - * /dev/XXX [where XXX includes at least console] - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -void test_case_reopen_append(void); - -char test_write_buffer[ 1024 ]; - -/* - * File test support routines. - */ - -void test_cat( - char *file, - int offset_arg, - int length -); - -void test_write( - char *file, - off_t offset, - char *buffer -); - -void test_extend( - char *file, - off_t new_len -); - -void IMFS_dump( void ); -int IMFS_memfile_maximum_size( void ); - -/* - * dump_statbuf - */ - -void dump_statbuf( struct stat *buf ) -{ - int major1; - int minor1; - int major2; - int minor2; - - rtems_filesystem_split_dev_t( buf->st_dev, major1, minor1 ); - rtems_filesystem_split_dev_t( buf->st_rdev, major2, minor2 ); - - printf( "....st_dev (0x%x:0x%x)\n", major1, minor1 ); - printf( "....st_ino %x may vary by small amount\n", - (unsigned int) buf->st_ino ); - printf( "....mode = %08o\n", buf->st_mode ); - printf( "....nlink = %d\n", buf->st_nlink ); - - printf( "....uid = %d\n", buf->st_uid ); - printf( "....gid = %d\n", buf->st_gid ); - - printf( "....atime = %s", ctime(&buf->st_atime) ); - printf( "....mtime = %s", ctime(&buf->st_mtime) ); - printf( "....ctime = %s", ctime(&buf->st_ctime) ); - -#if defined(__svr4__) && !defined(__PPC__) && !defined(__sun__) - printf( "....st_blksize %x\n", buf.st_blksize ); - printf( "....st_blocks %x\n", buf.st_blocks ); -#endif - -} - -void stat_a_file( - const char *file -) -{ - int status; - struct stat statbuf; - - assert( file ); - - printf( "stat( %s ) returned ", file ); - fflush( stdout ); - - status = stat( file, &statbuf ); - - if ( status == -1 ) { - printf( ": %s\n", strerror( errno ) ); - } else { - puts(""); - dump_statbuf( &statbuf ); - } - -} - - -/* - * Main entry point of the test - */ - -#if defined(__rtems__) -int test_main(void) -#else -int main( - int argc, - char **argv -) -#endif -{ - int status; - int max_size; - int fd; - int i; - struct stat buf; - char buffer[128]; - FILE *file; - time_t atime1; - time_t mtime1; - time_t ctime1; - time_t atime2; - time_t mtime2; - time_t ctime2; - rtems_status_code rtems_status; - rtems_time_of_day time; - - printf( "\n\n*** FILE TEST 1 ***\n" ); - - /* - * Grab the maximum size of an in-memory file. - */ - - max_size = IMFS_memfile_maximum_size(); - - build_time( &time, 12, 31, 1988, 9, 0, 0, 0 ); - rtems_status = rtems_clock_set( &time ); - - /* - * Dump an empty file system - */ - - IMFS_dump(); - - /* - * Simple stat() of /dev/console. - */ - - puts( "stat of /dev/console" ); - status = stat( "/dev/console", &buf ); - assert( !status ); - - dump_statbuf( &buf ); - - /* - * Exercise mkdir() and some path evaluation. - */ - - puts( "" ); - puts( "mkdir /dev/tty" ); - status = mkdir( "/dev/tty", S_IRWXU ); - assert( !status ); - - puts( "" ); - puts( "mkdir /usr" ); - status = mkdir( "/usr", S_IRWXU ); - assert( !status ); - puts( "mkdir /etc" ); - status = mkdir( "/etc", S_IRWXU ); - assert( !status ); - - puts( "mkdir /tmp" ); - status = mkdir( "/tmp", S_IRWXU ); - assert( !status ); - - /* this tests the ".." path in path name evaluation */ - puts( "mkdir /tmp/.." ); - status = mkdir( "/tmp/..", S_IRWXU ); - assert( status == -1 ); - assert( errno == EEXIST ); - - /* now check out trailing separators */ - puts( "mkdir /tmp/" ); - status = mkdir( "/tmp/", S_IRWXU ); - assert( status == -1 ); - assert( errno == EEXIST ); - - /* try to make a directory under a non-existent subdirectory */ - puts( "mkdir /j/j1" ); - status = mkdir( "/j/j1", S_IRWXU ); - assert( status == -1 ); - assert( errno == ENOENT ); - - /* this tests the ability to make a directory in the current one */ - puts( "mkdir tmp" ); - status = mkdir( "tmp", S_IRWXU ); - assert( status == -1 ); - assert( errno == EEXIST ); - - /* test rtems_filesystem_evaluate_path by sending NULL path */ - status = chdir( NULL ); - assert( status == -1 ); - - /* - * Now switch gears and exercise rmdir(). - */ - - puts( "" ); - puts( "rmdir /usr" ); - status = rmdir( "/usr" ); - assert( !status ); - - puts( "rmdir /dev" ); - status = rmdir( "/dev" ); - assert( status == -1 ); - assert( errno == ENOTEMPTY); - - puts( "rmdir /fred" ); - status = rmdir ("/fred"); - assert (status == -1); - assert( errno == ENOENT ); - - puts( "mknod /dev/test_console" ); - status = mknod( "/dev/test_console", S_IFCHR, 0LL ); - assert( !status ); - - puts( "mknod /dev/tty/S3" ); - status = mknod( "/dev/tty/S3", S_IFCHR, 0xFF00000080LL ); - assert( !status ); - - puts ("mknod /etc/passwd"); - status = mknod( "/etc/passwd", (S_IFREG | S_IRWXU), 0LL ); - assert( !status ); - - puts( "mkdir /tmp/my_dir"); - status = mkdir( "/tmp/my_dir", S_IRWXU ); - assert( status == 0 ); - - puts("mkfifo /c/my_dir" ); - status = mkfifo( "/c/my_dir", S_IRWXU ); - assert( status == -1 ); - - /* - * Try to make a directory under a file -- ERROR - */ - - puts( "mkdir /etc/passwd/j" ); - status = mkdir( "/etc/passwd/j", S_IRWXU ); - assert( status == -1 ); - assert( errno == ENOTDIR ); - - /* - * Simple open failure case on non-existent file - */ - - puts( "open /tmp/joel - should fail with ENOENT" ); - fd = open( "/tmp/joel", O_RDONLY ); - assert( fd == -1 ); - assert( errno == ENOENT ); - - /* - * Simple open case where the file is created. - */ - - puts( "open /tmp/j" ); - fd = open( "/tmp/j", O_RDWR|O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO ); - assert( fd != -1 ); - printf( "open returned file descriptor %d\n", fd ); - - puts( "close /tmp/j" ); - status = close( fd ); - assert( !status ); - - puts( "close /tmp/j again" ); - status = close( fd ); - assert( status == -1 ); - - puts( "unlink /tmp/j" ); - status = unlink( "/tmp/j" ); - assert( !status ); - - puts( "unlink /tmp" ); - status = unlink( "/tmp" ); - assert( status ); - - /* - * Simple open failure. Trying to create an existing file. - */ - - puts("create and close /tmp/tom"); - fd = open( "/tmp/tom", O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO ); - assert( fd != -1 ); - status = close( fd ); - assert( status == 0 ); - - puts("Attempt to recreate /tmp/tom"); - fd = open( "/tmp/tom", O_CREAT | O_EXCL, S_IRWXU|S_IRWXG|S_IRWXO ); - assert( fd == -1 ); - assert( errno == EEXIST ); - - puts("create /tmp/john"); - fd = open( "/tmp/john", O_RDWR|O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO ); - assert( fd != -1 ); - - puts("tcdrain /tmp/john" ); - status = tcdrain( fd ); - assert( status == 0 ); - - /* - * Test simple write to a file at offset 0 - */ - - puts( "mknod /tmp/joel" ); - status = mknod( "/tmp/joel", (S_IFREG | S_IRWXU), 0LL ); - test_write( "/tmp/joel", 0, "the first write!!!\n" ); - test_cat( "/tmp/joel", 0, 0 ); - - /* - * Test simple write to a file at a non-0 offset in the first block - */ - - status = unlink( "/tmp/joel" ); - assert( !status ); - - status = mknod( "/tmp/joel", (S_IFREG | S_IRWXU), 0LL ); - assert( !status ); - - test_write( "/tmp/joel", 10, "the first write!!!\n" ); - test_cat( "/tmp/joel", 0, 0 ); - stat_a_file( "/tmp/joel" ); - - /* - * Test simple write to a file at a non-0 offset in the second block. Then - * try to read from various offsets and lengths. - */ - - puts("unlink /tmp/joel"); - status = unlink( "/tmp/joel" ); - assert( !status ); - - /* Test a failure path */ - - puts( "unlink /tmp/joel" ); - status = unlink( "/tmp/joel" ); - assert( status == -1 ); - - puts( "mknod /tmp/joel"); - status = mknod( "/tmp/joel", (S_IFREG | S_IRWXU), 0LL ); - assert( !status ); - - test_write( "/tmp/joel", 514, "the first write!!!\n" ); - test_write( "/tmp/joel", 1, test_write_buffer ); - test_write( "/tmp/joel", 63, test_write_buffer ); - test_cat( "/tmp/joel", 0, 1 ); - test_cat( "/tmp/joel", 1, 1 ); - test_cat( "/tmp/joel", 490, 1 ); - test_cat( "/tmp/joel", 512, 1 ); - test_cat( "/tmp/joel", 513, 1 ); - test_cat( "/tmp/joel", 514, 1 ); - test_cat( "/tmp/joel", 520, 1 ); - test_cat( "/tmp/joel", 1, 1024 ); - - /* - * Read from a much longer file so we can descend into doubly and - * triply indirect blocks. - */ - - if ( max_size < 300 * 1024 ) { - test_extend( "/tmp/joel", max_size - 1 ); - test_cat( "/tmp/joel", max_size / 2, 1024 ); - } else { - printf( "Skipping maximum file size test since max_size is %d bytes\n", max_size ); - puts("That is likely to be bigger than the available RAM on many targets." ); - } - - stat_a_file( "/tmp/joel" ); - - /* - * Now try to use a FILE * descriptor - * - * /tmp/j should not exist at this point. - */ - - puts( "stat of /tmp/j" ); - errno = 0; - status = stat( "/tmp/j", &buf ); - printf( "stat(/tmp/j) returned %d (errno=%d)\n", status, errno ); - dump_statbuf( &buf ); - - puts( "fopen of /tmp/j" ); - file = fopen( "/tmp/j", "w+" ); - assert( file ); - - puts( "fprintf to /tmp/j" ); - for (i=1 ; i<=5 ; i++) { - status = fprintf( file, "This is call %d to fprintf\n", i ); - assert( status ); - printf( "(%d) %d characters written to the file\n", i, status ); - } - - fflush( file ); - - status = stat( "/tmp/j", &buf ); - assert( !status ); - dump_statbuf( &buf ); - atime2 = buf.st_atime; - mtime2 = buf.st_mtime; - ctime2 = buf.st_ctime; - - - status = rtems_task_wake_after( 1 * TICKS_PER_SECOND ); - rewind( file ); - while ( fgets(buffer, 128, file) ) - printf( "%s", buffer ); - - /* - * Verify only atime changed for a read. - */ - status = stat( "/tmp/j", &buf ); - assert( !status ); - dump_statbuf( &buf ); - atime1 = buf.st_atime; - mtime1 = buf.st_mtime; - ctime1 = buf.st_ctime; - assert( atime1 != atime2); - assert( mtime1 == mtime2); - assert( ctime1 == ctime2); - - IMFS_dump(); - - unlink( "/tmp/joel" ); - - /* - * Now truncate a file - */ - - status = rtems_task_wake_after( 1 * TICKS_PER_SECOND ); - puts( "truncate /tmp/j to length of 40" ); - status = truncate( "/tmp/j", 40 ); - assert( !status ); - - /* - * Verify truncate changed only atime. - */ - status = stat( "/tmp/j", &buf ); - assert( !status ); - dump_statbuf( &buf ); - atime2 = buf.st_atime; - mtime2 = buf.st_mtime; - ctime2 = buf.st_ctime; - assert( atime1 != atime2); - assert( mtime1 == mtime2); - assert( ctime1 == ctime2); - - IMFS_dump(); - - /* try to truncate the console and see what happens */ - status = truncate( "/dev/console", 40 ); - assert(status == -1 ); - - puts( "truncate /tmp/j to length of 0" ); - status = truncate( "/tmp/j", 0 ); - assert( !status ); - - puts( "truncate /tmp to length of 0 should fail with EISDIR\n"); - status = truncate( "/tmp", 0 ); - assert( status == -1 ); - printf( "%d: %s\n", errno, strerror( errno ) ); - assert( errno == EISDIR ); - - IMFS_dump(); - - status = truncate( "/tmp/fred", 10 ); - assert( status == -1); - - rtems_status = rtems_io_register_name( "/dev/console", 0, 0 ); - - test_case_reopen_append(); - - printf( "*** END OF FILE TEST 1 ***\n" ); - rtems_test_exit( 0 ); -} - -/* - * Open/Create a File and write to it - * - * Test case submitted by Andrew Bythell . - * - */ - -void test_file (char *filename, char *mode); - -void test_case_reopen_append(void) -{ - printf ("Writing First File\n"); - test_file ("/one.txt", "a"); - test_file ("/one.txt", "a"); - - /* but not the second time - this will insert junk. - the number of ^@'s seems to equal the number of - actual characters in the file */ - - printf ("Writing Second File\n"); - test_file ("/two.txt", "a"); - test_file ("/two.txt", "a"); - - test_cat( "/one.txt", 0, 1024 ); - test_cat( "/two.txt", 0, 1024 ); -} - -void test_file (char *filename, char *mode) -{ - FILE *fp; - fp = fopen (filename, mode); - if (!fp) - perror ("fopen"); - fprintf (fp, "this is a test line\n"); - if (fclose (fp)) - perror ("fclose"); -} - - diff --git a/testsuites/psxtests/psxfile01/test_cat.c b/testsuites/psxtests/psxfile01/test_cat.c deleted file mode 100644 index ea1e63ef7e..0000000000 --- a/testsuites/psxtests/psxfile01/test_cat.c +++ /dev/null @@ -1,83 +0,0 @@ -/* - * A test support function which performs a crude version of - * "cat" so you can look at specific parts of a file. - * - * $Id$ - */ - -#include - -#include -#include -#include -#include -#include -#include -#include - -#include - -#include - -/* - * test_cat routine - */ - -unsigned char test_cat_buffer[ 1024 ]; - -void test_cat( - char *file, - int offset_arg, - int length -) -{ - int fd; - int status; - int is_printable = 0; - int my_length; - int i; - unsigned char c; - int count = 0; - off_t offset = (off_t)offset_arg; - - my_length = (length) ? length : sizeof( test_cat_buffer ); - assert( my_length <= sizeof( test_cat_buffer ) ); - - fd = open( file, O_RDONLY ); - if ( fd == -1 ) { - printf( "test_cat: open( %s ) failed : %s\n", file, strerror( errno ) ); - rtems_test_exit( 0 ); - } - - for ( ;; ) { - status = lseek( fd, offset, SEEK_SET ); - assert( status != -1 ); - - status = read( fd, test_cat_buffer, sizeof(test_cat_buffer) ); - if ( status <= 0 ) { - if (!is_printable) - printf( "(%d)", count ); - puts( "" ); - break; - } - - for ( i=0 ; i - -#include -#include -#include -#include -#include -#include -#include - -#include - -#include - -/* - * test_extend routine - */ - -void test_extend( - char *file, - off_t offset -) -{ - int fd; - int status; - char c = 0; - - fd = open( file, O_WRONLY ); - if ( fd == -1 ) { - printf( "test_extend: open( %s ) failed : %s\n", file, strerror( errno ) ); - rtems_test_exit( 0 ); - } - - status = lseek( fd, offset - 1, SEEK_SET ); - assert( status != -1 ); - - status = write( fd, &c, 1 ); - if ( status == -1 ) { - printf( "test_extend: write( %s ) failed : %s\n", file, strerror( errno ) ); - rtems_test_exit( 0 ); - } - - if ( status != 1 ) { - printf( "test_extend: write( %s ) only wrote %d of %d bytes\n", - file, status, 1 ); - rtems_test_exit( 0 ); - } - - status = close( fd ); - assert( !status ); -} diff --git a/testsuites/psxtests/psxfile01/test_write.c b/testsuites/psxtests/psxfile01/test_write.c deleted file mode 100644 index b87ba06624..0000000000 --- a/testsuites/psxtests/psxfile01/test_write.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - * A test support function which performs a write() and - * handles implied open(), lseek(), write(), and close() operations. - * - * $Id$ - */ - -#include - -#include -#include -#include -#include -#include -#include - -#include - -#include - -/* - * test_write routine - */ - -void test_write( - char *file, - off_t offset, - char *buffer -) -{ - int fd; - int status; - int length; - - - length = strlen( buffer ); - - fd = open( file, O_WRONLY ); - if ( fd == -1 ) { - printf( "test_write: open( %s ) failed : %s\n", file, strerror( errno ) ); - rtems_test_exit( 0 ); - } - - status = lseek( fd, offset, SEEK_SET ); - assert( status != -1 ); - - status = write( fd, buffer, length ); - if ( status == -1 ) { - printf( "test_write: write( %s ) failed : %s\n", file, strerror( errno ) ); - rtems_test_exit( 0 ); - } - - if ( status != length ) { - printf( "test_write: write( %s ) only wrote %d of %d bytes\n", - file, status, length ); - rtems_test_exit( 0 ); - } - - status = close( fd ); - assert( !status ); -} diff --git a/testsuites/psxtests/psxhdrs/.cvsignore b/testsuites/psxtests/psxhdrs/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/psxtests/psxhdrs/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/psxtests/psxhdrs/Makefile.am b/testsuites/psxtests/psxhdrs/Makefile.am deleted file mode 100644 index 9271945d1b..0000000000 --- a/testsuites/psxtests/psxhdrs/Makefile.am +++ /dev/null @@ -1,40 +0,0 @@ -## -## $Id$ -## - - -C_FILES = clock01.c clock02.c clock03.c clock04.c clock05.c clock06.c \ - cond01.c cond02.c cond03.c cond04.c cond05.c cond06.c cond07.c cond08.c \ - cond09.c cond10.c key01.c key02.c key03.c key04.c mutex01.c mutex02.c \ - mutex03.c mutex04.c mutex05.c mutex06.c mutex07.c mutex08.c mutex09.c \ - mutex10.c mutex11.c mutex12.c mutex13.c mutex14.c mutex15.c mutex16.c \ - pthread01.c pthread02.c pthread03.c pthread04.c pthread05.c pthread06.c \ - pthread07.c pthread08.c pthread09.c pthread10.c pthread11.c pthread12.c \ - pthread13.c pthread14.c pthread15.c pthread16.c pthread17.c pthread18.c \ - pthread19.c pthread20.c pthread21.c pthread22.c pthread23.c pthread24.c \ - pthread25.c pthread26.c pthread27.c pthread28.c pthread29.c pthread30.c \ - pthread31.c pthread32.c pthread33.c pthread34.c pthread35.c pthread36.c \ - proc01.c proc02.c proc03.c proc04.c proc05.c proc06.c proc07.c proc08.c \ - proc09.c proc10.c proc11.c proc12.c proc13.c proc14.c sched01.c \ - sched02.c sched03.c sched04.c sched05.c sched06.c sched07.c sched08.c \ - signal01.c signal02.c signal03.c signal04.c signal05.c signal06.c \ - signal07.c signal08.c signal09.c signal10.c signal11.c signal12.c \ - signal13.c signal14.c signal15.c signal16.c signal17.c signal18.c \ - signal19.c signal20.c signal21.c signal22.c time01.c time02.c time03.c \ - time04.c time05.c time06.c time07.c time08.c time09.c time10.c time11.c \ - time12.c time13.c timer01.c timer02.c timer03.c timer04.c timer05.c \ - timer06.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -SRCS = $(C_FILES) -OBJS = $(C_O_FILES) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am - -all-local: ${ARCH} ${OBJS} - -EXTRA_DIST = $(C_FILES) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/psxtests/psxhdrs/clock01.c b/testsuites/psxtests/psxhdrs/clock01.c deleted file mode 100644 index ab520983e2..0000000000 --- a/testsuites/psxtests/psxhdrs/clock01.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_TIMERS -#error "rtems is supposed to have clock_gettime" -#endif - -void test( void ) -{ - clockid_t clock_id = 0; - struct timespec tp; - int result; - - result = clock_gettime( clock_id, &tp ); -} diff --git a/testsuites/psxtests/psxhdrs/clock02.c b/testsuites/psxtests/psxhdrs/clock02.c deleted file mode 100644 index c12aa3c906..0000000000 --- a/testsuites/psxtests/psxhdrs/clock02.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_TIMERS -#error "rtems is supposed to have clock_settime" -#endif - -void test( void ) -{ - clockid_t clock_id = 0; - struct timespec tp; - int result; - - result = clock_settime( clock_id, &tp ); -} diff --git a/testsuites/psxtests/psxhdrs/clock03.c b/testsuites/psxtests/psxhdrs/clock03.c deleted file mode 100644 index 1e44eea91a..0000000000 --- a/testsuites/psxtests/psxhdrs/clock03.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_TIMERS -#error "rtems is supposed to have clock_getres" -#endif - -void test( void ) -{ - clockid_t clock_id = 0; - struct timespec res; - int result; - - result = clock_getres( clock_id, &res ); -} diff --git a/testsuites/psxtests/psxhdrs/clock04.c b/testsuites/psxtests/psxhdrs/clock04.c deleted file mode 100644 index b65320d11e..0000000000 --- a/testsuites/psxtests/psxhdrs/clock04.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_CPUTIME -#error "rtems is supposed to have clock_getcpuclockid" -#endif - -void test( void ) -{ - pid_t pid = 0; - clockid_t clock_id; - int result; - - result = clock_getcpuclockid( pid, &clock_id ); -} diff --git a/testsuites/psxtests/psxhdrs/clock05.c b/testsuites/psxtests/psxhdrs/clock05.c deleted file mode 100644 index a8b1357eb6..0000000000 --- a/testsuites/psxtests/psxhdrs/clock05.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_CPUTIME -#error "rtems is supposed to have clock_setenable_attr" -#endif -#ifndef _POSIX_THREAD_CPUTIME -#error "rtems is supposed to have clock_setenable_attr" -#endif - -void test( void ) -{ - clockid_t clock_id = 0; - int attr; - int result; - - attr = CLOCK_ENABLED; - attr = CLOCK_DISABLED; - - result = clock_setenable_attr( clock_id, attr ); -} diff --git a/testsuites/psxtests/psxhdrs/clock06.c b/testsuites/psxtests/psxhdrs/clock06.c deleted file mode 100644 index eac0169ced..0000000000 --- a/testsuites/psxtests/psxhdrs/clock06.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_CPUTIME -#error "rtems is supposed to have clock_getenable_attr" -#endif -#ifndef _POSIX_THREAD_CPUTIME -#error "rtems is supposed to have clock_getenable_attr" -#endif - -void test( void ) -{ - clockid_t clock_id = 0; - int attr; - int result; - - result = clock_getenable_attr( clock_id, &attr ); -} diff --git a/testsuites/psxtests/psxhdrs/cond01.c b/testsuites/psxtests/psxhdrs/cond01.c deleted file mode 100644 index 28cf76d8bb..0000000000 --- a/testsuites/psxtests/psxhdrs/cond01.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_condattr_init" -#endif - -void test( void ) -{ - pthread_condattr_t attribute; - int result; - - result = pthread_condattr_init( &attribute ); -} diff --git a/testsuites/psxtests/psxhdrs/cond02.c b/testsuites/psxtests/psxhdrs/cond02.c deleted file mode 100644 index 1f6c3cfeff..0000000000 --- a/testsuites/psxtests/psxhdrs/cond02.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_condattr_destroy" -#endif - -void test( void ) -{ - pthread_condattr_t attribute; - int result; - - result = pthread_condattr_destroy( &attribute ); -} diff --git a/testsuites/psxtests/psxhdrs/cond03.c b/testsuites/psxtests/psxhdrs/cond03.c deleted file mode 100644 index 2bb7e29445..0000000000 --- a/testsuites/psxtests/psxhdrs/cond03.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_cond_init" -#endif - -void test( void ) -{ - pthread_cond_t cond = PTHREAD_COND_INITIALIZER; - pthread_condattr_t attribute; - int result; - - result = pthread_cond_init( &cond, &attribute ); -} diff --git a/testsuites/psxtests/psxhdrs/cond04.c b/testsuites/psxtests/psxhdrs/cond04.c deleted file mode 100644 index 6dcf08b94a..0000000000 --- a/testsuites/psxtests/psxhdrs/cond04.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_cond_destroy" -#endif - -void test( void ) -{ - pthread_cond_t cond = PTHREAD_COND_INITIALIZER; - int result; - - result = pthread_cond_destroy( &cond ); -} diff --git a/testsuites/psxtests/psxhdrs/cond05.c b/testsuites/psxtests/psxhdrs/cond05.c deleted file mode 100644 index a7a9a2e207..0000000000 --- a/testsuites/psxtests/psxhdrs/cond05.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_cond_signal" -#endif - -void test( void ) -{ - pthread_cond_t cond = PTHREAD_COND_INITIALIZER; - int result; - - result = pthread_cond_signal( &cond ); -} diff --git a/testsuites/psxtests/psxhdrs/cond06.c b/testsuites/psxtests/psxhdrs/cond06.c deleted file mode 100644 index 25a43087cd..0000000000 --- a/testsuites/psxtests/psxhdrs/cond06.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_cond_wait" -#endif - -void test( void ) -{ - pthread_cond_t cond = PTHREAD_COND_INITIALIZER; - pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; - int result; - - result = pthread_cond_wait( &cond, &mutex ); -} diff --git a/testsuites/psxtests/psxhdrs/cond07.c b/testsuites/psxtests/psxhdrs/cond07.c deleted file mode 100644 index a88c16bd3c..0000000000 --- a/testsuites/psxtests/psxhdrs/cond07.c +++ /dev/null @@ -1,29 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_cond_timedwait" -#endif - -void test( void ) -{ - pthread_cond_t cond = PTHREAD_COND_INITIALIZER; - pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; - struct timespec abstime; - int result; - - result = pthread_cond_timedwait( &cond, &mutex, &abstime ); -} diff --git a/testsuites/psxtests/psxhdrs/cond08.c b/testsuites/psxtests/psxhdrs/cond08.c deleted file mode 100644 index 353887c303..0000000000 --- a/testsuites/psxtests/psxhdrs/cond08.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_condattr_getpshared" -#endif -#ifndef _POSIX_THREAD_PROCESS_SHARED -#error "rtems is supposed to have pthread_condattr_setpshared" -#endif - -void test( void ) -{ - pthread_condattr_t attribute; - int pshared; - int result; - - result = pthread_condattr_getpshared( &attribute, &pshared ); -} diff --git a/testsuites/psxtests/psxhdrs/cond09.c b/testsuites/psxtests/psxhdrs/cond09.c deleted file mode 100644 index 0e5d10dbf4..0000000000 --- a/testsuites/psxtests/psxhdrs/cond09.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_condattr_setpshared" -#endif -#ifndef _POSIX_THREAD_PROCESS_SHARED -#error "rtems is supposed to have pthread_condattr_setpshared" -#endif - -void test( void ) -{ - pthread_condattr_t attribute; - int pshared; - int result; - - pshared = PTHREAD_PROCESS_SHARED; - pshared = PTHREAD_PROCESS_PRIVATE; - - result = pthread_condattr_setpshared( &attribute, pshared ); -} diff --git a/testsuites/psxtests/psxhdrs/cond10.c b/testsuites/psxtests/psxhdrs/cond10.c deleted file mode 100644 index 4147fe4c24..0000000000 --- a/testsuites/psxtests/psxhdrs/cond10.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_cond_broadcast" -#endif - -void test( void ) -{ - pthread_cond_t cond = PTHREAD_COND_INITIALIZER; - int result; - - result = pthread_cond_broadcast( &cond ); -} diff --git a/testsuites/psxtests/psxhdrs/key01.c b/testsuites/psxtests/psxhdrs/key01.c deleted file mode 100644 index b61e61a79f..0000000000 --- a/testsuites/psxtests/psxhdrs/key01.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_key_create" -#endif - -void key_destructor( - void *argument -) -{ -} - -void test( void ) -{ - pthread_key_t key; - int result; - - result = pthread_key_create( &key, key_destructor ); -} diff --git a/testsuites/psxtests/psxhdrs/key02.c b/testsuites/psxtests/psxhdrs/key02.c deleted file mode 100644 index c8e88a1fee..0000000000 --- a/testsuites/psxtests/psxhdrs/key02.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_setspecific" -#endif - -void test( void ) -{ - pthread_key_t key; - int value; - int result; - - key = 0; - value = 0; - - result = pthread_setspecific( key, &value ); -} diff --git a/testsuites/psxtests/psxhdrs/key03.c b/testsuites/psxtests/psxhdrs/key03.c deleted file mode 100644 index ca8b4c3199..0000000000 --- a/testsuites/psxtests/psxhdrs/key03.c +++ /dev/null @@ -1,29 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_getspecific" -#endif - -void test( void ) -{ - pthread_key_t key; - void *value; - - key = 0; - - value = pthread_getspecific( key ); -} diff --git a/testsuites/psxtests/psxhdrs/key04.c b/testsuites/psxtests/psxhdrs/key04.c deleted file mode 100644 index c03977f223..0000000000 --- a/testsuites/psxtests/psxhdrs/key04.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_key_delete" -#endif - -void test( void ) -{ - pthread_key_t key = 0; - int result; - - result = pthread_key_delete( key ); -} diff --git a/testsuites/psxtests/psxhdrs/mutex01.c b/testsuites/psxtests/psxhdrs/mutex01.c deleted file mode 100644 index fad7f89845..0000000000 --- a/testsuites/psxtests/psxhdrs/mutex01.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_mutexattr_init" -#endif - -void test( void ) -{ - pthread_mutexattr_t attribute; - int result; - - result = pthread_mutexattr_init( &attribute ); -} diff --git a/testsuites/psxtests/psxhdrs/mutex02.c b/testsuites/psxtests/psxhdrs/mutex02.c deleted file mode 100644 index 70a196c5b5..0000000000 --- a/testsuites/psxtests/psxhdrs/mutex02.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_mutexattr_destroy" -#endif - -void test( void ) -{ - pthread_mutexattr_t attribute; - int result; - - result = pthread_mutexattr_destroy( &attribute ); -} diff --git a/testsuites/psxtests/psxhdrs/mutex03.c b/testsuites/psxtests/psxhdrs/mutex03.c deleted file mode 100644 index 32f93d46b4..0000000000 --- a/testsuites/psxtests/psxhdrs/mutex03.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_mutex_init" -#endif - -void test( void ) -{ - pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; - pthread_mutexattr_t attribute; - int result; - - result = pthread_mutex_init( &mutex, &attribute ); -} diff --git a/testsuites/psxtests/psxhdrs/mutex04.c b/testsuites/psxtests/psxhdrs/mutex04.c deleted file mode 100644 index 54c52f3198..0000000000 --- a/testsuites/psxtests/psxhdrs/mutex04.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_mutex_destroy" -#endif - -void test( void ) -{ - pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; - int result; - - result = pthread_mutex_destroy( &mutex ); -} diff --git a/testsuites/psxtests/psxhdrs/mutex05.c b/testsuites/psxtests/psxhdrs/mutex05.c deleted file mode 100644 index 2b3ce61b18..0000000000 --- a/testsuites/psxtests/psxhdrs/mutex05.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_mutex_lock" -#endif - -void test( void ) -{ - pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; - int result; - - result = pthread_mutex_lock( &mutex ); -} diff --git a/testsuites/psxtests/psxhdrs/mutex06.c b/testsuites/psxtests/psxhdrs/mutex06.c deleted file mode 100644 index 7fa549000f..0000000000 --- a/testsuites/psxtests/psxhdrs/mutex06.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_mutex_unlock" -#endif - -void test( void ) -{ - pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; - int result; - - result = pthread_mutex_unlock( &mutex ); -} diff --git a/testsuites/psxtests/psxhdrs/mutex07.c b/testsuites/psxtests/psxhdrs/mutex07.c deleted file mode 100644 index fc4cc1fb93..0000000000 --- a/testsuites/psxtests/psxhdrs/mutex07.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREAD_PRIO_INHERIT -#error "rtems is supposed to have pthread_mutexattr_setprotocol" -#endif -#ifndef _POSIX_THREAD_PRIO_PROTECT -#error "rtems is supposed to have pthread_mutexattr_setprotocol" -#endif - -void test( void ) -{ - pthread_mutexattr_t attribute; - int protocol; - int result; - - protocol = PTHREAD_PRIO_NONE; - protocol = PTHREAD_PRIO_INHERIT; - protocol = PTHREAD_PRIO_PROTECT; - - result = pthread_mutexattr_setprotocol( &attribute, protocol ); -} diff --git a/testsuites/psxtests/psxhdrs/mutex08.c b/testsuites/psxtests/psxhdrs/mutex08.c deleted file mode 100644 index e46712b94c..0000000000 --- a/testsuites/psxtests/psxhdrs/mutex08.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREAD_PRIO_INHERIT -#error "rtems is supposed to have pthread_mutexattr_getprioceiling" -#endif -#ifndef _POSIX_THREAD_PRIO_PROTECT -#error "rtems is supposed to have pthread_mutexattr_getprioceiling" -#endif - -void test( void ) -{ - pthread_mutexattr_t attribute; - int prioceiling = 0; - int result; - - result = pthread_mutexattr_getprioceiling( &attribute, &prioceiling ); -} diff --git a/testsuites/psxtests/psxhdrs/mutex09.c b/testsuites/psxtests/psxhdrs/mutex09.c deleted file mode 100644 index 4b8aff0a55..0000000000 --- a/testsuites/psxtests/psxhdrs/mutex09.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREAD_PRIO_INHERIT -#error "rtems is supposed to have pthread_mutexattr_setprioceiling" -#endif -#ifndef _POSIX_THREAD_PRIO_PROTECT -#error "rtems is supposed to have pthread_mutexattr_setprioceiling" -#endif - -void test( void ) -{ - pthread_mutexattr_t attribute; - int prioceiling = 0; - int result; - - result = pthread_mutexattr_setprioceiling( &attribute, prioceiling ); -} diff --git a/testsuites/psxtests/psxhdrs/mutex10.c b/testsuites/psxtests/psxhdrs/mutex10.c deleted file mode 100644 index 550906b8ae..0000000000 --- a/testsuites/psxtests/psxhdrs/mutex10.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_mutexattr_getpshared" -#endif -#ifndef _POSIX_THREAD_PROCESS_SHARED -#error "rtems is supposed to have pthread_mutexattr_setpshared" -#endif - -void test( void ) -{ - pthread_mutexattr_t attribute; - int pshared; - int result; - - result = pthread_mutexattr_getpshared( &attribute, &pshared ); -} diff --git a/testsuites/psxtests/psxhdrs/mutex11.c b/testsuites/psxtests/psxhdrs/mutex11.c deleted file mode 100644 index 8d50790ddf..0000000000 --- a/testsuites/psxtests/psxhdrs/mutex11.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_mutexattr_setpshared" -#endif -#ifndef _POSIX_THREAD_PROCESS_SHARED -#error "rtems is supposed to have pthread_mutexattr_setpshared" -#endif - -void test( void ) -{ - pthread_mutexattr_t attribute; - int pshared; - int result; - - pshared = PTHREAD_PROCESS_SHARED; - pshared = PTHREAD_PROCESS_PRIVATE; - - result = pthread_mutexattr_setpshared( &attribute, pshared ); -} diff --git a/testsuites/psxtests/psxhdrs/mutex12.c b/testsuites/psxtests/psxhdrs/mutex12.c deleted file mode 100644 index 0fcba60e29..0000000000 --- a/testsuites/psxtests/psxhdrs/mutex12.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_mutex_trylock" -#endif - -void test( void ) -{ - pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; - int result; - - result = pthread_mutex_trylock( &mutex ); -} diff --git a/testsuites/psxtests/psxhdrs/mutex13.c b/testsuites/psxtests/psxhdrs/mutex13.c deleted file mode 100644 index d3027a06a9..0000000000 --- a/testsuites/psxtests/psxhdrs/mutex13.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_mutex_timedlock" -#endif -#ifndef _POSIX_TIMEOUTS -#error "rtems is supposed to have pthread_mutex_timedlock" -#endif - -void test( void ) -{ - pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; - struct timespec timeout; - int result; - - result = pthread_mutex_timedlock( &mutex, &timeout ); -} diff --git a/testsuites/psxtests/psxhdrs/mutex14.c b/testsuites/psxtests/psxhdrs/mutex14.c deleted file mode 100644 index 966cfc58ba..0000000000 --- a/testsuites/psxtests/psxhdrs/mutex14.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREAD_PRIO_INHERIT -#error "rtems is supposed to have pthread_mutexattr_getprotocol" -#endif -#ifndef _POSIX_THREAD_PRIO_PROTECT -#error "rtems is supposed to have pthread_mutexattr_getprotocol" -#endif - -void test( void ) -{ - pthread_mutexattr_t attribute; - int protocol; - int result; - - result = pthread_mutexattr_getprotocol( &attribute, &protocol ); -} diff --git a/testsuites/psxtests/psxhdrs/mutex15.c b/testsuites/psxtests/psxhdrs/mutex15.c deleted file mode 100644 index 25cab34a2a..0000000000 --- a/testsuites/psxtests/psxhdrs/mutex15.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREAD_PRIO_INHERIT -#error "rtems is supposed to have pthread_mutex_getprioceiling" -#endif -#ifndef _POSIX_THREAD_PRIO_PROTECT -#error "rtems is supposed to have pthread_mutex_getprioceiling" -#endif - -void test( void ) -{ - pthread_mutex_t mutex; - int prioceiling; - int result; - - result = pthread_mutex_getprioceiling( &mutex, &prioceiling ); -} diff --git a/testsuites/psxtests/psxhdrs/mutex16.c b/testsuites/psxtests/psxhdrs/mutex16.c deleted file mode 100644 index be0c0ce135..0000000000 --- a/testsuites/psxtests/psxhdrs/mutex16.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREAD_PRIO_INHERIT -#error "rtems is supposed to have pthread_mutex_setprioceiling" -#endif -#ifndef _POSIX_THREAD_PRIO_PROTECT -#error "rtems is supposed to have pthread_mutex_setprioceiling" -#endif - -void test( void ) -{ - pthread_mutex_t mutex; - int prioceiling; - int oldceiling; - int result; - - prioceiling = 0; - - result = pthread_mutex_setprioceiling( &mutex, prioceiling, &oldceiling ); -} diff --git a/testsuites/psxtests/psxhdrs/proc01.c b/testsuites/psxtests/psxhdrs/proc01.c deleted file mode 100644 index c29deb0f3d..0000000000 --- a/testsuites/psxtests/psxhdrs/proc01.c +++ /dev/null @@ -1,22 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -void test( void ) -{ - pid_t pid; - - pid = getpid(); -} diff --git a/testsuites/psxtests/psxhdrs/proc02.c b/testsuites/psxtests/psxhdrs/proc02.c deleted file mode 100644 index 721f05f15f..0000000000 --- a/testsuites/psxtests/psxhdrs/proc02.c +++ /dev/null @@ -1,22 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -void test( void ) -{ - pid_t pid; - - pid = getppid(); -} diff --git a/testsuites/psxtests/psxhdrs/proc03.c b/testsuites/psxtests/psxhdrs/proc03.c deleted file mode 100644 index 692e0f7da4..0000000000 --- a/testsuites/psxtests/psxhdrs/proc03.c +++ /dev/null @@ -1,23 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include - -void test( void ) -{ - uid_t uid; - - uid = getuid(); -} diff --git a/testsuites/psxtests/psxhdrs/proc04.c b/testsuites/psxtests/psxhdrs/proc04.c deleted file mode 100644 index e1b51e7e6d..0000000000 --- a/testsuites/psxtests/psxhdrs/proc04.c +++ /dev/null @@ -1,23 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include - -void test( void ) -{ - uid_t uid; - - uid = geteuid(); -} diff --git a/testsuites/psxtests/psxhdrs/proc05.c b/testsuites/psxtests/psxhdrs/proc05.c deleted file mode 100644 index a105f20e96..0000000000 --- a/testsuites/psxtests/psxhdrs/proc05.c +++ /dev/null @@ -1,23 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include - -void test( void ) -{ - gid_t gid; - - gid = getgid(); -} diff --git a/testsuites/psxtests/psxhdrs/proc06.c b/testsuites/psxtests/psxhdrs/proc06.c deleted file mode 100644 index 7cbc0ed490..0000000000 --- a/testsuites/psxtests/psxhdrs/proc06.c +++ /dev/null @@ -1,23 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include - -void test( void ) -{ - gid_t gid; - - gid = getegid(); -} diff --git a/testsuites/psxtests/psxhdrs/proc07.c b/testsuites/psxtests/psxhdrs/proc07.c deleted file mode 100644 index 038c02aded..0000000000 --- a/testsuites/psxtests/psxhdrs/proc07.c +++ /dev/null @@ -1,25 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -void test( void ) -{ - uid_t uid; - int result; - - uid = 0; - - result = setuid( uid ); -} diff --git a/testsuites/psxtests/psxhdrs/proc08.c b/testsuites/psxtests/psxhdrs/proc08.c deleted file mode 100644 index 8133f6a3b6..0000000000 --- a/testsuites/psxtests/psxhdrs/proc08.c +++ /dev/null @@ -1,25 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -void test( void ) -{ - gid_t gid; - int result; - - gid = 0; - - result = setgid( gid ); -} diff --git a/testsuites/psxtests/psxhdrs/proc09.c b/testsuites/psxtests/psxhdrs/proc09.c deleted file mode 100644 index a6b7a0a27b..0000000000 --- a/testsuites/psxtests/psxhdrs/proc09.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -void test( void ) -{ - gid_t grouplist[ 20 ]; - int gidsetsize; - int result; - - gidsetsize = 20; - - result = getgroups( gidsetsize, grouplist ); -} diff --git a/testsuites/psxtests/psxhdrs/proc10.c b/testsuites/psxtests/psxhdrs/proc10.c deleted file mode 100644 index 7ea8ea0988..0000000000 --- a/testsuites/psxtests/psxhdrs/proc10.c +++ /dev/null @@ -1,22 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -void test( void ) -{ - char *loginname; - - loginname = getlogin(); -} diff --git a/testsuites/psxtests/psxhdrs/proc11.c b/testsuites/psxtests/psxhdrs/proc11.c deleted file mode 100644 index d09b5c183b..0000000000 --- a/testsuites/psxtests/psxhdrs/proc11.c +++ /dev/null @@ -1,24 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include /* for LOGIN_NAME_MAX */ - -void test( void ) -{ - char loginnamebuffer[ LOGIN_NAME_MAX ]; - int result; - - result = getlogin_r( loginnamebuffer, LOGIN_NAME_MAX ); -} diff --git a/testsuites/psxtests/psxhdrs/proc12.c b/testsuites/psxtests/psxhdrs/proc12.c deleted file mode 100644 index faf88794b5..0000000000 --- a/testsuites/psxtests/psxhdrs/proc12.c +++ /dev/null @@ -1,22 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -void test( void ) -{ - pid_t pgrp; - - pgrp = getpgrp(); -} diff --git a/testsuites/psxtests/psxhdrs/proc13.c b/testsuites/psxtests/psxhdrs/proc13.c deleted file mode 100644 index a373e9a956..0000000000 --- a/testsuites/psxtests/psxhdrs/proc13.c +++ /dev/null @@ -1,22 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -void test( void ) -{ - pid_t pid; - - pid = setsid(); -} diff --git a/testsuites/psxtests/psxhdrs/proc14.c b/testsuites/psxtests/psxhdrs/proc14.c deleted file mode 100644 index 49e9d3ab5b..0000000000 --- a/testsuites/psxtests/psxhdrs/proc14.c +++ /dev/null @@ -1,24 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -void test( void ) -{ - pid_t pid = 0; - pid_t pgid = 0; - int result; - - result = setpgid( pid, pgid ); -} diff --git a/testsuites/psxtests/psxhdrs/pthread01.c b/testsuites/psxtests/psxhdrs/pthread01.c deleted file mode 100644 index af2d96f2a1..0000000000 --- a/testsuites/psxtests/psxhdrs/pthread01.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_attr_init" -#endif - -void test( void ) -{ - pthread_attr_t attribute; - int result; - - result = pthread_attr_init( &attribute ); -} diff --git a/testsuites/psxtests/psxhdrs/pthread02.c b/testsuites/psxtests/psxhdrs/pthread02.c deleted file mode 100644 index c69881f86f..0000000000 --- a/testsuites/psxtests/psxhdrs/pthread02.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_attr_destroy" -#endif - -void test( void ) -{ - pthread_attr_t attribute; - int result; - - result = pthread_attr_destroy( &attribute ); -} diff --git a/testsuites/psxtests/psxhdrs/pthread03.c b/testsuites/psxtests/psxhdrs/pthread03.c deleted file mode 100644 index 6200860216..0000000000 --- a/testsuites/psxtests/psxhdrs/pthread03.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_attr_setdetachstate" -#endif - -void test( void ) -{ - pthread_attr_t attribute; - int state; - int result; - - state = PTHREAD_CREATE_DETACHED; - state = PTHREAD_CREATE_JOINABLE; - - result = pthread_attr_setdetachstate( &attribute, state ); -} diff --git a/testsuites/psxtests/psxhdrs/pthread04.c b/testsuites/psxtests/psxhdrs/pthread04.c deleted file mode 100644 index 08c4c0405b..0000000000 --- a/testsuites/psxtests/psxhdrs/pthread04.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_attr_getdetachstate" -#endif - -void test( void ) -{ - pthread_attr_t attribute; - int state; - int result; - - result = pthread_attr_getdetachstate( &attribute, &state ); -} diff --git a/testsuites/psxtests/psxhdrs/pthread05.c b/testsuites/psxtests/psxhdrs/pthread05.c deleted file mode 100644 index ce972c6f90..0000000000 --- a/testsuites/psxtests/psxhdrs/pthread05.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include /* only for PTHREAD_STACK_MIN */ - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_setstacksize" -#endif - -#ifndef _POSIX_THREAD_ATTR_STACKSIZE -#error "rtems is supposed to have pthread_setstacksize" -#endif - -void test( void ) -{ - pthread_attr_t attribute; - size_t size; - int result; - - size = PTHREAD_STACK_MIN; - - result = pthread_attr_setstacksize( &attribute, size ); -} diff --git a/testsuites/psxtests/psxhdrs/pthread06.c b/testsuites/psxtests/psxhdrs/pthread06.c deleted file mode 100644 index 5f0fc96237..0000000000 --- a/testsuites/psxtests/psxhdrs/pthread06.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_getstacksize" -#endif - -#ifndef _POSIX_THREAD_ATTR_STACKSIZE -#error "rtems is supposed to have pthread_getstacksize" -#endif - -void test( void ) -{ - pthread_attr_t attribute; - size_t size; - int result; - - result = pthread_attr_getstacksize( &attribute, &size ); -} diff --git a/testsuites/psxtests/psxhdrs/pthread07.c b/testsuites/psxtests/psxhdrs/pthread07.c deleted file mode 100644 index 9192820821..0000000000 --- a/testsuites/psxtests/psxhdrs/pthread07.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_create" -#endif - -void *test_task( - void * arg -) -{ - for ( ; ; ) - ; -} - -void test( void ) -{ - pthread_t thread; - pthread_attr_t attribute; - void *arg = NULL; - int result; - - result = pthread_create( &thread, &attribute, test_task, arg ); -} diff --git a/testsuites/psxtests/psxhdrs/pthread08.c b/testsuites/psxtests/psxhdrs/pthread08.c deleted file mode 100644 index b8b7269365..0000000000 --- a/testsuites/psxtests/psxhdrs/pthread08.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_exit" -#endif - -void test( void ) -{ - void *status = NULL; - - pthread_exit( status ); -} diff --git a/testsuites/psxtests/psxhdrs/pthread09.c b/testsuites/psxtests/psxhdrs/pthread09.c deleted file mode 100644 index 2a5bd6f93a..0000000000 --- a/testsuites/psxtests/psxhdrs/pthread09.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_self" -#endif - -void test( void ) -{ - pthread_t self; - - self = pthread_self(); -} diff --git a/testsuites/psxtests/psxhdrs/pthread10.c b/testsuites/psxtests/psxhdrs/pthread10.c deleted file mode 100644 index f543ec4e76..0000000000 --- a/testsuites/psxtests/psxhdrs/pthread10.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_equal" -#endif - -void test( void ) -{ - pthread_t id_1 = 0; - pthread_t id_2 = 0; - int result; - - result = pthread_equal( id_1, id_2 ); -} diff --git a/testsuites/psxtests/psxhdrs/pthread11.c b/testsuites/psxtests/psxhdrs/pthread11.c deleted file mode 100644 index 75075e8d45..0000000000 --- a/testsuites/psxtests/psxhdrs/pthread11.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREAD_PRIORITY_SCHEDULING -#error "RTEMS is supposed to have pthread_setschedparam" -#endif - -void test( void ) -{ - pthread_t thread; - int policy; - struct sched_param param; - int result; - - thread = 0; - - policy = SCHED_OTHER; - policy = SCHED_FIFO; - policy = SCHED_RR; -#ifdef _POSIX_SPORADIC_SERVER - policy = SCHED_SPORADIC; -#endif - - /* - * really should use sched_get_priority_min() and sched_get_priority_max() - */ - - param.sched_priority = 0; -#ifdef _POSIX_SPORADIC_SERVER - param.ss_low_priority = 0; - param.ss_replenish_period.tv_sec = 0; - param.ss_replenish_period.tv_nsec = 0; - param.ss_initial_budget.tv_sec = 0; - param.ss_initial_budget.tv_nsec = 0; -#endif - - result = pthread_setschedparam( thread, policy, ¶m ); -} diff --git a/testsuites/psxtests/psxhdrs/pthread12.c b/testsuites/psxtests/psxhdrs/pthread12.c deleted file mode 100644 index c5ca91ae4c..0000000000 --- a/testsuites/psxtests/psxhdrs/pthread12.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREAD_PRIORITY_SCHEDULING -#error "RTEMS is supposed to have pthread_getschedparam" -#endif - -void test( void ) -{ - pthread_t thread; - int policy; - struct sched_param param; - int result; - - thread = 0; - - result = pthread_getschedparam( thread, &policy, ¶m ); -} diff --git a/testsuites/psxtests/psxhdrs/pthread13.c b/testsuites/psxtests/psxhdrs/pthread13.c deleted file mode 100644 index e4d70bc85c..0000000000 --- a/testsuites/psxtests/psxhdrs/pthread13.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREAD_PRIORITY_SCHEDULING -#error "RTEMS is supposed to have pthread_attr_setscope" -#endif - -void test( void ) -{ - pthread_attr_t attr; - int contentionscope; - int result; - - contentionscope = PTHREAD_SCOPE_SYSTEM; - contentionscope = PTHREAD_SCOPE_PROCESS; - - result = pthread_attr_setscope( &attr, contentionscope ); -} diff --git a/testsuites/psxtests/psxhdrs/pthread14.c b/testsuites/psxtests/psxhdrs/pthread14.c deleted file mode 100644 index 31fe6d6a86..0000000000 --- a/testsuites/psxtests/psxhdrs/pthread14.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREAD_PRIORITY_SCHEDULING -#error "RTEMS is supposed to have pthread_attr_getscope" -#endif - -void test( void ) -{ - pthread_attr_t attr; - int contentionscope; - int result; - - result = pthread_attr_getscope( &attr, &contentionscope ); -} diff --git a/testsuites/psxtests/psxhdrs/pthread15.c b/testsuites/psxtests/psxhdrs/pthread15.c deleted file mode 100644 index f18f13be2c..0000000000 --- a/testsuites/psxtests/psxhdrs/pthread15.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREAD_PRIORITY_SCHEDULING -#error "RTEMS is supposed to have pthread_attr_setinheritsched" -#endif - -void test( void ) -{ - pthread_attr_t attr; - int inheritsched; - int result; - - inheritsched = PTHREAD_INHERIT_SCHED; - inheritsched = PTHREAD_EXPLICIT_SCHED; - - result = pthread_attr_setinheritsched( &attr, inheritsched ); -} diff --git a/testsuites/psxtests/psxhdrs/pthread16.c b/testsuites/psxtests/psxhdrs/pthread16.c deleted file mode 100644 index 8d8cb4a8db..0000000000 --- a/testsuites/psxtests/psxhdrs/pthread16.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREAD_PRIORITY_SCHEDULING -#error "RTEMS is supposed to have pthread_attr_getinheritsched" -#endif - -void test( void ) -{ - pthread_attr_t attr; - int inheritsched; - int result; - - result = pthread_attr_getinheritsched( &attr, &inheritsched ); -} diff --git a/testsuites/psxtests/psxhdrs/pthread17.c b/testsuites/psxtests/psxhdrs/pthread17.c deleted file mode 100644 index bd259f7165..0000000000 --- a/testsuites/psxtests/psxhdrs/pthread17.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREAD_PRIORITY_SCHEDULING -#error "RTEMS is supposed to have pthread_attr_setschedpolicy" -#endif - -void test( void ) -{ - pthread_attr_t attr; - int policy; - int result; - - policy = SCHED_FIFO; - policy = SCHED_RR; - policy = SCHED_OTHER; -#ifdef _POSIX_SPORADIC_SERVER - policy = SCHED_SPORADIC; -#endif - - result = pthread_attr_setschedpolicy( &attr, policy ); -} diff --git a/testsuites/psxtests/psxhdrs/pthread18.c b/testsuites/psxtests/psxhdrs/pthread18.c deleted file mode 100644 index aeb3e630d4..0000000000 --- a/testsuites/psxtests/psxhdrs/pthread18.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREAD_PRIORITY_SCHEDULING -#error "RTEMS is supposed to have pthread_attr_getschedpolicy" -#endif - -void test( void ) -{ - pthread_attr_t attr; - int policy; - int result; - - result = pthread_attr_getschedpolicy( &attr, &policy ); -} diff --git a/testsuites/psxtests/psxhdrs/pthread19.c b/testsuites/psxtests/psxhdrs/pthread19.c deleted file mode 100644 index f14a1d6241..0000000000 --- a/testsuites/psxtests/psxhdrs/pthread19.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREAD_PRIORITY_SCHEDULING -#error "RTEMS is supposed to have pthread_attr_setschedparam" -#endif - -void test( void ) -{ - pthread_attr_t attr; - struct sched_param param; - int result; - - result = pthread_attr_setschedparam( &attr, ¶m ); -} diff --git a/testsuites/psxtests/psxhdrs/pthread20.c b/testsuites/psxtests/psxhdrs/pthread20.c deleted file mode 100644 index b679521082..0000000000 --- a/testsuites/psxtests/psxhdrs/pthread20.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREAD_PRIORITY_SCHEDULING -#error "RTEMS is supposed to have pthread_attr_getschedparam" -#endif - -void test( void ) -{ - pthread_attr_t attr; - struct sched_param param; - int result; - - result = pthread_attr_getschedparam( &attr, ¶m ); -} diff --git a/testsuites/psxtests/psxhdrs/pthread21.c b/testsuites/psxtests/psxhdrs/pthread21.c deleted file mode 100644 index 9507ac36d5..0000000000 --- a/testsuites/psxtests/psxhdrs/pthread21.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_detach" -#endif - -void test( void ) -{ - pthread_t thread; - int result; - - thread = 0; - result = pthread_detach( thread ); -} diff --git a/testsuites/psxtests/psxhdrs/pthread22.c b/testsuites/psxtests/psxhdrs/pthread22.c deleted file mode 100644 index ff889d37d2..0000000000 --- a/testsuites/psxtests/psxhdrs/pthread22.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREAD_PRIORITY_SCHEDULING -#error "RTEMS is supposed to have pthread_setschedparam" -#endif - -void test( void ) -{ - pthread_t thread = 0; - int policy; - struct sched_param param; - int result; - - policy = SCHED_OTHER; - policy = SCHED_FIFO; - policy = SCHED_RR; -#ifdef _POSIX_SPORADIC_SERVER - policy = SCHED_SPORADIC; -#endif - - /* - * really should use sched_get_priority_min() and sched_get_priority_max() - */ - - param.sched_priority = 0; -#ifdef _POSIX_SPORADIC_SERVER - param.ss_low_priority = 0; - param.ss_replenish_period.tv_sec = 0; - param.ss_replenish_period.tv_nsec = 0; - param.ss_initial_budget.tv_sec = 0; - param.ss_initial_budget.tv_nsec = 0; -#endif - - result = pthread_setschedparam( thread, policy, ¶m ); -} diff --git a/testsuites/psxtests/psxhdrs/pthread23.c b/testsuites/psxtests/psxhdrs/pthread23.c deleted file mode 100644 index 6dd04d9512..0000000000 --- a/testsuites/psxtests/psxhdrs/pthread23.c +++ /dev/null @@ -1,29 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREAD_PRIORITY_SCHEDULING -#error "RTEMS is supposed to have pthread_getschedparam" -#endif - -void test( void ) -{ - pthread_t thread = 0; - int policy; - struct sched_param param; - int result; - - result = pthread_getschedparam( thread, &policy, ¶m ); -} diff --git a/testsuites/psxtests/psxhdrs/pthread24.c b/testsuites/psxtests/psxhdrs/pthread24.c deleted file mode 100644 index 6727a5ea4d..0000000000 --- a/testsuites/psxtests/psxhdrs/pthread24.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include /* only for PTHREAD_STACK_MIN */ - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_setstackaddr" -#endif - -#ifndef _POSIX_THREAD_ATTR_STACKADDR -#error "rtems is supposed to have pthread_setstackaddr" -#endif - -void test( void ) -{ - pthread_attr_t attribute; - void *stackaddr; - int result; - - stackaddr = NULL; - - result = pthread_attr_setstackaddr( &attribute, stackaddr ); -} diff --git a/testsuites/psxtests/psxhdrs/pthread25.c b/testsuites/psxtests/psxhdrs/pthread25.c deleted file mode 100644 index 1b1bc57502..0000000000 --- a/testsuites/psxtests/psxhdrs/pthread25.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include /* only for PTHREAD_STACK_MIN */ - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_getstackaddr" -#endif - -#ifndef _POSIX_THREAD_ATTR_STACKADDR -#error "rtems is supposed to have pthread_getstackaddr" -#endif - -void test( void ) -{ - pthread_attr_t attribute; - void *stackaddr; - int result; - - result = pthread_attr_getstackaddr( &attribute, &stackaddr ); -} diff --git a/testsuites/psxtests/psxhdrs/pthread26.c b/testsuites/psxtests/psxhdrs/pthread26.c deleted file mode 100644 index e4d61e39fc..0000000000 --- a/testsuites/psxtests/psxhdrs/pthread26.c +++ /dev/null @@ -1,30 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_join" -#endif - -void test( void ) -{ - pthread_t thread; - void *value_ptr; - int result; - - thread = 0; - - result = pthread_join( thread, &value_ptr ); -} diff --git a/testsuites/psxtests/psxhdrs/pthread27.c b/testsuites/psxtests/psxhdrs/pthread27.c deleted file mode 100644 index cf152962d0..0000000000 --- a/testsuites/psxtests/psxhdrs/pthread27.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_once" -#endif - -void init_routine( void ) -{ -} - -void test( void ) -{ - pthread_once_t once_control = PTHREAD_ONCE_INIT; - int result; - - result = pthread_once( &once_control, init_routine ); -} diff --git a/testsuites/psxtests/psxhdrs/pthread28.c b/testsuites/psxtests/psxhdrs/pthread28.c deleted file mode 100644 index 011ddea8f5..0000000000 --- a/testsuites/psxtests/psxhdrs/pthread28.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_cancel" -#endif - -void init_routine( void ) -{ -} - -void test( void ) -{ - pthread_t thread; - int result; - - thread = 0; - result = pthread_cancel( thread ); -} diff --git a/testsuites/psxtests/psxhdrs/pthread29.c b/testsuites/psxtests/psxhdrs/pthread29.c deleted file mode 100644 index 5bc5dc0a69..0000000000 --- a/testsuites/psxtests/psxhdrs/pthread29.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_setcancelstate" -#endif - -void init_routine( void ) -{ -} - -void test( void ) -{ - int state; - int oldstate; - int result; - - state = PTHREAD_CANCEL_ENABLE; - state = PTHREAD_CANCEL_DISABLE; - - result = pthread_setcancelstate( state, &oldstate ); -} diff --git a/testsuites/psxtests/psxhdrs/pthread30.c b/testsuites/psxtests/psxhdrs/pthread30.c deleted file mode 100644 index bb9e1da558..0000000000 --- a/testsuites/psxtests/psxhdrs/pthread30.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_setcanceltype" -#endif - -void init_routine( void ) -{ -} - -void test( void ) -{ - int type; - int oldtype; - int result; - - type = PTHREAD_CANCEL_DEFERRED; - type = PTHREAD_CANCEL_ASYNCHRONOUS; - - result = pthread_setcanceltype( type, &oldtype ); -} diff --git a/testsuites/psxtests/psxhdrs/pthread31.c b/testsuites/psxtests/psxhdrs/pthread31.c deleted file mode 100644 index d12df9829e..0000000000 --- a/testsuites/psxtests/psxhdrs/pthread31.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_testcancel" -#endif - -void init_routine( void ) -{ -} - -void test( void ) -{ - pthread_testcancel(); -} diff --git a/testsuites/psxtests/psxhdrs/pthread32.c b/testsuites/psxtests/psxhdrs/pthread32.c deleted file mode 100644 index 0b03fd9e47..0000000000 --- a/testsuites/psxtests/psxhdrs/pthread32.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_cleanup_push" -#endif - -void cleanup_routine( - void *argument -) -{ -} - -void test( void ) -{ - int argument; - - argument = 0; - - pthread_cleanup_push( cleanup_routine, &argument ); -} diff --git a/testsuites/psxtests/psxhdrs/pthread33.c b/testsuites/psxtests/psxhdrs/pthread33.c deleted file mode 100644 index 88ed3e7127..0000000000 --- a/testsuites/psxtests/psxhdrs/pthread33.c +++ /dev/null @@ -1,24 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_cleanup_pop" -#endif - -void test( void ) -{ - pthread_cleanup_pop( 1 ); -} diff --git a/testsuites/psxtests/psxhdrs/pthread34.c b/testsuites/psxtests/psxhdrs/pthread34.c deleted file mode 100644 index 9d4072102a..0000000000 --- a/testsuites/psxtests/psxhdrs/pthread34.c +++ /dev/null @@ -1,30 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREAD_CPUTIME -#error "rtems is supposed to have pthread_getcpuclockid" -#endif - -void test( void ) -{ - pthread_t thread; - clockid_t clock_id; - int result; - - thread = 0; - - result = pthread_getcpuclockid( thread, &clock_id ); -} diff --git a/testsuites/psxtests/psxhdrs/pthread35.c b/testsuites/psxtests/psxhdrs/pthread35.c deleted file mode 100644 index a53aaeedcb..0000000000 --- a/testsuites/psxtests/psxhdrs/pthread35.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREAD_CPUTIME -#error "rtems is supposed to have pthread_attr_setcputime" -#endif - -void test( void ) -{ - pthread_attr_t attr; - int clock_allowed; - int result; - - clock_allowed = CLOCK_ALLOWED; - clock_allowed = CLOCK_DISALLOWED; - - result = pthread_attr_setcputime( &attr, clock_allowed ); -} diff --git a/testsuites/psxtests/psxhdrs/pthread36.c b/testsuites/psxtests/psxhdrs/pthread36.c deleted file mode 100644 index 21e503865d..0000000000 --- a/testsuites/psxtests/psxhdrs/pthread36.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREAD_CPUTIME -#error "rtems is supposed to have pthread_attr_getcputime" -#endif - -void test( void ) -{ - pthread_attr_t attr; - int clock_allowed; - int result; - - result = pthread_attr_getcputime( &attr, &clock_allowed ); -} diff --git a/testsuites/psxtests/psxhdrs/sched01.c b/testsuites/psxtests/psxhdrs/sched01.c deleted file mode 100644 index 5b48736b09..0000000000 --- a/testsuites/psxtests/psxhdrs/sched01.c +++ /dev/null @@ -1,43 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_PRIORITY_SCHEDULING -#error "rtems is supposed to have sched_setparam" -#endif - -void test( void ) -{ - pid_t pid; - struct sched_param param; - int result; - - pid = 0; - - /* - * really should use sched_get_priority_min() and sched_get_priority_max() - */ - - param.sched_priority = 0; -#ifdef _POSIX_SPORADIC_SERVER - param.ss_low_priority = 0; - param.ss_replenish_period.tv_sec = 0; - param.ss_replenish_period.tv_nsec = 0; - param.ss_initial_budget.tv_sec = 0; - param.ss_initial_budget.tv_nsec = 0; -#endif - - result = sched_setparam( pid, ¶m ); -} diff --git a/testsuites/psxtests/psxhdrs/sched02.c b/testsuites/psxtests/psxhdrs/sched02.c deleted file mode 100644 index 8e66cfba46..0000000000 --- a/testsuites/psxtests/psxhdrs/sched02.c +++ /dev/null @@ -1,30 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_PRIORITY_SCHEDULING -#error "rtems is supposed to have sched_getparam" -#endif - -void test( void ) -{ - pid_t pid; - struct sched_param param; - int result; - - pid = 0; - - result = sched_getparam( pid, ¶m ); -} diff --git a/testsuites/psxtests/psxhdrs/sched03.c b/testsuites/psxtests/psxhdrs/sched03.c deleted file mode 100644 index 16e2aad92d..0000000000 --- a/testsuites/psxtests/psxhdrs/sched03.c +++ /dev/null @@ -1,51 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_PRIORITY_SCHEDULING -#error "rtems is supposed to have sched_setscheduler" -#endif - -void test( void ) -{ - pid_t pid; - int policy; - struct sched_param param; - int result; - - pid = 0; - - policy = SCHED_RR; - policy = SCHED_FIFO; - policy = SCHED_OTHER; -#ifdef _POSIX_SPORADIC_SERVER - policy = SCHED_SPORADIC; -#endif - - /* - * really should use sched_get_priority_min() and sched_get_priority_max() - */ - - param.sched_priority = 0; -#ifdef _POSIX_SPORADIC_SERVER - param.ss_low_priority = 0; - param.ss_replenish_period.tv_sec = 0; - param.ss_replenish_period.tv_nsec = 0; - param.ss_initial_budget.tv_sec = 0; - param.ss_initial_budget.tv_nsec = 0; -#endif - - result = sched_setscheduler( pid, policy, ¶m ); -} diff --git a/testsuites/psxtests/psxhdrs/sched04.c b/testsuites/psxtests/psxhdrs/sched04.c deleted file mode 100644 index ba81adb78d..0000000000 --- a/testsuites/psxtests/psxhdrs/sched04.c +++ /dev/null @@ -1,29 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_PRIORITY_SCHEDULING -#error "rtems is supposed to have sched_getscheduler" -#endif - -void test( void ) -{ - pid_t pid; - int result; - - pid = 0; - - result = sched_getscheduler( pid ); -} diff --git a/testsuites/psxtests/psxhdrs/sched05.c b/testsuites/psxtests/psxhdrs/sched05.c deleted file mode 100644 index 158484b96c..0000000000 --- a/testsuites/psxtests/psxhdrs/sched05.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_PRIORITY_SCHEDULING -#error "rtems is supposed to have sched_yield" -#endif - -void test( void ) -{ - int result; - - result = sched_yield(); -} diff --git a/testsuites/psxtests/psxhdrs/sched06.c b/testsuites/psxtests/psxhdrs/sched06.c deleted file mode 100644 index fdcb08eac5..0000000000 --- a/testsuites/psxtests/psxhdrs/sched06.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_PRIORITY_SCHEDULING -#error "rtems is supposed to have sched_get_priority_max" -#endif - -void test( void ) -{ - int policy; - int result; - - policy = SCHED_RR; - policy = SCHED_FIFO; - policy = SCHED_OTHER; -#ifdef _POSIX_SPORADIC_SERVER - policy = SCHED_SPORADIC; -#endif - - result = sched_get_priority_max( policy ); -} diff --git a/testsuites/psxtests/psxhdrs/sched07.c b/testsuites/psxtests/psxhdrs/sched07.c deleted file mode 100644 index a41bbba830..0000000000 --- a/testsuites/psxtests/psxhdrs/sched07.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_PRIORITY_SCHEDULING -#error "rtems is supposed to have sched_get_priority_min" -#endif - -void test( void ) -{ - int policy; - int result; - - policy = SCHED_RR; - policy = SCHED_FIFO; - policy = SCHED_OTHER; -#ifdef _POSIX_SPORADIC_SERVER - policy = SCHED_SPORADIC; -#endif - - result = sched_get_priority_min( policy ); -} diff --git a/testsuites/psxtests/psxhdrs/sched08.c b/testsuites/psxtests/psxhdrs/sched08.c deleted file mode 100644 index 8596ef60a0..0000000000 --- a/testsuites/psxtests/psxhdrs/sched08.c +++ /dev/null @@ -1,30 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_PRIORITY_SCHEDULING -#error "rtems is supposed to have sched_rr_get_interval" -#endif - -void test( void ) -{ - pid_t pid; - struct timespec interval; - int result; - - pid = 0; - - result = sched_rr_get_interval( pid, &interval ); -} diff --git a/testsuites/psxtests/psxhdrs/signal01.c b/testsuites/psxtests/psxhdrs/signal01.c deleted file mode 100644 index 50ee847513..0000000000 --- a/testsuites/psxtests/psxhdrs/signal01.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -void test( void ) -{ - sigset_t signal_set; - int signal_number; - int result; - - signal_number = SIGALRM; - - result = sigaddset( &signal_set, signal_number ); -} diff --git a/testsuites/psxtests/psxhdrs/signal02.c b/testsuites/psxtests/psxhdrs/signal02.c deleted file mode 100644 index 16e3771b48..0000000000 --- a/testsuites/psxtests/psxhdrs/signal02.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -void test( void ) -{ - sigset_t signal_set; - int signal_number; - int result; - - signal_number = SIGALRM; - - result = sigdelset( &signal_set, signal_number ); -} diff --git a/testsuites/psxtests/psxhdrs/signal03.c b/testsuites/psxtests/psxhdrs/signal03.c deleted file mode 100644 index bb17812a39..0000000000 --- a/testsuites/psxtests/psxhdrs/signal03.c +++ /dev/null @@ -1,23 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -void test( void ) -{ - sigset_t signal_set; - int result; - - result = sigfillset( &signal_set ); -} diff --git a/testsuites/psxtests/psxhdrs/signal04.c b/testsuites/psxtests/psxhdrs/signal04.c deleted file mode 100644 index 8b0c960dcf..0000000000 --- a/testsuites/psxtests/psxhdrs/signal04.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -void test( void ) -{ - sigset_t signal_set; - int signal_number; - int result; - - signal_number = SIGALRM; - - result = sigismember( &signal_set, signal_number ); -} diff --git a/testsuites/psxtests/psxhdrs/signal05.c b/testsuites/psxtests/psxhdrs/signal05.c deleted file mode 100644 index c21a79abbc..0000000000 --- a/testsuites/psxtests/psxhdrs/signal05.c +++ /dev/null @@ -1,23 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -void test( void ) -{ - sigset_t signal_set; - int result; - - result = sigemptyset( &signal_set ); -} diff --git a/testsuites/psxtests/psxhdrs/signal06.c b/testsuites/psxtests/psxhdrs/signal06.c deleted file mode 100644 index f7eaff884a..0000000000 --- a/testsuites/psxtests/psxhdrs/signal06.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -void test( void ) -{ - int signal_number; - struct sigaction act; - struct sigaction oact; - int result; - - signal_number = SIGALRM; - - /* - * Really should not reference sa_handler and sa_signction simultaneously. - */ - - act.sa_handler = SIG_DFL; - act.sa_handler = SIG_IGN; - act.sa_mask = 0; - act.sa_flags = SA_NOCLDSTOP; - act.sa_flags = SA_SIGINFO; - act.sa_sigaction = NULL; - - result = sigaction( signal_number, &act, &oact ); -} diff --git a/testsuites/psxtests/psxhdrs/signal07.c b/testsuites/psxtests/psxhdrs/signal07.c deleted file mode 100644 index 0fe5817a70..0000000000 --- a/testsuites/psxtests/psxhdrs/signal07.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_kill" -#endif - -void test( void ) -{ - pthread_t thread; - int signal_number; - int result; - - thread = 0; - signal_number = SIGALRM; - - result = pthread_kill( thread, signal_number ); -} diff --git a/testsuites/psxtests/psxhdrs/signal08.c b/testsuites/psxtests/psxhdrs/signal08.c deleted file mode 100644 index 295800e599..0000000000 --- a/testsuites/psxtests/psxhdrs/signal08.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#error "rtems is supposed to have pthread_sigmask" -#endif - -void test( void ) -{ - int how; - sigset_t set; - sigset_t oset; - int result; - - how = SIG_BLOCK; - how = SIG_UNBLOCK; - how = SIG_SETMASK; - - result = pthread_sigmask( how, &set, &oset ); -} diff --git a/testsuites/psxtests/psxhdrs/signal09.c b/testsuites/psxtests/psxhdrs/signal09.c deleted file mode 100644 index 97c7eddcef..0000000000 --- a/testsuites/psxtests/psxhdrs/signal09.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include - -void test( void ) -{ - pid_t pid; - int signal_number; - int result; - - pid = 0; - signal_number = SIGALRM; - - result = kill( pid, signal_number ); -} diff --git a/testsuites/psxtests/psxhdrs/signal10.c b/testsuites/psxtests/psxhdrs/signal10.c deleted file mode 100644 index a3155e1a67..0000000000 --- a/testsuites/psxtests/psxhdrs/signal10.c +++ /dev/null @@ -1,24 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -void test( void ) -{ - sigset_t set; - int sig; - int result; - - result = sigwait( &set, &sig ); -} diff --git a/testsuites/psxtests/psxhdrs/signal11.c b/testsuites/psxtests/psxhdrs/signal11.c deleted file mode 100644 index 63a840aeac..0000000000 --- a/testsuites/psxtests/psxhdrs/signal11.c +++ /dev/null @@ -1,25 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -void test( void ) -{ - int signal_number; - int result; - - signal_number = SIGALRM; - - result = raise( signal_number ); -} diff --git a/testsuites/psxtests/psxhdrs/signal12.c b/testsuites/psxtests/psxhdrs/signal12.c deleted file mode 100644 index 85d4dd5c47..0000000000 --- a/testsuites/psxtests/psxhdrs/signal12.c +++ /dev/null @@ -1,25 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -void test( void ) -{ - void (*signal_function_pointer)(); - int signal_number; - - signal_number = SIGALRM; - - signal_function_pointer = signal( signal_number, SIG_IGN ); -} diff --git a/testsuites/psxtests/psxhdrs/signal13.c b/testsuites/psxtests/psxhdrs/signal13.c deleted file mode 100644 index 7b177dd3ff..0000000000 --- a/testsuites/psxtests/psxhdrs/signal13.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -void test( void ) -{ - int how; - sigset_t set; - sigset_t oset; - int result; - - how = SIG_BLOCK; - how = SIG_UNBLOCK; - how = SIG_SETMASK; - - (void) sigemptyset( &set ); - - result = sigprocmask( how, &set, &oset ); -} diff --git a/testsuites/psxtests/psxhdrs/signal14.c b/testsuites/psxtests/psxhdrs/signal14.c deleted file mode 100644 index 20c6a9cf71..0000000000 --- a/testsuites/psxtests/psxhdrs/signal14.c +++ /dev/null @@ -1,25 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -void test( void ) -{ - sigset_t set; - int result; - - (void) sigemptyset( &set ); - - result = sigpending( &set ); -} diff --git a/testsuites/psxtests/psxhdrs/signal15.c b/testsuites/psxtests/psxhdrs/signal15.c deleted file mode 100644 index ddb1972d4f..0000000000 --- a/testsuites/psxtests/psxhdrs/signal15.c +++ /dev/null @@ -1,25 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -void test( void ) -{ - sigset_t sigmask; - int result; - - (void) sigemptyset( &sigmask ); - - result = sigsuspend( &sigmask ); -} diff --git a/testsuites/psxtests/psxhdrs/signal16.c b/testsuites/psxtests/psxhdrs/signal16.c deleted file mode 100644 index dca42d55bd..0000000000 --- a/testsuites/psxtests/psxhdrs/signal16.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_THREADS -#define "rtems is supposed to have pthread_sigmask" -#endif - -void test( void ) -{ - int how; - sigset_t set; - sigset_t oset; - int result; - - how = SIG_BLOCK; - how = SIG_UNBLOCK; - how = SIG_SETMASK; - - (void) sigemptyset( &set ); - - result = pthread_sigmask( how, &set, &oset ); -} diff --git a/testsuites/psxtests/psxhdrs/signal17.c b/testsuites/psxtests/psxhdrs/signal17.c deleted file mode 100644 index d9f4def624..0000000000 --- a/testsuites/psxtests/psxhdrs/signal17.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -void test( void ) -{ - sigset_t set; - siginfo_t info; - int result; - - (void) sigemptyset( &set ); - - result = sigwaitinfo( &set, &info ); -} diff --git a/testsuites/psxtests/psxhdrs/signal18.c b/testsuites/psxtests/psxhdrs/signal18.c deleted file mode 100644 index fe067a0886..0000000000 --- a/testsuites/psxtests/psxhdrs/signal18.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -void test( void ) -{ - sigset_t set; - siginfo_t info; - struct timespec timeout; - int result; - - (void) sigemptyset( &set ); - - result = sigtimedwait( &set, &info, &timeout ); -} diff --git a/testsuites/psxtests/psxhdrs/signal19.c b/testsuites/psxtests/psxhdrs/signal19.c deleted file mode 100644 index d8852d32ef..0000000000 --- a/testsuites/psxtests/psxhdrs/signal19.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -void test( void ) -{ - sigset_t set; - int sig; - int result; - - (void) sigemptyset( &set ); - - result = sigwait( &set, &sig ); -} diff --git a/testsuites/psxtests/psxhdrs/signal20.c b/testsuites/psxtests/psxhdrs/signal20.c deleted file mode 100644 index aaf75a8611..0000000000 --- a/testsuites/psxtests/psxhdrs/signal20.c +++ /dev/null @@ -1,25 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -void test( void ) -{ - unsigned int seconds; - unsigned int result; - - seconds = 10; - - result = alarm( seconds ); -} diff --git a/testsuites/psxtests/psxhdrs/signal21.c b/testsuites/psxtests/psxhdrs/signal21.c deleted file mode 100644 index 756147c2fd..0000000000 --- a/testsuites/psxtests/psxhdrs/signal21.c +++ /dev/null @@ -1,22 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -void test( void ) -{ - int result; - - result = pause(); -} diff --git a/testsuites/psxtests/psxhdrs/signal22.c b/testsuites/psxtests/psxhdrs/signal22.c deleted file mode 100644 index 6685ff6dea..0000000000 --- a/testsuites/psxtests/psxhdrs/signal22.c +++ /dev/null @@ -1,25 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -void test( void ) -{ - unsigned int seconds; - unsigned int result; - - seconds = 10; - - result = sleep( seconds ); -} diff --git a/testsuites/psxtests/psxhdrs/time01.c b/testsuites/psxtests/psxhdrs/time01.c deleted file mode 100644 index a9608adbf8..0000000000 --- a/testsuites/psxtests/psxhdrs/time01.c +++ /dev/null @@ -1,22 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -void test( void ) -{ - clock_t clock_ticks; - - clock_ticks = clock(); -} diff --git a/testsuites/psxtests/psxhdrs/time02.c b/testsuites/psxtests/psxhdrs/time02.c deleted file mode 100644 index ecb890e72f..0000000000 --- a/testsuites/psxtests/psxhdrs/time02.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -void test( void ) -{ - time_t time1; - time_t time2; - double difference; - - time1 = 0; - time2 = 0; - - difference = difftime( time1, time2 ); -} diff --git a/testsuites/psxtests/psxhdrs/time03.c b/testsuites/psxtests/psxhdrs/time03.c deleted file mode 100644 index a031109b6e..0000000000 --- a/testsuites/psxtests/psxhdrs/time03.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -void test( void ) -{ - struct tm timestruct; - time_t time_encoded; - - timestruct.tm_sec = 0; - timestruct.tm_min = 0; - timestruct.tm_hour = 0; - timestruct.tm_mday = 1; - timestruct.tm_mon = 0; - timestruct.tm_year = 0; - timestruct.tm_wday = 0; - timestruct.tm_yday = 0; - timestruct.tm_isdst = 0; - - time_encoded = mktime( ×truct ); -} diff --git a/testsuites/psxtests/psxhdrs/time04.c b/testsuites/psxtests/psxhdrs/time04.c deleted file mode 100644 index 72cdc5aeb3..0000000000 --- a/testsuites/psxtests/psxhdrs/time04.c +++ /dev/null @@ -1,22 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -void test( void ) -{ - time_t new_time; - - new_time = time( &new_time ); -} diff --git a/testsuites/psxtests/psxhdrs/time05.c b/testsuites/psxtests/psxhdrs/time05.c deleted file mode 100644 index 62b4b2d85a..0000000000 --- a/testsuites/psxtests/psxhdrs/time05.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -void test( void ) -{ - size_t length; - size_t max_length; - char buffer[ 80 ]; - struct tm timestruct; - - max_length = sizeof( buffer ); - - length = strftime( buffer, max_length, "%A", ×truct ); -} diff --git a/testsuites/psxtests/psxhdrs/time06.c b/testsuites/psxtests/psxhdrs/time06.c deleted file mode 100644 index 9b694bfe11..0000000000 --- a/testsuites/psxtests/psxhdrs/time06.c +++ /dev/null @@ -1,23 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -void test( void ) -{ - char *buffer; - struct tm timestruct; - - buffer = asctime( ×truct ); -} diff --git a/testsuites/psxtests/psxhdrs/time07.c b/testsuites/psxtests/psxhdrs/time07.c deleted file mode 100644 index 6eda111f6f..0000000000 --- a/testsuites/psxtests/psxhdrs/time07.c +++ /dev/null @@ -1,23 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -void test( void ) -{ - char *buffer; - time_t time; - - buffer = ctime( &time ); -} diff --git a/testsuites/psxtests/psxhdrs/time08.c b/testsuites/psxtests/psxhdrs/time08.c deleted file mode 100644 index 84a5b9e711..0000000000 --- a/testsuites/psxtests/psxhdrs/time08.c +++ /dev/null @@ -1,23 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -void test( void ) -{ - time_t time; - struct tm *timestruct; - - timestruct = gmtime( &time ); -} diff --git a/testsuites/psxtests/psxhdrs/time09.c b/testsuites/psxtests/psxhdrs/time09.c deleted file mode 100644 index c92072ffc0..0000000000 --- a/testsuites/psxtests/psxhdrs/time09.c +++ /dev/null @@ -1,23 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -void test( void ) -{ - time_t time; - struct tm *timestruct; - - timestruct = localtime( &time ); -} diff --git a/testsuites/psxtests/psxhdrs/time10.c b/testsuites/psxtests/psxhdrs/time10.c deleted file mode 100644 index b27be5037c..0000000000 --- a/testsuites/psxtests/psxhdrs/time10.c +++ /dev/null @@ -1,24 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -void test( void ) -{ - char *buffer_pointer; - struct tm timestruct; - char buffer[ 80 ]; - - buffer_pointer = asctime_r( ×truct, buffer ); -} diff --git a/testsuites/psxtests/psxhdrs/time11.c b/testsuites/psxtests/psxhdrs/time11.c deleted file mode 100644 index 5fea8b4415..0000000000 --- a/testsuites/psxtests/psxhdrs/time11.c +++ /dev/null @@ -1,24 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -void test( void ) -{ - char *buffer_pointer; - char buffer[ 80 ]; - time_t time; - - buffer_pointer = ctime_r( &time, buffer ); -} diff --git a/testsuites/psxtests/psxhdrs/time12.c b/testsuites/psxtests/psxhdrs/time12.c deleted file mode 100644 index 5fd0cd856d..0000000000 --- a/testsuites/psxtests/psxhdrs/time12.c +++ /dev/null @@ -1,24 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -void test( void ) -{ - time_t time; - struct tm *timestruct_pointer; - struct tm timestruct; - - timestruct_pointer = gmtime_r( &time, ×truct ); -} diff --git a/testsuites/psxtests/psxhdrs/time13.c b/testsuites/psxtests/psxhdrs/time13.c deleted file mode 100644 index 39c738ddbd..0000000000 --- a/testsuites/psxtests/psxhdrs/time13.c +++ /dev/null @@ -1,24 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -void test( void ) -{ - time_t time; - struct tm *timestruct_pointer; - struct tm timestruct; - - timestruct_pointer = localtime_r( &time, ×truct ); -} diff --git a/testsuites/psxtests/psxhdrs/timer01.c b/testsuites/psxtests/psxhdrs/timer01.c deleted file mode 100644 index d2a01e0252..0000000000 --- a/testsuites/psxtests/psxhdrs/timer01.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_TIMERS -#error "rtems is supposed to have timer_create" -#endif - -void test( void ) -{ - clockid_t clock_id = 0; - timer_t timerid = 0; - struct sigevent evp; - int result; - - evp.sigev_notify = SIGEV_NONE; - evp.sigev_notify = SIGEV_SIGNAL; - evp.sigev_notify = SIGEV_THREAD; - evp.sigev_signo = SIGALRM; - evp.sigev_value.sival_int = 0; - evp.sigev_value.sival_ptr = NULL; - - result = timer_create( clock_id, &evp, &timerid ); -} diff --git a/testsuites/psxtests/psxhdrs/timer02.c b/testsuites/psxtests/psxhdrs/timer02.c deleted file mode 100644 index e2116d0362..0000000000 --- a/testsuites/psxtests/psxhdrs/timer02.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_TIMERS -#error "rtems is supposed to have timer_delete" -#endif - -void test( void ) -{ - timer_t timerid = 0; - int result; - - result = timer_delete( timerid ); -} diff --git a/testsuites/psxtests/psxhdrs/timer03.c b/testsuites/psxtests/psxhdrs/timer03.c deleted file mode 100644 index d499f079d6..0000000000 --- a/testsuites/psxtests/psxhdrs/timer03.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_TIMERS -#error "rtems is supposed to have timer_settime" -#endif - -void test( void ) -{ - timer_t timerid = 0; - int flags; - struct itimerspec value; - struct itimerspec ovalue; - int result; - - value.it_interval.tv_sec = 0; - value.it_interval.tv_nsec = 0; - value.it_value.tv_sec = 0; - value.it_value.tv_nsec = 0; - - flags = TIMER_ABSTIME; - flags = CLOCK_REALTIME; - - result = timer_settime( timerid, flags, &value, &ovalue ); -} diff --git a/testsuites/psxtests/psxhdrs/timer04.c b/testsuites/psxtests/psxhdrs/timer04.c deleted file mode 100644 index d0ee86e38b..0000000000 --- a/testsuites/psxtests/psxhdrs/timer04.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_TIMERS -#error "rtems is supposed to have timer_gettime" -#endif - -void test( void ) -{ - timer_t timerid = 0; - struct itimerspec value; - int result; - - result = timer_gettime( timerid, &value ); -} diff --git a/testsuites/psxtests/psxhdrs/timer05.c b/testsuites/psxtests/psxhdrs/timer05.c deleted file mode 100644 index aac3e4e3ec..0000000000 --- a/testsuites/psxtests/psxhdrs/timer05.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_TIMERS -#error "rtems is supposed to have timer_getoverrun" -#endif - -void test( void ) -{ - timer_t timerid = 0; - int result; - - result = timer_getoverrun( timerid ); -} diff --git a/testsuites/psxtests/psxhdrs/timer06.c b/testsuites/psxtests/psxhdrs/timer06.c deleted file mode 100644 index 4db7cc524c..0000000000 --- a/testsuites/psxtests/psxhdrs/timer06.c +++ /dev/null @@ -1,30 +0,0 @@ -/* - * This test file is used to verify that the header files associated with - * invoking this function are correct. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -#ifndef _POSIX_TIMERS -#error "rtems is supposed to have nanosleep" -#endif - -void test( void ) -{ - struct timespec rqtp; - struct timespec rmtp; - int result; - - rqtp.tv_sec = 0; - rqtp.tv_nsec = 0; - result = nanosleep( &rqtp, &rmtp ); -} diff --git a/testsuites/psxtests/psxmount/.cvsignore b/testsuites/psxtests/psxmount/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/psxtests/psxmount/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/psxtests/psxmount/Makefile.am b/testsuites/psxtests/psxmount/Makefile.am deleted file mode 100644 index 84158cdee7..0000000000 --- a/testsuites/psxtests/psxmount/Makefile.am +++ /dev/null @@ -1,41 +0,0 @@ -## -## $Id$ -## - - -TEST = psxmount - -MANAGERS = all - -C_FILES = main.c test.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -DOCTYPES = scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/psxtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -AM_CPPFLAGS += -I$(top_srcdir)/include - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/psxtests/psxmount/main.c b/testsuites/psxtests/psxmount/main.c deleted file mode 100644 index 8bf5f72b7f..0000000000 --- a/testsuites/psxtests/psxmount/main.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Simple test program -- check out of the basic file system mounting - * capabilities - * Attempt to mount the IMFS file system on a mount point in the base IMFS - */ - -#define TEST_INIT - -#include -#include - -void test_main( void ); - -rtems_task Init( - rtems_task_argument ignored -) -{ - test_main(); - rtems_test_exit( 0 ); -} - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER - -#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM -#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 10 - -#define CONFIGURE_MAXIMUM_TASKS 1 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_INIT - -#include - -/* end of file */ diff --git a/testsuites/psxtests/psxmount/psxmount.scn b/testsuites/psxtests/psxmount/psxmount.scn deleted file mode 100644 index 88c1fa9fbe..0000000000 --- a/testsuites/psxtests/psxmount/psxmount.scn +++ /dev/null @@ -1,86 +0,0 @@ - - -*** MOUNT/UNMOUNT TEST *** - -chdir to the root directory -chdir() status : 0 - - -Creating a series of directories under / -Creating : a 0 0 Success -Creating : b 0 0 Success -Creating : c 0 0 Success -Creating : d 0 0 Success -Creating : e 0 0 Success -Creating : f 0 0 Success -Creating : c/y 0 0 Success -Creating : c/z 0 0 Success -Creating : c/x 0 0 Success -Creating : c/y/a3333 0 0 Success -Creating : c/y/j123 0 0 Success -Creating : c/y/my_mount_point 0 0 Success -Creating : c/y/my_mount_point/my_dir 0 0 Success -Creating : c/z/my_mount_point 0 0 Success -create /b/my_file -Verify /b/my_file -create c/y/my_mount_point/my_dir/d -Verify c/y/my_mount_point/my_dir/d -Attempting to mount IMFS file system at /c/z/my_mount_point -2nd file system successfully mounted at /c/z/my_mount_point - -chdir to /c/z/my_mount_point. -chdir() status : 0 - - -Creating a series of directories under /c/z/my_mount_point -Creating: a 0 2 Success -Creating: b 0 2 Success -Creating: c 0 2 Success -Creating: d 0 2 Success -Creating: e 0 2 Success -Creating: f 0 2 Success -Creating: c/y 0 2 Success -Creating: c/z 0 2 Success -Creating: c/x 0 2 Success -Creating: c/y/a3333 0 2 Success -Creating: c/y/j123 0 2 Success -Creating: c/y/my_mount_point 0 2 Success -Creating: c/y/my_mount_point/my_dir 0 2 Success -Creating: c/y/my_mount_point/my_dir/d 0 2 Success -Creating: c/z/my_mount_point 0 2 Success -Creating: /c/z/my_mount_point/a/../../my_mount_point/a/g 0 2 Success - -chdir to / -chdir() status : 0 - -Unmount status: 0 -Mount a NULL file system and verify EINVAL -mount with option of -62 should fail with EINVAL -Mount a Read Only filesystem at /c/y/my_mount_point -Read only file system successfully mounted at /c/y/my_mount_point -create c/y/my_mount_point/../../y/my_mount_point/new_dir -Verify a mount point returns EBUSY for another mount -Mount on a file should fail with ENOTDIR -Create and chdir to /c/y/my_mount_point/mydir -unmount of /c/y/my_mount_point should fail with EBUSY -chdir to / and verify we can unmount /c/y/my_mount_point -unmount /c/y/my_mount_point -unmount /b/mount_point should fail with EINVAL -Mount /c/y/my_mount_point -Create and open /c/y/my_mount_point/my_file - -mkdir /c/y/my_mount_point/my_dir -Open /c/y/my_mount_point/my_dir -Unmount /c/y/my_mount_point should fail with EBUSY -Close /c/y/my_mount_point/my_dir -Unmount /c/y/my_mount_point/my_dir should fail with EACCES -Mount a file system at /c/y/my_mount_point/my_dir -unmount /c/y/my_mount_point should fail with EBUSY -Verify a hard link across filesystems fails with EXDEV -Verify a symbolic link across file systems works -unmount /c/y/my_mount_point/my_dir -Verify the symbolic link now fails -unmount /c/y/my_mount_point - - -*** END OF MOUNT/UNMOUNT TEST *** diff --git a/testsuites/psxtests/psxmount/test.c b/testsuites/psxtests/psxmount/test.c deleted file mode 100644 index bf4a704c26..0000000000 --- a/testsuites/psxtests/psxmount/test.c +++ /dev/null @@ -1,447 +0,0 @@ -/* - * This is a native test to explore how the readdir() family works. - * Newlib supports the following readdir() family members: - * - * closedir() - - * readdir() - - * scandir() - - * opendir() - - * rewinddir() - - * telldir() - BSD not in POSIX - * seekdir() - BSD not in POSIX - * - * - * seekdir() takes an offset which is a byte offset. The Linux - * implementation of this appears to seek to the ((off/DIRENT_SIZE) + 1) - * record where DIRENT_SIZE seems to be 12 bytes. - * - * - * - * $Id$ - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -extern rtems_filesystem_location_info_t rtems_filesystem_current; - -DIR *directory; -DIR *directory2; -DIR *directory3; -DIR *directory_not; - -#ifndef __P -#define __P(args)() -#endif - -char *dnames[] = { - "a", - "b", - "c", - "d", - "e", - "f", - "c/y", - "c/z", - "c/x", - "c/y/a3333", - "c/y/j123", - "c/y/my_mount_point", - "c/y/my_mount_point/my_dir", - "c/z/my_mount_point", - "END" -}; - -char *fnames[] = { - "a", - "b", - "c", - "d", - "e", - "f", - "c/y", - "c/z", - "c/x", - "c/y/a3333", - "c/y/j123", - "c/y/my_mount_point", - "c/y/my_mount_point/my_dir", - "c/y/my_mount_point/my_dir/d", - "c/z/my_mount_point", - "/c/z/my_mount_point/a/../../my_mount_point/a/g", - "END" -}; - -#if defined(__rtems__) -int test_main(void) -#else -int main( - int argc, - char **argv -) -#endif -{ - int i; - int fd; - int status; - struct stat statbuf; - rtems_filesystem_mount_table_entry_t *mt_entry; - static char mount_point_string[25] = { "/c/z/my_mount_point" }; - - - printf( "\n\n*** MOUNT/UNMOUNT TEST ***\n" ); - - /* - * Change directory to the root and create files under - * the base file system. - */ - - printf( "\nchdir to the root directory\n" ); - status = chdir( "/" ); - printf( "chdir() status : %d\n\n", status ); - - printf( "\nCreating a series of directories under /\n" ); - i=0; - while ( strcmp(dnames[i], "END") != 0 ) - { - status = mkdir( dnames[i], 0777 ); - printf("Creating : %25s %d %d ", dnames[i], status, errno ); - if ( status == 0 ) - printf(" Success\n"); - else - printf(" Failure\n"); - - i++; - } - - /* - * Create a Files with all rwx for others group and user. Verify - * the created file. - */ - - printf("create /b/my_file\n"); - fd = open ("/b/my_file", O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO); - assert( fd != 0 ); - close (fd); - - printf("Verify /b/my_file\n"); - fd = open("/b/my_file", S_IRWXU|S_IRWXG|S_IRWXO); - assert( fd != 0 ); - close( fd ); - - - printf("create c/y/my_mount_point/my_dir/d\n"); - fd = open ("c/y/my_mount_point/my_dir/d", O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO); - assert( fd != 0 ); - close (fd); - - printf("Verify c/y/my_mount_point/my_dir/d\n"); - fd = open("c/y/my_mount_point/my_dir/d", S_IRWXU|S_IRWXG|S_IRWXO); - assert( fd != 0 ); - close( fd ); - - /* - * Mount an the IMFS file system on the base file system. - */ - - printf("Attempting to mount IMFS file system at /c/z/my_mount_point \n"); - status = mount( - &mt_entry, - &IMFS_ops, - RTEMS_FILESYSTEM_READ_WRITE, - NULL, - mount_point_string ); - assert( status == 0 ); - if( mt_entry == NULL ){ - printf(" NULL mount table entry was returned\n"); - } - else { - printf("2nd file system successfully mounted at /c/z/my_mount_point \n"); - } - - /* - * Change directory to the mount point and create a group of files under - * the mounted file system. - */ - - printf( "\nchdir to /c/z/my_mount_point.\n" ); - status = chdir( "/c/z/my_mount_point" ); - printf( "chdir() status : %d\n\n", status ); - - printf( "\nCreating a series of directories under /c/z/my_mount_point\n" ); - i=0; - while ( strcmp(fnames[i], "END") != 0 ) - { - status = mkdir( fnames[i], 0777 ); - printf("Creating: %46s %d %d ", fnames[i], status, errno ); - if ( status == 0 ) - printf(" Success\n"); - else { - printf(" Failure\n"); - perror("errno"); - } - - status = stat( fnames[i], &statbuf ); - if ( status == -1 ) - printf( ": %s\n", strerror( errno ) ); - - i++; - } - - printf( "\nchdir to /\n" ); - status = chdir( "/" ); - printf( "chdir() status : %d\n\n", status ); - - /* - * Unmount the first file system we mounted - */ - - printf( "Unmount status:"); - status = unmount( "/c/z/my_mount_point" ); - printf( " %d\n", status ); - - - /* - * Mount a NULL filesystem and verify it fails. - */ - - printf("Mount a NULL file system and verify EINVAL\n"); - status = mount( - &mt_entry, - NULL, - RTEMS_FILESYSTEM_READ_WRITE, - NULL, - mount_point_string ); - assert( status == -1 ); - assert( errno == EINVAL ); - - /* - * Verify mount with option of -62 fails with EINVAL - */ - - printf("mount with option of -62 should fail with EINVAL\n"); - status = mount( - &mt_entry, - &IMFS_ops, - -62, - NULL, - "/c/y/my_mount_point" ); - assert( status == -1 ); - assert( errno == EINVAL ); - - /* - * Mount a Read Only File system. - */ - - printf("Mount a Read Only filesystem at /c/y/my_mount_point \n"); - status = mount( - &mt_entry, - &IMFS_ops, - RTEMS_FILESYSTEM_READ_ONLY, - NULL, - "/c/y/my_mount_point" ); - assert( status == 0 ); - if( mt_entry == NULL ){ - printf(" NULL mount table entry was returned\n"); - } - else { - printf("Read only file system successfully mounted at /c/y/my_mount_point \n"); - } - - /* - * Create a directory that passes through the read only file system. - */ - - printf("create c/y/my_mount_point/../../y/my_mount_point/new_dir\n"); - status = mkdir("c/y/my_mount_point/../../y/my_mount_point/new_dir",S_IRWXU ); - assert( status == 0 ); - status = stat("c/y/my_mount_point/../../y/my_mount_point/new_dir",&statbuf ); - assert( status == 0 ); - status = stat("c/y/my_mount_point/new_dir/..", &statbuf ); - assert( status == 0 ); - - /* - * Attempt to mount a second file system at a used mount point. - */ - - printf("Verify a mount point returns EBUSY for another mount\n"); - status = mount( - &mt_entry, - &IMFS_ops, - RTEMS_FILESYSTEM_READ_ONLY, - NULL, - "/c/y/my_mount_point" ); - assert( status == -1 ); - assert( errno == EBUSY); - - /* - * Attempt to mount at a file. - */ - - printf("Mount on a file should fail with ENOTDIR\n"); - status = mount( - &mt_entry, - &IMFS_ops, - RTEMS_FILESYSTEM_READ_ONLY, - NULL, - "/b/my_file" ); - assert( status == -1 ); - assert( errno == ENOTDIR ); - - - /* - * Verify we cannot unmount a file system while we are in it. - */ - - printf("Create and chdir to /c/y/my_mount_point/mydir\n"); - status = mkdir( "/c/y/my_mount_point/mydir", 0777); - assert( status == 0 ); - - status = chdir( "/c/y/my_mount_point/mydir" ); - assert( status == 0 ); - - printf("unmount of /c/y/my_mount_point should fail with EBUSY\n"); - status = unmount( "/c/y/my_mount_point" ); - assert( status == -1 ); - assert( errno == EBUSY ); - - /* - * Chdir to root and verify we can unmount the file system now. - */ - - printf("chdir to / and verify we can unmount /c/y/my_mount_point\n"); - status = chdir( "/" ); - assert( status == 0 ); - - printf("unmount /c/y/my_mount_point \n"); - status = unmount( "/c/y/my_mount_point" ); - assert( status == 0 ); - - /* - * Attempt to unmount a directory that does not exist. - */ - - printf("unmount /b/mount_point should fail with EINVAL\n"); - status = unmount( "/b/mount_point" ); - assert( status == -1 ); - assert( errno == ENOENT ); - - /* - * Remount the filesystem. - */ - - printf("Mount /c/y/my_mount_point\n"); - status = mount( - &mt_entry, - &IMFS_ops, - RTEMS_FILESYSTEM_READ_ONLY, - NULL, - "/c/y/my_mount_point" ); - assert( status == 0 ); - - /* - * Create a file and directory then open the directory. - * Verify unmount will return EBUSY while directory is open. - */ - - printf("Create and open /c/y/my_mount_point/my_file\n"); - fd = open( "/c/y/my_mount_point/my_file", O_CREAT, S_IRWXU|S_IRWXG|S_IRWXO); - assert( fd != -1 ); - status = close( fd ); - assert( status == 0 ); - - printf("\nmkdir /c/y/my_mount_point/my_dir\n"); - status = mkdir( "/c/y/my_mount_point/my_dir", 0x1c0 ); - printf("Open /c/y/my_mount_point/my_dir\n"); - directory = opendir( "/c/y/my_mount_point/my_dir" ); - assert( directory ); - - printf("Unmount /c/y/my_mount_point should fail with EBUSY\n"); - status = unmount( "/c/y/my_mount_point" ); - assert( status == -1 ); - assert( errno == EBUSY ); - - printf("Close /c/y/my_mount_point/my_dir\n"); - status = closedir( directory ); - assert( status == 0 ); - - /* - * Attempt to unmount a directory that is not a mount point. - */ - - printf("Unmount /c/y/my_mount_point/my_dir should fail with EACCES\n"); - status = unmount( "/c/y/my_mount_point/my_dir" ); - assert( status == -1 ); - assert( errno == EACCES ); - - /* - * Verify a file system can not be unmounted with a mounted file system - * in it. - */ - - printf("Mount a file system at /c/y/my_mount_point/my_dir\n"); - status = mount( - &mt_entry, - &IMFS_ops, - RTEMS_FILESYSTEM_READ_WRITE, - NULL, - "/c/y/my_mount_point/my_dir"); - assert( status == 0 ); - - printf("unmount /c/y/my_mount_point should fail with EBUSY\n"); - status = unmount( "/c/y/my_mount_point" ); - assert( status == -1 ); - assert( errno == EBUSY ); - - /* - * Verify you cannot create a hard link across mounted file systems. - */ - - printf("Verify a hard link across filesystems fails with EXDEV\n"); - status = mkdir( "/c/y/my_mount_point/my_dir2", S_IRWXU ); - assert( status == 0 ); - - status = link( "/c/y/my_mount_point/my_dir2", "/c/y/my_mount_point/my_dir/my_link" ); - assert( status == -1 ); - assert( errno == EXDEV ); - - /* - * Create a symbolic link across mountpoints. - */ - - printf("Verify a symbolic link across file systems works\n"); - status = symlink( "/c/y/my_mount_point/my_dir2", "/c/y/my_mount_point/my_dir/my_link" ); - assert( status == 0 ); - status = stat( "/c/y/my_mount_point/my_dir/my_link", &statbuf ); - assert( status == 0 ); - - printf("unmount /c/y/my_mount_point/my_dir\n"); - status = unmount( "/c/y/my_mount_point/my_dir" ); - assert( status == 0 ); - - /* - * Verify symblic link no longer works. - */ - - printf("Verify the symbolic link now fails\n"); - status = stat( "/c/y/my_mount_point/my_dir/my_link", &statbuf ); - assert( status != 0 ); - - printf("unmount /c/y/my_mount_point\n"); - status = unmount( "/c/y/my_mount_point" ); - assert( status == 0 ); - - printf( "\n\n*** END OF MOUNT/UNMOUNT TEST ***\n" ); - rtems_test_exit(0); -} - diff --git a/testsuites/psxtests/psxmsgq01/.cvsignore b/testsuites/psxtests/psxmsgq01/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/psxtests/psxmsgq01/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/psxtests/psxmsgq01/Makefile.am b/testsuites/psxtests/psxmsgq01/Makefile.am deleted file mode 100644 index 9a0707bc0d..0000000000 --- a/testsuites/psxtests/psxmsgq01/Makefile.am +++ /dev/null @@ -1,44 +0,0 @@ -## -## $Id$ -## - - -TEST = psxmsgq01 - -MANAGERS = all - -C_FILES = init.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/psxtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -AM_CPPFLAGS += -I$(top_srcdir)/include - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/psxtests/psxmsgq01/init.c b/testsuites/psxtests/psxmsgq01/init.c deleted file mode 100644 index 56587254b4..0000000000 --- a/testsuites/psxtests/psxmsgq01/init.c +++ /dev/null @@ -1,1313 +0,0 @@ -/* - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define CONFIGURE_INIT -#include "system.h" -#include -#include -#include -#include -#include /* signal facilities */ - -typedef struct { - char msg[ 50 ]; - int size; - unsigned int priority; -}Test_Message_t; -Test_Message_t Predefined_Msgs[MAXMSG+1]; -Test_Message_t Predefined_Msgs[MAXMSG+1] = { - { "12345678", 9, MQ_PRIO_MAX-1 }, /* Max Length Message med */ - { "", 1, 1 }, /* NULL Message low */ - { "Last", 5, MQ_PRIO_MAX }, /* Queue Full Message hi */ - { "No Message", 0, MQ_PRIO_MAX-1 }, /* 0 length Message med */ - { "1", 2, 0 }, /* Cause Overflow Behavior */ -}; -int Priority_Order[MAXMSG+1] = { 2, 0, 3, 1, MAXMSG }; - - -typedef struct { - mqd_t mq; - Test_Queue_Types index; - char *name; - int oflag; - int maxmsg; - int msgsize; - int count; -} Test_queue_type; - -Test_queue_type Test_q[ NUMBER_OF_TEST_QUEUES ] = -{ - { 0, 0, "Qread", ( O_CREAT | O_RDONLY | O_NONBLOCK ), MAXMSG, MSGSIZE, 0 }, - { 0, 1, "Qwrite", ( O_CREAT | O_WRONLY | O_NONBLOCK ), MAXMSG, MSGSIZE, 0 }, - { 0, 2, "Qnoblock", ( O_CREAT | O_RDWR | O_NONBLOCK ), MAXMSG, MSGSIZE, 0 }, - { 0, 3, "Qblock", ( O_CREAT | O_RDWR ) , MAXMSG, MSGSIZE, 0 }, - { 0, 4, "Qdefault", ( O_CREAT | O_RDWR ) , 10, 16, 0 }, - { 0, 5, "mq6", ( O_CREAT | O_WRONLY | O_NONBLOCK ), MAXMSG, MSGSIZE, 0 }, -}; - -#define RW_NAME Test_q[ RW_QUEUE ].name -#define DEFAULT_NAME Test_q[ DEFAULT_RW ].name -#define RD_NAME Test_q[ RD_QUEUE ].name -#define WR_NAME Test_q[ WR_QUEUE ].name -#define BLOCKING_NAME Test_q[ BLOCKING ].name -#define CLOSED_NAME Test_q[ CLOSED ].name - -#define RW_ATTR Test_q[ RW_QUEUE ].oflag -#define DEFAULT_ATTR Test_q[ DEFAULT_RW ].oflag -#define RD_ATTR Test_q[ RD_QUEUE ].oflag -#define WR_ATTR Test_q[ WR_QUEUE ].oflag -#define BLOCK_ATTR Test_q[ BLOCKING ].oflag -#define CLOSED_ATTR Test_q[ CLOSED ].oflag - -/* - * Outputs a header at each test section. - */ -void Start_Test( - char *description -) -{ - printf( "_______________%s\n", description ); -} - - -void Validate_attributes( - mqd_t mq, - int oflag, - int msg_count -) -{ - int status; - struct mq_attr attr; - - status = mq_getattr( mq, &attr ); - fatal_posix_service_status( status, 0, "mq_getattr valid return status"); - - if ( mq != Test_q[ DEFAULT_RW ].mq ){ - fatal_int_service_status((int)attr.mq_maxmsg, MAXMSG, "maxmsg attribute" ); - fatal_int_service_status((int)attr.mq_msgsize,MSGSIZE,"msgsize attribute"); - } - - fatal_int_service_status((int)attr.mq_curmsgs, msg_count, "count attribute" ); - fatal_int_service_status((int)attr.mq_flags, oflag, "flag attribute" ); -} - -char Queue_Name[PATH_MAX + 2]; -#define Get_Queue_Name( i ) Test_q[i].name - -char *Build_Queue_Name( int i ) { - sprintf(Queue_Name,"mq%d", i+1 ); - return Queue_Name; -} - -char *Get_Too_Long_Name() -{ - int i; - - for ( i=0; i< PATH_MAX+1; i++ ) - Queue_Name[i] = 'N'; - Queue_Name[i] = '\0'; - return Queue_Name; -} - - -void open_test_queues() -{ - struct mq_attr attr; - int status; - Test_queue_type *tq; - int que; - - attr.mq_maxmsg = MAXMSG; - attr.mq_msgsize = MSGSIZE; - - puts( "Init: Open Test Queues" ); - - for( que = 0; que < NUMBER_OF_TEST_QUEUES; que++ ) { - - tq = &Test_q[ que ]; - if ( que == DEFAULT_RW) - Test_q[que].mq = mq_open( tq->name, tq->oflag, 0x777, NULL ); - else - Test_q[que].mq = mq_open( tq->name, tq->oflag, 0x777, &attr ); - - assert( Test_q[que].mq != (-1) ); - } - - status = mq_close( Test_q[CLOSED].mq ); - fatal_posix_service_status( status, 0, "mq_close message queue"); - status = mq_unlink( CLOSED_NAME ); - fatal_posix_service_status( status, 0, "mq_unlink message queue"); -} - -/* - * Opens CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES then leaves size queues - * opened but closes the rest. - */ - -void validate_mq_open_error_codes() -{ - int i; - mqd_t n_mq2; - struct mq_attr attr; - int status; - mqd_t open_mq[CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES + 1]; - - attr.mq_maxmsg = MAXMSG; - attr.mq_msgsize = MSGSIZE; - - Start_Test( "mq_open errors" ); - - /* - * XXX EINVAL - inappropriate name was given for the message queue - */ - - /* - * EINVAL - Create with negative maxmsg. - */ - - attr.mq_maxmsg = -1; - puts( "Init: mq_open - Create with maxmsg (-1) (EINVAL)" ); - n_mq2 = mq_open( "mq2", O_CREAT | O_RDONLY, 0x777, &attr); - fatal_posix_service_status( - (int) n_mq2, (int ) (-1), "mq_open error return status" ); - fatal_posix_service_status( errno, EINVAL, "mq_open errno EINVAL"); - attr.mq_maxmsg = MAXMSG; - - /* - * EINVAL - Create withnegative msgsize. - */ - - attr.mq_msgsize = -1; - puts( "Init: mq_open - Create with msgsize (-1) (EINVAL)" ); - n_mq2 = mq_open( "mq2", O_CREAT | O_RDONLY, 0x777, &attr); - fatal_posix_service_status( - (int) n_mq2, (int ) (-1), "mq_open error return status" ); - fatal_posix_service_status( errno, EINVAL, "mq_open errno EINVAL"); - attr.mq_msgsize = MSGSIZE; - - /* - * ENOENT - Open a non-created file. - */ - - puts( "Init: mq_open - Open new mq without create flag (ENOENT)" ); - n_mq2 = mq_open( "mq3", O_EXCL | O_RDONLY, 0x777, NULL); - fatal_posix_service_status( - (int) n_mq2, (int ) (-1), "mq_open error return status" ); - fatal_posix_service_status( errno, ENOENT, "mq_open errno ENOENT"); - - /* - * XXX EINTR - call was interrupted by a signal - */ - - /* - * ENAMETOOLONG - Give a name greater than PATH_MAX. - */ - - puts( "Init: mq_open - Open with too long of a name (ENAMETOOLONG)" ); - n_mq2 = mq_open( Get_Too_Long_Name(), O_CREAT | O_RDONLY, 0x777, NULL ); - fatal_posix_service_status( - (int) n_mq2, (int ) (-1), "mq_open error return status" ); - fatal_posix_service_status( errno, ENAMETOOLONG, "mq_open errno ENAMETOOLONG"); - - /* - * XXX - ENAMETOOLONG - Give a name greater than NAME_MAX - * Per implementation not possible. - */ - - /* - * EEXIST - Create an existing queue. - */ - - puts( "Init: mq_open - Create an Existing mq (EEXIST)" ); - open_mq[0] = mq_open( - Build_Queue_Name(0), O_CREAT | O_RDWR | O_NONBLOCK, 0x777, NULL ); - assert( open_mq[0] != (-1) ); - - n_mq2 = mq_open( - Build_Queue_Name(0), O_CREAT | O_EXCL | O_RDONLY, 0x777, NULL); - fatal_posix_service_status( - (int) n_mq2, (int ) (-1), "mq_open error return status" ); - fatal_posix_service_status( errno, EEXIST, "mq_open errno EEXIST"); - - status = mq_unlink( Build_Queue_Name(0) ); - fatal_posix_service_status( status, 0, "mq_unlink message queue"); - - status = mq_close( open_mq[0]); - fatal_posix_service_status( status, 0, "mq_close message queue"); - - /* - * Open maximum number of message queues - */ - - puts( "Init: mq_open - SUCCESSFUL" ); - for (i = 0; i < CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES; i++) { - open_mq[i] = mq_open( - Build_Queue_Name(i), O_CREAT | O_RDWR | O_NONBLOCK, 0x777, NULL ); - assert( open_mq[i] != (-1) ); - assert( open_mq[i] ); - /*XXX - Isn't there a more general check */ -/* JRS printf( "mq_open 0x%x %s\n", open_mq[i], Build_Queue_Name(i) ); */ - } - - /* - * XXX EACCES - permission to create is denied. - */ - - /* - * XXX EACCES - queue exists permissions specified by o_flag are denied. - */ - - /* - * XXX EMFILE - Too many message queues in use by the process - */ - - /* - * ENFILE - Too many message queues open in the system - */ - - puts( "Init: mq_open - system is out of resources (ENFILE)" ); - n_mq2 = mq_open( Build_Queue_Name(i), O_CREAT | O_RDONLY, 0x777, NULL ); - fatal_posix_service_status( - (int) n_mq2, (int ) (-1), "mq_open error return status" ); - fatal_posix_service_status( errno, ENFILE, "mq_open errno ENFILE"); - - /* - * Unlink and Close all queues. - */ - - puts( "Init: mq_close and mq_unlink (mq3...mqn) - SUCCESSFUL" ); - for (i = 0; i < CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES; i++) { - - status = mq_close( open_mq[i]); - fatal_posix_service_status( status, 0, "mq_close message queue"); - - status = mq_unlink( Build_Queue_Name(i) ); - if ( status == -1 ) - perror( "mq_unlink" ); - fatal_posix_service_status( status, 0, "mq_unlink message queue"); - /* JRS printf( "mq_close/mq_unlink 0x%x %s\n", open_mq[i], Build_Queue_Name(i) ); */ - } -} - -void validate_mq_unlink_error_codes() -{ - int status; - - Start_Test( "mq_unlink errors" ); - - /* - * XXX - EACCES Permission Denied - */ - - /* - * ENAMETOOLONG - Give a name greater than PATH_MAX. - */ - - puts( "Init: mq_unlink - mq_unlink with too long of a name (ENAMETOOLONG)" ); - status = mq_unlink( Get_Too_Long_Name() ); - fatal_posix_service_status( status, -1, "mq_unlink error return status"); - fatal_posix_service_status( errno, ENAMETOOLONG, "mq_unlink errno ENAMETOOLONG"); - - /* - * XXX - ENAMETOOLONG - Give a name greater than NAME_MAX - * Per implementation not possible. - */ - - /* - * ENOENT - Unlink an unopened queue - */ - - puts( "Init: mq_unlink - A Queue not opened (ENOENT)" ); - status = mq_unlink( CLOSED_NAME ); - fatal_posix_service_status( status, -1, "mq_unlink error return status"); - fatal_posix_service_status( errno, ENOENT, "mq_unlink errno ENOENT"); - - /* - * XXX - The following were not listed in the POSIX document as - * possible errors. Under other commands the EINVAL is - * given for these conditions. - */ - - /* - * EINVAL - Unlink a queue with no name - */ - - puts( "Init: mq_unlink (NULL) - EINVAL" ); - status = mq_unlink( NULL ); - fatal_posix_service_status( status, -1, "mq_unlink error return status"); - fatal_posix_service_status( errno, EINVAL, "mq_unlink errno value"); - - /* - * EINVAL - Unlink a queue with a null name - */ - - puts( "Init: mq_unlink (\"\") - EINVAL" ); - status = mq_unlink( "" ); - fatal_posix_service_status( status, -1, "mq_unlink error return status"); - fatal_posix_service_status( errno, EINVAL, "mq_unlink errno value"); -} - -void validate_mq_close_error_codes() -{ - int status; - - Start_Test( "mq_close errors" ); - - /* - * EBADF - Close a queue that is not open. - */ - - puts( "Init: mq_close - unopened queue (EBADF)" ); - status = mq_close( Test_q[CLOSED].mq ); - fatal_posix_service_status( status, -1, "mq_close error return status"); - fatal_posix_service_status( errno, EBADF, "mq_close errno EBADF"); -} - - -void validate_mq_getattr_error_codes() -{ - struct mq_attr attr; - int status; - - Start_Test( "mq_getattr errors" ); - - /* - * EBADF - Get the attributes from a closed queue. - */ - - puts( "Init: mq_getattr - unopened queue (EBADF)" ); - status = mq_getattr( Test_q[CLOSED].mq, &attr ); - fatal_posix_service_status( status, -1, "mq_close error return status"); - fatal_posix_service_status( errno, EBADF, "mq_close errno EBADF"); - - /* - * XXX - The following are not listed in the POSIX manual but - * may occur. - */ - - /* - * EINVAL - NULL attributes - */ - - puts( "Init: mq_getattr - NULL attributes (EINVAL)" ); - status = mq_getattr( Test_q[RW_QUEUE].mq, NULL ); - fatal_posix_service_status( status, -1, "mq_close error return status"); - fatal_posix_service_status( errno, EINVAL, "mq_close errno EINVAL"); - -} - - -void Send_msg_to_que( - int que, - int msg -) -{ - Test_Message_t *ptr = &Predefined_Msgs[msg]; - int status; - - status = mq_send( Test_q[que].mq, ptr->msg, ptr->size , ptr->priority ); - fatal_posix_service_status( status, 0, "mq_send valid return status"); - Test_q[que].count++; -} - -void Show_send_msg_to_que( - char *task_name, - int que, - int msg -) -{ - Test_Message_t *ptr = &Predefined_Msgs[msg]; - printf( "%s mq_send - to %s msg: %s priority %d\n", - task_name, Test_q[que].name, ptr->msg, ptr->priority); - Send_msg_to_que( que, msg ); -} - -void verify_queues_full( - char *task_name -) -{ - int que; - - /* - * Validate that the queues are full. - */ - - printf( "%s Verify Queues are full\n", task_name ); - for( que = RW_QUEUE; que < CLOSED; que++ ) - Validate_attributes( Test_q[que].mq, Test_q[que].oflag, Test_q[que].count ); - -} -void verify_queues_empty( - char *task_name -) -{ - int que; - - printf( "%s Verify Queues are empty\n", task_name ); - for( que = RW_QUEUE; que < CLOSED; que++ ) - Validate_attributes( Test_q[que].mq, Test_q[que].oflag, 0 ); -} - -int fill_message_queues( - char *task_name -) -{ - int msg; - int que; - - - verify_queues_empty( task_name ); - - /* - * Fill Queue with predefined messages. - */ - - printf( "%s Fill Queues with messages\n", task_name ); - for(msg=0; msgmsg ); - fatal_int_service_status( status, ptr->size, err_msg ); - - assert( !strcmp( message, ptr->msg ) ); - strcpy( message, "No Message" ); - - sprintf( err_msg,"%s msg %s size failure", Test_q[ que ].name, ptr->msg ); - fatal_int_service_status(priority, ptr->priority, err_msg ); -} - -int empty_message_queues( - char *task_name -) -{ - int que; - int i; - - printf( "%s Empty all Queues\n", task_name ); - for( que = RW_QUEUE; que < CLOSED; que++ ) { - for(i=0; Test_q[que].count != 0; i++ ) - Read_msg_from_que( que, Priority_Order[i] ); - - Validate_attributes( Test_q[ que].mq, Test_q[ que ].oflag, 0 ); - } - return 0; -} - -/* - * Returns the number of messages queued after the test on the - * first queue. - */ - -int validate_mq_send_error_codes( ) -{ - int status; - int i; - char *str; - - Start_Test( "mq_send errors" ); - - /* - * EBADF - Write to a closed queue. - */ - - puts( "Init: mq_send - Closed message queue (EBADF)" ); - status = mq_send( Test_q[CLOSED].mq, "", 1, 0 ); - fatal_posix_service_status( status, -1, "mq_send error return status"); - fatal_posix_service_status( errno, EBADF, "mq_send errno EBADF"); - - /* - * EBADF - Write to a read only queue. - */ - - puts( "Init: mq_send - Read only message queue (EBADF)" ); - status = mq_send( Test_q[ RD_QUEUE ].mq, "", 1, 0 ); - fatal_posix_service_status( status, -1, "mq_send error return status"); - fatal_posix_service_status( errno, EBADF, "mq_send errno EBADF"); - - /* - * XXX - EINTR Signal interrupted the call. - * - puts( "Init: mq_send - UNSUCCESSFUL (EINTR)" ); - status = mq_send( Test_q, "", 0xffff, 0 ); - fatal_posix_service_status( status, -1, "mq_send error return status"); - fatal_posix_service_status( errno, E, "mq_send errno E"); - */ - - /* - * EINVAL priority is out of range. - */ - - puts( "Init: mq_send - Priority out of range (EINVAL)" ); - status = mq_send( Test_q[ RW_QUEUE ].mq, "", 1, MQ_PRIO_MAX + 1 ); - fatal_posix_service_status( status, -1, "mq_send error return status"); - fatal_posix_service_status( errno, EINVAL, "mq_send errno EINVAL"); - - /* - * EMSGSIZE - Message size larger than msg_len - * Validates that msgsize is stored correctly. - */ - - puts( "Init: mq_send - Message longer than msg_len (EMSGSIZE)" ); - status = mq_send( Test_q[ RW_QUEUE ].mq, "", MSGSIZE+1, 0 ); - fatal_posix_service_status( status, -1, "mq_send error return status"); - fatal_posix_service_status( errno, EMSGSIZE, "mq_send errno EMSGSIZE"); - - i = fill_message_queues( "Init:" ); - - /* - * ENOSYS - send not supported - puts( "Init: mq_send - Blocking Queue overflow (ENOSYS)" ); - status = mq_send( n_mq1, Predefined_Msgs[i], 0, 0 ); - fatal_posix_service_status( status, -1, "mq_send error return status"); - fatal_posix_service_status( errno, EBADF, "mq_send errno EBADF"); - - status = mq_close( n_mq1 ); - fatal_posix_service_status( status, 0, "mq_close message queue"); - - status = mq_unlink( "read_only" ); - fatal_posix_service_status( status, 0, "mq_unlink message queue"); - */ - - /* - * EAGAIN - O_NONBLOCK and message queue is full. - */ - - puts( "Init: mq_send - on a FULL non-blocking queue with (EAGAIN)" ); - str = Predefined_Msgs[i].msg; - status = mq_send(Test_q[RW_QUEUE].mq, str, 0, 0 ); - fatal_posix_service_status( status, -1, "mq_send error return status"); - fatal_posix_service_status( errno, EAGAIN, "mq_send errno EAGAIN"); - - return i-1; -} - -void validate_mq_receive_error_codes( ) -{ - int status; - char message[100]; - unsigned int priority; - - Start_Test( "mq_receive errors" ); - - /* - * EBADF - Not A Valid Message Queue - */ - - puts( "Init: mq_receive - Unopened message queue (EBADF)" ); - status = mq_receive( Test_q[CLOSED].mq, message, 100, &priority ); - fatal_posix_service_status( status, -1, "mq_ error return status"); - fatal_posix_service_status( errno, EBADF, "mq_receive errno EBADF"); - - /* - * EBADF - Queue not opened to read - */ - - puts( "Init: mq_receive - Write only queue (EBADF)" ); - status = mq_receive( Test_q[WR_QUEUE].mq, message, 100, &priority ); - fatal_posix_service_status( status, -1, "mq_ error return status"); - fatal_posix_service_status( errno, EBADF, "mq_receive errno EBADF"); - - /* - * EMSGSIZE - Size is less than the message size attribute - */ - - puts( "Init: mq_receive - Size is less than the message (EMSGSIZE)" ); - status = mq_receive( - Test_q[RW_QUEUE].mq, message, Predefined_Msgs[0].size-1, &priority ); - fatal_posix_service_status( status, -1, "mq_ error return status"); - fatal_posix_service_status( errno, EMSGSIZE, "mq_receive errno EMSGSIZE"); - - - /* - * EAGAIN - O_NONBLOCK and Queue is empty - */ - verify_queues_full( "Init:" ); - empty_message_queues( "Init:" ); - - puts( "Init: mq_receive - Queue is empty (EAGAIN)" ); - status = mq_receive( Test_q[RW_QUEUE].mq, message, 100, &priority ); - fatal_posix_service_status( status, -1, "mq_ error return status"); - fatal_posix_service_status( errno, EAGAIN, "mq_receive errno EAGAIN"); - - /* - * XXX - EINTR - Interrupted by a signal - */ - - /* - * XXX - EBADMSG - a data corruption problem. - */ - - /* - * XXX - ENOSYS - mq_receive not supported - */ -} - -void verify_open_functionality() -{ - mqd_t n_mq; - - Start_Test( "mq_open functionality" ); - - /* - * Validate a second open returns the same message queue. - */ - -#if 0 - puts( "Init: mq_open - Open an existing mq ( same id )" ); - n_mq = mq_open( RD_NAME, 0 ); - fatal_posix_service_status( - (int) n_mq, (int ) Test_q[RD_QUEUE].mq, "mq_open error return status" ); -#endif -} - -void verify_unlink_functionality() -{ - mqd_t n_mq; - int status; - - Start_Test( "mq_unlink functionality" ); - - /* - * Unlink the message queue, then verify an open of the same name produces a - * different message queue. - */ - - puts( "Init: Unlink and Open without closing SUCCESSFUL" ); - status = mq_unlink( DEFAULT_NAME ); - fatal_posix_service_status( status, 0, "mq_unlink locked message queue"); - - n_mq = mq_open( DEFAULT_NAME, DEFAULT_ATTR, 0x777, NULL ); - assert( n_mq != (-1) ); - assert( n_mq != Test_q[ DEFAULT_RW ].mq ); - - - status = mq_unlink( DEFAULT_NAME ); - fatal_posix_service_status( status, 0, "mq_unlink locked message queue"); - status = mq_close( Test_q[ DEFAULT_RW ].mq ); - fatal_posix_service_status( status, 0, "mq_close message queue"); - - Test_q[ DEFAULT_RW ].mq = n_mq; -} - -void verify_close_functionality() -{ - int i; - int status; - Start_Test( "Unlink and Close All Files" ); - for (i=0; imsg, ptr->size , ptr->priority ); - fatal_posix_service_status( status, -1, "mq_send error return status"); - fatal_posix_service_status( errno, EBADF, "mq_send errno EBADF"); - -} - -void validate_mq_setattr() -{ - struct mq_attr attr; - struct mq_attr save_attr[ NUMBER_OF_TEST_QUEUES ]; - int status; - int i; - - /* - * EBADF - Get the attributes from a closed queue. - */ - - puts( "Task1:mq_setattr - unopened queue (EBADF)" ); - status = mq_setattr( Test_q[CLOSED].mq, &attr, NULL ); - fatal_posix_service_status( status, -1, "mq_setattr error return status"); - fatal_posix_service_status( errno, EBADF, "mq_setattr errno EBADF"); - - /* - * XXX - The following are not listed in the POSIX manual but - * may occur. - */ - - /* - * EINVAL - NULL attributes - */ - - puts( "Task1:mq_setattr - NULL attributes (EINVAL)" ); - status = mq_setattr( Test_q[RW_QUEUE].mq, NULL, NULL ); - fatal_posix_service_status( status, -1, "mq_setattr error return status"); - fatal_posix_service_status( errno, EINVAL, "mq_setattr errno EINVAL"); - - /* - * Verify change queues to blocking, by verifying all queues block - * for a timed receive. - */ - - puts( "Init: set_attr all queues to blocking" ); - for(i=0; i -#include -#include -#include -#include - -void *POSIX_Init( - void *argument -); - -void *Task_1_through_3( - void *argument -); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 5 -#define CONFIGURE_MAXIMUM_POSIX_MESSAGE_QUEUES 10 -#define CONFIGURE_MAXIMUM_POSIX_TIMERS 4 -#define CONFIGURE_MAXIMUM_TIMERS 4 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE -#define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE \ - (RTEMS_MINIMUM_STACK_SIZE * 10) - -#include - -/* global variables */ - -TEST_EXTERN pthread_t Init_id; -TEST_EXTERN pthread_t Task_id; - -#define MSGSIZE 9 -#define MAXMSG 4 - -typedef enum { - RD_QUEUE, /* Read only queue */ - WR_QUEUE, /* Write only queue */ - RW_QUEUE, /* Read Write non-blocking queue */ - BLOCKING, /* Read Write blocking queue */ - DEFAULT_RW, /* default must be last */ - CLOSED, /* Created and closed queue */ - NUMBER_OF_TEST_QUEUES -} Test_Queue_Types; -extern int Priority_Order[MAXMSG+1]; -void *Task_1 ( void *argument ); -void *Task_2( void *argument ); -void *Task_3( void *argument ); -void *Task_4( void *argument ); - -/* end of include file */ - - diff --git a/testsuites/psxtests/psxreaddir/.cvsignore b/testsuites/psxtests/psxreaddir/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/psxtests/psxreaddir/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/psxtests/psxreaddir/Makefile.am b/testsuites/psxtests/psxreaddir/Makefile.am deleted file mode 100644 index 83a54faed2..0000000000 --- a/testsuites/psxtests/psxreaddir/Makefile.am +++ /dev/null @@ -1,41 +0,0 @@ -## -## $Id$ -## - - -TEST = psxreaddir - -MANAGERS = all - -C_FILES = main.c test.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -DOCTYPES = scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/psxtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -AM_CPPFLAGS += -I$(top_srcdir)/include - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/psxtests/psxreaddir/main.c b/testsuites/psxtests/psxreaddir/main.c deleted file mode 100644 index 4ce4bae422..0000000000 --- a/testsuites/psxtests/psxreaddir/main.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Simple test program -- simplified version of sample test hello. - */ - -#define TEST_INIT - -#include -#include - -void test_main( void ); - -rtems_task Init( - rtems_task_argument ignored -) -{ - test_main(); - rtems_test_exit( 0 ); -} - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER - -#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM -#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 10 - -#define CONFIGURE_MAXIMUM_TASKS 1 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_INIT - -#include - -/* end of file */ diff --git a/testsuites/psxtests/psxreaddir/psxreaddir.scn b/testsuites/psxtests/psxreaddir/psxreaddir.scn deleted file mode 100644 index 5259773924..0000000000 --- a/testsuites/psxtests/psxreaddir/psxreaddir.scn +++ /dev/null @@ -1,236 +0,0 @@ -*** READDIR TEST *** -chdir to the root directory -chdir() status : 0 -Creating a series of directories under / -Creating directory: a 0 0 Success -Creating directory: b 0 0 Success -Creating directory: c 0 0 Success -Creating directory: d 0 0 Success -Creating directory: e 0 0 Success -Creating directory: f 0 0 Success -Creating directory: c/y 0 0 Success -Creating directory: c/z 0 0 Success -Creating directory: c/x 0 0 Success -Creating directory: c/y/a3333 0 0 Success -Creating directory: c/y/j123 0 0 Success -Create a lot of files -Create a -Create b -Create c -Create d -Create e -Create f -Create g -Create h -Create i -Create j -Create k -Create l -Create m -Create n -Create o -Create p -Create q -Create r -Create s -Create t -Create u -Create v -Create w -Create x -Create y -Create z -Create aa -Create ab -Create ac -Create ad -Create ae -Create af -Create ag -Create ah -Create ai -Create aj -Create ak -Create al -Create am -Create an -Create ao -Create ap -Create aq -Create ar -Open /many and print the directory -name inode offset reclen type -a 17 0 268 0x010c -b 18 268 268 0x010c -c 19 536 268 0x010c -d 20 804 268 0x010c -e 21 1072 268 0x010c -f 22 1340 268 0x010c -g 23 1608 268 0x010c -h 24 1876 268 0x010c -i 25 2144 268 0x010c -j 26 2412 268 0x010c -k 27 2680 268 0x010c -l 28 2948 268 0x010c -m 29 3216 268 0x010c -n 30 3484 268 0x010c -o 31 3752 268 0x010c -p 32 4020 268 0x010c -q 33 4288 268 0x010c -r 34 4556 268 0x010c -s 35 4824 268 0x010c -t 36 5092 268 0x010c -u 37 5360 268 0x010c -v 38 5628 268 0x010c -w 39 5896 268 0x010c -x 40 6164 268 0x010c -y 41 6432 268 0x010c -z 42 6700 268 0x010c -aa 43 6968 268 0x010c -ab 44 7236 268 0x010c -ac 45 7504 268 0x010c -ad 46 7772 268 0x010c -ae 47 8040 268 0x010c -af 48 8308 268 0x010c -ag 49 8576 268 0x010c -ah 50 8844 268 0x010c -ai 51 9112 268 0x010c -aj 52 9380 268 0x010c -ak 53 9648 268 0x010c -al 54 9916 268 0x010c -am 55 10184 268 0x010c -an 56 10452 268 0x010c -ao 57 10720 268 0x010c -ap 58 10988 268 0x010c -aq 59 11256 268 0x010c -ar 60 11524 268 0x010c -open /b/myfile -scandir a file status: -1 -Open /b/new_file -fcntl F_SETFD should return 0 -fcntl F_SETFD should return 1 -fcntl F_DUPFD should return 0 -- skip until implemented -fcntl F_GETFL returns current flags -fcntl F_GETFL returned 0x200 -fcntl F_SETFL to add O_APPEND and O_NONBLOCK -fcntl F_GETFL return current flags to see changes -fcntl F_GETFL returned 0x1208 -fcntl F_GETLK should return -1 -fcntl F_SETLK should return -1 -fcntl F_SETLKW should return -1 -fcntl F_SETOWN should return -1 -fcntl F_GETOWN should return -1 -fcntl invalid argument should return -1 -Status -1 -opendir and readdir /b/myfile -opendir and readdir -chdir to /b/myfile -Performing stat of directory / -status for stat : 0, size of directory: 2144 -Open and print directory / -name inode offset reclen type -dev 2 0 268 0x010c -a 5 268 268 0x010c -b 6 536 268 0x010c -c 7 804 268 0x010c -d 8 1072 268 0x010c -e 9 1340 268 0x010c -f 10 1608 268 0x010c -many 16 1876 268 0x010c -mkdir /d/my_dir -Open /d/my_dir -remove /d/my_dir. -close /d/my_dir. -Opening directory /c -name inode offset reclen type -y 11 0 268 0x010c -z 12 268 268 0x010c -x 13 536 268 0x010c -Opening directory /c/y -name inode offset reclen type -a3333 14 0 268 0x010c -j123 15 268 268 0x010c -LSEEK to the start of the open directory -name inode offset reclen type -dev 2 0 268 0x010c -a 5 268 268 0x010c -b 6 536 268 0x010c -c 7 804 268 0x010c -d 8 1072 268 0x010c -e 9 1340 268 0x010c -f 10 1608 268 0x010c -many 16 1876 268 0x010c -Rewinding directory -name inode offset reclen type -dev 2 0 268 0x010c -a 5 268 268 0x010c -b 6 536 268 0x010c -c 7 804 268 0x010c -d 8 1072 268 0x010c -e 9 1340 268 0x010c -f 10 1608 268 0x010c -many 16 1876 268 0x010c -Send rewinddir a NULL pointer -Seek directory -telldir() should report only sizeof(struct dirent) increments -in position. Sizeof(struct dirent): 268 -seeked to 0 -- currently at 0 -seeked to 67 -- currently at 0 -seeked to 134 -- currently at 0 -Send seekdir a NULL pointer -Closing directory -SCANDIR TEST -selection rule 1 -scanning for any entry under directory /c -SCANDIR SELECT1 accepts nodename: y -SCANDIR SELECT1 accepts nodename: z -SCANDIR SELECT1 accepts nodename: x -scandir status: 3 -Selected Node Name: y -Selected Node Name: z -Selected Node Name: x -selection rule 2 -scanning for any entry under directory /c whose name = y -SCANDIR SELECT accepted nodename: y -SCANDIR SELECT rejected nodename: z -SCANDIR SELECT rejected nodename: x -scandir status: 1 -Selected Node Name: y -SCANDIR with sorting -selection rule 1 -scanning for any entry under directory /c -sort in ascending order -SCANDIR SELECT1 accepts nodename: y -SCANDIR SELECT1 accepts nodename: z -SCANDIR SELECT1 accepts nodename: x -scandir status: 3 -Selected and Sorted Node Name: x -Selected and Sorted Node Name: y -Selected and Sorted Node Name: z -SCANDIR with sorting -selection rule 1 -scanning for any entry under directory /c -sort in descending order -SCANDIR SELECT1 accepts nodename: y -SCANDIR SELECT1 accepts nodename: z -SCANDIR SELECT1 accepts nodename: x -scandir status: 3 -Selected and Sorted Node Name: z -Selected and Sorted Node Name: y -Selected and Sorted Node Name: x -Validate readdir across mount point -name inode offset reclen type -should_be_hidden 65 0 268 0x010c -Attempting to mount IMFS file system at /imfs -create /imfs/testdir and /imfs/testdir/testsubdir -name inode offset reclen type -testdir 2 0 268 0x010c -name inode offset reclen type -testdir 2 0 268 0x010c -name inode offset reclen type -testdir 2 0 268 0x010c -name inode offset reclen type -testsubdir 3 0 268 0x010c -name inode offset reclen type -testdir 2 0 268 0x010c -*** END OF READDIR TEST *** diff --git a/testsuites/psxtests/psxreaddir/test.c b/testsuites/psxtests/psxreaddir/test.c deleted file mode 100644 index f8615dc578..0000000000 --- a/testsuites/psxtests/psxreaddir/test.c +++ /dev/null @@ -1,501 +0,0 @@ -/* - * This is a native test to explore how the readdir() family works. - * Newlib supports the following readdir() family members: - * - * closedir() - - * readdir() - - * scandir() - - * opendir() - - * rewinddir() - - * telldir() - BSD not in POSIX - * seekdir() - BSD not in POSIX - * - * - * seekdir() takes an offset which is a byte offset. The Linux - * implementation of this appears to seek to the ((off/DIRENT_SIZE) + 1) - * record where DIRENT_SIZE seems to be 12 bytes. - * - * - * - * $Id$ - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -DIR *directory; -DIR *directory2; -DIR *directory3; -DIR *directory_not; - -#ifndef __P -#define __P(args)() -#endif - -int scandir ( const char *dirname, - struct dirent *** namelist, - int (*select) __P((struct dirent *)), - int (*dcomp) __P((const void *, const void *)) -); - -#if defined(__rtems__) -#define d_type d_reclen -#include -#endif - -void printdir( DIR *directory ) -{ - struct dirent *d; - - printf( "%-20s %8s %8s %8s %4s\n", - "name", " inode", " offset", "reclen", " type" ); - d = readdir(directory); - - while (d) { - printf( "%-20s %8d %8d %6d 0x%04x\n", - d->d_name, (int)d->d_ino, (int)d->d_off, d->d_reclen, d->d_type ); - d = readdir(directory); - - } -} - -void complete_printdir( char *path ) -{ - DIR *the_dir; - int status; - - the_dir = opendir( path ); - assert( the_dir ); - printdir( the_dir ); - status = closedir( the_dir ); -} - -char *many_files[] = { - "a", - "b", - "c", - "d", - "e", - "f", - "g", - "h", - "i", - "j", - "k", - "l", - "m", - "n", - "o", - "p", - "q", - "r", - "s", - "t", - "u", - "v", - "w", - "x", - "y", - "z", - "aa", - "ab", - "ac", - "ad", - "ae", - "af", - "ag", - "ah", - "ai", - "aj", - "ak", - "al", - "am", - "an", - "ao", - "ap", - "aq", - "ar" -}; - -char *dnames[] = { - "a", - "b", - "c", - "d", - "e", - "f", - "c/y", - "c/z", - "c/x", - "c/y/a3333", - "c/y/j123", - "END" -}; - -int select1 ( struct dirent *entry ) -{ - printf("SCANDIR SELECT1 accepts nodename: %s\n", entry->d_name ); - return 1; -} - -int select2 ( struct dirent *entry ) -{ - if( strcmp( entry->d_name, "y") == 0 ) { - printf("SCANDIR SELECT accepted nodename: %s\n", entry->d_name ); - return 1; - } - printf("SCANDIR SELECT rejected nodename: %s\n", entry->d_name ); - return 0; -} - -int compare_ascending( struct dirent **a, struct dirent **b ) -{ - int i; - - i = strcmp ( - (char *)((struct dirent *)(*a)->d_name), - (char *)((struct dirent *)(*b)->d_name) - ); - return i; -} - - -int compare_descending( struct dirent **a, struct dirent **b ) -{ - int i; - - i = strcmp ( - (char *)((struct dirent *)(*b)->d_name), - (char *)((struct dirent *)(*a)->d_name) - ); - - return i; -} - -int test_across_mount() -{ - rtems_filesystem_mount_table_entry_t *mt_entry; - int status; - - /* - * Verify Readdir works correctly over mount points. - */ - - printf("Validate readdir across mount point\n"); - assert( mkdir( "/imfs", 0777 ) == 0 ); - assert( mkdir( "/imfs/should_be_hidden", 0777 ) == 0 ); - complete_printdir("/imfs" ); - printf("Attempting to mount IMFS file system at /imfs \n"); - status = mount( - &mt_entry, - &IMFS_ops, - RTEMS_FILESYSTEM_READ_WRITE, - NULL, - "/imfs" ); - assert( status == 0 ); - if( mt_entry == NULL ){ - printf(" NULL mount table entry was returned\n"); - } - printf( "create /imfs/testdir and /imfs/testdir/testsubdir\n"); - - status = mkdir( "/imfs/testdir", 0777 ); - assert( status == 0 ); - status = mkdir( "/imfs/testdir/testsubdir", 0777 ); - assert( status == 0 ); - - complete_printdir("/imfs" ); - complete_printdir("/imfs/" ); - complete_printdir("/imfs/." ); - complete_printdir("/imfs/testdir" ); - complete_printdir("/imfs/testdir/.." ); -} - -#if defined(__rtems__) -int test_main(void) -#else -int main( - int argc, - char **argv -) -#endif -{ - int fd; - int i; - int status; - off_t off; - struct dirent *d_not; - struct dirent **namelist; - struct stat s; - - - printf( "\n\n*** READDIR TEST ***\n" ); - - printf( "\nchdir to the root directory\n" ); - status = chdir( "/" ); - printf( "chdir() status : %d\n\n", status ); - - printf( "\nCreating a series of directories under /\n" ); - i=0; - while ( strcmp(dnames[i], "END") != 0 ) - { - status = mkdir( dnames[i], 0x1c0 ); - printf("Creating directory: %s %d %d ", dnames[i], status, errno ); - if ( errno == 0 ) - printf(" Success\n"); - else - printf(" Failure\n"); - - i++; - } - - /* - * Create files under many and open the directory. - */ - - printf("Create a lot of files\n"); - status = mkdir( "/many", 0x1c0 ); - status = chdir( "/many" ); - for (i = 0; i<44; i++) { - printf("Create %s\n", many_files[i]); - fd = open (many_files[i], O_CREAT, S_IRWXU); - close (fd); - } - printf("Open /many and print the directory\n"); - directory_not = opendir( "/many" ); - printdir ( directory_not ); - d_not = readdir( directory_not ); - - printf("open /b/myfile\n"); - fd = open ("/b/my_file", O_CREAT, S_IRWXU); - assert( fd != -1 ); - close (fd); - - printf("scandir a file status: "); - status = scandir( - "/b/my_file", - &namelist, - select1, - NULL - ); - printf("%d\n", status); - - printf("Open /b/new_file\n"); - fd = open( "/b/new_file", O_CREAT, S_IRWXU ); - assert( fd != -1 ); - - printf("fcntl F_SETFD should return 0\n"); - status = fcntl( fd, F_SETFD, 1 ); - assert( status == 0 ); - - printf("fcntl F_SETFD should return 1\n"); - status = fcntl( fd, F_GETFD, 1 ); - assert( status == 1 ); - -#if 0 - printf("fcntl F_DUPFD should return 0\n"); - status = fcntl( fd, F_DUPFD, 0 ); - assert ( status == 0 ); -#else - printf("fcntl F_DUPFD should return 0 -- skip until implemented\n"); -#endif - - printf("fcntl F_GETFL returns current flags\n"); - status = fcntl( fd, F_GETFL, 1 ); - printf("fcntl F_GETFL returned 0x%x\n", status ); - assert( status != -1 ); - - printf("fcntl F_SETFL to add O_APPEND and O_NONBLOCK\n"); - status = fcntl( fd, F_SETFL, O_APPEND|O_NONBLOCK ); - assert ( status != -1 ); - - printf("fcntl F_GETFL return current flags to see changes\n"); - status = fcntl( fd, F_GETFL, 1 ); - printf("fcntl F_GETFL returned 0x%x\n", status ); - assert( status != -1 ); - - printf("fcntl F_GETLK should return -1\n"); - status = fcntl( fd, F_GETLK, 1 ); - assert ( status == -1 ); - - printf("fcntl F_SETLK should return -1\n"); - status = fcntl( fd, F_SETLK, 1 ); - assert ( status == -1 ); - - printf("fcntl F_SETLKW should return -1\n"); - status = fcntl( fd, F_SETLKW, 1 ); - assert ( status == -1 ); - - printf("fcntl F_SETOWN should return -1\n"); - status = fcntl( fd, F_SETOWN, 1 ); - assert ( status == -1 ); - - printf("fcntl F_GETOWN should return -1\n"); - status = fcntl( fd, F_GETOWN, 1 ); - assert ( status == -1 ); - - printf("fcntl invalid argument should return -1\n"); - status = fcntl( fd, 0xb, 1 ); - printf("Status %d\n",status); - assert( status == -1 ); - - printf("opendir and readdir /b/myfile\n"); - directory_not = opendir ("/b/my_file"); - d_not = readdir(directory_not); - - printf("opendir and readdir\n"); - directory_not = opendir ("/a"); - d_not = readdir (directory_not); - - printf("chdir to /b/myfile\n"); - status = chdir ("/b/my_file"); - assert (status == -1); - - printf( "\nPerforming stat of directory /\n"); - status = stat( "/", &s ); - printf("status for stat : %d, size of directory: %d\n\n", - status,(int)s.st_size); - - puts( "\nOpen and print directory /" ); - directory = opendir("/"); - assert( directory ); - printdir(directory); - - printf("\nmkdir /d/my_dir\n"); - status = mkdir( "/d/my_dir", 0x1c0 ); - printf("Open /d/my_dir\n"); - directory_not = opendir( "/d/my_dir" ); - assert( directory_not ); - - printf( "remove /d/my_dir.\n" ); - status = rmdir( "/d/my_dir" ); - assert( status == 0 ); - - printf( "close /d/my_dir.\n" ); - closedir( directory_not ); - - printf( "\nOpening directory /c\n" ); - directory2 = opendir("/c"); - - assert( directory2 ); - - printdir(directory2); - status = closedir( directory2 ); - - printf( "\nOpening directory /c/y\n" ); - directory3 = opendir("/c/y"); - assert( directory3 ); - printdir(directory3); - status = closedir( directory3 ); - - printf( "\nLSEEK to the start of the open directory\n" ); - lseek( directory->dd_fd, 0, SEEK_SET ); - printdir(directory); - - lseek( directory->dd_fd, 0, SEEK_CUR ); - - lseek( directory->dd_fd, 0, SEEK_END ); - - lseek( directory->dd_fd, 0, -99 ); - - printf( "\nRewinding directory\n" ); - rewinddir( directory ); - printdir(directory); - -/* Don't know how to check this one automatically. */ - printf( "Send rewinddir a NULL pointer\n"); - rewinddir( NULL ); - - printf( "\nSeek directory\n" ); - printf( "telldir() should report only sizeof(struct dirent) increments \n" ); - printf( "in position. Sizeof(struct dirent): %d\n", sizeof(struct dirent) ); - rewinddir( directory ); - for( off=0 ; off<=200 ; off=off + sizeof(struct dirent) / 4 ) { - seekdir( directory, off ); - printf( - "seeked to %2d -- currently at %2d\n", - (int)off, - (int)telldir(directory) - ); - } - - printf( "Send seekdir a NULL pointer\n"); - seekdir( NULL, off ); - - printf( "\nClosing directory\n" ); - status = closedir( directory ); - - printf( "\nSCANDIR TEST\n"); - printf( "\nselection rule 1\n"); - printf( "scanning for any entry under directory /c\n\n"); - status = scandir( - "/c", - &namelist, - select1, - NULL - ); - printf("\nscandir status: %d\n", status ); - for ( i=0; id_name ); - } - - printf( "\nselection rule 2\n"); - printf( "scanning for any entry under directory /c whose name = y\n\n"); - status = scandir( - "/c", - &namelist, - select2, - NULL - ); - printf("\nscandir status: %d\n", status ); - for ( i=0; id_name ); - } - - printf( "\nSCANDIR with sorting\n" ); - printf( "\nselection rule 1\n"); - printf( "scanning for any entry under directory /c\n"); - printf( "sort in ascending order\n\n"); - status = scandir( - "/c", - &namelist, - select1, - compare_ascending - ); - printf("\nscandir status: %d\n", status ); - for ( i=0; id_name ); - } - - - printf( "\nSCANDIR with sorting\n" ); - printf( "\nselection rule 1\n"); - printf( "scanning for any entry under directory /c\n"); - printf( "sort in descending order\n\n"); - status = scandir( - "/c", - &namelist, - select1, - compare_descending - ); - printf("scandir status: %d\n", status ); - for ( i=0; id_name ); - } - - test_across_mount(); - printf( "\n\n*** END OF READDIR TEST ***\n" ); - rtems_test_exit(0); -} - diff --git a/testsuites/psxtests/psxsem01/.cvsignore b/testsuites/psxtests/psxsem01/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/psxtests/psxsem01/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/psxtests/psxsem01/Makefile.am b/testsuites/psxtests/psxsem01/Makefile.am deleted file mode 100644 index 6e97638a5b..0000000000 --- a/testsuites/psxtests/psxsem01/Makefile.am +++ /dev/null @@ -1,44 +0,0 @@ -## -## $Id$ -## - - -TEST = psxsem01 - -MANAGERS = all - -C_FILES = init.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/psxtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -AM_CPPFLAGS += -I$(top_srcdir)/include - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/psxtests/psxsem01/init.c b/testsuites/psxtests/psxsem01/init.c deleted file mode 100644 index 4985c3a148..0000000000 --- a/testsuites/psxtests/psxsem01/init.c +++ /dev/null @@ -1,246 +0,0 @@ -#define CONFIGURE_INIT -#include "system.h" -#include -#include -#include -#include - -void *POSIX_Init( - void *argument -) -{ - int status; - int value; - int i; - sem_t sems[CONFIGURE_MAXIMUM_POSIX_SEMAPHORES]; - sem_t sem2; - sem_t *n_sem1; - sem_t *n_sem2; - struct timespec waittime; - char failure_msg[80]; - - puts( "\n\n*** POSIX SEMAPHORE MANAGER TEST 1 ***" ); - - puts( "Init: sem_init - SUCCESSFUL" ); - for (i = 0; i < CONFIGURE_MAXIMUM_POSIX_SEMAPHORES; i++) { - status = sem_init(&sems[i], 0, i); - sprintf(failure_msg, "sem_init %d", i ); - fatal_posix_service_status( status, 0, failure_msg); - } - puts( "Init: sem_init - UNSUCCESSFUL (ENOSPC)" ); - status = sem_init(&sem2, 0, 1); - fatal_posix_service_status( status, -1, "sem_init error return status"); - fatal_posix_service_status( errno, ENOSPC, "sem_init errorno ENOSPC" ); - - puts( "Init: sem_init - UNSUCCESSFUL (ENOSYS -- pshared not supported)" ); - status = sem_init(&sem2, 1, 1); - fatal_posix_service_status( status, -1, "sem_init error return status"); - fatal_posix_service_status( errno, ENOSYS, "sem_init errno set to ENOSYS"); - - puts( "Init: sem_getvalue - SUCCESSFUL "); - for (i = 0; i < CONFIGURE_MAXIMUM_POSIX_SEMAPHORES; i++) { - status = sem_getvalue(&sems[i], &value); - sprintf( failure_msg, "sem_getvalue %d", i ); - fatal_posix_service_status( status, 0, failure_msg ); - fatal_posix_service_status( value, i, "sem_getvalue correct value" ); - } - puts( "Init: sem_getvalue - UNSUCCESSFUL "); - status = sem_getvalue(&sem2, &value); - fatal_posix_service_status( status, -1, "sem_getvalue error return status"); - fatal_posix_service_status( errno, EINVAL, "sem_getvalue errno EINVAL"); - - puts( "Init: sem_destroy - SUCCESSFUL" ); - status = sem_destroy(&sems[0]); - fatal_posix_service_status( status, 0, "sem_destroy semaphore 0"); - - puts( "Init: sem_destroy - UNSUCCESSFUL (EINVAL)" ); - status = sem_destroy(&sem2); - fatal_posix_service_status( status, -1, "sem_destroy error return status"); - fatal_posix_service_status( errno, EINVAL, "sem_destroy errno EINVAL"); - - puts( "Init: sem_wait - SUCCESSFUL" ); - status = sem_wait(&sems[1]); - fatal_posix_service_status( status, 0, "sem_wait semaphore 1"); - - puts( "Init: sem_wait - UNSUCCESSFUL (EINVAL)" ); - status = sem_wait(&sem2); - fatal_posix_service_status( status, -1, "sem_wait error return status"); - fatal_posix_service_status( errno, EINVAL, "sem_wait errno EINVAL"); - - puts( "Init: sem_post - SUCCESSFUL" ); - status = sem_post(&sems[1]); - fatal_posix_service_status( status, 0, "sem_post semaphore 1"); - - puts( "Init: sem_wait - SUCCESSFUL (after a sem_post)" ); - status = sem_wait(&sems[1]); - fatal_posix_service_status( status, 0, "sem_wait semaphore 1"); - - puts( "Init: sem_trywait - SUCCESSFUL" ); - status = sem_trywait(&sems[2]); - fatal_posix_service_status( status, 0, "sem_trywait semaphore 2"); - - puts( "Init: sem_trywait - UNSUCCESSFUL (EAGAIN)" ); - status = sem_trywait(&sems[1]); - fatal_posix_service_status( status, -1, "sem_trywait error return status"); - fatal_posix_service_status( errno, EAGAIN, "sem_trywait errno EAGAIN"); - - puts( "Init: sem_trywait - UNSUCCESSFUL (EINVAL)" ); - status = sem_trywait(&sem2); - fatal_posix_service_status( status, -1, "sem_trywait error return status"); - fatal_posix_service_status( errno, EINVAL, "sem_trywait errno EINVAL"); - - puts( "Init: sem_timedwait - SUCCESSFUL" ); - waittime.tv_sec = 0; - waittime.tv_nsec = 100; - status = sem_timedwait(&sems[2], &waittime); - fatal_posix_service_status( status, 0, "sem_timedwait semaphore 2"); - - puts( "Init: sem_timedwait - UNSUCCESSFUL (ETIMEDOUT)" ); - status = sem_timedwait(&sems[1], &waittime); - fatal_posix_service_status( status, -1, "sem_timedwait error return status"); - fatal_posix_service_status( errno, ETIMEDOUT, "sem_timedwait errno ETIMEDOUT"); - - puts( "Init: sem_timedwait - UNSUCCESSFUL (EINVAL)" ); - status = sem_timedwait(&sem2, &waittime); - fatal_posix_service_status( status, -1, "sem_timedwait error return status"); - fatal_posix_service_status( errno, EINVAL, "sem_init errno EINVAL"); - - puts( "Init: sem_post - UNSUCCESSFUL (EINVAL)" ); - status = sem_post(&sem2); - fatal_posix_service_status( status, -1, "sem_post error return status"); - fatal_posix_service_status( errno, EINVAL, "sem_post errno EINVAL"); - - puts( "Init: sem_destroy - SUCCESSFUL" ); - for (i = 1; i < CONFIGURE_MAXIMUM_POSIX_SEMAPHORES; i++) { - status = sem_destroy(&sems[i]); - sprintf( failure_msg, "sem_destroy %d", i ); - fatal_posix_service_status( status, 0, failure_msg ); - } - - /* Modes are currently unsupported */ - - /* - * Validate all sem_open return paths. - */ - - puts( "Init: sem_open - sem1 SUCCESSFUL" ); - n_sem1 = sem_open( "sem1", O_CREAT, 00777, 1 ); - assert( n_sem1 != SEM_FAILED ); - - puts( "Init: sem_open - Create an Existing sem (EEXIST)" ); - n_sem2 = sem_open("sem1", O_CREAT | O_EXCL, 00777, 1); - fatal_posix_service_status( - (int) n_sem2, (int ) SEM_FAILED, "sem_open error return status" ); - fatal_posix_service_status( errno, EEXIST, "sem_open errno EEXIST"); - - puts( "Init: sem_open - Open new sem without create flag (ENOENT)" ); - n_sem2 = sem_open("sem3", O_EXCL, 00777, 1); - fatal_posix_service_status( - (int) n_sem2, (int ) SEM_FAILED, "sem_open error return status" ); - fatal_posix_service_status( errno, ENOENT, "sem_open errno EEXIST"); - - /* - * XXX - Could not hit the following errors: - * E_POSIX_Semaphore_Create_support only fails if - * ENOSYS - When semaphore is shared between processes. - * ENOSPC - When out of memory. - */ - - /* - * Validate we can wait on a semaphore opened with sem_open. - */ - - puts( "Init: sem_wait on sem1" ); - status = sem_wait(n_sem1); - fatal_posix_service_status( status, 0, "sem_wait opened semaphore"); - - /* - * Validate a second open returns the same semaphore. - */ - - puts( "Init: sem_open - Open an existing sem ( same id )" ); - n_sem2 = sem_open("sem1", 0 ); - fatal_posix_service_status( - (int) n_sem2, (int ) n_sem1, "sem_open error return status" ); - - /* - * Unlink the semaphore, then verify an open of the same name produces a - * different semaphore. - */ - - puts( "Init: sem_unlink - sem1 SUCCESSFUL" ); - status = sem_unlink( "sem1" ); - fatal_posix_service_status( status, 0, "sem_unlink locked semaphore"); - - puts( "Init: sem_open - Reopen sem1 SUCCESSFUL with a different id" ); - n_sem2 = sem_open( "sem1", O_CREAT | O_EXCL, 00777, 1); - assert( n_sem2 != SEM_FAILED ); - assert( n_sem2 != n_sem1 ); - - /* - * Validate we can call close on a semaphore opened with sem_open. - */ - - puts( "Init: sem_close (1) - SUCCESSFUL" ); - status = sem_close( n_sem1 ); - fatal_posix_service_status( status, 0, "sem_close semaphore"); - - - /* - * Validate it n_sem2 (the last open for sem1 name can be - * correctly closed and unlinked. - */ - - puts( "Init: sem_close (2) - SUCCESSFUL" ); - status = sem_close( n_sem2 ); - fatal_posix_service_status( status, 0, "sem_close semaphore"); - - puts( "Init: sem_unlink - sem1 (2) SUCCESSFUL" ); - status = sem_unlink( "sem1" ); - fatal_posix_service_status( status, 0, "sem_unlink locked semaphore"); - - puts( "Init: sem_close - UNSUCCESSFUL (EINVAL)" ); - status = sem_close(n_sem2); - fatal_posix_service_status( status, -1, "sem_close error return status"); - fatal_posix_service_status( errno, EINVAL, "sem_close errno EINVAL"); - - puts( "Init: sem_unlink - UNSUCCESSFUL (ENOENT)" ); - status = sem_unlink("sem1"); - fatal_posix_service_status( status, -1, "sem_unlink error return status"); - fatal_posix_service_status( errno, ENOENT, "sem_close errno EINVAL"); - - - /* - * Validate we can unlink (2) - */ - - puts( "Init: sem_unlink (NULL) - EINVAL" ); - status = sem_unlink( NULL ); - fatal_posix_service_status( status, -1, "sem_unlink error return status"); - fatal_posix_service_status( errno, EINVAL, "sem_unlink errno value"); - - puts( "Init: sem_unlink (\"\") - EINVAL" ); - status = sem_unlink( "" ); - fatal_posix_service_status( status, -1, "sem_unlink error return status"); - fatal_posix_service_status( errno, EINVAL, "sem_unlink errno value"); - - /* - * XXX - Cant' create location OBJECTS_ERROR or OBJECTS_REMOTE. - * sem_close and sem_unlink. - */ - - puts( "Init: sem_unlink - UNSUCCESSFUL (ENOENT)" ); - status = sem_unlink("sem2"); - fatal_posix_service_status( status, -1, "sem_unlink error return status"); - fatal_posix_service_status( errno, ENOENT, "sem_unlink errno ENOENT"); - assert( (status == -1) && (errno == ENOENT) ); - - - /* Try adding in unlinking before closing... (can we still open?) */ - - puts( "*** POSIX SEMAPHORE MANAGER TEST 1 COMPLETED ***" ); - rtems_test_exit(0); - - return NULL; /* just so the compiler thinks we returned something */ -} - diff --git a/testsuites/psxtests/psxsem01/psxsem01.scn b/testsuites/psxtests/psxsem01/psxsem01.scn deleted file mode 100644 index cf8cf13fb1..0000000000 --- a/testsuites/psxtests/psxsem01/psxsem01.scn +++ /dev/null @@ -1,37 +0,0 @@ -*** POSIX SEMAPHORE MANAGER TEST 1 *** -Init: sem_init - SUCCESSFUL -Init: sem_init - UNSUCCESSFUL (ENOSPC) -Init: sem_init - UNSUCCESSFUL (ENOSYS -- pshared not supported) -Init: sem_getvalue - SUCCESSFUL -Init: sem_getvalue - UNSUCCESSFUL -Init: sem_destroy - SUCCESSFUL -Init: sem_destroy - UNSUCCESSFUL (EINVAL) -Init: sem_wait - SUCCESSFUL -Init: sem_wait - UNSUCCESSFUL (EINVAL) -Init: sem_post - SUCCESSFUL -Init: sem_wait - SUCCESSFUL (after a sem_post) -Init: sem_trywait - SUCCESSFUL -Init: sem_trywait - UNSUCCESSFUL (EAGAIN) -Init: sem_trywait - UNSUCCESSFUL (EINVAL) -Init: sem_timedwait - SUCCESSFUL -Init: sem_timedwait - UNSUCCESSFUL (ETIMEDOUT) -Init: sem_timedwait - UNSUCCESSFUL (EINVAL) -Init: sem_post - UNSUCCESSFUL (EINVAL) -Init: sem_destroy - SUCCESSFUL -Init: sem_open - sem1 SUCCESSFUL -Init: sem_open - Create an Existing sem (EEXIST) -Init: sem_open - Open new sem without create flag (ENOENT) -Init: sem_wait on sem1 -Init: sem_open - Open an existing sem ( same id ) -Init: sem_unlink - sem1 SUCCESSFUL -Init: sem_open - Reopen sem1 SUCCESSFUL with a different id -Init: sem_close (1) - SUCCESSFUL -Init: sem_close (2) - SUCCESSFUL -Init: sem_unlink - sem1 (2) SUCCESSFUL -Init: sem_close - UNSUCCESSFUL (EINVAL) -Init: sem_unlink - UNSUCCESSFUL (ENOENT) -Init: sem_unlink (NULL) - EINVAL -Init: sem_unlink ("") - EINVAL -Init: sem_unlink - UNSUCCESSFUL (ENOENT) -*** POSIX SEMAPHORE MANAGER TEST 1 COMPLETED *** - diff --git a/testsuites/psxtests/psxsem01/system.h b/testsuites/psxtests/psxsem01/system.h deleted file mode 100644 index 8237eab279..0000000000 --- a/testsuites/psxtests/psxsem01/system.h +++ /dev/null @@ -1,55 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -/* functions */ - -#include -#include -#include -#include -#include -#include - -void *POSIX_Init( - void *argument -); - -void *Task_1_through_3( - void *argument -); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 2 -#define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES 10 - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE -#define CONFIGURE_POSIX_INIT_THREAD_STACK_SIZE \ - (RTEMS_MINIMUM_STACK_SIZE * 4) - -#include - -/* global variables */ - -TEST_EXTERN pthread_t Init_id; -TEST_EXTERN pthread_t Task_id; - -/* end of include file */ - diff --git a/testsuites/psxtests/psxstat/.cvsignore b/testsuites/psxtests/psxstat/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/psxtests/psxstat/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/psxtests/psxstat/Makefile.am b/testsuites/psxtests/psxstat/Makefile.am deleted file mode 100644 index 9823ed9fb3..0000000000 --- a/testsuites/psxtests/psxstat/Makefile.am +++ /dev/null @@ -1,41 +0,0 @@ -## -## $Id$ -## - - -TEST = psxstat - -MANAGERS = all - -C_FILES = main.c test.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -DOCTYPES = scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/psxtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -AM_CPPFLAGS += -I$(top_srcdir)/include - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/psxtests/psxstat/main.c b/testsuites/psxtests/psxstat/main.c deleted file mode 100644 index 4a67c31542..0000000000 --- a/testsuites/psxtests/psxstat/main.c +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Simple test program -- simplified version of sample test hello. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT - -#include -#include - -void test_main( void ); - -rtems_task Init( - rtems_task_argument ignored -) -{ - test_main(); - rtems_test_exit( 0 ); -} - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM -#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 10 - -#define CONFIGURE_MAXIMUM_TASKS 1 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE -#define CONFIGURE_INIT_TASK_STACK_SIZE (RTEMS_MINIMUM_STACK_SIZE * 2) - -#define CONFIGURE_INIT - -#include - -/* end of file */ diff --git a/testsuites/psxtests/psxstat/psxstat.scn b/testsuites/psxtests/psxstat/psxstat.scn deleted file mode 100644 index 8be1a93e13..0000000000 --- a/testsuites/psxtests/psxstat/psxstat.scn +++ /dev/null @@ -1,1199 +0,0 @@ -*** STAT TEST 01 *** ->>>>Current Time: - rtems_clock_get - 09:00:00 12/31/1988 -Making directory /my_mount_point/dir1 -Making directory /my_mount_point/dir2 -Making directory /my_mount_point/dir3 -Making directory /my_mount_point/dir4 -Making directory /my_mount_point/dir1/dir1 -Making directory /./././my_mount_point/dir1/ dir1 -Making directory /./././my_mount_point/links -Making directory ///my_mount_point/dir1/dir1/../../dir1/../symlinks///// -Making file /////my_mount_point/dir1/\//file1\\// -Making file /my_mount_point/dir1/file2 -Making file /my_mount_point/dir1/file3 -Making file /my_mount_point/dir1/file4 -Making file /my_mount_point/dir1/dir1/file1 -Making file ../../..//my_mount_point/dir1/./././dir1/ file1 -Making file main.c -Making file dir1/dir1/../../links/dir1 -Making file links/dir2 -Making file links/dir3 -Making file links/dir4 -Making file links/dir1_dir1 -Making file links/dir1_ dir1 -Making file links/../links/../links/links -Making file links/dir1_file1 -Making file links/dir1_file2 -Making file links/dir1_file3 -Making file links/dir1_file4 -Making file links/dir1_dir1_f1 -Making file links/dir1_dir1 f1 -Making file links/links/links/links_dir1 -Making file links//links_dir2 -Making file links//links_dir3 -Making file links//links_dir4 -Making file links//links_dir1_d1 -Making file links//links_dir1 d1 -Making file links//links_links -Making file links///links_d1_file1 -Making file links///links_d1_file2 -Making file links///links_d1_file3 -Making file links///links_d1_file4 -Making file links///links_d1_d1_f1 -Making file links///links_r1_d1 f1 -Doing the stat() on all the good absolute paths -stat( /my_mount_point/dev ) returned -...st_dev (0x0:0x0) -...st_ino 2 -...st_mode 40700 -...st_nlink 1 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:00 1988 -stat( ////my_mount_point/dir1/\//file1\\// ) returned -...st_dev (0x0:0x0) -...st_ino b -...st_mode 100000 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:10 1988 -stat( /my_mount_point/dir1/\\/file2 ) returned -...st_dev (0x0:0x0) -...st_ino c -...st_mode 100000 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:10 1988 -stat( /my_mount_point/dir1/file3/////\\\ ) returned -...st_dev (0x0:0x0) -...st_ino d -...st_mode 100000 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:10 1988 -stat( /my_mount_point/dir1/file4 ) returned -...st_dev (0x0:0x0) -...st_ino e -...st_mode 100000 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:10 1988 -stat( /my_mount_point/dir1/dir1/file1 ) returned -...st_dev (0x0:0x0) -...st_ino f -...st_mode 100000 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:10 1988 -stat( /my_mount_point/dir1/dir1/ file1 ) returned -...st_dev (0x0:0x0) -...st_ino 10 -...st_mode 100000 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:10 1988 -stat( /my_mount_point/dir1 ) returned -...st_dev (0x0:0x0) -...st_ino 3 -...st_mode 40700 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 1608 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:05 1988 -stat( /my_mount_point/dir2//////\ ) returned -...st_dev (0x0:0x0) -...st_ino 4 -...st_mode 40700 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:05 1988 -stat( /my_mount_point/dir3 ) returned -...st_dev (0x0:0x0) -...st_ino 5 -...st_mode 40700 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:05 1988 -stat( /my_mount_point/dir4 ) returned -...st_dev (0x0:0x0) -...st_ino 6 -...st_mode 40700 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:05 1988 -stat( /my_mount_point/dir1/dir1 ) returned -...st_dev (0x0:0x0) -...st_ino 7 -...st_mode 40700 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 536 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:05 1988 -stat( /my_mount_point/dir1/ dir1///\\ ) returned -...st_dev (0x0:0x0) -...st_ino 8 -...st_mode 40700 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:05 1988 -stat( /my_mount_point/\/\/\/\/\/\/links\/\/\/\/\/\ ) returned -...st_dev (0x0:0x0) -...st_ino 9 -...st_mode 40700 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 6968 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:05 1988 -Doing the stat() on all the good relative paths -stat( dev ) returned -...st_dev (0x0:0x0) -...st_ino 2 -...st_mode 40700 -...st_nlink 1 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:00 1988 -stat( dir1/\//file1\\// ) returned -...st_dev (0x0:0x0) -...st_ino b -...st_mode 100000 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:10 1988 -stat( dir1/\\/file2 ) returned -...st_dev (0x0:0x0) -...st_ino c -...st_mode 100000 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:10 1988 -stat( dir1/file3/////\\\ ) returned -...st_dev (0x0:0x0) -...st_ino d -...st_mode 100000 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:10 1988 -stat( dir1/file4 ) returned -...st_dev (0x0:0x0) -...st_ino e -...st_mode 100000 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:10 1988 -stat( dir1/dir1/file1 ) returned -...st_dev (0x0:0x0) -...st_ino f -...st_mode 100000 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:10 1988 -stat( dir1/dir1/ file1 ) returned -...st_dev (0x0:0x0) -...st_ino 10 -...st_mode 100000 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:10 1988 -stat( dir1 ) returned -...st_dev (0x0:0x0) -...st_ino 3 -...st_mode 40700 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 1608 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:05 1988 -stat( dir2//////\ ) returned -...st_dev (0x0:0x0) -...st_ino 4 -...st_mode 40700 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:05 1988 -stat( dir3 ) returned -...st_dev (0x0:0x0) -...st_ino 5 -...st_mode 40700 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:05 1988 -stat( dir4 ) returned -...st_dev (0x0:0x0) -...st_ino 6 -...st_mode 40700 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:05 1988 -stat( dir1/dir1 ) returned -...st_dev (0x0:0x0) -...st_ino 7 -...st_mode 40700 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 536 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:05 1988 -stat( dir1/ dir1///\\ ) returned -...st_dev (0x0:0x0) -...st_ino 8 -...st_mode 40700 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:05 1988 -stat( main.c ) returned -...st_dev (0x0:0x0) -...st_ino 11 -...st_mode 100000 -...st_nlink 1 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:00 1988 -chdir to dev -stat relative paths that are now bad -stat( dev ) returned : No such file or directory -stat( dir1/\//file1\\// ) returned : No such file or directory -stat( dir1/\\/file2 ) returned : No such file or directory -stat( dir1/file3/////\\\ ) returned : No such file or directory -stat( dir1/file4 ) returned : No such file or directory -stat( dir1/dir1/file1 ) returned : No such file or directory -stat( dir1/dir1/ file1 ) returned : No such file or directory -stat( dir1 ) returned : No such file or directory -stat( dir2//////\ ) returned : No such file or directory -stat( dir3 ) returned : No such file or directory -stat( dir4 ) returned : No such file or directory -stat( dir1/dir1 ) returned : No such file or directory -stat( dir1/ dir1///\\ ) returned : No such file or directory -stat( main.c ) returned : No such file or directory -chdir to ../links -Doing the stat() on good links -stat( dir1/dir1/../../links/dir1 ) returned -...st_dev (0x0:0x0) -...st_ino 3 -...st_mode 40700 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 1608 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:05 1988 -stat( links/dir2 ) returned -...st_dev (0x0:0x0) -...st_ino 4 -...st_mode 40700 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:05 1988 -stat( links/dir3 ) returned -...st_dev (0x0:0x0) -...st_ino 5 -...st_mode 40700 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:05 1988 -stat( links/dir4 ) returned -...st_dev (0x0:0x0) -...st_ino 6 -...st_mode 40700 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:05 1988 -stat( links/dir1_dir1 ) returned -...st_dev (0x0:0x0) -...st_ino 7 -...st_mode 40700 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 536 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:05 1988 -stat( links/dir1_ dir1 ) returned -...st_dev (0x0:0x0) -...st_ino 8 -...st_mode 40700 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:05 1988 -stat( links/../links/../links/links ) returned -...st_dev (0x0:0x0) -...st_ino 9 -...st_mode 40700 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 6968 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:05 1988 -stat( links/dir1_file1 ) returned -...st_dev (0x0:0x0) -...st_ino b -...st_mode 100000 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:10 1988 -stat( links/dir1_file2 ) returned -...st_dev (0x0:0x0) -...st_ino c -...st_mode 100000 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:10 1988 -stat( links/dir1_file3 ) returned -...st_dev (0x0:0x0) -...st_ino d -...st_mode 100000 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:10 1988 -stat( links/dir1_file4 ) returned -...st_dev (0x0:0x0) -...st_ino e -...st_mode 100000 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:10 1988 -stat( links/dir1_dir1_f1 ) returned -...st_dev (0x0:0x0) -...st_ino f -...st_mode 100000 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:10 1988 -stat( links/dir1_dir1 f1 ) returned -...st_dev (0x0:0x0) -...st_ino 10 -...st_mode 100000 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:10 1988 -stat( links/links/links/links_dir1 ) returned -...st_dev (0x0:0x0) -...st_ino 3 -...st_mode 40700 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 1608 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:05 1988 -stat( links//links_dir2 ) returned -...st_dev (0x0:0x0) -...st_ino 4 -...st_mode 40700 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:05 1988 -stat( links//links_dir3 ) returned -...st_dev (0x0:0x0) -...st_ino 5 -...st_mode 40700 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:05 1988 -stat( links//links_dir4 ) returned -...st_dev (0x0:0x0) -...st_ino 6 -...st_mode 40700 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:05 1988 -stat( links//links_dir1_d1 ) returned -...st_dev (0x0:0x0) -...st_ino 7 -...st_mode 40700 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 536 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:05 1988 -stat( links//links_dir1 d1 ) returned -...st_dev (0x0:0x0) -...st_ino 8 -...st_mode 40700 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:05 1988 -stat( links//links_links ) returned -...st_dev (0x0:0x0) -...st_ino 9 -...st_mode 40700 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 6968 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:05 1988 -stat( links///links_d1_file1 ) returned -...st_dev (0x0:0x0) -...st_ino b -...st_mode 100000 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:10 1988 -stat( links///links_d1_file2 ) returned -...st_dev (0x0:0x0) -...st_ino c -...st_mode 100000 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:10 1988 -stat( links///links_d1_file3 ) returned -...st_dev (0x0:0x0) -...st_ino d -...st_mode 100000 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:10 1988 -stat( links///links_d1_file4 ) returned -...st_dev (0x0:0x0) -...st_ino e -...st_mode 100000 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:10 1988 -stat( links///links_d1_d1_f1 ) returned -...st_dev (0x0:0x0) -...st_ino f -...st_mode 100000 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:10 1988 -stat( links///links_r1_d1 f1 ) returned -...st_dev (0x0:0x0) -...st_ino 10 -...st_mode 100000 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:10 1988 -chmod of /my_mount_point/dir1/dir1 to Read/Write -Doing the stat() on all the bad paths -stat( /my_mount_point/links/ENAMETOOLONG__________________________ ) returned : File or path name too long -stat( /my_mount_point/dir1/file4/NOTADIR ) returned : Not a directory -stat( /my_mount_point/dir1/dir1/EACCES__ ) returned : Permission denied -Making file /my_mount_point/links/ENAMETOOLONG__________________________ : File or path name too long -Making file /my_mount_point/dir1/file4/NOTADIR : Not a directory -Making file /my_mount_point/dir1/dir1/EACCES__ : Permission denied -Return /my_mount_point/dir1/dir1 to RWX -Making file /my_mount_point/symlinks/a_file_symlink -Verify with readlink -Making file /my_mount_point/symlinks/a_dir_symlink -Verify with readlink -Making file /my_mount_point/symlinks/a_link_symlink -Verify with readlink -Making file ../symlinks/no_file -Verify with readlink -Making file /my_mount_point/symlinks/a_dir_symlink/a_file_symlink -Verify with readlink -Making file /my_mount_point/symlinks/links -Verify with readlink -stat( /my_mount_point/symlinks/a_file_symlink ) returned -...st_dev (0x0:0x0) -...st_ino b -...st_mode 100000 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:10 1988 -stat( /my_mount_point/symlinks/a_dir_symlink ) returned -...st_dev (0x0:0x0) -...st_ino 3 -...st_mode 40700 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 1876 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:05 1988 -stat( /my_mount_point/symlinks/a_link_symlink ) returned -...st_dev (0x0:0x0) -...st_ino 3 -...st_mode 40700 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 1876 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:05 1988 -stat( ../symlinks/no_file ) returned : No such file or directory -stat( /my_mount_point/symlinks/a_dir_symlink/a_file_symlink ) returned -...st_dev (0x0:0x0) -...st_ino 3 -...st_mode 40700 -...st_nlink 3 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 1876 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:05 1988 -Making file 1 -Verify with readlink -Making file 2 -Verify with readlink -Making file 3 -Verify with readlink -Making file 4 -Verify with readlink -Making file 5 -Verify with readlink -Making file 6 -Verify with readlink -Making file 7 -Verify with readlink -Making file 8 -Verify with readlink -Making file 9 -Verify with readlink -stat( 1 ) returned : No such file or directory -stat( 2 ) returned : No such file or directory -stat( 3 ) returned : No such file or directory -stat( 4 ) returned : No such file or directory -stat( 5 ) returned : No such file or directory -stat( 6 ) returned : Too many symbolic links -stat( 7 ) returned : Too many symbolic links -stat( 8 ) returned : Too many symbolic links -stat( 9 ) returned : Too many symbolic links -Pass an invalid mode to chmod should fail with EPERM -chdir to a file should fail with ENOTDIR -Verify RWX permission on /my_mount_point/dir1 via access -chmod of /my_mount_point/dir1 to Read/Write -chmod fred should fail with ENOENT -Create under /my_mount_point/dir1 should fail with EACCES -chdir to /my_mount_point/dir1/dir1 should fail with EACCES -Stat with a NULL buffer should fail with EFAULT -chmod of /my_mount_point/dir1 to Read/Write -mkdir /my_mount_point/dir1/BADNAME should fail with EACCESS -/my_mount_point/dir1 Should exist ( access ) -/my_mount_point/dir1 Should have read permission( access ) -/my_mount_point/dir1 Should have write permission( access ) -/my_mount_point/dir1 Should not have execute permission( access ) -Restore /my_mount_point/dir1 to RWX -chdir to /my_mount_point -Remove /./././my_mount_point/dir1/ dir1 -stat( /./././my_mount_point/dir1/ dir1 ) returned : No such file or directory -stat( links/dir1_ dir1 ) returned -...st_dev (0x0:0x0) -...st_ino 8 -...st_mode 40700 -...st_nlink 2 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:20 1988 -stat( links//links_dir1 d1 ) returned -...st_dev (0x0:0x0) -...st_ino 8 -...st_mode 40700 -...st_nlink 2 -...st_uid 0 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:20 1988 -Chdir to links/dir1_ dir1 -Chdir to .. should fail with ENOENT -mkdir ../t should fail with ENOENT -mkdir t -chdir to /my_mount_point -rmdir links/dir1_ dir1 should fail with ENOTDIR -unlink links/dir1_ dir1 -unlink links//links_dir1 d1 should fail with ENOTEMPTY -rmdir links//links_dir1 d1/t -unlink links/dir1_ dir1 -Attempting to mount IMFS file system at /dir1/my_mount_point -rmdir /dir1/my_mount_point should fail with EBUSY -Unmount /my_mount_point/dir1/my_mount_point -chmod of /////my_mount_point/dir1/\//file1\\// to group and other execute -Open /////my_mount_point/dir1/\//file1\\// for write should fail with EACCES -chmod of /my_mount_point/dir4 to User Execute and Read -Mkdir of /my_mount_point/dir4/NewFile should fail with EACCES -Making too many hard links. -Making file /LinkName1 -Making file /LinkName2 -Making file /LinkName3 -Making file /LinkName4 -Making file /LinkName5 -Making file /LinkName6 -Making file /LinkName7 -Making file /LinkName8 -pass fstat a null pointer should fail with EFAULT -chdir to /my_mount_point -Change group of /////my_mount_point/dir1/\//file1\\// -stat( /////my_mount_point/dir1/\//file1\\// ) returned -...st_dev (0x0:0x0) -...st_ino b -...st_mode 100011 -...st_nlink 3 -...st_uid 0 -...st_gid 1 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:25 1988 -Change owner of /////my_mount_point/dir1/\//file1\\// -stat( /////my_mount_point/dir1/\//file1\\// ) returned -...st_dev (0x0:0x0) -...st_ino b -...st_mode 100011 -...st_nlink 3 -...st_uid 1 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:25 1988 -Change group of /my_mount_point/dir1/file2 -stat( /my_mount_point/dir1/file2 ) returned -...st_dev (0x0:0x0) -...st_ino c -...st_mode 100000 -...st_nlink 3 -...st_uid 0 -...st_gid 1 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:25 1988 -Change owner of /my_mount_point/dir1/file2 -stat( /my_mount_point/dir1/file2 ) returned -...st_dev (0x0:0x0) -...st_ino c -...st_mode 100000 -...st_nlink 3 -...st_uid 1 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:25 1988 -Change group of /my_mount_point/dir1/file3 -stat( /my_mount_point/dir1/file3 ) returned -...st_dev (0x0:0x0) -...st_ino d -...st_mode 100000 -...st_nlink 3 -...st_uid 0 -...st_gid 1 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:25 1988 -Change owner of /my_mount_point/dir1/file3 -stat( /my_mount_point/dir1/file3 ) returned -...st_dev (0x0:0x0) -...st_ino d -...st_mode 100000 -...st_nlink 3 -...st_uid 1 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:25 1988 -Change group of /my_mount_point/dir1/file4 -stat( /my_mount_point/dir1/file4 ) returned -...st_dev (0x0:0x0) -...st_ino e -...st_mode 100000 -...st_nlink 3 -...st_uid 0 -...st_gid 1 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:25 1988 -Change owner of /my_mount_point/dir1/file4 -stat( /my_mount_point/dir1/file4 ) returned -...st_dev (0x0:0x0) -...st_ino e -...st_mode 100000 -...st_nlink 3 -...st_uid 1 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:25 1988 -Change group of /my_mount_point/dir1/dir1/file1 -stat( /my_mount_point/dir1/dir1/file1 ) returned -...st_dev (0x0:0x0) -...st_ino f -...st_mode 100000 -...st_nlink 3 -...st_uid 0 -...st_gid 1 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:25 1988 -Change owner of /my_mount_point/dir1/dir1/file1 -stat( /my_mount_point/dir1/dir1/file1 ) returned -...st_dev (0x0:0x0) -...st_ino f -...st_mode 100000 -...st_nlink 3 -...st_uid 1 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:25 1988 -Change group of ../../..//my_mount_point/dir1/./././dir1/ file1 -stat( ../../..//my_mount_point/dir1/./././dir1/ file1 ) returned -...st_dev (0x0:0x0) -...st_ino 10 -...st_mode 100000 -...st_nlink 3 -...st_uid 0 -...st_gid 1 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:25 1988 -Change owner of ../../..//my_mount_point/dir1/./././dir1/ file1 -stat( ../../..//my_mount_point/dir1/./././dir1/ file1 ) returned -...st_dev (0x0:0x0) -...st_ino 10 -...st_mode 100000 -...st_nlink 3 -...st_uid 1 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:25 1988 -Change group of main.c -stat( main.c ) returned -...st_dev (0x0:0x0) -...st_ino 11 -...st_mode 100000 -...st_nlink 1 -...st_uid 0 -...st_gid 1 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:25 1988 -Change owner of main.c -stat( main.c ) returned -...st_dev (0x0:0x0) -...st_ino 11 -...st_mode 100000 -...st_nlink 1 -...st_uid 1 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:25 1988 -Change group of dir1/dir1/../../links/dir1 -stat( dir1/dir1/../../links/dir1 ) returned -...st_dev (0x0:0x0) -...st_ino 3 -...st_mode 40700 -...st_nlink 3 -...st_uid 0 -...st_gid 1 -...st_rdev (0x0:0x0) -...st_size 1876 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:30 1988 -Change owner of dir1/dir1/../../links/dir1 -stat( dir1/dir1/../../links/dir1 ) returned : Permission denied -Change group of links/dir2 -stat( links/dir2 ) returned -...st_dev (0x0:0x0) -...st_ino 4 -...st_mode 40700 -...st_nlink 3 -...st_uid 0 -...st_gid 1 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:30 1988 -Change owner of links/dir2 -stat( links/dir2 ) returned -...st_dev (0x0:0x0) -...st_ino 4 -...st_mode 40700 -...st_nlink 3 -...st_uid 1 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:30 1988 -Change group of links/dir3 -stat( links/dir3 ) returned -...st_dev (0x0:0x0) -...st_ino 5 -...st_mode 40700 -...st_nlink 3 -...st_uid 0 -...st_gid 1 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:30 1988 -Change owner of links/dir3 -stat( links/dir3 ) returned -...st_dev (0x0:0x0) -...st_ino 5 -...st_mode 40700 -...st_nlink 3 -...st_uid 1 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:30 1988 -Change group of links/dir4 -stat( links/dir4 ) returned -...st_dev (0x0:0x0) -...st_ino 6 -...st_mode 40500 -...st_nlink 3 -...st_uid 0 -...st_gid 1 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:30 1988 -Change owner of links/dir4 -stat( links/dir4 ) returned -...st_dev (0x0:0x0) -...st_ino 6 -...st_mode 40500 -...st_nlink 3 -...st_uid 1 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 0 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:30 1988 -Change group of links/dir1_dir1 -stat( links/dir1_dir1 ) returned -...st_dev (0x0:0x0) -...st_ino 7 -...st_mode 40700 -...st_nlink 3 -...st_uid 0 -...st_gid 1 -...st_rdev (0x0:0x0) -...st_size 536 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:30 1988 -Change owner of links/dir1_dir1 -stat( links/dir1_dir1 ) returned -...st_dev (0x0:0x0) -...st_ino 7 -...st_mode 40700 -...st_nlink 3 -...st_uid 1 -...st_gid 0 -...st_rdev (0x0:0x0) -...st_size 536 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:30 1988 -Change group of links/dir1_ dir1 -stat( links/dir1_ dir1 ) returned : No such file or directory -Change owner of links/dir1_ dir1 -stat( links/dir1_ dir1 ) returned : No such file or directory -Change group of links/../links/../links/links -stat( links/../links/../links/links ) returned -...st_dev (0x0:0x0) -...st_ino 9 -...st_mode 40700 -...st_nlink 3 -...st_uid 0 -...st_gid 1 -...st_rdev (0x0:0x0) -...st_size 8844 -...st_atime Sat Dec 31 09:00:00 1988 -...st_mtime Sat Dec 31 09:00:00 1988 -...st_ctime Sat Dec 31 09:00:30 1988 -Change owner of links/../links/../links/links -stat( links/../links/../links/links ) returned : Permission denied -*** END OF STAT TEST 01 *** diff --git a/testsuites/psxtests/psxstat/test.c b/testsuites/psxtests/psxstat/test.c deleted file mode 100644 index 8852674181..0000000000 --- a/testsuites/psxtests/psxstat/test.c +++ /dev/null @@ -1,857 +0,0 @@ -/* - * This test exercises stat() via fstat() and generates as many of the - * path evaluation cases as possible. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define MAXSYMLINK 5 /* There needs to be a better way of getting this. */ -#define TIMEOUT_VALUE ( 5 * TICKS_PER_SECOND ) - - -/* - * List of files which should exist. - */ - -char *Files[] = { - "/////my_mount_point/dir1/\\//file1\\\\//", - "/my_mount_point/dir1/file2", - "/my_mount_point/dir1/file3", - "/my_mount_point/dir1/file4", - "/my_mount_point/dir1/dir1/file1", - "../../..//my_mount_point/dir1/./././dir1/ file1", - "main.c", - 0 -}; - -/* - * List of directories which should exist. - */ - -char *Directories[] = { - "/my_mount_point/dir1", - "/my_mount_point/dir2", - "/my_mount_point/dir3", - "/my_mount_point/dir4", - "/my_mount_point/dir1/dir1", - "/./././my_mount_point/dir1/ dir1", - "/./././my_mount_point/links", - "///my_mount_point/dir1/dir1/../../dir1/../symlinks/////", - 0 -}; - -char *Links_to_Dirs[]= { - "dir1/dir1/../../links/dir1", - "links/dir2", - "links/dir3", - "links/dir4", - "links/dir1_dir1", - "links/dir1_ dir1", - "links/../links/../links/links", - 0 -}; - -char *Links_to_Files[]= { - "links/dir1_file1", - "links/dir1_file2", - "links/dir1_file3", - "links/dir1_file4", - "links/dir1_dir1_f1", - "links/dir1_dir1 f1", - 0 -}; - -char *Links_to_dirlinks[]= { - "links/links/links/links_dir1", - "links//links_dir2", - "links//links_dir3", - "links//links_dir4", - "links//links_dir1_d1", - "links//links_dir1 d1", - "links//links_links", - 0 -}; - -char *Links_to_filelinks[]= { - "links///links_d1_file1", - "links///links_d1_file2", - "links///links_d1_file3", - "links///links_d1_file4", - "links///links_d1_d1_f1", - "links///links_r1_d1 f1", - 0 -}; - -char *SymLinks[]= { - "/my_mount_point/symlinks/a_file_symlink", - "/my_mount_point/symlinks/a_dir_symlink", - "/my_mount_point/symlinks/a_link_symlink", - "../symlinks/no_file", - "/my_mount_point/symlinks/a_dir_symlink/a_file_symlink", - 0 -}; - -/* - * List of absolute paths to stat. - */ - -char *Good_absolute_paths[] = { - "/my_mount_point/dev", - "////my_mount_point/dir1/\\//file1\\\\//", - "/my_mount_point/dir1/\\\\/file2", - "/my_mount_point/dir1/file3/////\\\\\\", - "/my_mount_point/dir1/file4", - "/my_mount_point/dir1/dir1/file1", - "/my_mount_point/dir1/dir1/ file1", - "/my_mount_point/dir1", - "/my_mount_point/dir2//////\\", - "/my_mount_point/dir3", - "/my_mount_point/dir4", - "/my_mount_point/dir1/dir1", - "/my_mount_point/dir1/ dir1///\\\\", - "/my_mount_point/\\/\\/\\/\\/\\/\\/links\\/\\/\\/\\/\\/\\", - 0 -}; - - -char *Bad_paths[] = { - "/my_mount_point/links/ENAMETOOLONG__________________________", - "/my_mount_point/dir1/file4/NOTADIR", - "/my_mount_point/dir1/dir1/EACCES__", - 0 -}; - -/* - * List of relative paths to stat. - */ - -char *Good_relative_paths[] = { - "dev", - "dir1/\\//file1\\\\//", - "dir1/\\\\/file2", - "dir1/file3/////\\\\\\", - "dir1/file4", - "dir1/dir1/file1", - "dir1/dir1/ file1", - "dir1", - "dir2//////\\", - "dir3", - "dir4", - "dir1/dir1", - "dir1/ dir1///\\\\", - "main.c", - 0 -}; - -/* - * Do a stat on a single file and report the status. - */ - -void stat_a_file( - const char *file -) -{ - int status; - struct stat statbuf; - int major1; - int minor1; - int major2; - int minor2; - - - assert( file ); - - printf( "stat( %s ) returned ", file ); - fflush( stdout ); - - status = stat( file, &statbuf ); - - if ( status == -1 ) { - printf( ": %s\n", strerror( errno ) ); - } else { - - rtems_filesystem_split_dev_t( statbuf.st_dev, major1, minor1 ); - rtems_filesystem_split_dev_t( statbuf.st_rdev, major2, minor2 ); - - - printf("\n...st_dev (0x%x:0x%x)\n", major1, minor1 ); - printf( "...st_ino %x\n", (int) statbuf.st_ino ); - printf( "...st_mode %o\n", statbuf.st_mode ); - printf( "...st_nlink %x\n", statbuf.st_nlink ); - printf( "...st_uid %d\n", statbuf.st_uid ); - printf( "...st_gid %d\n", statbuf.st_gid ); - printf( "...st_rdev (0x%x:0x%x)\n", major2, minor2 ); - printf( "...st_size %d\n",(unsigned int) statbuf.st_size ); - printf( "...st_atime %s", ctime( &statbuf.st_atime ) ); - printf( "...st_mtime %s", ctime( &statbuf.st_mtime ) ); - printf( "...st_ctime %s", ctime( &statbuf.st_ctime ) ); -#if defined(__svr4__) && !defined(__PPC__) && !defined(__sun__) - printf( "...st_blksize %x\n", statbuf.st_blksize ); - printf( "...st_blocks %x\n", statbuf.st_blocks ); -#endif - - } -} - -/* - * stat() multiple files at a time - */ - -void stat_multiple_files( - char **files -) -{ - int i; - - i = 0; - while ( files[i] ) { - stat_a_file( files[i] ); - i++; - } -} - -/* - * chown() multiple files at a time - */ -void chown_multiple_files( - char **files -) -{ - int i; - uid_t st_uid; - gid_t st_gid; - - st_uid = geteuid(); - st_gid = getegid(); - - i = 0; - while ( files[i] ) { - printf("Change group of %s\n", files[i]); - chown( files[i], st_uid, (st_gid+1) ); - stat_a_file( files[i] ); - - printf("Change owner of %s\n", files[i]); - chown( files[i], (st_uid+1), st_gid ); - stat_a_file( files[i] ); - i++; - } - -} - - - -/* - * mknod() multiple files at a time - */ - -void make_multiple_files( - char **files -) -{ - int i; - int status; - - i = 0; - while ( files[i] ) { - printf( "Making file %s\n", files[i] ); - status = mknod( files[i], ( S_IFREG | S_IROTH|S_IWOTH ), 0LL ); - assert( !status ); - i++; - } - puts( "" ); -} - -void make_multiple_bad_files( - char **files -) -{ - int i; - int status; - - i = 0; - while ( files[i] ) { - printf( "Making file %s ", files[i] ); - status = mknod( files[i], ( S_IFREG | S_IROTH|S_IWOTH ), 0LL ); - assert( status ); - printf( ": %s\n", strerror( errno ) ); - i++; - } - puts( "" ); -} - -void make_multiple_links( - char **existing, - char **new -) -{ - int i; - int status; - - i = 0; - while ( new[i] && existing[i] ) { - printf( "Making file %s\n", new[i] ); - status = link( existing[i], new[i] ); - assert( !status ); - i++; - } - puts( "" ); - - status = link( "fred", "bob" ); - assert( status == -1 ); - - status = link( existing[1], "doug/bob" ); - assert( status == -1 ); -} - - -void make_too_many_links() -{ - int i; - int status; - char name [20]; - - status = mkdir("/dummy", S_IRWXU ); - assert( status == 0 ); - - for (i=1; i<= LINK_MAX; i++) { - - sprintf(name,"/LinkName%d",i); - printf( "Making file %s\n", name ); - status = link("/dummy" , name ); - if( i < LINK_MAX ) - assert( !status ); - else - assert( status == -1 ); - - } -} - - -void make_a_symlink( - char *existing, - char *new -) -{ - int status; - char buf[100]; - int len; - - memset( buf, 0, 100 ); - - printf( "Making file %s\n", new ); - status = symlink( existing, new ); - assert( !status ); - - printf( "Verify with readlink\n"); - status = readlink( new, buf, 100 ); - len = strlen( existing ); - assert ( status == len ); - - status = readlink( new, buf, 3 ); - len = strlen( existing ); - if (len < 3 ) - assert( status == len ); - else - assert( status == 3 ); - - status = strcmp( existing, buf ); - assert( !status ); -} - -void make_multiple_symlinks() -{ - int status; - - make_a_symlink( Files[0], SymLinks[0] ); - make_a_symlink( Directories[0], SymLinks[1] ); - make_a_symlink( Links_to_dirlinks[0], SymLinks[2] ); - make_a_symlink( "No_File", SymLinks[3] ); - make_a_symlink( SymLinks[1], SymLinks[4] ); - make_a_symlink( "//my_mount_point/links","/my_mount_point/symlinks/links" ); - - stat_a_file( SymLinks[0] ); - stat_a_file( SymLinks[1] ); - stat_a_file( SymLinks[2] ); - stat_a_file( SymLinks[3] ); - stat_a_file( SymLinks[4] ); - - status = symlink( "//links", "bob/frank" ); - assert (status == -1); - -} -/* -void make_too_many_symlinks() -{ - int i, status; - char name1[8]; - - for (i=1; i <= MAXSYMLINK; i++) { - sprintf( name1, "SymLink%d", i ); - status = symlink( "/dummy", name1 ); - if( i < MAXSYMLINK ) - assert( !status ); - else - assert( status == -1 ); - } -} -*/ -void make_many_symlinks( - char *real_file, - int link_count -) -{ - int i; - char name1[5]; - char name2[5]; - char *link_file; - - link_file = real_file; - for (i=1; i < link_count; i++) { - sprintf( name1, "%d", i ); - make_a_symlink( link_file, name1 ); - strcpy( name2, name1 ); - link_file = name2; - } - - for (i=1; i < link_count; i++) { - sprintf( name1, "%d", i ); - stat_a_file( name1 ); - } - -} - -/* - * mkdir() multiple directories at a time - */ - -void make_multiple_directories( - char **files -) -{ - int i; - int status; - - i = 0; - while ( files[i] ) { - printf( "Making directory %s\n", files[i] ); - status = mkdir( files[i], S_IRWXU ); - assert( !status ); - i++; - } - puts( "" ); -} - -/* - * Cause faults. - */ - - -void Cause_faults() -{ - int fd; - int status; - char longer_name[100]; - rtems_filesystem_mount_table_entry_t *mt_entry; - - /* - * Verify chmod with an invalid type. - */ - - printf("\n\nPass an invalid mode to chmod should fail with EPERM \n" ); - status = chmod( Files[0], S_IFREG ); - assert( status == -1 ); - assert( errno == EPERM ); - - /* - * Change file to executable then try to chdir to it. - */ - - status = chmod( Files[0], S_IXUSR ); - assert( status != -1 ); - - printf("chdir to a file should fail with ENOTDIR\n"); - status = chdir( Files[0] ); - assert( status == -1 ); - assert( errno == ENOTDIR ); - - /* - * Change mode to read/write on a directory. - * Verify directory works properly. - */ - - printf("Verify RWX permission on %s via access\n", Directories[0]); - status = access( Directories[0], ( R_OK | W_OK | X_OK ) ); - assert( status == 0 ); - - printf( "chmod of %s to Read/Write\n", Directories[0] ); - status = chmod( Directories[0], (S_IXGRP | S_IXOTH) ); - assert( status == 0 ); - - printf( "chmod fred should fail with ENOENT\n" ); - status = chmod( "fred", (S_IXGRP | S_IXOTH) ); - assert( status == -1 ); - assert( errno == ENOENT ); - - strcpy(longer_name, Directories[0] ); - strcat(longer_name, "/BADNAME" ); - printf( "Create under %s should fail with EACCES\n", Directories[0] ); - status = mkdir( longer_name , S_IRWXU ); - assert( status == -1 ); - assert( errno == EACCES ); - - printf("chdir to %s should fail with EACCES\n", Directories[4] ); - status = chdir( Directories[4] ); - assert( status == -1 ); - assert( errno == EACCES ); - - /* - * Check stat with a NULL buffer. - */ - - printf("Stat with a NULL buffer should fail with EFAULT\n"); - status = stat( Directories[0], NULL ); - assert( status == -1 ); - assert( errno == EFAULT ); - - /* - * Set current to a directory with no owner permissions. - * Verify it works properly. - */ - - printf( "\n\nchmod of %s to Read/Write\n", Directories[0] ); - status = chmod( Directories[0], (S_IXGRP | S_IXOTH) ); - assert( status == 0 ); - - printf("mkdir %s should fail with EACCESS\n", longer_name ); - status = mkdir( longer_name , S_IRWXU ); - assert( status == -1 ); - assert( errno == EACCES ); - - printf("\n%s Should exist ( access )\n",Directories[0] ); - status = access( Directories[0], F_OK ); - assert( status == 0 ); - printf("\n%s Should have read permission( access )\n",Directories[0] ); - status = access( Directories[0], R_OK ); - assert( status != 0 ); - printf("\n%s Should have write permission( access )\n",Directories[0] ); - status = access( Directories[0], W_OK ); - assert( status != 0 ); - printf("\n%s Should not have execute permission( access )\n",Directories[0] ); - status = access( Directories[0], X_OK ); - assert( status != 0 ); - - printf("\nRestore %s to RWX\n",Directories[0] ); - status = chmod( Directories[0], S_IRWXU ); - assert( status == 0 ); - - printf("chdir to /my_mount_point \n"); - status = chdir( "/my_mount_point" ); - assert( status == 0 ); - - /* - * Remove one of the directories. - * Verify links to the removed directory still work. - */ - - printf( "Remove %s\n", Directories[5] ); - status = rmdir( Directories[5] ); - assert( status == 0 ); - - stat_a_file( Directories[5] ); - status = access( Directories[5], F_OK ); - assert( status != 0 ); - - stat_a_file( Links_to_Dirs[5] ); - status = readlink( Links_to_Dirs[5], longer_name, 3 ); - assert( status == -1 ); - assert( errno == EINVAL ); - - stat_a_file( Links_to_dirlinks[5] ); - printf("Chdir to %s\n", Links_to_Dirs[5] ); - status = chdir( Links_to_Dirs[5] ); - assert( status == 0 ); - - /* - * Verify we cannot move up from a node with no parent node. - */ - - printf("Chdir to .. should fail with ENOENT\n" ); - status = chdir( ".." ); - assert( status == -1 ); - assert( errno == ENOENT ); - - /* - * Create a subdirectory under the dangling node. - */ - - printf("mkdir ../t should fail with ENOENT\n" ); - status = mkdir( "../t" , S_IRWXU ); - assert( status == -1 ); - assert( errno == ENOENT ); - - printf("mkdir t\n"); - status = mkdir( "t" , S_IRWXU ); - assert( status == 0 ); - - printf("chdir to /my_mount_point\n"); - status = chdir( "/my_mount_point" ); - assert( status == 0 ); - - /* - * Check rmdir, rmnod, and unlink - */ - - printf("rmdir %s should fail with ENOTDIR\n", Links_to_Dirs[5] ); - status = rmdir( Links_to_Dirs[5] ); - assert( status == -1 ); - assert( errno == ENOTDIR ); - - printf("unlink %s\n", Links_to_Dirs[5] ); - status = unlink( Links_to_Dirs[5] ); - assert( status == 0 ); - - printf("unlink %s should fail with ENOTEMPTY\n", Links_to_dirlinks[5] ); - status = unlink( Links_to_dirlinks[5] ); - assert( status == -1 ); - assert( errno == ENOTEMPTY ); - - strcpy( longer_name, Links_to_dirlinks[5] ); - strcat( longer_name, "/t"); - printf("rmdir %s\n", longer_name ); - status = rmdir( longer_name ); - assert( status == 0 ); - - printf("unlink %s\n", Links_to_Dirs[5]); - status = unlink( Links_to_dirlinks[5] ); - assert( status == 0 ); - - status = chdir( Directories[0] ); - status = mkdir ( "my_mount_point", S_IRWXU ); - assert( status == 0 ); - - printf("Attempting to mount IMFS file system at /dir1/my_mount_point \n"); - status = mount( - &mt_entry, - &IMFS_ops, - RTEMS_FILESYSTEM_READ_WRITE, - NULL, - "/my_mount_point/dir1/my_mount_point" ); - assert( status == 0 ); - - printf("rmdir /dir1/my_mount_point should fail with EBUSY\n"); - status = rmdir ("/my_mount_point/dir1/my_mount_point" ); - assert( status == -1 ); - assert( errno == EBUSY ); - - printf( "Unmount /my_mount_point/dir1/my_mount_point\n"); - status = unmount( "/my_mount_point/dir1/my_mount_point" ); - assert( status == 0 ); - - /* - * Verify write permission is checked. - */ - - printf("chmod of %s to group and other execute\n", Files[0] ); - status = chmod (Files[0], (S_IXGRP | S_IXOTH) ); - assert( status == 0 ); - - printf("Open %s for write should fail with EACCES\n", Files[0] ); - fd = open (Files[0], O_WRONLY); - assert( fd == -1 ); - assert( errno == EACCES ); - - printf("chmod of %s to User Execute and Read\n", Directories[3] ); - status = chmod (Directories[3], (S_IXUSR | S_IRUSR) ); - assert( status == 0 ); - strcpy(longer_name, Directories[3] ); - strcat(longer_name, "/NewFile" ); - printf("Mkdir of %s should fail with EACCES\n",longer_name ); - status = mkdir( longer_name, S_IRWXU ); - assert( status != 0 ); - assert( errno == EACCES ); - - printf("Making too many hard links.\n" ); - make_too_many_links( ); - - printf( "pass fstat a null pointer should fail with EFAULT\n"); - status = fstat( fd, NULL ); - assert( status == -1 ); - assert( errno == EFAULT); - - /* - * The current directory MUST be restored at the end of this test. - */ - - printf("chdir to /my_mount_point \n"); - status = chdir( "/my_mount_point" ); - assert( status == 0 ); - -} - -void Show_Time() -{ - rtems_time_of_day time; - rtems_status_code status; - - status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time ); - printf(">>>>Current Time: "); - print_time( " - rtems_clock_get - ", &time, "\n" ); -} - -/* - * main entry point to the test - */ - -#if defined(__rtems__) -int test_main(void) -#else -int main( - int argc, - char **argv -) -#endif -{ - rtems_status_code status; - rtems_time_of_day time; - rtems_filesystem_mount_table_entry_t *mt_entry; - - puts( "\n\n*** STAT TEST 01 ***" ); - - build_time( &time, 12, 31, 1988, 9, 0, 0, 0 ); - status = rtems_clock_set( &time ); - Show_Time(); - - /* - * Create and mount another version of the filesyste. - * This allows expected node id's to be consistant across - * platforms and bsp's. - */ - - status = mkdir("/my_mount_point", S_IRWXU ); - assert( status == 0 ); - status = mount( - &mt_entry, - &IMFS_ops, - RTEMS_FILESYSTEM_READ_WRITE, - NULL, - "my_mount_point" ); - assert( status == 0 ); - status = chdir( "/my_mount_point" ); - assert( status == 0 ); - status = mkdir("dev", S_IRWXU ); - assert( status == 0 ); - - - /* - * Create the files and directories for the test. - */ - - make_multiple_directories( Directories ); - make_multiple_files( Files ); - make_multiple_links( Directories, Links_to_Dirs ); - make_multiple_links( Files, Links_to_Files ); - - status = rtems_task_wake_after( TIMEOUT_VALUE ); - make_multiple_links( Links_to_Dirs, Links_to_dirlinks ); - status = rtems_task_wake_after( TIMEOUT_VALUE ); - make_multiple_links( Links_to_Files, Links_to_filelinks ); - - status = rtems_task_wake_after( TIMEOUT_VALUE ); - - /* - * Now go through all the absolute path. - */ - - puts( "Doing the stat() on all the good absolute paths" ); - stat_multiple_files( Good_absolute_paths ); - - /* - * run through the relative paths. - */ - - puts( "\nDoing the stat() on all the good relative paths" ); - stat_multiple_files( Good_relative_paths ); - - /* - * Change directory and releative paths are now bad. - */ - - puts("\nchdir to dev"); - chdir("dev"); - puts("\nstat relative paths that are now bad"); - stat_multiple_files( Good_relative_paths ); - - /* - * Change directory to the link directory and follow links. - */ - - puts("\nchdir to ../links"); - chdir("../links"); - puts("Doing the stat() on good links\n"); - stat_multiple_files( Links_to_Dirs ); - stat_multiple_files( Links_to_Files ); - stat_multiple_files( Links_to_dirlinks ); - stat_multiple_files( Links_to_filelinks ); - - /* - * Chmod on dir1/dir1. This allows the error path to be hit. - */ - - printf( "chmod of %s to Read/Write\n", Directories[4] ); - chmod( Directories[4], (S_IROTH|S_IWOTH) ); - puts( "\nDoing the stat() on all the bad paths" ); - - stat_multiple_files( Bad_paths ); - make_multiple_bad_files( Bad_paths ); - - printf( "Return %s to RWX\n", Directories[4] ); - chmod( Directories[4], S_IRWXU ); - - - /* - * Check out symbolic links. - */ - - make_multiple_symlinks(); - make_many_symlinks( "/symlinks", 10 ); - - status = rtems_task_wake_after( TIMEOUT_VALUE ); - Cause_faults(); - - status = rtems_task_wake_after( TIMEOUT_VALUE ); - chown_multiple_files( Files ); - - status = rtems_task_wake_after( TIMEOUT_VALUE ); - chown_multiple_files( Links_to_Dirs ); - - puts( "\n\n*** END OF STAT TEST 01 ***" ); - rtems_test_exit(0); -} - - - - - - - diff --git a/testsuites/psxtests/psxtests.am b/testsuites/psxtests/psxtests.am deleted file mode 100644 index edf4bdeb51..0000000000 --- a/testsuites/psxtests/psxtests.am +++ /dev/null @@ -1,25 +0,0 @@ -## $Id$ - -project_bspdir=$(PROJECT_ROOT)/@RTEMS_BSP@ - -$(project_bspdir)/tests: - @$(mkinstalldirs) $@ - -$(project_bspdir)/tests/$(TEST)$(LIB_VARIANT).exe: $(PGM) - $(INSTALL_PROGRAM) $< $@ - -$(project_bspdir)/tests/screens: - @$(mkinstalldirs) $@ - -$(project_bspdir)/tests/screens/psxtests: - @$(mkinstalldirs) $@ - -$(project_bspdir)/tests/screens/psxtests/$(TEST).scn: $(TEST).scn - $(INSTALL_DATA) $< $@ - -TMPINSTALL_FILES = \ -$(project_bspdir)/tests \ -$(project_bspdir)/tests/$(TEST)$(LIB_VARIANT).exe \ -$(project_bspdir)/tests/screens \ -$(project_bspdir)/tests/screens/psxtests \ -$(project_bspdir)/tests/screens/psxtests/$(TEST).scn diff --git a/testsuites/psxtests/psxtime/.cvsignore b/testsuites/psxtests/psxtime/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/psxtests/psxtime/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/psxtests/psxtime/Makefile.am b/testsuites/psxtests/psxtime/Makefile.am deleted file mode 100644 index 630b47025f..0000000000 --- a/testsuites/psxtests/psxtime/Makefile.am +++ /dev/null @@ -1,39 +0,0 @@ -## -## $Id$ -## - - -TEST = psxtime - -MANAGERS = all - -C_FILES = main.c test.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -DOCTYPES = scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/psxtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/psxtests/psxtime/main.c b/testsuites/psxtests/psxtime/main.c deleted file mode 100644 index 38e6d1a951..0000000000 --- a/testsuites/psxtests/psxtime/main.c +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Simple test program -- simplified version of sample test hello. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT - -#include -#include /* instantiate buffering code if needed */ - -void test_main( void ); - -rtems_task Init( - rtems_task_argument ignored -) -{ - test_main(); - rtems_test_exit( 0 ); -} - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 1 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_INIT - -#include - -/* end of file */ diff --git a/testsuites/psxtests/psxtime/psxtime.scn b/testsuites/psxtests/psxtime/psxtime.scn deleted file mode 100644 index 57f751fcf5..0000000000 --- a/testsuites/psxtests/psxtime/psxtime.scn +++ /dev/null @@ -1,302 +0,0 @@ - - -*** POSIX TIME OF DAY TEST *** -rtems_clock_set 12:45:00 01/01/1988 -rtems_clock_get 12:45:00 01/01/1988 -gettimeofday: Fri Jan 1 12:45:00 1988 -time: Fri Jan 1 12:45:00 1988 -localtime: Fri Jan 1 12:45:00 1988 -gmtime: Fri Jan 1 12:45:00 1988 - -rtems_clock_get 12:45:05 01/01/1988 -gettimeofday: Fri Jan 1 12:45:05 1988 -time: Fri Jan 1 12:45:05 1988 -localtime: Fri Jan 1 12:45:05 1988 -gmtime: Fri Jan 1 12:45:05 1988 - -rtems_clock_get 12:45:10 01/01/1988 -gettimeofday: Fri Jan 1 12:45:10 1988 -time: Fri Jan 1 12:45:10 1988 -localtime: Fri Jan 1 12:45:10 1988 -gmtime: Fri Jan 1 12:45:10 1988 - -rtems_clock_get 12:45:15 01/01/1988 -gettimeofday: Fri Jan 1 12:45:15 1988 -time: Fri Jan 1 12:45:15 1988 -localtime: Fri Jan 1 12:45:15 1988 -gmtime: Fri Jan 1 12:45:15 1988 - -rtems_clock_get 12:45:20 01/01/1988 -gettimeofday: Fri Jan 1 12:45:20 1988 -time: Fri Jan 1 12:45:20 1988 -localtime: Fri Jan 1 12:45:20 1988 -gmtime: Fri Jan 1 12:45:20 1988 - -rtems_clock_get 12:45:25 01/01/1988 -gettimeofday: Fri Jan 1 12:45:25 1988 -time: Fri Jan 1 12:45:25 1988 -localtime: Fri Jan 1 12:45:25 1988 -gmtime: Fri Jan 1 12:45:25 1988 - -rtems_clock_set 09:00:00 12/31/1988 -rtems_clock_get 09:00:00 12/31/1988 -gettimeofday: Sat Dec 31 09:00:00 1988 -time: Sat Dec 31 09:00:00 1988 -localtime: Sat Dec 31 09:00:00 1988 -gmtime: Sat Dec 31 09:00:00 1988 - -rtems_clock_get 09:00:05 12/31/1988 -gettimeofday: Sat Dec 31 09:00:05 1988 -time: Sat Dec 31 09:00:05 1988 -localtime: Sat Dec 31 09:00:05 1988 -gmtime: Sat Dec 31 09:00:05 1988 - -rtems_clock_get 09:00:10 12/31/1988 -gettimeofday: Sat Dec 31 09:00:10 1988 -time: Sat Dec 31 09:00:10 1988 -localtime: Sat Dec 31 09:00:10 1988 -gmtime: Sat Dec 31 09:00:10 1988 - -rtems_clock_get 09:00:15 12/31/1988 -gettimeofday: Sat Dec 31 09:00:15 1988 -time: Sat Dec 31 09:00:15 1988 -localtime: Sat Dec 31 09:00:15 1988 -gmtime: Sat Dec 31 09:00:15 1988 - -rtems_clock_get 09:00:20 12/31/1988 -gettimeofday: Sat Dec 31 09:00:20 1988 -time: Sat Dec 31 09:00:20 1988 -localtime: Sat Dec 31 09:00:20 1988 -gmtime: Sat Dec 31 09:00:20 1988 - -rtems_clock_get 09:00:25 12/31/1988 -gettimeofday: Sat Dec 31 09:00:25 1988 -time: Sat Dec 31 09:00:25 1988 -localtime: Sat Dec 31 09:00:25 1988 -gmtime: Sat Dec 31 09:00:25 1988 - -rtems_clock_set 23:55:59 12/31/1999 -rtems_clock_get 23:55:59 12/31/1999 -gettimeofday: Fri Dec 31 23:55:59 1999 -time: Fri Dec 31 23:55:59 1999 -localtime: Fri Dec 31 23:55:59 1999 -gmtime: Fri Dec 31 23:55:59 1999 - -rtems_clock_get 23:56:04 12/31/1999 -gettimeofday: Fri Dec 31 23:56:04 1999 -time: Fri Dec 31 23:56:04 1999 -localtime: Fri Dec 31 23:56:04 1999 -gmtime: Fri Dec 31 23:56:04 1999 - -rtems_clock_get 23:56:09 12/31/1999 -gettimeofday: Fri Dec 31 23:56:09 1999 -time: Fri Dec 31 23:56:09 1999 -localtime: Fri Dec 31 23:56:09 1999 -gmtime: Fri Dec 31 23:56:09 1999 - -rtems_clock_get 23:56:14 12/31/1999 -gettimeofday: Fri Dec 31 23:56:14 1999 -time: Fri Dec 31 23:56:14 1999 -localtime: Fri Dec 31 23:56:14 1999 -gmtime: Fri Dec 31 23:56:14 1999 - -rtems_clock_get 23:56:19 12/31/1999 -gettimeofday: Fri Dec 31 23:56:19 1999 -time: Fri Dec 31 23:56:19 1999 -localtime: Fri Dec 31 23:56:19 1999 -gmtime: Fri Dec 31 23:56:19 1999 - -rtems_clock_get 23:56:24 12/31/1999 -gettimeofday: Fri Dec 31 23:56:24 1999 -time: Fri Dec 31 23:56:24 1999 -localtime: Fri Dec 31 23:56:24 1999 -gmtime: Fri Dec 31 23:56:24 1999 - -rtems_clock_set 00:01:30 06/30/1999 -rtems_clock_get 00:01:30 06/30/1999 -gettimeofday: Wed Jun 30 00:01:30 1999 -time: Wed Jun 30 00:01:30 1999 -localtime: Wed Jun 30 00:01:30 1999 -gmtime: Wed Jun 30 00:01:30 1999 - -rtems_clock_get 00:01:35 06/30/1999 -gettimeofday: Wed Jun 30 00:01:35 1999 -time: Wed Jun 30 00:01:35 1999 -localtime: Wed Jun 30 00:01:35 1999 -gmtime: Wed Jun 30 00:01:35 1999 - -rtems_clock_get 00:01:40 06/30/1999 -gettimeofday: Wed Jun 30 00:01:40 1999 -time: Wed Jun 30 00:01:40 1999 -localtime: Wed Jun 30 00:01:40 1999 -gmtime: Wed Jun 30 00:01:40 1999 - -rtems_clock_get 00:01:45 06/30/1999 -gettimeofday: Wed Jun 30 00:01:45 1999 -time: Wed Jun 30 00:01:45 1999 -localtime: Wed Jun 30 00:01:45 1999 -gmtime: Wed Jun 30 00:01:45 1999 - -rtems_clock_get 00:01:50 06/30/1999 -gettimeofday: Wed Jun 30 00:01:50 1999 -time: Wed Jun 30 00:01:50 1999 -localtime: Wed Jun 30 00:01:50 1999 -gmtime: Wed Jun 30 00:01:50 1999 - -rtems_clock_get 00:01:55 06/30/1999 -gettimeofday: Wed Jun 30 00:01:55 1999 -time: Wed Jun 30 00:01:55 1999 -localtime: Wed Jun 30 00:01:55 1999 -gmtime: Wed Jun 30 00:01:55 1999 - -rtems_clock_set 00:15:59 01/01/2000 -rtems_clock_get 00:15:59 01/01/2000 -gettimeofday: Sat Jan 1 00:15:59 2000 -time: Sat Jan 1 00:15:59 2000 -localtime: Sat Jan 1 00:15:59 2000 -gmtime: Sat Jan 1 00:15:59 2000 - -rtems_clock_get 00:16:04 01/01/2000 -gettimeofday: Sat Jan 1 00:16:04 2000 -time: Sat Jan 1 00:16:04 2000 -localtime: Sat Jan 1 00:16:04 2000 -gmtime: Sat Jan 1 00:16:04 2000 - -rtems_clock_get 00:16:09 01/01/2000 -gettimeofday: Sat Jan 1 00:16:09 2000 -time: Sat Jan 1 00:16:09 2000 -localtime: Sat Jan 1 00:16:09 2000 -gmtime: Sat Jan 1 00:16:09 2000 - -rtems_clock_get 00:16:14 01/01/2000 -gettimeofday: Sat Jan 1 00:16:14 2000 -time: Sat Jan 1 00:16:14 2000 -localtime: Sat Jan 1 00:16:14 2000 -gmtime: Sat Jan 1 00:16:14 2000 - -rtems_clock_get 00:16:19 01/01/2000 -gettimeofday: Sat Jan 1 00:16:19 2000 -time: Sat Jan 1 00:16:19 2000 -localtime: Sat Jan 1 00:16:19 2000 -gmtime: Sat Jan 1 00:16:19 2000 - -rtems_clock_get 00:16:24 01/01/2000 -gettimeofday: Sat Jan 1 00:16:24 2000 -time: Sat Jan 1 00:16:24 2000 -localtime: Sat Jan 1 00:16:24 2000 -gmtime: Sat Jan 1 00:16:24 2000 - -rtems_clock_set 05:10:59 02/02/2005 -rtems_clock_get 05:10:59 02/02/2005 -gettimeofday: Wed Feb 2 05:10:59 2005 -time: Wed Feb 2 05:10:59 2005 -localtime: Wed Feb 2 05:10:59 2005 -gmtime: Wed Feb 2 05:10:59 2005 - -rtems_clock_get 05:11:04 02/02/2005 -gettimeofday: Wed Feb 2 05:11:04 2005 -time: Wed Feb 2 05:11:04 2005 -localtime: Wed Feb 2 05:11:04 2005 -gmtime: Wed Feb 2 05:11:04 2005 - -rtems_clock_get 05:11:09 02/02/2005 -gettimeofday: Wed Feb 2 05:11:09 2005 -time: Wed Feb 2 05:11:09 2005 -localtime: Wed Feb 2 05:11:09 2005 -gmtime: Wed Feb 2 05:11:09 2005 - -rtems_clock_get 05:11:14 02/02/2005 -gettimeofday: Wed Feb 2 05:11:14 2005 -time: Wed Feb 2 05:11:14 2005 -localtime: Wed Feb 2 05:11:14 2005 -gmtime: Wed Feb 2 05:11:14 2005 - -rtems_clock_get 05:11:19 02/02/2005 -gettimeofday: Wed Feb 2 05:11:19 2005 -time: Wed Feb 2 05:11:19 2005 -localtime: Wed Feb 2 05:11:19 2005 -gmtime: Wed Feb 2 05:11:19 2005 - -rtems_clock_get 05:11:24 02/02/2005 -gettimeofday: Wed Feb 2 05:11:24 2005 -time: Wed Feb 2 05:11:24 2005 -localtime: Wed Feb 2 05:11:24 2005 -gmtime: Wed Feb 2 05:11:24 2005 - -rtems_clock_set 10:05:59 03/03/2010 -rtems_clock_get 10:05:59 03/03/2010 -gettimeofday: Wed Mar 3 10:05:59 2010 -time: Wed Mar 3 10:05:59 2010 -localtime: Wed Mar 3 10:05:59 2010 -gmtime: Wed Mar 3 10:05:59 2010 - -rtems_clock_get 10:06:04 03/03/2010 -gettimeofday: Wed Mar 3 10:06:04 2010 -time: Wed Mar 3 10:06:04 2010 -localtime: Wed Mar 3 10:06:04 2010 -gmtime: Wed Mar 3 10:06:04 2010 - -rtems_clock_get 10:06:09 03/03/2010 -gettimeofday: Wed Mar 3 10:06:09 2010 -time: Wed Mar 3 10:06:09 2010 -localtime: Wed Mar 3 10:06:09 2010 -gmtime: Wed Mar 3 10:06:09 2010 - -rtems_clock_get 10:06:14 03/03/2010 -gettimeofday: Wed Mar 3 10:06:14 2010 -time: Wed Mar 3 10:06:14 2010 -localtime: Wed Mar 3 10:06:14 2010 -gmtime: Wed Mar 3 10:06:14 2010 - -rtems_clock_get 10:06:19 03/03/2010 -gettimeofday: Wed Mar 3 10:06:19 2010 -time: Wed Mar 3 10:06:19 2010 -localtime: Wed Mar 3 10:06:19 2010 -gmtime: Wed Mar 3 10:06:19 2010 - -rtems_clock_get 10:06:24 03/03/2010 -gettimeofday: Wed Mar 3 10:06:24 2010 -time: Wed Mar 3 10:06:24 2010 -localtime: Wed Mar 3 10:06:24 2010 -gmtime: Wed Mar 3 10:06:24 2010 - -rtems_clock_set 15:00:59 04/04/2020 -rtems_clock_get 15:00:59 04/04/2020 -gettimeofday: Sat Apr 4 15:00:59 2020 -time: Sat Apr 4 15:00:59 2020 -localtime: Sat Apr 4 15:00:59 2020 -gmtime: Sat Apr 4 15:00:59 2020 - -rtems_clock_get 15:01:04 04/04/2020 -gettimeofday: Sat Apr 4 15:01:04 2020 -time: Sat Apr 4 15:01:04 2020 -localtime: Sat Apr 4 15:01:04 2020 -gmtime: Sat Apr 4 15:01:04 2020 - -rtems_clock_get 15:01:09 04/04/2020 -gettimeofday: Sat Apr 4 15:01:09 2020 -time: Sat Apr 4 15:01:09 2020 -localtime: Sat Apr 4 15:01:09 2020 -gmtime: Sat Apr 4 15:01:09 2020 - -rtems_clock_get 15:01:14 04/04/2020 -gettimeofday: Sat Apr 4 15:01:14 2020 -time: Sat Apr 4 15:01:14 2020 -localtime: Sat Apr 4 15:01:14 2020 -gmtime: Sat Apr 4 15:01:14 2020 - -rtems_clock_get 15:01:19 04/04/2020 -gettimeofday: Sat Apr 4 15:01:19 2020 -time: Sat Apr 4 15:01:19 2020 -localtime: Sat Apr 4 15:01:19 2020 -gmtime: Sat Apr 4 15:01:19 2020 - -rtems_clock_get 15:01:24 04/04/2020 -gettimeofday: Sat Apr 4 15:01:24 2020 -time: Sat Apr 4 15:01:24 2020 -localtime: Sat Apr 4 15:01:24 2020 -gmtime: Sat Apr 4 15:01:24 2020 - - - -*** END OF TIME OF DAY TEST 01 *** diff --git a/testsuites/psxtests/psxtime/test.c b/testsuites/psxtests/psxtime/test.c deleted file mode 100644 index 0c1cd88d33..0000000000 --- a/testsuites/psxtests/psxtime/test.c +++ /dev/null @@ -1,115 +0,0 @@ -/* - * This test exercises the time of day services via the Classic - * and POSIX APIs to make sure they are consistent. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * List of dates and times to test. - */ -#define NUMBER_OF_DATES 8 -rtems_time_of_day Dates[ NUMBER_OF_DATES ] = { - /* YEAR, MONTH, DAY, HOUR, MINUTE, SECOND, TICKS */ - { 1988, 1, 1, 12, 45, 00, 0 }, - { 1988, 12, 31, 9, 00, 00, 0 }, - { 1999, 12, 31, 23, 55, 59, 0 }, - { 1999, 06, 30, 00, 01, 30, 0 }, - { 2000, 1, 1, 0, 15, 59, 0 }, - { 2005, 2, 2, 5, 10, 59, 0 }, - { 2010, 3, 3, 10, 5, 59, 0 }, - { 2020, 4, 4, 15, 0, 59, 0 }, -}; - -/* - * Check out a single date and time - */ - -void check_a_tod( - rtems_time_of_day *the_tod -) -{ - rtems_status_code status; - rtems_time_of_day new_tod; - time_t a_time_t; - struct timeval tv; - struct tm *a_tm; - int result; - int i = 0; - - print_time( "rtems_clock_set ", the_tod, "\n" ); - status = rtems_clock_set( the_tod ); - assert( !status ); - - do { - status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &new_tod ); - assert( !status ); - print_time( "rtems_clock_get ", &new_tod, "\n" ); - - /* now do the posix time gets */ - result = gettimeofday( &tv, 0 ); - assert( result == 0 ); - a_time_t = tv.tv_sec; /* ctime() takes a time_t */ - printf( "gettimeofday: %s", ctime( &a_time_t) ); - - a_time_t = time( 0 ); - printf( "time: %s", ctime( &a_time_t ) ); - - a_tm = localtime( &a_time_t ); - printf( "localtime: %s", asctime( a_tm ) ); - - a_tm = gmtime( &a_time_t ); - printf( "gmtime: %s\n", asctime( a_tm ) ); - - status = rtems_task_wake_after( 5 * TICKS_PER_SECOND ); - - i++; - - } while( i < 6 ); -} - -/* - * main entry point to the test - */ - -#if defined(__rtems__) -int test_main(void) -#else -int main( - int argc, - char **argv -) -#endif -{ - int i; - - puts( "\n\n*** POSIX TIME OF DAY TEST ***" ); - - i = 0; - while ( i < NUMBER_OF_DATES ) { - check_a_tod( &Dates[i] ); - i++; - } - - puts( "\n\n*** END OF TIME OF DAY TEST 01 ***" ); - rtems_test_exit(0); -} - diff --git a/testsuites/psxtests/psxtimer/.cvsignore b/testsuites/psxtests/psxtimer/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/psxtests/psxtimer/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/psxtests/psxtimer/Makefile.am b/testsuites/psxtests/psxtimer/Makefile.am deleted file mode 100644 index e6ddd611fc..0000000000 --- a/testsuites/psxtests/psxtimer/Makefile.am +++ /dev/null @@ -1,44 +0,0 @@ -## -## $Id$ -## - - -TEST = psxtimer - -MANAGERS = all - -C_FILES = psxtimer.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/psxtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -AM_CPPFLAGS += -I$(top_srcdir)/include - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/psxtests/psxtimer/psxtimer.c b/testsuites/psxtests/psxtimer/psxtimer.c deleted file mode 100644 index 3d6bb3eb36..0000000000 --- a/testsuites/psxtests/psxtimer/psxtimer.c +++ /dev/null @@ -1,337 +0,0 @@ -/* - * - * This is a simple real-time applications which contains 3 periodic tasks. - * - * Task A is an independent task. - * - * Task B and C share a data. - * - * Tasks are implemented as POSIX threads. - * - * The share data is protected with a POSIX mutex. - * - * Other POSIX facilities such as timers, condition, .. is also used - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define CONFIGURE_INIT -#include "system.h" -#include /* thread facilities */ -#include /* signal facilities */ -#include /* sleep facilities */ -#include /* schedule facilities */ -#include /* time facilities */ -#include /* console facilities */ - - - -/* temporal parameters of a task */ - -struct periodic_params { - struct timespec period; - int signo; /* signal number */ - int id; /* task identification */ - }; - -pthread_attr_t attr; - -/* shared datum */ - -struct shared_data { - pthread_mutex_t mutex; - pthread_cond_t sync; - int updated; - int x; - }; - -struct shared_data data; - -/* task A */ - -void * task_a (void *arg) -{ - struct timespec my_period; - int my_sig, received_sig; - struct itimerspec timerdata; - timer_t timer_id; - time_t clock; - struct sigevent event; - sigset_t set; - - my_period = ((struct periodic_params*) arg)->period; - my_sig = ((struct periodic_params*) arg)->signo; - - /* timer create */ - event.sigev_notify = SIGEV_SIGNAL; - event.sigev_signo = my_sig; - if (timer_create (CLOCK_REALTIME, &event, &timer_id) == -1) { - perror ("Error in timer creation\n"); - pthread_exit ((void *) -1); - } - - /* block the timer signal */ - sigemptyset (&set); - sigaddset (&set,my_sig); - pthread_sigmask(SIG_BLOCK,&set,NULL); - - /* set the timer in periodic mode */ - timerdata.it_interval = my_period; - timerdata.it_value = my_period; - if (timer_settime(timer_id, 0, &timerdata, NULL) == -1) { - perror ("Error in timer setting\n"); - pthread_exit ((void *) -1); - } - - /* periodic activity */ - while(1) { - if (sigwait(&set,&received_sig) == -1) { - perror ("Error in sigwait\n"); - } - clock = time(NULL); - printf("Executing task A %s", ctime(&clock)); - } - } - -/* task B */ - -void * task_b (void *arg) -{ - struct timespec my_period; - int my_sig, received_sig; - struct itimerspec timerdata; - timer_t timer_id; - time_t clock; - struct sigevent event; - sigset_t set; - - int x; /* value to be copied to the shared datum */ - - my_period = ((struct periodic_params*) arg)->period; - my_sig = ((struct periodic_params*) arg)->signo; - - x = 1; - - /* timer create */ - event.sigev_notify = SIGEV_SIGNAL; - event.sigev_signo = my_sig; - if (timer_create (CLOCK_REALTIME, &event, &timer_id) == -1) { - perror ("Error in timer creation\n"); - pthread_exit ((void *) -1); - } - - /* block the timer signal */ - sigemptyset (&set); - sigaddset (&set,my_sig); - pthread_sigmask(SIG_BLOCK,&set,NULL); - - /* set the timer in periodic mode */ - timerdata.it_interval = my_period; - timerdata.it_value = my_period; - if (timer_settime(timer_id, 0, &timerdata, NULL) == -1) { - perror ("Error in timer setting\n"); - pthread_exit ((void *) -1); - } - - /* periodic activity */ - while(1) { - if (sigwait(&set,&received_sig) == -1) { - perror ("Error in sigwait\n"); - pthread_exit ((void *) -1); - } - pthread_mutex_lock (&data.mutex); - clock = time(NULL); - printf("Executing task B with x = %i %s", x, ctime(&clock)); - data.x = x; - data.updated = TRUE; - pthread_cond_signal (&data.sync); - pthread_mutex_unlock (&data.mutex); - x++; - } -} - -/* task C */ - -void * task_c (void *arg) -{ - struct timespec my_period; - int my_sig, received_sig; - struct itimerspec timerdata; - timer_t timer_id; - time_t clock; - struct sigevent event; - sigset_t set; - - int x; /* value to be copied to the shared datum */ - - my_period = ((struct periodic_params*) arg)->period; - my_sig = ((struct periodic_params*) arg)->signo; - - x = 0; - - /* timer create */ - event.sigev_notify = SIGEV_SIGNAL; - event.sigev_signo = my_sig; - if (timer_create (CLOCK_REALTIME, &event, &timer_id) == -1) { - perror ("Error in timer creation\n"); - pthread_exit ((void *) -1); - } - - /* block the timer signal */ - sigemptyset (&set); - sigaddset (&set,my_sig); - pthread_sigmask(SIG_BLOCK,&set,NULL); - - /* set the timer in periodic mode */ - timerdata.it_interval = my_period; - timerdata.it_value = my_period; - if (timer_settime(timer_id, 0, &timerdata, NULL) == -1) { - perror ("Error in timer setting\n"); - pthread_exit ((void *) -1); - } - - /* periodic activity */ - while(1) { - if (sigwait(&set,&received_sig) == -1) { - perror ("Error in sigwait\n"); - pthread_exit ((void *) -1); - } - pthread_mutex_lock (&data.mutex); - while (data.updated == FALSE) { - pthread_cond_wait (&data.sync,&data.mutex); - } - x = data.x; - clock = time(NULL); - printf("Executing task C with x = %i %s", x, ctime(&clock)); - pthread_mutex_unlock (&data.mutex); - } - } - - -/* main */ - -void *POSIX_Init ( - void *argument -) - -{ - pthread_mutexattr_t mutexattr; /* mutex attributes */ - pthread_condattr_t condattr; /* condition attributes */ - pthread_attr_t attr; /* task attributes */ - pthread_t ta,tb,tc; /* threads */ - sigset_t set; /* signals */ - - struct sched_param sch_param; /* schedule parameters */ - struct periodic_params params_a, params_b, params_c; - - puts( "\n\n*** POSIX Timers Test ***" ); - - data.updated = FALSE; - data.x = 0; - - /* mask signal */ - sigemptyset (&set); - sigaddset (&set,SIGALRM); - pthread_sigmask (SIG_BLOCK,&set,NULL); - - /* set mutex attributes */ - if (pthread_mutexattr_init (&mutexattr) != 0) { - perror ("Error in mutex attribute init\n"); - } - - /* init mutex */ - if (pthread_mutex_init (&data.mutex,&mutexattr) != 0) { - perror ("Error in mutex init"); - } - - /* init condition attributes */ - if (pthread_condattr_init (&condattr) != 0) { - perror ("Error in condition attribute init\n"); - } - - /* init condition */ - if (pthread_cond_init (&data.sync,&condattr) != 0) { - perror ("Error in condition init"); - } - - /* init task attributes */ - if (pthread_attr_init(&attr) != 0) { - perror ("Error in attribute init\n"); - } - - /* set explicit schedule for every task */ - if (pthread_attr_setinheritsched (&attr, - PTHREAD_EXPLICIT_SCHED) != 0) { - perror("Error in attribute inheritsched\n"); - } - - /* set task independent (join will not use) */ - if (pthread_attr_setdetachstate (&attr, - PTHREAD_CREATE_DETACHED) != 0) { - perror ("Error in attribute detachstate\n"); - } - - /* schedule policy POSIX_FIFO (priority preemtive and FIFO within the same - priority) */ - if (pthread_attr_setschedpolicy (&attr, - SCHED_FIFO) != 0) { - perror ("Error in attribute setschedpolicy\n"); - } - - /* set and create thread A with priority 1 */ - - sch_param.sched_priority = 1; - if (pthread_attr_setschedparam(&attr, &sch_param) != 0) { - perror ("Error in attribute schedparam\n"); - } - - /* Temporal parameters (1 sec. periodicity) */ - - params_a.period.tv_sec = 1; /* seconds */ - params_a.period.tv_nsec = 000000000; /* nanoseconds */ - params_a.signo = SIGALRM; - if (pthread_create (&ta, &attr, task_a, ¶ms_a) != 0 ) { - perror ("Error in thread create for task a\n"); - } - - /* set and create thread B with priority 15 */ - - sch_param.sched_priority = 15; - if (pthread_attr_setschedparam(&attr, &sch_param) != 0) { - perror ("Error in attribute schedparam"); - } - - /* Temporal parameters (2 sec. periodicity) */ - params_b.period.tv_sec = 2; /* seconds */ - params_b.period.tv_nsec = 000000000; /* nanoseconds */ - params_b.signo = SIGALRM; - if (pthread_create (&tb, &attr, task_b, ¶ms_b) != 0) { - perror ("Error in thread create for task b\n"); - } - - /* set and create thread B with priority 14 */ - - sch_param.sched_priority = 14; - if (pthread_attr_setschedparam(&attr, &sch_param) != 0 ) { - perror ("Error in attribute schedparam\n"); - } - - /* Temporal parameters (3 sec. periodicity) */ - params_c.period.tv_sec = 3; /* seconds */ - params_c.period.tv_nsec = 000000000; /* nanoseconds */ - params_c.signo = SIGALRM; - if (pthread_create (&tc, &attr, task_c, ¶ms_c) != 0) { - perror ("Error in trhead create for task c\n"); - } - - - /* execute 20 seconds and finish */ - sleep (20); - puts( "\n\n*** End of POSIX Timers Test ***" ); - rtems_test_exit (0); - } - diff --git a/testsuites/psxtests/psxtimer/psxtimer.scn b/testsuites/psxtests/psxtimer/psxtimer.scn deleted file mode 100644 index e9940d077e..0000000000 --- a/testsuites/psxtests/psxtimer/psxtimer.scn +++ /dev/null @@ -1,37 +0,0 @@ -*** POSIX Timers Test *** -Executing task A Fri Jan 1 00:00:01 1988 -Executing task B with x = 1 Fri Jan 1 00:00:02 1988 -Executing task A Fri Jan 1 00:00:02 1988 -Executing task C with x = 1 Fri Jan 1 00:00:03 1988 -Executing task A Fri Jan 1 00:00:03 1988 -Executing task B with x = 2 Fri Jan 1 00:00:04 1988 -Executing task A Fri Jan 1 00:00:04 1988 -Executing task A Fri Jan 1 00:00:05 1988 -Executing task B with x = 3 Fri Jan 1 00:00:06 1988 -Executing task C with x = 3 Fri Jan 1 00:00:06 1988 -Executing task A Fri Jan 1 00:00:06 1988 -Executing task A Fri Jan 1 00:00:07 1988 -Executing task B with x = 4 Fri Jan 1 00:00:08 1988 -Executing task A Fri Jan 1 00:00:08 1988 -Executing task C with x = 4 Fri Jan 1 00:00:09 1988 -Executing task A Fri Jan 1 00:00:09 1988 -Executing task B with x = 5 Fri Jan 1 00:00:10 1988 -Executing task A Fri Jan 1 00:00:10 1988 -Executing task A Fri Jan 1 00:00:11 1988 -Executing task B with x = 6 Fri Jan 1 00:00:12 1988 -Executing task C with x = 6 Fri Jan 1 00:00:12 1988 -Executing task A Fri Jan 1 00:00:12 1988 -Executing task A Fri Jan 1 00:00:13 1988 -Executing task B with x = 7 Fri Jan 1 00:00:14 1988 -Executing task A Fri Jan 1 00:00:14 1988 -Executing task C with x = 7 Fri Jan 1 00:00:15 1988 -Executing task A Fri Jan 1 00:00:15 1988 -Executing task B with x = 8 Fri Jan 1 00:00:16 1988 -Executing task A Fri Jan 1 00:00:16 1988 -Executing task A Fri Jan 1 00:00:17 1988 -Executing task B with x = 9 Fri Jan 1 00:00:18 1988 -Executing task C with x = 9 Fri Jan 1 00:00:18 1988 -Executing task A Fri Jan 1 00:00:18 1988 -Executing task A Fri Jan 1 00:00:19 1988 -Executing task B with x = 10 Fri Jan 1 00:00:20 1988 -*** End of POSIX Timers Test *** diff --git a/testsuites/psxtests/psxtimer/system.h b/testsuites/psxtests/psxtimer/system.h deleted file mode 100644 index 38c9bc6a92..0000000000 --- a/testsuites/psxtests/psxtimer/system.h +++ /dev/null @@ -1,64 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * system.h,v 1.9 1996/08/09 18:48:33 joel Exp - */ - -/* functions */ - -#include -#include -#include -#include - -void *POSIX_Init ( - void *arg -); - -void *task_a( - void *arg -); - -void *task_b( - void *arg -); - -void *task_c( - void *arg -); - - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_POSIX_INIT_THREAD_TABLE - -#define CONFIGURE_MAXIMUM_POSIX_THREADS 4 -#define CONFIGURE_MAXIMUM_POSIX_TIMERS 4 -#define CONFIGURE_MAXIMUM_TIMERS 4 -#define CONFIGURE_MAXIMUM_POSIX_MUTEXES 2 -#define CONFIGURE_MAXIMUM_POSIX_CONDITION_VARIABLES 2 - - -#include - -/* global variables */ - -#ifdef CONFIGURE_INIT -#define TEST_EXTERN -#else -#define TEST_EXTERN extern -#endif - -TEST_EXTERN pthread_t Init_id; -TEST_EXTERN pthread_t Task_id; - -/* end of include file */ diff --git a/testsuites/samples/.cvsignore b/testsuites/samples/.cvsignore deleted file mode 100644 index bfdfd995be..0000000000 --- a/testsuites/samples/.cvsignore +++ /dev/null @@ -1,14 +0,0 @@ -aclocal.m4 -autom4te*.cache -config.cache -config.guess -config.log -config.status -config.sub -configure -depcomp -install-sh -Makefile -Makefile.in -missing -mkinstalldirs diff --git a/testsuites/samples/ChangeLog b/testsuites/samples/ChangeLog deleted file mode 100644 index b0f0031184..0000000000 --- a/testsuites/samples/ChangeLog +++ /dev/null @@ -1,194 +0,0 @@ -2003-02-11 Ralf Corsepius - - * configure.ac: AM_INIT_AUTOMAKE([1.7.2]). - -2003-02-11 Ralf Corsepius - - * configure.ac: AC_PREREQ(2.57). - -2003-01-27 Joel Sherrill - - * Makefile.am, configure.ac: Added new test loopback which shows how to - use the loopback interface. Thank you Eric Norum for a portable - target independent test which exercises the TCP/IP. This should - prevent massive failures in the TCP/IP stack from reaching the - street. - * loopback/.cvsignore, loopback/Makefile.am, loopback/README, - loopback/init.c, loopback/loopback.scn: New files. - -2003-01-03 Joel Sherrill - - * unlimited/system.h, unlimited/test1.c: Backed off previous - modification as it does not compile. - -2002-10-31 Chris Johns - - * unlimited/test1.c: PR296. Only fails if more tasks than allowed - can be created. - * unlimited/system.h: PR296. Reference the number of tasks in the - configuration table rather than a hardcoded number. - -2002-11-05 Ralf Corsepius - - * configure.ac: Unconditionally check for CXX (Hack to bug in - autoconf > 2.54). - -2002-10-31 Joel Sherrill - - * base_mp/apptask.c: Removed warning. - -2002-10-28 Joel Sherrill - - * base_mp/apptask.c: Add include of to eliminate warning. - -2002-10-21 Ralf Corsepius - - * .cvsignore: Reformat. - Add autom4te*cache. - Remove autom4te.cache. - -2002-08-11 Ralf Corsepius - - * base_mp/node1/Makefile.am: Use .$(OBJEXT) instead of .o. - * base_mp/node2/Makefile.am: Use .$(OBJEXT) instead of .o. - * base_sp/Makefile.am: Use .$(OBJEXT) instead of .o. - * cdtest/Makefile.am: Use .$(OBJEXT) instead of .o. - * hello/Makefile.am: Use .$(OBJEXT) instead of .o. - * minimum/Makefile.am: Use .$(OBJEXT) instead of .o. - * paranoia/Makefile.am: Use .$(OBJEXT) instead of .o. - * ticker/Makefile.am: Use .$(OBJEXT) instead of .o. - * unlimited/Makefile.am: Use .$(OBJEXT) instead of .o. - -2002-08-01 Joel Sherrill - - * Per PR47 add support for buffered test output. This involved - adding defines to redirect output to a buffer and dump it when - full, at "test pause", and at exit. To avoid problems when redefining - exit(), all tests were modified to call rtems_test_exit(). - Some tests, notable psxtests, had to be modified to include - the standard test macro .h file (pmacros.h or tmacros.h) to - enable this support. - * cdtest/init.c: Modified. - -2002-07-01 Joel Sherrill - - * unlimited/test1.c: Corrected use of _Objects_Information_table - now that it is a two dimensional array based upon API and class. - -2002-04-17 Ralf Corsepius - - * base_sp/apptask.c: Include . - * hello/init.c: Ditto. - * paranoia/init.c: Ditto. - * ticker/tasks.c: Ditto. - * unlimited/init.c: Ditto. - * unlimited/test1.c: Ditto. - * unlimited/test2.c: Ditto. - * unlimited/test3.c: Ditto. - -2002-04-14 Ralf Corsepius - - * configure.ac: Remove ENABLE_GCC28. - -2002-03-27 Ralf Corsepius - - * configure.ac: - AC_INIT(package,_RTEMS_VERSION,_RTEMS_BUGS). - AM_INIT_AUTOMAKE([no-define foreign 1.6]). - * base_mp/node1/Makefile.am: Remove AUTOMAKE_OPTIONS. - * base_mp/Makefile.am: Remove AUTOMAKE_OPTIONS. - * base_mp/node2/Makefile.am: Remove AUTOMAKE_OPTIONS. - * Makefile.am: Remove AUTOMAKE_OPTIONS. - * base_sp/Makefile.am: Remove AUTOMAKE_OPTIONS. - * cdtest/Makefile.am: Remove AUTOMAKE_OPTIONS. - * hello/Makefile.am: Remove AUTOMAKE_OPTIONS. - * minimum/Makefile.am: Remove AUTOMAKE_OPTIONS. - * paranoia/Makefile.am: Remove AUTOMAKE_OPTIONS. - * ticker/Makefile.am: Remove AUTOMAKE_OPTIONS. - * unlimited/Makefile.am: Remove AUTOMAKE_OPTIONS. - -2001-11-26 Ralf Corsepius - - * cdtest/main.cc: Remove RTEMS_TEST_IO_STREAM. - -2001-10-25 Eric Norum - - * cdtest/system.h: Configure 1 semaphore. This probably covers - up not defining one for the GCC C++ Run-Time Libraries. - -2001-10-17 Ralf Corsepius - - * paranoia/Makefile.am: Use LD_LIBS = -lm to make automake-1.5 happy. - -2001-10-12 Joel Sherrill - - * unlimited/init.c, unlimited/system.h, unlimited/test1.c, - unlimited/test2.c, unlimited/test3.c, unlimited/unlimited.doc: - Fixed typo. - -2001-10-11 Ralf Corsepius - - * .cvsignore: Add autom4te.cache for autoconf > 2.52. - * configure.in: Remove. - * configure.ac: New file, generated from configure.in by autoupdate. - -2001-09-22 Ralf Corsepius - - * minimum/Makefile.am: Fix comments to make automake-1.5 happy. - * sample.am: Use TMPINSTALL_FILES = to make automake-1.5 happy. - * cdtest/Makefile.am: Remove LD_LIBS. - -2001-09-19 Ralf Corsepius - - * unlimited/Makefile.am: include leaf.am instead of leaf.cfg. - * base_mp/node2/Makefile.am: include leaf.am instead of leaf.cfg. - * base_mp/node1/Makefile.am: include leaf.am instead of leaf.cfg. - * hello/Makefile.am: include leaf.am instead of leaf.cfg. - * base_sp/Makefile.am: include leaf.am instead of leaf.cfg. - * paranoia/Makefile.am: include leaf.am instead of leaf.cfg. - * cdtest/Makefile.am: include leaf.am instead of leaf.cfg, use - make-cxx-exe. - * ticker/Makefile.am: include leaf.am instead of leaf.cfg. - * minimum/Makefile.am: include leaf.am instead of leaf.cfg. - -2001-06-14 Joel Sherrill - - * cdtest/system.h: Removed configure of POSIX mutexes since - there do not appear to be any used in this test. - -2001-05-10 Ralf Corsepius - - * configure.in: Use RTEMS_PROG_CC_FOR_TARGET([-ansi -fasm]). - -2000-11-09 Ralf Corsepius - - * Makefile.am: Use ... instead of RTEMS_TOPdir in ACLOCAL_AMFLAGS. - -2000-11-02 Ralf Corsepius - - * Makefile.am: Switch to ACLOCAL_AMFLAGS = -I $(RTEMS_TOPdir)/aclocal. - -2000-10-30 Joel Sherrill - - * POSIX include files merged into newlib. This resulted in - some definitions moving to other files and thus some secondary - effects in RTEMS source code. - * paranoia/paranoia.c: Commented out incorrect and conflicting - prototype of read(). - -2000-10-27 Ralf Corsepius - - * Makefile.am: ACLOCAL_AMFLAGS= -I $(RTEMS_TOPdir)/macros. - Switch to GNU canonicalization. - * sample.am: Remove DEFS. - -2000-09-04 Ralf Corsepius - - * base_mp/node1/Makefile.am, base_mp/node2/Makefile.am, - base_sp/Makefile.am, cdtest/Makefile.am, hello/Makefile.am, - minimum/Makefile.am, paranoia/Makefile.am, ticker/Makefile.am, - unlimited/Makefile.am: Include compile.am - -2000-08-10 Joel Sherrill - - * ChangeLog: New file. diff --git a/testsuites/samples/Makefile.am b/testsuites/samples/Makefile.am deleted file mode 100644 index d10b81b308..0000000000 --- a/testsuites/samples/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -## -## $Id$ -## - -ACLOCAL_AMFLAGS = -I ../../../../aclocal - -CPLUSPLUS_TESTS = cdtest - -## base_mp is a sample multiprocessing test -MP_TESTS = base_mp - -FP_TESTS = paranoia - -## loopback tests a network loopback interface -NET_TESTS = loopback - -SUBDIRS = hello ticker base_sp unlimited minimum $(MP_TESTS) \ - $(CPLUSPLUS_TESTS) $(FP_TESTS) $(NET_TESTS) - -AUTOMAKE_FILES = sample.am - -EXTRA_DIST = $(AUTOMAKE_FILES) - -include $(top_srcdir)/../../../../automake/subdirs.am -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/samples/README b/testsuites/samples/README deleted file mode 100644 index 9a94a9b0fd..0000000000 --- a/testsuites/samples/README +++ /dev/null @@ -1,72 +0,0 @@ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# -# $Id$ -# - -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/.cvsignore b/testsuites/samples/base_mp/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/samples/base_mp/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/samples/base_mp/Makefile.am b/testsuites/samples/base_mp/Makefile.am deleted file mode 100644 index 77ac7b9fe2..0000000000 --- a/testsuites/samples/base_mp/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ -## -## $Id$ -## - - -SUBDIRS = node1 node2 - -EXTRA_DIST = apptask.c init.c system.h - -include $(top_srcdir)/../../../../automake/subdirs.am -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/samples/base_mp/apptask.c b/testsuites/samples/base_mp/apptask.c deleted file mode 100644 index a5364dd5fc..0000000000 --- a/testsuites/samples/base_mp/apptask.c +++ /dev/null @@ -1,38 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" -#include -#include - -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 deleted file mode 100644 index a30bed867f..0000000000 --- a/testsuites/samples/base_mp/init.c +++ /dev/null @@ -1,46 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define CONFIGURE_INIT -#include "system.h" -#include - -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, RTEMS_MINIMUM_STACK_SIZE, - RTEMS_INTERRUPT_LEVEL(0), RTEMS_DEFAULT_ATTRIBUTES, &tid ); - status = rtems_task_start( - tid, - Application_task, - Multiprocessing_configuration.node - ); - status = rtems_task_delete( RTEMS_SELF ); -} diff --git a/testsuites/samples/base_mp/node1/.cvsignore b/testsuites/samples/base_mp/node1/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/samples/base_mp/node1/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/samples/base_mp/node1/Makefile.am b/testsuites/samples/base_mp/node1/Makefile.am deleted file mode 100644 index 6e4676ce09..0000000000 --- a/testsuites/samples/base_mp/node1/Makefile.am +++ /dev/null @@ -1,50 +0,0 @@ -## -## $Id$ -## - - -VPATH = @srcdir@:@srcdir@/.. - -NODE = 1 -SAMPLE = base_mp-node$(NODE) -PGM = ${ARCH}/$(SAMPLE).exe - -MANAGERS = io mp - -C_FILES = init.c apptask.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=base_mp.%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/sample.am - -AM_CPPFLAGS += -DNODE_NUMBER=$(NODE) -I. - -if HAS_MP - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) -else -all-local: -endif - -EXTRA_DIST = $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/samples/base_mp/node1/base_mp.doc b/testsuites/samples/base_mp/node1/base_mp.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/samples/base_mp/node1/base_mp.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/samples/base_mp/node1/base_mp.scn b/testsuites/samples/base_mp/node1/base_mp.scn deleted file mode 100644 index a2d2f359be..0000000000 --- a/testsuites/samples/base_mp/node1/base_mp.scn +++ /dev/null @@ -1,5 +0,0 @@ -*** SAMPLE MULTIPROCESSOR APPLICATION *** -Creating and starting an application task -This task was invoked with the node argument (1) -This task has the id of 0x10002 -*** END OF SAMPLE MULTIPROCESSOR APPLICATION *** diff --git a/testsuites/samples/base_mp/node2/.cvsignore b/testsuites/samples/base_mp/node2/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/samples/base_mp/node2/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/samples/base_mp/node2/Makefile.am b/testsuites/samples/base_mp/node2/Makefile.am deleted file mode 100644 index b4931f5fbd..0000000000 --- a/testsuites/samples/base_mp/node2/Makefile.am +++ /dev/null @@ -1,50 +0,0 @@ -## -## $Id$ -## - - -VPATH = @srcdir@:@srcdir@/.. - -NODE = 2 -SAMPLE = base_mp-node$(NODE) -PGM = ${ARCH}/$(SAMPLE).exe - -MANAGERS = io mp - -C_FILES = init.c apptask.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=base_mp.%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/sample.am - -AM_CPPFLAGS += -DNODE_NUMBER=$(NODE) -I. - -if HAS_MP - -# -# (OPTIONAL) Add local stuff here using += -# - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) -else -all-local: -endif - -EXTRA_DIST = $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/samples/base_mp/node2/base_mp.doc b/testsuites/samples/base_mp/node2/base_mp.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/samples/base_mp/node2/base_mp.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/samples/base_mp/node2/base_mp.scn b/testsuites/samples/base_mp/node2/base_mp.scn deleted file mode 100644 index 95bc96a808..0000000000 --- a/testsuites/samples/base_mp/node2/base_mp.scn +++ /dev/null @@ -1,5 +0,0 @@ -*** SAMPLE MULTIPROCESSOR APPLICATION *** -Creating and starting an application task -This task was invoked with the node argument (2) -This task has the id of 0x20002 -*** END OF SAMPLE MULTIPROCESSOR APPLICATION *** diff --git a/testsuites/samples/base_mp/system.h b/testsuites/samples/base_mp/system.h deleted file mode 100644 index 428a5019e3..0000000000 --- a/testsuites/samples/base_mp/system.h +++ /dev/null @@ -1,47 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_task Application_task( - rtems_task_argument argument -); - -/* configuration information */ - -#include /* for device driver prototypes */ - -#define CONFIGURE_MP_APPLICATION - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 2 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -/* - * Put the overrides of default configuration parameters here. - */ - -#include - -/* end of include file */ diff --git a/testsuites/samples/base_sp/.cvsignore b/testsuites/samples/base_sp/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/samples/base_sp/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/samples/base_sp/Makefile.am b/testsuites/samples/base_sp/Makefile.am deleted file mode 100644 index e7f38b6963..0000000000 --- a/testsuites/samples/base_sp/Makefile.am +++ /dev/null @@ -1,41 +0,0 @@ -## -## $Id$ -## - - -SAMPLE = base_sp -PGM = ${ARCH}/$(SAMPLE).exe - -MANAGERS = io - -C_FILES = init.c apptask.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=$(SAMPLE).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/sample.am - -# -# (OPTIONAL) Add local stuff here using += -# - -all-local: ${ARCH} $(TMPINSTALL_FILES) - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/samples/base_sp/apptask.c b/testsuites/samples/base_sp/apptask.c deleted file mode 100644 index 5e2f55f1dc..0000000000 --- a/testsuites/samples/base_sp/apptask.c +++ /dev/null @@ -1,39 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" -#include -#include - -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 deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/samples/base_sp/base_sp.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/samples/base_sp/base_sp.scn b/testsuites/samples/base_sp/base_sp.scn deleted file mode 100644 index 117ddaecb8..0000000000 --- a/testsuites/samples/base_sp/base_sp.scn +++ /dev/null @@ -1,5 +0,0 @@ -*** 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 deleted file mode 100644 index e5eae4c9a5..0000000000 --- a/testsuites/samples/base_sp/init.c +++ /dev/null @@ -1,48 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define CONFIGURE_INIT -#include "system.h" -#include - -#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, RTEMS_MINIMUM_STACK_SIZE, - 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 deleted file mode 100644 index 233cbb7f2f..0000000000 --- a/testsuites/samples/base_sp/system.h +++ /dev/null @@ -1,40 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_task Application_task( - rtems_task_argument argument -); - -/* configuration information */ - -#include /* for device driver prototypes */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 2 -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* end of include file */ diff --git a/testsuites/samples/cdtest/.cvsignore b/testsuites/samples/cdtest/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/samples/cdtest/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/samples/cdtest/Makefile.am b/testsuites/samples/cdtest/Makefile.am deleted file mode 100644 index 45969efbd2..0000000000 --- a/testsuites/samples/cdtest/Makefile.am +++ /dev/null @@ -1,48 +0,0 @@ -## -## $Id$ -## - - -SAMPLE = cdtest -PGM = ${ARCH}/$(SAMPLE).exe - -MANAGERS = all - -C_FILES = init.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -CC_FILES = main.cc -CC_O_FILES = $(CC_FILES:%.cc=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn -DOCS = $(DOCTYPES:%=$(SAMPLE).%) - -SRCS = $(DOCS) $(C_FILES) $(CC_FILES) $(H_FILES) -OBJS = $(C_O_FILES) $(CC_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/sample.am - -# -# (OPTIONAL) Add local stuff here using += -# - -if HAS_CXX -${PGM}: $(OBJS) $(LINK_FILES) - $(make-cxx-exe) - -all-local: ${ARCH} $(TMPINSTALL_FILES) -else -all-local: -endif - -EXTRA_DIST = $(C_FILES) $(CC_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/samples/cdtest/cdtest.scn b/testsuites/samples/cdtest/cdtest.scn deleted file mode 100644 index a832a72372..0000000000 --- a/testsuites/samples/cdtest/cdtest.scn +++ /dev/null @@ -1,31 +0,0 @@ -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 deleted file mode 100644 index 2ba973793a..0000000000 --- a/testsuites/samples/cdtest/init.c +++ /dev/null @@ -1,26 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define CONFIGURE_INIT -#include "system.h" -#include -#include diff --git a/testsuites/samples/cdtest/main.cc b/testsuites/samples/cdtest/main.cc deleted file mode 100644 index a319a6f058..0000000000 --- a/testsuites/samples/cdtest/main.cc +++ /dev/null @@ -1,214 +0,0 @@ -/* - * 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. - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * - * by Rosimildo da Silva: - * Modified the test a bit to indicate when an instance is - * global or not, and added code to test C++ exception. - * - * - * $Id$ - */ - -#include -#include -#include -#ifdef RTEMS_TEST_IO_STREAM -#include -#endif - -extern "C" -{ -#include -extern rtems_task main_task(rtems_task_argument); -} - -static int num_inst = 0; - -class AClass { -public: - AClass(const char *p = "LOCAL" ) : ptr( p ) - { - num_inst++; - printf( - "%s: Hey I'm in base class constructor number %d for %p.\n", - p, num_inst, this - ); - - /* - * Make sure we use some space - */ - - string = new char[50]; - sprintf(string, "Instantiation order %d", num_inst); - }; - - virtual ~AClass() - { - printf( - "%s: Hey I'm in base class destructor number %d for %p.\n", - ptr, num_inst, this - ); - print(); - num_inst--; - }; - - virtual void print() { printf("%s\n", string); }; - -protected: - char *string; - const char *ptr; -}; - -class BClass : public AClass { -public: - BClass(const char *p = "LOCAL" ) : AClass( p ) - { - num_inst++; - printf( - "%s: Hey I'm in derived class constructor number %d for %p.\n", - p, num_inst, this - ); - - /* - * Make sure we use some space - */ - - string = new char[50]; - sprintf(string, "Instantiation order %d", num_inst); - }; - - ~BClass() - { - printf( - "%s: Hey I'm in derived class destructor number %d for %p.\n", - ptr, num_inst, - this - ); - print(); - num_inst--; - }; - - void print() { printf("Derived class - %s\n", string); } -}; - - -class RtemsException -{ -public: - - RtemsException( char *module, int ln, int err = 0 ) - : error( err ), line( ln ), file( module ) - { - printf( "RtemsException raised=File:%s, Line:%d, Error=%X\n", - file, line, error ); - } - - void show() - { - printf( "RtemsException ---> File:%s, Line:%d, Error=%X\n", - file, line, error ); - } - -private: - int error; - int line; - char *file; - -}; - - - -AClass foo( "GLOBAL" ); -BClass foobar( "GLOBAL" ); - -void -cdtest(void) -{ - AClass bar, blech, blah; - BClass bleak; - -#ifdef RTEMS_TEST_IO_STREAM - cout << "Testing a C++ I/O stream" << endl; -#else - printf("IO Stream not tested\n"); -#endif - bar = blech; - rtems_task_wake_after( 5 * get_ticks_per_second() ); -} - -// -// main equivalent -// It can not be called 'main' since the bsp owns that name -// in many implementations in order to get global constructors -// run. -// - -static void foo_function() -{ - try - { - throw "foo_function() throw this exception"; - } - catch( const char *e ) - { - printf( "foo_function() catch block called:\n < %s >\n", e ); - throw "foo_function() re-throwing execption..."; - } -} - -rtems_task main_task( - rtems_task_argument -) -{ - printf( "\n\n*** CONSTRUCTOR/DESTRUCTOR TEST ***\n" ); - - cdtest(); - - printf( "*** END OF CONSTRUCTOR/DESTRUCTOR TEST ***\n\n\n" ); - - - printf( "*** TESTING C++ EXCEPTIONS ***\n\n" ); - - try - { - foo_function(); - } - catch( const char *e ) - { - printf( "Success catching a char * exception\n%s\n", e ); - } - try - { - printf( "throw an instance based exception\n" ); - throw RtemsException( __FILE__, __LINE__, 0x55 ); - } - catch( RtemsException & ex ) - { - printf( "Success catching RtemsException...\n" ); - ex.show(); - } - catch(...) - { - printf( "Caught another exception.\n" ); - } - printf( "Exceptions are working properly.\n" ); - rtems_task_wake_after( 5 * get_ticks_per_second() ); - printf( "Global Dtors should be called after this line....\n" ); - exit(0); -} diff --git a/testsuites/samples/cdtest/system.h b/testsuites/samples/cdtest/system.h deleted file mode 100644 index ba9fcd54bd..0000000000 --- a/testsuites/samples/cdtest/system.h +++ /dev/null @@ -1,40 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task main_task( - rtems_task_argument argument -); - -/* configuration information */ - -#include /* for device driver prototypes */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 1 -#define CONFIGURE_MAXIMUM_SEMAPHORES 1 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE -#define CONFIGURE_INIT_TASK_ENTRY_POINT main_task -#define CONFIGURE_INIT_TASK_NAME rtems_build_name( 'C', 'T', 'O', 'R' ) - -#include - -/* end of include file */ diff --git a/testsuites/samples/configure.ac b/testsuites/samples/configure.ac deleted file mode 100644 index 4443987dbe..0000000000 --- a/testsuites/samples/configure.ac +++ /dev/null @@ -1,55 +0,0 @@ -## Process this file with autoconf to produce a configure script. -## -## $Id$ - -AC_PREREQ(2.57) -AC_INIT([rtems-c-src-tests-samples],[_RTEMS_VERSION],[rtems-bugs@OARcorp.com]) -AC_CONFIG_SRCDIR([hello]) -RTEMS_TOP(../../../..) -AC_CONFIG_AUX_DIR(../../../..) - -RTEMS_CANONICAL_TARGET_CPU - -AM_INIT_AUTOMAKE([no-define foreign 1.7.2]) -AM_MAINTAINER_MODE - -RTEMS_ENABLE_NETWORKING -RTEMS_ENABLE_CXX -RTEMS_ENABLE_BARE - -RTEMS_ENV_RTEMSBSP -RTEMS_CHECK_CPU -RTEMS_CANONICAL_HOST - -RTEMS_PROJECT_ROOT - -RTEMS_PROG_CC_FOR_TARGET([-ansi -fasm]) - -RTEMS_PROG_CXX_FOR_TARGET - -RTEMS_CANONICALIZE_TOOLS - -RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP) -RTEMS_CHECK_MULTIPROCESSING(RTEMS_BSP) -RTEMS_CHECK_CXX(RTEMS_BSP) -RTEMS_CHECK_NETWORKING - -AM_CONDITIONAL(HAS_NETWORKING,test "$HAS_NETWORKING" = "yes") -AM_CONDITIONAL(HAS_CXX,test "$HAS_CPLUSPLUS" = "yes") -AM_CONDITIONAL(HAS_MP,test "$HAS_MP" = "yes") - -# Explicitly list all Makefiles here -AC_CONFIG_FILES([Makefile -base_sp/Makefile -hello/Makefile -loopback/Makefile -minimum/Makefile -paranoia/Makefile -ticker/Makefile -unlimited/Makefile -base_mp/Makefile -base_mp/node1/Makefile -base_mp/node2/Makefile -cdtest/Makefile -]) -AC_OUTPUT diff --git a/testsuites/samples/hello/.cvsignore b/testsuites/samples/hello/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/samples/hello/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/samples/hello/Makefile.am b/testsuites/samples/hello/Makefile.am deleted file mode 100644 index fe1e1440af..0000000000 --- a/testsuites/samples/hello/Makefile.am +++ /dev/null @@ -1,41 +0,0 @@ -## -## $Id$ -## - - -SAMPLE = hello -PGM = ${ARCH}/$(SAMPLE).exe - -MANAGERS = io - -C_FILES = init.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=$(SAMPLE).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/sample.am - -# -# (OPTIONAL) Add local stuff here using += -# - -all-local: ${ARCH} $(TMPINSTALL_FILES) - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/samples/hello/hello.doc b/testsuites/samples/hello/hello.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/samples/hello/hello.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/samples/hello/hello.scn b/testsuites/samples/hello/hello.scn deleted file mode 100644 index d9e92d81d5..0000000000 --- a/testsuites/samples/hello/hello.scn +++ /dev/null @@ -1,3 +0,0 @@ -*** HELLO WORLD TEST *** -Hello World -*** END OF HELLO WORLD TEST *** diff --git a/testsuites/samples/hello/init.c b/testsuites/samples/hello/init.c deleted file mode 100644 index fed39513ca..0000000000 --- a/testsuites/samples/hello/init.c +++ /dev/null @@ -1,36 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define CONFIGURE_INIT -#include "system.h" -#include -#include - -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 deleted file mode 100644 index 79a57713d0..0000000000 --- a/testsuites/samples/hello/system.h +++ /dev/null @@ -1,38 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -/* configuration information */ - -#include /* for device driver prototypes */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 1 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM - -#include - -/* end of include file */ diff --git a/testsuites/samples/loopback/.cvsignore b/testsuites/samples/loopback/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/samples/loopback/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/samples/loopback/Makefile.am b/testsuites/samples/loopback/Makefile.am deleted file mode 100644 index ef34244254..0000000000 --- a/testsuites/samples/loopback/Makefile.am +++ /dev/null @@ -1,41 +0,0 @@ -## -## $Id$ -## - - -SAMPLE = loopback -PGM = ${ARCH}/$(SAMPLE).exe - -MANAGERS = io event - -C_FILES = init.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -DOCTYPES = scn -DOCS = $(DOCTYPES:%=$(SAMPLE).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/sample.am - -# -# (OPTIONAL) Add local stuff here using += -# - - -if HAS_NETWORKING -all-local: ${ARCH} $(TMPINSTALL_FILES) - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) -endif - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/samples/loopback/README b/testsuites/samples/loopback/README deleted file mode 100644 index 8733bed358..0000000000 --- a/testsuites/samples/loopback/README +++ /dev/null @@ -1,65 +0,0 @@ -# -# $Id$ -# - -Simple test of kernel network code. -Requires no network hardware since only the loopback network address is used. - -Output should look like: -======================================================================== -"Network" initializing! -"Network" initialized! -Try running client with no server present. -Should fail with `connection refused'. -Connect to server. -Can't connect to server: Connection refused -Client closing connection. - -Start server. - -Try running client with server present. -Create socket. -Connect to server. -Bind socket. -Can't connect to server: Connection refused -Client closing connection. -Client task terminating. - -Try running two clients. -Connect to server. -Connect to server. -ACCEPTED:7F000001 -ACCEPTED:7F000001 -Write 22-byte message to server. -Write 22-byte message to server. -Read 43 from server: Server received 22 (Hi there, server (2).) -Read 43 from server: Server received 22 (Hi there, server (3).) -Client closing connection. -Client task terminating. -Worker task terminating. -Client closing connection. -Client task terminating. -Worker task terminating. - -Try running three clients. -Connect to server. -Connect to server. -Connect to server. -ACCEPTED:7F000001 -ACCEPTED:7F000001 -ACCEPTED:7F000001 -Write 22-byte message to server. -Write 22-byte message to server. -Write 22-byte message to server. -Read 43 from server: Server received 22 (Hi there, server (4).) -Read 43 from server: Server received 22 (Hi there, server (5).) -Read 43 from server: Server received 22 (Hi there, server (6).) -Client closing connection. -Client task terminating. -Worker task terminating. -Client closing connection. -Client task terminating. -Worker task terminating. -Client closing connection. -Client task terminating. -Worker task terminating. diff --git a/testsuites/samples/loopback/init.c b/testsuites/samples/loopback/init.c deleted file mode 100644 index b0aaf66597..0000000000 --- a/testsuites/samples/loopback/init.c +++ /dev/null @@ -1,267 +0,0 @@ -#include - -#define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_EXECUTIVE_RAM_SIZE (512*1024) -#define CONFIGURE_MAXIMUM_SEMAPHORES 20 -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 20 -#define CONFIGURE_MAXIMUM_TASKS 20 - -#define CONFIGURE_MICROSECONDS_PER_TICK 10000 -#define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS 50 -#define CONFIGURE_USE_IMFS_AS_BASE_FILESYSTEM - -#define CONFIGURE_INIT_TASK_STACK_SIZE (10*1024) -#define CONFIGURE_INIT_TASK_PRIORITY 50 -#define CONFIGURE_INIT_TASK_INITIAL_MODES (RTEMS_PREEMPT | \ - RTEMS_NO_TIMESLICE | \ - RTEMS_NO_ASR | \ - RTEMS_INTERRUPT_LEVEL(0)) - -#define CONFIGURE_INIT -rtems_task Init(rtems_task_argument argument); - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -/* - * Network configuration - */ -extern void rtems_bsdnet_loopattach(); -static struct rtems_bsdnet_ifconfig loopback_config = { - "lo0", /* name */ - (int (*)(struct rtems_bsdnet_ifconfig *, int))rtems_bsdnet_loopattach, /* attach function */ - NULL, /* link to next interface */ - "127.0.0.1", /* IP address */ - "255.0.0.0", /* IP net mask */ -}; - -struct rtems_bsdnet_config rtems_bsdnet_config = { - &loopback_config, /* Network interface */ - NULL, /* Use fixed network configuration */ - 0, /* Default network task priority */ - 0, /* Default mbuf capacity */ - 0, /* Default mbuf cluster capacity */ - "testSystem", /* Host name */ - "nowhere.com", /* Domain name */ - "127.0.0.1", /* Gateway */ - "127.0.0.1", /* Log host */ - {"127.0.0.1" }, /* Name server(s) */ - {"127.0.0.1" }, /* NTP server(s) */ -}; - -/* - * Thread-safe output routines - */ -static rtems_id printMutex; -static void printSafe(const char *fmt, ...) -{ - va_list args; - va_start(args, fmt); - rtems_semaphore_obtain(printMutex, RTEMS_WAIT, RTEMS_NO_TIMEOUT); - vprintf(fmt, args); - rtems_semaphore_release(printMutex); - va_end(args); -} -#define printf printSafe - -/* - * Spawn a task - */ -static void spawnTask(rtems_task_entry entryPoint, rtems_task_priority priority, rtems_task_argument arg) -{ - rtems_status_code sc; - rtems_id tid; - - sc = rtems_task_create(rtems_build_name('t','a','s','k'), - priority, - RTEMS_MINIMUM_STACK_SIZE+(8*1024), - RTEMS_PREEMPT|RTEMS_TIMESLICE|RTEMS_NO_ASR|RTEMS_INTERRUPT_LEVEL(0), - RTEMS_FLOATING_POINT|RTEMS_LOCAL, - &tid); - if (sc != RTEMS_SUCCESSFUL) - rtems_panic("Can't create task: %s", rtems_status_text(sc)); - sc = rtems_task_start(tid, entryPoint, arg); - if (sc != RTEMS_SUCCESSFUL) - rtems_panic("Can't start task: %s", rtems_status_text(sc)); -} - -/* - * Server subtask - */ -static rtems_task workerTask(rtems_task_argument arg) -{ - int s = arg; - char msg[80]; - char reply[100]; - int i; - - for (;;) { - if ((i = read(s, msg, sizeof msg)) < 0) { - printf("Server couldn't read message from client: %s\n", strerror(errno)); - break; - } - if (i == 0) - break; - rtems_task_wake_after(20); /* Simulate some processing delay */ - i = sprintf(reply, "Server received %d (%s)", i, msg); - if ((i = write(s, reply, i+1)) < 0) { - printf("Server couldn't write message to client: %s\n", strerror(errno)); - break; - } - } - if (close(s) < 0) - printf("Can't close worker task socket: %s\n", strerror(errno)); - printf("Worker task terminating.\n"); - rtems_task_delete(RTEMS_SELF); -} - -/* - * Server Task - */ -static rtems_task serverTask(rtems_task_argument arg) -{ - int s, s1; - int addrlen; - struct sockaddr_in myAddr, farAddr; - rtems_task_priority myPriority; - - printf("Create socket.\n"); - s = socket(AF_INET, SOCK_STREAM, 0); - if (s < 0) - rtems_panic("Can't create socket: %s\n", strerror(errno)); - memset(&myAddr, 0, sizeof myAddr); - myAddr.sin_family = AF_INET; - myAddr.sin_port = htons(1234); - myAddr.sin_addr.s_addr = htonl(INADDR_ANY); - printf("Bind socket.\n"); - if (bind(s, (struct sockaddr *)&myAddr, sizeof myAddr) < 0) - rtems_panic("Can't bind socket: %s\n", strerror(errno)); - if (listen(s, 5) < 0) - printf("Can't listen on socket: %s\n", strerror(errno)); - rtems_task_set_priority(RTEMS_SELF, RTEMS_CURRENT_PRIORITY, &myPriority); - for(;;) { - addrlen = sizeof farAddr; - s1 = accept(s, (struct sockaddr *)&farAddr, &addrlen); - if (s1 < 0) - rtems_panic("Can't accept connection: %s", strerror(errno)); - else - printf("ACCEPTED:%lX\n", ntohl(farAddr.sin_addr.s_addr)); - spawnTask(workerTask, myPriority, s1); - } -} - -/* - * The real part of the client - */ -static rtems_task clientWorker(int arg) -{ - int s; - struct sockaddr_in myAddr, farAddr; - char cbuf[50]; - int i; - - s = socket(AF_INET, SOCK_STREAM, 0); - if (s < 0) { - printf("Can't create client socket: %s\n", strerror(errno)); - return; - } - memset(&myAddr, 0, sizeof myAddr); - myAddr.sin_family = AF_INET; - myAddr.sin_port = htons(0); - myAddr.sin_addr.s_addr = htonl(INADDR_ANY); - if (bind(s, (struct sockaddr *)&myAddr, sizeof myAddr) < 0) { - printf("Can't bind socket: %s\n", strerror(errno)); - goto close; - } - memset(&farAddr, 0, sizeof farAddr); - farAddr.sin_family = AF_INET; - farAddr.sin_port = htons(1234); - farAddr.sin_addr.s_addr = htonl(INADDR_ANY); - printf("Connect to server.\n"); - if (connect(s, (struct sockaddr *)&farAddr, sizeof farAddr) < 0) { - printf("Can't connect to server: %s\n", strerror(errno)); - goto close; - } - rtems_task_wake_after(20); /* Simulate client delay */ - i = sprintf(cbuf, "Hi there, server (%d).", arg); - i++; /* Send the '\0', too */ - printf("Write %d-byte message to server.\n", i); - if (write(s, cbuf, i) < 0) { - printf("Can't write to server: %s\n", strerror(errno)); - goto close; - } - if ((i = read(s, cbuf, sizeof cbuf)) < 0) { - printf("Can't read from server: %s\n", strerror(errno)); - goto close; - } - printf("Read %d from server: %.*s\n", i, i, cbuf); - rtems_task_wake_after(20); /* Simulate client delay */ - close: - printf("Client closing connection.\n"); - if (close(s) < 0) - printf("Can't close client task socket: %s\n", strerror(errno)); -} - -/* - * Client Task - */ -static rtems_task clientTask(rtems_task_argument arg) -{ - clientWorker(arg); - printf("Client task terminating.\n"); -} - -/* - * RTEMS Startup Task - */ -rtems_task -Init (rtems_task_argument ignored) -{ - rtems_status_code sc; - - sc = rtems_semaphore_create(rtems_build_name('P','m','t','x'), - 1, - RTEMS_PRIORITY|RTEMS_BINARY_SEMAPHORE|RTEMS_INHERIT_PRIORITY| - RTEMS_NO_PRIORITY_CEILING|RTEMS_LOCAL, - 0, - &printMutex); - if (sc != RTEMS_SUCCESSFUL) - rtems_panic("Can't create printf mutex:", rtems_status_text(sc)); - printf("\"Network\" initializing!\n"); - rtems_bsdnet_initialize_network(); - printf("\"Network\" initialized!\n"); - - printf("Try running client with no server present.\n"); - printf("Should fail with `connection refused'.\n"); - clientWorker(0); - - printf("\nStart server.\n"); - spawnTask(serverTask, 150, 0); - - printf("\nTry running client with server present.\n"); - spawnTask(clientTask, 120, 1); - rtems_task_wake_after(500); - - printf("\nTry running two clients.\n"); - spawnTask(clientTask, 120, 2); - spawnTask(clientTask, 120, 3); - rtems_task_wake_after(500); - - printf("\nTry running three clients.\n"); - spawnTask(clientTask, 120, 4); - spawnTask(clientTask, 120, 5); - spawnTask(clientTask, 120, 6); - - rtems_task_suspend(RTEMS_SELF); -} diff --git a/testsuites/samples/loopback/loopback.scn b/testsuites/samples/loopback/loopback.scn deleted file mode 100644 index ec6207f315..0000000000 --- a/testsuites/samples/loopback/loopback.scn +++ /dev/null @@ -1,56 +0,0 @@ -"Network" initializing! -"Network" initialized! -Try running client with no server present. -Should fail with `connection refused'. -Connect to server. -Can't connect to server: Connection refused -Client closing connection. - -Start server. - -Try running client with server present. -Create socket. -Connect to server. -Bind socket. -Can't connect to server: Connection refused -Client closing connection. -Client task terminating. - -Try running two clients. -Connect to server. -Connect to server. -ACCEPTED:7F000001 -ACCEPTED:7F000001 -Write 22-byte message to server. -Write 22-byte message to server. -Read 43 from server: Server received 22 (Hi there, server (2).) -Read 43 from server: Server received 22 (Hi there, server (3).) -Client closing connection. -Client task terminating. -Worker task terminating. -Client closing connection. -Client task terminating. -Worker task terminating. - -Try running three clients. -Connect to server. -Connect to server. -Connect to server. -ACCEPTED:7F000001 -ACCEPTED:7F000001 -ACCEPTED:7F000001 -Write 22-byte message to server. -Write 22-byte message to server. -Write 22-byte message to server. -Read 43 from server: Server received 22 (Hi there, server (4).) -Read 43 from server: Server received 22 (Hi there, server (5).) -Read 43 from server: Server received 22 (Hi there, server (6).) -Client closing connection. -Client task terminating. -Worker task terminating. -Client closing connection. -Client task terminating. -Worker task terminating. -Client closing connection. -Client task terminating. -Worker task terminating. diff --git a/testsuites/samples/minimum/.cvsignore b/testsuites/samples/minimum/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/samples/minimum/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/samples/minimum/Makefile.am b/testsuites/samples/minimum/Makefile.am deleted file mode 100644 index 7fe380dc9e..0000000000 --- a/testsuites/samples/minimum/Makefile.am +++ /dev/null @@ -1,39 +0,0 @@ -## -## $Id$ -## - - -SAMPLE = minimum -PGM = ${ARCH}/$(SAMPLE).exe - -MANAGERS = all - -C_FILES = init.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=$(SAMPLE).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/sample.am - -# -# (OPTIONAL) Add local stuff here using += -# - -all-local: ${ARCH} $(TMPINSTALL_FILES) -# This test should not be executed - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/samples/minimum/init.c b/testsuites/samples/minimum/init.c deleted file mode 100644 index 980393f0b2..0000000000 --- a/testsuites/samples/minimum/init.c +++ /dev/null @@ -1,41 +0,0 @@ -/* Init - * - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -rtems_task Init( - rtems_task_argument ignored -) -{ -} - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_USE_MINIIMFS_AS_BASE_FILESYSTEM - -#define CONFIGURE_MAXIMUM_TASKS 1 - -#define CONFIGURE_INIT - -#include - -/* global variables */ - diff --git a/testsuites/samples/minimum/minimum.doc b/testsuites/samples/minimum/minimum.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/samples/minimum/minimum.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/samples/minimum/minimum.scn b/testsuites/samples/minimum/minimum.scn deleted file mode 100644 index 610f3d4ddd..0000000000 --- a/testsuites/samples/minimum/minimum.scn +++ /dev/null @@ -1 +0,0 @@ -*** TEST SHOULD NOT BE RUN *** diff --git a/testsuites/samples/paranoia/.cvsignore b/testsuites/samples/paranoia/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/samples/paranoia/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/samples/paranoia/Makefile.am b/testsuites/samples/paranoia/Makefile.am deleted file mode 100644 index b3036938c0..0000000000 --- a/testsuites/samples/paranoia/Makefile.am +++ /dev/null @@ -1,47 +0,0 @@ -## -## $Id$ -## - - -SAMPLE = paranoia -PGM = ${ARCH}/$(SAMPLE).exe - -MANAGERS = all - -C_FILES = init.c paranoia.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc -DOCS = $(DOCTYPES:%=$(SAMPLE).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/sample.am - -# -# (OPTIONAL) Add local stuff here using += -# -# -DCYGNUS turns on more verbose msgs -# - -AM_CPPFLAGS += -DNOSIGNAL -DCYGNUS -DNOMAIN - -LD_LIBS = -lm - -all-local: ${ARCH} $(TMPINSTALL_FILES) - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/samples/paranoia/init.c b/testsuites/samples/paranoia/init.c deleted file mode 100644 index e0260bf0a0..0000000000 --- a/testsuites/samples/paranoia/init.c +++ /dev/null @@ -1,49 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define CONFIGURE_INIT -#include "system.h" -#include -#include /* exit */ - -extern int paranoia(int, char **); - -char *args[2] = { "paranoia", 0 }; - -rtems_task Init( - rtems_task_argument ignored -) -{ - /* - * Install whatever optional floating point assistance package - * is required by this CPU. - */ - -#if (defined (m68040)) - M68KFPSPInstallExceptionHandlers (); -#endif - - 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 deleted file mode 100644 index da03db6606..0000000000 --- a/testsuites/samples/paranoia/paranoia.c +++ /dev/null @@ -1,2304 +0,0 @@ -/* - * $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 -#include - -#if defined(solaris2) -#include -#endif - -/* - * 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 -struct _reent libm_reent = _REENT_INIT(libm_reent); -struct _reent *_impure_ptr = &libm_reent; -#endif - -#ifndef NOSIGNAL -#include -#include -#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 HVar, 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 WVar; -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"); - WVar = One; - do { - WVar = WVar + WVar; - Y = WVar + One; - Z = Y - WVar; - Y = Z - One; - } - while (MinusOne + FABS (Y) < Zero); - /*.. now WVar is just big enough that |((WVar+1)-WVar)-1| >= 1 ...*/ - Precision = Zero; - Y = One; - do { - Radix = WVar + Y; - Y = Y + Y; - Radix = Radix - WVar; - } - while (Radix == Zero); - if (Radix < Two) - Radix = One; - printf ("Radix = %f .\n", Radix); - if (Radix != 1) { - WVar = One; - do { - Precision = Precision + One; - WVar = WVar * Radix; - Y = WVar + One; - } - while ((Y - WVar) == One); - } - /*... now WVar == Radix^Precision is barely too big to satisfy (WVar+1)-WVar == 1 - ...*/ - U1 = One / WVar; - 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); - WVar = 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 = WVar / (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 != WVar - 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 != WVar - 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", WVar); - 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 (WVar) / 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; - HVar = One / HInvrse; - /* ... 1/HInvrse == HVar == Min(1/Radix, 1/2) */ - CInvrse = One / C; - E0 = C; - Z = E0 * HVar; - /* ...1/Radix^(BIG Integer) << 1 << CInvrse == 1/C */ - do { - Y = E0; - E0 = Z; - Z = E0 * HVar; - } - 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 * HVar; - 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 * HVar; - } - 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 = HVar * 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 = HVar + HVar; - } else - R = SQRT (Underflow / UfThold); - sigsave = 0; - if (R <= HVar) { - Z = R * UfThold; - X = Z * (One + R * HVar * (One + HVar)); - } else { - Z = UfThold; - X = Z * (One + HVar * HVar * (One + HVar)); - } - 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 < WVar) - 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 > WVar - 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 < WVar); -} - -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 deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/samples/paranoia/paranoia.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/samples/paranoia/system.h b/testsuites/samples/paranoia/system.h deleted file mode 100644 index 359e255882..0000000000 --- a/testsuites/samples/paranoia/system.h +++ /dev/null @@ -1,41 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -/* configuration information */ - -#include /* for device driver prototypes */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 1 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE -#define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_FLOATING_POINT -#define CONFIGURE_INIT_TASK_STACK_SIZE (RTEMS_MINIMUM_STACK_SIZE * 2) - -#define CONFIGURE_EXTRA_TASK_STACKS (1 * RTEMS_MINIMUM_STACK_SIZE) - -#include - -/* end of include file */ diff --git a/testsuites/samples/sample.am b/testsuites/samples/sample.am deleted file mode 100644 index 8ea5642da1..0000000000 --- a/testsuites/samples/sample.am +++ /dev/null @@ -1,20 +0,0 @@ -## $Id$ - -project_bspdir=$(PROJECT_ROOT)/@RTEMS_BSP@ - -$(project_bspdir)/samples: - @$(mkinstalldirs) $@ -$(project_bspdir)/tests: - @$(mkinstalldirs) $@ - -$(project_bspdir)/samples/$(SAMPLE)$(LIB_VARIANT).exe: $(PGM) - $(INSTALL_PROGRAM) $< $@ - -$(project_bspdir)/tests/$(SAMPLE)$(LIB_VARIANT).exe: $(PGM) - $(INSTALL_PROGRAM) $< $@ - -TMPINSTALL_FILES = \ -$(project_bspdir)/tests \ -$(project_bspdir)/tests/$(SAMPLE)$(LIB_VARIANT).exe \ -$(project_bspdir)/samples \ -$(project_bspdir)/samples/$(SAMPLE)$(LIB_VARIANT).exe diff --git a/testsuites/samples/ticker/.cvsignore b/testsuites/samples/ticker/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/samples/ticker/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/samples/ticker/Makefile.am b/testsuites/samples/ticker/Makefile.am deleted file mode 100644 index 27e04b6e1b..0000000000 --- a/testsuites/samples/ticker/Makefile.am +++ /dev/null @@ -1,41 +0,0 @@ -## -## $Id$ -## - - -SAMPLE = ticker -PGM = ${ARCH}/$(SAMPLE).exe - -MANAGERS = io - -C_FILES = init.c tasks.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=$(SAMPLE).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/sample.am - -# -# (OPTIONAL) Add local stuff here using += -# - -all-local: ${ARCH} $(TMPINSTALL_FILES) - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/samples/ticker/init.c b/testsuites/samples/ticker/init.c deleted file mode 100644 index 36f3fd58f6..0000000000 --- a/testsuites/samples/ticker/init.c +++ /dev/null @@ -1,75 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define CONFIGURE_INIT -#include "system.h" -#include - -/* - * Keep the names and IDs in global variables so another task can use them. - */ - -rtems_id Task_id[ 4 ]; /* array of task ids */ -rtems_name Task_name[ 4 ]; /* array of task names */ - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - rtems_time_of_day time; - - puts( "\n\n*** CLOCK TICK TEST ***" ); - - time.year = 1988; - time.month = 12; - time.day = 31; - time.hour = 9; - time.minute = 0; - time.second = 0; - time.ticks = 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, RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ 1 ] - ); - status = rtems_task_create( - Task_name[ 2 ], 1, RTEMS_MINIMUM_STACK_SIZE * 2, RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, &Task_id[ 2 ] - ); - status = rtems_task_create( - Task_name[ 3 ], 1, RTEMS_MINIMUM_STACK_SIZE * 2, 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 deleted file mode 100644 index 7a0caa93ba..0000000000 --- a/testsuites/samples/ticker/system.h +++ /dev/null @@ -1,115 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_task Test_task( - rtems_task_argument argument -); - -/* global variables */ - -/* - * Keep the names and IDs in global variables so another task can use them. - */ - -extern rtems_id Task_id[ 4 ]; /* array of task ids */ -extern rtems_name Task_name[ 4 ]; /* array of task names */ - - -/* configuration information */ - -#include /* for device driver prototypes */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 4 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_EXTRA_TASK_STACKS (3 * RTEMS_MINIMUM_STACK_SIZE) - -#include - -/* - * Handy macros and static inline functions - */ - -/* - * Macro to hide the ugliness of printing the time. - */ - -#define print_time(_s1, _tb, _s2) \ - do { \ - printf( "%s%02d:%02d:%02d %02d/%02d/%04d%s", \ - _s1, (_tb)->hour, (_tb)->minute, (_tb)->second, \ - (_tb)->month, (_tb)->day, (_tb)->year, _s2 ); \ - fflush(stdout); \ - } while ( 0 ) - -/* - * Macro to print an task name that is composed of ASCII characters. - * - */ - -#define put_name( _name, _crlf ) \ - do { \ - rtems_unsigned32 c0, c1, c2, c3; \ - \ - c0 = ((_name) >> 24) & 0xff; \ - c1 = ((_name) >> 16) & 0xff; \ - c2 = ((_name) >> 8) & 0xff; \ - c3 = (_name) & 0xff; \ - putchar( (char)c0 ); \ - if ( c1 ) putchar( (char)c1 ); \ - if ( c2 ) putchar( (char)c2 ); \ - if ( c3 ) putchar( (char)c3 ); \ - if ( (_crlf) ) \ - putchar( '\n' ); \ - } while (0) - -/* - * static inline routine to make obtaining ticks per second easier. - */ - -static inline rtems_unsigned32 get_ticks_per_second( void ) -{ - rtems_interval ticks_per_second; - (void) rtems_clock_get( RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticks_per_second ); return ticks_per_second; -} - - -/* - * This allows us to view the "Test_task" instantiations as a set - * of numbered tasks by eliminating the number of application - * tasks created. - * - * In reality, this is too complex for the purposes of this - * example. It would have been easier to pass a task argument. :) - * But it shows how rtems_id's can sometimes be used. - */ - -#define task_number( tid ) \ - ( rtems_get_index( tid ) - \ - rtems_configuration_get_rtems_api_configuration()->number_of_initialization_tasks ) - -/* end of include file */ diff --git a/testsuites/samples/ticker/tasks.c b/testsuites/samples/ticker/tasks.c deleted file mode 100644 index b9b5ebe0e5..0000000000 --- a/testsuites/samples/ticker/tasks.c +++ /dev/null @@ -1,45 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" -#include -#include - -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 ); - for ( ; ; ) { - 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 * get_ticks_per_second() ); - } -} diff --git a/testsuites/samples/ticker/ticker.doc b/testsuites/samples/ticker/ticker.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/samples/ticker/ticker.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/samples/ticker/ticker.scn b/testsuites/samples/ticker/ticker.scn deleted file mode 100644 index 35952e6170..0000000000 --- a/testsuites/samples/ticker/ticker.scn +++ /dev/null @@ -1,16 +0,0 @@ -*** 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/samples/unlimited/.cvsignore b/testsuites/samples/unlimited/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/samples/unlimited/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/samples/unlimited/Makefile.am b/testsuites/samples/unlimited/Makefile.am deleted file mode 100644 index f0bfb27f7d..0000000000 --- a/testsuites/samples/unlimited/Makefile.am +++ /dev/null @@ -1,41 +0,0 @@ -## -## $Id$ -## - - -SAMPLE = unlimited -PGM = ${ARCH}/$(SAMPLE).exe - -MANAGERS = io event - -C_FILES = init.c test1.c test2.c test3.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc scn -DOCS = $(DOCTYPES:%=$(SAMPLE).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/sample.am - -# -# (OPTIONAL) Add local stuff here using += -# - -all-local: ${ARCH} $(TMPINSTALL_FILES) - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/samples/unlimited/init.c b/testsuites/samples/unlimited/init.c deleted file mode 100644 index c0d568ea74..0000000000 --- a/testsuites/samples/unlimited/init.c +++ /dev/null @@ -1,127 +0,0 @@ -/* 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-1997. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may in - * the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define CONFIGURE_INIT - -#include "system.h" -#include -#include - -rtems_id task_id[MAX_TASKS]; - -void test1(); -void test2(); - -rtems_task Init( - rtems_task_argument ignored -) -{ - rtems_task_priority old_priority; - rtems_mode old_mode; - rtems_unsigned32 task; - - /* lower the task priority to allow created tasks to execute */ - - rtems_task_set_priority(RTEMS_SELF, 20, &old_priority); - rtems_task_mode(RTEMS_PREEMPT, RTEMS_PREEMPT_MASK, &old_mode); - - printf( "\n*** UNLIMITED TASK TEST ***\n" ); - - /* - * Invalid state if the task id is 0 - */ - - for (task = 0; task < MAX_TASKS; task++) - task_id[task] = 0; - - test1(); - test2(); - test3(); - - printf( "\n*** END OF UNLIMITED TASK TEST ***\n" ); - exit( 0 ); -} - -rtems_task test_task( - rtems_task_argument my_number - ) -{ - rtems_event_set out; - - printf( "task %i has started.\n", my_number); - - rtems_event_receive(1, RTEMS_WAIT | RTEMS_EVENT_ANY, 0, &out); - - printf( "task %i ending.\n", my_number); - - rtems_task_delete(RTEMS_SELF); -} - -void destory_all_tasks( - const char *who -) -{ - rtems_unsigned32 task; - - /* - * If the id is not zero, signal the task to delete. - */ - - for (task = 0; task < MAX_TASKS; task++) - if (task_id[task]) - { - printf(" %s : signal task %08x to delete, ", who, task_id[task]); - fflush(stdout); - rtems_event_send(task_id[task], 1); - task_id[task] = 0; - } -} - -boolean status_code_bad( - rtems_status_code status_code - ) -{ - if (status_code != RTEMS_SUCCESSFUL) - { - printf("failure, "); - - if (status_code == RTEMS_TOO_MANY) - { - printf("too many.\n"); - return TRUE; - } - if (status_code == RTEMS_UNSATISFIED) - { - printf("unsatisfied.\n"); - return TRUE; - } - - printf("error code = %i\n", status_code); - exit( 1 ); - } - return FALSE; -} - - - - - diff --git a/testsuites/samples/unlimited/system.h b/testsuites/samples/unlimited/system.h deleted file mode 100644 index 46e3991a65..0000000000 --- a/testsuites/samples/unlimited/system.h +++ /dev/null @@ -1,90 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1997. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may in - * the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_task test_task( - rtems_task_argument my_number -); - -void -destory_all_tasks( - const char *who -); - -boolean status_code_bad( - rtems_status_code status_code -); - -void test1(); -void test2(); -void test3(); - -/* configuration information */ - -#include /* for device driver prototypes */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define TASK_ALLOCATION_SIZE (5) -#define CONFIGURE_MAXIMUM_TASKS rtems_resource_unlimited(TASK_ALLOCATION_SIZE) -#define CONFIGURE_EXTRA_TASK_STACKS (62 * RTEMS_MINIMUM_STACK_SIZE) - - -#include - -/* - * Keep track of the task id's created, use a large array. - */ - -#define MAX_TASKS (1000) -#define TASK_INDEX_OFFSET (1) - -extern rtems_id task_id[MAX_TASKS]; - -/* - * Increment the task name. - */ - -#define NEXT_TASK_NAME(c1, c2, c3, c4) \ - if (c4 == '9') { \ - if (c3 == '9') { \ - if (c2 == 'z') { \ - if (c1 == 'z') { \ - printf("not enough task letters for names !!!\n"); \ - exit( 1 ); \ - } else \ - c1++; \ - c2 = 'a'; \ - } else \ - c2++; \ - c3 = '0'; \ - } else \ - c3++; \ - c4 = '0'; \ - } \ - else \ - c4++ \ - - -/* end of include file */ diff --git a/testsuites/samples/unlimited/test1.c b/testsuites/samples/unlimited/test1.c deleted file mode 100644 index 5b13c301de..0000000000 --- a/testsuites/samples/unlimited/test1.c +++ /dev/null @@ -1,106 +0,0 @@ -/* Test1 - * - * This test uses a hack to disable suto-extend then checks to see only the - * requested number of objects are allocated. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1997. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may in - * the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" -#include -#include -#include - -void test1() -{ - boolean auto_extend; - rtems_status_code result; - rtems_unsigned32 task_count = 0; - Objects_Information *the_information; - - char c1 = 'a'; - char c2 = 'a'; - char c3 = '0'; - char c4 = '0'; - - printf( "\n TEST1 : auto-extend disabled.\n" ); - - /* - * This is a major hack and only recommended for a test. Doing this - * saves having another test. - */ - - the_information = - _Objects_Information_table[OBJECTS_CLASSIC_API][OBJECTS_RTEMS_TASKS]; - auto_extend = the_information->auto_extend; - the_information->auto_extend = FALSE; - - while (task_count < MAX_TASKS) - { - rtems_name name; - - printf(" TEST1 : creating task '%c%c%c%c', ", c1, c2, c3, c4); - - name = rtems_build_name(c1, c2, c3, c4); - - result = rtems_task_create(name, - 10, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_ATTRIBUTES, - RTEMS_LOCAL, - &task_id[task_count]); - - if (status_code_bad(result)) - break; - - printf("number = %3i, id = %08x, starting, ", task_count, task_id[task_count]); - - fflush(stdout); - result = rtems_task_start(task_id[task_count], - test_task, - (rtems_task_argument) task_count); - - if (status_code_bad(result)) - break; - - /* - * Update the name. - */ - - NEXT_TASK_NAME(c1, c2, c3, c4); - - task_count++; - } - - if (task_count >= MAX_TASKS) - printf( "\nMAX_TASKS too small for work-space size, please make larger !!\n\n" ); - - if (task_count != (TASK_ALLOCATION_SIZE - 1)) { - printf( " FAIL1 : the number of tasks does not equal the expected size -\n" - " task created = %i, required number = %i\n", - task_count, TASK_ALLOCATION_SIZE); - exit( 1 ); - } - - destory_all_tasks("TEST1"); - - the_information->auto_extend = auto_extend; - - printf( " TEST1 : completed\n" ); -} - - - - - diff --git a/testsuites/samples/unlimited/test2.c b/testsuites/samples/unlimited/test2.c deleted file mode 100644 index dc95bd1bb1..0000000000 --- a/testsuites/samples/unlimited/test2.c +++ /dev/null @@ -1,229 +0,0 @@ -/* 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-1997. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may in - * the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" -#include -#include - -void test2() -{ - rtems_status_code result; - rtems_unsigned32 remove_task; - rtems_unsigned32 task; - rtems_unsigned32 block; - rtems_unsigned32 task_count = 0; - rtems_id removed_ids[TASK_ALLOCATION_SIZE * 2]; - - char c1 = 'a'; - char c2 = 'a'; - char c3 = '0'; - char c4 = '0'; - - printf( "\n TEST2 : re-allocate of index numbers, and a block free'ed and one inactive\n" ); - - /* - * Allocate enought tasks so the Inactive list is empty. Remember - * to count the Init task, ie ... - 1. - */ - - while (task_count < ((TASK_ALLOCATION_SIZE * 5) - TASK_INDEX_OFFSET)) - { - rtems_name name; - - printf(" TEST2 : creating task '%c%c%c%c', ", c1, c2, c3, c4); - - name = rtems_build_name(c1, c2, c3, c4); - - result = rtems_task_create(name, - 10, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_ATTRIBUTES, - RTEMS_LOCAL, - &task_id[task_count]); - - if (status_code_bad(result)) - break; - - printf("number = %3i, id = %08x, starting, ", task_count, task_id[task_count]); - fflush(stdout); - - result = rtems_task_start(task_id[task_count], - test_task, - (rtems_task_argument) task_count); - - if (status_code_bad(result)) - break; - - /* - * Update the name. - */ - - NEXT_TASK_NAME(c1, c2, c3, c4); - - task_count++; - } - - /* - * Take out the second and fourth allocation size block of tasks - */ - - if (task_count != ((TASK_ALLOCATION_SIZE * 5) - TASK_INDEX_OFFSET)) { - printf( " FAIL2 : not enough tasks created -\n" - " task created = %i, required number = %i\n", - task_count, (TASK_ALLOCATION_SIZE * 5) - TASK_INDEX_OFFSET); - destory_all_tasks("TEST2"); - exit( 1 ); - } - - task = 0; - - for (block = 1; block < 4; block += 2) - { - for (remove_task = (block * TASK_ALLOCATION_SIZE) - TASK_INDEX_OFFSET; - remove_task < (((block + 1) * TASK_ALLOCATION_SIZE) - TASK_INDEX_OFFSET); - remove_task++) - { - if (!task_id[remove_task]) - { - printf( " FAIL2 : remove task has a 0 id -\n" - " task number = %i\n", - remove_task); - destory_all_tasks("TEST2"); - exit( 1 ); - } - - /* - * Save the id's to match them against the reallocated ids - */ - - removed_ids[task++] = task_id[remove_task]; - - printf(" TEST2 : block %i remove, signal task %08x, ", block, task_id[remove_task]); - rtems_event_send(task_id[remove_task], 1); - task_id[remove_task] = 0; - } - } - - for (task = 0; task < (TASK_ALLOCATION_SIZE * 2); task++) - { - rtems_name name; - rtems_unsigned32 id_slot; - - /* - * Find a free slot in the task id table. - */ - - for (id_slot = 0; id_slot < MAX_TASKS; id_slot++) - if (!task_id[id_slot]) - break; - - if (id_slot == MAX_TASKS) - { - printf( " FAIL2 : no free task id slot.\n"); - destory_all_tasks("TEST2"); - exit( 1 ); - } - - printf(" TEST2 : creating task '%c%c%c%c', ", c1, c2, c3, c4); - - name = rtems_build_name(c1, c2, c3, c4); - - result = rtems_task_create(name, - 10, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_ATTRIBUTES, - RTEMS_LOCAL, - &task_id[id_slot]); - - if (status_code_bad(result)) - { - printf( " FAIL2 : re-creating a task -\n" - " task number = %i\n", - id_slot); - destory_all_tasks("TEST2"); - exit( 1 ); - } - - printf("number = %3i, id = %08x, starting, ", task_count, task_id[id_slot]); - - result = rtems_task_start(task_id[id_slot], - test_task, - (rtems_task_argument) task_count); - - if (status_code_bad(result)) - { - printf( " FAIL : re-starting a task -\n" - " task number = %i\n", - id_slot); - destory_all_tasks("TEST2"); - exit( 1 ); - } - - /* - * Update the name. - */ - - NEXT_TASK_NAME(c1, c2, c3, c4); - - /* - * Search the removed ids to see if it existed, clear the removed id when found - */ - - for (remove_task = 0; remove_task < (TASK_ALLOCATION_SIZE * 2); remove_task++) - if (removed_ids[remove_task] == task_id[id_slot]) - { - removed_ids[remove_task] = 0; - break; - } - - /* - * If not located in the removed id table, check and make sure it is not - * already allocated - */ - - if (remove_task == (TASK_ALLOCATION_SIZE * 2)) - { - rtems_unsigned32 allocated_id; - - for (allocated_id = 0; allocated_id < MAX_TASKS; allocated_id++) - if ((task_id[id_slot] == task_id[allocated_id]) && (id_slot != allocated_id)) - { - printf( " FAIL2 : the new id is the same as an id already allocated -\n" - " task id = %08x\n", - task_id[id_slot]); - exit( 1 ); - } - - printf( " FAIL2 : could not find the task id in the removed table -\n" - " task id = %08x\n", - task_id[id_slot]); - exit( 1 ); - } - - task_count++; - } - - destory_all_tasks("TEST2"); - - printf( " TEST2 : completed\n" ); -} - diff --git a/testsuites/samples/unlimited/test3.c b/testsuites/samples/unlimited/test3.c deleted file mode 100644 index 28f160c85e..0000000000 --- a/testsuites/samples/unlimited/test3.c +++ /dev/null @@ -1,146 +0,0 @@ -/* 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-1997. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may in - * the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" -#include -#include - -void test3() -{ - rtems_status_code result; - rtems_unsigned32 remove_task; - rtems_unsigned32 block; - rtems_unsigned32 task_count = 0; - - char c1 = 'a'; - char c2 = 'a'; - char c3 = '0'; - char c4 = '0'; - - printf( "\n TEST3 : free more than 3 x allocation size, but not the same block,\n" - " then free a block\n"); - - /* - * Check the value of the allocation unit - */ - - if (TASK_ALLOCATION_SIZE < 4) - { - printf( " FAIL3 : task allocation size must be greater than 4.\n"); - exit( 1 ); - } - - /* - * Allocate as many tasks as possible. - */ - - while (task_count < MAX_TASKS) - { - rtems_name name; - - printf(" TEST3 : creating task '%c%c%c%c', ", c1, c2, c3, c4); - - name = rtems_build_name(c1, c2, c3, c4); - - result = rtems_task_create(name, - 10, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_ATTRIBUTES, - RTEMS_LOCAL, - &task_id[task_count]); - - if (status_code_bad(result)) - break; - - printf("number = %3i, id = %08x, starting, ", task_count, task_id[task_count]); - fflush(stdout); - - result = rtems_task_start(task_id[task_count], - test_task, - (rtems_task_argument) task_count); - - if (status_code_bad(result)) - break; - - /* - * Update the name. - */ - - NEXT_TASK_NAME(c1, c2, c3, c4); - - task_count++; - } - - /* - * Take out 3 tasks from each block of allocated tasks. Do this for - * allocation size number of blocks. - */ - - if (task_count < (TASK_ALLOCATION_SIZE * 11)) - { - printf( " FAIL3 : not enough tasks created -\n" - " task created = %i, required number = %i\n", - task_count, (TASK_ALLOCATION_SIZE * 11)); - exit( 1 ); - } - - for (block = 0; block < TASK_ALLOCATION_SIZE; block++) - { - for (remove_task = ((block * TASK_ALLOCATION_SIZE) - TASK_INDEX_OFFSET); - remove_task < (((block * TASK_ALLOCATION_SIZE) + 3) - TASK_INDEX_OFFSET); - remove_task++) - { - if (!task_id[remove_task]) - { - printf( " FAIL3 : remove task has a 0 id -\n" - " task number = %i\n", - remove_task); - exit( 1 ); - } - - printf(" TEST3 : remove, signal task %08x, ", task_id[remove_task]); - rtems_event_send(task_id[remove_task], 1); - task_id[remove_task] = 0; - } - } - - /* - * Remove a complete block, not the first, forces a scan of the blocks in the - * allocator's free routine - */ - - for (remove_task = (TASK_ALLOCATION_SIZE - TASK_INDEX_OFFSET); - remove_task < ((TASK_ALLOCATION_SIZE * 2) - - TASK_INDEX_OFFSET); - remove_task++) - { - if (task_id[remove_task]) - { - printf(" TEST3 : remove, signal task %08x, ", task_id[remove_task]); - rtems_event_send(task_id[remove_task], 1); - task_id[remove_task] = 0; - } - } - - destory_all_tasks("TEST3"); - - printf( " TEST3 : completed\n" ); -} diff --git a/testsuites/samples/unlimited/unlimited.doc b/testsuites/samples/unlimited/unlimited.doc deleted file mode 100644 index 9214c9e222..0000000000 --- a/testsuites/samples/unlimited/unlimited.doc +++ /dev/null @@ -1,36 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1997. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may in -# the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - -This file describes the directives and concepts tested by this test set. - -test set name: test1 - -directives: - _Object_Allocate, _Object_Free, _Object_Extend_information, - _Object_Shrink_information - -concepts: - - a. Verifies when the auto-extend is false the number of objects does - not grow, and the number of objects is the maximum number specified - in the Configuration table. - - b. Verify the re-allocation of index numbers, and a block of objects is - freed while another remains yet all it objects are not in - use. Four blocks of the allocation size of objects are created, - then the first and third blocks are freed. Only the first - block's memory will be released, while the second remains. This - is due the allocation hystersis. - - c. Allocate as many objects are the work-space can hold. Free objects - from a number of blocks with-out freeing the blocks. Free the remaining - blocks. - diff --git a/testsuites/samples/unlimited/unlimited.scn b/testsuites/samples/unlimited/unlimited.scn deleted file mode 100644 index f1c026fe4b..0000000000 --- a/testsuites/samples/unlimited/unlimited.scn +++ /dev/null @@ -1,337 +0,0 @@ - -*** UNLIMITED TASK TEST *** - - TEST1 : auto-extend disabled. - TEST1 : creating task 'aa00', number = 0, id = 08010002, starting, task 0 has started. - TEST1 : creating task 'aa01', number = 1, id = 08010003, starting, task 1 has started. - TEST1 : creating task 'aa02', number = 2, id = 08010004, starting, task 2 has started. - TEST1 : creating task 'aa03', number = 3, id = 08010005, starting, task 3 has started. - TEST1 : creating task 'aa04', failure, too many. - TEST1 : signal task 08010002 to delete, task 0 ending. - TEST1 : signal task 08010003 to delete, task 1 ending. - TEST1 : signal task 08010004 to delete, task 2 ending. - TEST1 : signal task 08010005 to delete, task 3 ending. - TEST1 : completed - - TEST2 : re-allocate of index numbers, and a block free'ed and one inactive - TEST2 : creating task 'aa00', number = 0, id = 08010002, starting, task 0 has started. - TEST2 : creating task 'aa01', number = 1, id = 08010003, starting, task 1 has started. - TEST2 : creating task 'aa02', number = 2, id = 08010004, starting, task 2 has started. - TEST2 : creating task 'aa03', number = 3, id = 08010005, starting, task 3 has started. - TEST2 : creating task 'aa04', number = 4, id = 08010006, starting, task 4 has started. - TEST2 : creating task 'aa05', number = 5, id = 08010007, starting, task 5 has started. - TEST2 : creating task 'aa06', number = 6, id = 08010008, starting, task 6 has started. - TEST2 : creating task 'aa07', number = 7, id = 08010009, starting, task 7 has started. - TEST2 : creating task 'aa08', number = 8, id = 0801000a, starting, task 8 has started. - TEST2 : creating task 'aa09', number = 9, id = 0801000b, starting, task 9 has started. - TEST2 : creating task 'aa10', number = 10, id = 0801000c, starting, task 10 has started. - TEST2 : creating task 'aa11', number = 11, id = 0801000d, starting, task 11 has started. - TEST2 : creating task 'aa12', number = 12, id = 0801000e, starting, task 12 has started. - TEST2 : creating task 'aa13', number = 13, id = 0801000f, starting, task 13 has started. - TEST2 : creating task 'aa14', number = 14, id = 08010010, starting, task 14 has started. - TEST2 : creating task 'aa15', number = 15, id = 08010011, starting, task 15 has started. - TEST2 : creating task 'aa16', number = 16, id = 08010012, starting, task 16 has started. - TEST2 : creating task 'aa17', number = 17, id = 08010013, starting, task 17 has started. - TEST2 : creating task 'aa18', number = 18, id = 08010014, starting, task 18 has started. - TEST2 : creating task 'aa19', number = 19, id = 08010015, starting, task 19 has started. - TEST2 : creating task 'aa20', number = 20, id = 08010016, starting, task 20 has started. - TEST2 : creating task 'aa21', number = 21, id = 08010017, starting, task 21 has started. - TEST2 : creating task 'aa22', number = 22, id = 08010018, starting, task 22 has started. - TEST2 : creating task 'aa23', number = 23, id = 08010019, starting, task 23 has started. - TEST2 : block 1 remove, signal task 08010006, task 4 ending. - TEST2 : block 1 remove, signal task 08010007, task 5 ending. - TEST2 : block 1 remove, signal task 08010008, task 6 ending. - TEST2 : block 1 remove, signal task 08010009, task 7 ending. - TEST2 : block 1 remove, signal task 0801000a, task 8 ending. - TEST2 : block 3 remove, signal task 08010010, task 14 ending. - TEST2 : block 3 remove, signal task 08010011, task 15 ending. - TEST2 : block 3 remove, signal task 08010012, task 16 ending. - TEST2 : block 3 remove, signal task 08010013, task 17 ending. - TEST2 : block 3 remove, signal task 08010014, task 18 ending. - TEST2 : creating task 'aa24', number = 24, id = 08010010, starting, task 24 has started. - TEST2 : creating task 'aa25', number = 25, id = 08010011, starting, task 25 has started. - TEST2 : creating task 'aa26', number = 26, id = 08010012, starting, task 26 has started. - TEST2 : creating task 'aa27', number = 27, id = 08010013, starting, task 27 has started. - TEST2 : creating task 'aa28', number = 28, id = 08010014, starting, task 28 has started. - TEST2 : creating task 'aa29', number = 29, id = 08010006, starting, task 29 has started. - TEST2 : creating task 'aa30', number = 30, id = 08010007, starting, task 30 has started. - TEST2 : creating task 'aa31', number = 31, id = 08010008, starting, task 31 has started. - TEST2 : creating task 'aa32', number = 32, id = 08010009, starting, task 32 has started. - TEST2 : creating task 'aa33', number = 33, id = 0801000a, starting, task 33 has started. - TEST2 : signal task 08010002 to delete, task 0 ending. - TEST2 : signal task 08010003 to delete, task 1 ending. - TEST2 : signal task 08010004 to delete, task 2 ending. - TEST2 : signal task 08010005 to delete, task 3 ending. - TEST2 : signal task 08010010 to delete, task 24 ending. - TEST2 : signal task 08010011 to delete, task 25 ending. - TEST2 : signal task 08010012 to delete, task 26 ending. - TEST2 : signal task 08010013 to delete, task 27 ending. - TEST2 : signal task 08010014 to delete, task 28 ending. - TEST2 : signal task 0801000b to delete, task 9 ending. - TEST2 : signal task 0801000c to delete, task 10 ending. - TEST2 : signal task 0801000d to delete, task 11 ending. - TEST2 : signal task 0801000e to delete, task 12 ending. - TEST2 : signal task 0801000f to delete, task 13 ending. - TEST2 : signal task 08010006 to delete, task 29 ending. - TEST2 : signal task 08010007 to delete, task 30 ending. - TEST2 : signal task 08010008 to delete, task 31 ending. - TEST2 : signal task 08010009 to delete, task 32 ending. - TEST2 : signal task 0801000a to delete, task 33 ending. - TEST2 : signal task 08010015 to delete, task 19 ending. - TEST2 : signal task 08010016 to delete, task 20 ending. - TEST2 : signal task 08010017 to delete, task 21 ending. - TEST2 : signal task 08010018 to delete, task 22 ending. - TEST2 : signal task 08010019 to delete, task 23 ending. - TEST2 : completed - TEST3 : free more than 3 x allocation size, but not the same block, - then free a block - TEST3 : creating task 'aa00', number = 0, id = 08010002, starting, task 0 has started. - TEST3 : creating task 'aa01', number = 1, id = 08010003, starting, task 1 has started. - TEST3 : creating task 'aa02', number = 2, id = 08010004, starting, task 2 has started. - TEST3 : creating task 'aa03', number = 3, id = 08010005, starting, task 3 has started. - TEST3 : creating task 'aa04', number = 4, id = 08010015, starting, task 4 has started. - TEST3 : creating task 'aa05', number = 5, id = 08010016, starting, task 5 has started. - TEST3 : creating task 'aa06', number = 6, id = 08010017, starting, task 6 has started. - TEST3 : creating task 'aa07', number = 7, id = 08010018, starting, task 7 has started. - TEST3 : creating task 'aa08', number = 8, id = 08010019, starting, task 8 has started. - TEST3 : creating task 'aa09', number = 9, id = 08010006, starting, task 9 has started. - TEST3 : creating task 'aa10', number = 10, id = 08010007, starting, task 10 has started. - TEST3 : creating task 'aa11', number = 11, id = 08010008, starting, task 11 has started. - TEST3 : creating task 'aa12', number = 12, id = 08010009, starting, task 12 has started. - TEST3 : creating task 'aa13', number = 13, id = 0801000a, starting, task 13 has started. - TEST3 : creating task 'aa14', number = 14, id = 0801000b, starting, task 14 has started. - TEST3 : creating task 'aa15', number = 15, id = 0801000c, starting, task 15 has started. - TEST3 : creating task 'aa16', number = 16, id = 0801000d, starting, task 16 has started. - TEST3 : creating task 'aa17', number = 17, id = 0801000e, starting, task 17 has started. - TEST3 : creating task 'aa18', number = 18, id = 0801000f, starting, task 18 has started. - TEST3 : creating task 'aa19', number = 19, id = 08010010, starting, task 19 has started. - TEST3 : creating task 'aa20', number = 20, id = 08010011, starting, task 20 has started. - TEST3 : creating task 'aa21', number = 21, id = 08010012, starting, task 21 has started. - TEST3 : creating task 'aa22', number = 22, id = 08010013, starting, task 22 has started. - TEST3 : creating task 'aa23', number = 23, id = 08010014, starting, task 23 has started. - TEST3 : creating task 'aa24', number = 24, id = 0801001a, starting, task 24 has started. - TEST3 : creating task 'aa25', number = 25, id = 0801001b, starting, task 25 has started. - TEST3 : creating task 'aa26', number = 26, id = 0801001c, starting, task 26 has started. - TEST3 : creating task 'aa27', number = 27, id = 0801001d, starting, task 27 has started. - TEST3 : creating task 'aa28', number = 28, id = 0801001e, starting, task 28 has started. - TEST3 : creating task 'aa29', number = 29, id = 0801001f, starting, task 29 has started. - TEST3 : creating task 'aa30', number = 30, id = 08010020, starting, task 30 has started. - TEST3 : creating task 'aa31', number = 31, id = 08010021, starting, task 31 has started. - TEST3 : creating task 'aa32', number = 32, id = 08010022, starting, task 32 has started. - TEST3 : creating task 'aa33', number = 33, id = 08010023, starting, task 33 has started. - TEST3 : creating task 'aa34', number = 34, id = 08010024, starting, task 34 has started. - TEST3 : creating task 'aa35', number = 35, id = 08010025, starting, task 35 has started. - TEST3 : creating task 'aa36', number = 36, id = 08010026, starting, task 36 has started. - TEST3 : creating task 'aa37', number = 37, id = 08010027, starting, task 37 has started. - TEST3 : creating task 'aa38', number = 38, id = 08010028, starting, task 38 has started. - TEST3 : creating task 'aa39', number = 39, id = 08010029, starting, task 39 has started. - TEST3 : creating task 'aa40', number = 40, id = 0801002a, starting, task 40 has started. - TEST3 : creating task 'aa41', number = 41, id = 0801002b, starting, task 41 has started. - TEST3 : creating task 'aa42', number = 42, id = 0801002c, starting, task 42 has started. - TEST3 : creating task 'aa43', number = 43, id = 0801002d, starting, task 43 has started. - TEST3 : creating task 'aa44', number = 44, id = 0801002e, starting, task 44 has started. - TEST3 : creating task 'aa45', number = 45, id = 0801002f, starting, task 45 has started. - TEST3 : creating task 'aa46', number = 46, id = 08010030, starting, task 46 has started. - TEST3 : creating task 'aa47', number = 47, id = 08010031, starting, task 47 has started. - TEST3 : creating task 'aa48', number = 48, id = 08010032, starting, task 48 has started. - TEST3 : creating task 'aa49', number = 49, id = 08010033, starting, task 49 has started. - TEST3 : creating task 'aa50', number = 50, id = 08010034, starting, task 50 has started. - TEST3 : creating task 'aa51', number = 51, id = 08010035, starting, task 51 has started. - TEST3 : creating task 'aa52', number = 52, id = 08010036, starting, task 52 has started. - TEST3 : creating task 'aa53', number = 53, id = 08010037, starting, task 53 has started. - TEST3 : creating task 'aa54', number = 54, id = 08010038, starting, task 54 has started. - TEST3 : creating task 'aa55', number = 55, id = 08010039, starting, task 55 has started. - TEST3 : creating task 'aa56', number = 56, id = 0801003a, starting, task 56 has started. - TEST3 : creating task 'aa57', number = 57, id = 0801003b, starting, task 57 has started. - TEST3 : creating task 'aa58', number = 58, id = 0801003c, starting, task 58 has started. - TEST3 : creating task 'aa59', number = 59, id = 0801003d, starting, task 59 has started. - TEST3 : creating task 'aa60', number = 60, id = 0801003e, starting, task 60 has started. - TEST3 : creating task 'aa61', number = 61, id = 0801003f, starting, task 61 has started. - TEST3 : creating task 'aa62', number = 62, id = 08010040, starting, task 62 has started. - TEST3 : creating task 'aa63', number = 63, id = 08010041, starting, task 63 has started. - TEST3 : creating task 'aa64', number = 64, id = 08010042, starting, task 64 has started. - TEST3 : creating task 'aa65', number = 65, id = 08010043, starting, task 65 has started. - TEST3 : creating task 'aa66', number = 66, id = 08010044, starting, task 66 has started. - TEST3 : creating task 'aa67', number = 67, id = 08010045, starting, task 67 has started. - TEST3 : creating task 'aa68', number = 68, id = 08010046, starting, task 68 has started. - TEST3 : creating task 'aa69', number = 69, id = 08010047, starting, task 69 has started. - TEST3 : creating task 'aa70', number = 70, id = 08010048, starting, task 70 has started. - TEST3 : creating task 'aa71', number = 71, id = 08010049, starting, task 71 has started. - TEST3 : creating task 'aa72', number = 72, id = 0801004a, starting, task 72 has started. - TEST3 : creating task 'aa73', number = 73, id = 0801004b, starting, task 73 has started. - TEST3 : creating task 'aa74', number = 74, id = 0801004c, starting, task 74 has started. - TEST3 : creating task 'aa75', number = 75, id = 0801004d, starting, task 75 has started. - TEST3 : creating task 'aa76', number = 76, id = 0801004e, starting, task 76 has started. - TEST3 : creating task 'aa77', number = 77, id = 0801004f, starting, task 77 has started. - TEST3 : creating task 'aa78', number = 78, id = 08010050, starting, task 78 has started. - TEST3 : creating task 'aa79', number = 79, id = 08010051, starting, task 79 has started. - TEST3 : creating task 'aa80', number = 80, id = 08010052, starting, task 80 has started. - TEST3 : creating task 'aa81', number = 81, id = 08010053, starting, task 81 has started. - TEST3 : creating task 'aa82', number = 82, id = 08010054, starting, task 82 has started. - TEST3 : creating task 'aa83', number = 83, id = 08010055, starting, task 83 has started. - TEST3 : creating task 'aa84', number = 84, id = 08010056, starting, task 84 has started. - TEST3 : creating task 'aa85', number = 85, id = 08010057, starting, task 85 has started. - TEST3 : creating task 'aa86', number = 86, id = 08010058, starting, task 86 has started. - TEST3 : creating task 'aa87', number = 87, id = 08010059, starting, task 87 has started. - TEST3 : creating task 'aa88', number = 88, id = 0801005a, starting, task 88 has started. - TEST3 : creating task 'aa89', number = 89, id = 0801005b, starting, task 89 has started. - TEST3 : creating task 'aa90', number = 90, id = 0801005c, starting, task 90 has started. - TEST3 : creating task 'aa91', number = 91, id = 0801005d, starting, task 91 has started. - TEST3 : creating task 'aa92', number = 92, id = 0801005e, starting, task 92 has started. - TEST3 : creating task 'aa93', number = 93, id = 0801005f, starting, task 93 has started. - TEST3 : creating task 'aa94', number = 94, id = 08010060, starting, task 94 has started. - TEST3 : creating task 'aa95', number = 95, id = 08010061, starting, task 95 has started. - TEST3 : creating task 'aa96', number = 96, id = 08010062, starting, task 96 has started. - TEST3 : creating task 'aa97', number = 97, id = 08010063, starting, task 97 has started. - TEST3 : creating task 'aa98', number = 98, id = 08010064, starting, task 98 has started. - TEST3 : creating task 'aa99', number = 99, id = 08010065, starting, task 99 has started. - TEST3 : creating task 'ab00', number = 100, id = 08010066, starting, task 100 has started. - TEST3 : creating task 'ab01', number = 101, id = 08010067, starting, task 101 has started. - TEST3 : creating task 'ab02', number = 102, id = 08010068, starting, task 102 has started. - TEST3 : creating task 'ab03', number = 103, id = 08010069, starting, task 103 has started. - TEST3 : creating task 'ab04', number = 104, id = 0801006a, starting, task 104 has started. - TEST3 : creating task 'ab05', number = 105, id = 0801006b, starting, task 105 has started. - TEST3 : creating task 'ab06', number = 106, id = 0801006c, starting, task 106 has started. - TEST3 : creating task 'ab07', number = 107, id = 0801006d, starting, task 107 has started. - TEST3 : creating task 'ab08', number = 108, id = 0801006e, starting, task 108 has started. - TEST3 : creating task 'ab09', number = 109, id = 0801006f, starting, task 109 has started. - TEST3 : creating task 'ab10', number = 110, id = 08010070, starting, task 110 has started. - TEST3 : creating task 'ab11', number = 111, id = 08010071, starting, task 111 has started. - TEST3 : creating task 'ab12', number = 112, id = 08010072, starting, task 112 has started. - TEST3 : creating task 'ab13', number = 113, id = 08010073, starting, task 113 has started. - TEST3 : creating task 'ab14', number = 114, id = 08010074, starting, task 114 has started. - TEST3 : creating task 'ab15', number = 115, id = 08010075, starting, task 115 has started. - TEST3 : creating task 'ab16', number = 116, id = 08010076, starting, task 116 has started. - TEST3 : creating task 'ab17', number = 117, id = 08010077, starting, task 117 has started. - TEST3 : creating task 'ab18', number = 118, id = 08010078, starting, task 118 has started. - TEST3 : creating task 'ab19', number = 119, id = 08010079, starting, task 119 has started. - TEST3 : creating task 'ab20', number = 120, id = 0801007a, starting, task 120 has started. - TEST3 : creating task 'ab21', failure, unsatisfied. - TEST3 : remove, signal task 08010015, task 4 ending. - TEST3 : remove, signal task 08010016, task 5 ending. - TEST3 : remove, signal task 08010017, task 6 ending. - TEST3 : remove, signal task 08010006, task 9 ending. - TEST3 : remove, signal task 08010007, task 10 ending. - TEST3 : remove, signal task 08010008, task 11 ending. - TEST3 : remove, signal task 0801000b, task 14 ending. - TEST3 : remove, signal task 0801000c, task 15 ending. - TEST3 : remove, signal task 0801000d, task 16 ending. - TEST3 : remove, signal task 08010010, task 19 ending. - TEST3 : remove, signal task 08010011, task 20 ending. - TEST3 : remove, signal task 08010012, task 21 ending. - TEST3 : remove, signal task 08010018, task 7 ending. - TEST3 : remove, signal task 08010019, task 8 ending. - TEST3 : signal task 08010002 to delete, task 0 ending. - TEST3 : signal task 08010003 to delete, task 1 ending. - TEST3 : signal task 08010004 to delete, task 2 ending. - TEST3 : signal task 08010005 to delete, task 3 ending. - TEST3 : signal task 08010009 to delete, task 12 ending. - TEST3 : signal task 0801000a to delete, task 13 ending. - TEST3 : signal task 0801000e to delete, task 17 ending. - TEST3 : signal task 0801000f to delete, task 18 ending. - TEST3 : signal task 08010013 to delete, task 22 ending. - TEST3 : signal task 08010014 to delete, task 23 ending. - TEST3 : signal task 0801001a to delete, task 24 ending. - TEST3 : signal task 0801001b to delete, task 25 ending. - TEST3 : signal task 0801001c to delete, task 26 ending. - TEST3 : signal task 0801001d to delete, task 27 ending. - TEST3 : signal task 0801001e to delete, task 28 ending. - TEST3 : signal task 0801001f to delete, task 29 ending. - TEST3 : signal task 08010020 to delete, task 30 ending. - TEST3 : signal task 08010021 to delete, task 31 ending. - TEST3 : signal task 08010022 to delete, task 32 ending. - TEST3 : signal task 08010023 to delete, task 33 ending. - TEST3 : signal task 08010024 to delete, task 34 ending. - TEST3 : signal task 08010025 to delete, task 35 ending. - TEST3 : signal task 08010026 to delete, task 36 ending. - TEST3 : signal task 08010027 to delete, task 37 ending. - TEST3 : signal task 08010028 to delete, task 38 ending. - TEST3 : signal task 08010029 to delete, task 39 ending. - TEST3 : signal task 0801002a to delete, task 40 ending. - TEST3 : signal task 0801002b to delete, task 41 ending. - TEST3 : signal task 0801002c to delete, task 42 ending. - TEST3 : signal task 0801002d to delete, task 43 ending. - TEST3 : signal task 0801002e to delete, task 44 ending. - TEST3 : signal task 0801002f to delete, task 45 ending. - TEST3 : signal task 08010030 to delete, task 46 ending. - TEST3 : signal task 08010031 to delete, task 47 ending. - TEST3 : signal task 08010032 to delete, task 48 ending. - TEST3 : signal task 08010033 to delete, task 49 ending. - TEST3 : signal task 08010034 to delete, task 50 ending. - TEST3 : signal task 08010035 to delete, task 51 ending. - TEST3 : signal task 08010036 to delete, task 52 ending. - TEST3 : signal task 08010037 to delete, task 53 ending. - TEST3 : signal task 08010038 to delete, task 54 ending. - TEST3 : signal task 08010039 to delete, task 55 ending. - TEST3 : signal task 0801003a to delete, task 56 ending. - TEST3 : signal task 0801003b to delete, task 57 ending. - TEST3 : signal task 0801003c to delete, task 58 ending. - TEST3 : signal task 0801003d to delete, task 59 ending. - TEST3 : signal task 0801003e to delete, task 60 ending. - TEST3 : signal task 0801003f to delete, task 61 ending. - TEST3 : signal task 08010040 to delete, task 62 ending. - TEST3 : signal task 08010041 to delete, task 63 ending. - TEST3 : signal task 08010042 to delete, task 64 ending. - TEST3 : signal task 08010043 to delete, task 65 ending. - TEST3 : signal task 08010044 to delete, task 66 ending. - TEST3 : signal task 08010045 to delete, task 67 ending. - TEST3 : signal task 08010046 to delete, task 68 ending. - TEST3 : signal task 08010047 to delete, task 69 ending. - TEST3 : signal task 08010048 to delete, task 70 ending. - TEST3 : signal task 08010049 to delete, task 71 ending. - TEST3 : signal task 0801004a to delete, task 72 ending. - TEST3 : signal task 0801004b to delete, task 73 ending. - TEST3 : signal task 0801004c to delete, task 74 ending. - TEST3 : signal task 0801004d to delete, task 75 ending. - TEST3 : signal task 0801004e to delete, task 76 ending. - TEST3 : signal task 0801004f to delete, task 77 ending. - TEST3 : signal task 08010050 to delete, task 78 ending. - TEST3 : signal task 08010051 to delete, task 79 ending. - TEST3 : signal task 08010052 to delete, task 80 ending. - TEST3 : signal task 08010053 to delete, task 81 ending. - TEST3 : signal task 08010054 to delete, task 82 ending. - TEST3 : signal task 08010055 to delete, task 83 ending. - TEST3 : signal task 08010056 to delete, task 84 ending. - TEST3 : signal task 08010057 to delete, task 85 ending. - TEST3 : signal task 08010058 to delete, task 86 ending. - TEST3 : signal task 08010059 to delete, task 87 ending. - TEST3 : signal task 0801005a to delete, task 88 ending. - TEST3 : signal task 0801005b to delete, task 89 ending. - TEST3 : signal task 0801005c to delete, task 90 ending. - TEST3 : signal task 0801005d to delete, task 91 ending. - TEST3 : signal task 0801005e to delete, task 92 ending. - TEST3 : signal task 0801005f to delete, task 93 ending. - TEST3 : signal task 08010060 to delete, task 94 ending. - TEST3 : signal task 08010061 to delete, task 95 ending. - TEST3 : signal task 08010062 to delete, task 96 ending. - TEST3 : signal task 08010063 to delete, task 97 ending. - TEST3 : signal task 08010064 to delete, task 98 ending. - TEST3 : signal task 08010065 to delete, task 99 ending. - TEST3 : signal task 08010066 to delete, task 100 ending. - TEST3 : signal task 08010067 to delete, task 101 ending. - TEST3 : signal task 08010068 to delete, task 102 ending. - TEST3 : signal task 08010069 to delete, task 103 ending. - TEST3 : signal task 0801006a to delete, task 104 ending. - TEST3 : signal task 0801006b to delete, task 105 ending. - TEST3 : signal task 0801006c to delete, task 106 ending. - TEST3 : signal task 0801006d to delete, task 107 ending. - TEST3 : signal task 0801006e to delete, task 108 ending. - TEST3 : signal task 0801006f to delete, task 109 ending. - TEST3 : signal task 08010070 to delete, task 110 ending. - TEST3 : signal task 08010071 to delete, task 111 ending. - TEST3 : signal task 08010072 to delete, task 112 ending. - TEST3 : signal task 08010073 to delete, task 113 ending. - TEST3 : signal task 08010074 to delete, task 114 ending. - TEST3 : signal task 08010075 to delete, task 115 ending. - TEST3 : signal task 08010076 to delete, task 116 ending. - TEST3 : signal task 08010077 to delete, task 117 ending. - TEST3 : signal task 08010078 to delete, task 118 ending. - TEST3 : signal task 08010079 to delete, task 119 ending. - TEST3 : signal task 0801007a to delete, task 120 ending. - TEST3 : completed - -*** END OF UNLIMITED TASK TEST *** - -NOTE: The failures are expected. This is the limiting factor, memory in the - work-space. -NOTE: The number of tasks may vary due to the size of the work-space. diff --git a/testsuites/sptests/.cvsignore b/testsuites/sptests/.cvsignore deleted file mode 100644 index bfdfd995be..0000000000 --- a/testsuites/sptests/.cvsignore +++ /dev/null @@ -1,14 +0,0 @@ -aclocal.m4 -autom4te*.cache -config.cache -config.guess -config.log -config.status -config.sub -configure -depcomp -install-sh -Makefile -Makefile.in -missing -mkinstalldirs diff --git a/testsuites/sptests/ChangeLog b/testsuites/sptests/ChangeLog deleted file mode 100644 index 7311e484c9..0000000000 --- a/testsuites/sptests/ChangeLog +++ /dev/null @@ -1,319 +0,0 @@ -2003-02-11 Ralf Corsepius - - * configure.ac: AM_INIT_AUTOMAKE([1.7.2]). - -2003-02-11 Ralf Corsepius - - * configure.ac: AC_PREREQ(2.57). - -2002-11-14 Joel Sherrill - - * sp02/sp02.scn, sp15/sp15.scn, sp16/sp16.scn, sp20/sp20.scn, - sp22/sp22.scn, sp23/sp23.scn, sp25/sp25.scn, sp31/sp31.scn: Per PR239 - update the IDs in the screens. - -2002-10-21 Ralf Corsepius - - * .cvsignore: Reformat. - Add autom4te*cache. - Remove autom4te.cache. - -2002-09-14 Joel Sherrill - - * sp32/.cvsignore: New file. - -2002-09-14 Aaron J. Grier - - * PR271 was not applicable against the current source but included - a nice test that Joel decided to add to the tree as sp32. - * sp32/Makefile.am, sp32/init.c, sp32/sp32.scn: New file. - * Makefile.am, configure.ac: Modified to reflect addition. - -2002-08-11 Ralf Corsepius - - * sp01/Makefile.am: Use $(OBJEXT) instead of .o. - * sp02/Makefile.am: Use $(OBJEXT) instead of .o. - * sp03/Makefile.am: Use $(OBJEXT) instead of .o. - * sp04/Makefile.am: Use $(OBJEXT) instead of .o. - * sp05/Makefile.am: Use $(OBJEXT) instead of .o. - * sp06/Makefile.am: Use $(OBJEXT) instead of .o. - * sp07/Makefile.am: Use $(OBJEXT) instead of .o. - * sp08/Makefile.am: Use $(OBJEXT) instead of .o. - * sp09/Makefile.am: Use $(OBJEXT) instead of .o. - * sp11/Makefile.am: Use $(OBJEXT) instead of .o. - * sp12/Makefile.am: Use $(OBJEXT) instead of .o. - * sp13/Makefile.am: Use $(OBJEXT) instead of .o. - * sp14/Makefile.am: Use $(OBJEXT) instead of .o. - * sp15/Makefile.am: Use $(OBJEXT) instead of .o. - * sp16/Makefile.am: Use $(OBJEXT) instead of .o. - * sp17/Makefile.am: Use $(OBJEXT) instead of .o. - * sp19/Makefile.am: Use $(OBJEXT) instead of .o. - * sp20/Makefile.am: Use $(OBJEXT) instead of .o. - * sp21/Makefile.am: Use $(OBJEXT) instead of .o. - * sp22/Makefile.am: Use $(OBJEXT) instead of .o. - * sp23/Makefile.am: Use $(OBJEXT) instead of .o. - * sp24/Makefile.am: Use $(OBJEXT) instead of .o. - * sp25/Makefile.am: Use $(OBJEXT) instead of .o. - * sp26/Makefile.am: Use $(OBJEXT) instead of .o. - * sp27/Makefile.am: Use $(OBJEXT) instead of .o. - * sp28/Makefile.am: Use $(OBJEXT) instead of .o. - * sp29/Makefile.am: Use $(OBJEXT) instead of .o. - * sp30/Makefile.am: Use $(OBJEXT) instead of .o. - * sp31/Makefile.am: Use $(OBJEXT) instead of .o. - * spfatal/Makefile.am: Use $(OBJEXT) instead of .o. - * spsize/Makefile.am: Use $(OBJEXT) instead of .o. - -2002-08-01 Joel Sherrill - - * Per PR47 add support for buffered test output. This involved - adding defines to redirect output to a buffer and dump it when - full, at "test pause", and at exit. To avoid problems when redefining - exit(), all tests were modified to call rtems_test_exit(). - Some tests, notable psxtests, had to be modified to include - the standard test macro .h file (pmacros.h or tmacros.h) to - enable this support. - * sp01/task1.c, sp02/task1.c, sp03/task2.c, sp04/task1.c, sp05/task1.c, - sp06/task1.c, sp07/taskexit.c, sp08/task1.c, sp09/task1.c, - sp11/task1.c, sp12/pritask.c, sp12/task5.c, sp13/task1.c, - sp14/task2.c, sp15/task1.c, sp16/task1.c, sp17/task1.c, - sp19/fptask.c, sp20/task1.c, sp21/task1.c, sp22/task1.c, - sp23/task1.c, sp24/task1.c, sp25/task1.c, sp26/init.c, sp26/task1.c, - sp30/task1.c, sp31/task1.c, spsize/init.c, spsize/size.c: Modified. - -2002-07-30 Joel Sherrill - - * spsize/size.c: Don't reference the RTEMS allocated interrupt - stack if the port doesn't configure using it. - -2002-07-04 Joel Sherrill - - * Jump table for single entry point removed. - * spsize/size.c: Modified to reflect above. - -2002-07-01 Joel Sherrill - - * sp29/init.c: Corrected definitions for task stack usage. - -2002-07-01 Joel Sherrill - - * spsize/size.c: _Thread_queue_Extract_table removed. - -2001-05-17 Joel Sherrill - - * sp21/task1.c (INVALID_DRIVER_MAJOR): Change definition to reflect - number of staticly configured device drivers. - -2001-05-14 Joel Sherrill - - * sp21/task1.c: Correct INVALID_DRIVER_MAJOR so it is precisely 1 more - than the configured number of drivers. - -2002-04-14 Ralf Corsepius - - * configure.ac: Remove ENABLE_GCC28. - -2001-04-04 Joel Sherrill - - * spsize/size.c: Reflect SPARC modifcation to get rid of - NO_TABLE_MOVE and references to _CPU_Trap_Table_area. - -2001-03-29 Joel Sherrill - - * Per PR147 addressed problems when reseting and inserting a timer - into a timer chain that did not honor time passage since the last - time the timer server was scheduled and the new insertion. - * sp31/sp31.scn, sp31/task1.c: Added test code to detect this case. - -2001-03-28 Joel Sherrill - - * Side-effect of PR132. - * sp21/system.h: Now must explicitly request NULL driver. - -2002-03-27 Ralf Corsepius - - * configure.ac: - AC_INIT(package,_RTEMS_VERSION,_RTEMS_BUGS). - AM_INIT_AUTOMAKE([no-define foreign 1.6]). - * sp01/Makefile.am: Remove AUTOMAKE_OPTIONS. - * sp02/Makefile.am: Remove AUTOMAKE_OPTIONS. - * Makefile.am: Remove AUTOMAKE_OPTIONS. - * sp03/Makefile.am: Remove AUTOMAKE_OPTIONS. - * sp04/Makefile.am: Remove AUTOMAKE_OPTIONS. - * sp05/Makefile.am: Remove AUTOMAKE_OPTIONS. - * sp06/Makefile.am: Remove AUTOMAKE_OPTIONS. - * sp07/Makefile.am: Remove AUTOMAKE_OPTIONS. - * sp08/Makefile.am: Remove AUTOMAKE_OPTIONS. - * sp09/Makefile.am: Remove AUTOMAKE_OPTIONS. - * sp11/Makefile.am: Remove AUTOMAKE_OPTIONS. - * sp12/Makefile.am: Remove AUTOMAKE_OPTIONS. - * sp13/Makefile.am: Remove AUTOMAKE_OPTIONS. - * sp14/Makefile.am: Remove AUTOMAKE_OPTIONS. - * sp15/Makefile.am: Remove AUTOMAKE_OPTIONS. - * sp16/Makefile.am: Remove AUTOMAKE_OPTIONS. - * sp17/Makefile.am: Remove AUTOMAKE_OPTIONS. - * sp19/Makefile.am: Remove AUTOMAKE_OPTIONS. - * sp20/Makefile.am: Remove AUTOMAKE_OPTIONS. - * sp21/Makefile.am: Remove AUTOMAKE_OPTIONS. - * sp22/Makefile.am: Remove AUTOMAKE_OPTIONS. - * sp23/Makefile.am: Remove AUTOMAKE_OPTIONS. - * sp24/Makefile.am: Remove AUTOMAKE_OPTIONS. - * sp25/Makefile.am: Remove AUTOMAKE_OPTIONS. - * sp26/Makefile.am: Remove AUTOMAKE_OPTIONS. - * sp27/Makefile.am: Remove AUTOMAKE_OPTIONS. - * sp28/Makefile.am: Remove AUTOMAKE_OPTIONS. - * sp29/Makefile.am: Remove AUTOMAKE_OPTIONS. - * sp30/Makefile.am: Remove AUTOMAKE_OPTIONS. - * sp31/Makefile.am: Remove AUTOMAKE_OPTIONS. - * spfatal/Makefile.am: Remove AUTOMAKE_OPTIONS. - * spsize/Makefile.am: Remove AUTOMAKE_OPTIONS. - -2002-03-20 Chris Johns - - * PR145. - * sp04/task1.c, sp04/tswitch.c: Test fails if other tasks present - in system (e.g. driver tasks). Also exit on minimum number of - switches not precise number. - -2001-01-29 Joel Sherrill - - * Fixed bug where resetting a timer that was not at the head - of one of the task timer chains resulted in the Timer Server - task waking up too far in the future. - * Added rtems_timer_get_information() directive to support testing. - * sp31/init.c, sp31/system.h, sp31/task1.c: Modified to test for - above condition. - -2001-01-22 Joel Sherrill - - * sp09/screen14.c, sp09/sp09.scn, sp30/init.c, sp31/init.c: Modified - because priority added as argument to rtems_timer_initiate_server(). - -2001-01-16 Joel Sherrill - - * Added tests for task-based timers. This included the new tests - sp30 and sp31. - * Makefile.am, configure.ac: Modified to reflect new tests and files. - * sp09/screen14.c, sp09/sp09.scn: Modified to add error checks - for task-based timer services. - * sp30/.cvsignore, sp30/Makefile.am, sp30/init.c, sp30/resume.c, - sp30/sp30.doc, sp30/sp30.scn, sp30/system.h, sp30/task1.c, - sp31/.cvsignore, sp31/Makefile.am, sp31/delay.c, sp31/init.c, - sp31/prtime.c, sp31/sp31.doc, sp31/sp31.scn, sp31/system.h, - sp31/task1.c: New files. - -2001-11-01 Joel Sherrill - - * sp26/system.h: Properly account for stack memory used by - this test. Reported by Jerry Needell - and processed as PR78. - -2001-10-11 Ralf Corsepius - - * .cvsignore: Add autom4te.cache for autoconf > 2.52. - * configure.in: Remove. - * configure.ac: New file, generated from configure.in by autoupdate. - -2001-09-22 Ralf Corsepius - - * sptests.am: Use TMPINSTALL_FILES = to make automake-1.5 happy. - -2001-09-19 Ralf Corsepius - - * sp20/Makefile.am: include leaf.am instead of leaf.cfg. - * sp02/Makefile.am: include leaf.am instead of leaf.cfg. - * sp19/Makefile.am: include leaf.am instead of leaf.cfg. - * sp11/Makefile.am: include leaf.am instead of leaf.cfg. - * sp25/Makefile.am: include leaf.am instead of leaf.cfg. - * sp04/Makefile.am: include leaf.am instead of leaf.cfg. - * spsize/Makefile.am: include leaf.am instead of leaf.cfg. - * sp01/Makefile.am: include leaf.am instead of leaf.cfg. - * sp16/Makefile.am: include leaf.am instead of leaf.cfg. - * sp05/Makefile.am: include leaf.am instead of leaf.cfg. - * sp09/Makefile.am: include leaf.am instead of leaf.cfg. - * spfatal/Makefile.am: include leaf.am instead of leaf.cfg. - * sp06/Makefile.am: include leaf.am instead of leaf.cfg. - * sp23/Makefile.am: include leaf.am instead of leaf.cfg. - * sp28/Makefile.am: include leaf.am instead of leaf.cfg. - * sp03/Makefile.am: include leaf.am instead of leaf.cfg. - * sp29/Makefile.am: include leaf.am instead of leaf.cfg. - * sp13/Makefile.am: include leaf.am instead of leaf.cfg. - * sp27/Makefile.am: include leaf.am instead of leaf.cfg. - * sp14/Makefile.am: include leaf.am instead of leaf.cfg. - * sp07/Makefile.am: include leaf.am instead of leaf.cfg. - * sp15/Makefile.am: include leaf.am instead of leaf.cfg. - * sp17/Makefile.am: include leaf.am instead of leaf.cfg. - * sp22/Makefile.am: include leaf.am instead of leaf.cfg. - * sp12/Makefile.am: include leaf.am instead of leaf.cfg. - * sp26/Makefile.am: include leaf.am instead of leaf.cfg. - * sp21/Makefile.am: include leaf.am instead of leaf.cfg. - * sp24/Makefile.am: include leaf.am instead of leaf.cfg. - * sp08/Makefile.am: include leaf.am instead of leaf.cfg. - -2001-08-16 Joel Sherrill - - * sp20/system.h: Account for extra task stacks properly. - -2001-08-16 Joel Sherrill - - * sp13/sp13.scn: Id in screen had wrong class field value. - * sp13/system.h: Account for message buffer memory. - * sp13/task2.c: Remove unnecessary check for failure. - -2001-05-10 Ralf Corsepius - - * configure.in: Use RTEMS_PROG_CC_FOR_TARGET([-ansi -fasm]). - -2001-04-20 Joel Sherrill - - * sp298/sp28.scn: Minor adjustment so test output matches the screen - file. - -2001-02-07 Ralf Corsepius - - * spsize/size.c: Use #if !defined(RTEMS_UNIX). - -2001-01-26 Ralf Corsepius - - * sp21/Makefile.am: Remove libtest. - -2000-11-09 Ralf Corsepius - - * Makefile.am: Use ... instead of RTEMS_TOPdir in ACLOCAL_AMFLAGS. - -2000-11-02 Ralf Corsepius - - * Makefile.am: Switch to ACLOCAL_AMFLAGS = -I $(RTEMS_TOPdir)/aclocal. - -2000-10-27 Ralf Corsepius - - * Makefile.am: ACLOCAL_AMFLAGS= -I $(RTEMS_TOPdir)/macros. - Switch to GNU canonicalization. - * sptests.am: Remove DEFS. - -2000-09-29 Joel Sherrill - - * sp20/sp20.scn: Corrected to reflect new addition. - * sp20/system.h: Removed comment reflecting history. - -2000-09-29 Stephan Merker - - * sp20/getall.c, sp20/init.c, sp20/system.h, sp20/task1.c: - Added new task to test sequence of altering a period's length - while it is still active. - -2000-09-04 Ralf Corsepius - - * sp01/Makefile.am, sp02/Makefile.am, sp03/Makefile.am, - sp04/Makefile.am, sp05/Makefile.am, sp06/Makefile.am, - sp07/Makefile.am, sp08/Makefile.am, sp09/Makefile.am, - sp11/Makefile.am, sp12/Makefile.am, sp13/Makefile.am, - sp14/Makefile.am, sp15/Makefile.am, sp16/Makefile.am, - sp17/Makefile.am, sp19/Makefile.am, sp20/Makefile.am, - sp21/Makefile.am, sp22/Makefile.am, sp23/Makefile.am, - sp24/Makefile.am, sp25/Makefile.am, sp26/Makefile.am, - sp27/Makefile.am, sp28/Makefile.am, sp29/Makefile.am, - spfatal/Makefile.am, spsize/Makefile.am: Include compile.am - -2000-08-10 Joel Sherrill - - * ChangeLog: New file. diff --git a/testsuites/sptests/Makefile.am b/testsuites/sptests/Makefile.am deleted file mode 100644 index 47d2e26130..0000000000 --- a/testsuites/sptests/Makefile.am +++ /dev/null @@ -1,15 +0,0 @@ -## -## $Id$ -## - -ACLOCAL_AMFLAGS = -I ../../../../aclocal - -## sp10 and spfatal are not included for now -SUBDIRS = sp01 sp02 sp03 sp04 sp05 sp06 sp07 sp08 sp09 sp11 sp12 sp13 sp14 \ - sp15 sp16 sp17 sp19 sp20 sp21 sp22 sp23 sp24 sp25 sp26 sp27 sp28 sp29 \ - sp30 sp31 sp32 spsize - -EXTRA_DIST = sptests.am spfatal - -include $(top_srcdir)/../../../../automake/subdirs.am -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/sptests/README b/testsuites/sptests/README deleted file mode 100644 index 2843063c31..0000000000 --- a/testsuites/sptests/README +++ /dev/null @@ -1,9 +0,0 @@ -# -# $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/configure.ac b/testsuites/sptests/configure.ac deleted file mode 100644 index 15898c537e..0000000000 --- a/testsuites/sptests/configure.ac +++ /dev/null @@ -1,74 +0,0 @@ -## Process this file with autoconf to produce a configure script. -## -## $Id$ - -AC_PREREQ(2.57) -AC_INIT([rtems-c-src-tests-sptests],[_RTEMS_VERSION],[rtems-bugs@OARcorp.com]) -AC_CONFIG_SRCDIR([sp01]) -RTEMS_TOP(../../../..) -AC_CONFIG_AUX_DIR(../../../..) - -RTEMS_CANONICAL_TARGET_CPU - -AM_INIT_AUTOMAKE([no-define foreign 1.7.2]) -AM_MAINTAINER_MODE - -RTEMS_ENABLE_BARE - -RTEMS_ENV_RTEMSBSP -RTEMS_CHECK_RTEMS_TEST_NO_PAUSE -RTEMS_CHECK_CPU -RTEMS_CANONICAL_HOST - -RTEMS_PROJECT_ROOT - -RTEMS_PROG_CC_FOR_TARGET([-ansi -fasm]) - -RTEMS_CANONICALIZE_TOOLS - -RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP) - -AC_SUBST(BARE_CPU_CFLAGS) -AC_SUBST(BARE_CPU_MODEL) -AC_SUBST(CC_CFLAGS_DEFAULT) -AC_SUBST(CC_CFLAGS_DEBUG_V) -AC_SUBST(CC_CFLAGS_PROFILE_V) -AC_SUBST(CC_LDFLAGS_PROFILE_V) - -# Explicitly list all Makefiles here -AC_CONFIG_FILES([Makefile -sp01/Makefile -sp02/Makefile -sp03/Makefile -sp04/Makefile -sp05/Makefile -sp06/Makefile -sp07/Makefile -sp08/Makefile -sp09/Makefile -sp11/Makefile -sp12/Makefile -sp13/Makefile -sp14/Makefile -sp15/Makefile -sp16/Makefile -sp17/Makefile -sp19/Makefile -sp20/Makefile -sp21/Makefile -sp22/Makefile -sp23/Makefile -sp24/Makefile -sp25/Makefile -sp26/Makefile -sp27/Makefile -sp28/Makefile -sp29/Makefile -sp30/Makefile -sp31/Makefile -sp32/Makefile -spsize/Makefile -]) -AC_OUTPUT - -# spfatal/Makefile diff --git a/testsuites/sptests/sp01/.cvsignore b/testsuites/sptests/sp01/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/sptests/sp01/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/sptests/sp01/Makefile.am b/testsuites/sptests/sp01/Makefile.am deleted file mode 100644 index 49524981e9..0000000000 --- a/testsuites/sptests/sp01/Makefile.am +++ /dev/null @@ -1,38 +0,0 @@ -## -## $Id$ -## - - -TEST = sp01 - -MANAGERS = io - -C_FILES = init.c task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/sptests.am - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/sptests/sp01/init.c b/testsuites/sptests/sp01/init.c deleted file mode 100644 index b8f409b3bb..0000000000 --- a/testsuites/sptests/sp01/init.c +++ /dev/null @@ -1,85 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.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, - RTEMS_MINIMUM_STACK_SIZE * 2, - 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, - RTEMS_MINIMUM_STACK_SIZE * 2, - 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, - RTEMS_MINIMUM_STACK_SIZE * 3, - 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 deleted file mode 100644 index 338ff1fb1b..0000000000 --- a/testsuites/sptests/sp01/sp01.doc +++ /dev/null @@ -1,42 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - -This file describes the directives and concepts tested by this test set. - -test set name: 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 deleted file mode 100644 index 6d687d042a..0000000000 --- a/testsuites/sptests/sp01/sp01.scn +++ /dev/null @@ -1,18 +0,0 @@ -*** 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 -TA2 - rtems_clock_get - 09:00:30 12/31/1988 -TA1 - 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 deleted file mode 100644 index 3d4b636d38..0000000000 --- a/testsuites/sptests/sp01/system.h +++ /dev/null @@ -1,45 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_task Task_1_through_3( - rtems_task_argument argument -); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_EXTRA_TASK_STACKS (4 * RTEMS_MINIMUM_STACK_SIZE) -#define CONFIGURE_MAXIMUM_TASKS 4 - -#include - -/* global variables */ - -TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */ - -/* end of include file */ diff --git a/testsuites/sptests/sp01/task1.c b/testsuites/sptests/sp01/task1.c deleted file mode 100644 index 4429127d91..0000000000 --- a/testsuites/sptests/sp01/task1.c +++ /dev/null @@ -1,49 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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 ***" ); - rtems_test_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/.cvsignore b/testsuites/sptests/sp02/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/sptests/sp02/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/sptests/sp02/Makefile.am b/testsuites/sptests/sp02/Makefile.am deleted file mode 100644 index 905fc5c483..0000000000 --- a/testsuites/sptests/sp02/Makefile.am +++ /dev/null @@ -1,38 +0,0 @@ -## -## $Id$ -## - - -TEST = sp02 - -MANAGERS = io - -C_FILES = init.c task1.c task2.c task3.c preempt.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/sptests.am - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/sptests/sp02/init.c b/testsuites/sptests/sp02/init.c deleted file mode 100644 index bd1274ceca..0000000000 --- a/testsuites/sptests/sp02/init.c +++ /dev/null @@ -1,151 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.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, - RTEMS_MINIMUM_STACK_SIZE, - 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, - RTEMS_MINIMUM_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 ], - 3, - RTEMS_MINIMUM_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 ], - 3, - RTEMS_MINIMUM_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, 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, - RTEMS_MINIMUM_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 ], - 3, - RTEMS_MINIMUM_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 ], - 3, - RTEMS_MINIMUM_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, 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 deleted file mode 100644 index e494349c8a..0000000000 --- a/testsuites/sptests/sp02/preempt.c +++ /dev/null @@ -1,31 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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 deleted file mode 100644 index 2b624f8e23..0000000000 --- a/testsuites/sptests/sp02/sp02.doc +++ /dev/null @@ -1,36 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - -This file describes the directives and concepts tested by this test set. - -test set name: 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 deleted file mode 100644 index 01f22f6a19..0000000000 --- a/testsuites/sptests/sp02/sp02.scn +++ /dev/null @@ -1,15 +0,0 @@ -*** 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 (0x0a010004) -TA1 - rtems_task_ident - tid of TA3 (0x0a010002) -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 deleted file mode 100644 index 0303a97812..0000000000 --- a/testsuites/sptests/sp02/system.h +++ /dev/null @@ -1,58 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_task Preempt_task( - rtems_task_argument argument -); - -rtems_task Task_1( - rtems_task_argument argument -); - -rtems_task Task_2( - rtems_task_argument argument -); - -rtems_task Task_3( - rtems_task_argument argument -); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE -#define CONFIGURE_MAXIMUM_TASKS 4 - -#include - -/* global variables */ - -TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */ - -TEST_EXTERN rtems_id Preempt_task_id; /* preempt task id */ -TEST_EXTERN rtems_name Preempt_task_name; /* preempt task name */ - -/* end of include file */ diff --git a/testsuites/sptests/sp02/task1.c b/testsuites/sptests/sp02/task1.c deleted file mode 100644 index de46289106..0000000000 --- a/testsuites/sptests/sp02/task1.c +++ /dev/null @@ -1,65 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/sptests/sp02/task2.c b/testsuites/sptests/sp02/task2.c deleted file mode 100644 index 583f0043f7..0000000000 --- a/testsuites/sptests/sp02/task2.c +++ /dev/null @@ -1,33 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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 deleted file mode 100644 index 6fd637ecc6..0000000000 --- a/testsuites/sptests/sp02/task3.c +++ /dev/null @@ -1,36 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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/.cvsignore b/testsuites/sptests/sp03/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/sptests/sp03/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/sptests/sp03/Makefile.am b/testsuites/sptests/sp03/Makefile.am deleted file mode 100644 index 83a35b4a8b..0000000000 --- a/testsuites/sptests/sp03/Makefile.am +++ /dev/null @@ -1,38 +0,0 @@ -## -## $Id$ -## - - -TEST = sp03 - -MANAGERS = io - -C_FILES = init.c task1.c task2.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/sptests.am - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/sptests/sp03/init.c b/testsuites/sptests/sp03/init.c deleted file mode 100644 index 560e01a53b..0000000000 --- a/testsuites/sptests/sp03/init.c +++ /dev/null @@ -1,66 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.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, - RTEMS_MINIMUM_STACK_SIZE * 2, - 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, - RTEMS_MINIMUM_STACK_SIZE, - 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 deleted file mode 100644 index 4fb72db94b..0000000000 --- a/testsuites/sptests/sp03/sp03.doc +++ /dev/null @@ -1,23 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - -This file describes the directives and concepts tested by this test set. - -test set name: 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 deleted file mode 100644 index 496982e86f..0000000000 --- a/testsuites/sptests/sp03/sp03.scn +++ /dev/null @@ -1,26 +0,0 @@ -*** 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 deleted file mode 100644 index 79bd7232cc..0000000000 --- a/testsuites/sptests/sp03/system.h +++ /dev/null @@ -1,50 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_task Task_1( - rtems_task_argument argument -); - -rtems_task Task_2( - rtems_task_argument argument -); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_EXTRA_TASK_STACKS (1 * RTEMS_MINIMUM_STACK_SIZE) -#define CONFIGURE_MAXIMUM_TASKS 3 - - -#include - -/* global variables */ - -TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */ - -/* end of include file */ diff --git a/testsuites/sptests/sp03/task1.c b/testsuites/sptests/sp03/task1.c deleted file mode 100644 index 246e293839..0000000000 --- a/testsuites/sptests/sp03/task1.c +++ /dev/null @@ -1,58 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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 deleted file mode 100644 index 37b8354d5a..0000000000 --- a/testsuites/sptests/sp03/task2.c +++ /dev/null @@ -1,45 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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 *** " ); - rtems_test_exit( 0 ); - } - - put_name( Task_name[ 2 ], FALSE ); - print_time( " ", &time, "\n" ); - } -} diff --git a/testsuites/sptests/sp04/.cvsignore b/testsuites/sptests/sp04/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/sptests/sp04/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/sptests/sp04/Makefile.am b/testsuites/sptests/sp04/Makefile.am deleted file mode 100644 index a82e7ce3f5..0000000000 --- a/testsuites/sptests/sp04/Makefile.am +++ /dev/null @@ -1,38 +0,0 @@ -## -## $Id$ -## - - -TEST = sp04 - -MANAGERS = io - -C_FILES = init.c task1.c task2.c task3.c tswitch.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/sptests.am - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/sptests/sp04/init.c b/testsuites/sptests/sp04/init.c deleted file mode 100644 index 032797c904..0000000000 --- a/testsuites/sptests/sp04/init.c +++ /dev/null @@ -1,109 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.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, - RTEMS_MINIMUM_STACK_SIZE * 2, - RTEMS_TIMESLICE, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 1 ] - ); - directive_failed( status, "rtems_task_create of TA1" ); - - status = rtems_task_create( - Task_name[ 2 ], - 1, - RTEMS_MINIMUM_STACK_SIZE * 2, - RTEMS_TIMESLICE, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 2 ] - ); - directive_failed( status, "rtems_task_create of TA2" ); - - status = rtems_task_create( - Task_name[ 3 ], - 1, - RTEMS_MINIMUM_STACK_SIZE * 2, - 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 deleted file mode 100644 index 35c353e529..0000000000 --- a/testsuites/sptests/sp04/sp04.doc +++ /dev/null @@ -1,37 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - -This file describes the directives and concepts tested by this test set. - -test set name: 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 deleted file mode 100644 index 801ad8c6fb..0000000000 --- a/testsuites/sptests/sp04/sp04.scn +++ /dev/null @@ -1,25 +0,0 @@ -*** TEST 4 *** -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 -TA1 - rtems_task_mode - change mode to NO RTEMS_PREEMPT -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 - 09:15:15 12/31/1988 -TA1 - rtems_task_mode - change mode to RTEMS_PREEMPT -TA1 - 09:15:00 12/31/1988 -TA2 - 09:15:04 12/31/1988 -TA3 - 09:15:05 12/31/1988 -TA1 - 09:15:06 12/31/1988 -TA2 - 09:15:07 12/31/1988 -TA3 - 09:15:08 12/31/1988 -TA1 - 09:15:09 12/31/1988 -TA2 - 09:15:16 12/31/1988 -TA3 - 09:15:17 12/31/1988 -TA1 - 09:15:18 12/31/1988 -*** END OF TEST 4 *** diff --git a/testsuites/sptests/sp04/system.h b/testsuites/sptests/sp04/system.h deleted file mode 100644 index cf5d6216f2..0000000000 --- a/testsuites/sptests/sp04/system.h +++ /dev/null @@ -1,81 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_task Task_1( - rtems_task_argument argument -); - -rtems_task Task_2( - rtems_task_argument argument -); - -rtems_task Task_3( - rtems_task_argument argument -); - -void Task_switch( - rtems_tcb *unused, - rtems_tcb *heir -); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_USER_EXTENSIONS 1 -#define CONFIGURE_TICKS_PER_TIMESLICE 100 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_EXTRA_TASK_STACKS (3 * RTEMS_MINIMUM_STACK_SIZE) -#define CONFIGURE_MAXIMUM_TASKS 4 - -#include - -/* global variables */ - -TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */ - -TEST_EXTERN rtems_id Extension_id[ 4 ]; -TEST_EXTERN rtems_name Extension_name[ 4 ]; /* array of task names */ - -/* array of task run counts */ -TEST_EXTERN volatile rtems_unsigned32 Run_count[ 4 ]; - -/* - * Keep track of task switches - */ - -struct taskSwitchLog { - int taskIndex; - rtems_time_of_day when; -}; - -extern struct taskSwitchLog taskSwitchLog[]; -extern int taskSwitchLogIndex; -volatile extern int testsFinished; - - -/* end of include file */ diff --git a/testsuites/sptests/sp04/task1.c b/testsuites/sptests/sp04/task1.c deleted file mode 100644 index da54ffe227..0000000000 --- a/testsuites/sptests/sp04/task1.c +++ /dev/null @@ -1,117 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -static void -showTaskSwitches (void) -{ - int i; - int switches = taskSwitchLogIndex; - - for (i = 0 ; i < switches ; i++) { - put_name( Task_name[taskSwitchLog[i].taskIndex], FALSE ); - print_time( "- ", &taskSwitchLog[i].when, "\n" ); - } -} - -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_time; - rtems_unsigned32 end_time; - - 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_time ); - directive_failed( status, "rtems_clock_get" ); - - puts( "TA1 - killing time" ); - - for ( ; ; ) { - status = rtems_clock_get( RTEMS_CLOCK_GET_SECONDS_SINCE_EPOCH, &end_time ); - directive_failed( status, "rtems_clock_get" ); - - if ( end_time > (start_time + 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 ( !testsFinished ); - showTaskSwitches (); - puts( "*** END OF TEST 4 ***" ); - rtems_test_exit (0); - } - } -} diff --git a/testsuites/sptests/sp04/task2.c b/testsuites/sptests/sp04/task2.c deleted file mode 100644 index 5dbdda331d..0000000000 --- a/testsuites/sptests/sp04/task2.c +++ /dev/null @@ -1,28 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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 deleted file mode 100644 index 829f52820f..0000000000 --- a/testsuites/sptests/sp04/task3.c +++ /dev/null @@ -1,28 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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 deleted file mode 100644 index 689dd623d3..0000000000 --- a/testsuites/sptests/sp04/tswitch.c +++ /dev/null @@ -1,62 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -struct taskSwitchLog taskSwitchLog[1000]; -int taskSwitchLogIndex; -volatile int testsFinished; - -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 ) - task_number( Task_id[1] ) + 1; - - switch( index ) { - case 1: - case 2: - case 3: - Run_count[ index ] += 1; - - status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time ); - directive_failed_with_level( status, "rtems_clock_get", 1 ); - - if (taskSwitchLogIndex < (sizeof taskSwitchLog / sizeof taskSwitchLog[0])) { - taskSwitchLog[taskSwitchLogIndex].taskIndex = index; - taskSwitchLog[taskSwitchLogIndex].when = time; - taskSwitchLogIndex++; - } - if ( time.second >= 16 ) - testsFinished = 1; - break; - - case 0: - default: - break; - } -} diff --git a/testsuites/sptests/sp05/.cvsignore b/testsuites/sptests/sp05/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/sptests/sp05/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/sptests/sp05/Makefile.am b/testsuites/sptests/sp05/Makefile.am deleted file mode 100644 index 2f1eeedcda..0000000000 --- a/testsuites/sptests/sp05/Makefile.am +++ /dev/null @@ -1,38 +0,0 @@ -## -## $Id$ -## - - -TEST = sp05 - -MANAGERS = io - -C_FILES = init.c task1.c task2.c task3.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/sptests.am - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/sptests/sp05/init.c b/testsuites/sptests/sp05/init.c deleted file mode 100644 index 8d84d253f6..0000000000 --- a/testsuites/sptests/sp05/init.c +++ /dev/null @@ -1,80 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.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, - RTEMS_MINIMUM_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, - RTEMS_MINIMUM_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, - RTEMS_MINIMUM_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, 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 deleted file mode 100644 index e13f88ffd7..0000000000 --- a/testsuites/sptests/sp05/sp05.doc +++ /dev/null @@ -1,25 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - -This file describes the directives and concepts tested by this test set. - -test set name: 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 deleted file mode 100644 index 40afb2d4b2..0000000000 --- a/testsuites/sptests/sp05/sp05.scn +++ /dev/null @@ -1,47 +0,0 @@ -*** 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 deleted file mode 100644 index 5b1cca7d5c..0000000000 --- a/testsuites/sptests/sp05/system.h +++ /dev/null @@ -1,53 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_task Task_1( - rtems_task_argument argument -); - -rtems_task Task_2( - rtems_task_argument argument -); - -rtems_task Task_3( - rtems_task_argument argument -); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_TICKS_PER_TIMESLICE 100 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE -#define CONFIGURE_MAXIMUM_TASKS 4 - -#include - -/* global variables */ - -TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */ - -/* end of include file */ diff --git a/testsuites/sptests/sp05/task1.c b/testsuites/sptests/sp05/task1.c deleted file mode 100644 index 60c562fd25..0000000000 --- a/testsuites/sptests/sp05/task1.c +++ /dev/null @@ -1,77 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/sptests/sp05/task2.c b/testsuites/sptests/sp05/task2.c deleted file mode 100644 index 40e110693b..0000000000 --- a/testsuites/sptests/sp05/task2.c +++ /dev/null @@ -1,38 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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 deleted file mode 100644 index 7d1163e5de..0000000000 --- a/testsuites/sptests/sp05/task3.c +++ /dev/null @@ -1,38 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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/.cvsignore b/testsuites/sptests/sp06/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/sptests/sp06/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/sptests/sp06/Makefile.am b/testsuites/sptests/sp06/Makefile.am deleted file mode 100644 index 4de47ccc5d..0000000000 --- a/testsuites/sptests/sp06/Makefile.am +++ /dev/null @@ -1,38 +0,0 @@ -## -## $Id$ -## - - -TEST = sp06 - -MANAGERS = io - -C_FILES = init.c task1.c task2.c task3.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/sptests.am - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/sptests/sp06/init.c b/testsuites/sptests/sp06/init.c deleted file mode 100644 index 4c7b858584..0000000000 --- a/testsuites/sptests/sp06/init.c +++ /dev/null @@ -1,86 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.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, - RTEMS_MINIMUM_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, - RTEMS_MINIMUM_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 ], - 10, - RTEMS_MINIMUM_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, 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 deleted file mode 100644 index 2e2f59996a..0000000000 --- a/testsuites/sptests/sp06/sp06.doc +++ /dev/null @@ -1,25 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - -This file describes the directives and concepts tested by this test set. - -test set name: 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 deleted file mode 100644 index 64f6489dc8..0000000000 --- a/testsuites/sptests/sp06/sp06.scn +++ /dev/null @@ -1,40 +0,0 @@ -*** 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 deleted file mode 100644 index a397754d5f..0000000000 --- a/testsuites/sptests/sp06/system.h +++ /dev/null @@ -1,56 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_task Task_1( - rtems_task_argument argument -); - -rtems_task Task_2( - rtems_task_argument argument -); - -rtems_task Task_3( - rtems_task_argument argument -); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_TICKS_PER_TIMESLICE 100 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE -#define CONFIGURE_MAXIMUM_TASKS 4 - -#include - -/* global variables */ - -TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */ - -TEST_EXTERN rtems_task_argument Argument; /* generic task argument */ -TEST_EXTERN rtems_task_argument Restart_argument; /* task 1 restart argument */ - -/* end of include file */ diff --git a/testsuites/sptests/sp06/task1.c b/testsuites/sptests/sp06/task1.c deleted file mode 100644 index 14ad40d86d..0000000000 --- a/testsuites/sptests/sp06/task1.c +++ /dev/null @@ -1,60 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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 ***" ); - rtems_test_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 deleted file mode 100644 index da3f7ff70d..0000000000 --- a/testsuites/sptests/sp06/task2.c +++ /dev/null @@ -1,39 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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 deleted file mode 100644 index 677dec4404..0000000000 --- a/testsuites/sptests/sp06/task3.c +++ /dev/null @@ -1,31 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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/.cvsignore b/testsuites/sptests/sp07/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/sptests/sp07/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/sptests/sp07/Makefile.am b/testsuites/sptests/sp07/Makefile.am deleted file mode 100644 index ca2c9225c2..0000000000 --- a/testsuites/sptests/sp07/Makefile.am +++ /dev/null @@ -1,39 +0,0 @@ -## -## $Id$ -## - - -TEST = sp07 - -MANAGERS = io - -C_FILES = init.c task1.c task2.c task3.c task4.c taskexit.c tcreate.c \ - tdelete.c trestart.c tstart.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/sptests.am - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/sptests/sp07/init.c b/testsuites/sptests/sp07/init.c deleted file mode 100644 index b45a7dc228..0000000000 --- a/testsuites/sptests/sp07/init.c +++ /dev/null @@ -1,127 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.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, - RTEMS_MINIMUM_STACK_SIZE * 2, - 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, - RTEMS_MINIMUM_STACK_SIZE * 2, - 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, - RTEMS_MINIMUM_STACK_SIZE * 2, - 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, - RTEMS_MINIMUM_STACK_SIZE * 2, - 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 deleted file mode 100644 index 6b2a162f4d..0000000000 --- a/testsuites/sptests/sp07/sp07.doc +++ /dev/null @@ -1,36 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - -This file describes the directives and concepts tested by this test set. - -test set name: 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 deleted file mode 100644 index 1f6de2d93d..0000000000 --- a/testsuites/sptests/sp07/sp07.scn +++ /dev/null @@ -1,33 +0,0 @@ -*** 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 - -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 deleted file mode 100644 index d739d70cef..0000000000 --- a/testsuites/sptests/sp07/system.h +++ /dev/null @@ -1,87 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_task Task_1( - rtems_task_argument argument -); - -rtems_task Task_2( - rtems_task_argument argument -); - -rtems_task Task_3( - rtems_task_argument argument -); - -rtems_task Task_4( - rtems_task_argument argument -); - -rtems_boolean Task_create_extension( - rtems_tcb *unused, - rtems_tcb *created_task -); - -rtems_extension Task_delete_extension( - rtems_tcb *running_task, - rtems_tcb *deleted_task -); - -rtems_extension Task_restart_extension( - rtems_tcb *unused, - rtems_tcb *restarted_task -); - -rtems_extension Task_start_extension( - rtems_tcb *unused, - rtems_tcb *started_task -); - -rtems_extension Task_exit_extension( - rtems_tcb *running_task -); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_USER_EXTENSIONS 1 -#define CONFIGURE_TICKS_PER_TIMESLICE 100 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_EXTRA_TASK_STACKS (4 * RTEMS_MINIMUM_STACK_SIZE) -#define CONFIGURE_MAXIMUM_TASKS 5 - -#include - -/* global variables */ - -TEST_EXTERN rtems_id Task_id[ 5 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 5 ]; /* array of task names */ - -TEST_EXTERN rtems_id Extension_id[ 4 ]; -TEST_EXTERN rtems_name Extension_name[ 4 ]; /* array of task names */ - -/* end of include file */ diff --git a/testsuites/sptests/sp07/task1.c b/testsuites/sptests/sp07/task1.c deleted file mode 100644 index 858ee4b36a..0000000000 --- a/testsuites/sptests/sp07/task1.c +++ /dev/null @@ -1,84 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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; - - rtems_test_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 deleted file mode 100644 index 65869cc5ae..0000000000 --- a/testsuites/sptests/sp07/task2.c +++ /dev/null @@ -1,77 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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 deleted file mode 100644 index f39eee5258..0000000000 --- a/testsuites/sptests/sp07/task3.c +++ /dev/null @@ -1,33 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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 deleted file mode 100644 index 17ff1c28be..0000000000 --- a/testsuites/sptests/sp07/task4.c +++ /dev/null @@ -1,29 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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 deleted file mode 100644 index e6a6ad0c00..0000000000 --- a/testsuites/sptests/sp07/taskexit.c +++ /dev/null @@ -1,32 +0,0 @@ -/* Task_exit_extension - * - * This routine is the task exitted user extension. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/sptests/sp07/tcreate.c b/testsuites/sptests/sp07/tcreate.c deleted file mode 100644 index 27a5ac4ee1..0000000000 --- a/testsuites/sptests/sp07/tcreate.c +++ /dev/null @@ -1,34 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -rtems_boolean 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." ); - } - return TRUE; -} diff --git a/testsuites/sptests/sp07/tdelete.c b/testsuites/sptests/sp07/tdelete.c deleted file mode 100644 index b877f7e499..0000000000 --- a/testsuites/sptests/sp07/tdelete.c +++ /dev/null @@ -1,36 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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 deleted file mode 100644 index dcd5d15f72..0000000000 --- a/testsuites/sptests/sp07/trestart.c +++ /dev/null @@ -1,33 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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 deleted file mode 100644 index 0aeed5b81f..0000000000 --- a/testsuites/sptests/sp07/tstart.c +++ /dev/null @@ -1,33 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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/.cvsignore b/testsuites/sptests/sp08/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/sptests/sp08/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/sptests/sp08/Makefile.am b/testsuites/sptests/sp08/Makefile.am deleted file mode 100644 index 007a571df1..0000000000 --- a/testsuites/sptests/sp08/Makefile.am +++ /dev/null @@ -1,38 +0,0 @@ -## -## $Id$ -## - - -TEST = sp08 - -MANAGERS = io - -C_FILES = init.c task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/sptests.am - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/sptests/sp08/init.c b/testsuites/sptests/sp08/init.c deleted file mode 100644 index 35fc42c444..0000000000 --- a/testsuites/sptests/sp08/init.c +++ /dev/null @@ -1,52 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.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, - RTEMS_MINIMUM_STACK_SIZE * 2, - 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 deleted file mode 100644 index 325fba0afd..0000000000 --- a/testsuites/sptests/sp08/sp08.doc +++ /dev/null @@ -1,25 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - -This file describes the directives and concepts tested by this test set. - -test set name: 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 deleted file mode 100644 index d85ccc384f..0000000000 --- a/testsuites/sptests/sp08/sp08.scn +++ /dev/null @@ -1,22 +0,0 @@ -*** 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 deleted file mode 100644 index 5bb3407dac..0000000000 --- a/testsuites/sptests/sp08/system.h +++ /dev/null @@ -1,50 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_task Task_1( - rtems_task_argument argument -); - -#define put_mode( _comment, _output_mode ) \ - printf( "%s %08x\n", _comment, _output_mode ); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_TICKS_PER_TIMESLICE 100 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_EXTRA_TASK_STACKS (1 * RTEMS_MINIMUM_STACK_SIZE) -#define CONFIGURE_MAXIMUM_TASKS 2 - -#include - -/* global variables */ - -TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */ - -/* end of include file */ diff --git a/testsuites/sptests/sp08/task1.c b/testsuites/sptests/sp08/task1.c deleted file mode 100644 index 3729568647..0000000000 --- a/testsuites/sptests/sp08/task1.c +++ /dev/null @@ -1,255 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/sptests/sp09/.cvsignore b/testsuites/sptests/sp09/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/sptests/sp09/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/sptests/sp09/Makefile.am b/testsuites/sptests/sp09/Makefile.am deleted file mode 100644 index c5efd40ca5..0000000000 --- a/testsuites/sptests/sp09/Makefile.am +++ /dev/null @@ -1,42 +0,0 @@ -## -## $Id$ -## - - -TEST = sp09 - -MANAGERS = io message dual_ported_memory event multi_processor region \ - semaphore signal rate_monotonic timer partition - -C_FILES = init.c delay.c isr.c screen01.c screen02.c screen03.c screen04.c \ - screen05.c screen06.c screen07.c screen08.c screen09.c screen10.c \ - screen11.c screen12.c screen13.c screen14.c task1.c task2.c task3.c \ - task4.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/sptests.am - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/sptests/sp09/delay.c b/testsuites/sptests/sp09/delay.c deleted file mode 100644 index 7a6d9cb245..0000000000 --- a/testsuites/sptests/sp09/delay.c +++ /dev/null @@ -1,27 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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 deleted file mode 100644 index fe95de61da..0000000000 --- a/testsuites/sptests/sp09/init.c +++ /dev/null @@ -1,119 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.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, - RTEMS_MINIMUM_STACK_SIZE, - 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, - RTEMS_MINIMUM_STACK_SIZE * 3, - 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 deleted file mode 100644 index b3a213df09..0000000000 --- a/testsuites/sptests/sp09/isr.c +++ /dev/null @@ -1,26 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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 deleted file mode 100644 index 96470b06c5..0000000000 --- a/testsuites/sptests/sp09/screen01.c +++ /dev/null @@ -1,179 +0,0 @@ -/* Screen1 - * - * This routine generates error screen 1 for test 9. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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, ¬epad_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, ¬epad_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" ); - - /* - * This one case is different if MP is enabled/disabled. - */ - - status = rtems_task_ident( 100, 2, &Junk_id ); -#if defined(RTEMS_MULTIPROCESSING) - fatal_directive_status( - status, - RTEMS_INVALID_NODE, - "rtems_task_ident with illegal node" - ); -#else - fatal_directive_status( - status, - RTEMS_INVALID_NAME, - "rtems_task_ident with illegal node" - ); -#endif - 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 deleted file mode 100644 index 8654d93f95..0000000000 --- a/testsuites/sptests/sp09/screen02.c +++ /dev/null @@ -1,191 +0,0 @@ -/* Screen2 - * - * This routine generates error screen 2 for test 9. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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 deleted file mode 100644 index ed35ad7574..0000000000 --- a/testsuites/sptests/sp09/screen03.c +++ /dev/null @@ -1,217 +0,0 @@ -/* Screen3 - * - * This routine generates error screen 3 for test 9. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -void Screen3() -{ - rtems_name task_name; - rtems_status_code status; - - task_name = 1; - status = rtems_task_create( - 0, - 1, - RTEMS_MINIMUM_STACK_SIZE, - 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" ); - - /* - * If the bsp provides its own stack allocator, then - * skip the test that tries to allocate a stack that is too big. - */ - - if (rtems_cpu_configuration_get_stack_allocate_hook()) { - puts( "TA1 - rtems_task_create - stack size - RTEMS_UNSATISFIED -- SKIPPED" ); - } else { - status = rtems_task_create( - task_name, - 1, - rtems_configuration_get_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, - RTEMS_MINIMUM_STACK_SIZE, - 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, - RTEMS_MINIMUM_STACK_SIZE, - 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, - RTEMS_MINIMUM_STACK_SIZE, - 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, - RTEMS_MINIMUM_STACK_SIZE, - 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, - RTEMS_MINIMUM_STACK_SIZE, - 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, - RTEMS_MINIMUM_STACK_SIZE, - 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, - RTEMS_MINIMUM_STACK_SIZE, - 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, - RTEMS_MINIMUM_STACK_SIZE, - 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, - RTEMS_MINIMUM_STACK_SIZE, - 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, - RTEMS_MINIMUM_STACK_SIZE, - 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" ); - - /* - * The check for an object being global is only made if - * multiprocessing is enabled. - */ - -#if defined(RTEMS_MULTIPROCESSING) - status = rtems_task_create( - task_name, - 4, - RTEMS_MINIMUM_STACK_SIZE, - 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" - ); -#endif - puts( "TA1 - rtems_task_create - RTEMS_MP_NOT_CONFIGURED" ); -} diff --git a/testsuites/sptests/sp09/screen04.c b/testsuites/sptests/sp09/screen04.c deleted file mode 100644 index fafd528fbc..0000000000 --- a/testsuites/sptests/sp09/screen04.c +++ /dev/null @@ -1,84 +0,0 @@ -/* Screen4 - * - * This routine generates error screen 4 for test 9. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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 deleted file mode 100644 index deb990c42d..0000000000 --- a/testsuites/sptests/sp09/screen05.c +++ /dev/null @@ -1,170 +0,0 @@ -/* Screen5 - * - * This routine generates error screen 5 for test 9. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -void Screen5() -{ - rtems_status_code status; - - status = rtems_semaphore_create( - 0, - 1, - RTEMS_DEFAULT_ATTRIBUTES, - RTEMS_NO_PRIORITY, - &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, - RTEMS_NO_PRIORITY, - &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 | RTEMS_PRIORITY | RTEMS_INHERIT_PRIORITY, - RTEMS_NO_PRIORITY, - &Semaphore_id[ 2 ] - ); - directive_failed( status, "rtems_semaphore_create" ); - puts( "TA1 - rtems_semaphore_create - 2 - RTEMS_SUCCESSFUL" ); - - do { - status = rtems_semaphore_create( - Semaphore_name[ 3 ], - 1, - RTEMS_DEFAULT_ATTRIBUTES, - RTEMS_NO_PRIORITY, - &Junk_id - ); - } while (status == RTEMS_SUCCESSFUL); - - 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, - RTEMS_NO_PRIORITY, - &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, - RTEMS_NO_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, - RTEMS_NO_PRIORITY, - &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" ); - - /* - * The check for an object being global is only made if - * multiprocessing is enabled. - */ - -#if defined(RTEMS_MULTIPROCESSING) - status = rtems_semaphore_create( - Semaphore_name[ 3 ], - 1, - RTEMS_GLOBAL, - RTEMS_NO_PRIORITY, - &Junk_id - ); - fatal_directive_status( - status, - RTEMS_MP_NOT_CONFIGURED, - "rtems_semaphore_create of mp not configured" - ); -#endif - 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 deleted file mode 100644 index 90f522acde..0000000000 --- a/testsuites/sptests/sp09/screen06.c +++ /dev/null @@ -1,124 +0,0 @@ -/* Screen6 - * - * This routine generates error screen 6 for test 9. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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 deleted file mode 100644 index 737ba70a1f..0000000000 --- a/testsuites/sptests/sp09/screen07.c +++ /dev/null @@ -1,208 +0,0 @@ -/* Screen7 - * - * This routine generates error screen 7 for test 9. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -#define MESSAGE_SIZE (sizeof(long) * 4) - -void Screen7() -{ - long buffer[ 4 ]; - rtems_unsigned32 size; - rtems_unsigned32 count; - rtems_status_code status; - - status = rtems_message_queue_broadcast( 100, buffer, MESSAGE_SIZE, &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, - MESSAGE_SIZE, - 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" ); - - /* - * The check for an object being global is only made if - * multiprocessing is enabled. - */ - -#if defined(RTEMS_MULTIPROCESSING) - status = rtems_message_queue_create( - Queue_name[ 1 ], - 1, - MESSAGE_SIZE, - RTEMS_GLOBAL, - &Junk_id - ); - fatal_directive_status( - status, - RTEMS_MP_NOT_CONFIGURED, - "rtems_message_queue_create of mp not configured" - ); -#endif - puts( "TA1 - rtems_message_queue_create - Q 1 - RTEMS_MP_NOT_CONFIGURED" ); - - status = rtems_message_queue_create( - Queue_name[ 1 ], - 2, - MESSAGE_SIZE, - RTEMS_DEFAULT_ATTRIBUTES, - &Queue_id[ 1 ] - ); - directive_failed( status, "rtems_message_queue_create successful" ); - puts( - "TA1 - rtems_message_queue_create - Q 1 - 2 DEEP - RTEMS_SUCCESSFUL" - ); - - status = rtems_message_queue_create( - Queue_name[ 2 ], - 1, - MESSAGE_SIZE, - 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_get_number_pending( 100, &count ); - fatal_directive_status( - status, - RTEMS_INVALID_ID, - "rtems_message_queue_get_number_pending with illegal id" - ); - puts( "TA1 - rtems_message_queue_get_number_pending - RTEMS_INVALID_ID" ); - - 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, - &size, - 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, - &size, - 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, - &size, - 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, buffer, MESSAGE_SIZE ); - 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 ], buffer, MESSAGE_SIZE ); - 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 ], buffer, MESSAGE_SIZE ); - 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 ], buffer, MESSAGE_SIZE ); - 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 deleted file mode 100644 index 76af9e8bb9..0000000000 --- a/testsuites/sptests/sp09/screen08.c +++ /dev/null @@ -1,129 +0,0 @@ -/* Screen8 - * - * This routine generates error screen 8 for test 9. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -#define MESSAGE_SIZE (sizeof(long) * 4) - -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, - MESSAGE_SIZE, - RTEMS_DEFAULT_ATTRIBUTES, - &Queue_id[ 1 ] - ); - directive_failed( status, "rtems_message_queue_create successful" ); - puts( - "TA1 - rtems_message_queue_create - Q 1 - 2 DEEP - RTEMS_SUCCESSFUL" - ); - - status = rtems_message_queue_send( Queue_id[ 1 ], buffer, MESSAGE_SIZE ); - 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 ], buffer, MESSAGE_SIZE ); - 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 ], buffer, MESSAGE_SIZE ); - 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, - MESSAGE_SIZE, - RTEMS_DEFAULT_ATTRIBUTES, - &Queue_id[ 1 ] - ); - directive_failed( status, "rtems_message_queue_create successful" ); - puts( - "TA1 - rtems_message_queue_create - Q 1 - 3 DEEP - RTEMS_SUCCESSFUL" - ); - - status = rtems_message_queue_send( Queue_id[ 1 ], buffer, MESSAGE_SIZE ); - 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 ], buffer, MESSAGE_SIZE ); - 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 ], buffer, MESSAGE_SIZE ); - directive_failed( status, "rtems_message_queue_send successful" ); - puts( "TA1 - rtems_message_queue_send - BUFFER 3 TO Q 1 - RTEMS_SUCCESSFUL" ); - - status = rtems_message_queue_send( Queue_id[ 1 ], buffer, MESSAGE_SIZE ); - fatal_directive_status( - status, - RTEMS_TOO_MANY, - "rtems_message_queue_send too many to limited queue" - ); - puts( - "TA1 - rtems_message_queue_send - BUFFER 4 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, - MESSAGE_SIZE, - RTEMS_DEFAULT_ATTRIBUTES, - &Queue_id[ 1 ] - ); - directive_failed( status, "rtems_message_queue_create successful" ); - puts( - "TA1 - rtems_message_queue_create - Q 1 - 3 DEEP - 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 deleted file mode 100644 index 0060b84caa..0000000000 --- a/testsuites/sptests/sp09/screen09.c +++ /dev/null @@ -1,163 +0,0 @@ -/* Screen9 - * - * This routine generates error screen 9 for test 9. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -void Screen9() -{ - void *converted; - rtems_status_code status; - rtems_isr_entry old_service_routine; - - status = rtems_interrupt_catch( - Service_routine, - ISR_INTERRUPT_MAXIMUM_VECTOR_NUMBER + 10, - &old_service_routine - ); - fatal_directive_status( - status, - RTEMS_INVALID_NUMBER, - "rtems_interrupt_catch with invalid vector" - ); - puts( "TA1 - rtems_interrupt_catch - RTEMS_INVALID_NUMBER" ); - -#if defined(_C3x) || defined(_C4x) - puts( "TA1 - rtems_interrupt_catch - bad handler RTEMS_INVALID_ADDRESS -- SKIPPED" ); -#else - 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 - bad handler RTEMS_INVALID_ADDRESS" ); -#endif - -#if defined(_C3x) || defined(_C4x) - puts( "TA1 - rtems_interrupt_catch - old isr RTEMS_INVALID_ADDRESS - SKIPPED" ); -#else - status = rtems_interrupt_catch( Service_routine, 3, NULL ); - fatal_directive_status( - status, - RTEMS_INVALID_ADDRESS, - "rtems_interrupt_catch with invalid old isr pointer" - ); - puts( "TA1 - rtems_interrupt_catch - old isr RTEMS_INVALID_ADDRESS" ); -#endif - - 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" ); - -#if defined(_C3x) || defined(_C4x) - puts( "TA1 - rtems_port_create - RTEMS_INVALID_ADDRESS - SKIPPED" ); -#else - 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" ); -#endif - - 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 deleted file mode 100644 index f51ad2ebf9..0000000000 --- a/testsuites/sptests/sp09/screen10.c +++ /dev/null @@ -1,163 +0,0 @@ -/* Screen10 - * - * This routine generates error screen 10 for test 9. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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 deleted file mode 100644 index 373ad560b9..0000000000 --- a/testsuites/sptests/sp09/screen11.c +++ /dev/null @@ -1,264 +0,0 @@ -/* Screen11 - * - * This routine generates error screen 11 for test 9. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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" - ); - - /* - * The check for an object being global is only made if - * multiprocessing is enabled. - */ - -#if defined(RTEMS_MULTIPROCESSING) - 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" - ); -#endif - puts( "TA1 - rtems_partition_create - RTEMS_MP_NOT_CONFIGURED" ); - -#if defined(_C3x) || defined(_C4x) - puts( "TA1 - rtems_partition_create - RTEMS_INVALID_ADDRESS - SKIPPED" ); -#else - 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" ); -#endif - -#if defined(_C3x) || defined(_C4x) - puts( "TA1 - rtems_partition_create - RTEMS_INVALID_SIZE - SKIPPED" ); -#else - 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" ); -#endif - - 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 deleted file mode 100644 index 1c3a6790db..0000000000 --- a/testsuites/sptests/sp09/screen12.c +++ /dev/null @@ -1,344 +0,0 @@ -/* Screen12 - * - * This routine generates error screen 12 for test 9. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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, - 0x40, - 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" ); - -#if defined(_C3x) || defined(_C4x) - puts( "TA1 - rtems_region_create - RTEMS_INVALID_ADDRESS - SKIPPED" ); -#else - status = rtems_region_create( - Region_name[ 1 ], - Region_bad_area, - 0x40, - 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" ); -#endif - -#if defined(_C3x) || defined(_C4x) - puts( "TA1 - rtems_region_create - RTEMS_INVALID_SIZE - SKIPPED" ); -#else - status = rtems_region_create( - Region_name[ 1 ], - Region_good_area, - 0x40, - 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" ); -#endif - - status = rtems_region_create( - Region_name[ 1 ], - &Region_good_area[ REGION_START_OFFSET ], - REGION_LENGTH, - 0x40, - 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, - REGION_LENGTH, - 0x40, - 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, - 0x40, - 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 ], - REGION_LENGTH / 2, - 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 ); - -#if 0 - - 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; - -#else - offset = 0; - good_front_flag = 0; - good_back_flag = 0; - puts( "TA1 - rtems_region_return_segment - RTEMS_INVALID_ADDRESS - SKIPPED" ); - puts( "TA1 - rtems_region_return_segment - RTEMS_INVALID_ADDRESS - SKIPPED" ); -#endif - - 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 deleted file mode 100644 index 6e9584d279..0000000000 --- a/testsuites/sptests/sp09/screen13.c +++ /dev/null @@ -1,113 +0,0 @@ -/* Screen13 - * - * This routine generates error screen 13 for test 9. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -void Screen13() -{ - rtems_time_of_day time; - rtems_status_code status; - - status = rtems_io_close( 0xffff, 0x0000, NULL); - 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); - 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); - 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); - 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); - 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); - 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 deleted file mode 100644 index 20b166314b..0000000000 --- a/testsuites/sptests/sp09/screen14.c +++ /dev/null @@ -1,245 +0,0 @@ -/* Screen14 - * - * This routine generates error screen 14 for test 9. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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_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" - ); - -/* timer server interface routines */ - - status = rtems_timer_server_fire_after( 0, 5, NULL, NULL ); - fatal_directive_status( - status, - RTEMS_INCORRECT_STATE, - "rtems_timer_server_fire_after incorrect state" - ); - puts( "TA1 - rtems_timer_server_fire_after - RTEMS_INCORRECT_STATE" ); - - status = rtems_timer_server_fire_when( 0, &time, NULL, NULL ); - fatal_directive_status( - status, - RTEMS_INCORRECT_STATE, - "rtems_timer_server_fire_when incorrect state" - ); - puts( "TA1 - rtems_timer_server_fire_when - RTEMS_INCORRECT_STATE" ); - - status = - rtems_timer_initiate_server( 0, 0, 0 ); - fatal_directive_status( - status, - RTEMS_INVALID_PRIORITY, - "rtems_timer_initiate_server invalid priority" - ); - puts( "TA1 - rtems_timer_initiate_server - RTEMS_INVALID_PRIORITY" ); - - status = - rtems_timer_initiate_server( RTEMS_TIMER_SERVER_DEFAULT_PRIORITY, 0, 0 ); - directive_failed( status, "rtems_timer_initiate_server" ); - puts( "TA1 - rtems_timer_initiate_server" ); - - status = rtems_timer_server_fire_after( - 0x010100, - 5 * TICKS_PER_SECOND, - Delayed_routine, - NULL - ); - fatal_directive_status( - status, - RTEMS_INVALID_ID, - "rtems_timer_server_fire_after illegal id" - ); - puts( "TA1 - rtems_timer_server_fire_after - RTEMS_INVALID_ID" ); - - build_time( &time, 12, 31, 1994, 9, 0, 0, 0 ); - status = rtems_timer_server_fire_when( 0x010100, &time, Delayed_routine, NULL ); - fatal_directive_status( - status, - RTEMS_INVALID_ID, - "rtems_timer_server_fire_when with illegal id" - ); - puts( "TA1 - rtems_timer_server_fire_when - RTEMS_INVALID_ID" ); - - status = rtems_timer_server_fire_after( Timer_id[ 1 ], 0, Delayed_routine, NULL ); - fatal_directive_status( - status, - RTEMS_INVALID_NUMBER, - "rtems_timer_server_fire_after with 0 ticks" - ); - puts( "TA1 - rtems_timer_server_fire_after - RTEMS_INVALID_NUMBER" ); - - build_time( &time, 2, 5, 1987, 8, 30, 45, 0 ); - status = rtems_timer_server_fire_when( Timer_id[ 1 ], &time, Delayed_routine, NULL ); - fatal_directive_status( - status, - RTEMS_INVALID_CLOCK, - "rtems_timer_server_fire_when with illegal time" - ); - print_time( - "TA1 - rtems_timer_server_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_server_fire_when( Timer_id[ 1 ], &time, Delayed_routine, NULL ); - fatal_directive_status( - status, - RTEMS_INVALID_CLOCK, - "rtems_timer_server_fire_when before current time" - ); - print_time( - "TA1 - rtems_timer_server_fire_when - ", - &time, - " - before RTEMS_INVALID_CLOCK\n" - ); -} diff --git a/testsuites/sptests/sp09/sp09.doc b/testsuites/sptests/sp09/sp09.doc deleted file mode 100644 index 6737d3c8e6..0000000000 --- a/testsuites/sptests/sp09/sp09.doc +++ /dev/null @@ -1,35 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - -This file describes the directives and concepts tested by this test set. - -test set name: 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 deleted file mode 100644 index 1f00519188..0000000000 --- a/testsuites/sptests/sp09/sp09.scn +++ /dev/null @@ -1,261 +0,0 @@ -*** 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 - -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 - -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 - -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 - -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 - -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 - -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 - 2 DEEP - 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_get_number_pending - RTEMS_INVALID_ID -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 - -TA1 - rtems_message_queue_delete - Q 1 - RTEMS_SUCCESSFUL -TA1 - rtems_message_queue_create - Q 1 - 2 DEEP - 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 - 3 DEEP - 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_SUCCESSFUL -TA1 - rtems_message_queue_send - BUFFER 4 TO Q 1 - RTEMS_TOO_MANY -TA1 - rtems_message_queue_delete - Q 1 - RTEMS_SUCCESSFUL -TA1 - rtems_message_queue_create - Q 1 - 3 DEEP - 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 - -TA1 - rtems_interrupt_catch - RTEMS_INVALID_NUMBER -TA1 - rtems_interrupt_catch - bad handler RTEMS_INVALID_ADDRESS -TA1 - rtems_interrupt_catch - old isr 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 - -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 - -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 - -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 - SKIPPED -TA1 - rtems_region_return_segment - RTEMS_INVALID_ADDRESS - SKIPPED -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 - -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 - -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_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:01 01/01/1992 -TA1 - rtems_timer_fire_when - 08:30:45 02/05/1990 - before RTEMS_INVALID_CLOCK -TA1 - rtems_timer_server_fire_after - RTEMS_INCORRECT_STATE -TA1 - rtems_timer_server_fire_when - RTEMS_INCORRECT_STATE -TA1 - rtems_timer_initiate_server - RTEMS_INVALID_PRIORITY -TA1 - rtems_timer_initiate_server -TA1 - rtems_timer_server_fire_after - RTEMS_INVALID_ID -TA1 - rtems_timer_server_fire_when - RTEMS_INVALID_ID -TA1 - rtems_timer_server_fire_after - RTEMS_INVALID_NUMBER -TA1 - rtems_timer_server_fire_when - 08:30:45 02/05/1987 - RTEMS_INVALID_CLOCK -TA1 - rtems_clock_get - 00:00:01 01/01/1992 -TA1 - rtems_timer_server_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 deleted file mode 100644 index b9f10eb1d5..0000000000 --- a/testsuites/sptests/sp09/system.h +++ /dev/null @@ -1,141 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_timer_service_routine Delayed_routine( - rtems_id ignored_id, - void *ignored_address -); - -rtems_task Task_1( - rtems_task_argument argument -); - -rtems_task Task_2( - rtems_task_argument argument -); - -rtems_task Task_3( - rtems_task_argument argument -); - -rtems_task Task_4( - rtems_task_argument argument -); - -rtems_isr Service_routine( - rtems_vector_number ignored -); - -rtems_timer_service_routine Io_during_interrupt( - rtems_id ignored -); - -void Screen1( void ); - -void Screen2( void ); - -void Screen3( void ); - -void Screen4( void ); - -void Screen5( void ); - -void Screen6( void ); - -void Screen7( void ); - -void Screen8( void ); - -void Screen9( void ); - -void Screen10( void ); - -void Screen11( void ); - -void Screen12( void ); - -void Screen13( void ); - -void Screen14( void ); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 10 -#define CONFIGURE_MAXIMUM_TIMERS 1 -#define CONFIGURE_MAXIMUM_SEMAPHORES 2 -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 -#define CONFIGURE_MAXIMUM_PARTITIONS 1 -#define CONFIGURE_MAXIMUM_REGIONS 1 -#define CONFIGURE_MAXIMUM_PERIODS 1 -#define CONFIGURE_MAXIMUM_USER_EXTENSIONS 0 -#define CONFIGURE_TICKS_PER_TIMESLICE 100 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_EXTRA_TASK_STACKS (2 * RTEMS_MINIMUM_STACK_SIZE) - -#include - -/* global variables */ - -TEST_EXTERN rtems_id Task_id[ 11 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 11 ]; /* array of task names */ - -TEST_EXTERN rtems_name Timer_name[ 2 ]; /* array of timer names */ -TEST_EXTERN rtems_id Timer_id[ 2 ]; /* array of timer ids */ - -TEST_EXTERN rtems_name Semaphore_name[ 4 ]; /* array of semaphore names */ -TEST_EXTERN rtems_id Semaphore_id[ 4 ]; /* array of semaphore ids */ - -TEST_EXTERN rtems_name Queue_name[ 3 ]; /* array of queue names */ -TEST_EXTERN rtems_id Queue_id[ 3 ]; /* array of queue ids */ - -TEST_EXTERN rtems_name Partition_name[ 2 ]; /* array of partition names */ -TEST_EXTERN rtems_id Partition_id[ 2 ]; /* array of partition ids */ - -TEST_EXTERN rtems_name Region_name[ 2 ]; /* array of region names */ -TEST_EXTERN rtems_id Region_id[ 2 ]; /* array of region ids */ - -TEST_EXTERN rtems_name Port_name[ 2 ]; /* array of port names */ -TEST_EXTERN rtems_id Port_id[ 2 ]; /* array of port ids */ - -TEST_EXTERN rtems_name Period_name[ 2 ]; /* array of period names */ -TEST_EXTERN rtems_id Period_id[ 2 ]; /* array of period ids */ - -TEST_EXTERN rtems_id Junk_id; /* id used to return errors */ - -#define Internal_port_area (void *) 0x00001000 -#define External_port_area (void *) 0x00002000 - -TEST_EXTERN rtems_unsigned8 Partition_good_area[256] CPU_STRUCTURE_ALIGNMENT; -#define Partition_bad_area (void *) 0x00000006 - -TEST_EXTERN rtems_unsigned32 Region_good_area[4096] CPU_STRUCTURE_ALIGNMENT; -#define Region_bad_area (void *) 0x00000006 -#define REGION_START_OFFSET 1024 -#define REGION_LENGTH 512 - -/* end of include file */ diff --git a/testsuites/sptests/sp09/task1.c b/testsuites/sptests/sp09/task1.c deleted file mode 100644 index 84247e2711..0000000000 --- a/testsuites/sptests/sp09/task1.c +++ /dev/null @@ -1,69 +0,0 @@ -/* Task_1 - * - * This task generates all possible errors for the RTEMS executive. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -rtems_task Task_1( - rtems_task_argument argument -) -{ - Screen1(); - rtems_test_pause_and_screen_number( 2 ); - - Screen2(); - rtems_test_pause_and_screen_number( 3 ); - - Screen3(); - rtems_test_pause_and_screen_number( 4 ); - - Screen4(); - rtems_test_pause_and_screen_number( 5 ); - - Screen5(); - rtems_test_pause_and_screen_number( 6 ); - - Screen6(); - rtems_test_pause_and_screen_number( 7 ); - - Screen7(); - rtems_test_pause_and_screen_number( 8 ); - - Screen8(); - rtems_test_pause_and_screen_number( 9 ); - - Screen9(); - rtems_test_pause_and_screen_number( 10 ); - - Screen10(); - rtems_test_pause_and_screen_number( 11 ); - - Screen11(); - rtems_test_pause_and_screen_number( 12 ); - - Screen12(); - rtems_test_pause_and_screen_number( 13 ); - - Screen13(); - rtems_test_pause_and_screen_number( 14 ); - - Screen14(); - - puts( "*** END OF TEST 9 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/sptests/sp09/task2.c b/testsuites/sptests/sp09/task2.c deleted file mode 100644 index 5f9a7205c7..0000000000 --- a/testsuites/sptests/sp09/task2.c +++ /dev/null @@ -1,47 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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 deleted file mode 100644 index 4c90d37134..0000000000 --- a/testsuites/sptests/sp09/task3.c +++ /dev/null @@ -1,52 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -rtems_task Task_3( - rtems_task_argument argument -) -{ - rtems_status_code status; - long buffer[ 4 ]; - rtems_unsigned32 size; - - puts( "TA3 - rtems_message_queue_receive - Q 1 - RTEMS_WAIT FOREVER" ); - status = rtems_message_queue_receive( - Queue_id[ 1 ], - (long (*)[4])buffer, - &size, - 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 deleted file mode 100644 index f5e254c9fe..0000000000 --- a/testsuites/sptests/sp09/task4.c +++ /dev/null @@ -1,49 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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/.cvsignore b/testsuites/sptests/sp11/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/sptests/sp11/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/sptests/sp11/Makefile.am b/testsuites/sptests/sp11/Makefile.am deleted file mode 100644 index 3bc437af15..0000000000 --- a/testsuites/sptests/sp11/Makefile.am +++ /dev/null @@ -1,38 +0,0 @@ -## -## $Id$ -## - - -TEST = sp11 - -MANAGERS = io event timer - -C_FILES = init.c task1.c task2.c timer.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/sptests.am - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/sptests/sp11/init.c b/testsuites/sptests/sp11/init.c deleted file mode 100644 index 55b60936fa..0000000000 --- a/testsuites/sptests/sp11/init.c +++ /dev/null @@ -1,91 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.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, - RTEMS_MINIMUM_STACK_SIZE * 2, - 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, - RTEMS_MINIMUM_STACK_SIZE * 2, - 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 deleted file mode 100644 index 57c09d5532..0000000000 --- a/testsuites/sptests/sp11/sp11.doc +++ /dev/null @@ -1,25 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - -This file describes the directives and concepts tested by this test set. - -test set name: 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 deleted file mode 100644 index db0469eb60..0000000000 --- a/testsuites/sptests/sp11/sp11.scn +++ /dev/null @@ -1,74 +0,0 @@ -*** 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 4 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 - -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_19 - RTEMS_NO_WAIT -TA2 - RTEMS_EVENT_19 received - eventout => 00080000 -TA2 - rtems_task_delete - deletes self -TA1 - RTEMS_EVENT_18 received - eventout => 00040000 -TA1 - rtems_clock_get - 08:15:05 02/12/1988 -TA1 - rtems_event_send - send RTEMS_EVENT_3 to self -TA1 - rtems_event_receive - RTEMS_EVENT_3 or RTEMS_EVENT_22 - NO_WAIT and ANY -TA1 - RTEMS_EVENT_3 received - eventout => 00000008 -TA1 - rtems_event_send - send RTEMS_EVENT_4 to self -TA1 - rtems_event_receive - RTEMS_EVENT_4 or RTEMS_EVENT_5 - forever and ANY -TA1 - RTEMS_EVENT_4 received - eventout => 00000010 - -TA1 - rtems_event_send - send RTEMS_EVENT_18 to self after 5 seconds -TA1 - rtems_timer_cancel - cancelling timer for event RTEMS_EVENT_18 -TA1 - rtems_event_send - send RTEMS_EVENT_8 to self after 60 seconds -TA1 - rtems_event_send - send RTEMS_EVENT_9 to self after 60 seconds -TA1 - rtems_event_send - send RTEMS_EVENT_10 to self after 60 seconds -TA1 - rtems_timer_cancel - cancelling timer for event RTEMS_EVENT_8 -TA1 - rtems_clock_set - 08:15:00 02/12/1988 -TA1 - rtems_event_send - send RTEMS_EVENT_1 every second -TA1 - RTEMS_EVENT_1 received - eventout => 00000002 - at 08:15:01 02/12/1988 -TA1 - RTEMS_EVENT_1 received - eventout => 00000002 - at 08:15:02 02/12/1988 -TA1 - RTEMS_EVENT_1 received - eventout => 00000002 - at 08:15:03 02/12/1988 -TA1 - rtems_timer_cancel - cancelling timer for event RTEMS_EVENT_1 - -TA1 - rtems_event_send - sending RTEMS_EVENT_11 to self in 1 day -TA1 - rtems_event_send - sending RTEMS_EVENT_11 to self in 1 day -TA1 - rtems_event_send - sending RTEMS_EVENT_11 to self in 2 days -TA1 - rtems_timer_cancel - cancelling RTEMS_EVENT_11 to self in 1 day -TA1 - rtems_timer_cancel - cancelling RTEMS_EVENT_11 to self in 2 days -TA1 - rtems_event_send - resending RTEMS_EVENT_11 to self in 2 days -TA1 - rtems_clock_set - 08:15:03 02/15/1988 -TA1 - rtems_event_receive - waiting forever on RTEMS_EVENT_11 -TA1 - RTEMS_EVENT_11 received - eventout => 00000800 - -TA1 - rtems_event_send/rtems_event_receive combination -TA1 - rtems_clock_set - 08:15:00 02/12/1988 -TA1 - rtems_event_receive all outstanding events -TA1 - rtems_event_send - sending RTEMS_EVENT_10 to self in 1 day -TA1 - rtems_event_send - sending RTEMS_EVENT_11 to self in 2 days -TA1 - rtems_clock_set - 07:15:00 02/12/1988 -TA1 - set time backwards -TA1 - no events received -TA1 - rtems_clock_set - 07:15:00 02/14/1988 -TA1 - set time forwards (leave a timer) -TA1 - RTEMS_EVENT_10 received -TA1 - rtems_event_send - sending RTEMS_EVENT_11 to self in 100 ticks -TA1 - rtems_event_send - sending RTEMS_EVENT_11 to self in 200 ticks -*** END OF TEST 11 *** diff --git a/testsuites/sptests/sp11/system.h b/testsuites/sptests/sp11/system.h deleted file mode 100644 index be3df1116a..0000000000 --- a/testsuites/sptests/sp11/system.h +++ /dev/null @@ -1,90 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_task Task_1( - rtems_task_argument argument -); - -rtems_task Task_2( - rtems_task_argument argument -); - -rtems_timer_service_routine TA1_send_18_to_self_5_seconds( - rtems_id ignored_id, - void *ignored_address -); - -rtems_timer_service_routine TA1_send_8_to_self_60_seconds( - rtems_id ignored_id, - void *ignored_address -); - -rtems_timer_service_routine TA1_send_9_to_self_60_seconds( - rtems_id ignored_id, - void *ignored_address -); - -rtems_timer_service_routine TA1_send_10_to_self( - rtems_id ignored_id, - void *ignored_address -); - -rtems_timer_service_routine TA1_send_1_to_self_every_second( - rtems_id ignored_id, - void *ignored_address -); - -rtems_timer_service_routine TA1_send_11_to_self( - rtems_id ignored_id, - void *ignored_address -); - -rtems_timer_service_routine TA2_send_10_to_self( - rtems_id ignored_id, - void *ignored_address -); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 3 -#define CONFIGURE_MAXIMUM_TIMERS 6 -#define CONFIGURE_TICKS_PER_TIMESLICE 100 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_EXTRA_TASK_STACKS (2 * RTEMS_MINIMUM_STACK_SIZE) - -#include - -/* global variables */ - -TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */ - -TEST_EXTERN rtems_id Timer_id[ 7 ]; /* array of timer ids */ -TEST_EXTERN rtems_name Timer_name[ 7 ]; /* array of timer names */ - -/* end of include file */ diff --git a/testsuites/sptests/sp11/task1.c b/testsuites/sptests/sp11/task1.c deleted file mode 100644 index 8ccd73607a..0000000000 --- a/testsuites/sptests/sp11/task1.c +++ /dev/null @@ -1,409 +0,0 @@ -/* Task_1 - * - * This routine serves as a test task. It verifies the event maager. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -rtems_task Task_1( - rtems_task_argument argument -) -{ - rtems_event_set eventout; - rtems_time_of_day time; - rtems_status_code status; - rtems_unsigned32 index; - - puts( "TA1 - rtems_event_send - send RTEMS_EVENT_16 to TA2" ); - status = rtems_event_send( Task_id[ 2 ], RTEMS_EVENT_16 ); - directive_failed( status, "rtems_event_send" ); - - puts( - "TA1 - rtems_event_receive - waiting forever on " - "RTEMS_EVENT_14 and RTEMS_EVENT_15" - ); - status = rtems_event_receive( - RTEMS_EVENT_14 | RTEMS_EVENT_15, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &eventout - ); - directive_failed( status, "rtems_event_receive" ); - printf( - "TA1 - RTEMS_EVENT_14 and RTEMS_EVENT_15 received - eventout => %08x\n", - eventout - ); - - puts( "TA1 - rtems_event_send - send RTEMS_EVENT_18 to TA2" ); - status = rtems_event_send( Task_id[ 2 ], RTEMS_EVENT_18 ); - directive_failed( status, "rtems_event_send" ); - - puts( - "TA1 - rtems_event_receive - waiting with 10 second timeout on RTEMS_EVENT_14" - ); - status = rtems_event_receive( - RTEMS_EVENT_14, - RTEMS_DEFAULT_OPTIONS, - 10 * TICKS_PER_SECOND, - &eventout - ); - directive_failed( status, "rtems_event_receive" ); - printf( "TA1 - RTEMS_EVENT_14 received - eventout => %08x\n", eventout ); - - puts( "TA1 - rtems_event_send - send RTEMS_EVENT_19 to TA2" ); - status = rtems_event_send( Task_id[ 2 ], RTEMS_EVENT_19 ); - directive_failed( status, "rtems_event_send" ); - - status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time ); - directive_failed( status, "rtems_clock_get" ); - print_time( "TA1 - rtems_clock_get - ", &time, "\n" ); - -rtems_test_pause(); - - puts( "TA1 - rtems_event_send - send RTEMS_EVENT_18 to self after 5 seconds"); - status = rtems_timer_fire_after( - Timer_id[ 1 ], - 5 * TICKS_PER_SECOND, - TA1_send_18_to_self_5_seconds, - NULL - ); - directive_failed( status, "rtems_timer_fire_after 5 seconds" ); - - puts( "TA1 - rtems_event_receive - waiting forever on RTEMS_EVENT_18" ); - status = rtems_event_receive( - RTEMS_EVENT_18, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &eventout - ); - directive_failed( status, "rtems_event_receive of 18" ); - printf( "TA1 - RTEMS_EVENT_18 received - eventout => %08x\n", eventout ); - - status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time ); - directive_failed( status, "TA1 rtems_clock_get" ); - print_time( "TA1 - rtems_clock_get - ", &time, "\n" ); - - puts( "TA1 - rtems_event_send - send RTEMS_EVENT_3 to self" ); - status = rtems_event_send( RTEMS_SELF, RTEMS_EVENT_3 ); - directive_failed( status, "rtems_event_send" ); - - puts( - "TA1 - rtems_event_receive - RTEMS_EVENT_3 or " - "RTEMS_EVENT_22 - NO_WAIT and ANY" - ); - status = rtems_event_receive( - RTEMS_EVENT_3 | RTEMS_EVENT_22, - RTEMS_NO_WAIT | RTEMS_EVENT_ANY, - RTEMS_NO_TIMEOUT, - &eventout - ); - directive_failed( status, "rtems_event_receive of 3 and 22" ); - printf( "TA1 - RTEMS_EVENT_3 received - eventout => %08x\n", eventout ); - - puts( "TA1 - rtems_event_send - send RTEMS_EVENT_4 to self" ); - status = rtems_event_send( RTEMS_SELF, RTEMS_EVENT_4 ); - directive_failed( status, "rtems_event_send" ); - - puts ( - "TA1 - rtems_event_receive - RTEMS_EVENT_4 or " - "RTEMS_EVENT_5 - forever and ANY" - ); - status = rtems_event_receive( - RTEMS_EVENT_4 | RTEMS_EVENT_5, - RTEMS_EVENT_ANY, - RTEMS_NO_TIMEOUT, - &eventout - ); - directive_failed( status, "rtems_event_receive" ); - printf( "TA1 - RTEMS_EVENT_4 received - eventout => %08x\n", eventout ); - -rtems_test_pause(); - - puts( "TA1 - rtems_event_send - send RTEMS_EVENT_18 to self after 5 seconds"); - status = rtems_timer_fire_after( - Timer_id[ 1 ], - 5 * TICKS_PER_SECOND, - TA1_send_18_to_self_5_seconds, - NULL - ); - directive_failed( status, "rtems_timer_fire_after 5 seconds" ); - - puts( "TA1 - rtems_timer_cancel - cancelling timer for event RTEMS_EVENT_18"); - status = rtems_timer_cancel( Timer_id[ 1 ] ); - directive_failed( status, "rtems_timer_cancel" ); - - puts( "TA1 - rtems_event_send - send RTEMS_EVENT_8 to self after 60 seconds"); - status = rtems_timer_fire_after( - Timer_id[ 1 ], - 60 * TICKS_PER_SECOND, - TA1_send_8_to_self_60_seconds, - NULL - ); - directive_failed( status, "rtems_timer_fire_after 60 seconds" ); - - puts( "TA1 - rtems_event_send - send RTEMS_EVENT_9 to self after 60 seconds"); - status = rtems_timer_fire_after( - Timer_id[ 2 ], - 60 * TICKS_PER_SECOND, - TA1_send_9_to_self_60_seconds, - NULL - ); - directive_failed( status, "rtems_timer_fire_after 60 seconds" ); - - puts( - "TA1 - rtems_event_send - send RTEMS_EVENT_10 to self after 60 seconds" - ); - status = rtems_timer_fire_after( - Timer_id[ 3 ], - 60 * TICKS_PER_SECOND, - TA1_send_10_to_self, - NULL - ); - directive_failed( status, "rtems_timer_fire_after 60 seconds" ); - - puts( "TA1 - rtems_timer_cancel - cancelling timer for event RTEMS_EVENT_8" ); - status = rtems_timer_cancel( Timer_id[ 1 ] ); - directive_failed( status, "rtems_timer_cancel" ); - - build_time( &time, 2, 12, 1988, 8, 15, 0, 0 ); - - print_time( "TA1 - rtems_clock_set - ", &time, "\n" ); - status = rtems_clock_set( &time ); - directive_failed( status, "rtems_clock_set" ); - - puts( "TA1 - rtems_event_send - send RTEMS_EVENT_1 every second" ); - status = rtems_timer_fire_after( - Timer_id[ 1 ], - TICKS_PER_SECOND, - TA1_send_1_to_self_every_second, - NULL - ); - directive_failed( status, "rtems_timer_fire_after 1 second" ); - - for ( index = 0; index < 3; index++ ) { - - status = rtems_event_receive( - RTEMS_EVENT_1, - RTEMS_EVENT_ANY, - RTEMS_NO_TIMEOUT, - &eventout - ); - directive_failed( status, "rtems_event_receive" ); - - status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time ); - directive_failed( status, "rtems_clock_get" ); - - printf( "TA1 - RTEMS_EVENT_1 received - eventout => %08x - ", eventout ); - print_time( "at ", &time, "\n" ); - - if ( index < 2 ) { - status = rtems_timer_reset( Timer_id[ 1 ] ); - directive_failed( status, "rtems_timer_reset" ); - }; - - } - - puts( "TA1 - rtems_timer_cancel - cancelling timer for event RTEMS_EVENT_1" ); - status = rtems_timer_cancel( Timer_id[ 1 ] ); - directive_failed( status, "rtems_timer_cancel" ); - -rtems_test_pause(); - - time.day = 13; - puts( "TA1 - rtems_event_send - sending RTEMS_EVENT_11 to self in 1 day" ); - status = rtems_timer_fire_when( - Timer_id[ 1 ], - &time, - TA1_send_11_to_self, - NULL - ); - directive_failed( status, "rtems_timer_fire_when 1 day" ); - - time.hour = 7; - puts( "TA1 - rtems_event_send - sending RTEMS_EVENT_11 to self in 1 day" ); - status = rtems_timer_fire_when( - Timer_id[ 2 ], - &time, - TA1_send_11_to_self, - NULL - ); - directive_failed( status, "rtems_timer_fire_when 1 day" ); - - time.hour = 8; /* so code below has correct time/date */ - time.day = 14; - puts( "TA1 - rtems_event_send - sending RTEMS_EVENT_11 to self in 2 days" ); - status = rtems_timer_fire_when( - Timer_id[ 3 ], - &time, - TA1_send_11_to_self, - NULL - ); - directive_failed( status, "rtems_timer_fire_when 2 days" ); - - puts("TA1 - rtems_timer_cancel - cancelling RTEMS_EVENT_11 to self in 1 day"); - status = rtems_timer_cancel( Timer_id[ 1 ] ); - directive_failed( status, "rtems_timer_cancel" ); - - puts( - "TA1 - rtems_timer_cancel - cancelling RTEMS_EVENT_11 to self in 2 days" - ); - status = rtems_timer_cancel( Timer_id[ 3 ] ); - directive_failed( status, "rtems_timer_cancel" ); - - puts( - "TA1 - rtems_event_send - resending RTEMS_EVENT_11 to self in 2 days" - ); - status = rtems_timer_fire_when( - Timer_id[ 3 ], - &time, - TA1_send_11_to_self, - NULL - ); - directive_failed( status, "rtems_timer_fire_when 2 days" ); - - time.day = 15; - print_time( "TA1 - rtems_clock_set - ", &time, "\n" ); - status = rtems_clock_set( &time ); - directive_failed( status, "TA1 rtems_clock_set" ); - - puts( "TA1 - rtems_event_receive - waiting forever on RTEMS_EVENT_11" ); - status = rtems_event_receive( - RTEMS_EVENT_11, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &eventout - ); - directive_failed( status, "rtems_event_receive" ); - printf( "TA1 - RTEMS_EVENT_11 received - eventout => %08x\n", eventout ); - -rtems_test_pause(); - - puts( "TA1 - rtems_event_send/rtems_event_receive combination" ); - status = rtems_timer_fire_after( - Timer_id[ 1 ], - 10, - TA1_send_11_to_self, - NULL - ); - directive_failed( status, "rtems_timer_fire_after 10 ticks" ); - - status = rtems_event_receive( - RTEMS_EVENT_11, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &eventout - ); - directive_failed( status, "rtems_event_receive" ); - - build_time( &time, 2, 12, 1988, 8, 15, 0, 0 ); - - print_time( "TA1 - rtems_clock_set - ", &time, "\n" ); - status = rtems_clock_set( &time ); - directive_failed( status, "rtems_clock_set" ); - - time.day = 13; - puts( "TA1 - rtems_event_receive all outstanding events" ); - status = rtems_event_receive( - RTEMS_ALL_EVENTS, - RTEMS_NO_WAIT | RTEMS_EVENT_ANY, - 0, - &eventout - ); - fatal_directive_status( - status, - RTEMS_UNSATISFIED, - "rtems_event_receive all events" - ); - - puts( "TA1 - rtems_event_send - sending RTEMS_EVENT_10 to self in 1 day" ); - status = rtems_timer_fire_when( - Timer_id[ 1 ], - &time, - TA1_send_10_to_self, - NULL - ); - directive_failed( status, "rtems_timer_fire_when 1 day" ); - - time.day = 14; - puts( "TA1 - rtems_event_send - sending RTEMS_EVENT_11 to self in 2 days" ); - status = rtems_timer_fire_when( - Timer_id[ 2 ], - &time, - TA1_send_11_to_self, - NULL - ); - directive_failed( status, "rtems_timer_fire_when 2 days" ); - - build_time( &time, 2, 12, 1988, 7, 15, 0, 0 ); - - print_time( "TA1 - rtems_clock_set - ", &time, "\n" ); - puts( "TA1 - set time backwards" ); - status = rtems_clock_set( &time ); - directive_failed( status, "rtems_clock_set" ); - - status = rtems_event_receive( - RTEMS_ALL_EVENTS, - RTEMS_NO_WAIT | RTEMS_EVENT_ANY, - RTEMS_NO_TIMEOUT, - &eventout - ); - if ( eventout ) printf( "ERROR -0x%08x events received\n", eventout ); - else puts( "TA1 - no events received" ); - fatal_directive_status( - status, - RTEMS_UNSATISFIED, - "rtems_event_receive all events" - ); - - build_time( &time, 2, 14, 1988, 7, 15, 0, 0 ); - - print_time( "TA1 - rtems_clock_set - ", &time, "\n" ); - puts( "TA1 - set time forwards (leave a timer)" ); - status = rtems_clock_set( &time ); - directive_failed( status, "rtems_clock_set" ); - - status = rtems_event_receive( - RTEMS_ALL_EVENTS, - RTEMS_NO_WAIT | RTEMS_EVENT_ANY, - RTEMS_NO_TIMEOUT, - &eventout - ); - if ( eventout == RTEMS_EVENT_10 ) puts( "TA1 - RTEMS_EVENT_10 received" ); - else printf( "ERROR -0x%08x events received\n", eventout ); - directive_failed( status, "rtems_event_receive all events" ); - - puts( "TA1 - rtems_event_send - sending RTEMS_EVENT_11 to self in 100 ticks"); - status = rtems_timer_fire_after( - Timer_id[ 1 ], - 100, - TA1_send_11_to_self, - NULL - ); - directive_failed( status, "rtems_timer_fire_after 100 ticks" ); - - puts( "TA1 - rtems_event_send - sending RTEMS_EVENT_11 to self in 200 ticks"); - status = rtems_timer_fire_after( - Timer_id[ 1 ], - 200, - TA1_send_11_to_self, - NULL - ); - directive_failed( status, "rtems_timer_fire_after 200 ticks" ); - - puts( "*** END OF TEST 11 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/sptests/sp11/task2.c b/testsuites/sptests/sp11/task2.c deleted file mode 100644 index bbfa27fd9f..0000000000 --- a/testsuites/sptests/sp11/task2.c +++ /dev/null @@ -1,125 +0,0 @@ -/* Task_2 - * - * This routine serves as a test task. Multiple tasks are required to - * verify all capabilities of the event manager. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -rtems_task Task_2( - rtems_task_argument argument -) -{ - rtems_event_set eventout; - rtems_time_of_day time; - rtems_status_code status; - - status = rtems_task_wake_after( 1*TICKS_PER_SECOND ); - directive_failed( status, "rtems_task_wake_after" ); - - puts( "TA2 - rtems_event_receive - waiting forever on RTEMS_EVENT_16" ); - status = rtems_event_receive( - RTEMS_EVENT_16, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &eventout - ); - directive_failed( status, "rtems_event_receive" ); - printf( "TA2 - RTEMS_EVENT_16 received - eventout => %08x\n", eventout ); - - puts( - "TA2 - rtems_event_send - send RTEMS_EVENT_14 and RTEMS_EVENT_15 to TA1" - ); - status = rtems_event_send( Task_id[ 1 ], RTEMS_EVENT_14 | RTEMS_EVENT_15 ); - directive_failed( status, "rtems_event_send" ); - - puts( - "TA2 - rtems_event_receive - RTEMS_EVENT_17 or " - "RTEMS_EVENT_18 - forever and ANY" - ); - status = rtems_event_receive( - RTEMS_EVENT_17 | RTEMS_EVENT_18, - RTEMS_EVENT_ANY, - RTEMS_NO_TIMEOUT, - &eventout - ); - directive_failed( status, "rtems_event_receive" ); - printf( - "TA2 - RTEMS_EVENT_17 or RTEMS_EVENT_18 received - eventout => %08x\n", - eventout - ); - - puts( "TA2 - rtems_event_send - send RTEMS_EVENT_14 to TA1" ); - status = rtems_event_send( Task_id[ 1 ], RTEMS_EVENT_14 ); - directive_failed( status, "rtems_event_send" ); - - build_time( &time, 2, 12, 1988, 8, 15, 0, 0 ); - print_time( "TA2 - rtems_clock_set - ", &time, "\n" ); - status = rtems_clock_set( &time ); - directive_failed( status, "TA2 rtems_clock_set" ); - - time.second += 4; - puts( - "TA2 - rtems_event_send - sending RTEMS_EVENT_10 to self after 4 seconds" - ); - status = rtems_timer_fire_when( - Timer_id[ 5 ], - &time, - TA2_send_10_to_self, - NULL - ); - directive_failed( status, "rtems_timer_fire_when after 4 seconds" ); - - puts( "TA2 - rtems_event_receive - waiting forever on RTEMS_EVENT_10" ); - status = rtems_event_receive( - RTEMS_EVENT_10, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &eventout - ); - directive_failed( status, "rtems_event_receive" ); - - status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time ); - directive_failed( status, "rtems_clock_get" ); - - printf( "TA2 - RTEMS_EVENT_10 received - eventout => %08x\n", eventout ); - print_time( "TA2 - rtems_clock_get - ", &time, "\n" ); - - puts( "TA2 - rtems_event_receive - RTEMS_PENDING_EVENTS" ); - status = rtems_event_receive( - RTEMS_PENDING_EVENTS, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &eventout - ); - directive_failed( status, "rtems_event_receive" ); - printf( "TA2 - eventout => %08x\n", eventout ); - - puts( "TA2 - rtems_event_receive - RTEMS_EVENT_19 - RTEMS_NO_WAIT" ); - status = rtems_event_receive( - RTEMS_EVENT_19, - RTEMS_NO_WAIT, - RTEMS_NO_TIMEOUT, - &eventout - ); - directive_failed( status, "rtems_event_receive" ); - printf( "TA2 - RTEMS_EVENT_19 received - eventout => %08x\n", eventout ); - - puts( "TA2 - rtems_task_delete - deletes self" ); - status = rtems_task_delete( Task_id[ 2 ] ); - directive_failed( status, "rtems_task_delete of TA2" ); -} diff --git a/testsuites/sptests/sp11/timer.c b/testsuites/sptests/sp11/timer.c deleted file mode 100644 index f6dff55dd5..0000000000 --- a/testsuites/sptests/sp11/timer.c +++ /dev/null @@ -1,96 +0,0 @@ -/* Timer_functions - * - * These routines are the timer service routines used by this test. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -rtems_timer_service_routine TA1_send_18_to_self_5_seconds( - rtems_id ignored_id, - void *ignored_address -) -{ - rtems_status_code status; - - status = rtems_event_send( Task_id[ 1 ], RTEMS_EVENT_18 ); - directive_failed_with_level( status, "rtems_event_send of 18", 1 ); -} - -rtems_timer_service_routine TA1_send_8_to_self_60_seconds( - rtems_id ignored_id, - void *ignored_address -) -{ - rtems_status_code status; - - status = rtems_event_send( Task_id[ 1 ], RTEMS_EVENT_8 ); - directive_failed_with_level( status, "rtems_event_send of 8", 1 ); -} - -rtems_timer_service_routine TA1_send_9_to_self_60_seconds( - rtems_id ignored_id, - void *ignored_address -) -{ - rtems_status_code status; - - status = rtems_event_send( Task_id[ 1 ], RTEMS_EVENT_9 ); - directive_failed_with_level( status, "rtems_event_send of 9", 1 ); -} - -rtems_timer_service_routine TA1_send_10_to_self( - rtems_id ignored_id, - void *ignored_address -) -{ - rtems_status_code status; - - status = rtems_event_send( Task_id[ 1 ], RTEMS_EVENT_10 ); - directive_failed_with_level( status, "rtems_event_send of 10", -1 ); -} - -rtems_timer_service_routine TA1_send_1_to_self_every_second( - rtems_id ignored_id, - void *ignored_address -) -{ - rtems_status_code status; - - status = rtems_event_send( Task_id[ 1 ], RTEMS_EVENT_1 ); - directive_failed_with_level( status, "rtems_event_send of 1", 1 ); -} - -rtems_timer_service_routine TA1_send_11_to_self( - rtems_id ignored_id, - void *ignored_address -) -{ - rtems_status_code status; - - status = rtems_event_send( Task_id[ 1 ], RTEMS_EVENT_11 ); - directive_failed_with_level( status, "rtems_event_send of 11", -1 ); -} - -rtems_timer_service_routine TA2_send_10_to_self( - rtems_id ignored_id, - void *ignored_address -) -{ - rtems_status_code status; - - status = rtems_event_send( Task_id[ 2 ], RTEMS_EVENT_10 ); - directive_failed_with_level( status, "rtems_event_send of 10", 1 ); -} diff --git a/testsuites/sptests/sp12/.cvsignore b/testsuites/sptests/sp12/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/sptests/sp12/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/sptests/sp12/Makefile.am b/testsuites/sptests/sp12/Makefile.am deleted file mode 100644 index d11f2622cb..0000000000 --- a/testsuites/sptests/sp12/Makefile.am +++ /dev/null @@ -1,38 +0,0 @@ -## -## $Id$ -## - - -TEST = sp12 - -MANAGERS = io semaphore - -C_FILES = init.c task1.c task2.c task3.c task4.c task5.c pridrv.c pritask.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/sptests.am - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/sptests/sp12/init.c b/testsuites/sptests/sp12/init.c deleted file mode 100644 index b7155354c5..0000000000 --- a/testsuites/sptests/sp12/init.c +++ /dev/null @@ -1,178 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - - puts( "\n\n*** TEST 12 ***" ); - - 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', ' ' ); - - Priority_task_name[ 1 ] = rtems_build_name( 'P', 'R', 'I', '1' ); - Priority_task_name[ 2 ] = rtems_build_name( 'P', 'R', 'I', '2' ); - Priority_task_name[ 3 ] = rtems_build_name( 'P', 'R', 'I', '3' ); - Priority_task_name[ 4 ] = rtems_build_name( 'P', 'R', 'I', '4' ); - Priority_task_name[ 5 ] = rtems_build_name( 'P', 'R', 'I', '5' ); - - 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', ' ' ); - - status = rtems_semaphore_create( - Semaphore_name[ 1 ], - 1, - RTEMS_DEFAULT_ATTRIBUTES, - RTEMS_NO_PRIORITY, - &Semaphore_id[ 1 ] - ); - directive_failed( status, "rtems_semaphore_create of SM1" ); - - status = rtems_semaphore_create( - Semaphore_name[ 2 ], - 0, - RTEMS_PRIORITY, - RTEMS_NO_PRIORITY, - &Semaphore_id[ 2 ] - ); - directive_failed( status, "rtems_semaphore_create of SM2" ); - - status = rtems_semaphore_create( - Semaphore_name[ 3 ], - 1, - RTEMS_DEFAULT_ATTRIBUTES, - RTEMS_NO_PRIORITY, - &Semaphore_id[ 3 ] - ); - directive_failed( status, "rtems_semaphore_create of SM3" ); - - puts( "INIT - Forward priority queue test" ); - Priority_test_driver( 0 ); - - puts( "INIT - Backward priority queue test" ); - Priority_test_driver( 32 ); - -rtems_test_pause(); - - puts( "INIT - Binary Semaphore and Priority Inheritance Test" ); - - status = rtems_semaphore_delete( Semaphore_id[ 2 ] ); - directive_failed( status, "rtems_semaphore_delete of SM2" ); - - puts( "INIT - rtems_semaphore_create - allocated binary semaphore" ); - status = rtems_semaphore_create( - Semaphore_name[ 2 ], - 0, - RTEMS_BINARY_SEMAPHORE | RTEMS_PRIORITY | RTEMS_INHERIT_PRIORITY, - RTEMS_NO_PRIORITY, - &Semaphore_id[ 2 ] - ); - directive_failed( status, "rtems_semaphore_create of priority inherit SM2" ); - - puts( "INIT - rtems_semaphore_release - allocated binary semaphore" ); - status = rtems_semaphore_release( Semaphore_id[ 2 ] ); - directive_failed( status, "rtems_semaphore_release of SM2" ); - - puts( "INIT - rtems_semaphore_delete - allocated binary semaphore" ); - status = rtems_semaphore_delete( Semaphore_id[ 2 ] ); - directive_failed( status, "rtems_semaphore_delete of SM2" ); - - status = rtems_semaphore_create( - Semaphore_name[ 2 ], - 1, - RTEMS_BINARY_SEMAPHORE | RTEMS_PRIORITY | RTEMS_INHERIT_PRIORITY, - RTEMS_NO_PRIORITY, - &Semaphore_id[ 2 ] - ); - directive_failed( status, "rtems_semaphore_create of priority inherit SM2" ); - - Priority_test_driver( 64 ); - -rtems_test_pause(); - - status = rtems_semaphore_delete( Semaphore_id[ 2 ] ); - directive_failed( status, "rtems_semaphore_delete of SM2" ); - - status = rtems_semaphore_create( - Semaphore_name[ 2 ], - 0, - RTEMS_PRIORITY, - RTEMS_NO_PRIORITY, - &Semaphore_id[ 2 ] - ); - directive_failed( status, "rtems_semaphore_create of priority SM2" ); - - status = rtems_semaphore_release( Semaphore_id[ 2 ] ); - directive_failed( status, "rtems_semaphore_release of SM2" ); - - status = rtems_task_create( - Task_name[ 1 ], - 4, - RTEMS_MINIMUM_STACK_SIZE * 2, - 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, - RTEMS_MINIMUM_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 ], - 4, - RTEMS_MINIMUM_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, 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/sp12/pridrv.c b/testsuites/sptests/sp12/pridrv.c deleted file mode 100644 index 2d945c4e12..0000000000 --- a/testsuites/sptests/sp12/pridrv.c +++ /dev/null @@ -1,130 +0,0 @@ -/* Priority_test_driver - * - * 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: - * priority_base - priority_base switch - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -void Priority_test_driver( - rtems_unsigned32 priority_base -) -{ - rtems_task_priority previous_priority; - rtems_unsigned32 index; - rtems_status_code status; - - for ( index = 1 ; index <= 5 ; index++ ) { - switch ( index ) { - case 1: - case 2: - case 3: - Task_priority[ index ] = priority_base + index; - break; - default: - Task_priority[ index ] = priority_base + 3; - break; - } - - status = rtems_task_create( - Priority_task_name[ index ], - Task_priority[ index ], - RTEMS_MINIMUM_STACK_SIZE * 2, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Priority_task_id[ index ] - ); - directive_failed( status, "rtems_task_create loop" ); - - } - - if ( priority_base == 0 ) { - for ( index = 1 ; index <= 5 ; index++ ) { - status = rtems_task_start( - Priority_task_id[ index ], - Priority_task, - index - ); - directive_failed( status, "rtems_task_start loop" ); - } - } else { - for ( index = 5 ; index >= 1 ; index-- ) { - status = rtems_task_start( - Priority_task_id[ index ], - Priority_task, - index - ); - directive_failed( status, "rtems_task_start loop" ); - - status = rtems_task_wake_after( TICKS_PER_SECOND ); - directive_failed( status, "rtems_task_wake_after loop" ); - - if ( priority_base == 64 ) { - if ( index == 4 ) { - status = rtems_task_set_priority( - Priority_task_id[ 5 ], - priority_base + 4, - &previous_priority - ); - printf( "PDRV - change priority of PRI5 from %d to %d\n", - previous_priority, - priority_base + 4 - ); - directive_failed( status, "PDRV rtems_task_set_priority" ); - } - status = rtems_task_set_priority( - Priority_task_id[ 5 ], - RTEMS_CURRENT_PRIORITY, - &previous_priority - ); - directive_failed( status, "PDRV rtems_task_set_priority CURRENT" ); - printf( "PDRV - priority of PRI5 is %d\n", previous_priority ); - } - } - } - - status = rtems_task_wake_after( TICKS_PER_SECOND ); - directive_failed( status, "rtems_task_wake_after after loop" ); - - if ( priority_base == 0 ) { - for ( index = 1 ; index <= 5 ; index++ ) { - status = rtems_semaphore_release( Semaphore_id[ 2 ] ); - directive_failed( status, "rtems_semaphore_release loop" ); - } - } - - if ( priority_base == 64 ) { - puts( "PDRV - rtems_task_resume - PRI5" ); - status = rtems_task_resume( Priority_task_id[ 5 ] ); - directive_failed( status, "rtems_task_resume" ); - - status = rtems_task_wake_after( 1 * TICKS_PER_SECOND ); - directive_failed( status, "rtems_task_wake_after so PRI5 can run" ); - - status = rtems_task_delete( Priority_task_id[ 5 ] ); - directive_failed( status, "rtems_task_delete of PRI5" ); - } - else { - for ( index = 1 ; index <= 5 ; index++ ) { - status = rtems_task_delete( Priority_task_id[ index ] ); - directive_failed( status, "rtems_task_delete loop" ); - } - } -} diff --git a/testsuites/sptests/sp12/pritask.c b/testsuites/sptests/sp12/pritask.c deleted file mode 100644 index fb28405c44..0000000000 --- a/testsuites/sptests/sp12/pritask.c +++ /dev/null @@ -1,90 +0,0 @@ -/* Priority_task - * - * This routine serves as a test task. It verifies the semaphore manager. - * - * Input parameters: - * its_index - priority index - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -rtems_task Priority_task( - rtems_task_argument its_index -) -{ - rtems_interval timeout; - rtems_task_priority its_priority; - rtems_task_priority current_priority; - rtems_status_code status; - rtems_unsigned32 index; - - its_priority = Task_priority[ its_index ]; - - if ( its_priority < 3 ) - timeout = 5 * TICKS_PER_SECOND; - else - timeout = RTEMS_NO_TIMEOUT; - - put_name( Priority_task_name[ its_index ], FALSE ); - puts( " - rtems_semaphore_obtain - wait forever on SM2" ); - - status = rtems_semaphore_obtain( - Semaphore_id[ 2 ], - RTEMS_DEFAULT_OPTIONS, - timeout - ); - directive_failed( status, "rtems_semaphore_obtain of SM2" ); - - if ( its_priority < 64 ) { - printf( "PRI%d - WHY AM I HERE? (pri=%d)", its_index, its_priority ); - rtems_test_exit( 0 ); - } - - if ( its_index == 5 ) - puts( "PRI5 - rtems_task_suspend - until all priority tasks blocked" ); - status = rtems_task_suspend( RTEMS_SELF ); - directive_failed( status, "rtems_task_suspend" ); - - puts( "PRI5 - rtems_task_delete - all tasks waiting on SM2" ); - for ( index = 1 ; index < 5 ; index++ ) { - status = rtems_task_delete( Priority_task_id[ index ] ); - directive_failed( status, "rtems_task_delete loop" ); - } - - puts( "PRI5 - rtems_semaphore_obtain - nested" ); - status = rtems_semaphore_obtain( - Semaphore_id[ 2 ], - RTEMS_DEFAULT_OPTIONS, - timeout - ); - directive_failed( status, "rtems_semaphore_obtain nested" ); - - puts( "PRI5 - rtems_semaphore_release - nested" ); - status = rtems_semaphore_release( Semaphore_id[ 2 ] ); - directive_failed( status, "rtems_semaphore_release nested " ); - - puts( "PRI5 - rtems_semaphore_release - restore priority" ); - status = rtems_semaphore_release( Semaphore_id[ 2 ] ); - directive_failed( status, "rtems_semaphore_release" ); - - status = rtems_task_set_priority( - RTEMS_SELF, - RTEMS_CURRENT_PRIORITY, - ¤t_priority - ); - directive_failed( status, "PRI5 rtems_task_set_priority CURRENT" ); - printf( "PRI5 - priority of PRI5 is %d\n", current_priority ); - - (void) rtems_task_suspend( RTEMS_SELF ); -} diff --git a/testsuites/sptests/sp12/sp12.doc b/testsuites/sptests/sp12/sp12.doc deleted file mode 100644 index 5ecfc25939..0000000000 --- a/testsuites/sptests/sp12/sp12.doc +++ /dev/null @@ -1,26 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - -This file describes the directives and concepts tested by this test set. - -test set name: test12 - -directives: - ex_init, ex_start, t_create, t_start, t_delete, tm_tick, i_return, - sm_create, sm_ident, sm_delete, sm_p, sm_v, tm_wkafter, t_setpri - -concepts: - - a. This test checks out the semaphore manager. - - b. This test forces _Flush_taskq() to unblock a task waiting - on a deleted object. diff --git a/testsuites/sptests/sp12/sp12.scn b/testsuites/sptests/sp12/sp12.scn deleted file mode 100644 index e75a804b0c..0000000000 --- a/testsuites/sptests/sp12/sp12.scn +++ /dev/null @@ -1,78 +0,0 @@ -*** TEST 12 *** -INIT - Forward priority queue test -PRI1 - rtems_semaphore_obtain - wait forever on SM2 -PRI2 - rtems_semaphore_obtain - wait forever on SM2 -PRI3 - rtems_semaphore_obtain - wait forever on SM2 -PRI4 - rtems_semaphore_obtain - wait forever on SM2 -PRI5 - rtems_semaphore_obtain - wait forever on SM2 -INIT - Backward priority queue test -PRI5 - rtems_semaphore_obtain - wait forever on SM2 -PRI4 - rtems_semaphore_obtain - wait forever on SM2 -PRI3 - rtems_semaphore_obtain - wait forever on SM2 -PRI2 - rtems_semaphore_obtain - wait forever on SM2 -PRI1 - rtems_semaphore_obtain - wait forever on SM2 - -INIT - Binary Semaphore and Priority Inheritance Test -INIT - rtems_semaphore_create - allocated binary semaphore -INIT - rtems_semaphore_release - allocated binary semaphore -INIT - rtems_semaphore_delete - allocated binary semaphore -PRI5 - rtems_semaphore_obtain - wait forever on SM2 -PRI5 - rtems_task_suspend - until all priority tasks blocked -PDRV - priority of PRI5 is 67 -PRI4 - rtems_semaphore_obtain - wait forever on SM2 -PDRV - change priority of PRI5 from 67 to 68 -PDRV - priority of PRI5 is 67 -PRI3 - rtems_semaphore_obtain - wait forever on SM2 -PDRV - priority of PRI5 is 67 -PRI2 - rtems_semaphore_obtain - wait forever on SM2 -PDRV - priority of PRI5 is 66 -PRI1 - rtems_semaphore_obtain - wait forever on SM2 -PDRV - priority of PRI5 is 65 -PDRV - rtems_task_resume - PRI5 -PRI5 - rtems_task_delete - all tasks waiting on SM2 -PRI5 - rtems_semaphore_obtain - nested -PRI5 - rtems_semaphore_release - nested -PRI5 - rtems_semaphore_release - restore priority -PRI5 - priority of PRI5 is 68 - -TA1 - rtems_semaphore_ident - smid => 18010002 -TA1 - rtems_semaphore_obtain - wait forever on SM2 -TA1 - got SM2 -TA1 - rtems_semaphore_obtain - wait forever on SM3 -TA1 - got SM3 -TA1 - rtems_semaphore_obtain - get SM1 - RTEMS_NO_WAIT -TA1 - got SM1 -TA1 - rtems_task_wake_after - sleep 5 seconds -TA2 - rtems_semaphore_obtain - wait forever on SM1 -TA3 - rtems_semaphore_obtain - wait forever on SM2 - -TA1 - rtems_semaphore_release - release SM1 -TA1 - rtems_semaphore_obtain - waiting for SM1 with 10 second timeout -TA2 - got SM1 -TA2 - rtems_semaphore_release - release SM1 -TA2 - rtems_task_set_priority - make self highest priority task -TA2 - rtems_semaphore_obtain - wait forever on SM2 -TA1 - got SM1 -TA1 - rtems_semaphore_release - release SM2 -TA2 - got SM2 -TA2 - rtems_semaphore_release - release SM2 -TA2 - rtems_task_delete - delete self -TA1 - rtems_task_wake_after - sleep 5 seconds -TA3 - got SM2 -TA3 - rtems_semaphore_release - release SM2 -TA3 - rtems_semaphore_obtain - wait forever on SM3 - -TA1 - rtems_task_delete - delete TA3 -TA1 - rtems_task_wake_after - sleep 5 seconds -TA4 - rtems_semaphore_obtain - wait forever on SM1 -TA5 - rtems_semaphore_obtain - wait forever on SM1 -TA1 - rtems_task_delete - delete TA4 -TA1 - rtems_semaphore_release - release SM1 -TA1 - rtems_task_wake_after - sleep 5 seconds -TA5 - got SM1 -TA5 - rtems_semaphore_obtain - wait forever on SM1 -TA1 - rtems_semaphore_delete - delete SM1 -TA1 - rtems_semaphore_delete - delete SM3 -TA1 - rtems_task_delete - delete self -TA5 - SM1 deleted by TA1 -*** END OF TEST 12 *** diff --git a/testsuites/sptests/sp12/system.h b/testsuites/sptests/sp12/system.h deleted file mode 100644 index 134bb17578..0000000000 --- a/testsuites/sptests/sp12/system.h +++ /dev/null @@ -1,82 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -void Priority_test_driver( - rtems_unsigned32 priority_base -); - -rtems_task Priority_task( - rtems_task_argument its_index -); - -rtems_task Task_1( - rtems_task_argument argument -); - -rtems_task Task_2( - rtems_task_argument argument -); - -rtems_task Task_3( - rtems_task_argument argument -); - -rtems_task Task_4( - rtems_task_argument argument -); - -rtems_task Task5( - rtems_task_argument argument -); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_INIT_TASK_STACK_SIZE (RTEMS_MINIMUM_STACK_SIZE * 2) -#define CONFIGURE_MAXIMUM_TASKS 8 -#define CONFIGURE_MAXIMUM_SEMAPHORES 10 -#define CONFIGURE_TICKS_PER_TIMESLICE 100 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_EXTRA_TASK_STACKS (6 * RTEMS_MINIMUM_STACK_SIZE) - -#include - -/* global variables */ - - -TEST_EXTERN rtems_id Task_id[ 6 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 6 ]; /* array of task names */ - -TEST_EXTERN rtems_id Priority_task_id[ 6 ]; /* array of task ids */ -TEST_EXTERN rtems_name Priority_task_name[ 6 ]; /* array of task names */ - -TEST_EXTERN rtems_task_priority Task_priority[ 6 ]; - -TEST_EXTERN rtems_id Semaphore_id[ 4 ]; /* array of semaphore ids */ -TEST_EXTERN rtems_name Semaphore_name[ 4 ]; /* array of semaphore names */ - -/* end of include file */ diff --git a/testsuites/sptests/sp12/task1.c b/testsuites/sptests/sp12/task1.c deleted file mode 100644 index 6f1c5356f8..0000000000 --- a/testsuites/sptests/sp12/task1.c +++ /dev/null @@ -1,152 +0,0 @@ -/* Task_1 - * - * This routine serves as a test task. It verifies the semaphore manager. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -rtems_task Task_1( - rtems_task_argument argument -) -{ - rtems_id smid; - rtems_status_code status; - - status = rtems_semaphore_ident( - Semaphore_name[ 1 ], - RTEMS_SEARCH_ALL_NODES, - &smid - ); - printf( "TA1 - rtems_semaphore_ident - smid => %08x\n", smid ); - directive_failed( status, "rtems_semaphore_ident of SM1" ); - - puts( "TA1 - rtems_semaphore_obtain - wait forever on SM2" ); - status = rtems_semaphore_obtain( - Semaphore_id[ 2 ], - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); - directive_failed( status, "rtems_semaphore_obtain of SM2" ); - puts( "TA1 - got SM2" ); - - puts( "TA1 - rtems_semaphore_obtain - wait forever on SM3" ); - status = rtems_semaphore_obtain( - Semaphore_id[ 3 ], - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); - directive_failed( status, "rtems_semaphore_obtain of SM3" ); - puts( "TA1 - got SM3" ); - - puts( "TA1 - rtems_semaphore_obtain - get SM1 - RTEMS_NO_WAIT" ); - status = rtems_semaphore_obtain( - Semaphore_id[ 1 ], - RTEMS_NO_WAIT, - RTEMS_NO_TIMEOUT - ); - directive_failed( status, "rtems_semaphore_obtain of SM1" ); - puts( "TA1 - got SM1" ); - - 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" ); - -rtems_test_pause(); - - puts( "TA1 - rtems_semaphore_release - release SM1" ); - status = rtems_semaphore_release( Semaphore_id[ 1 ] ); - directive_failed( status, "rtems_semaphore_release of SM1" ); - - puts( - "TA1 - rtems_semaphore_obtain - waiting for SM1 with 10 second timeout" - ); - status = rtems_semaphore_obtain( - Semaphore_id[ 1 ], - RTEMS_DEFAULT_OPTIONS, - 10 * TICKS_PER_SECOND - ); - directive_failed( status, "rtems_semaphore_obtain of SM1" ); - puts( "TA1 - got SM1" ); - - puts( "TA1 - rtems_semaphore_release - release SM2" ); - status = rtems_semaphore_release( Semaphore_id[ 2 ] ); - directive_failed( status, "rtems_semaphore_release of SM2" ); - - 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" ); - -rtems_test_pause(); - - puts( "TA1 - rtems_task_delete - delete TA3" ); - status = rtems_task_delete( Task_id[ 3 ] ); - directive_failed( status, "rtems_task_delete of TA3" ); - - status = rtems_task_create( - Task_name[ 4 ], - 4, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 4 ] - ); - directive_failed( status, "rtems_task_create of TA4" ); - - status = rtems_task_create( - Task_name[ 5 ], - 4, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 5 ] - ); - directive_failed( status, "rtems_task_create of TA5" ); - - status = rtems_task_start( Task_id[ 4 ], Task_4, 0 ); - directive_failed( status, "rtems_task_start of TA4" ); - - status = rtems_task_start( Task_id[ 5 ], Task5, 0 ); - directive_failed( status, "rtems_task_start of TA5" ); - - 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_delete - delete TA4" ); - status = rtems_task_delete( Task_id[ 4 ] ); - directive_failed( status, "rtems_task_delete of TA4" ); - - puts( "TA1 - rtems_semaphore_release - release SM1" ); - status = rtems_semaphore_release( Semaphore_id[ 1 ] ); - directive_failed( status, "rtems_semaphore_release on SM1" ); - - 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_semaphore_delete - delete SM1" ); - status = rtems_semaphore_delete( Semaphore_id[ 1 ] ); - directive_failed( status, "rtems_semaphore_delete of SM1" ); - - puts( "TA1 - rtems_semaphore_delete - delete SM3" ); - status = rtems_semaphore_delete( Semaphore_id[ 3 ] ); - directive_failed( status, "rtems_semaphore_delete of SM3" ); - - puts( "TA1 - rtems_task_delete - delete self" ); - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of TA1" ); -} diff --git a/testsuites/sptests/sp12/task2.c b/testsuites/sptests/sp12/task2.c deleted file mode 100644 index d5bd9c5199..0000000000 --- a/testsuites/sptests/sp12/task2.c +++ /dev/null @@ -1,64 +0,0 @@ -/* Task_2 - * - * This routine serves as a test task. It simply obtains semaphores - * 1 and 2, the later when it is a high priority task. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - - -#include "system.h" - -rtems_task Task_2( - rtems_task_argument argument -) -{ - rtems_status_code status; - rtems_task_priority previous_priority; - - puts( "TA2 - rtems_semaphore_obtain - wait forever on SM1" ); - status = rtems_semaphore_obtain( - Semaphore_id[ 1 ], - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); - puts( "TA2 - got SM1" ); - directive_failed( status, "rtems_semaphore_obtain on SM1" ); - - puts( "TA2 - rtems_semaphore_release - release SM1" ); - status = rtems_semaphore_release( Semaphore_id[ 1 ] ); - directive_failed( status, "rtems_semaphore_release on SM1" ); - - puts( "TA2 - rtems_task_set_priority - make self highest priority task" ); - status = rtems_task_set_priority( RTEMS_SELF, 3, &previous_priority ); - directive_failed( status, "rtems_task_set_priority on TA2" ); - - puts( "TA2 - rtems_semaphore_obtain - wait forever on SM2" ); - status = rtems_semaphore_obtain( - Semaphore_id[ 2 ], - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); - puts( "TA2 - got SM2" ); - directive_failed( status, "rtems_semaphore_obtain on SM2" ); - - puts( "TA2 - rtems_semaphore_release - release SM2" ); - status = rtems_semaphore_release( Semaphore_id[ 2 ] ); - directive_failed( status, "rtems_semaphore_release on SM2" ); - - puts( "TA2 - rtems_task_delete - delete self" ); - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of TA2" ); -} diff --git a/testsuites/sptests/sp12/task3.c b/testsuites/sptests/sp12/task3.c deleted file mode 100644 index ceb7b56232..0000000000 --- a/testsuites/sptests/sp12/task3.c +++ /dev/null @@ -1,49 +0,0 @@ -/* Task_3 - * - * This routine serves as a test task. It simply obtains semaphore - * 2 and waits forever attempting to obtain semaphore 3. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -rtems_task Task_3( - rtems_task_argument argument -) -{ - rtems_status_code status; - - puts( "TA3 - rtems_semaphore_obtain - wait forever on SM2" ); - status = rtems_semaphore_obtain( - Semaphore_id[ 2 ], - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); - directive_failed( status, "rtems_semaphore_obtain on SM2" ); - puts( "TA3 - got SM2" ); - - puts( "TA3 - rtems_semaphore_release - release SM2" ); - status = rtems_semaphore_release( Semaphore_id[ 2 ] ); - directive_failed( status, "rtems_semaphore_release on SM2" ); - - puts( "TA3 - rtems_semaphore_obtain - wait forever on SM3" ); - status = rtems_semaphore_obtain( - Semaphore_id[ 3 ], - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); - directive_failed( status, "rtems_semaphore_obtain on SM3" ); -} diff --git a/testsuites/sptests/sp12/task4.c b/testsuites/sptests/sp12/task4.c deleted file mode 100644 index ce3a82f856..0000000000 --- a/testsuites/sptests/sp12/task4.c +++ /dev/null @@ -1,36 +0,0 @@ -/* Task_4 - * - * This routine serves as a test task. It waits forever attempting - * to obtain semaphore 1. However, it should never get the semaphore! - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -rtems_task Task_4( - rtems_task_argument argument -) -{ - rtems_status_code status; - - puts( "TA4 - rtems_semaphore_obtain - wait forever on SM1" ); - status = rtems_semaphore_obtain( - Semaphore_id[ 1 ], - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); - directive_failed( status, "rtems_semaphore_obtain on SM1" ); -} diff --git a/testsuites/sptests/sp12/task5.c b/testsuites/sptests/sp12/task5.c deleted file mode 100644 index 167c69228f..0000000000 --- a/testsuites/sptests/sp12/task5.c +++ /dev/null @@ -1,54 +0,0 @@ -/* Task5 - * - * This routine serves as a test task. It obtains semaphore 1 correctly - * once, then waits for semaphore 1 again. Task 1 should delete the - * semaphore, thus waking this task up. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -rtems_task Task5( - rtems_task_argument argument -) -{ - rtems_status_code status; - - puts( "TA5 - rtems_semaphore_obtain - wait forever on SM1" ); - status = rtems_semaphore_obtain( - Semaphore_id[ 1 ], - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); - directive_failed( status, "rtems_semaphore_obtain on SM1" ); - puts( "TA5 - got SM1" ); - - puts( "TA5 - rtems_semaphore_obtain - wait forever on SM1" ); - status = rtems_semaphore_obtain( - Semaphore_id[ 1 ], - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); - fatal_directive_status( - status, - RTEMS_OBJECT_WAS_DELETED, - "rtems_semaphore_obtain on SM1" - ); - puts( "TA5 - SM1 deleted by TA1" ); - - puts( "*** END OF TEST 12 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/sptests/sp13/.cvsignore b/testsuites/sptests/sp13/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/sptests/sp13/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/sptests/sp13/Makefile.am b/testsuites/sptests/sp13/Makefile.am deleted file mode 100644 index 05427bb92d..0000000000 --- a/testsuites/sptests/sp13/Makefile.am +++ /dev/null @@ -1,38 +0,0 @@ -## -## $Id$ -## - - -TEST = sp13 - -MANAGERS = io message - -C_FILES = init.c fillbuff.c putbuff.c task1.c task2.c task3.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/sptests.am - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/sptests/sp13/fillbuff.c b/testsuites/sptests/sp13/fillbuff.c deleted file mode 100644 index 6930913d3d..0000000000 --- a/testsuites/sptests/sp13/fillbuff.c +++ /dev/null @@ -1,46 +0,0 @@ -/* Fill_buffer - * - * This test routine copies a given source string to a given destination - * buffer. - * - * Input parameters: - * source - pointer to string to be copied - * buffer - pointer to message buffer to be filled - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -#define MESSAGE_SIZE (sizeof(long) * 4) - -void Fill_buffer( - char *source, - long *buffer -) -{ - char *p; - int i; -/* - memcpy( buffer, source, 16 ); -*/ - p = source; - for ( i=0 ; i> 24), - (char) (buffer[i] >> 16 & 0xff), - (char) (buffer[i] >> 8 & 0xff), - (char) (buffer[i] >> 0 & 0xff) ); - } - -} diff --git a/testsuites/sptests/sp13/sp13.doc b/testsuites/sptests/sp13/sp13.doc deleted file mode 100644 index 8cdd44ac80..0000000000 --- a/testsuites/sptests/sp13/sp13.doc +++ /dev/null @@ -1,24 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - -This file describes the directives and concepts tested by this test set. - -test set name: test13 - -directives: - ex_init, ex_start, t_create, t_start, t_delete, tm_tick, i_return, - q_create, q_ident, q_delete, q_send, q_urgent, q_broadcast, q_receive, - tm_wkafter, t_setpri - -concepts: - - a. This test checks out the message manager. diff --git a/testsuites/sptests/sp13/sp13.scn b/testsuites/sptests/sp13/sp13.scn deleted file mode 100644 index 51441e1c15..0000000000 --- a/testsuites/sptests/sp13/sp13.scn +++ /dev/null @@ -1,78 +0,0 @@ -*** TEST 13 *** -TA1 - rtems_message_queue_ident - qid => 1c010001 -TA1 - rtems_message_queue_send - BUFFER 1 TO Q 1 -TA1 - rtems_message_queue_send - BUFFER 2 TO Q 1 -TA1 - rtems_task_wake_after - sleep 5 seconds -TA2 - rtems_message_queue_receive - receive from queue 1 - RTEMS_NO_WAIT -TA2 - buffer received: BUFFER 1 TO Q 1 -TA2 - rtems_message_queue_receive - receive from queue 1 - RTEMS_WAIT FOREVER -TA2 - buffer received: BUFFER 2 TO Q 1 -TA2 - rtems_message_queue_receive - receive from queue 1 - RTEMS_WAIT FOREVER -TA3 - rtems_message_queue_receive - receive from queue 2 - RTEMS_WAIT FOREVER -TA1 - rtems_message_queue_send - BUFFER 3 TO Q 1 -TA1 - rtems_task_wake_after - sleep 5 seconds -TA2 - buffer received: BUFFER 3 TO Q 1 -TA2 - rtems_task_set_priority - make self highest priority task -TA2 - rtems_message_queue_receive - receive from queue 2 - RTEMS_WAIT FOREVER - -TA1 - rtems_message_queue_send - BUFFER 1 TO Q 2 -TA2 - buffer received: BUFFER 1 TO Q 2 -TA2 - rtems_message_queue_send - BUFFER 2 TO Q 2 -TA2 - rtems_message_queue_receive - receive from queue 1 - 10 second timeout -TA1 - rtems_message_queue_receive - receive from queue 1 - 10 second timeout -TA3 - buffer received: BUFFER 2 TO Q 2 -TA3 - rtems_message_queue_broadcast - BUFFER 3 TO Q 1 -TA2 - buffer received: BUFFER 3 TO Q 1 -TA2 - rtems_message_queue_receive - receive from queue 3 - RTEMS_WAIT FOREVER -TA3 - number of tasks awakened = 02 -TA3 - rtems_message_queue_receive - receive from queue 3 - RTEMS_WAIT FOREVER -TA1 - buffer received: BUFFER 3 TO Q 1 -TA1 - rtems_task_delete - delete TA2 -TA1 - rtems_message_queue_send - BUFFER 1 TO Q 3 -TA1 - rtems_task_wake_after - sleep 5 seconds -TA3 - buffer received: BUFFER 1 TO Q 3 -TA3 - rtems_task_delete - delete self - -TA1 - rtems_message_queue_send - BUFFER 2 TO Q 3 -TA1 - rtems_message_queue_send - BUFFER 3 TO Q 3 -TA1 - rtems_message_queue_send - BUFFER 4 TO Q 3 -TA1 - rtems_message_queue_urgent - BUFFER 5 TO Q 3 -TA1 - rtems_message_queue_receive - receive from queue 3 - RTEMS_WAIT FOREVER -TA1 - buffer received: BUFFER 5 TO Q 3 -TA1 - rtems_message_queue_receive - receive from queue 3 - RTEMS_WAIT FOREVER -TA1 - buffer received: BUFFER 2 TO Q 3 -TA1 - rtems_message_queue_receive - receive from queue 3 - RTEMS_WAIT FOREVER -TA1 - buffer received: BUFFER 3 TO Q 3 -TA1 - rtems_message_queue_receive - receive from queue 3 - RTEMS_WAIT FOREVER -TA1 - buffer received: BUFFER 4 TO Q 3 -TA1 - rtems_message_queue_urgent - BUFFER 3 TO Q 2 -TA1 - rtems_message_queue_receive - receive from queue 2 - RTEMS_WAIT FOREVER -TA1 - buffer received: BUFFER 3 TO Q 2 - -TA1 - rtems_message_queue_delete - delete queue 1 -TA1 - rtems_message_queue_urgent - BUFFER 3 TO Q 2 -TA1 - rtems_message_queue_delete - delete queue 2 -TA1 - rtems_message_queue_get_number_pending - SUCCESSFUL -TA1 - 0 messages are pending on Q 3 -TA1 - rtems_message_queue_flush - empty Q 3 -TA1 - 0 messages were flushed from Q 3 -TA1 - rtems_message_queue_send - BUFFER 1 TO Q 3 -TA1 - rtems_message_queue_send - BUFFER 2 TO Q 3 -TA3 - rtems_message_queue_broadcast - NO BUFFER TO Q1 -TA3 - number of tasks awakened = 0 -TA1 - rtems_message_queue_get_number_pending - SUCCESSFUL -TA1 - 2 messages are pending on Q 3 -TA1 - rtems_message_queue_send - BUFFER 3 TO Q 3 -TA1 - rtems_message_queue_flush - Q 3 -TA1 - 3 messages were flushed from Q 3 -TA1 - rtems_message_queue_send until all message buffers consumed -TA1 - all message buffers consumed -TA1 - rtems_message_queue_flush - Q 3 -TA1 - 100 messages were flushed from Q 3 - -TA1 - create message queue of 20 bytes on queue 1 -TA1 - rtems_message_queue_delete - delete queue 1 - -TA1 - rtems_message_queue_create - variable sizes -TA1 - rtems_message_queue_create and send - variable sizes -*** END OF TEST 13 *** diff --git a/testsuites/sptests/sp13/system.h b/testsuites/sptests/sp13/system.h deleted file mode 100644 index c30459a477..0000000000 --- a/testsuites/sptests/sp13/system.h +++ /dev/null @@ -1,69 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -void Fill_buffer( - char source[], - long *buffer -); - -void Put_buffer( - long *buffer -); - -rtems_task Task_1( - rtems_task_argument argument -); - -rtems_task Task_2( - rtems_task_argument argument -); - -rtems_task Task_3( - rtems_task_argument argument -); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 4 -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 10 -#define CONFIGURE_TICKS_PER_TIMESLICE 100 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_MEMORY_OVERHEAD 32 -#define CONFIGURE_EXTRA_TASK_STACKS (3 * RTEMS_MINIMUM_STACK_SIZE) - -#include - -/* global variables */ - -TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */ - -TEST_EXTERN rtems_id Queue_id[ 4 ]; /* array of queue ids */ -TEST_EXTERN rtems_name Queue_name[ 4 ]; /* array of queue names */ - -/* end of include file */ diff --git a/testsuites/sptests/sp13/task1.c b/testsuites/sptests/sp13/task1.c deleted file mode 100644 index 4f5e6844ae..0000000000 --- a/testsuites/sptests/sp13/task1.c +++ /dev/null @@ -1,363 +0,0 @@ -/* Task_1 - * - * This routine serves as a test task. It verifies the message manager. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" -#include /* for memcmp */ - -char big_send_buffer[2048]; -char big_receive_buffer[2048]; - -long buffer[ 4 ]; - -#define MESSAGE_SIZE (sizeof(long) * 4) - -void dope_buffer(unsigned char *buff, - int buff_size, - unsigned32 v) -{ - int i; - unsigned char ch; - - ch = (' ' + (v % (0x7f - ' '))); - - for (i=0; i= 0x7f) - ch = ' '; - } -} - -rtems_task Task_1( - rtems_task_argument argument -) -{ - rtems_id qid; - rtems_unsigned32 index; - rtems_unsigned32 count; - rtems_status_code status; - rtems_unsigned32 size; - rtems_unsigned32 queue_size; - char *cp; - - status = rtems_message_queue_ident( - Queue_name[ 1 ], - RTEMS_SEARCH_ALL_NODES, - &qid - ); - printf( "TA1 - rtems_message_queue_ident - qid => %08x\n", qid ); - directive_failed( status, "rtems_message_queue_ident" ); - - Fill_buffer( "BUFFER 1 TO Q 1", buffer ); - puts( "TA1 - rtems_message_queue_send - BUFFER 1 TO Q 1" ); - status = rtems_message_queue_send( Queue_id[ 1 ], buffer, MESSAGE_SIZE ); - directive_failed( status, "rtems_message_queue_send" ); - - Fill_buffer( "BUFFER 2 TO Q 1", buffer ); - puts( "TA1 - rtems_message_queue_send - BUFFER 2 TO Q 1" ); - status = rtems_message_queue_send( Queue_id[ 1 ], buffer, MESSAGE_SIZE ); - directive_failed( status, "rtems_message_queue_send" ); - - 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" ); - - Fill_buffer( "BUFFER 3 TO Q 1", buffer ); - puts( "TA1 - rtems_message_queue_send - BUFFER 3 TO Q 1" ); - status = rtems_message_queue_send( Queue_id[ 1 ], buffer, MESSAGE_SIZE ); - directive_failed( status, "rtems_message_queue_send" ); - - 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" ); - -rtems_test_pause(); - - Fill_buffer( "BUFFER 1 TO Q 2", buffer ); - puts( "TA1 - rtems_message_queue_send - BUFFER 1 TO Q 2" ); - status = rtems_message_queue_send( Queue_id[ 2 ], buffer, MESSAGE_SIZE ); - directive_failed( status, "rtems_message_queue_send" ); - - puts_nocr( "TA1 - rtems_message_queue_receive - receive from queue 1 - " ); - puts ( "10 second timeout" ); - status = rtems_message_queue_receive( - Queue_id[ 1 ], - buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - 10 * TICKS_PER_SECOND - ); - directive_failed( status, "rtems_message_queue_receive" ); - puts_nocr( "TA1 - buffer received: " ); - Put_buffer( buffer ); - new_line; - - puts( "TA1 - rtems_task_delete - delete TA2" ); - status = rtems_task_delete( Task_id[ 2 ] ); - directive_failed( status, "rtems_task_delete" ); - - Fill_buffer( "BUFFER 1 TO Q 3", buffer ); - puts( "TA1 - rtems_message_queue_send - BUFFER 1 TO Q 3" ); - status = rtems_message_queue_send( Queue_id[ 3 ], buffer, MESSAGE_SIZE ); - directive_failed( status, "rtems_message_queue_send" ); - - 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" ); - -rtems_test_pause(); - - Fill_buffer( "BUFFER 2 TO Q 3", buffer ); - puts( "TA1 - rtems_message_queue_send - BUFFER 2 TO Q 3" ); - status = rtems_message_queue_send( Queue_id[ 3 ], buffer, MESSAGE_SIZE ); - directive_failed( status, "rtems_message_queue_send" ); - - Fill_buffer( "BUFFER 3 TO Q 3", buffer ); - puts( "TA1 - rtems_message_queue_send - BUFFER 3 TO Q 3" ); - status = rtems_message_queue_send( Queue_id[ 3 ], buffer, MESSAGE_SIZE ); - directive_failed( status, "rtems_message_queue_send" ); - - Fill_buffer( "BUFFER 4 TO Q 3", buffer ); - puts( "TA1 - rtems_message_queue_send - BUFFER 4 TO Q 3" ); - status = rtems_message_queue_send( Queue_id[ 3 ], buffer, MESSAGE_SIZE ); - directive_failed( status, "rtems_message_queue_send" ); - - Fill_buffer( "BUFFER 5 TO Q 3", buffer ); - puts( "TA1 - rtems_message_queue_urgent - BUFFER 5 TO Q 3" ); - status = rtems_message_queue_urgent( Queue_id[ 3 ], buffer, MESSAGE_SIZE ); - directive_failed( status, "rtems_message_queue_urgent" ); - - for ( index = 1 ; index <= 4 ; index++ ) { - puts( - "TA1 - rtems_message_queue_receive - receive from queue 3 - " - "RTEMS_WAIT FOREVER" - ); - status = rtems_message_queue_receive( - Queue_id[ 3 ], - buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); - directive_failed( status, "rtems_message_queue_receive" ); - puts_nocr( "TA1 - buffer received: " ); - Put_buffer( buffer ); - new_line; - } - - Fill_buffer( "BUFFER 3 TO Q 2", buffer ); - puts( "TA1 - rtems_message_queue_urgent - BUFFER 3 TO Q 2" ); - status = rtems_message_queue_urgent( Queue_id[ 2 ], buffer, MESSAGE_SIZE ); - directive_failed( status, "rtems_message_queue_urgent" ); - - puts( - "TA1 - rtems_message_queue_receive - receive from queue 2 - " - "RTEMS_WAIT FOREVER" - ); - status = rtems_message_queue_receive( - Queue_id[ 2 ], - buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); - directive_failed( status, "rtems_message_queue_receive" ); - puts_nocr( "TA1 - buffer received: " ); - Put_buffer( buffer ); - new_line; - -rtems_test_pause(); - - puts( "TA1 - rtems_message_queue_delete - delete queue 1" ); - status = rtems_message_queue_delete( Queue_id[ 1 ] ); - directive_failed( status, "rtems_message_queue_delete" ); - - Fill_buffer( "BUFFER 3 TO Q 2", buffer ); - puts( "TA1 - rtems_message_queue_urgent - BUFFER 3 TO Q 2" ); - status = rtems_message_queue_urgent( Queue_id[ 2 ], buffer, MESSAGE_SIZE ); - directive_failed( status, "rtems_message_queue_urgent" ); - - puts( "TA1 - rtems_message_queue_delete - delete queue 2" ); - status = rtems_message_queue_delete( Queue_id[ 2 ] ); - directive_failed( status, "rtems_message_queue_delete" ); - - puts( "TA1 - rtems_message_queue_get_number_pending - SUCCESSFUL\n" ); - status = rtems_message_queue_get_number_pending( Queue_id[ 3 ], &count ); - printf( "TA1 - %d messages are pending on Q 3\n", count ); - - puts( "TA1 - rtems_message_queue_flush - empty Q 3" ); - status = rtems_message_queue_flush( Queue_id[ 3 ], &count ); - printf( "TA1 - %d messages were flushed from Q 3\n", count ); - - Fill_buffer( "BUFFER 1 TO Q 3", buffer ); - puts( "TA1 - rtems_message_queue_send - BUFFER 1 TO Q 3" ); - status = rtems_message_queue_send( Queue_id[ 3 ], buffer, MESSAGE_SIZE ); - directive_failed( status, "rtems_message_queue_send" ); - - Fill_buffer( "BUFFER 2 TO Q 3", buffer ); - puts( "TA1 - rtems_message_queue_send - BUFFER 2 TO Q 3" ); - status = rtems_message_queue_send( Queue_id[ 3 ], buffer, MESSAGE_SIZE ); - directive_failed( status, "rtems_message_queue_send" ); - - /* this broadcast should have no effect on the queue */ - Fill_buffer( "NO BUFFER TO Q1", (long *)buffer ); - puts( "TA3 - rtems_message_queue_broadcast - NO BUFFER TO Q1" ); - status = rtems_message_queue_broadcast( - Queue_id[ 1 ], - (long (*)[4])buffer, - 16, - &count - ); - printf( "TA3 - number of tasks awakened = %d\n", count ); - - - puts( "TA1 - rtems_message_queue_get_number_pending - SUCCESSFUL\n" ); - status = rtems_message_queue_get_number_pending( Queue_id[ 3 ], &count ); - printf( "TA1 - %d messages are pending on Q 3\n", count ); - - Fill_buffer( "BUFFER 3 TO Q 3", buffer ); - puts( "TA1 - rtems_message_queue_send - BUFFER 3 TO Q 3" ); - status = rtems_message_queue_send( Queue_id[ 3 ], buffer, MESSAGE_SIZE ); - directive_failed( status, "rtems_message_queue_send" ); - - puts( "TA1 - rtems_message_queue_flush - Q 3" ); - status = rtems_message_queue_flush( Queue_id[ 3 ], &count ); - printf( "TA1 - %d messages were flushed from Q 3\n", count ); - - puts( "TA1 - rtems_message_queue_send until all message buffers consumed" ); - while ( FOREVER ) { - status = rtems_message_queue_send( Queue_id[ 3 ], buffer, MESSAGE_SIZE ); - if ( status == RTEMS_TOO_MANY ) break; - directive_failed( status, "rtems_message_queue_send loop" ); - } - - puts( "TA1 - all message buffers consumed" ); - puts( "TA1 - rtems_message_queue_flush - Q 3" ); - status = rtems_message_queue_flush( Queue_id[ 3 ], &count ); - printf( "TA1 - %d messages were flushed from Q 3\n", count ); - -rtems_test_pause(); - - puts( "TA1 - create message queue of 20 bytes on queue 1" ); - status = rtems_message_queue_create( - Queue_name[ 1 ], - 100, - 20, - RTEMS_DEFAULT_ATTRIBUTES, - &Queue_id[ 1 ] - ); - directive_failed( status, "rtems_message_queue_create of Q1; 20 bytes each" ); - status = rtems_message_queue_send( Queue_id[ 3 ], big_send_buffer, 40 ); - fatal_directive_status(status, RTEMS_INVALID_SIZE, "expected RTEMS_INVALID_SIZE"); - - puts( "TA1 - rtems_message_queue_delete - delete queue 1" ); - status = rtems_message_queue_delete( Queue_id[ 1 ] ); - directive_failed( status, "rtems_message_queue_delete" ); - -rtems_test_pause(); - - puts( "TA1 - rtems_message_queue_create - variable sizes " ); - for (queue_size = 1; queue_size < 1030; queue_size++) - { - status = rtems_message_queue_create( - Queue_name[ 1 ], - 2, /* just 2 msgs each */ - queue_size, - RTEMS_DEFAULT_ATTRIBUTES, - &Queue_id[ 1 ] - ); - if (status != RTEMS_SUCCESSFUL) - { - printf("TA1 - msq que size: %d\n", queue_size); - directive_failed( status, "rtems_message_queue_create of Q1" ); - } - - status = rtems_message_queue_delete( Queue_id[ 1 ] ); - directive_failed( status, "rtems_message_queue_delete" ); - } - - puts( "TA1 - rtems_message_queue_create and send - variable sizes " ); - for (queue_size = 1; queue_size < 1030; queue_size++) - { - /* printf("TA1 - message queue size: %d\n", queue_size); */ - - status = rtems_message_queue_create( - Queue_name[ 1 ], - 2, /* just 2 msgs each */ - queue_size, - RTEMS_DEFAULT_ATTRIBUTES, - &Queue_id[ 1 ] - ); - - directive_failed( status, "rtems_message_queue_create of Q1" ); - - dope_buffer(big_send_buffer, sizeof(big_send_buffer), queue_size); - memset(big_receive_buffer, 'Z', sizeof(big_receive_buffer)); - - /* send a msg too big */ - status = rtems_message_queue_send( Queue_id[ 1 ], - big_send_buffer, - queue_size + 1 ); - - fatal_directive_status(status, - RTEMS_INVALID_SIZE, - "rtems_message_queue_send too large"); - - /* send a msg that is just right */ - status = rtems_message_queue_send(Queue_id[ 1 ], - big_send_buffer, - queue_size); - directive_failed(status, "rtems_message_queue_send exact size"); - - /* now read and verify the message just sent */ - status = rtems_message_queue_receive(Queue_id[ 1 ], - big_receive_buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - 1 * TICKS_PER_SECOND); - directive_failed(status, "rtems_message_queue_receive exact size"); - if (size != queue_size) - { - puts("TA1 - exact size size match failed"); - rtems_test_exit(1); - } - - if (memcmp(big_send_buffer, big_receive_buffer, size) != 0) - { - puts("TA1 - exact size data match failed"); - rtems_test_exit(1); - } - - for (cp = (big_receive_buffer + size); - cp < (big_receive_buffer + sizeof(big_receive_buffer)); - cp++) - if (*cp != 'Z') - { - puts("TA1 - exact size overrun match failed"); - rtems_test_exit(1); - } - - /* all done with this one; delete it */ - status = rtems_message_queue_delete( Queue_id[ 1 ] ); - directive_failed( status, "rtems_message_queue_delete" ); - } - - puts( "*** END OF TEST 13 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/sptests/sp13/task2.c b/testsuites/sptests/sp13/task2.c deleted file mode 100644 index e970eac4e7..0000000000 --- a/testsuites/sptests/sp13/task2.c +++ /dev/null @@ -1,138 +0,0 @@ -/* Task_2 - * - * This routine serves as a test task. Multiple tasks are required to - * verify all message manager capabilities. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -#define MESSAGE_SIZE (sizeof(long) * 4) - -rtems_task Task_2( - rtems_task_argument argument -) -{ - long buffer[ 4 ]; - rtems_unsigned32 size; - rtems_task_priority previous_priority; - rtems_status_code status; - - puts( - "TA2 - rtems_message_queue_receive - receive from queue 1 - RTEMS_NO_WAIT" - ); - status = rtems_message_queue_receive( - Queue_id[ 1 ], - buffer, - &size, - RTEMS_NO_WAIT, - RTEMS_NO_TIMEOUT - ); - directive_failed( status, "rtems_message_queue_receive" ); - puts_nocr( "TA2 - buffer received: " ); - Put_buffer( buffer ); - new_line; - - puts( - "TA2 - rtems_message_queue_receive - receive from queue 1 - " - "RTEMS_WAIT FOREVER" - ); - status = rtems_message_queue_receive( - Queue_id[ 1 ], - buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); - directive_failed( status, "rtems_message_queue_receive" ); - puts_nocr( "TA2 - buffer received: " ); - Put_buffer( buffer ); - new_line; - - puts( - "TA2 - rtems_message_queue_receive - receive from queue 1 - " - "RTEMS_WAIT FOREVER" - ); - status = rtems_message_queue_receive( - Queue_id[ 1 ], - buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); - directive_failed( status, "rtems_message_queue_receive" ); - puts_nocr( "TA2 - buffer received: " ); - Put_buffer( buffer ); - new_line; - - puts( "TA2 - rtems_task_set_priority - make self highest priority task" ); - status = rtems_task_set_priority( RTEMS_SELF, 3, &previous_priority ); - directive_failed( status, "rtems_task_set_priority" ); - - puts( - "TA2 - rtems_message_queue_receive - receive from queue 2 - " - "RTEMS_WAIT FOREVER" - ); - status = rtems_message_queue_receive( - Queue_id[ 2 ], - buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); - directive_failed( status, "rtems_message_queue_receive" ); - puts_nocr( "TA2 - buffer received: " ); - Put_buffer( buffer ); - new_line; - - Fill_buffer( "BUFFER 2 TO Q 2", (long *)buffer ); - puts( "TA2 - rtems_message_queue_send - BUFFER 2 TO Q 2" ); - status = rtems_message_queue_send( Queue_id[ 2 ], buffer, MESSAGE_SIZE ); - directive_failed( status, "rtems_message_queue_send" ); - - puts( - "TA2 - rtems_message_queue_receive - receive from queue 1 - " - "10 second timeout" - ); - status = rtems_message_queue_receive( - Queue_id[ 1 ], - buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - 10 * TICKS_PER_SECOND - ); - directive_failed( status, "rtems_message_queue_receive" ); - puts_nocr( "TA2 - buffer received: " ); - Put_buffer( buffer ); - new_line; - - puts( - "TA2 - rtems_message_queue_receive - receive from queue 3 - " - "RTEMS_WAIT FOREVER" - ); - status = rtems_message_queue_receive( - Queue_id[ 3 ], - buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); - directive_failed( status, "rtems_message_queue_receive" ); - puts_nocr( "TA2 - buffer received: " ); - Put_buffer( buffer ); - new_line; - -} diff --git a/testsuites/sptests/sp13/task3.c b/testsuites/sptests/sp13/task3.c deleted file mode 100644 index 95acec01fc..0000000000 --- a/testsuites/sptests/sp13/task3.c +++ /dev/null @@ -1,77 +0,0 @@ -/* Task_3 - * - * This routine serves as a test task. Its major function is to - * broadcast a messge to all the other tasks. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -rtems_task Task_3( - rtems_task_argument argument -) -{ - long buffer[ 4 ]; - rtems_unsigned32 size; - rtems_unsigned32 count; - rtems_status_code status; - - puts( - "TA3 - rtems_message_queue_receive - receive from queue 2 - " - "RTEMS_WAIT FOREVER" - ); - status = rtems_message_queue_receive( - Queue_id[ 2 ], - (long (*)[4])buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); - directive_failed( status, "rtems_message_queue_receive" ); - puts_nocr( "TA3 - buffer received: " ); - Put_buffer( buffer ); - new_line; - - Fill_buffer( "BUFFER 3 TO Q 1", (long *)buffer ); - puts( "TA3 - rtems_message_queue_broadcast - BUFFER 3 TO Q 1" ); - status = rtems_message_queue_broadcast( - Queue_id[ 1 ], - (long (*)[4])buffer, - 16, - &count - ); - printf( "TA3 - number of tasks awakened = %02d\n", count ); - puts( - "TA3 - rtems_message_queue_receive - receive from queue 3 - " - "RTEMS_WAIT FOREVER" - ); - - status = rtems_message_queue_receive( - Queue_id[ 3 ], - (long (*)[4])buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); - directive_failed( status, "rtems_message_queue_receive" ); - puts_nocr( "TA3 - buffer received: " ); - Put_buffer( buffer ); - new_line; - - puts( "TA3 - rtems_task_delete - delete self" ); - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} diff --git a/testsuites/sptests/sp14/.cvsignore b/testsuites/sptests/sp14/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/sptests/sp14/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/sptests/sp14/Makefile.am b/testsuites/sptests/sp14/Makefile.am deleted file mode 100644 index 4377353fc8..0000000000 --- a/testsuites/sptests/sp14/Makefile.am +++ /dev/null @@ -1,38 +0,0 @@ -## -## $Id$ -## - - -TEST = sp14 - -MANAGERS = io signal timer - -C_FILES = init.c asr.c task1.c task2.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/sptests.am - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/sptests/sp14/asr.c b/testsuites/sptests/sp14/asr.c deleted file mode 100644 index 6c635b00f3..0000000000 --- a/testsuites/sptests/sp14/asr.c +++ /dev/null @@ -1,46 +0,0 @@ -/* Process_asr - * - * This is the asynchronous signal routine (asr) for task 1. - * It demonstrates that ASRs can block execute and block. - * - * Input parameters: - * the_signal_set - signal set - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -rtems_asr Process_asr( - rtems_signal_set the_signal_set -) -{ - rtems_status_code status; - - printf( "ASR - ENTRY - signal => %08x\n", the_signal_set ); - switch( the_signal_set ) { - case RTEMS_SIGNAL_16: - case RTEMS_SIGNAL_17: - case RTEMS_SIGNAL_18 | RTEMS_SIGNAL_19: - break; - case RTEMS_SIGNAL_0: - case RTEMS_SIGNAL_1: - puts( "ASR - rtems_task_wake_after - yield processor" ); - status = rtems_task_wake_after( RTEMS_YIELD_PROCESSOR ); - directive_failed( status, "rtems_task_wake_after yield" ); - break; - case RTEMS_SIGNAL_3: - Asr_fired = TRUE; - break; - } - printf( "ASR - EXIT - signal => %08x\n", the_signal_set ); -} diff --git a/testsuites/sptests/sp14/init.c b/testsuites/sptests/sp14/init.c deleted file mode 100644 index 3ce5be0be0..0000000000 --- a/testsuites/sptests/sp14/init.c +++ /dev/null @@ -1,71 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - - puts( "\n\n*** TEST 14 ***" ); - - 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, - RTEMS_MINIMUM_STACK_SIZE * 2, - 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, - RTEMS_MINIMUM_STACK_SIZE, - 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', ' ' ); - - status = rtems_timer_create( Timer_name[ 1 ], &Timer_id[ 1 ] ); - directive_failed( status, "rtems_timer_create of TM1" ); - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} diff --git a/testsuites/sptests/sp14/sp14.doc b/testsuites/sptests/sp14/sp14.doc deleted file mode 100644 index 7bf040ca03..0000000000 --- a/testsuites/sptests/sp14/sp14.doc +++ /dev/null @@ -1,23 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - -This file describes the directives and concepts tested by this test set. - -test set name: test14 - -directives: - ex_init, ex_start, t_create, t_start, t_delete, tm_tick, i_return, - as_catch, as_return, as_send, tm_wkafter - -concepts: - - a. This test checks out the signal manager. diff --git a/testsuites/sptests/sp14/sp14.scn b/testsuites/sptests/sp14/sp14.scn deleted file mode 100644 index 31e6d067d2..0000000000 --- a/testsuites/sptests/sp14/sp14.scn +++ /dev/null @@ -1,33 +0,0 @@ -*** TEST 14 *** -TA1 - rtems_signal_catch - RTEMS_INTERRUPT_LEVEL( 3 ) -TA1 - rtems_signal_send - RTEMS_SIGNAL_16 to self -ASR - ENTRY - signal => 00010000 -ASR - EXIT - signal => 00010000 -TA1 - rtems_signal_send - RTEMS_SIGNAL_0 to self -ASR - ENTRY - signal => 00000001 -ASR - rtems_task_wake_after - yield processor -TA2 - rtems_signal_send - RTEMS_SIGNAL_17 to TA1 -TA2 - rtems_task_wake_after - yield processor -ASR - ENTRY - signal => 00020000 -ASR - EXIT - signal => 00020000 -ASR - EXIT - signal => 00000001 -TA1 - rtems_signal_catch - RTEMS_NO_ASR - -TA1 - rtems_signal_send - RTEMS_SIGNAL_1 to self -ASR - ENTRY - signal => 00000002 -ASR - rtems_task_wake_after - yield processor -TA2 - rtems_signal_send - RTEMS_SIGNAL_18 and RTEMS_SIGNAL_19 to TA1 -TA2 - rtems_task_wake_after - yield processor -ASR - EXIT - signal => 00000002 -ASR - ENTRY - signal => 000c0000 -ASR - EXIT - signal => 000c0000 -TA1 - rtems_task_mode - disable ASRs -TA1 - sending signal to RTEMS_SELF from timer -TA1 - waiting for signal to arrive -TA1 - timer routine got the correct arguments -TA1 - rtems_task_mode - enable ASRs -ASR - ENTRY - signal => 00000008 -ASR - EXIT - signal => 00000008 -TA1 - rtems_signal_catch - asraddr of NULL -TA1 - rtems_task_delete - delete self -*** END OF TEST 14 *** diff --git a/testsuites/sptests/sp14/system.h b/testsuites/sptests/sp14/system.h deleted file mode 100644 index 2483902dcb..0000000000 --- a/testsuites/sptests/sp14/system.h +++ /dev/null @@ -1,78 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_timer_service_routine Signal_3_to_task_1( - rtems_id id, - void *pointer -); - -rtems_asr Process_asr( - rtems_signal_set the_signal_set -); - -rtems_task Task_1( - rtems_task_argument argument -); - -rtems_task Task_2( - rtems_task_argument argument -); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 3 -#define CONFIGURE_MAXIMUM_TIMERS 1 -#define CONFIGURE_TICKS_PER_TIMESLICE 100 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_EXTRA_TASK_STACKS (1 * RTEMS_MINIMUM_STACK_SIZE) - -#include - -/* global variables */ - -TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */ - -TEST_EXTERN rtems_id Timer_id[ 3 ]; /* array of timer ids */ -TEST_EXTERN rtems_name Timer_name[ 3 ]; /* array of timer names */ - -TEST_EXTERN volatile rtems_unsigned32 Signals_sent; - /* set to TRUE to indicate that a */ - /* signal set has been sent from */ - /* an ISR to the executing task */ - -TEST_EXTERN volatile rtems_unsigned32 Asr_fired; - /* set to TRUE to indicate that the */ - /* RTEMS_ASR has executed and was */ - /* passed the correct signal set */ - -TEST_EXTERN volatile rtems_id Timer_got_this_id; - -TEST_EXTERN volatile void *Timer_got_this_pointer; - -/* end of include file */ diff --git a/testsuites/sptests/sp14/task1.c b/testsuites/sptests/sp14/task1.c deleted file mode 100644 index 23ab0a84b7..0000000000 --- a/testsuites/sptests/sp14/task1.c +++ /dev/null @@ -1,115 +0,0 @@ -/* Task_1 - * - * This routine serves as a test task. It establishes an RTEMS_ASR and - * sends signal to itself to determine if the RTEMS_ASR gets to execute. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -rtems_timer_service_routine Signal_3_to_task_1( - rtems_id id, - void *pointer -) -{ - rtems_status_code status; - - status = rtems_signal_send( Task_id[ 1 ], RTEMS_SIGNAL_3 ); - directive_failed_with_level( status, "rtems_signal_send of 3", 1 ); - - Timer_got_this_id = id; - Timer_got_this_pointer = pointer; - - Signals_sent = TRUE; -} - -rtems_task Task_1( - rtems_task_argument argument -) -{ - rtems_mode previous_mode; - rtems_status_code status; - - puts( "TA1 - rtems_signal_catch - RTEMS_INTERRUPT_LEVEL( 3 )" ); - status = rtems_signal_catch( Process_asr, RTEMS_INTERRUPT_LEVEL(3) ); - directive_failed( status, "rtems_signal_catch" ); - - puts( "TA1 - rtems_signal_send - RTEMS_SIGNAL_16 to self" ); - status = rtems_signal_send( RTEMS_SELF, RTEMS_SIGNAL_16 ); - directive_failed( status, "rtems_signal_send" ); - - puts( "TA1 - rtems_signal_send - RTEMS_SIGNAL_0 to self" ); - status = rtems_signal_send( RTEMS_SELF, RTEMS_SIGNAL_0 ); - directive_failed( status, "rtems_signal_send" ); - - puts( "TA1 - rtems_signal_catch - RTEMS_NO_ASR" ); - status = rtems_signal_catch( Process_asr, RTEMS_NO_ASR ); - directive_failed( status, "rtems_signal_catch" ); - -rtems_test_pause(); - - puts( "TA1 - rtems_signal_send - RTEMS_SIGNAL_1 to self" ); - status = rtems_signal_send( RTEMS_SELF, RTEMS_SIGNAL_1 ); - directive_failed( status, "rtems_signal_send" ); - - puts( "TA1 - rtems_task_mode - disable ASRs" ); - status = rtems_task_mode( RTEMS_NO_ASR, RTEMS_ASR_MASK, &previous_mode ); - directive_failed( status, "rtems_task_mode" ); - - Timer_got_this_id = 0; - Timer_got_this_pointer = NULL; - - puts( "TA1 - sending signal to RTEMS_SELF from timer" ); - status = rtems_timer_fire_after( - Timer_id[ 1 ], - TICKS_PER_SECOND / 2, - Signal_3_to_task_1, - (void *) Task_1 - ); - directive_failed( status, "rtems_timer_fire_after" ); - - puts( "TA1 - waiting for signal to arrive" ); - - Signals_sent = FALSE; - Asr_fired = FALSE; - - while ( Signals_sent == FALSE ) - ; - - if ( Timer_got_this_id == Timer_id[ 1 ] && - Timer_got_this_pointer == Task_1 ) - puts( "TA1 - timer routine got the correct arguments" ); - else - printf( - "TA1 - timer got (0x%x, %p) instead of (0x%x, %p)!!!!\n", - Timer_got_this_id, - Timer_got_this_pointer, - Timer_id[ 1 ], - Task_1 - ); - - puts( "TA1 - rtems_task_mode - enable ASRs" ); - status = rtems_task_mode( RTEMS_ASR, RTEMS_ASR_MASK, &previous_mode ); - directive_failed( status, "rtems_task_mode" ); - - puts( "TA1 - rtems_signal_catch - asraddr of NULL" ); - status = rtems_signal_catch( NULL, RTEMS_DEFAULT_MODES ); - directive_failed( status, "rtems_signal_catch" ); - - puts( "TA1 - rtems_task_delete - delete self" ); - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} diff --git a/testsuites/sptests/sp14/task2.c b/testsuites/sptests/sp14/task2.c deleted file mode 100644 index 248d29840b..0000000000 --- a/testsuites/sptests/sp14/task2.c +++ /dev/null @@ -1,47 +0,0 @@ -/* Task_2 - * - * This routine serves as a test task. It verifies that one task can - * send signals to another task ( invoking the other task's RTEMS_ASR ). - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -rtems_task Task_2( - rtems_task_argument argument -) -{ - rtems_status_code status; - - puts( "TA2 - rtems_signal_send - RTEMS_SIGNAL_17 to TA1" ); - status = rtems_signal_send( Task_id[ 1 ], RTEMS_SIGNAL_17 ); - directive_failed( status, "rtems_signal_send" ); - - puts( "TA2 - rtems_task_wake_after - yield processor" ); - status = rtems_task_wake_after( RTEMS_YIELD_PROCESSOR ); - directive_failed( status, "rtems_task_wake_after" ); - - puts("TA2 - rtems_signal_send - RTEMS_SIGNAL_18 and RTEMS_SIGNAL_19 to TA1"); - status = rtems_signal_send( Task_id[ 1 ], RTEMS_SIGNAL_18 | RTEMS_SIGNAL_19 ); - directive_failed( status, "rtems_signal_send" ); - - puts( "TA2 - rtems_task_wake_after - yield processor" ); - status = rtems_task_wake_after( RTEMS_YIELD_PROCESSOR ); - directive_failed( status, "rtems_task_wake_after" ); - - puts( "*** END OF TEST 14 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/sptests/sp15/.cvsignore b/testsuites/sptests/sp15/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/sptests/sp15/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/sptests/sp15/Makefile.am b/testsuites/sptests/sp15/Makefile.am deleted file mode 100644 index b14b8d1119..0000000000 --- a/testsuites/sptests/sp15/Makefile.am +++ /dev/null @@ -1,38 +0,0 @@ -## -## $Id$ -## - - -TEST = sp15 - -MANAGERS = io partition - -C_FILES = init.c task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/sptests.am - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/sptests/sp15/init.c b/testsuites/sptests/sp15/init.c deleted file mode 100644 index 747646fb37..0000000000 --- a/testsuites/sptests/sp15/init.c +++ /dev/null @@ -1,77 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - - puts( "\n\n*** TEST 15 ***" ); - - Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' ); - - Partition_name[ 1 ] = rtems_build_name( 'P', 'T', '1', ' ' ); - Partition_name[ 2 ] = rtems_build_name( 'P', 'T', '2', ' ' ); - - status = rtems_task_create( - Task_name[ 1 ], - 4, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 1 ] - ); - directive_failed( status, "rtems_task_create of TA1" ); - - status = rtems_task_start( Task_id[ 1 ], Task_1, 0 ); - directive_failed( status, "rtems_task_start of TA1" ); - - puts("INIT - rtems_partition_create - partition 1"); - status = rtems_partition_create( - Partition_name[ 1 ], - Area_1, - 4096, - 512, - RTEMS_DEFAULT_ATTRIBUTES, - &Partition_id[ 1 ] - ); - directive_failed( status, "rtems_partition_create of PT1" ); - - puts("INIT - rtems_partition_create - partition 2"); - status = rtems_partition_create( - Partition_name[ 2 ], - Area_2, - 274, - 128, - RTEMS_DEFAULT_ATTRIBUTES, - &Partition_id[ 2 ] - ); - directive_failed( status, "rtems_partition_create of PT2" ); - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} diff --git a/testsuites/sptests/sp15/sp15.doc b/testsuites/sptests/sp15/sp15.doc deleted file mode 100644 index dd8f7d6a37..0000000000 --- a/testsuites/sptests/sp15/sp15.doc +++ /dev/null @@ -1,23 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - -This file describes the directives and concepts tested by this test set. - -test set name: test15 - -directives: - ex_init, ex_start, t_create, t_start, t_delete, tm_tick, i_return, - pt_create, pt_ident, pt_getbuf, pt_retbuf, pt_delete - -concepts: - - a. This test checks out the partition manager. diff --git a/testsuites/sptests/sp15/sp15.scn b/testsuites/sptests/sp15/sp15.scn deleted file mode 100644 index 9cc7f1d200..0000000000 --- a/testsuites/sptests/sp15/sp15.scn +++ /dev/null @@ -1,16 +0,0 @@ -*** TEST 15 *** -INIT - rtems_partition_create - partition 1 -INIT - rtems_partition_create - partition 2 -TA1 - rtems_partition_ident - partition 1 id = 2a010001 -TA1 - rtems_partition_ident - partition 2 id = 2a010002 -TA1 - rtems_partition_get_buffer - buffer 1 from partition 1 - 0x00000000 -TA1 - rtems_partition_get_buffer - buffer 2 from partition 1 - 0x00000200 -TA1 - rtems_partition_get_buffer - buffer 1 from partition 2 - 0x00000000 -TA1 - rtems_partition_get_buffer - buffer 2 from partition 2 - 0x00000080 -TA1 - rtems_partition_return_buffer - buffer 1 to partition 1 - 0x00000000 -TA1 - rtems_partition_return_buffer - buffer 2 to partition 1 - 0x00000200 -TA1 - rtems_partition_return_buffer - buffer 1 to partition 2 - 0x00000000 -TA1 - rtems_partition_return_buffer - buffer 2 to partition 2 - 0x00000080 -TA1 - rtems_partition_delete - delete partition 1 -TA1 - rtems_partition_delete - delete partition 2 -*** END OF TEST 15 *** diff --git a/testsuites/sptests/sp15/system.h b/testsuites/sptests/sp15/system.h deleted file mode 100644 index be434159c3..0000000000 --- a/testsuites/sptests/sp15/system.h +++ /dev/null @@ -1,60 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_task Task_1( - rtems_task_argument argument -); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 2 -#define CONFIGURE_MAXIMUM_PARTITIONS 2 -#define CONFIGURE_TICKS_PER_TIMESLICE 100 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* global variables */ - -TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */ - -TEST_EXTERN rtems_name Partition_id[ 4 ]; /* array of partition ids */ -TEST_EXTERN rtems_name Partition_name[ 4 ]; /* array of partition names */ - -TEST_EXTERN rtems_unsigned8 Area_1[4096] CPU_STRUCTURE_ALIGNMENT; -TEST_EXTERN rtems_unsigned8 Area_2[274] CPU_STRUCTURE_ALIGNMENT; - -#define Put_address_from_area_1( _to_be_printed ) \ - printf( "0x%08lx", \ - (unsigned long)((rtems_unsigned8 *)(_to_be_printed) - Area_1 ) ) - -#define Put_address_from_area_2( _to_be_printed ) \ - printf( "0x%08lx", \ - (unsigned long)((rtems_unsigned8 *)(_to_be_printed) - Area_2 ) ) - -/* end of include file */ diff --git a/testsuites/sptests/sp15/task1.c b/testsuites/sptests/sp15/task1.c deleted file mode 100644 index e3644c6427..0000000000 --- a/testsuites/sptests/sp15/task1.c +++ /dev/null @@ -1,128 +0,0 @@ -/* Task_1 - * - * This routine serves as a test task. It tests the partition manager. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -rtems_task Task_1( - rtems_task_argument argument -) -{ - rtems_id ptid_1; - rtems_id ptid_2; - void *buffer_address_1; - void *buffer_address_2; - void *buffer_address_3; - void *buffer_address_4; - rtems_status_code status; - - puts_nocr( "TA1 - rtems_partition_ident - partition 1 id = " ); - status = rtems_partition_ident( - Partition_name[ 1 ], - RTEMS_SEARCH_ALL_NODES, - &ptid_1 - ); - directive_failed( status, "rtems_partition_ident of PT1" ); - printf( "%08x\n", ptid_1 ); - - puts_nocr( "TA1 - rtems_partition_ident - partition 2 id = " ); - status = rtems_partition_ident( - Partition_name[ 2 ], - RTEMS_SEARCH_ALL_NODES, - &ptid_2 - ); - directive_failed( status, "rtems_partition_ident of PT2" ); - printf( "%08x\n", ptid_2 ); - - puts_nocr( - "TA1 - rtems_partition_get_buffer - buffer 1 from partition 1 - " - ); - status = rtems_partition_get_buffer( ptid_1, &buffer_address_1 ); - directive_failed( status, "rtems_partition_get_buffer" ); - Put_address_from_area_1( buffer_address_1 ); - new_line; - - puts_nocr( - "TA1 - rtems_partition_get_buffer - buffer 2 from partition 1 - " - ); - status = rtems_partition_get_buffer( ptid_1, &buffer_address_2 ); - directive_failed( status, "rtems_partition_get_buffer" ); - Put_address_from_area_1( buffer_address_2 ); - new_line; - - puts_nocr( - "TA1 - rtems_partition_get_buffer - buffer 1 from partition 2 - " - ); - status = rtems_partition_get_buffer( ptid_2, &buffer_address_3 ); - directive_failed( status, "rtems_partition_get_buffer" ); - Put_address_from_area_2( buffer_address_3 ); - new_line; - - puts_nocr( - "TA1 - rtems_partition_get_buffer - buffer 2 from partition 2 - " - ); - status = rtems_partition_get_buffer( ptid_2, &buffer_address_4 ); - directive_failed( status, "rtems_partition_get_buffer" ); - Put_address_from_area_2( buffer_address_4 ); - new_line; - - puts_nocr( - "TA1 - rtems_partition_return_buffer - buffer 1 to partition 1 - " - ); - Put_address_from_area_1( buffer_address_1 ); - new_line; - status = rtems_partition_return_buffer( ptid_1, buffer_address_1 ); - directive_failed( status, "rtems_partition_return_buffer" ); - - puts_nocr( - "TA1 - rtems_partition_return_buffer - buffer 2 to partition 1 - " - ); - Put_address_from_area_1( buffer_address_2 ); - new_line; - status = rtems_partition_return_buffer( ptid_1, buffer_address_2 ); - directive_failed( status, "rtems_partition_return_buffer" ); - - puts_nocr( - "TA1 - rtems_partition_return_buffer - buffer 1 to partition 2 - " - ); - Put_address_from_area_2( buffer_address_3 ); - new_line; - status = rtems_partition_return_buffer( ptid_2, buffer_address_3 ); - directive_failed( status, "rtems_partition_return_buffer" ); - - puts_nocr( - "TA1 - rtems_partition_return_buffer - buffer 2 to partition 2 - " - ); - Put_address_from_area_2( buffer_address_4 ); - new_line; - status = rtems_partition_return_buffer( ptid_2, buffer_address_4 ); - directive_failed( status, "rtems_partition_return_buffer" ); - - puts( "TA1 - rtems_partition_delete - delete partition 1" - ); - status = rtems_partition_delete( ptid_1 ); - directive_failed( status, "rtems_partition_delete" ); - - puts( "TA1 - rtems_partition_delete - delete partition 2" - ); - status = rtems_partition_delete( ptid_2 ); - directive_failed( status, "rtems_partition_delete" ); - - puts( "*** END OF TEST 15 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/sptests/sp16/.cvsignore b/testsuites/sptests/sp16/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/sptests/sp16/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/sptests/sp16/Makefile.am b/testsuites/sptests/sp16/Makefile.am deleted file mode 100644 index 4de1ba7664..0000000000 --- a/testsuites/sptests/sp16/Makefile.am +++ /dev/null @@ -1,38 +0,0 @@ -## -## $Id$ -## - - -TEST = sp16 - -MANAGERS = io region - -C_FILES = init.c task1.c task2.c task3.c task4.c task5.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/sptests.am - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/sptests/sp16/init.c b/testsuites/sptests/sp16/init.c deleted file mode 100644 index c78eca4b24..0000000000 --- a/testsuites/sptests/sp16/init.c +++ /dev/null @@ -1,127 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - - puts( "\n\n*** TEST 16 ***" ); - - 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', ' ' ); - - status = rtems_task_create( - Task_name[ 1 ], - BASE_PRIORITY, - RTEMS_MINIMUM_STACK_SIZE * 2, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 1 ] - ); - directive_failed( status, "rtems_task_create of TA1" ); - - status = rtems_task_create( - Task_name[ 2 ], - BASE_PRIORITY, - RTEMS_MINIMUM_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 ], - BASE_PRIORITY, - RTEMS_MINIMUM_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, 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" ); - - Region_name[ 1 ] = rtems_build_name( 'R', 'N', '1', ' ' ); - Region_name[ 2 ] = rtems_build_name( 'R', 'N', '2', ' ' ); - Region_name[ 3 ] = rtems_build_name( 'R', 'N', '3', ' ' ); - Region_name[ 4 ] = rtems_build_name( 'R', 'N', '4', ' ' ); - - status = rtems_region_create( - Region_name[ 1 ], - Area_1, - 4096, - 128, - RTEMS_DEFAULT_ATTRIBUTES, - &Region_id[ 1 ] - ); - directive_failed( status, "rtems_region_create of RN1" ); - - status = rtems_region_create( - Region_name[ 2 ], - Area_2, - 4096, - 128, - RTEMS_PRIORITY, - &Region_id[ 2 ] - ); - directive_failed( status, "rtems_region_create of RN2" ); - - status = rtems_region_create( - Region_name[ 3 ], - Area_3, - 4096, - 128, - RTEMS_DEFAULT_ATTRIBUTES, - &Region_id[ 3 ] - ); - directive_failed( status, "rtems_region_create of RN3" ); - - status = rtems_region_create( - Region_name[ 4 ], - Area_4, - 4096, - 128, - RTEMS_DEFAULT_ATTRIBUTES, - &Region_id[ 4 ] - ); - directive_failed( status, "rtems_region_create of RN4" ); - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} diff --git a/testsuites/sptests/sp16/sp16.doc b/testsuites/sptests/sp16/sp16.doc deleted file mode 100644 index d93abe33c4..0000000000 --- a/testsuites/sptests/sp16/sp16.doc +++ /dev/null @@ -1,23 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - -This file describes the directives and concepts tested by this test set. - -test set name: test16 - -directives: - ex_init, ex_start, t_create, t_start, t_delete, tm_tick, i_return, - rn_create, rn_ident, rn_getbuf, rn_retbuf, rn_delete - -concepts: - - a. This test checks out the region manager. diff --git a/testsuites/sptests/sp16/sp16.scn b/testsuites/sptests/sp16/sp16.scn deleted file mode 100644 index 113d08f567..0000000000 --- a/testsuites/sptests/sp16/sp16.scn +++ /dev/null @@ -1,58 +0,0 @@ -*** TEST 16 *** -TA1 - rtems_region_ident - rnid => 32010002 -TA1 - rtems_region_get_segment - wait on 100 byte segment from region 2 -TA1 - got segment from region 2 - 0x00000f78 -TA1 - rtems_region_get_segment - wait on 3K segment from region 3 -TA1 - got segment from region 3 - 0x000003f8 -TA1 - rtems_region_get_segment - get 3080 byte segment from region 1 - NO_WAIT -TA1 - got segment from region 1 - 0x00000378 -TA1 - rtems_task_wake_after - yield processor -TA2 - rtems_region_get_segment - wait on 2K segment from region 1 -TA3 - rtems_region_get_segment - wait on 3968 byte segment from region 2 - -TA1 - rtems_region_return_segment - return segment to region 1 - 0x00000378 -TA1 - rtems_region_get_segment - wait 10 seconds for 3K segment from region 1 -TA2 - got segment from region 1 - 0x000007f8 -TA2 - rtems_region_return_segment - return segment to region 1 - 0x000007f8 -TA2 - rtems_task_set_priority - make self highest priority task -TA2 - rtems_region_get_segment - wait on 3968 byte segment -TA1 - got segment from region 1 - 0x000003f8 -TA1 - rtems_region_return_segment - return segment to region 2 - 0x00000f78 -TA2 - got segment from region 2 - 0x00000008 -TA2 - rtems_region_return_segment - return segment to region 2 - 0x00000008 -TA2 - rtems_task_delete - delete self -TA1 - rtems_task_wake_after - yield processor -TA3 - got segment from region 2 - 0x00000008 -TA3 - rtems_region_get_segment - wait on 2K segment from region 3 -TA1 - rtems_task_delete - delete TA3 - -TA1 - rtems_task_wake_after - yield processor -TA4 - rtems_region_get_segment - wait on 1.5K segment from region 1 -TA5 - rtems_region_get_segment - wait on 1.5K segment from region 1 -TA1 - rtems_region_return_segment - return segment to region 1 - 0x000003f8 -TA1 - rtems_task_wake_after - yield processor -TA4 - got and returned 0x000009f8 -TA5 - got and returned 0x000003f0 -TA1 - rtems_region_get_segment - wait 10 seconds for 3K segment from region 1 -TA1 - got segment from region 1 - 0x000003f8 -TA1 - rtems_task_wake_after - yield processor -TA4 - rtems_region_get_segment - wait on 3K segment from region 1 -TA5 - rtems_region_get_segment - wait on 3K segment from region 1 -TA1 - rtems_task_delete - delete TA4 -TA1 - rtems_region_return_segment - return segment to region 1 - 0x000003f8 -TA1 - rtems_task_wake_after - yield processor -TA5 - got segment from region 1 - 0x000003f8 -TA5 - rtems_region_return_segment - return segment to region 1 - 0x000003f8 -TA5 - rtems_task_delete - delete self -TA1 - rtems_region_delete - delete region 1 -TA1 - rtems_region_get_segment - get 3K segment from region 4 -TA1 - got segment from region 4 - 0x000003f8 -TA1 - rtems_region_get_segment - attempt to get 3K segment from region 4 -TA1 - rtems_task_get_note - RTEMS_UNSATISFIED -TA1 - rtems_region_extend - extend region 4 by 4K -TA1 - rtems_region_get_segment - attempt to get 3K segment from region 4 -TA1 - got 3K segment from region 4 - 0x00001400 -TA1 - rtems_region_return_segment - return segment to region 4 - 0x000003f8 -TA1 - rtems_region_return_segment - return segment to region 4 - 0x00001400 -TA1 - rtems_region_delete - delete region 4 -*** END OF TEST 16 *** diff --git a/testsuites/sptests/sp16/system.h b/testsuites/sptests/sp16/system.h deleted file mode 100644 index fc218652b2..0000000000 --- a/testsuites/sptests/sp16/system.h +++ /dev/null @@ -1,89 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_task Task_1( - rtems_task_argument argument -); - -rtems_task Task_2( - rtems_task_argument argument -); - -rtems_task Task_3( - rtems_task_argument argument -); - -rtems_task Task_4( - rtems_task_argument argument -); - -rtems_task Task5( - rtems_task_argument argument -); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 4 -#define CONFIGURE_MAXIMUM_REGIONS 4 -#define CONFIGURE_TICKS_PER_TIMESLICE 100 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_EXTRA_TASK_STACKS (1 * RTEMS_MINIMUM_STACK_SIZE) - -#include - -/* global variables */ - -TEST_EXTERN rtems_id Task_id[ 6 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 6 ]; /* array of task names */ -TEST_EXTERN rtems_id Region_id[ 5 ]; /* array of region ids */ -TEST_EXTERN rtems_name Region_name[ 5 ]; /* array of region names */ - -TEST_EXTERN rtems_unsigned8 Area_1[4096] CPU_STRUCTURE_ALIGNMENT; -TEST_EXTERN rtems_unsigned8 Area_2[4096] CPU_STRUCTURE_ALIGNMENT; -TEST_EXTERN rtems_unsigned8 Area_3[4096] CPU_STRUCTURE_ALIGNMENT; -TEST_EXTERN rtems_unsigned8 Area_4[8192] CPU_STRUCTURE_ALIGNMENT; - -#define BASE_PRIORITY 140 - -#define Put_address_from_area_1( _to_be_printed ) \ - printf( "0x%08lx", \ - (unsigned long) ((rtems_unsigned8 *)(_to_be_printed) - Area_1 ) ) - -#define Put_address_from_area_2( _to_be_printed ) \ - printf( "0x%08lx", \ - (unsigned long) ((rtems_unsigned8 *)(_to_be_printed) - Area_2 ) ) - -#define Put_address_from_area_3( _to_be_printed ) \ - printf( "0x%08lx", \ - (unsigned long) ((rtems_unsigned8 *)(_to_be_printed) - Area_3 ) ) - -#define Put_address_from_area_4( _to_be_printed ) \ - printf( "0x%08lx", \ - (unsigned long) ((rtems_unsigned8 *)(_to_be_printed) - Area_4 ) ) - -/* end of include file */ diff --git a/testsuites/sptests/sp16/task1.c b/testsuites/sptests/sp16/task1.c deleted file mode 100644 index 480c47fee7..0000000000 --- a/testsuites/sptests/sp16/task1.c +++ /dev/null @@ -1,281 +0,0 @@ -/* Task_1 - * - * This routine serves as a test task. It tests the region manager. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -rtems_task Task_1( - rtems_task_argument argument -) -{ - rtems_id rnid; - void *segment_address_1; - void *segment_address_2; - void *segment_address_3; - void *segment_address_4; - rtems_status_code status; - - status = rtems_region_ident( Region_name[ 1 ], &rnid ); - printf( "TA1 - rtems_region_ident - rnid => %08x\n", rnid ); - directive_failed( status, "rtems_region_ident of RN1" ); - - puts( - "TA1 - rtems_region_get_segment - wait on 100 byte segment from region 2" - ); - status = rtems_region_get_segment( - Region_id[ 2 ], - 100, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &segment_address_1 - ); - directive_failed( status, "rtems_region_get_segment" ); - puts_nocr( "TA1 - got segment from region 2 - " ); - Put_address_from_area_2( segment_address_1 ); - new_line; - - puts( "TA1 - rtems_region_get_segment - wait on 3K segment from region 3" ); - status = rtems_region_get_segment( - Region_id[ 3 ], - 3072, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &segment_address_2 - ); - directive_failed( status, "rtems_region_get_segment" ); - puts_nocr( "TA1 - got segment from region 3 - " ); - Put_address_from_area_3( segment_address_2 ); - new_line; - - puts_nocr( "TA1 - rtems_region_get_segment - get 3080 byte segment " ); - puts ( "from region 1 - NO_WAIT" ); - status = rtems_region_get_segment( - Region_id[ 1 ], - 3080, - RTEMS_NO_WAIT, - RTEMS_NO_TIMEOUT, - &segment_address_3 - ); - directive_failed( status, "rtems_region_get_segment" ); - puts_nocr( "TA1 - got segment from region 1 - " ); - Put_address_from_area_1( segment_address_3 ); - new_line; - - puts( "TA1 - rtems_task_wake_after - yield processor" ); - status = rtems_task_wake_after( RTEMS_YIELD_PROCESSOR ); - directive_failed( status, "rtems_task_wake_after" ); - -rtems_test_pause(); - - puts_nocr( - "TA1 - rtems_region_return_segment - return segment to region 1 - " - ); - Put_address_from_area_1( segment_address_3 ); - status = rtems_region_return_segment( Region_id[ 1 ], segment_address_3 ); - directive_failed( status, "rtems_region_return_segment" ); - new_line; - - puts( - "TA1 - rtems_region_get_segment - wait 10 seconds for 3K " - "segment from region 1" - ); - status = rtems_region_get_segment( - Region_id[ 1 ], - 3072, - RTEMS_DEFAULT_OPTIONS, - 10 * TICKS_PER_SECOND, - &segment_address_4 - ); - directive_failed( status, "rtems_region_get_segment" ); - puts_nocr( "TA1 - got segment from region 1 - " ); - Put_address_from_area_1( segment_address_4 ); - new_line; - - puts_nocr( - "TA1 - rtems_region_return_segment - return segment to region 2 - " - ); - Put_address_from_area_2( segment_address_1 ); - new_line; - status = rtems_region_return_segment( Region_id[ 2 ], segment_address_1 ); - directive_failed( status, "rtems_region_return_segment" ); - - puts( "TA1 - rtems_task_wake_after - yield processor" ); - status = rtems_task_wake_after( RTEMS_YIELD_PROCESSOR ); - directive_failed( status, "rtems_task_wake_after" ); - - puts( "TA1 - rtems_task_delete - delete TA3" ); - status = rtems_task_delete( Task_id[ 3 ] ); - directive_failed( status, "rtems_task_delete of TA3" ); - -rtems_test_pause(); - - status = rtems_task_create( - Task_name[ 4 ], - BASE_PRIORITY, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 4 ] - ); - directive_failed( status, "rtems_task_create of TA4" ); - - status = rtems_task_create( - Task_name[ 5 ], - BASE_PRIORITY, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 5 ] - ); - directive_failed( status, "rtems_task_create of TA5" ); - - status = rtems_task_start( Task_id[ 4 ], Task_4, 0 ); - directive_failed( status, "rtems_task_start of TA4" ); - - status = rtems_task_start( Task_id[ 5 ], Task5, 0 ); - directive_failed( status, "rtems_task_start of TA5" ); - - puts( "TA1 - rtems_task_wake_after - yield processor" ); - status = rtems_task_wake_after( 1 * TICKS_PER_SECOND ); - directive_failed( status, "rtems_task_wake_after" ); - - puts_nocr( - "TA1 - rtems_region_return_segment - return segment to region 1 - " - ); - Put_address_from_area_1( segment_address_4 ); - status = rtems_region_return_segment( Region_id[ 1 ], segment_address_4 ); - directive_failed( status, "rtems_region_return_segment" ); - new_line; - - puts( "TA1 - rtems_task_wake_after - yield processor" ); - status = rtems_task_wake_after( 1 * TICKS_PER_SECOND ); - directive_failed( status, "rtems_task_wake_after" ); - - puts_nocr( "TA1 - rtems_region_get_segment - wait 10 seconds for 3K " ); - puts ( "segment from region 1"); - status = rtems_region_get_segment( - Region_id[ 1 ], - 3072, - RTEMS_DEFAULT_OPTIONS, - 10 * TICKS_PER_SECOND, - &segment_address_4 - ); - directive_failed( status, "rtems_region_get_segment" ); - puts_nocr( "TA1 - got segment from region 1 - " ); - Put_address_from_area_1( segment_address_4 ); - new_line; - - puts( "TA1 - rtems_task_wake_after - yield processor" ); - status = rtems_task_wake_after( 1 * TICKS_PER_SECOND ); - directive_failed( status, "rtems_task_wake_after" ); - - puts( "TA1 - rtems_task_delete - delete TA4" ); - status = rtems_task_delete( Task_id[ 4 ] ); - directive_failed( status, "rtems_task_delete of TA4" ); - - puts_nocr( - "TA1 - rtems_region_return_segment - return segment to region 1 - " - ); - Put_address_from_area_1( segment_address_4 ); - status = rtems_region_return_segment( Region_id[ 1 ], segment_address_4 ); - directive_failed( status, "rtems_region_return_segment" ); - new_line; - - puts( "TA1 - rtems_task_wake_after - yield processor" ); - status = rtems_task_wake_after( RTEMS_YIELD_PROCESSOR ); - - puts( "TA1 - rtems_region_delete - delete region 1" ); - status = rtems_region_delete( Region_id[ 1 ] ); - directive_failed( status, "rtems_region_delete" ); - - puts( "TA1 - rtems_region_get_segment - get 3K segment from region 4" ); - status = rtems_region_get_segment( - Region_id[ 4 ], - 3072, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &segment_address_1 - ); - directive_failed( status, "rtems_region_get_segment" ); - puts_nocr( "TA1 - got segment from region 4 - " ); - Put_address_from_area_4( segment_address_1 ); - new_line; - - puts( - "TA1 - rtems_region_get_segment - attempt to get 3K segment from region 4" - ); - status = rtems_region_get_segment( - Region_id[ 4 ], - 3072, - RTEMS_NO_WAIT, - RTEMS_NO_TIMEOUT, - &segment_address_2 - ); - fatal_directive_status( - status, - RTEMS_UNSATISFIED, - "rtems_task_get_segment with no memory left" - ); - puts( "TA1 - rtems_task_get_note - RTEMS_UNSATISFIED" ); - - puts( "TA1 - rtems_region_extend - extend region 4 by 4K" ); - status = rtems_region_extend( - Region_id[ 4 ], - &Area_4[4096], - 4096 - ); - directive_failed( status, "rtems_region_extend" ); - - puts( - "TA1 - rtems_region_get_segment - attempt to get 3K segment from region 4" - ); - status = rtems_region_get_segment( - Region_id[ 4 ], - 3072, - RTEMS_NO_WAIT, - RTEMS_NO_TIMEOUT, - &segment_address_3 - ); - directive_failed( status, "rtems_region_get_segment" ); - puts_nocr( "TA1 - got 3K segment from region 4 - " ); - Put_address_from_area_4( segment_address_3 ); - new_line; - - puts_nocr( - "TA1 - rtems_region_return_segment - return segment to region 4 - " - ); - Put_address_from_area_4( segment_address_1 ); - status = rtems_region_return_segment( Region_id[ 4 ], segment_address_1 ); - directive_failed( status, "rtems_region_return_segment" ); - new_line; - - puts_nocr( - "TA1 - rtems_region_return_segment - return segment to region 4 - " - ); - Put_address_from_area_4( segment_address_3 ); - status = rtems_region_return_segment( Region_id[ 4 ], segment_address_3 ); - directive_failed( status, "rtems_region_return_segment" ); - new_line; - - puts( "TA1 - rtems_region_delete - delete region 4" ); - status = rtems_region_delete( Region_id[ 4 ] ); - directive_failed( status, "rtems_region_delete" ); - - puts( "*** END OF TEST 16 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/sptests/sp16/task2.c b/testsuites/sptests/sp16/task2.c deleted file mode 100644 index 8bed4585e1..0000000000 --- a/testsuites/sptests/sp16/task2.c +++ /dev/null @@ -1,85 +0,0 @@ -/* Task_2 - * - * This routine serves as a test task. It competes with the other tasks - * for region resources. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -rtems_task Task_2( - rtems_task_argument argument -) -{ - rtems_status_code status; - rtems_task_priority previous_priority; - void *segment_address_1; - void *segment_address_2; - - puts( "TA2 - rtems_region_get_segment - wait on 2K segment from region 1" ); - status = rtems_region_get_segment( - Region_id[ 1 ], - 2048, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &segment_address_1 - ); - directive_failed( status, "rtems_region_get_segment" ); - puts_nocr( "TA2 - got segment from region 1 - " ); - Put_address_from_area_1( segment_address_1 ); - new_line; - - puts_nocr( - "TA2 - rtems_region_return_segment - return segment to region 1 - " - ); - Put_address_from_area_1( segment_address_1 ); - status = rtems_region_return_segment( Region_id[ 1 ], segment_address_1 ); - directive_failed( status, "rtems_region_return_segment" ); - new_line; - - puts( "TA2 - rtems_task_set_priority - make self highest priority task" ); - status = rtems_task_set_priority( - RTEMS_SELF, - BASE_PRIORITY-1, - &previous_priority - ); - directive_failed( status, "rtems_task_set_priority" ); - - puts("TA2 - rtems_region_get_segment - wait on 3968 byte segment"); - status = rtems_region_get_segment( - Region_id[ 2 ], - 3968, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &segment_address_2 - ); - directive_failed( status, "rtems_region_get_segment" ); - puts_nocr( "TA2 - got segment from region 2 - "); - Put_address_from_area_2( segment_address_2 ); - new_line; - - puts_nocr( - "TA2 - rtems_region_return_segment - return segment to region 2 - " - ); - Put_address_from_area_2( segment_address_2 ); - status = rtems_region_return_segment( Region_id[ 2 ], segment_address_2 ); - directive_failed( status, "rtems_region_return_segment" ); - new_line; - - puts( "TA2 - rtems_task_delete - delete self" ); - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} diff --git a/testsuites/sptests/sp16/task3.c b/testsuites/sptests/sp16/task3.c deleted file mode 100644 index 4b49b8e19d..0000000000 --- a/testsuites/sptests/sp16/task3.c +++ /dev/null @@ -1,56 +0,0 @@ -/* Task_3 - * - * This routine serves as a test task. It competes with the other tasks - * for region resources. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -rtems_task Task_3( - rtems_task_argument argument -) -{ - rtems_status_code status; - void *segment_address_1; - void *segment_address_2; - - puts( - "TA3 - rtems_region_get_segment - wait on 3968 byte segment from region 2" - ); - status = rtems_region_get_segment( - Region_id[ 2 ], - 3968, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &segment_address_1 - ); - directive_failed( status, "rtems_region_get_segment" ); - puts_nocr( "TA3 - got segment from region 2 - " ); - Put_address_from_area_2( segment_address_1 ); - new_line; - directive_failed( status, "rtems_region_return_segment" ); - - puts( "TA3 - rtems_region_get_segment - wait on 2K segment from region 3" ); - status = rtems_region_get_segment( - Region_id[ 3 ], - 2048, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &segment_address_2 - ); - directive_failed( status, "rtems_region_get_segment" ); -} diff --git a/testsuites/sptests/sp16/task4.c b/testsuites/sptests/sp16/task4.c deleted file mode 100644 index ae0814b7eb..0000000000 --- a/testsuites/sptests/sp16/task4.c +++ /dev/null @@ -1,59 +0,0 @@ -/* Task_4 - * - * This routine serves as a test task. It competes with the other tasks - * for region resources. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -rtems_task Task_4( - rtems_task_argument argument -) -{ - rtems_status_code status; - void *segment_address_1; - void *segment_address_2; - - puts( "TA4 - rtems_region_get_segment - wait on 1.5K segment from region 1" ); - status = rtems_region_get_segment( - Region_id[ 1 ], - 1536, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &segment_address_1 - ); - directive_failed( status, "rtems_region_get_segment" ); - - status = rtems_region_return_segment( Region_id[ 1 ], segment_address_1 ); - directive_failed( status, "rtems_region_return_segment" ); - puts_nocr( "TA4 - got and returned " ); - Put_address_from_area_1( segment_address_1 ); - new_line; - - status = rtems_task_wake_after( TICKS_PER_SECOND ); - directive_failed( status, "rtems_task_wake_after" ); - - puts( "TA4 - rtems_region_get_segment - wait on 3K segment from region 1" ); - status = rtems_region_get_segment( - Region_id[ 1 ], - 3072, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &segment_address_2 - ); - directive_failed( status, "rtems_region_get_segment" ); -} diff --git a/testsuites/sptests/sp16/task5.c b/testsuites/sptests/sp16/task5.c deleted file mode 100644 index 770dc0f081..0000000000 --- a/testsuites/sptests/sp16/task5.c +++ /dev/null @@ -1,72 +0,0 @@ -/* Task5 - * - * This routine serves as a test task. It competes with the other tasks - * for region resources. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -rtems_task Task5( - rtems_task_argument argument -) -{ - void *segment_address_1; - void *segment_address_2; - rtems_status_code status; - - puts( "TA5 - rtems_region_get_segment - wait on 1.5K segment from region 1" ); - status = rtems_region_get_segment( - Region_id[ 1 ], - 1536, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &segment_address_1 - ); - directive_failed( status, "rtems_region_get_segment" ); - - status = rtems_region_return_segment( Region_id[ 1 ], segment_address_1 ); - directive_failed( status, "rtems_region_return_segment" ); - puts_nocr( "TA5 - got and returned " ); - Put_address_from_area_1( segment_address_1 ); - new_line; - - status = rtems_task_wake_after( TICKS_PER_SECOND ); - directive_failed( status, "rtems_task_wake_after" ); - - puts( "TA5 - rtems_region_get_segment - wait on 3K segment from region 1" ); - status = rtems_region_get_segment( - Region_id[ 1 ], - 3072, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &segment_address_2 - ); - puts_nocr( "TA5 - got segment from region 1 - " ); - Put_address_from_area_1( segment_address_2 ); - new_line; - - status = rtems_region_return_segment( Region_id[ 1 ], segment_address_2 ); - puts_nocr( - "TA5 - rtems_region_return_segment - return segment to region 1 - " - ); - Put_address_from_area_1( segment_address_2 ); - new_line; - - puts( "TA5 - rtems_task_delete - delete self" ); - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} diff --git a/testsuites/sptests/sp17/.cvsignore b/testsuites/sptests/sp17/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/sptests/sp17/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/sptests/sp17/Makefile.am b/testsuites/sptests/sp17/Makefile.am deleted file mode 100644 index a96d0d56a6..0000000000 --- a/testsuites/sptests/sp17/Makefile.am +++ /dev/null @@ -1,38 +0,0 @@ -## -## $Id$ -## - - -TEST = sp17 - -MANAGERS = io signal - -C_FILES = init.c asr.c task1.c task2.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/sptests.am - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/sptests/sp17/asr.c b/testsuites/sptests/sp17/asr.c deleted file mode 100644 index 4be76d76e0..0000000000 --- a/testsuites/sptests/sp17/asr.c +++ /dev/null @@ -1,31 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -rtems_asr Process_asr( - rtems_signal_set signal_set -) -{ - rtems_status_code status; - - status = rtems_task_resume( Task_id[ 2 ] ); - directive_failed( status, "RTEMS_ASR - rtems_task_resume of TA2" ); -} diff --git a/testsuites/sptests/sp17/init.c b/testsuites/sptests/sp17/init.c deleted file mode 100644 index 241070de02..0000000000 --- a/testsuites/sptests/sp17/init.c +++ /dev/null @@ -1,68 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - - puts( "\n\n*** TEST 17 ***" ); - - Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' ); - Task_name[ 2 ] = rtems_build_name( 'T', 'A', '2', ' ' ); - - Task_2_preempted = FALSE; - - status = rtems_task_create( - Task_name[ 1 ], - 2, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 1 ] - ); - directive_failed( status, "rtems_task_create of TA1" ); - - status = rtems_task_start( Task_id[ 1 ], Task_1, 0 ); - directive_failed( status, "rtems_task_start of TA1" ); - - status = rtems_task_create( - Task_name[ 2 ], - 1, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 2 ] - ); - directive_failed( status, "rtems_task_create of TA2" ); - - 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/sp17/sp17.doc b/testsuites/sptests/sp17/sp17.doc deleted file mode 100644 index 2c4a79cb1a..0000000000 --- a/testsuites/sptests/sp17/sp17.doc +++ /dev/null @@ -1,34 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - -This file describes the directives and concepts tested by this test set. - -test set name: test17 - -directives: - ex_init, ex_start, t_create, t_start, tm_tick, i_return, t_ident, - as_catch, as_return - -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 executive initialization performed correctly. - - d. Verifies that a task can get the task identification number - of another task. - - e. Verifies that a signal can be sent to a remote task. diff --git a/testsuites/sptests/sp17/sp17.scn b/testsuites/sptests/sp17/sp17.scn deleted file mode 100644 index 47fd140e2a..0000000000 --- a/testsuites/sptests/sp17/sp17.scn +++ /dev/null @@ -1,8 +0,0 @@ -*** TEST 17 *** -TA2 - Suspending self -TA1 - rtems_signal_catch: initializing signal catcher -TA1 - Sending signal to self -TA2 - signal_return preempted correctly -TA1 - TA2 correctly preempted me -TA1 - Got Back!!! -*** END OF TEST 17 *** diff --git a/testsuites/sptests/sp17/system.h b/testsuites/sptests/sp17/system.h deleted file mode 100644 index b86cc5ff09..0000000000 --- a/testsuites/sptests/sp17/system.h +++ /dev/null @@ -1,56 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_asr Process_asr( - rtems_signal_set signal_set -); - -rtems_task Task_1( - rtems_task_argument argument -); - -rtems_task Task_2( - rtems_task_argument argument -); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 3 -#define CONFIGURE_MICROSECONDS_PER_TICK RTEMS_MILLISECONDS_TO_MICROSECONDS(25) -#define CONFIGURE_TICKS_PER_TIMESLICE 1000 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* global variables */ - -TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */ - -TEST_EXTERN rtems_unsigned32 Task_2_preempted; - -/* end of include file */ diff --git a/testsuites/sptests/sp17/task1.c b/testsuites/sptests/sp17/task1.c deleted file mode 100644 index 8ef50d8324..0000000000 --- a/testsuites/sptests/sp17/task1.c +++ /dev/null @@ -1,47 +0,0 @@ -/* Task_1 - * - * 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -rtems_task Task_1( - rtems_task_argument argument -) -{ - rtems_status_code status; - - puts( "TA1 - rtems_signal_catch: initializing signal catcher" ); - status = rtems_signal_catch( Process_asr, RTEMS_NO_ASR | RTEMS_NO_PREEMPT ); - directive_failed( status, "rtems_signal_catch" ); - - puts( "TA1 - Sending signal to self" ); - status = rtems_signal_send( Task_id[ 1 ], RTEMS_SIGNAL_16 ); - directive_failed( status, "rtems_signal_send" ); - - if ( Task_2_preempted == TRUE ) - puts( "TA1 - TA2 correctly preempted me" ); - - puts("TA1 - Got Back!!!"); - - puts( "*** END OF TEST 17 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/sptests/sp17/task2.c b/testsuites/sptests/sp17/task2.c deleted file mode 100644 index 4935c57ba8..0000000000 --- a/testsuites/sptests/sp17/task2.c +++ /dev/null @@ -1,44 +0,0 @@ -/* Task_2 - * - * 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -rtems_task Task_2( - rtems_task_argument argument -) -{ - rtems_status_code status; - - Task_2_preempted = FALSE; - - puts( "TA2 - Suspending self" ); - status = rtems_task_suspend( RTEMS_SELF ); - directive_failed( status, "rtems_task_suspend of TA2" ); - - puts( "TA2 - signal_return preempted correctly" ); - - Task_2_preempted = TRUE; - - status = rtems_task_suspend( RTEMS_SELF ); - directive_failed( status, "rtems_task_suspend of TA2" ); -} diff --git a/testsuites/sptests/sp19/.cvsignore b/testsuites/sptests/sp19/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/sptests/sp19/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/sptests/sp19/Makefile.am b/testsuites/sptests/sp19/Makefile.am deleted file mode 100644 index f10491ef3f..0000000000 --- a/testsuites/sptests/sp19/Makefile.am +++ /dev/null @@ -1,38 +0,0 @@ -## -## $Id$ -## - - -TEST = sp19 - -MANAGERS = io - -C_FILES = init.c first.c fptask.c task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h fptest.h inttest.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/sptests.am - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/sptests/sp19/first.c b/testsuites/sptests/sp19/first.c deleted file mode 100644 index aa566e1d30..0000000000 --- a/testsuites/sptests/sp19/first.c +++ /dev/null @@ -1,65 +0,0 @@ -/* First_FP_task - * - * This routine serves as a floating point test task. It verifies the - * basic task switching capabilities of the executive when floating - * point is configured. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" -#include "fptest.h" -#include "inttest.h" - -rtems_task First_FP_task( - rtems_task_argument argument -) -{ - rtems_status_code status; - rtems_id tid; - rtems_time_of_day time; - rtems_unsigned32 task_index; - INTEGER_DECLARE; - FP_DECLARE; - - status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid ); - directive_failed( status, "rtems_task_ident" ); - - task_index = task_number( tid ); - - INTEGER_LOAD( INTEGER_factors[ task_index ] ); - FP_LOAD( FP_factors[ task_index ] ); - - put_name( Task_name[ task_index ], FALSE ); - printf( " - integer base = (0x%x)\n", INTEGER_factors[ task_index ] ); - put_name( Task_name[ task_index ], FALSE ); -#if ( RTEMS_HAS_HARDWARE_FP == 1 ) - printf( " - float base = (%g)\n", FP_factors[ task_index ] ); -#else - printf( " - float base = (NA)\n" ); -#endif - - if ( argument == 0 ) { - status = rtems_task_restart( RTEMS_SELF, 1 ); - directive_failed( status, "rtems_task_restart of RTEMS_SELF" ); - } else { - build_time( &time, 12, 31, 1988, 9, 0, 0, 0 ); - status = rtems_clock_set( &time ); - directive_failed( status, "rtems_clock_set" ); - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); - } -} diff --git a/testsuites/sptests/sp19/fptask.c b/testsuites/sptests/sp19/fptask.c deleted file mode 100644 index d82f8e6724..0000000000 --- a/testsuites/sptests/sp19/fptask.c +++ /dev/null @@ -1,97 +0,0 @@ -/* FP_task - * - * This routine serves as a floating point test task. It verifies the - * basic task switching capabilities of the executive when floating - * point is configured. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" -#include "fptest.h" -#include "inttest.h" - -rtems_task FP_task( - rtems_task_argument argument -) -{ - rtems_status_code status; - rtems_id tid; - rtems_time_of_day time; - rtems_unsigned32 task_index; - rtems_unsigned32 previous_seconds; - INTEGER_DECLARE; - FP_DECLARE; - - status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid ); - directive_failed( status, "rtems_task_ident of self" ); - - task_index = task_number( tid ); - - INTEGER_LOAD( INTEGER_factors[ task_index ] ); - FP_LOAD( FP_factors[ task_index ] ); - - put_name( Task_name[ task_index ], FALSE ); - printf( " - integer base = (0x%x)\n", INTEGER_factors[ task_index ] ); - put_name( Task_name[ task_index ], FALSE ); -#if ( RTEMS_HAS_HARDWARE_FP == 1 ) - printf( " - float base = (%g)\n", FP_factors[ task_index ] ); -#else - printf( " - float base = (NA)\n" ); -#endif - - previous_seconds = -1; - - while( FOREVER ) { - - status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time ); - directive_failed( status, "rtems_clock_get" ); - - if ( time.second >= 16 ) { - - if ( task_number( tid ) == 4 ) { - puts( "TA4 - rtems_task_delete - self" ); - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of TA4" ); - } - puts( "TA5 - rtems_task_delete - TA3" ); - status = rtems_task_delete( Task_id[ 3 ] ); - directive_failed( status, "rtems_task_delete of TA3" ); - - puts( "*** END OF TEST 19 *** " ); - rtems_test_exit( 0 ); - } - - if (previous_seconds != time.second) - { - put_name( Task_name[ task_index ], FALSE ); - print_time( " - rtems_clock_get - ", &time, "\n" ); - previous_seconds = time.second; - } - - INTEGER_CHECK( INTEGER_factors[ task_index ] ); - FP_CHECK( FP_factors[ task_index ] ); - - /* for the first 4 seconds we spin as fast as possible - * so that we likely are interrupted - * After that, we go to sleep for a second at a time - */ - if (time.second >= 4) - { - status = rtems_task_wake_after( TICKS_PER_SECOND ); - directive_failed( status, "rtems_task_wake_after" ); - } - } -} diff --git a/testsuites/sptests/sp19/fptest.h b/testsuites/sptests/sp19/fptest.h deleted file mode 100644 index 48839d3204..0000000000 --- a/testsuites/sptests/sp19/fptest.h +++ /dev/null @@ -1,171 +0,0 @@ -/* fptest.h - * - * This include file contains the CPU dependent implementation - * of the following routines needed to test RTEMS floating - * point support: - * FP_load( &context ) - * FP_check( &context ) - * - * FP_load - loads the specified floating point context - * FP_check - checks the specified floating point context - * - * NOTE: These routines are VERY CPU dependent and are thus - * located in in the CPU dependent include file - * fptest.h. These routines form the core of the - * floating point context switch test. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - - -#ifndef __FPTEST_h -#define __FPTEST_h - -#include - -#ifndef RTEMS_HAS_HARDWARE_FP -#error "This CPU does not have RTEMS_HAS_HARDWARE_FP defined" -#endif - -#if ( RTEMS_HAS_HARDWARE_FP == FALSE ) - -/* - * The following is useless except to avoid some warnings. - */ - -#define FP_DECLARE unsigned int fp01 = 0; -#define FP_LOAD( _factor ) fp01 = 2; -#define FP_CHECK( _factor ) \ - if ( fp01 != 2 ) \ - printf("%d: single integer is wrong -- (%d != 2) \n", \ - task_index, fp01 ); \ - -#else - -#define FP_DECLARE \ - double fp01 = 1.0; \ - double fp02 = 2.0; \ - double fp03 = 3.0; \ - double fp04 = 4.0; \ - double fp05 = 5.0; \ - double fp06 = 6.0; \ - double fp07 = 7.0; \ - double fp08 = 8.0; \ - double fp09 = 9.0; \ - double fp10 = 10.0; \ - double fp11 = 11.0; \ - double fp12 = 12.0; \ - double fp13 = 13.0; \ - double fp14 = 14.0; \ - double fp15 = 15.0; \ - double fp16 = 16.0; \ - double fp17 = 17.0; \ - double fp18 = 18.0; \ - double fp19 = 19.0; \ - double fp20 = 20.0; \ - double fp21 = 21.0; \ - double fp22 = 22.0; \ - double fp23 = 23.0; \ - double fp24 = 24.0; \ - double fp25 = 25.0; \ - double fp26 = 26.0; \ - double fp27 = 27.0; \ - double fp28 = 28.0; \ - double fp29 = 29.0; \ - double fp30 = 30.0; \ - double fp31 = 31.0; \ - double fp32 = 32.0 - -#define FP_LOAD( _factor ) \ - do { \ - fp01 += _factor; \ - fp02 += _factor; \ - fp03 += _factor; \ - fp04 += _factor; \ - fp05 += _factor; \ - fp06 += _factor; \ - fp07 += _factor; \ - fp08 += _factor; \ - fp09 += _factor; \ - fp10 += _factor; \ - fp11 += _factor; \ - fp12 += _factor; \ - fp13 += _factor; \ - fp14 += _factor; \ - fp15 += _factor; \ - fp16 += _factor; \ - fp17 += _factor; \ - fp18 += _factor; \ - fp19 += _factor; \ - fp20 += _factor; \ - fp21 += _factor; \ - fp22 += _factor; \ - fp23 += _factor; \ - fp24 += _factor; \ - fp25 += _factor; \ - fp26 += _factor; \ - fp27 += _factor; \ - fp28 += _factor; \ - fp29 += _factor; \ - fp30 += _factor; \ - fp31 += _factor; \ - fp32 += _factor; \ - } while (0) - -#define EPSILON (0.0005) -#define FPABS(d) (((d) < 0.0) ? -(d) : (d)) -#define FPNEQ(a,b) (FPABS((a)-(b)) > EPSILON) - -#define FP_CHECK_ONE( _v, _base, _factor ) \ - if ( FPNEQ( (_v), ((_base) + (_factor)) ) ) { \ - printf("%d: " #_v " wrong -- (%g not %g)\n", \ - task_index, (_v), (_base + _factor)); \ - } - - -#define FP_CHECK( _factor ) \ - do { \ - FP_CHECK_ONE( fp01, 1.0, (_factor) ); \ - FP_CHECK_ONE( fp02, 2.0, (_factor) ); \ - FP_CHECK_ONE( fp03, 3.0, (_factor) ); \ - FP_CHECK_ONE( fp04, 4.0, (_factor) ); \ - FP_CHECK_ONE( fp05, 5.0, (_factor) ); \ - FP_CHECK_ONE( fp06, 6.0, (_factor) ); \ - FP_CHECK_ONE( fp07, 7.0, (_factor) ); \ - FP_CHECK_ONE( fp08, 8.0, (_factor) ); \ - FP_CHECK_ONE( fp09, 9.0, (_factor) ); \ - FP_CHECK_ONE( fp10, 10.0, (_factor) ); \ - FP_CHECK_ONE( fp11, 11.0, (_factor) ); \ - FP_CHECK_ONE( fp12, 12.0, (_factor) ); \ - FP_CHECK_ONE( fp13, 13.0, (_factor) ); \ - FP_CHECK_ONE( fp14, 14.0, (_factor) ); \ - FP_CHECK_ONE( fp15, 15.0, (_factor) ); \ - FP_CHECK_ONE( fp16, 16.0, (_factor) ); \ - FP_CHECK_ONE( fp17, 17.0, (_factor) ); \ - FP_CHECK_ONE( fp18, 18.0, (_factor) ); \ - FP_CHECK_ONE( fp19, 19.0, (_factor) ); \ - FP_CHECK_ONE( fp20, 20.0, (_factor) ); \ - FP_CHECK_ONE( fp21, 21.0, (_factor) ); \ - FP_CHECK_ONE( fp22, 22.0, (_factor) ); \ - FP_CHECK_ONE( fp23, 23.0, (_factor) ); \ - FP_CHECK_ONE( fp24, 24.0, (_factor) ); \ - FP_CHECK_ONE( fp25, 25.0, (_factor) ); \ - FP_CHECK_ONE( fp26, 26.0, (_factor) ); \ - FP_CHECK_ONE( fp27, 27.0, (_factor) ); \ - FP_CHECK_ONE( fp28, 28.0, (_factor) ); \ - FP_CHECK_ONE( fp29, 29.0, (_factor) ); \ - FP_CHECK_ONE( fp30, 30.0, (_factor) ); \ - FP_CHECK_ONE( fp31, 31.0, (_factor) ); \ - FP_CHECK_ONE( fp32, 32.0, (_factor) ); \ - } while (0) - -#endif - -#endif diff --git a/testsuites/sptests/sp19/init.c b/testsuites/sptests/sp19/init.c deleted file mode 100644 index 4a4cd9adc8..0000000000 --- a/testsuites/sptests/sp19/init.c +++ /dev/null @@ -1,149 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - - puts( "\n\n*** TEST 19 ***" ); - - 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( 'F', 'P', '1', ' ' ); - - status = rtems_task_create( - Task_name[ 1 ], - 2, - RTEMS_MINIMUM_STACK_SIZE * 4, - RTEMS_DEFAULT_MODES, - RTEMS_FLOATING_POINT, - &Task_id[ 1 ] - ); - directive_failed( status, "rtems_task_create of TA1" ); - - status = rtems_task_create( - Task_name[ 2 ], - 2, - RTEMS_MINIMUM_STACK_SIZE * 4, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 2 ] - ); - directive_failed( status, "rtems_task_create of TA2" ); - - status = rtems_task_create( - Task_name[ 3 ], - 2, - RTEMS_MINIMUM_STACK_SIZE * 4, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 3 ] - ); - directive_failed( status, "rtems_task_create of TA3" ); - - status = rtems_task_create( - Task_name[ 4 ], - 2, - RTEMS_MINIMUM_STACK_SIZE * 4, - RTEMS_DEFAULT_MODES, - RTEMS_FLOATING_POINT, - &Task_id[ 4 ] - ); - directive_failed( status, "rtems_task_create of TA4" ); - - status = rtems_task_create( - Task_name[ 5 ], - 2, - RTEMS_MINIMUM_STACK_SIZE * 4, - RTEMS_DEFAULT_MODES, - RTEMS_FLOATING_POINT, - &Task_id[ 5 ] - ); - directive_failed( status, "rtems_task_create of TA5" ); - - status = rtems_task_create( - Task_name[ 6 ], - 1, - RTEMS_MINIMUM_STACK_SIZE * 4, - RTEMS_DEFAULT_MODES, - RTEMS_FLOATING_POINT, - &Task_id[ 6 ] - ); - directive_failed( status, "rtems_task_create of FP1" ); - - status = rtems_task_start( Task_id[ 6 ], First_FP_task, 0 ); - directive_failed( status, "rtems_task_start of FP1" ); - - 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_1, 0 ); - directive_failed( status, "rtems_task_start of TA2" ); - - status = rtems_task_start( Task_id[ 3 ], Task_1, 0 ); - directive_failed( status, "rtems_task_start of TA3" ); - - status = rtems_task_start( Task_id[ 4 ], FP_task, 0 ); - directive_failed( status, "rtems_task_start of TA4" ); - - status = rtems_task_start( Task_id[ 5 ], FP_task, 0 ); - directive_failed( status, "rtems_task_create of TA5" ); - - /* - * Load "task dependent factors" in the context areas - */ - - - FP_factors[0] = 0.0; - FP_factors[1] = 1000.1; - FP_factors[2] = 2000.2; - FP_factors[3] = 3000.3; - FP_factors[4] = 4000.4; - FP_factors[5] = 5000.5; - FP_factors[6] = 6000.6; - FP_factors[7] = 7000.7; - FP_factors[8] = 8000.8; - FP_factors[9] = 9000.9; - - INTEGER_factors[0] = 0x0000; - INTEGER_factors[1] = 0x1000; - INTEGER_factors[2] = 0x2000; - INTEGER_factors[3] = 0x3000; - INTEGER_factors[4] = 0x4000; - INTEGER_factors[5] = 0x5000; - INTEGER_factors[6] = 0x6000; - INTEGER_factors[7] = 0x7000; - INTEGER_factors[8] = 0x8000; - INTEGER_factors[9] = 0x9000; - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of TA1" ); -} diff --git a/testsuites/sptests/sp19/inttest.h b/testsuites/sptests/sp19/inttest.h deleted file mode 100644 index 5ab9870996..0000000000 --- a/testsuites/sptests/sp19/inttest.h +++ /dev/null @@ -1,148 +0,0 @@ -/* inttest.h - * - * XXX: ??? - * This include file contains the CPU dependent implementation - * of the following routines needed to test RTEMS floating - * point support: - * INTEGER_load( &context ) - * INTEGER_check( &context ) - * - * INTEGER_load - loads the specified floating point context - * INTEGER_check - checks the specified floating point context - * - * NOTE: These routines are VERY CPU dependent and are thus - * located in in the CPU dependent include file - * inttest.h. These routines form the core of the - * floating point context switch test. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - - -#ifndef __INTEGER_TEST_h -#define __INTEGER_TEST_h - -#include -#define REG_VARIABLE rtems_unsigned32 - -#define INTEGER_DECLARE \ - REG_VARIABLE int01 = 1; \ - REG_VARIABLE int02 = 2; \ - REG_VARIABLE int03 = 3; \ - REG_VARIABLE int04 = 4; \ - REG_VARIABLE int05 = 5; \ - REG_VARIABLE int06 = 6; \ - REG_VARIABLE int07 = 7; \ - REG_VARIABLE int08 = 8; \ - REG_VARIABLE int09 = 9; \ - REG_VARIABLE int10 = 10; \ - REG_VARIABLE int11 = 11; \ - REG_VARIABLE int12 = 12; \ - REG_VARIABLE int13 = 13; \ - REG_VARIABLE int14 = 14; \ - REG_VARIABLE int15 = 15; \ - REG_VARIABLE int16 = 16; \ - REG_VARIABLE int17 = 17; \ - REG_VARIABLE int18 = 18; \ - REG_VARIABLE int19 = 19; \ - REG_VARIABLE int20 = 20; \ - REG_VARIABLE int21 = 21; \ - REG_VARIABLE int22 = 22; \ - REG_VARIABLE int23 = 23; \ - REG_VARIABLE int24 = 24; \ - REG_VARIABLE int25 = 25; \ - REG_VARIABLE int26 = 26; \ - REG_VARIABLE int27 = 27; \ - REG_VARIABLE int28 = 28; \ - REG_VARIABLE int29 = 29; \ - REG_VARIABLE int30 = 30; \ - REG_VARIABLE int31 = 31; \ - REG_VARIABLE int32 = 32 - -#define INTEGER_LOAD( _factor ) \ - do { \ - int01 += _factor; \ - int02 += _factor; \ - int03 += _factor; \ - int04 += _factor; \ - int05 += _factor; \ - int06 += _factor; \ - int07 += _factor; \ - int08 += _factor; \ - int09 += _factor; \ - int10 += _factor; \ - int11 += _factor; \ - int12 += _factor; \ - int13 += _factor; \ - int14 += _factor; \ - int15 += _factor; \ - int16 += _factor; \ - int17 += _factor; \ - int18 += _factor; \ - int19 += _factor; \ - int20 += _factor; \ - int21 += _factor; \ - int22 += _factor; \ - int23 += _factor; \ - int24 += _factor; \ - int25 += _factor; \ - int26 += _factor; \ - int27 += _factor; \ - int28 += _factor; \ - int29 += _factor; \ - int30 += _factor; \ - int31 += _factor; \ - int32 += _factor; \ - } while (0) - -#define INTEGER_CHECK_ONE( _v, _base, _factor ) \ - if ( (_v) != ((_base) + (_factor)) ) { \ - printf("%d: " #_v " wrong -- (0x%x not 0x%x)\n", \ - task_index, (_v), (_base + _factor)); \ - } - - -#define INTEGER_CHECK( _factor ) \ - do { \ - INTEGER_CHECK_ONE( int01, 1, (_factor) ); \ - INTEGER_CHECK_ONE( int02, 2, (_factor) ); \ - INTEGER_CHECK_ONE( int03, 3, (_factor) ); \ - INTEGER_CHECK_ONE( int04, 4, (_factor) ); \ - INTEGER_CHECK_ONE( int05, 5, (_factor) ); \ - INTEGER_CHECK_ONE( int06, 6, (_factor) ); \ - INTEGER_CHECK_ONE( int07, 7, (_factor) ); \ - INTEGER_CHECK_ONE( int08, 8, (_factor) ); \ - INTEGER_CHECK_ONE( int09, 9, (_factor) ); \ - INTEGER_CHECK_ONE( int10, 10, (_factor) ); \ - INTEGER_CHECK_ONE( int11, 11, (_factor) ); \ - INTEGER_CHECK_ONE( int12, 12, (_factor) ); \ - INTEGER_CHECK_ONE( int13, 13, (_factor) ); \ - INTEGER_CHECK_ONE( int14, 14, (_factor) ); \ - INTEGER_CHECK_ONE( int15, 15, (_factor) ); \ - INTEGER_CHECK_ONE( int16, 16, (_factor) ); \ - INTEGER_CHECK_ONE( int17, 17, (_factor) ); \ - INTEGER_CHECK_ONE( int18, 18, (_factor) ); \ - INTEGER_CHECK_ONE( int19, 19, (_factor) ); \ - INTEGER_CHECK_ONE( int20, 20, (_factor) ); \ - INTEGER_CHECK_ONE( int21, 21, (_factor) ); \ - INTEGER_CHECK_ONE( int22, 22, (_factor) ); \ - INTEGER_CHECK_ONE( int23, 23, (_factor) ); \ - INTEGER_CHECK_ONE( int24, 24, (_factor) ); \ - INTEGER_CHECK_ONE( int25, 25, (_factor) ); \ - INTEGER_CHECK_ONE( int26, 26, (_factor) ); \ - INTEGER_CHECK_ONE( int27, 27, (_factor) ); \ - INTEGER_CHECK_ONE( int28, 28, (_factor) ); \ - INTEGER_CHECK_ONE( int29, 29, (_factor) ); \ - INTEGER_CHECK_ONE( int30, 30, (_factor) ); \ - INTEGER_CHECK_ONE( int31, 31, (_factor) ); \ - INTEGER_CHECK_ONE( int32, 32, (_factor) ); \ - } while (0) - -#endif diff --git a/testsuites/sptests/sp19/sp19.doc b/testsuites/sptests/sp19/sp19.doc deleted file mode 100644 index a5939bb566..0000000000 --- a/testsuites/sptests/sp19/sp19.doc +++ /dev/null @@ -1,22 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - -This file describes the directives and concepts tested by this test set. - -test set name: test19 - -directives: - -concepts: - - a. Verifies system can dispatch a mixture of floating point and - non-floating point tasks. diff --git a/testsuites/sptests/sp19/sp19.scn b/testsuites/sptests/sp19/sp19.scn deleted file mode 100644 index d70c8ad89a..0000000000 --- a/testsuites/sptests/sp19/sp19.scn +++ /dev/null @@ -1,50 +0,0 @@ -*** TEST 19 *** -FP1 - integer base = (0x6000) -FP1 - float base = (6000.6) -FP1 - integer base = (0x6000) -FP1 - float base = (6000.6) -TA1 - integer base = (0x1000) -TA1 - rtems_clock_get - 09:00:00 12/31/1988 -TA2 - integer base = (0x2000) -TA2 - rtems_clock_get - 09:00:00 12/31/1988 -TA3 - integer base = (0x3000) -TA3 - rtems_clock_get - 09:00:00 12/31/1988 -TA4 - integer base = (0x4000) -TA4 - float base = (4000.4) -TA4 - rtems_clock_get - 09:00:00 12/31/1988 -TA4 - rtems_clock_get - 09:00:01 12/31/1988 -TA4 - rtems_clock_get - 09:00:02 12/31/1988 -TA4 - rtems_clock_get - 09:00:03 12/31/1988 -TA4 - rtems_clock_get - 09:00:04 12/31/1988 -TA5 - integer base = (0x5000) -TA5 - float base = (5000.5) -TA5 - rtems_clock_get - 09:00:04 12/31/1988 -TA1 - rtems_clock_get - 09:00:05 12/31/1988 -TA5 - rtems_clock_get - 09:00:05 12/31/1988 -TA4 - rtems_clock_get - 09:00:05 12/31/1988 -TA5 - rtems_clock_get - 09:00:06 12/31/1988 -TA4 - rtems_clock_get - 09:00:06 12/31/1988 -TA5 - rtems_clock_get - 09:00:07 12/31/1988 -TA4 - rtems_clock_get - 09:00:07 12/31/1988 -TA5 - rtems_clock_get - 09:00:08 12/31/1988 -TA4 - rtems_clock_get - 09:00:08 12/31/1988 -TA5 - rtems_clock_get - 09:00:09 12/31/1988 -TA4 - rtems_clock_get - 09:00:09 12/31/1988 -TA2 - rtems_clock_get - 09:00:10 12/31/1988 -TA1 - rtems_clock_get - 09:00:10 12/31/1988 -TA5 - rtems_clock_get - 09:00:10 12/31/1988 -TA4 - rtems_clock_get - 09:00:10 12/31/1988 -TA5 - rtems_clock_get - 09:00:11 12/31/1988 -TA4 - rtems_clock_get - 09:00:11 12/31/1988 -TA5 - rtems_clock_get - 09:00:12 12/31/1988 -TA4 - rtems_clock_get - 09:00:12 12/31/1988 -TA5 - rtems_clock_get - 09:00:13 12/31/1988 -TA4 - rtems_clock_get - 09:00:13 12/31/1988 -TA5 - rtems_clock_get - 09:00:14 12/31/1988 -TA4 - rtems_clock_get - 09:00:14 12/31/1988 -TA3 - rtems_clock_get - 09:00:15 12/31/1988 -TA1 - rtems_clock_get - 09:00:15 12/31/1988 -TA5 - rtems_clock_get - 09:00:15 12/31/1988 -TA4 - rtems_clock_get - 09:00:15 12/31/1988 -TA5 - rtems_task_delete - TA3 -*** END OF TEST 19 *** diff --git a/testsuites/sptests/sp19/system.h b/testsuites/sptests/sp19/system.h deleted file mode 100644 index bfece91ec1..0000000000 --- a/testsuites/sptests/sp19/system.h +++ /dev/null @@ -1,58 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_task First_FP_task( - rtems_task_argument argument -); - -rtems_task FP_task( - rtems_task_argument argument -); - -rtems_task Task_1( - rtems_task_argument argument -); - -/* configuration information */ - -#define CONFIGURE_INIT_TASK_ATTRIBUTES RTEMS_FLOATING_POINT - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 7 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_EXTRA_TASK_STACKS (18 * RTEMS_MINIMUM_STACK_SIZE) - -#include - -/* global variables */ - -TEST_EXTERN rtems_id Task_id[ 7 ]; /* array of task ids */ -TEST_EXTERN rtems_id Task_name[ 7 ]; /* array of task names */ - -TEST_EXTERN rtems_double FP_factors[ 10 ]; /* FP "uniqueness" factors */ -TEST_EXTERN rtems_unsigned32 INTEGER_factors[ 10 ]; /* INT "uniqueness" factors */ -/* end of include file */ diff --git a/testsuites/sptests/sp19/task1.c b/testsuites/sptests/sp19/task1.c deleted file mode 100644 index 5f6d7a854d..0000000000 --- a/testsuites/sptests/sp19/task1.c +++ /dev/null @@ -1,58 +0,0 @@ -/* Task_1 - * - * 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" -#include "inttest.h" - -rtems_task Task_1( - rtems_task_argument argument -) -{ - rtems_status_code status; - rtems_id tid; - rtems_time_of_day time; - rtems_unsigned32 task_index; - INTEGER_DECLARE; - - status = rtems_task_ident( RTEMS_SELF, RTEMS_SEARCH_ALL_NODES, &tid ); - directive_failed( status, "rtems_task_ident" ); - - task_index = task_number( tid ); - - INTEGER_LOAD( INTEGER_factors[ task_index ] ); - - put_name( Task_name[ task_index ], FALSE ); - printf( " - integer base = (0x%x)\n", INTEGER_factors[ task_index ] ); - - while( FOREVER ) { - 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" ); - - INTEGER_CHECK( INTEGER_factors[ task_index ] ); - - status = rtems_task_wake_after( - ( task_number( tid ) ) * 5 * TICKS_PER_SECOND - ); - directive_failed( status, "rtems_task_wake_after" ); - } -} diff --git a/testsuites/sptests/sp20/.cvsignore b/testsuites/sptests/sp20/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/sptests/sp20/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/sptests/sp20/Makefile.am b/testsuites/sptests/sp20/Makefile.am deleted file mode 100644 index 22d64a2180..0000000000 --- a/testsuites/sptests/sp20/Makefile.am +++ /dev/null @@ -1,38 +0,0 @@ -## -## $Id$ -## - - -TEST = sp20 - -MANAGERS = io rate_monotonic - -C_FILES = init.c getall.c task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/sptests.am - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/sptests/sp20/getall.c b/testsuites/sptests/sp20/getall.c deleted file mode 100644 index e58e05a143..0000000000 --- a/testsuites/sptests/sp20/getall.c +++ /dev/null @@ -1,43 +0,0 @@ -/* Get_all_counters - * - * This routine allows TA5 to atomically obtain the iteration counters. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -void Get_all_counters() -{ - rtems_mode previous_mode; - rtems_status_code status; - - status = rtems_task_mode( - RTEMS_NO_PREEMPT, - RTEMS_PREEMPT_MASK, - &previous_mode - ); - directive_failed( status, "rtems_task_mode to RTEMS_NO_PREEMPT" ); - - Temporary_count = Count; - Count.count[ 1 ] = 0; - Count.count[ 2 ] = 0; - Count.count[ 3 ] = 0; - Count.count[ 4 ] = 0; - Count.count[ 5 ] = 0; - Count.count[ 6 ] = 0; - - status = rtems_task_mode( RTEMS_PREEMPT, RTEMS_PREEMPT_MASK, &previous_mode ); - directive_failed( status, "rtems_task_mode to RTEMS_PREEMPT" ); -} diff --git a/testsuites/sptests/sp20/init.c b/testsuites/sptests/sp20/init.c deleted file mode 100644 index 9984af0c67..0000000000 --- a/testsuites/sptests/sp20/init.c +++ /dev/null @@ -1,69 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_unsigned32 index; - rtems_status_code status; - - puts( "\n\n*** TEST 20 ***" ); - - 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', ' ' ); - - for ( index = 1 ; index <= 6 ; index++ ) { - status = rtems_task_create( - Task_name[ index ], - Priorities[ index ], - RTEMS_MINIMUM_STACK_SIZE * 4, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ index ] - ); - directive_failed( status, "rtems_task_create loop" ); - } - - for ( index = 1 ; index <= 6 ; index++ ) { - status = rtems_task_start( Task_id[ index ], Task_1_through_6, index ); - directive_failed( status, "rtems_task_start loop" ); - } - - Count.count[ 1 ] = 0; - Count.count[ 2 ] = 0; - Count.count[ 3 ] = 0; - Count.count[ 4 ] = 0; - Count.count[ 5 ] = 0; - Count.count[ 6 ] = 0; - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} diff --git a/testsuites/sptests/sp20/sp20.doc b/testsuites/sptests/sp20/sp20.doc deleted file mode 100644 index a3ff426ca6..0000000000 --- a/testsuites/sptests/sp20/sp20.doc +++ /dev/null @@ -1,23 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - -This file describes the directives and concepts tested by this test set. - -test set name: test20 - -directives: - - rm_create, rm_period - -concepts: - - a. Verifies Rate Monotonic Manager behavior. diff --git a/testsuites/sptests/sp20/sp20.scn b/testsuites/sptests/sp20/sp20.scn deleted file mode 100644 index d0726f7e07..0000000000 --- a/testsuites/sptests/sp20/sp20.scn +++ /dev/null @@ -1,40 +0,0 @@ -*** TEST 20 *** -TA1 - rtems_rate_monotonic_create id = 0x42010001 -TA1 - rtems_rate_monotonic_ident id = 0x42010001 -TA1 - (0x2c010001) period 2 -TA2 - rtems_rate_monotonic_create id = 0x42010002 -TA2 - rtems_rate_monotonic_ident id = 0x42010002 -TA2 - (0x2c010002) period 2 -TA3 - rtems_rate_monotonic_create id = 0x42010003 -TA3 - rtems_rate_monotonic_ident id = 0x42010003 -TA3 - (0x2c010003) period 2 -TA4 - rtems_rate_monotonic_create id = 0x42010004 -TA4 - rtems_rate_monotonic_ident id = 0x42010004 -TA4 - (0x2c010004) period 2 -TA5 - rtems_rate_monotonic_create id = 0x42010005 -TA5 - rtems_rate_monotonic_ident id = 0x42010005 -TA5 - (0x2c010005) period 100 -TA6 - rtems_rate_monotonic_create id = 0x42010006 -TA6 - rtems_rate_monotonic_ident id = 0x42010006 -TA6 - (0x2c010006) period 0 -TA5 - PERIODS CHECK OK (1) -TA5 - PERIODS CHECK OK (2) -TA5 - PERIODS CHECK OK (3) -TA5 - PERIODS CHECK OK (4) -TA5 - PERIODS CHECK OK (5) -TA6 - Actual: 10 Expected: 10 - OK -TA6 - Actual: 20 Expected: 20 - OK -TA6 - Actual: 30 Expected: 30 - OK -TA6 - Actual: 40 Expected: 40 - OK -TA6 - Actual: 50 Expected: 50 - OK -TA6 - Actual: 60 Expected: 60 - OK -TA6 - Actual: 70 Expected: 70 - OK -TA6 - Actual: 80 Expected: 80 - OK -TA6 - Actual: 90 Expected: 90 - OK -TA6 - Actual: 100 Expected: 100 - OK -TA5 - PERIODS CHECK OK (6) -TA5 - PERIODS CHECK OK (7) -TA5 - PERIODS CHECK OK (8) -TA5 - PERIODS CHECK OK (9) -TA5 - PERIODS CHECK OK (10) -*** END OF TEST 20 *** diff --git a/testsuites/sptests/sp20/system.h b/testsuites/sptests/sp20/system.h deleted file mode 100644 index 1c9c7e403d..0000000000 --- a/testsuites/sptests/sp20/system.h +++ /dev/null @@ -1,61 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* types */ - -struct counters { - rtems_unsigned32 count[7]; -}; - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_task Task_1_through_6( - rtems_task_argument argument -); - -void Get_all_counters( void ); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 7 -#define CONFIGURE_MAXIMUM_PERIODS 10 - -#define CONFIGURE_INIT_TASK_PRIORITY 10 -#define CONFIGURE_INIT_TASK_INITIAL_MODES RTEMS_DEFAULT_MODES -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_EXTRA_TASK_STACKS (6 * 3 * RTEMS_MINIMUM_STACK_SIZE) - -#include - -/* global variables */ - -TEST_EXTERN rtems_id Task_id[ 7 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 7 ]; /* array of task names */ - -TEST_EXTERN struct counters Count; /* iteration counters */ -TEST_EXTERN struct counters Temporary_count; -extern rtems_task_priority Priorities[ 7 ]; - -/* end of include file */ diff --git a/testsuites/sptests/sp20/task1.c b/testsuites/sptests/sp20/task1.c deleted file mode 100644 index 754686353d..0000000000 --- a/testsuites/sptests/sp20/task1.c +++ /dev/null @@ -1,153 +0,0 @@ -/* Task_1_through_5 - * - * This routine serves as a test task for the period capabilities of the - * Rate Monotonic Manager. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -/* - runtime of TA6 should be shorter than TA5 - */ -#define TA6_ITERATIONS 10 -#define TA6_PERIOD_FACTOR 10 - -rtems_unsigned32 Periods[7] = { 0, 2, 2, 2, 2, 100, 0 }; -rtems_unsigned32 Iterations[7] = { 0, 50, 50, 50, 50, 1, TA6_ITERATIONS }; -rtems_task_priority Priorities[7] = { 0, 1, 1, 3, 4, 5, 1 }; - -rtems_task Task_1_through_6( - rtems_unsigned32 argument -) -{ - rtems_id rmid; - rtems_id test_rmid; - rtems_unsigned32 index; - rtems_unsigned32 pass; - rtems_unsigned32 failed; - rtems_status_code status; - - status = rtems_rate_monotonic_create( argument, &rmid ); - directive_failed( status, "rtems_rate_monotonic_create" ); - put_name( Task_name[ argument ], FALSE ); - printf( "- rtems_rate_monotonic_create id = 0x%08x\n", rmid ); - - status = rtems_rate_monotonic_ident( argument, &test_rmid ); - directive_failed( status, "rtems_rate_monotonic_ident" ); - put_name( Task_name[ argument ], FALSE ); - printf( "- rtems_rate_monotonic_ident id = 0x%08x\n", test_rmid ); - - if ( rmid != test_rmid ) { - printf( "RMID's DO NOT MATCH (0x%x and 0x%x)\n", rmid, test_rmid ); - rtems_test_exit( 0 ); - } - - put_name( Task_name[ argument ], FALSE ); - printf( "- (0x%08x) period %d\n", rmid, Periods[ argument ] ); - - status = rtems_task_wake_after( 2 ); - directive_failed( status, "rtems_task_wake_after" ); - - switch ( argument ) { - case 1: - case 2: - case 3: - case 4: - while ( FOREVER ) { - status = rtems_rate_monotonic_period( rmid, Periods[ argument ] ); - directive_failed( status, "rtems_rate_monotonic_period" ); - Count.count[ argument ]++; - } - break; - case 5: - pass = 0; - failed = 0; - - status = rtems_rate_monotonic_period( rmid, Periods[ argument ] ); - directive_failed( status, "rtems_rate_monotonic_period 1 of TA5" ); - - Get_all_counters(); - - while ( FOREVER ) { - - status = rtems_rate_monotonic_period( rmid, Periods[ argument ] ); - directive_failed( status, "rtems_rate_monotonic_period 2 of TA5" ); - - Get_all_counters(); - - for( index = 1 ; index <= 4 ; index++ ) { - if ( Temporary_count.count[ index ] != Iterations[ index ] ) { - puts_nocr( "FAIL -- " ); - put_name ( Task_name[ index ], FALSE ); - printf ( " Actual=%d, Expected=%d\n", - Temporary_count.count[ index ], - Iterations[ index ] - ); - failed += 1; - } - } - - if ( failed == 5 ) - rtems_test_exit( 0 ); - - pass += 1; - - printf( "TA5 - PERIODS CHECK OK (%d)\n", pass ); - - fflush( stdout ); - - if ( pass == 10 ) { - puts( "*** END OF TEST 20 ***" ); - rtems_test_exit( 0 ); - } - - } - break; - case 6: - /* test changing periods */ - { - unsigned32 time[TA6_ITERATIONS+1]; - rtems_interval period; - - period = 1*TA6_PERIOD_FACTOR; - status = rtems_rate_monotonic_period( rmid, period); - directive_failed( status, "rtems_rate_monotonic_period of TA6" ); - time[0] = _Watchdog_Ticks_since_boot; /* timestamp */ - /*printf("%d - %d\n", period, time[0]);*/ - - for (index = 1; index <= TA6_ITERATIONS; index++) - { - period = (index+1)*TA6_PERIOD_FACTOR; - status = rtems_rate_monotonic_period( rmid, period); - directive_failed( status, "rtems_rate_monotonic_period of TA6" ); - time[index] = _Watchdog_Ticks_since_boot; /* timestamp */ - /*printf("%d - %d\n", period, time[index]);*/ - } - - for (index = 1; index <= TA6_ITERATIONS; index++) - { - rtems_interval meas = time[index] - time[index-1]; - period = index*TA6_PERIOD_FACTOR; - printf("TA6 - Actual: %d Expected: %d", meas, period); - if (period == meas) printf(" - OK\n"); - else printf(" - FAILED\n"); - } - } - rtems_task_suspend(RTEMS_SELF); - break; - } -} diff --git a/testsuites/sptests/sp21/.cvsignore b/testsuites/sptests/sp21/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/sptests/sp21/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/sptests/sp21/Makefile.am b/testsuites/sptests/sp21/Makefile.am deleted file mode 100644 index cd73749f1f..0000000000 --- a/testsuites/sptests/sp21/Makefile.am +++ /dev/null @@ -1,38 +0,0 @@ -## -## $Id$ -## - - -TEST = sp21 - -MANAGERS = io - -C_FILES = init.c task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/sptests.am - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/sptests/sp21/init.c b/testsuites/sptests/sp21/init.c deleted file mode 100644 index d2a666e97b..0000000000 --- a/testsuites/sptests/sp21/init.c +++ /dev/null @@ -1,52 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - - puts( "\n\n*** TEST 21 ***" ); - - Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' ); - - status = rtems_task_create( - Task_name[ 1 ], - 1, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 1 ] - ); - directive_failed( status, "rtems_task_create of TA1" ); - - status = rtems_task_start( Task_id[ 1 ], Task_1, 0 ); - directive_failed( status, "rtems_task_start of TA1" ); - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} diff --git a/testsuites/sptests/sp21/sp21.doc b/testsuites/sptests/sp21/sp21.doc deleted file mode 100644 index 52cb5a8f43..0000000000 --- a/testsuites/sptests/sp21/sp21.doc +++ /dev/null @@ -1,27 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - -This file describes the directives and concepts tested by this test set. - -test set name: test21 - -directives: - ex_init, ex_start, t_create, t_start, tm_tick, i_return, t_delete - de_init, de_open, de_close, de_read, de_write, de_cntrl - -concepts: - - a. Verifies all I/O manager directives always return successful for - null drivers. - - b. Verifies all I/O manager directives call and return from the driver - entry points in the driver address table. diff --git a/testsuites/sptests/sp21/sp21.scn b/testsuites/sptests/sp21/sp21.scn deleted file mode 100644 index c6392e3ea3..0000000000 --- a/testsuites/sptests/sp21/sp21.scn +++ /dev/null @@ -1,19 +0,0 @@ -*** TEST 21 *** ------ TESTING THE NULL DRIVER CHECKS ----- -TA1 - rtems_io_initialize - NULL DRIVER RTEMS_SUCCESSFUL -TA1 - rtems_io_open - NULL DRIVER RTEMS_SUCCESSFUL -TA1 - rtems_io_close - NULL DRIVER RTEMS_SUCCESSFUL -TA1 - rtems_io_read - NULL DRIVER RTEMS_SUCCESSFUL -TA1 - rtems_io_write - NULL DRIVER RTEMS_SUCCESSFUL -TA1 - rtems_io_control - NULL DRIVER RTEMS_SUCCESSFUL ------ TESTING THE I/O MANAGER DIRECTIVES ----- -TA1 - rtems_io_initialize - STUB DRIVER RTEMS_SUCCESSFUL -TA1 - rtems_io_open - STUB DRIVER RTEMS_SUCCESSFUL -TA1 - rtems_io_close - STUB DRIVER RTEMS_SUCCESSFUL -TA1 - rtems_io_read - STUB DRIVER RTEMS_SUCCESSFUL -TA1 - rtems_io_write - STUB DRIVER RTEMS_SUCCESSFUL -TA1 - rtems_io_control - STUB DRIVER RTEMS_SUCCESSFUL ------ RETURNING INVALID MAJOR NUMBER ----- -TA1 - rtems_io_initialize - RTEMS_INVALID_NUMBER -TA1 - rtems_io_open - RTEMS_INVALID_NUMBER -*** END OF TEST 21 *** diff --git a/testsuites/sptests/sp21/system.h b/testsuites/sptests/sp21/system.h deleted file mode 100644 index d1d04993c8..0000000000 --- a/testsuites/sptests/sp21/system.h +++ /dev/null @@ -1,46 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_task Task_1( - rtems_task_argument argument -); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_NULL_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 2 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* global variables */ - -TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */ - -/* end of include file */ diff --git a/testsuites/sptests/sp21/task1.c b/testsuites/sptests/sp21/task1.c deleted file mode 100644 index b5e40e0e89..0000000000 --- a/testsuites/sptests/sp21/task1.c +++ /dev/null @@ -1,105 +0,0 @@ -/* Task_1 - * - * This routine serves as a test task. It tests the I/O manager. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-2002. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -#define STUB_DRIVER_MAJOR 0x2 -#define NO_DRIVER_MAJOR 0x3 -#define INVALID_DRIVER_MAJOR (Configuration.number_of_device_drivers + 1) -/* #define INVALID_DRIVER_MAJOR 0xffffffff */ - -rtems_task Task_1( - rtems_task_argument argument -) -{ - rtems_status_code status; - - puts( "----- TESTING THE NULL DRIVER CHECKS -----" ); - - status = rtems_io_initialize( NO_DRIVER_MAJOR, 0, NULL ); - directive_failed( status, "rtems_io_initialize" ); - puts( "TA1 - rtems_io_initialize - NULL DRIVER RTEMS_SUCCESSFUL" ); - - status = rtems_io_open( NO_DRIVER_MAJOR, 0, NULL ); - directive_failed( status, "rtems_io_open" ); - puts( "TA1 - rtems_io_open - NULL DRIVER RTEMS_SUCCESSFUL" ); - - status = rtems_io_close( NO_DRIVER_MAJOR, 0, NULL ); - directive_failed( status, "rtems_io_close" ); - puts( "TA1 - rtems_io_close - NULL DRIVER RTEMS_SUCCESSFUL" ); - - status = rtems_io_read( NO_DRIVER_MAJOR, 0, NULL ); - directive_failed( status, "rtems_io_read" ); - puts( "TA1 - rtems_io_read - NULL DRIVER RTEMS_SUCCESSFUL" ); - - status = rtems_io_write( NO_DRIVER_MAJOR, 0, NULL ); - directive_failed( status, "rtems_io_write" ); - puts( "TA1 - rtems_io_write - NULL DRIVER RTEMS_SUCCESSFUL" ); - - status = rtems_io_control( NO_DRIVER_MAJOR, 0, NULL ); - directive_failed( status, "rtems_io_control" ); - puts( "TA1 - rtems_io_control - NULL DRIVER RTEMS_SUCCESSFUL" ); - - puts( "----- TESTING THE I/O MANAGER DIRECTIVES -----" ); - - status = rtems_io_initialize( STUB_DRIVER_MAJOR, 0, NULL ); - directive_failed( status, "rtems_io_initialize" ); - puts( "TA1 - rtems_io_initialize - STUB DRIVER RTEMS_SUCCESSFUL" ); - - status = rtems_io_open( STUB_DRIVER_MAJOR, 0, NULL ); - directive_failed( status, "rtems_io_open" ); - puts( "TA1 - rtems_io_open - STUB DRIVER RTEMS_SUCCESSFUL" ); - - status = rtems_io_close( STUB_DRIVER_MAJOR, 0, NULL ); - directive_failed( status, "rtems_io_close" ); - puts( "TA1 - rtems_io_close - STUB DRIVER RTEMS_SUCCESSFUL" ); - - status = rtems_io_read( STUB_DRIVER_MAJOR, 0, NULL ); - directive_failed( status, "rtems_io_read" ); - puts( "TA1 - rtems_io_read - STUB DRIVER RTEMS_SUCCESSFUL" ); - - status = rtems_io_write( STUB_DRIVER_MAJOR, 0, NULL ); - directive_failed( status, "rtems_io_write" ); - puts( "TA1 - rtems_io_write - STUB DRIVER RTEMS_SUCCESSFUL" ); - - status = rtems_io_control( STUB_DRIVER_MAJOR, 0, NULL ); - directive_failed( status, "rtems_io_control" ); - puts( "TA1 - rtems_io_control - STUB DRIVER RTEMS_SUCCESSFUL" ); - - puts( "----- RETURNING INVALID MAJOR NUMBER -----" ); - - status = rtems_io_initialize( INVALID_DRIVER_MAJOR, 0, NULL ); - fatal_directive_status( - status, - RTEMS_INVALID_NUMBER, - "rtems_io_initialize" - ); - puts( "TA1 - rtems_io_initialize - RTEMS_INVALID_NUMBER" ); - - status = rtems_io_open( INVALID_DRIVER_MAJOR, 0, NULL ); - fatal_directive_status( - status, - RTEMS_INVALID_NUMBER, - "rtems_io_open" - ); - puts( "TA1 - rtems_io_open - RTEMS_INVALID_NUMBER" ); - - puts( "*** END OF TEST 21 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/sptests/sp22/.cvsignore b/testsuites/sptests/sp22/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/sptests/sp22/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/sptests/sp22/Makefile.am b/testsuites/sptests/sp22/Makefile.am deleted file mode 100644 index 139c7518e4..0000000000 --- a/testsuites/sptests/sp22/Makefile.am +++ /dev/null @@ -1,38 +0,0 @@ -## -## $Id$ -## - - -TEST = sp22 - -MANAGERS = io timer - -C_FILES = init.c prtime.c delay.c task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/sptests.am - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/sptests/sp22/delay.c b/testsuites/sptests/sp22/delay.c deleted file mode 100644 index c3438e3a03..0000000000 --- a/testsuites/sptests/sp22/delay.c +++ /dev/null @@ -1,31 +0,0 @@ -/* Delayed_resume - * - * This routine is scheduled to be fired as a timer service routine. - * When fired this subprogram resumes Task_1. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -rtems_timer_service_routine Delayed_resume( - rtems_id ignored_id, - void *ignored_address -) -{ - rtems_status_code status; - - status = rtems_task_resume( Task_id[ 1 ] ); - directive_failed_with_level( status, "rtems_task_resume of self", 1 ); -} diff --git a/testsuites/sptests/sp22/init.c b/testsuites/sptests/sp22/init.c deleted file mode 100644 index 0ba8803a6d..0000000000 --- a/testsuites/sptests/sp22/init.c +++ /dev/null @@ -1,65 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_time_of_day time; - rtems_status_code status; - - puts( "\n\n*** TEST 22 ***" ); - - 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', ' ' ); - Timer_name[ 1 ] = rtems_build_name( 'T', 'M', '1', ' ' ); - - status = rtems_task_create( - Task_name[ 1 ], - 1, - RTEMS_MINIMUM_STACK_SIZE * 2, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 1 ] - ); - directive_failed( status, "rtems_task_create of TA1" ); - - status = rtems_task_start( Task_id[ 1 ], Task_1, 0 ); - directive_failed( status, "rtems_task_start of TA1" ); - - puts( "INIT - rtems_timer_create - creating timer 1" ); - status = rtems_timer_create( Timer_name[ 1 ], &Timer_id[ 1 ] ); - directive_failed( status, "rtems_timer_create" ); - - printf( "INIT - timer 1 has id (0x%x)\n", Timer_id[ 1 ] ); - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} diff --git a/testsuites/sptests/sp22/prtime.c b/testsuites/sptests/sp22/prtime.c deleted file mode 100644 index 2ab81606e0..0000000000 --- a/testsuites/sptests/sp22/prtime.c +++ /dev/null @@ -1,31 +0,0 @@ -/* Print_time - * - * This routine prints the name of Task_1 and the current time of day. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -void Print_time( void ) -{ - rtems_time_of_day time; - rtems_status_code status; - - status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time ); - directive_failed( status, "rtems_clock_get" ); - - put_name( Task_name[ 1 ], FALSE ); - print_time( "- rtems_clock_get - ", &time, "\n" ); -} diff --git a/testsuites/sptests/sp22/sp22.doc b/testsuites/sptests/sp22/sp22.doc deleted file mode 100644 index 636cdc2a1d..0000000000 --- a/testsuites/sptests/sp22/sp22.doc +++ /dev/null @@ -1,19 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - -This file describes the directives and concepts tested by this test set. - -test set name: test22 - -directives: - -concepts: diff --git a/testsuites/sptests/sp22/sp22.scn b/testsuites/sptests/sp22/sp22.scn deleted file mode 100644 index c58b107f06..0000000000 --- a/testsuites/sptests/sp22/sp22.scn +++ /dev/null @@ -1,29 +0,0 @@ -*** TEST 22 *** -INIT - rtems_timer_create - creating timer 1 -INIT - timer 1 has id (0x12010001) -TA1 - rtems_timer_ident - identing timer 1 -TA1 - timer 1 has id (0x12010001) -TA1 - rtems_clock_get - 09:00:00 12/31/1988 -TA1 - rtems_timer_fire_after - timer 1 in 3 seconds -TA1 - rtems_task_suspend( RTEMS_SELF ) -TA1 - rtems_clock_get - 09:00:03 12/31/1988 -TA1 - rtems_timer_fire_after - timer 1 in 3 seconds -TA1 - rtems_task_wake_after - 1 second -TA1 - rtems_clock_get - 09:00:04 12/31/1988 -TA1 - rtems_timer_reset - timer 1 -TA1 - rtems_task_suspend( RTEMS_SELF ) -TA1 - rtems_clock_get - 09:00:07 12/31/1988 - -TA1 - rtems_timer_fire_after - timer 1 in 3 seconds -TA1 - rtems_timer_cancel - timer 1 -TA1 - rtems_clock_get - 09:00:07 12/31/1988 -TA1 - rtems_timer_fire_when - timer 1 in 3 seconds -TA1 - rtems_task_suspend( RTEMS_SELF ) -TA1 - rtems_clock_get - 09:00:10 12/31/1988 -TA1 - rtems_timer_fire_when - timer 1 in 3 seconds -TA1 - rtems_task_wake_after - 1 second -TA1 - rtems_clock_get - 09:00:11 12/31/1988 -TA1 - rtems_timer_cancel - timer 1 -TA1 - rtems_task_wake_after - YIELD (only task at priority) -TA1 - timer_deleting - timer 1 -*** END OF TEST 22 *** diff --git a/testsuites/sptests/sp22/system.h b/testsuites/sptests/sp22/system.h deleted file mode 100644 index 4782a88979..0000000000 --- a/testsuites/sptests/sp22/system.h +++ /dev/null @@ -1,58 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_timer_service_routine Delayed_resume( - rtems_id ignored_id, - void *ignored_address -); - -void Print_time( void ); - -rtems_task Task_1( - rtems_task_argument argument -); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 2 -#define CONFIGURE_MAXIMUM_TIMERS 2 -#define CONFIGURE_INIT_TASK_STACK_SIZE (RTEMS_MINIMUM_STACK_SIZE * 2) - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_EXTRA_TASK_STACKS (1 * RTEMS_MINIMUM_STACK_SIZE) - -#include - -/* global variables */ - -TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */ - -TEST_EXTERN rtems_id Timer_id[ 2 ]; /* array of timer ids */ -TEST_EXTERN rtems_name Timer_name[ 2 ]; /* array of timer names */ - -/* end of include file */ diff --git a/testsuites/sptests/sp22/task1.c b/testsuites/sptests/sp22/task1.c deleted file mode 100644 index 1088487187..0000000000 --- a/testsuites/sptests/sp22/task1.c +++ /dev/null @@ -1,163 +0,0 @@ -/* Task_1 - * - * 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -rtems_task Task_1( - rtems_task_argument argument -) -{ - rtems_id tmid; - rtems_time_of_day time; - rtems_status_code status; - -/* Get id */ - - puts( "TA1 - rtems_timer_ident - identing timer 1" ); - status = rtems_timer_ident( Timer_name[ 1 ], &tmid ); - directive_failed( status, "rtems_timer_ident" ); - printf( "TA1 - timer 1 has id (0x%x)\n", tmid ); - -/* after which is allowed to fire */ - - Print_time(); - - puts( "TA1 - rtems_timer_fire_after - timer 1 in 3 seconds" ); - status = rtems_timer_fire_after( - tmid, - 3 * TICKS_PER_SECOND, - Delayed_resume, - NULL - ); - directive_failed( status, "rtems_timer_fire_after" ); - - puts( "TA1 - rtems_task_suspend( RTEMS_SELF )" ); - status = rtems_task_suspend( RTEMS_SELF ); - directive_failed( status, "rtems_task_suspend" ); - - Print_time(); - -/* after which is reset and allowed to fire */ - - puts( "TA1 - rtems_timer_fire_after - timer 1 in 3 seconds" ); - status = rtems_timer_fire_after( - tmid, - 3 * TICKS_PER_SECOND, - Delayed_resume, - NULL - ); - directive_failed( status, "rtems_timer_fire_after" ); - - puts( "TA1 - rtems_task_wake_after - 1 second" ); - status = rtems_task_wake_after( 1 * TICKS_PER_SECOND ); - directive_failed( status, "rtems_task_wake_after" ); - - Print_time(); - - puts( "TA1 - rtems_timer_reset - timer 1" ); - status = rtems_timer_reset( tmid ); - directive_failed( status, "rtems_timer_reset" ); - - puts( "TA1 - rtems_task_suspend( RTEMS_SELF )" ); - status = rtems_task_suspend( RTEMS_SELF ); - directive_failed( status, "rtems_task_suspend" ); - - Print_time(); - - rtems_test_pause(); - - /* - * Reset the time since we do not know how long the user waited - * before pressing at the pause. This insures that the - * actual output matches the screen. - */ - - build_time( &time, 12, 31, 1988, 9, 0, 7, 0 ); - - status = rtems_clock_set( &time ); - directive_failed( status, "rtems_clock_set" ); - -/* after which is canceled */ - - puts( "TA1 - rtems_timer_fire_after - timer 1 in 3 seconds" ); - status = rtems_timer_fire_after( - tmid, - 3 * TICKS_PER_SECOND, - Delayed_resume, - NULL - ); - directive_failed( status, "rtems_timer_fire_after" ); - - puts( "TA1 - rtems_timer_cancel - timer 1" ); - status = rtems_timer_cancel( tmid ); - directive_failed( status, "rtems_timer_cancel" ); - -/* when which is allowed to fire */ - - Print_time(); - - status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time ); - directive_failed( status, "rtems_clock_get" ); - - time.second += 3; - - puts( "TA1 - rtems_timer_fire_when - timer 1 in 3 seconds" ); - status = rtems_timer_fire_when( tmid, &time, Delayed_resume, NULL ); - directive_failed( status, "rtems_timer_fire_when" ); - - puts( "TA1 - rtems_task_suspend( RTEMS_SELF )" ); - status = rtems_task_suspend( RTEMS_SELF ); - directive_failed( status, "rtems_task_suspend" ); - - Print_time(); - -/* when which is canceled */ - - status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time ); - directive_failed( status, "rtems_clock_get" ); - - time.second += 3; - - puts( "TA1 - rtems_timer_fire_when - timer 1 in 3 seconds" ); - status = rtems_timer_fire_when( tmid, &time, Delayed_resume, NULL ); - directive_failed( status, "rtems_timer_fire_when" ); - - puts( "TA1 - rtems_task_wake_after - 1 second" ); - status = rtems_task_wake_after( 1 * TICKS_PER_SECOND ); - directive_failed( status, "rtems_task_wake_after" ); - - Print_time(); - - puts( "TA1 - rtems_timer_cancel - timer 1" ); - status = rtems_timer_cancel( tmid ); - directive_failed( status, "rtems_timer_cancel" ); - -/* delete */ - puts( "TA1 - rtems_task_wake_after - YIELD (only task at priority)" ); - status = rtems_task_wake_after( RTEMS_YIELD_PROCESSOR ); - directive_failed( status, "rtems_task_wake_after" ); - - puts( "TA1 - timer_deleting - timer 1" ); - status = rtems_timer_delete( tmid ); - directive_failed( status, "rtems_timer_delete" ); - - puts( "*** END OF TEST 22 *** " ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/sptests/sp23/.cvsignore b/testsuites/sptests/sp23/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/sptests/sp23/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/sptests/sp23/Makefile.am b/testsuites/sptests/sp23/Makefile.am deleted file mode 100644 index f6e82cb7ce..0000000000 --- a/testsuites/sptests/sp23/Makefile.am +++ /dev/null @@ -1,38 +0,0 @@ -## -## $Id$ -## - - -TEST = sp23 - -MANAGERS = io dual_ported_memory - -C_FILES = init.c task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/sptests.am - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/sptests/sp23/init.c b/testsuites/sptests/sp23/init.c deleted file mode 100644 index 70964dd18e..0000000000 --- a/testsuites/sptests/sp23/init.c +++ /dev/null @@ -1,68 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - - puts( "\n\n*** TEST 23 ***" ); - - Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' ); - - status = rtems_task_create( - Task_name[ 1 ], - 1, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 1 ] - ); - directive_failed( status, "rtems_task_create of TA1" ); - - status = rtems_task_start( Task_id[ 1 ], Task_1, 0 ); - directive_failed( status, "rtems_task_start of TA1" ); - - Port_name[ 1 ] = rtems_build_name( 'D', 'P', '1', ' ' ); - - status = rtems_port_create( - Port_name[ 1 ], - Internal_port_area, - External_port_area, - 0xff, - &Port_id[ 1 ] - ); - directive_failed( status, "rtems_port_create of DP1" ); - - printf( "INIT - rtems_port_create - DP1 - int = %p ext = %p\n", - Internal_port_area, - External_port_area - ); - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} diff --git a/testsuites/sptests/sp23/sp23.doc b/testsuites/sptests/sp23/sp23.doc deleted file mode 100644 index 2f3cbe4aed..0000000000 --- a/testsuites/sptests/sp23/sp23.doc +++ /dev/null @@ -1,25 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - -This file describes the directives and concepts tested by this test set. - -test set name: test23 - -directives: - ex_init, ex_start, t_create, t_start, tm_tick, i_return, t_delete, - m_ext2int, m_int2ext - -concepts: - - a. Verifies the dual ported RAM directives work correctly. - -output: diff --git a/testsuites/sptests/sp23/sp23.scn b/testsuites/sptests/sp23/sp23.scn deleted file mode 100644 index 0044ce7657..0000000000 --- a/testsuites/sptests/sp23/sp23.scn +++ /dev/null @@ -1,9 +0,0 @@ -*** TEST 23 *** -INIT - rtems_port_create - DP1 - int = 0x1000 ext = 0x2000 -TA1 - rtems_port_ident - 0x3a010001 -TA1 - rtems_port_external_to_internal - 0x200e => 0x100e -TA1 - rtems_port_internal_to_external - 0x100e => 0x200e -TA1 - rtems_port_external_to_internal - 0x300e => 0x300e -TA1 - rtems_port_internal_to_external - 0x50e => 0x50e -TA1 - rtems_port_delete - DP1 -*** END OF TEST 23 *** diff --git a/testsuites/sptests/sp23/system.h b/testsuites/sptests/sp23/system.h deleted file mode 100644 index 3098ddb0be..0000000000 --- a/testsuites/sptests/sp23/system.h +++ /dev/null @@ -1,57 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_task Task_1( - rtems_task_argument argument -); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 2 -#define CONFIGURE_MAXIMUM_PORTS 1 -#define CONFIGURE_INIT_TASK_STACK_SIZE (RTEMS_MINIMUM_STACK_SIZE * 2) - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_EXTRA_TASK_STACKS (1 * RTEMS_MINIMUM_STACK_SIZE) - -#include - -/* global variables */ - -TEST_EXTERN rtems_id Task_id[ 2 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 2 ]; /* array of task names */ - -TEST_EXTERN rtems_id Port_id[ 2 ]; /* array of port ids */ -TEST_EXTERN rtems_name Port_name[ 2 ]; /* array of port names */ - -#define Internal_port_area ((rtems_unsigned8 *) 0x00001000) -#define External_port_area ((rtems_unsigned8 *) 0x00002000) - -#define Below_port_area ((rtems_unsigned8 *) 0x00000500) -#define Above_port_area ((rtems_unsigned8 *) 0x00003000) - -/* end of include file */ diff --git a/testsuites/sptests/sp23/task1.c b/testsuites/sptests/sp23/task1.c deleted file mode 100644 index a71856ce88..0000000000 --- a/testsuites/sptests/sp23/task1.c +++ /dev/null @@ -1,95 +0,0 @@ -/* Task_1 - * - * This task verifies that the dual ported RAM directives work - * correctly by converting external addresses to internal addresses and - * internal addresses to external addresses. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -rtems_task Task_1( - rtems_task_argument argument -) -{ - rtems_id dpid; - void *to_be_converted; - void *converted; - rtems_status_code status; - - status = rtems_port_ident( Port_name[ 1 ], &dpid ); - directive_failed( status, "rtems_port_ident" ); - printf( "TA1 - rtems_port_ident - 0x%08x\n", dpid ); - - to_be_converted = &External_port_area[ 0xe ]; - status = rtems_port_external_to_internal( - Port_id[ 1 ], - to_be_converted, - &converted - ); - directive_failed( status, "rtems_port_external_to_internal" ); - printf( - "TA1 - rtems_port_external_to_internal - %p => %p\n", - to_be_converted, - converted - ); - - to_be_converted = &Internal_port_area[ 0xe ]; - status = rtems_port_internal_to_external( - Port_id[ 1 ], - to_be_converted, - &converted - ); - directive_failed( status, "rtems_port_internal_to_external" ); - printf( - "TA1 - rtems_port_internal_to_external - %p => %p\n", - to_be_converted, - converted - ); - - to_be_converted = &Above_port_area[ 0xe ]; - status = rtems_port_external_to_internal( - Port_id[ 1 ], - to_be_converted, - &converted - ); - directive_failed( status, "rtems_port_external_to_internal" ); - printf( - "TA1 - rtems_port_external_to_internal - %p => %p\n", - to_be_converted, - converted - ); - - to_be_converted = &Below_port_area[ 0xe ]; - status = rtems_port_internal_to_external( - Port_id[ 1 ], - to_be_converted, - &converted - ); - directive_failed( status, "rtems_port_internal_to_external" ); - printf( - "TA1 - rtems_port_internal_to_external - %p => %p\n", - to_be_converted, - converted - ); - - status = rtems_port_delete( Port_id[ 1 ] ); - directive_failed( status, "rtems_port_delete" ); - puts( "TA1 - rtems_port_delete - DP1" ); - - puts( "*** END OF TEST 23 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/sptests/sp24/.cvsignore b/testsuites/sptests/sp24/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/sptests/sp24/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/sptests/sp24/Makefile.am b/testsuites/sptests/sp24/Makefile.am deleted file mode 100644 index 198f5fa4f2..0000000000 --- a/testsuites/sptests/sp24/Makefile.am +++ /dev/null @@ -1,38 +0,0 @@ -## -## $Id$ -## - - -TEST = sp24 - -MANAGERS = io event timer - -C_FILES = init.c resume.c task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/sptests.am - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/sptests/sp24/init.c b/testsuites/sptests/sp24/init.c deleted file mode 100644 index 541c08cc7d..0000000000 --- a/testsuites/sptests/sp24/init.c +++ /dev/null @@ -1,75 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_time_of_day time; - rtems_unsigned32 index; - rtems_status_code status; - - puts( "\n\n*** TEST 24 ***" ); - - 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', ' ' ); - - 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', ' ' ); - - for ( index = 1 ; index <= 3 ; index++ ) { - status = rtems_task_create( - Task_name[ index ], - 1, - RTEMS_MINIMUM_STACK_SIZE * 2, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ index ] - ); - directive_failed( status, "rtems_task_create loop" ); - - status = rtems_timer_create( - Timer_name[ index ], - &Timer_id[ index ] - ); - directive_failed( status, "rtems_timer_create loop" ); - } - - for ( index = 1 ; index <= 3 ; index++ ) { - status = rtems_task_start( Task_id[ index ], Task_1_through_3, index ); - directive_failed( status, "rtems_task_start loop" ); - } - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} diff --git a/testsuites/sptests/sp24/resume.c b/testsuites/sptests/sp24/resume.c deleted file mode 100644 index 0267bff50e..0000000000 --- a/testsuites/sptests/sp24/resume.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Resume_task - * - * This subprogram is scheduled as a timer service routine. When - * it fires it resumes the task which is mapped to this timer. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -rtems_timer_service_routine Resume_task( - rtems_id timer_id, - void *ignored_address -) -{ - rtems_id task_to_resume; - rtems_status_code status; - - task_to_resume = Task_id[ rtems_get_index( timer_id ) ]; - status = rtems_task_resume( task_to_resume ); - directive_failed_with_level( status, "rtems_task_resume", 1 ); -} diff --git a/testsuites/sptests/sp24/sp24.doc b/testsuites/sptests/sp24/sp24.doc deleted file mode 100644 index de9c617409..0000000000 --- a/testsuites/sptests/sp24/sp24.doc +++ /dev/null @@ -1,50 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - -This file describes the directives and concepts tested by this test set. - -test set name: test24 - -directives: - ex_init, ex_start, t_create, t_start, tm_tick, i_return, t_ident, - ev_receive - -concepts: - - a. This test is a cyclic version of test1. The times printed by - each test should not skew as in test1 (see output section). - - b. Verifies system can create and start both the executive's system - initialization and idle task. - - c. Verifies executive can swap between three application tasks at the - same priority and the executive's internal idle task. - - d. Verifies can print strings to the CRT on port 2 of the mvme136 board - using Print and Println in the board support package. - - 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. - -output: - "TA1" is printed once every 5 seconds. "TA2" is printed once - every 10 seconds. "TA3" is printed once every 15 seconds. - - The times printed should be multiples of 5 seconds for TA1, 10 seconds - for TA2, and 15 seconds for TA3. If this does not happen, the calendar - time does not correspond correctly to the number of ticks. diff --git a/testsuites/sptests/sp24/sp24.scn b/testsuites/sptests/sp24/sp24.scn deleted file mode 100644 index 96a58f35e3..0000000000 --- a/testsuites/sptests/sp24/sp24.scn +++ /dev/null @@ -1,16 +0,0 @@ -*** TEST 24 *** -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 -TA2 - rtems_clock_get - 09:00:30 12/31/1988 -TA1 - rtems_clock_get - 09:00:30 12/31/1988 -*** END OF TEST 24 *** diff --git a/testsuites/sptests/sp24/system.h b/testsuites/sptests/sp24/system.h deleted file mode 100644 index 1cb57dcf40..0000000000 --- a/testsuites/sptests/sp24/system.h +++ /dev/null @@ -1,55 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_timer_service_routine Resume_task( - rtems_id timer_id, - void *ignored_address -); - -rtems_task Task_1_through_3( - rtems_task_argument argument -); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 4 -#define CONFIGURE_MAXIMUM_TIMERS 3 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_EXTRA_TASK_STACKS (3 * RTEMS_MINIMUM_STACK_SIZE) - -#include - -/* global variables */ - -TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */ - -TEST_EXTERN rtems_id Timer_id[ 4 ]; /* array of timer ids */ -TEST_EXTERN rtems_name Timer_name[ 4 ]; /* array of timer names */ - -/* end of include file */ diff --git a/testsuites/sptests/sp24/task1.c b/testsuites/sptests/sp24/task1.c deleted file mode 100644 index b093244f8b..0000000000 --- a/testsuites/sptests/sp24/task1.c +++ /dev/null @@ -1,57 +0,0 @@ -/* Task_1_through_3 - * - * This task is a cyclic version of test1 to asssure that the times - * displayed are not skewed as in test1. "TA1" is printed once every - * 5 seconds, "TA2" is printed once every 10 seconds, and "TA3" is - * printed once every 15 seconds. The times displayed should be - * in multiples of 5, 10, and 15 for TA1, TA2, and TA3 respectively. - * If the times are skewed from these values, then the calendar time - * does not correspond correctly with the number of ticks. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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 of self" ); - - while ( FOREVER ) { - status = rtems_timer_fire_after( - Timer_id[ argument ], - task_number( tid ) * 5 * TICKS_PER_SECOND, - Resume_task, - NULL - ); - directive_failed( status, "tm_fire_after failed" ); - - status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time ); - directive_failed( status, "rtems_clock_get failed" ); - - if ( time.second >= 35 ) { - puts( "*** END OF TEST 24 ***" ); - rtems_test_exit( 0 ); - } - - put_name( Task_name[ task_number( tid ) ], FALSE ); - print_time( " - rtems_clock_get - ", &time, "\n" ); - - status = rtems_task_suspend( RTEMS_SELF ); - directive_failed( status, "rtems_task_suspend" ); - } -} diff --git a/testsuites/sptests/sp25/.cvsignore b/testsuites/sptests/sp25/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/sptests/sp25/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/sptests/sp25/Makefile.am b/testsuites/sptests/sp25/Makefile.am deleted file mode 100644 index df75f51a0c..0000000000 --- a/testsuites/sptests/sp25/Makefile.am +++ /dev/null @@ -1,38 +0,0 @@ -## -## $Id$ -## - - -TEST = sp25 - -MANAGERS = io region - -C_FILES = init.c task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/sptests.am - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/sptests/sp25/init.c b/testsuites/sptests/sp25/init.c deleted file mode 100644 index fd4fca8cca..0000000000 --- a/testsuites/sptests/sp25/init.c +++ /dev/null @@ -1,65 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - - puts( "\n\n*** TEST 25 ***" ); - - Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' ); - - status = rtems_task_create( - Task_name[ 1 ], - BASE_PRIORITY, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 1 ] - ); - directive_failed( status, "rtems_task_create of TA1" ); - - status = rtems_task_start( Task_id[ 1 ], Task_1, 0 ); - directive_failed( status, "rtems_task_start of TA1" ); - - Region_name[ 1 ] = rtems_build_name('R', 'N', '0', '1'); - - - status = rtems_region_create( - Region_name[ 1 ], - Area_1, - sizeof( Area_1 ), - 64, - RTEMS_DEFAULT_ATTRIBUTES, - &Region_id[ 1 ] - ); - directive_failed( status, "rtems_region_create of RN1" ); - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} diff --git a/testsuites/sptests/sp25/sp25.doc b/testsuites/sptests/sp25/sp25.doc deleted file mode 100644 index 5312465362..0000000000 --- a/testsuites/sptests/sp25/sp25.doc +++ /dev/null @@ -1,31 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - -This file describes the directives and concepts tested by this test set. - -test set name: test25 - -directives: - task_create - task_start - task_delete - region_create - region_ident - region_get_segment - region_return_segment - region_delete - -concepts: - - a. Verifies that the heap maintains it's integrity trhough a series - on region_get_segments and region_return_segments. - diff --git a/testsuites/sptests/sp25/sp25.scn b/testsuites/sptests/sp25/sp25.scn deleted file mode 100644 index 85ec899f43..0000000000 --- a/testsuites/sptests/sp25/sp25.scn +++ /dev/null @@ -1,32 +0,0 @@ -NOTE: Addresses vary between BSPs. Please check that the addresses - printed are reasonable for your target board and that the - segments noted as being returned were allocated from the region. -*** TEST 25 *** -TA1 - rtems_region_ident - 0x32010002 -TA1 - rtems_region_get_segment - wait on 64 byte segment from region 1 -TA1 - got segment from region 1 - 0xXXXXXXXX -TA1 - rtems_region_get_segment - wait on 128 byte segment from region 1 -TA1 - got segment from region 1 - 0xXXXXXXXX -TA1 - rtems_region_get_segment - wait on 256 byte segment from region 1 -TA1 - got segment from region 1 - 0xXXXXXXXX -TA1 - rtems_region_get_segment - wait on 512 byte segment from region 1 -TA1 - got segment from region 1 - 0xXXXXXXXX -TA1 - rtems_region_get_segment - wait on 1024 byte segment from region 1 -TA1 - got segment from region 1 - 0xXXXXXXXX -TA1 - rtems_region_get_segment - wait on 2048 byte segment from region 1 -TA1 - got segment from region 1 - 0xXXXXXXXX -TA1 - rtems_region_get_segment - wait on 4096 byte segment from region 1 -TA1 - got segment from region 1 - 0xXXXXXXXX -TA1 - rtems_region_get_segment - wait on 8192 byte segment from region 1 -TA1 - got segment from region 1 - 0xXXXXXXXX - -TA1 - rtems_region_return_segment - return segment to region 1 - 0xXXXXXXXX -TA1 - rtems_region_return_segment - return segment to region 1 - 0xXXXXXXXX -TA1 - rtems_region_return_segment - return segment to region 1 - 0xXXXXXXXX -TA1 - rtems_region_return_segment - return segment to region 1 - 0xXXXXXXXX -TA1 - rtems_region_return_segment - return segment to region 1 - 0xXXXXXXXX -TA1 - rtems_region_return_segment - return segment to region 1 - 0xXXXXXXXX -TA1 - rtems_region_return_segment - return segment to region 1 - 0xXXXXXXXX -TA1 - rtems_region_return_segment - return segment to region 1 - 0xXXXXXXXX -TA1 - rtems_region_delete - walks heap if debug enabled -*** END OF TEST 25 *** diff --git a/testsuites/sptests/sp25/system.h b/testsuites/sptests/sp25/system.h deleted file mode 100644 index d2dfd939a7..0000000000 --- a/testsuites/sptests/sp25/system.h +++ /dev/null @@ -1,55 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_task Task_1( - rtems_task_argument argument -); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 2 -#define CONFIGURE_MAXIMUM_REGIONS 1 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* global variables */ - -TEST_EXTERN rtems_id Task_id[ 6 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 6 ]; /* array of task names */ -TEST_EXTERN rtems_id Region_id[ 2 ]; /* array of region ids */ -TEST_EXTERN rtems_name Region_name[ 2 ]; /* array of region names */ - -TEST_EXTERN rtems_unsigned8 Area_1[64000] CPU_STRUCTURE_ALIGNMENT; - -#define BASE_PRIORITY 140 - -#define Put_address_from_area_1( _to_be_printed ) \ - printf( "0x%08lx", \ - (unsigned long) ((rtems_unsigned8 *)(_to_be_printed) - Area_1 ) ) - -/* end of include file */ diff --git a/testsuites/sptests/sp25/task1.c b/testsuites/sptests/sp25/task1.c deleted file mode 100644 index d2379b14f7..0000000000 --- a/testsuites/sptests/sp25/task1.c +++ /dev/null @@ -1,240 +0,0 @@ -/* Task_1 - * - * This routine serves as a test task. It tests the region manager. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -rtems_task Task_1( - rtems_task_argument argument -) -{ - void *address_1; - void *address_2; - void *address_3; - void *address_4; - void *address_5; - void *address_6; - void *address_7; - void *address_8; - rtems_status_code status; - rtems_id region_id; - - status = rtems_region_ident(Region_name[ 1 ], ®ion_id); - printf( "TA1 - rtems_region_ident - 0x%08x\n", region_id ); - directive_failed(status, "rtems_region_ident of RN01"); - - puts( - "TA1 - rtems_region_get_segment - wait on 64 byte segment from region 1" - ); - rtems_region_get_segment( - Region_id[ 1 ], - 64, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &address_1 - ); - directive_failed( status, "rtems_region_get_segment" ); - puts_nocr( "TA1 - got segment from region 1 - " ); - Put_address_from_area_1( address_1 ); - new_line; - - puts( - "TA1 - rtems_region_get_segment - wait on 128 byte segment from region 1" - ); - rtems_region_get_segment( - Region_id[ 1 ], - 128, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &address_2 - ); - directive_failed( status, "rtems_region_get_segment" ); - puts_nocr( "TA1 - got segment from region 1 - " ); - Put_address_from_area_1( address_2 ); - new_line; - - puts( - "TA1 - rtems_region_get_segment - wait on 256 byte segment from region 1" - ); - rtems_region_get_segment( - Region_id[ 1 ], - 256, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &address_3 - ); - directive_failed( status, "rtems_region_get_segment" ); - puts_nocr( "TA1 - got segment from region 1 - " ); - Put_address_from_area_1( address_3 ); - new_line; - - puts( - "TA1 - rtems_region_get_segment - wait on 512 byte segment from region 1" - ); - rtems_region_get_segment( - Region_id[ 1 ], - 512, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &address_4 - ); - directive_failed( status, "rtems_region_get_segment" ); - puts_nocr( "TA1 - got segment from region 1 - " ); - Put_address_from_area_1( address_4 ); - new_line; - - puts( - "TA1 - rtems_region_get_segment - wait on 1024 byte segment from region 1" - ); - rtems_region_get_segment( - Region_id[ 1 ], - 1024, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &address_5 - ); - directive_failed( status, "rtems_region_get_segment" ); - puts_nocr( "TA1 - got segment from region 1 - " ); - Put_address_from_area_1( address_5 ); - new_line; - - puts( - "TA1 - rtems_region_get_segment - wait on 2048 byte segment from region 1" - ); - rtems_region_get_segment( - Region_id[ 1 ], - 2048, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &address_6 - ); - directive_failed( status, "rtems_region_get_segment" ); - puts_nocr( "TA1 - got segment from region 1 - " ); - Put_address_from_area_1( address_6 ); - new_line; - - puts( - "TA1 - rtems_region_get_segment - wait on 4096 byte segment from region 1" - ); - rtems_region_get_segment( - Region_id[ 1 ], - 4096, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &address_7 - ); - directive_failed( status, "rtems_region_get_segment" ); - puts_nocr( "TA1 - got segment from region 1 - " ); - Put_address_from_area_1( address_7 ); - new_line; - - puts( - "TA1 - rtems_region_get_segment - wait on 8192 byte segment from region 1" - ); - rtems_region_get_segment( - Region_id[ 1 ], - 8192, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &address_8 - ); - directive_failed( status, "rtems_region_get_segment" ); - puts_nocr( "TA1 - got segment from region 1 - " ); - Put_address_from_area_1( address_8 ); - new_line; - -rtems_test_pause(); - - puts_nocr( - "TA1 - rtems_region_return_segment - return segment to region 1 - " - ); - Put_address_from_area_1( address_3 ); - status = rtems_region_return_segment( Region_id[ 1 ], address_3 ); - directive_failed( status, "rtems_region_return_segment" ); - new_line; - address_3 = 0; - - puts_nocr( - "TA1 - rtems_region_return_segment - return segment to region 1 - " - ); - Put_address_from_area_1( address_4 ); - status = rtems_region_return_segment( Region_id[ 1 ], address_4 ); - directive_failed( status, "rtems_region_return_segment" ); - new_line; - address_4 = 0; - - puts_nocr( - "TA1 - rtems_region_return_segment - return segment to region 1 - " - ); - Put_address_from_area_1( address_1 ); - status = rtems_region_return_segment( Region_id[ 1 ], address_1 ); - directive_failed( status, "rtems_region_return_segment" ); - new_line; - address_1 = 0; - - puts_nocr( - "TA1 - rtems_region_return_segment - return segment to region 1 - " - ); - Put_address_from_area_1( address_2 ); - status = rtems_region_return_segment( Region_id[ 1 ], address_2 ); - directive_failed( status, "rtems_region_return_segment" ); - new_line; - address_2 = 0; - - puts_nocr( - "TA1 - rtems_region_return_segment - return segment to region 1 - " - ); - Put_address_from_area_1( address_7 ); - status = rtems_region_return_segment( Region_id[ 1 ], address_7 ); - directive_failed( status, "rtems_region_return_segment" ); - new_line; - address_7 = 0; - - puts_nocr( - "TA1 - rtems_region_return_segment - return segment to region 1 - " - ); - Put_address_from_area_1( address_6 ); - status = rtems_region_return_segment( Region_id[ 1 ], address_6 ); - directive_failed( status, "rtems_region_return_segment" ); - new_line; - address_6 = 0; - - puts_nocr( - "TA1 - rtems_region_return_segment - return segment to region 1 - " - ); - Put_address_from_area_1( address_8 ); - status = rtems_region_return_segment( Region_id[ 1 ], address_8 ); - directive_failed( status, "rtems_region_return_segment" ); - new_line; - address_8 = 0; - - puts_nocr( - "TA1 - rtems_region_return_segment - return segment to region 1 - " - ); - Put_address_from_area_1( address_5 ); - status = rtems_region_return_segment( Region_id[ 1 ], address_5 ); - directive_failed( status, "rtems_region_return_segment" ); - new_line; - address_5 = 0; - - puts( "TA1 - rtems_region_delete - walks heap if debug enabled" ); - rtems_region_delete(Region_id[ 1 ]); - - puts( "*** END OF TEST 25 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/sptests/sp26/.cvsignore b/testsuites/sptests/sp26/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/sptests/sp26/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/sptests/sp26/Makefile.am b/testsuites/sptests/sp26/Makefile.am deleted file mode 100644 index 03f91866b2..0000000000 --- a/testsuites/sptests/sp26/Makefile.am +++ /dev/null @@ -1,38 +0,0 @@ -## -## $Id$ -## - - -TEST = sp26 - -MANAGERS = io region event - -C_FILES = init.c task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/sptests.am - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/sptests/sp26/init.c b/testsuites/sptests/sp26/init.c deleted file mode 100644 index 0ccec87487..0000000000 --- a/testsuites/sptests/sp26/init.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - - -rtems_task Init( - rtems_task_argument argument -) -{ - puts( "\n\n*** TEST 26 ***" ); - - task1(); - /* does not return */ - puts( "Init - task1 should not have returned" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/sptests/sp26/sp26.doc b/testsuites/sptests/sp26/sp26.doc deleted file mode 100644 index 7ad648ea00..0000000000 --- a/testsuites/sptests/sp26/sp26.doc +++ /dev/null @@ -1,23 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - -This file describes the directives and concepts tested by this test set. - -test set name: sp26 - -directives: - task_is_suspended - -concepts: - - a. task_is_suspended operates correctly. - diff --git a/testsuites/sptests/sp26/sp26.scn b/testsuites/sptests/sp26/sp26.scn deleted file mode 100644 index 0e3faf5cd7..0000000000 --- a/testsuites/sptests/sp26/sp26.scn +++ /dev/null @@ -1,8 +0,0 @@ -*** TEST 26 *** -subTask2 - Task 1 suspended? - should be 0: 0 -subTask1 - Event sent -subTask2 - Task 1 suspended? - should be 1: 1 -subTask2 - Task 1 suspended? - should be 0: 0 -subTask1 - Back to task 1 -subTask2 - Task 1 suspended? - should be 1: 1 -*** END OF TEST 26 *** diff --git a/testsuites/sptests/sp26/system.h b/testsuites/sptests/sp26/system.h deleted file mode 100644 index 5957c21b3e..0000000000 --- a/testsuites/sptests/sp26/system.h +++ /dev/null @@ -1,46 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -void task1(void); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 5 -#define CONFIGURE_MAXIMUM_REGIONS 1 -#define CONFIGURE_EXTRA_TASK_STACKS (RTEMS_MINIMUM_STACK_SIZE * 4) - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* global variables */ - -TEST_EXTERN rtems_id Task_id[ 6 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 6 ]; /* array of task names */ - -#define BASE_PRIORITY 140 - -/* end of include file */ diff --git a/testsuites/sptests/sp26/task1.c b/testsuites/sptests/sp26/task1.c deleted file mode 100644 index 39541136e6..0000000000 --- a/testsuites/sptests/sp26/task1.c +++ /dev/null @@ -1,120 +0,0 @@ -/* - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include -#include - -static rtems_id taskId1; -static rtems_id taskId2; -rtems_interval ticksPerSecond; - -#include "system.h" - -static int -isSuspended (rtems_id tid) -{ - rtems_status_code sc; - - sc = rtems_task_is_suspended (tid); - if (sc == RTEMS_ALREADY_SUSPENDED) - return 1; - if (sc != RTEMS_SUCCESSFUL) - printf ("rtems_task_is_suspended: %s\n", rtems_status_text (sc)); - return 0; -} - -static void -subTask1 (rtems_task_argument arg) -{ - rtems_status_code sc; - - rtems_task_wake_after (ticksPerSecond * 3); - sc = rtems_event_send (taskId2, 1); - if (sc != RTEMS_SUCCESSFUL) { - printf ("subTask1 - Can't send event (%d)\n", sc); - rtems_task_suspend (RTEMS_SELF); - } - rtems_task_wake_after (ticksPerSecond * 3); - printf ("subTask1 - Event sent\n"); - rtems_task_suspend (RTEMS_SELF); - printf ("subTask1 - Back to task 1\n"); - rtems_task_wake_after (ticksPerSecond * 3); - rtems_task_suspend (RTEMS_SELF); -} - -static void -subTask2 (rtems_task_argument arg) -{ - rtems_status_code sc; - rtems_event_set ev; - - rtems_task_wake_after (ticksPerSecond * 1); - sc = rtems_event_receive (1, RTEMS_WAIT|RTEMS_EVENT_ANY, RTEMS_NO_TIMEOUT, &ev); - if (sc != RTEMS_SUCCESSFUL) { - printf ("subTask2 - Can't receive event (%d)\n", sc); - rtems_task_suspend (RTEMS_SELF); - } - printf ("subTask2 - Task 1 suspended? - should be 0: %d\n", - isSuspended (taskId1)); - rtems_task_wake_after (ticksPerSecond * 4); - printf ("subTask2 - Task 1 suspended? - should be 1: %d\n", - isSuspended (taskId1)); - rtems_task_resume (taskId1); - printf ("subTask2 - Task 1 suspended? - should be 0: %d\n", - isSuspended (taskId1)); - rtems_task_wake_after (ticksPerSecond * 4); - printf ("subTask2 - Task 1 suspended? - should be 1: %d\n", - isSuspended (taskId1)); - - puts( "*** END OF TEST 26 ***" ); - rtems_test_exit( 0 ); -} - -static void -createTask (char c, rtems_id *tid) -{ - rtems_status_code sc; - - sc = rtems_task_create (rtems_build_name('S','u','b',c), - 100, - RTEMS_MINIMUM_STACK_SIZE * 4, - RTEMS_PREEMPT|RTEMS_NO_TIMESLICE|RTEMS_NO_ASR|RTEMS_INTERRUPT_LEVEL(0), - RTEMS_NO_FLOATING_POINT|RTEMS_LOCAL, - tid); - if (sc != RTEMS_SUCCESSFUL) { - printf ("Can't create task (%d)\n", sc); - rtems_task_suspend (RTEMS_SELF); - } -} - -static void -startTask (rtems_id tid, rtems_task_entry entry_point) -{ - rtems_status_code sc; - - sc = rtems_task_start (tid, entry_point, 0); - if (sc != RTEMS_SUCCESSFUL) { - printf ("Can't start task (%d)\n", sc); - rtems_task_suspend (RTEMS_SELF); - } -} - -void -task1 (void) -{ - rtems_clock_get (RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticksPerSecond); - createTask ('1', &taskId1); - createTask ('2', &taskId2); - startTask (taskId1, subTask1); - startTask (taskId2, subTask2); - rtems_task_suspend (RTEMS_SELF); -} diff --git a/testsuites/sptests/sp27/.cvsignore b/testsuites/sptests/sp27/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/sptests/sp27/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/sptests/sp27/Makefile.am b/testsuites/sptests/sp27/Makefile.am deleted file mode 100644 index 22dc1c25c2..0000000000 --- a/testsuites/sptests/sp27/Makefile.am +++ /dev/null @@ -1,35 +0,0 @@ -## -## $Id$ -## - - -TEST = sp27 - -MANAGERS = all - -C_FILES = init.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -DOCTYPES = scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/sptests.am - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/sptests/sp27/init.c b/testsuites/sptests/sp27/init.c deleted file mode 100644 index d3353e6de3..0000000000 --- a/testsuites/sptests/sp27/init.c +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Test for rtems_semaphore_flush - * - * $Id$ - */ - -#include - -rtems_task Init (rtems_task_argument argument); - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 6 - -#define CONFIGURE_MICROSECONDS_PER_TICK 52429 - -#define CONFIGURE_INIT - -#include - -#include -#include - -#define NTASK 4 - -rtems_id semaphore; -volatile int flags[NTASK]; - -rtems_task -subtask (rtems_task_argument arg) -{ - rtems_status_code sc; - - for (;;) { - flags[arg]++; - sc = rtems_semaphore_obtain (semaphore, RTEMS_WAIT, RTEMS_NO_TIMEOUT); - if (sc == RTEMS_SUCCESSFUL) - puts ("Obtained semaphore -- and should not have done so!"); - else if (sc != RTEMS_UNSATISFIED) - printf ("Can't get semaphore: %s\n", rtems_status_text (sc)); - } -} - -void -starttask (int arg) -{ - rtems_id tid; - rtems_status_code sc; - rtems_task_priority priority; - - rtems_task_set_priority (RTEMS_SELF, RTEMS_CURRENT_PRIORITY, &priority); - sc = rtems_task_create (rtems_build_name ('S', 'R', 'V', arg + 'A'), - priority, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_PREEMPT|RTEMS_NO_TIMESLICE|RTEMS_NO_ASR|RTEMS_INTERRUPT_LEVEL(0), - RTEMS_NO_FLOATING_POINT|RTEMS_LOCAL, - &tid); - if (sc != RTEMS_SUCCESSFUL) { - printf ("Can't create task: %s\n", rtems_status_text (sc)); - rtems_task_suspend (RTEMS_SELF); - } - sc = rtems_task_start (tid, subtask, arg); - if (sc != RTEMS_SUCCESSFUL) { - printf ("Can't start task: %s\n", rtems_status_text (sc)); - rtems_task_suspend (RTEMS_SELF); - } -} - -rtems_task -Init (rtems_task_argument ignored) -{ - int pass, i; - rtems_status_code sc; - - puts("**** Semaphore flush test ****"); - sc = rtems_semaphore_create ( - rtems_build_name ('S', 'E', 'M', 'F'), - 0, - RTEMS_LOCAL|RTEMS_BINARY_SEMAPHORE|RTEMS_NO_INHERIT_PRIORITY|RTEMS_NO_PRIORITY_CEILING|RTEMS_FIFO, - 0, - &semaphore); - if (sc != RTEMS_SUCCESSFUL) { - printf ("Can't flush semaphore: %s\n", rtems_status_text (sc)); - exit (1); - } - for (i = 0 ; i < NTASK ; i++) - starttask (i); - for (pass = 1 ; pass < 10 ; pass++) { - rtems_task_wake_after (1); - for (i = 0 ; i < NTASK ; i++) { - if (flags[i] != pass) - printf ("flags[%d] = %d -- expected %d\n", i, flags[i], pass); - } - sc = rtems_semaphore_flush (semaphore); - if (sc != RTEMS_SUCCESSFUL) { - printf ("Can't flush semaphore: %s\n", rtems_status_text (sc)); - exit (1); - } - } - puts ("**** Semaphore flush test succeeded ****"); - exit (1); -} diff --git a/testsuites/sptests/sp27/sp27.doc b/testsuites/sptests/sp27/sp27.doc deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/testsuites/sptests/sp27/sp27.scn b/testsuites/sptests/sp27/sp27.scn deleted file mode 100644 index 7c1c36e95e..0000000000 --- a/testsuites/sptests/sp27/sp27.scn +++ /dev/null @@ -1,2 +0,0 @@ -**** Semaphore flush test **** -**** Semaphore flush test succeeded **** diff --git a/testsuites/sptests/sp28/.cvsignore b/testsuites/sptests/sp28/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/sptests/sp28/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/sptests/sp28/Makefile.am b/testsuites/sptests/sp28/Makefile.am deleted file mode 100644 index 0f4895b4d2..0000000000 --- a/testsuites/sptests/sp28/Makefile.am +++ /dev/null @@ -1,35 +0,0 @@ -## -## $Id$ -## - - -TEST = sp28 - -MANAGERS = all - -C_FILES = init.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -DOCTYPES = scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/sptests.am - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/sptests/sp28/init.c b/testsuites/sptests/sp28/init.c deleted file mode 100644 index e2c5a40027..0000000000 --- a/testsuites/sptests/sp28/init.c +++ /dev/null @@ -1,123 +0,0 @@ -/* - * $Id$ - */ - -#define TEST_INIT -#include - -rtems_task Init(rtems_task_argument argument); - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER -#define CONFIGURE_MAXIMUM_USER_EXTENSIONS 2 - -#define CONFIGURE_MAXIMUM_TASKS 4 -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE -#define CONFIGURE_MICROSECONDS_PER_TICK 52429 - -#define CONFIGURE_MICROSECONDS_INIT - -#include - -#include -#include -#include - -volatile void *taskvar; -volatile int nRunning; -volatile int nDeleted; - -rtems_task -subtask (rtems_task_argument arg) -{ - int localvar = arg; - int i; - rtems_status_code sc; - - nRunning++; - while (nRunning != 3) - rtems_task_wake_after (0); - sc = rtems_task_variable_add (RTEMS_SELF, (void **)&taskvar, NULL); - if (sc != RTEMS_SUCCESSFUL) { - printf ("Can't add task variable: %s\n", rtems_status_text (sc)); - rtems_task_suspend (RTEMS_SELF); - } - taskvar = (void *)localvar; - while (localvar < 1000) { - localvar++; - rtems_task_wake_after (0); - taskvar = (void *)((int)taskvar + 1); - rtems_task_wake_after (0); - if ((int)taskvar != localvar) { - printf ("Task:%d taskvar:%d localvar:%d\n", arg, (int)taskvar, localvar); - rtems_task_suspend (RTEMS_SELF); - } - } - sc = rtems_task_variable_delete (RTEMS_SELF, (void **)&taskvar); - nDeleted++; - if (sc != RTEMS_SUCCESSFUL) { - printf ("Can't delete task variable: %s\n", rtems_status_text (sc)); - nRunning--; - rtems_task_suspend (RTEMS_SELF); - } - if ((int)taskvar == localvar) { - printf ("Task:%d deleted taskvar:%d localvar:%d\n", arg, (int)taskvar, localvar); - nRunning--; - rtems_task_suspend (RTEMS_SELF); - } - while (nDeleted != 3) - rtems_task_wake_after (0); - for (i = 0 ; i < 1000 ; i++) { - taskvar = (void *)(localvar = 100 * arg); - rtems_task_wake_after (0); - if (nRunning <= 1) - break; - if ((int)taskvar == localvar) { - printf ("Task:%d taskvar:%d localvar:%d\n", arg, (int)taskvar, localvar); - nRunning--; - rtems_task_suspend (RTEMS_SELF); - } - } - nRunning--; - while (nRunning) - rtems_task_wake_after (0); - printf ("Task variables test complete.\n"); - puts ("*** END OF TEST SP28 ***" ); - exit (0); -} - -void -starttask (int arg) -{ - rtems_id tid; - rtems_status_code sc; - - sc = rtems_task_create (rtems_build_name ('S', 'R', 'V', arg + 'A'), - 100, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_PREEMPT|RTEMS_NO_TIMESLICE|RTEMS_NO_ASR|RTEMS_INTERRUPT_LEVEL(0), - RTEMS_NO_FLOATING_POINT|RTEMS_LOCAL, - &tid); - if (sc != RTEMS_SUCCESSFUL) { - printf ("Can't create task: %s\n", rtems_status_text (sc)); - rtems_task_suspend (RTEMS_SELF); - } - sc = rtems_task_start (tid, subtask, arg); - if (sc != RTEMS_SUCCESSFUL) { - printf ("Can't start task: %s\n", rtems_status_text (sc)); - rtems_task_suspend (RTEMS_SELF); - } -} - -rtems_task -Init (rtems_task_argument ignored) -{ - - puts ("*** START OF TEST SP28 ***" ); - puts ("Task variables test begins. Any output between\n"); - puts ("this line and the `Task variables test complete' line indicates an error.\n"); - starttask (1); - starttask (2); - starttask (3); - rtems_task_suspend (RTEMS_SELF); -} diff --git a/testsuites/sptests/sp28/sp28.doc b/testsuites/sptests/sp28/sp28.doc deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/testsuites/sptests/sp28/sp28.scn b/testsuites/sptests/sp28/sp28.scn deleted file mode 100644 index 2919bcc38c..0000000000 --- a/testsuites/sptests/sp28/sp28.scn +++ /dev/null @@ -1,5 +0,0 @@ -*** START OF TEST SP28 *** -Task variables test begins. Any output between -this line and the `Task variables test complete' line indicates an error. -Task variables test succeeded. -*** END OF TEST SP28 *** diff --git a/testsuites/sptests/sp29/.cvsignore b/testsuites/sptests/sp29/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/sptests/sp29/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/sptests/sp29/Makefile.am b/testsuites/sptests/sp29/Makefile.am deleted file mode 100644 index 443b79efb8..0000000000 --- a/testsuites/sptests/sp29/Makefile.am +++ /dev/null @@ -1,35 +0,0 @@ -## -## $Id$ -## - - -TEST = sp29 - -MANAGERS = all - -C_FILES = init.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -DOCTYPES = scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/sptests.am - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/sptests/sp29/init.c b/testsuites/sptests/sp29/init.c deleted file mode 100644 index b706c982d2..0000000000 --- a/testsuites/sptests/sp29/init.c +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Test for rtems_semaphore_flush - * - * $Id$ - */ - -#include - -rtems_task Init (rtems_task_argument argument); - -#define CONFIGURE_EXTRA_TASK_STACKS RTEMS_MINIMUM_STACK_SIZE - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER -#define CONFIGURE_MAXIMUM_TASKS 2 -#define CONFIGURE_MAXIMUM_SEMAPHORES 2 - -#define CONFIGURE_INIT - -#include - -#include -#include - -rtems_interval ticksPerSecond; - -rtems_task -subtask (rtems_task_argument arg) -{ - rtems_status_code sc; - rtems_id sem = (rtems_id)arg; - - for (;;) { - rtems_task_wake_after (ticksPerSecond * 2); - - sc = rtems_semaphore_release (sem); - if (sc != RTEMS_SUCCESSFUL) - printf ("%d: Can't release semaphore: %s\n", __LINE__, rtems_status_text (sc)); - } -} - -void -startTask (rtems_id arg) -{ - rtems_id tid; - rtems_status_code sc; - - sc = rtems_task_create (rtems_build_name ('S', 'R', 'V', 'A'), - 100, - RTEMS_MINIMUM_STACK_SIZE * 2, - RTEMS_PREEMPT|RTEMS_NO_TIMESLICE|RTEMS_NO_ASR|RTEMS_INTERRUPT_LEVEL(0), - RTEMS_NO_FLOATING_POINT|RTEMS_LOCAL, - &tid); - if (sc != RTEMS_SUCCESSFUL) { - printf ("Can't create task: %s\n", rtems_status_text (sc)); - rtems_task_suspend (RTEMS_SELF); - } - sc = rtems_task_start (tid, subtask, arg); - if (sc != RTEMS_SUCCESSFUL) { - printf ("Can't start task: %s\n", rtems_status_text (sc)); - rtems_task_suspend (RTEMS_SELF); - } -} - -rtems_task Init (rtems_task_argument ignored) -{ - int i; - rtems_id semrec, semnorec; - rtems_status_code sc; - rtems_interval then, now; - - puts( "*** SP29 - SIMPLE SEMAPHORE TEST ***" ); - puts( "This test only prints on errors." ); - - sc = rtems_clock_get (RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticksPerSecond); - if (sc != RTEMS_SUCCESSFUL) { - printf ("Can't get ticks per second: %s\n", rtems_status_text (sc)); - exit (1); - } - sc = rtems_semaphore_create (rtems_build_name ('S', 'M', 'r', 'c'), - 1, - RTEMS_PRIORITY|RTEMS_BINARY_SEMAPHORE|RTEMS_INHERIT_PRIORITY |RTEMS_NO_PRIORITY_CEILING|RTEMS_LOCAL, - 0, - &semrec); - if (sc != RTEMS_SUCCESSFUL) { - printf ("%d: Can't create recursive-lock semaphore: %s\n", __LINE__, rtems_status_text (sc)); - exit (1); - } - sc = rtems_semaphore_create (rtems_build_name ('S', 'M', 'n', 'c'), - 1, - RTEMS_PRIORITY|RTEMS_SIMPLE_BINARY_SEMAPHORE|RTEMS_INHERIT_PRIORITY |RTEMS_NO_PRIORITY_CEILING|RTEMS_LOCAL, - 0, - &semnorec); - if (sc != RTEMS_SUCCESSFUL) { - printf ("%d: Can't create non-recursive-lock semaphore: %s\n", __LINE__, rtems_status_text (sc)); - exit (1); - } - - sc = rtems_semaphore_obtain (semrec, RTEMS_NO_WAIT, 0); - if (sc != RTEMS_SUCCESSFUL) { - printf ("%d: Can't obtain recursive-lock semaphore: %s\n", __LINE__, rtems_status_text (sc)); - } - sc = rtems_semaphore_obtain (semrec, RTEMS_NO_WAIT, 0); - if (sc != RTEMS_SUCCESSFUL) { - printf ("%d: Can't reobtain recursive-lock semaphore: %s\n", __LINE__, rtems_status_text (sc)); - } - - sc = rtems_semaphore_obtain (semnorec, RTEMS_NO_WAIT, 0); - if (sc != RTEMS_SUCCESSFUL) { - printf ("%d: Can't obtain non-recursive-lock semaphore: %s\n", __LINE__, rtems_status_text (sc)); - } - sc = rtems_semaphore_obtain (semnorec, RTEMS_NO_WAIT, 0); - if (sc == RTEMS_SUCCESSFUL) { - printf ("%d: Reobtain non-recursive-lock semaphore -- and should not have.\n", __LINE__); - } - - sc = rtems_semaphore_release (semnorec); - if (sc != RTEMS_SUCCESSFUL) { - printf ("%d: Can't release non-recursive-lock semaphore: %s\n", __LINE__, rtems_status_text (sc)); - } - sc = rtems_semaphore_release (semnorec); - if (sc != RTEMS_SUCCESSFUL) { - printf ("%d: Can't rerelease non-recursive-lock semaphore: %s\n", __LINE__, rtems_status_text (sc)); - } - sc = rtems_semaphore_obtain (semnorec, RTEMS_NO_WAIT, 0); - if (sc != RTEMS_SUCCESSFUL) { - printf ("%d: Can't obtain non-recursive-lock semaphore: %s\n", __LINE__, rtems_status_text (sc)); - } - sc = rtems_semaphore_obtain (semnorec, RTEMS_NO_WAIT, 0); - if (sc == RTEMS_SUCCESSFUL) { - printf ("%d: Reobtain non-recursive-lock semaphore -- and should not have.\n", __LINE__); - } - else if (sc != RTEMS_UNSATISFIED) { - printf ("%d: Reobtain non-recursive-lock semaphore failed, but error is %d (%s), not RTEMS_UNSATISFIED.\n", __LINE__, sc, rtems_status_text (sc)); - } - - sc = rtems_semaphore_release (semnorec); - if (sc != RTEMS_SUCCESSFUL) { - printf ("%d: Can't release non-recursive-lock semaphore: %s\n", __LINE__, rtems_status_text (sc)); - } - sc = rtems_semaphore_release (semnorec); - if (sc != RTEMS_SUCCESSFUL) { - printf ("%d: Can't rerelease non-recursive-lock semaphore: %s\n", __LINE__, rtems_status_text (sc)); - } - sc = rtems_semaphore_obtain (semnorec, RTEMS_NO_WAIT, 0); - if (sc != RTEMS_SUCCESSFUL) { - printf ("%d: Can't obtain non-recursive-lock semaphore: %s\n", __LINE__, rtems_status_text (sc)); - } - /* - * Since this task is holding this, this task will block and timeout. - * Then the timeout error will be returned. - */ - rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &then); - sc = rtems_semaphore_obtain (semnorec, RTEMS_WAIT, 5); - rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &now); - if (sc == RTEMS_SUCCESSFUL) { - printf ("%d: Reobtain non-recursive-lock semaphore -- and should not have.\n", __LINE__); - } - else if (sc != RTEMS_TIMEOUT) { - printf ("%d: Reobtain non-recursive-lock semaphore failed, but error is %d (%s), not RTEMS_TIMEOUT.\n", __LINE__, sc, rtems_status_text (sc)); - } - if ((then - now) < 4) - printf ("%d: Reobtain non-recursive-lock semaphore failed without timeout.\n", __LINE__); - - startTask (semnorec); - rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &then); - for (i = 0 ; i < 5 ; i++) { - int diff; - - sc = rtems_semaphore_obtain (semnorec, RTEMS_WAIT, RTEMS_NO_TIMEOUT); - rtems_clock_get (RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, &now); - diff = now - then; - then = now; - if (sc != RTEMS_SUCCESSFUL) - printf ("%d: Failed to obtain non-recursive-lock semaphore: %s\n", __LINE__, rtems_status_text (sc)); - else if (diff < (2 * ticksPerSecond)) - printf ("%d: Obtained obtain non-recursive-lock semaphore too quickly -- %d ticks not %d ticks\n", __LINE__, diff, (2 * ticksPerSecond) ); - } - - puts( "*** END OF SP29 ***" ); - exit (0); -} diff --git a/testsuites/sptests/sp29/sp29.doc b/testsuites/sptests/sp29/sp29.doc deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/testsuites/sptests/sp29/sp29.scn b/testsuites/sptests/sp29/sp29.scn deleted file mode 100644 index 700ed7f98f..0000000000 --- a/testsuites/sptests/sp29/sp29.scn +++ /dev/null @@ -1,4 +0,0 @@ -*** SP29 - SIMPLE SEMAPHORE TEST *** -This test only prints on errors. -*** END OF SP29 *** - diff --git a/testsuites/sptests/sp30/.cvsignore b/testsuites/sptests/sp30/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/sptests/sp30/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/sptests/sp30/Makefile.am b/testsuites/sptests/sp30/Makefile.am deleted file mode 100644 index 961c54b7c9..0000000000 --- a/testsuites/sptests/sp30/Makefile.am +++ /dev/null @@ -1,35 +0,0 @@ -## -## $Id$ -## - - -TEST = sp30 - -MANAGERS = all - -C_FILES = init.c resume.c task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -DOCTYPES = scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/sptests.am - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/sptests/sp30/init.c b/testsuites/sptests/sp30/init.c deleted file mode 100644 index 80bb26d232..0000000000 --- a/testsuites/sptests/sp30/init.c +++ /dev/null @@ -1,82 +0,0 @@ -/* 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-2002. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_time_of_day time; - rtems_unsigned32 index; - rtems_status_code status; - - puts( "\n\n*** TEST 30 ***" ); - - build_time( &time, 12, 31, 1988, 9, 0, 0, 0 ); - - status = rtems_clock_set( &time ); - directive_failed( status, "rtems_clock_set" ); - - status = rtems_timer_initiate_server( - RTEMS_TIMER_SERVER_DEFAULT_PRIORITY, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_ATTRIBUTES - ); - directive_failed( status, "rtems_timer_initiate_server" ); - - 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', ' ' ); - - 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', ' ' ); - - for ( index = 1 ; index <= 3 ; index++ ) { - status = rtems_task_create( - Task_name[ index ], - 1, - RTEMS_MINIMUM_STACK_SIZE * 2, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ index ] - ); - directive_failed( status, "rtems_task_create loop" ); - - status = rtems_timer_create( - Timer_name[ index ], - &Timer_id[ index ] - ); - directive_failed( status, "rtems_timer_create loop" ); - } - - for ( index = 1 ; index <= 3 ; index++ ) { - status = rtems_task_start( Task_id[ index ], Task_1_through_3, index ); - directive_failed( status, "rtems_task_start loop" ); - } - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} diff --git a/testsuites/sptests/sp30/resume.c b/testsuites/sptests/sp30/resume.c deleted file mode 100644 index 265e26f3aa..0000000000 --- a/testsuites/sptests/sp30/resume.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Resume_task - * - * This subprogram is scheduled as a timer service routine. When - * it fires it resumes the task which is mapped to this timer. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-2002. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -rtems_timer_service_routine Resume_task( - rtems_id timer_id, - void *ignored_address -) -{ - rtems_id task_to_resume; - rtems_status_code status; - - task_to_resume = Task_id[ rtems_get_index( timer_id ) ]; - status = rtems_task_resume( task_to_resume ); - directive_failed_with_level( status, "rtems_task_resume", 1 ); -} diff --git a/testsuites/sptests/sp30/sp30.doc b/testsuites/sptests/sp30/sp30.doc deleted file mode 100644 index a7f402b6d7..0000000000 --- a/testsuites/sptests/sp30/sp30.doc +++ /dev/null @@ -1,50 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-2002. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - -This file describes the directives and concepts tested by this test set. - -test set name: test30 - -directives: - ex_init, ex_start, t_create, t_start, tm_tick, i_return, t_ident, - ev_receive - -concepts: - - a. This test is a cyclic version of test1. The times printed by - each test should not skew as in test1 (see output section). - - b. Verifies system can create and start both the executive's system - initialization and idle task. - - c. Verifies executive can swap between three application tasks at the - same priority and the executive's internal idle task. - - d. Verifies can print strings to the CRT on port 2 of the mvme136 board - using Print and Println in the board support package. - - 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. - -output: - "TA1" is printed once every 5 seconds. "TA2" is printed once - every 10 seconds. "TA3" is printed once every 15 seconds. - - The times printed should be multiples of 5 seconds for TA1, 10 seconds - for TA2, and 15 seconds for TA3. If this does not happen, the calendar - time does not correspond correctly to the number of ticks. diff --git a/testsuites/sptests/sp30/sp30.scn b/testsuites/sptests/sp30/sp30.scn deleted file mode 100644 index 9a7ac23124..0000000000 --- a/testsuites/sptests/sp30/sp30.scn +++ /dev/null @@ -1,16 +0,0 @@ -*** TEST 30 *** -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 -TA2 - rtems_clock_get - 09:00:30 12/31/1988 -TA1 - rtems_clock_get - 09:00:30 12/31/1988 -*** END OF TEST 30 *** diff --git a/testsuites/sptests/sp30/system.h b/testsuites/sptests/sp30/system.h deleted file mode 100644 index 16056921f8..0000000000 --- a/testsuites/sptests/sp30/system.h +++ /dev/null @@ -1,55 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-2002. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_timer_service_routine Resume_task( - rtems_id timer_id, - void *ignored_address -); - -rtems_task Task_1_through_3( - rtems_task_argument argument -); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 5 -#define CONFIGURE_MAXIMUM_TIMERS 3 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_EXTRA_TASK_STACKS (3 * RTEMS_MINIMUM_STACK_SIZE) - -#include - -/* global variables */ - -TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */ - -TEST_EXTERN rtems_id Timer_id[ 4 ]; /* array of timer ids */ -TEST_EXTERN rtems_name Timer_name[ 4 ]; /* array of timer names */ - -/* end of include file */ diff --git a/testsuites/sptests/sp30/task1.c b/testsuites/sptests/sp30/task1.c deleted file mode 100644 index 38e6ad9ab2..0000000000 --- a/testsuites/sptests/sp30/task1.c +++ /dev/null @@ -1,57 +0,0 @@ -/* Task_1_through_3 - * - * This task is a cyclic version of test1 to asssure that the times - * displayed are not skewed as in test1. "TA1" is printed once every - * 5 seconds, "TA2" is printed once every 10 seconds, and "TA3" is - * printed once every 15 seconds. The times displayed should be - * in multiples of 5, 10, and 15 for TA1, TA2, and TA3 respectively. - * If the times are skewed from these values, then the calendar time - * does not correspond correctly with the number of ticks. - * - * COPYRIGHT (c) 1989-2002. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#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 of self" ); - - while ( FOREVER ) { - status = rtems_timer_server_fire_after( - Timer_id[ argument ], - task_number( tid ) * 5 * TICKS_PER_SECOND, - Resume_task, - NULL - ); - directive_failed( status, "rtems_timer_server_fire_after failed" ); - - status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time ); - directive_failed( status, "rtems_clock_get failed" ); - - if ( time.second >= 35 ) { - puts( "*** END OF TEST 30 ***" ); - rtems_test_exit( 0 ); - } - - put_name( Task_name[ task_number( tid ) - 1 ], FALSE ); - print_time( " - rtems_clock_get - ", &time, "\n" ); - - status = rtems_task_suspend( RTEMS_SELF ); - directive_failed( status, "rtems_task_suspend" ); - } -} diff --git a/testsuites/sptests/sp31/.cvsignore b/testsuites/sptests/sp31/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/sptests/sp31/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/sptests/sp31/Makefile.am b/testsuites/sptests/sp31/Makefile.am deleted file mode 100644 index b674a55fe4..0000000000 --- a/testsuites/sptests/sp31/Makefile.am +++ /dev/null @@ -1,35 +0,0 @@ -## -## $Id$ -## - - -TEST = sp31 - -MANAGERS = all - -C_FILES = delay.c init.c prtime.c task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -DOCTYPES = scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/sptests.am - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/sptests/sp31/delay.c b/testsuites/sptests/sp31/delay.c deleted file mode 100644 index 542c76fc65..0000000000 --- a/testsuites/sptests/sp31/delay.c +++ /dev/null @@ -1,31 +0,0 @@ -/* Delayed_resume - * - * This routine is scheduled to be fired as a timer service routine. - * When fired this subprogram resumes Task_1. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-2002. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -rtems_timer_service_routine Delayed_resume( - rtems_id ignored_id, - void *ignored_address -) -{ - rtems_status_code status; - - status = rtems_task_resume( Task_id[ 1 ] ); - directive_failed_with_level( status, "rtems_task_resume of self", 1 ); -} diff --git a/testsuites/sptests/sp31/init.c b/testsuites/sptests/sp31/init.c deleted file mode 100644 index b2a87d5766..0000000000 --- a/testsuites/sptests/sp31/init.c +++ /dev/null @@ -1,77 +0,0 @@ -/* 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-2002. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_time_of_day time; - rtems_status_code status; - - puts( "\n\n*** TEST 31 ***" ); - - build_time( &time, 12, 31, 1988, 9, 0, 0, 0 ); - - status = rtems_clock_set( &time ); - directive_failed( status, "rtems_clock_set" ); - - status = rtems_timer_initiate_server( - RTEMS_TIMER_SERVER_DEFAULT_PRIORITY, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_ATTRIBUTES - ); - directive_failed( status, "rtems_timer_initiate_server" ); - - Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' ); - Timer_name[ 1 ] = rtems_build_name( 'T', 'M', '1', ' ' ); - Timer_name[ 2 ] = rtems_build_name( 'T', 'M', '2', ' ' ); - - status = rtems_task_create( - Task_name[ 1 ], - 1, - RTEMS_MINIMUM_STACK_SIZE * 2, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 1 ] - ); - directive_failed( status, "rtems_task_create of TA1" ); - - status = rtems_task_start( Task_id[ 1 ], Task_1, 0 ); - directive_failed( status, "rtems_task_start of TA1" ); - - puts( "INIT - rtems_timer_create - creating timer 1" ); - status = rtems_timer_create( Timer_name[ 1 ], &Timer_id[ 1 ] ); - directive_failed( status, "rtems_timer_create" ); - printf( "INIT - timer 1 has id (0x%x)\n", Timer_id[ 1 ] ); - - puts( "INIT - rtems_timer_create - creating timer 2" ); - status = rtems_timer_create( Timer_name[ 2 ], &Timer_id[ 2 ] ); - directive_failed( status, "rtems_timer_create" ); - printf( "INIT - timer 2 has id (0x%x)\n", Timer_id[ 2 ] ); - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} diff --git a/testsuites/sptests/sp31/prtime.c b/testsuites/sptests/sp31/prtime.c deleted file mode 100644 index fea6434f2c..0000000000 --- a/testsuites/sptests/sp31/prtime.c +++ /dev/null @@ -1,31 +0,0 @@ -/* Print_time - * - * This routine prints the name of Task_1 and the current time of day. - * - * Input parameters: NONE - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-2002. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -void Print_time( void ) -{ - rtems_time_of_day time; - rtems_status_code status; - - status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time ); - directive_failed( status, "rtems_clock_get" ); - - put_name( Task_name[ 1 ], FALSE ); - print_time( "- rtems_clock_get - ", &time, "\n" ); -} diff --git a/testsuites/sptests/sp31/sp31.doc b/testsuites/sptests/sp31/sp31.doc deleted file mode 100644 index a0aa4a7301..0000000000 --- a/testsuites/sptests/sp31/sp31.doc +++ /dev/null @@ -1,19 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-2002. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - -This file describes the directives and concepts tested by this test set. - -test set name: test31 - -directives: - -concepts: diff --git a/testsuites/sptests/sp31/sp31.scn b/testsuites/sptests/sp31/sp31.scn deleted file mode 100644 index afb11f9d27..0000000000 --- a/testsuites/sptests/sp31/sp31.scn +++ /dev/null @@ -1,52 +0,0 @@ -*** TEST 31 *** -INIT - rtems_timer_create - creating timer 1 -INIT - timer 1 has id (0x12010001) -INIT - rtems_timer_create - creating timer 2 -INIT - timer 2 has id (0x12010002) -TA1 - rtems_timer_ident - identing timer 1 -TA1 - timer 1 has id (0x12010001) -TA1 - rtems_timer_ident - identing timer 2 -TA1 - timer 2 has id (0x12010002) -TA1 - rtems_timer_server_fire_after - 1 second -TA1 - rtems_task_wake_after - 1/2 second -TA1 - rtems_timer_server_fire_after - timer 2 in 1/2 second -TA1 - rtems_timer_cancel - timer 1 -TA1 - rtems_timer_cancel - timer 2 -TA1 - rtems_timer_server_fire_after - timer 1 in 30 seconds -TA1 - rtems_timer_server_fire_after - timer 2 in 60 seconds -Timer 1 scheduled for 3050 ticks since boot -Timer Server scheduled for 3050 ticks since boot -TA1 - rtems_task_wake_after - 1 second -TA1 - rtems_timer_server_fire_after - timer 2 in 60 seconds -Timer 1 scheduled for 3050 ticks since boot -Timer Server scheduled for 3050 ticks since boot -TA1 - rtems_task_wake_after - 1 second -TA1 - rtems_timer_server_fire_after - timer 2 in 60 seconds -Timer 1 scheduled for 3050 ticks since boot -Timer Server scheduled for 3050 ticks since boot -TA1 - rtems_timer_cancel - timer 1 -TA1 - rtems_timer_cancel - timer 2 -TA1 - rtems_clock_get - 09:00:02 12/31/1988 -TA1 - rtems_timer_server_fire_after - timer 1 in 3 seconds -TA1 - rtems_task_suspend( RTEMS_SELF ) -TA1 - rtems_clock_get - 09:00:05 12/31/1988 -TA1 - rtems_timer_server_fire_after - timer 1 in 3 seconds -TA1 - rtems_task_wake_after - 1 second -TA1 - rtems_clock_get - 09:00:06 12/31/1988 -TA1 - rtems_timer_reset - timer 1 -TA1 - rtems_task_suspend( RTEMS_SELF ) -TA1 - rtems_clock_get - 09:00:09 12/31/1988 - -TA1 - rtems_timer_server_fire_after - timer 1 in 3 seconds -TA1 - rtems_timer_cancel - timer 1 -TA1 - rtems_clock_get - 09:00:07 12/31/1988 -TA1 - rtems_timer_server_fire_when - timer 1 in 3 seconds -TA1 - rtems_task_suspend( RTEMS_SELF ) -TA1 - rtems_clock_get - 09:00:10 12/31/1988 -TA1 - rtems_timer_server_fire_when - timer 1 in 3 seconds -TA1 - rtems_task_wake_after - 1 second -TA1 - rtems_clock_get - 09:00:11 12/31/1988 -TA1 - rtems_timer_cancel - timer 1 -TA1 - rtems_task_wake_after - YIELD (only task at priority) -TA1 - timer_deleting - timer 1 -*** END OF TEST 31 *** diff --git a/testsuites/sptests/sp31/system.h b/testsuites/sptests/sp31/system.h deleted file mode 100644 index e0f3640681..0000000000 --- a/testsuites/sptests/sp31/system.h +++ /dev/null @@ -1,58 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-2002. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_timer_service_routine Delayed_resume( - rtems_id ignored_id, - void *ignored_address -); - -void Print_time( void ); - -rtems_task Task_1( - rtems_task_argument argument -); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 3 -#define CONFIGURE_MAXIMUM_TIMERS 2 -#define CONFIGURE_INIT_TASK_STACK_SIZE (RTEMS_MINIMUM_STACK_SIZE * 2) - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_EXTRA_TASK_STACKS (1 * RTEMS_MINIMUM_STACK_SIZE) - -#include - -/* global variables */ - -TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */ - -TEST_EXTERN rtems_id Timer_id[ 3 ]; /* array of timer ids */ -TEST_EXTERN rtems_name Timer_name[ 3 ]; /* array of timer names */ - -/* end of include file */ diff --git a/testsuites/sptests/sp31/task1.c b/testsuites/sptests/sp31/task1.c deleted file mode 100644 index 9330993197..0000000000 --- a/testsuites/sptests/sp31/task1.c +++ /dev/null @@ -1,274 +0,0 @@ -/* Task_1 - * - * 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-2002. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -volatile int TSR_fired; - -rtems_timer_service_routine Should_not_fire_TSR( - rtems_id ignored_id, - void *ignored_address -) -{ - TSR_fired = 1; -} - -rtems_task Task_1( - rtems_task_argument argument -) -{ - rtems_id tmid; - rtems_id tmid2; - rtems_time_of_day time; - rtems_status_code status; - rtems_timer_information info; - -/* Get id */ - - puts( "TA1 - rtems_timer_ident - identing timer 1" ); - status = rtems_timer_ident( Timer_name[ 1 ], &tmid ); - directive_failed( status, "rtems_timer_ident" ); - printf( "TA1 - timer 1 has id (0x%x)\n", tmid ); - - puts( "TA1 - rtems_timer_ident - identing timer 2" ); - status = rtems_timer_ident( Timer_name[ 2 ], &tmid2 ); - directive_failed( status, "rtems_timer_ident" ); - printf( "TA1 - timer 2 has id (0x%x)\n", tmid2 ); - -/* make sure insertion does not unintentionally fire a timer per PR147 */ - - TSR_fired = 0; - - puts( "TA1 - rtems_timer_server_fire_after - 1 second" ); - status = rtems_timer_server_fire_after( - tmid, TICKS_PER_SECOND, Should_not_fire_TSR, NULL ); - directive_failed( status, "rtems_timer_server_fire_after" ); - - puts( "TA1 - rtems_task_wake_after - 1/2 second" ); - status = rtems_task_wake_after( TICKS_PER_SECOND / 2 ); - directive_failed( status, "rtems_timer_server_fire_after" ); - - directive_failed( status, "rtems_timer_server_fire_after" ); - puts( "TA1 - rtems_timer_server_fire_after - timer 2 in 1/2 second" ); - status = rtems_timer_server_fire_after( - tmid2, TICKS_PER_SECOND / 2, Should_not_fire_TSR, NULL ); - directive_failed( status, "rtems_timer_server_fire_after" ); - - if ( TSR_fired ) { - puts( "TA1 - TSR fired and should not have!" ); - rtems_test_exit(1); - } - - puts( "TA1 - rtems_timer_cancel - timer 1" ); - status = rtems_timer_cancel( tmid ); - directive_failed( status, "rtems_timer_cancel" ); - - puts( "TA1 - rtems_timer_cancel - timer 2" ); - status = rtems_timer_cancel( tmid2 ); - directive_failed( status, "rtems_timer_cancel" ); - - -/* now check that rescheduling an active timer works OK. */ - puts( "TA1 - rtems_timer_server_fire_after - timer 1 in 30 seconds" ); - status = rtems_timer_server_fire_after( - tmid, 30 * TICKS_PER_SECOND, Delayed_resume, NULL ); - directive_failed( status, "rtems_timer_server_fire_after" ); - - puts( "TA1 - rtems_timer_server_fire_after - timer 2 in 60 seconds" ); - status = rtems_timer_server_fire_after( - tmid2, 60 * TICKS_PER_SECOND, Delayed_resume, NULL ); - directive_failed( status, "rtems_timer_server_fire_after" ); - - status = rtems_timer_get_information( tmid, &info ); - printf( "Timer 1 scheduled for %d ticks since boot\n", - info.start_time + info.initial ); - printf( "Timer Server scheduled for %d ticks since boot\n", - _Timer_Server->Timer.initial + _Timer_Server->Timer.start_time ); - - puts( "TA1 - rtems_task_wake_after - 1 second" ); - status = rtems_task_wake_after( 1 * TICKS_PER_SECOND ); - directive_failed( status, "rtems_timer_wake_after" ); - - puts( "TA1 - rtems_timer_server_fire_after - timer 2 in 60 seconds" ); - status = rtems_timer_server_fire_after( - tmid2, 60 * TICKS_PER_SECOND, Delayed_resume, NULL ); - directive_failed( status, "rtems_timer_server_fire_after" ); - - status = rtems_timer_get_information( tmid, &info ); - directive_failed( status, "rtems_timer_get_information" ); - printf( "Timer 1 scheduled for %d ticks since boot\n", - info.start_time + info.initial ); - printf( "Timer Server scheduled for %d ticks since boot\n", - _Timer_Server->Timer.initial + _Timer_Server->Timer.start_time ); - assert( (info.start_time + info.initial) == - (_Timer_Server->Timer.initial + _Timer_Server->Timer.start_time) ); - - puts( "TA1 - rtems_task_wake_after - 1 second" ); - status = rtems_task_wake_after( 1 * TICKS_PER_SECOND ); - directive_failed( status, "rtems_timer_wake_after" ); - - puts( "TA1 - rtems_timer_server_fire_after - timer 2 in 60 seconds" ); - status = rtems_timer_server_fire_after( - tmid2, 60 * TICKS_PER_SECOND, Delayed_resume, NULL ); - directive_failed( status, "rtems_timer_server_fire_after" ); - - status = rtems_timer_get_information( tmid, &info ); - directive_failed( status, "rtems_timer_get_information" ); - printf( "Timer 1 scheduled for %d ticks since boot\n", - info.start_time + info.initial ); - printf( "Timer Server scheduled for %d ticks since boot\n", - _Timer_Server->Timer.initial + _Timer_Server->Timer.start_time ); - assert( (info.start_time + info.initial) == - (_Timer_Server->Timer.initial + _Timer_Server->Timer.start_time) ); - - puts( "TA1 - rtems_timer_cancel - timer 1" ); - status = rtems_timer_cancel( tmid ); - directive_failed( status, "rtems_timer_cancel" ); - - puts( "TA1 - rtems_timer_cancel - timer 2" ); - status = rtems_timer_cancel( tmid2 ); - directive_failed( status, "rtems_timer_cancel" ); - -/* after which is allowed to fire */ - - Print_time(); - - puts( "TA1 - rtems_timer_server_fire_after - timer 1 in 3 seconds" ); - status = rtems_timer_server_fire_after( - tmid, - 3 * TICKS_PER_SECOND, - Delayed_resume, - NULL - ); - directive_failed( status, "rtems_timer_server_fire_after" ); - - puts( "TA1 - rtems_task_suspend( RTEMS_SELF )" ); - status = rtems_task_suspend( RTEMS_SELF ); - directive_failed( status, "rtems_task_suspend" ); - - Print_time(); - -/* after which is reset and allowed to fire */ - - puts( "TA1 - rtems_timer_server_fire_after - timer 1 in 3 seconds" ); - status = rtems_timer_server_fire_after( - tmid, - 3 * TICKS_PER_SECOND, - Delayed_resume, - NULL - ); - directive_failed( status, "rtems_timer_server_fire_after" ); - - puts( "TA1 - rtems_task_wake_after - 1 second" ); - status = rtems_task_wake_after( 1 * TICKS_PER_SECOND ); - directive_failed( status, "rtems_task_wake_after" ); - - Print_time(); - - puts( "TA1 - rtems_timer_reset - timer 1" ); - status = rtems_timer_reset( tmid ); - directive_failed( status, "rtems_timer_reset" ); - - puts( "TA1 - rtems_task_suspend( RTEMS_SELF )" ); - status = rtems_task_suspend( RTEMS_SELF ); - directive_failed( status, "rtems_task_suspend" ); - - Print_time(); - - rtems_test_pause(); - - /* - * Reset the time since we do not know how long the user waited - * before pressing at the pause. This insures that the - * actual output matches the screen. - */ - - build_time( &time, 12, 31, 1988, 9, 0, 7, 0 ); - - status = rtems_clock_set( &time ); - directive_failed( status, "rtems_clock_set" ); - -/* after which is canceled */ - - puts( "TA1 - rtems_timer_server_fire_after - timer 1 in 3 seconds" ); - status = rtems_timer_server_fire_after( - tmid, - 3 * TICKS_PER_SECOND, - Delayed_resume, - NULL - ); - directive_failed( status, "rtems_timer_server_fire_after" ); - - puts( "TA1 - rtems_timer_cancel - timer 1" ); - status = rtems_timer_cancel( tmid ); - directive_failed( status, "rtems_timer_cancel" ); - -/* when which is allowed to fire */ - - Print_time(); - - status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time ); - directive_failed( status, "rtems_clock_get" ); - - time.second += 3; - - puts( "TA1 - rtems_timer_server_fire_when - timer 1 in 3 seconds" ); - status = rtems_timer_server_fire_when( tmid, &time, Delayed_resume, NULL ); - directive_failed( status, "rtems_timer_server_fire_when" ); - - puts( "TA1 - rtems_task_suspend( RTEMS_SELF )" ); - status = rtems_task_suspend( RTEMS_SELF ); - directive_failed( status, "rtems_task_suspend" ); - - Print_time(); - -/* when which is canceled */ - - status = rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time ); - directive_failed( status, "rtems_clock_get" ); - - time.second += 3; - - puts( "TA1 - rtems_timer_server_fire_when - timer 1 in 3 seconds" ); - status = rtems_timer_server_fire_when( tmid, &time, Delayed_resume, NULL ); - directive_failed( status, "rtems_timer_server_fire_when" ); - - puts( "TA1 - rtems_task_wake_after - 1 second" ); - status = rtems_task_wake_after( 1 * TICKS_PER_SECOND ); - directive_failed( status, "rtems_task_wake_after" ); - - Print_time(); - - puts( "TA1 - rtems_timer_cancel - timer 1" ); - status = rtems_timer_cancel( tmid ); - directive_failed( status, "rtems_timer_cancel" ); - -/* delete */ - puts( "TA1 - rtems_task_wake_after - YIELD (only task at priority)" ); - status = rtems_task_wake_after( RTEMS_YIELD_PROCESSOR ); - directive_failed( status, "rtems_task_wake_after" ); - - puts( "TA1 - timer_deleting - timer 1" ); - status = rtems_timer_delete( tmid ); - directive_failed( status, "rtems_timer_delete" ); - - puts( "*** END OF TEST 31 *** " ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/sptests/sp32/.cvsignore b/testsuites/sptests/sp32/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/sptests/sp32/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/sptests/sp32/Makefile.am b/testsuites/sptests/sp32/Makefile.am deleted file mode 100644 index fa23bd8494..0000000000 --- a/testsuites/sptests/sp32/Makefile.am +++ /dev/null @@ -1,34 +0,0 @@ -## -## $Id$ -## - -TEST = sp32 - -MANAGERS = io rate_monotonic - -C_FILES = init.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -DOCTYPES = scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/sptests.am - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/sptests/sp32/init.c b/testsuites/sptests/sp32/init.c deleted file mode 100644 index a29d445ebf..0000000000 --- a/testsuites/sptests/sp32/init.c +++ /dev/null @@ -1,111 +0,0 @@ -/* spmonotonic -- sanity check the rate monotonic manager - * - * license and distribution terms for this file may be found in the file - * LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html . - * - * $Id$ - */ - -#include /* includes bsp.h, stdio, etc... */ - -/* prototype */ -rtems_task Init (rtems_task_argument ignored); - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER -#define CONFIGURE_MAXIMUM_TASKS 1 -#define CONFIGURE_MAXIMUM_PERIODS 1 - -#define CONFIGURE_INIT - -#include - -rtems_task Init( - rtems_task_argument ignored -) { - rtems_status_code status; - rtems_interval timestamps[6], - wantintervals[5] = - { 1, 50, 200, 25, 3 }; - rtems_name period_name = - rtems_build_name('P','E','R','a'); - rtems_id period_id; - int loopy; - - printf("\n\n*** TEST 32 ***\n"); - - /* create period */ - status = rtems_rate_monotonic_create( - period_name, - &period_id - ); - directive_failed(status, "rate_monotonic_create"); - - /* start period with initial value */ - status = rtems_rate_monotonic_period( - period_id, - wantintervals[0] - ); - directive_failed(status, "rate_monotonic_period"); - - /* get our first timestamp */ - status = rtems_clock_get( - RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, - ×tamps[0] - ); - directive_failed(status, "clock_get"); - - /* loop through and gather more timestamps */ - for (loopy = 1; loopy < 5; loopy++) { - - status = rtems_rate_monotonic_period( - period_id, - wantintervals[loopy] - ); - directive_failed(status, "rate_monotonic_period"); - - status = rtems_clock_get( - RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, - ×tamps[loopy] - ); - directive_failed(status, "clock_get"); - } - - /* block one last time */ - status = rtems_rate_monotonic_period( - period_id, - 1 - ); - directive_failed(status, "rate_monotonic_period"); - - /* get one last timestamp */ - status = rtems_clock_get( - RTEMS_CLOCK_GET_TICKS_SINCE_BOOT, - ×tamps[loopy] - ); - directive_failed(status, "clock_get"); - - /* cancel the period */ - status = rtems_rate_monotonic_cancel(period_id); - directive_failed(status, "rate_monotonic_cancel"); - - /* delete it */ - status = rtems_rate_monotonic_delete(period_id); - directive_failed(status, "rate_monotonic_delete"); - - /* tabulate and print results */ - for (loopy = 0; loopy < 5; loopy++) { - printf( - "period %d: measured %d tick(s), wanted %d\n", - loopy, timestamps[loopy+1] - timestamps[loopy], - wantintervals[loopy] - ); - } - - /* the end */ - printf("*** END OF TEST SP32 ***\n"); - exit(0); -} diff --git a/testsuites/sptests/sp32/sp32.scn b/testsuites/sptests/sp32/sp32.scn deleted file mode 100644 index 358a45dc2b..0000000000 --- a/testsuites/sptests/sp32/sp32.scn +++ /dev/null @@ -1,7 +0,0 @@ -*** TEST 32 *** -period 0: measured 1 tick(s), wanted 1 -period 1: measured 50 tick(s), wanted 50 -period 2: measured 200 tick(s), wanted 200 -period 3: measured 25 tick(s), wanted 25 -period 4: measured 3 tick(s), wanted 3 -*** END OF TEST SP32 *** diff --git a/testsuites/sptests/spfatal/.cvsignore b/testsuites/sptests/spfatal/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/sptests/spfatal/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/sptests/spfatal/Makefile.am b/testsuites/sptests/spfatal/Makefile.am deleted file mode 100644 index a9f8c8472f..0000000000 --- a/testsuites/sptests/spfatal/Makefile.am +++ /dev/null @@ -1,38 +0,0 @@ -## -## $Id$ -## - - -TEST = spfatal - -MANAGERS = io - -C_FILES = init.c puterr.c fatal.c task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/sptests.am - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/sptests/spfatal/README b/testsuites/sptests/spfatal/README deleted file mode 100644 index ad56f040b7..0000000000 --- a/testsuites/sptests/spfatal/README +++ /dev/null @@ -1,8 +0,0 @@ -# -# $Id$ -# - -This test depends on tricks to test the fatal error paths in the -RTEMS executive initialization path. These tricks have gotten -out of sync with the implementation. So this test is no longer -included in the build set. diff --git a/testsuites/sptests/spfatal/fatal.c b/testsuites/sptests/spfatal/fatal.c deleted file mode 100644 index 4f5972c144..0000000000 --- a/testsuites/sptests/spfatal/fatal.c +++ /dev/null @@ -1,136 +0,0 @@ -/* Fatal Error Test - * - * NOTE: - * - * This test actually modifies the Configuration table and restarts - * the executive. It is very carefully constructed to do this and - * uses the Configuration very carefully. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -#include - -char Workspace[ 64 * 1024 ] CPU_STRUCTURE_ALIGNMENT; - -typedef enum { - FATAL_WORKSPACE_OF_ZERO, - FATAL_NULL_WORKSPACE, - FATAL_WORKSPACE_TOO_SMALL, - FATAL_TASK_CREATE, - FATAL_TASK_START -} Fatal_errors_t; - -#define FATAL_LAST FATAL_TASK_START - -volatile Fatal_errors_t Case_in_switch; - -rtems_status_code Expected_Errors[] = { - RTEMS_UNSATISFIED, - RTEMS_INVALID_ADDRESS, - RTEMS_UNSATISFIED, - RTEMS_INVALID_PRIORITY, - RTEMS_TASK_EXITTED -}; - -rtems_status_code Error_Happened[ FATAL_LAST + 1]; - -jmp_buf Restart_Context; - -/* - * We depend on this being zeroed during initialization. This - * occurs automatically because this is part of the BSS. - */ - -rtems_unsigned32 First_Time_Through; - -void Process_case(); - -rtems_extension Fatal_extension( - rtems_unsigned32 source, - boolean is_internal, - rtems_unsigned32 error -) -{ - int index; - - Error_Happened[ Case_in_switch ] = error; - - if ( First_Time_Through == 0 ) { - Case_in_switch = FATAL_WORKSPACE_OF_ZERO; - First_Time_Through = 1; - setjmp( Restart_Context ); - } else if ( Case_in_switch == FATAL_LAST ) { - - /* - * Depending on the C library we use, we cannot get the - * task exitted error so do not check for it. - */ - - puts( "*** TEST FATAL ***" ); - for ( index=0 ; index< FATAL_LAST ; index++ ) - put_error( Error_Happened[ index ], Expected_Errors[ index ] ); - puts( "NOT TESTING FATAL ERROR WHEN TASK EXITS -- C LIBRARY CATCHES THIS" ); - puts( "*** END OF TEST FATAL ***" ); - - /* - * returns to the default fatal error handler instead of - * calling rtems_shutdown_executive - */ - return; - - } else { - - longjmp( Restart_Context, 1 ); - } - - Process_case(); -} - - - -void Process_case() -{ - switch ( Case_in_switch ) { - case FATAL_WORKSPACE_OF_ZERO: - New_Configuration = rtems_configuration_get_table(); - New_Configuration.work_space_start = NULL; - Case_in_switch = FATAL_NULL_WORKSPACE; - break; - - case FATAL_NULL_WORKSPACE: - New_Configuration.work_space_start = Workspace; - New_Configuration.work_space_size = 256; - Case_in_switch = FATAL_WORKSPACE_TOO_SMALL; - break; - - case FATAL_WORKSPACE_TOO_SMALL: - Initialization_tasks[ 0 ].initial_priority = RTEMS_CURRENT_PRIORITY; - New_Configuration.work_space_size = sizeof( Workspace ); - Case_in_switch = FATAL_TASK_CREATE; - break; - - case FATAL_TASK_CREATE: - Initialization_tasks[ 0 ].initial_priority = 1; - Initialization_tasks[ 0 ].entry_point = NULL; - Case_in_switch = FATAL_TASK_START; - break; - - case FATAL_TASK_START: - /* this extension exits the test */ - Initialization_tasks[ 0 ].entry_point = Init; - break; - } - rtems_initialize_executive( - &New_Configuration, rtems_cpu_configuration_get_table() ); -} - diff --git a/testsuites/sptests/spfatal/init.c b/testsuites/sptests/spfatal/init.c deleted file mode 100644 index 98b8eab4ed..0000000000 --- a/testsuites/sptests/spfatal/init.c +++ /dev/null @@ -1,50 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - - Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' ); - - status = rtems_task_create( - Task_name[ 1 ], - 1, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 1 ] - ); - directive_failed( status, "rtems_task_create of TA1" ); - - status = rtems_task_start( Task_id[ 1 ], Task_1, 0 ); - directive_failed( status, "rtems_task_start of TA1" ); - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} diff --git a/testsuites/sptests/spfatal/puterr.c b/testsuites/sptests/spfatal/puterr.c deleted file mode 100644 index efde7a7219..0000000000 --- a/testsuites/sptests/spfatal/puterr.c +++ /dev/null @@ -1,67 +0,0 @@ -/* put_error - * - * This routine verifies that the given error is the expected error. - * - * Input parameters: - * error - actual error code - * expected - expected error code - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -char *Errors[] = { - "RTEMS_SUCCESSFUL", /* successful completion */ - "RTEMS_TASK_EXITTED", /* returned from a task */ - "RTEMS_MP_NOT_CONFIGURED", /* multiprocessing not configured */ - "RTEMS_INVALID_NAME", /* invalid object name */ - "RTEMS_INVALID_ID", /* invalid object id */ - "RTEMS_TOO_MANY", /* too many */ - "RTEMS_TIMEOUT", /* timed out waiting */ - "RTEMS_OBJECT_WAS_DELETED", /* object was deleted while waiting */ - "RTEMS_INVALID_SIZE", /* specified size was invalid */ - "RTEMS_INVALID_ADDRESS", /* address specified is invalid */ - "RTEMS_INVALID_NUMBER", /* number was invalid */ - "RTEMS_NOT_DEFINED", /* item has not been initialized */ - "RTEMS_RESOURCE_IN_USE", /* resources still outstanding */ - "RTEMS_UNSATISFIED", /* request not satisfied */ - "RTEMS_INCORRECT_STATE", /* task is in wrong state */ - "RTEMS_ALREADY_SUSPENDED", /* task already in state */ - "RTEMS_ILLEGAL_ON_SELF", /* illegal operation on calling task */ - "RTEMS_ILLEGAL_ON_REMOTE_OBJECT", /* illegal operation for remote object */ - "RTEMS_CALLED_FROM_ISR", /* called from ISR */ - "RTEMS_INVALID_PRIORITY", /* invalid task priority */ - "RTEMS_INVALID_CLOCK", /* invalid date/time */ - "RTEMS_INVALID_NODE", /* invalid node id */ - "RTEMS_NOT_OWNER_OF_RESOURCE", /* not owner of resource */ - "RTEMS_NOT_CONFIGURED", /* directive not configured */ - "RTEMS_NOT_IMPLEMENTED" /* directive not implemented */ -}; - -/* Task states */ - -void put_error( - rtems_unsigned32 error, - rtems_status_code expected -) -{ - - if ( error <= RTEMS_NOT_IMPLEMENTED ) - printf( "EXPECTED FATAL - error code is correctly %s\n", Errors[ error ] ); - else - printf( "ERROR - out of range error code is %d\n", error ); - - if ( error != expected ) { - printf( "ERROR - did not get expected code of %d\n", expected ); - } -} diff --git a/testsuites/sptests/spfatal/spfatal.doc b/testsuites/sptests/spfatal/spfatal.doc deleted file mode 100644 index fd70b4a4ad..0000000000 --- a/testsuites/sptests/spfatal/spfatal.doc +++ /dev/null @@ -1,27 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - -This file describes the directives and concepts tested by this test set. - -test set name: testfatal - -directives: none - -concepts: - - a. Verifies that the proper error is reported by k_fatal when a task - exits. - - b. Verifies that the task exitted extension works correctly. - - c. Verifies that the fatal error extension works corectly. - diff --git a/testsuites/sptests/spfatal/spfatal.scn b/testsuites/sptests/spfatal/spfatal.scn deleted file mode 100644 index ecb9f63597..0000000000 --- a/testsuites/sptests/spfatal/spfatal.scn +++ /dev/null @@ -1,8 +0,0 @@ -*** TEST FATAL *** -EXPECTED FATAL - error code is correctly RTEMS_UNSATISFIED -EXPECTED FATAL - error code is correctly RTEMS_INVALID_ADDRESS -EXPECTED FATAL - error code is correctly RTEMS_UNSATISFIED -EXPECTED FATAL - error code is correctly RTEMS_INVALID_PRIORITY -EXPECTED FATAL - error code is correctly RTEMS_TASK_EXITTED -NOT TESTING FATAL ERROR WHEN TASK EXITS -- C LIBRARY CATCHES THIS -*** END OF TEST FATAL *** diff --git a/testsuites/sptests/spfatal/system.h b/testsuites/sptests/spfatal/system.h deleted file mode 100644 index da32fac308..0000000000 --- a/testsuites/sptests/spfatal/system.h +++ /dev/null @@ -1,74 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -void put_error( - rtems_unsigned32 error, - rtems_status_code expected -); - -rtems_extension Fatal_extension( - rtems_unsigned32 source, - boolean is_internal, - rtems_unsigned32 error -); - -rtems_task Task_1( - rtems_task_argument argument -); - -/* configuration information */ - -extern rtems_extensions_table initial_extensions; - -#define CONFIGURE_INITIAL_EXTENSIONS \ - { \ - NULL, /* create */ \ - NULL, /* start */ \ - NULL, /* restart */ \ - NULL, /* delete */ \ - NULL, /* switch */ \ - NULL, /* begin */ \ - NULL, /* exitted */ \ - Fatal_extension /* fatal */ \ - } - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MICROSECONDS_PER_TICK RTEMS_MILLISECONDS_TO_MICROSECONDS(0) -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* global variables */ - -TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */ - -TEST_EXTERN rtems_configuration_table New_Configuration; - -extern rtems_extensions_table Extensions; - -/* end of include file */ diff --git a/testsuites/sptests/spfatal/task1.c b/testsuites/sptests/spfatal/task1.c deleted file mode 100644 index c009d2c10e..0000000000 --- a/testsuites/sptests/spfatal/task1.c +++ /dev/null @@ -1,28 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -rtems_task Task_1( - rtems_task_argument argument -) -{ - puts( "\n\n*** TEST FATAL ***" ); - puts( "TA1 - exitting task" ); -} diff --git a/testsuites/sptests/spsize/.cvsignore b/testsuites/sptests/spsize/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/sptests/spsize/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/sptests/spsize/Makefile.am b/testsuites/sptests/spsize/Makefile.am deleted file mode 100644 index 8a7ec4c172..0000000000 --- a/testsuites/sptests/spsize/Makefile.am +++ /dev/null @@ -1,36 +0,0 @@ -## -## $Id$ -## - - -TEST = size - -MANAGERS = io - -C_FILES = init.c getint.c size.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = scn -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/sptests.am - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/sptests/spsize/getint.c b/testsuites/sptests/spsize/getint.c deleted file mode 100644 index 2572cec3e3..0000000000 --- a/testsuites/sptests/spsize/getint.c +++ /dev/null @@ -1,31 +0,0 @@ -/* getint - * - * This routine reads and returns an integer. - * It assumes decimal. - * - * Input parameters: NONE - * - * Output parameters: - * returns - number read - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include -#include - -int getint( void ) -{ - char buff[16]; - - gets(buff); - return atoi(buff); -} diff --git a/testsuites/sptests/spsize/init.c b/testsuites/sptests/spsize/init.c deleted file mode 100644 index cfe6057bc1..0000000000 --- a/testsuites/sptests/spsize/init.c +++ /dev/null @@ -1,63 +0,0 @@ -/* Init - * - * This routine is the initialization task for this test program. - * It is a user initialization task and has the responsibility for creating - * and starting the tasks that make up the test. If the time of day - * clock is required for the test, it should also be set to a known - * value by this function. - * - * Input parameters: - * argument - task argument - * - * Output parameters: NONE - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -/* #define HAVE_MENU */ - -rtems_task Test_task(); -void size_rtems( int mode ); - -rtems_task Init( - rtems_task_argument argument -) -{ -#if defined(HAVE_MENU) - int choice = 0; -#endif - - setvbuf(stdout, 0, _IONBF, 0); - - puts( "\n*** RTEMS SIZE PROGRAM ***" ); - size_rtems( 1 ); - puts( "*** END OF RTEMS SIZE PROGRAM ***" ); - rtems_test_exit( 0 ); -#if defined(HAVE_MENU) - do { - printf( "\n\nPlease select program mode:\n" ); - printf( " 1) Print Formulas\n" ); - printf( " 2) Determine Workspace Size\n" ); - printf( " 3) Exit\n" ); - printf( "Enter number of choice (1,2,3) : " ); - - choice = getint(); - switch( choice ) { - case 1: size_rtems( 1 ); break; - case 2: size_rtems( 0 ); break; - case 3: rtems_test_exit( 0 ); - default: continue; - } - } while ( FOREVER ); -#endif -} diff --git a/testsuites/sptests/spsize/size.c b/testsuites/sptests/spsize/size.c deleted file mode 100644 index 5ffe538107..0000000000 --- a/testsuites/sptests/spsize/size.c +++ /dev/null @@ -1,683 +0,0 @@ -/* main - * - * This program is run to determine the data space and work space - * requirements of the current version of RTEMS. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#if defined(RTEMS_MULTIPROCESSING) -#include -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -/* These are always defined by the executive. - * - * #include - * #include - * #include - */ -#define HEAP_OVHD 16 /* wasted heap space per task stack */ -#define NAME_PTR_SIZE 8 /* size of name and pointer table entries */ -#define READYCHAINS_SIZE \ - ((RTEMS_MAXIMUM_PRIORITY + 1) * sizeof(Chain_Control )) - -#define PER_TASK \ - (long) (sizeof (Thread_Control) + \ - NAME_PTR_SIZE + HEAP_OVHD + sizeof( RTEMS_API_Control )) -#define PER_SEMAPHORE \ - (long) (sizeof (Semaphore_Control) + NAME_PTR_SIZE) -#define PER_TIMER \ - (long) (sizeof (Timer_Control) + NAME_PTR_SIZE) -#define PER_MSGQ \ - (long) (sizeof (Message_queue_Control) + NAME_PTR_SIZE) -#define PER_REGN \ - (long) (sizeof (Region_Control) + NAME_PTR_SIZE) -#define PER_PART \ - (long) (sizeof (Partition_Control) + NAME_PTR_SIZE) -#define PER_PERIOD \ - (long) (sizeof (Rate_monotonic_Control) + NAME_PTR_SIZE) -#define PER_PORT \ - (long) (sizeof (Dual_ported_memory_Control) + NAME_PTR_SIZE) -#define PER_EXTENSION \ - (long) (sizeof (Extension_Control) + NAME_PTR_SIZE) - -#define PER_DRV (long) (0) -#define PER_FPTASK (long) (CONTEXT_FP_SIZE) -#define PER_GOBTBL (long) (sizeof (Chain_Control)*4) -#define PER_NODE (long) PER_GOBTBL -#if defined(RTEMS_MULTIPROCESSING) -#define PER_GOBJECT (long) (sizeof (Objects_MP_Control)) -#else -#define PER_GOBJECT (long) 0 -#endif -#define PER_PROXY (long) (sizeof (Thread_Proxy_control)) - -#if !defined(RTEMS_MULTIPROCESSING) || (CPU_ALL_TASKS_ARE_FP != TRUE) -#define MPCI_RECEIVE_SERVER_FP (long) 0 -#else -#define MPCI_RECEIVE_SERVER_FP (long) (sizeof( Context_Control_fp )) -#endif - -#if (CPU_IDLE_TASK_IS_FP == TRUE) -#define SYSTEM_IDLE_FP (long) (sizeof( Context_Control_fp )) -#else -#define SYSTEM_IDLE_FP (long) 0 -#endif - -#if !defined(RTEMS_MULTIPROCESSING) -#define MPCI_RECEIVE_SERVER_STACK_SIZE 0 -#endif - -#if defined(RTEMS_MULTIPROCESSING) -#define MP_SYSTEM_TASKS \ - (MPCI_RECEIVE_SERVER_STACK_SIZE + \ - sizeof(Thread_Control) + \ - MPCI_RECEIVE_SERVER_FP) -#else -#define MP_SYSTEM_TASKS 0 -#endif - -/* - * Idle and the MPCI Receive Server Threads - */ - -#define SYSTEM_TASKS \ - (STACK_MINIMUM_SIZE + sizeof(Thread_Control) + SYSTEM_IDLE_FP + \ - MP_SYSTEM_TASKS) - -#define rtems_unsigned32 unsigned32 - -rtems_unsigned32 sys_req; - -void help_size(); -void print_formula(); - -void size_rtems( - int mode -) -{ -int uninitialized = 0; -int initialized = 0; - -/* - * The following data is allocated for each Manager: - * - * + Per Manager Object Information - * - local pointer table - * - local name table - * - the object's control blocks - * - global name chains - * - * The following is the data allocate from the RTEMS Workspace Area. - * The order indicates the order in which RTEMS allocates it. - * - * + Object MP - * - Global Object CB's - * + Thread - * - Ready Chain - * + Thread MP - * - Proxies Chain - * + Interrupt Manager - * - Interrupt Stack - * + Timer Manager - * - per Manager Object Data - * + Extension Manager - * - per Manager Object Data - * + Message Queue Manager - * - per Manager Object Data - * - Message Buffers - * + Semaphore Manager - * - per Manager Object Data - * + Partition Manager - * - per Manager Object Data - * + Region Manager - * - per Manager Object Data - * + Dual Ported Memory Manager - * - per Manager Object Data - * + Rate Monotonic Manager - * - per Manager Object Data - * + Internal Threads Handler - * - MPCI Receive Server Thread TCB - * - IDLE Thread TCB - * - MPCI Receive Server Thread stack - * - MPCI Receive Server Thread FP area (if CPU requires this) - * - IDLE Thread stack - * - IDLE Thread FP area (if CPU requires this) - * - * This does not take into account any CPU dependent alignment requirements. - * - * The following calculates the overhead needed by RTEMS from the - * Workspace Area. - */ -sys_req = SYSTEM_TASKS + /* MPCI Receive Server and IDLE */ - NAME_PTR_SIZE + /* Task Overhead */ - READYCHAINS_SIZE + /* Ready Chains */ - NAME_PTR_SIZE + /* Timer Overhead */ - NAME_PTR_SIZE + /* Semaphore Overhead */ - NAME_PTR_SIZE + /* Message Queue Overhead */ - NAME_PTR_SIZE + /* Region Overhead */ - NAME_PTR_SIZE + /* Partition Overhead */ - NAME_PTR_SIZE + /* Dual-Ported Memory Overhead */ - NAME_PTR_SIZE + /* Rate Monotonic Overhead */ - NAME_PTR_SIZE + /* Extension Overhead */ - PER_NODE; /* Extra Gobject Table */ - -uninitialized = -/*address.h*/ 0 + - -/*apiext.h*/ (sizeof _API_extensions_List) + - -/*asr.h*/ 0 + - -/*attr.h*/ 0 + - -/*bitfield.h*/ 0 + - -/*chain.h*/ 0 + - -/*clock.h*/ 0 + - -/*config.h*/ (sizeof _Configuration_Table) + - (sizeof _Configuration_MP_table) + - -/*context.h*/ (sizeof _Context_Switch_necessary) + - -/*copyrt.h*/ 0 + - -/*debug.h*/ (sizeof _Debug_Level) + - -/*dpmem.h*/ (sizeof _Dual_ported_memory_Information) + - -/*event.h*/ (sizeof _Event_Sync_state) + - -#if defined(RTEMS_MULTIPROCESSING) -/*eventmp.h*/ 0 + -#endif - -/*eventset.h*/ 0 + - -/*extension.h*/ (sizeof _Extension_Information) + - -/*fatal.h*/ 0 + - -/*heap.h*/ 0 + - -/*init.h*/ 0 + - -/*interr.h*/ (sizeof Internal_errors_What_happened) + - -/*intr.h*/ 0 + - -/*io.h*/ (sizeof _IO_Number_of_drivers) + - (sizeof _IO_Driver_address_table) + - (sizeof _IO_Number_of_devices) + - (sizeof _IO_Driver_name_table) + - -/*isr.h*/ (sizeof _ISR_Nest_level) + - (sizeof _ISR_Vector_table) + - (sizeof _ISR_Signals_to_thread_executing) + - -/*message.h*/ (sizeof _Message_queue_Information) + - -/*modes.h*/ 0 + - -#if defined(RTEMS_MULTIPROCESSING) -/*mp.h*/ 0 + -#endif - -#if defined(RTEMS_MULTIPROCESSING) -/*mpci.h*/ (sizeof _MPCI_Remote_blocked_threads) + - (sizeof _MPCI_Semaphore) + - (sizeof _MPCI_table) + - (sizeof _MPCI_Receive_server_tcb) + - (sizeof _MPCI_Packet_processors) + -#endif - -#if defined(RTEMS_MULTIPROCESSING) -/*mppkt.h*/ 0 + -#endif - -#if defined(RTEMS_MULTIPROCESSING) -/*mptables.h*/ 0 + -#endif - -#if defined(RTEMS_MULTIPROCESSING) -/*msgmp.h*/ 0 + -#endif - -/*object.h*/ (sizeof _Objects_Local_node) + - (sizeof _Objects_Maximum_nodes) + - (sizeof _Objects_Information_table) + - -#if defined(RTEMS_MULTIPROCESSING) -/*objectmp.h*/ (sizeof _Objects_MP_Maximum_global_objects) + - (sizeof _Objects_MP_Inactive_global_objects) + -#endif - -/*options.h*/ 0 + - -/*part.h*/ (sizeof _Partition_Information) + - -#if defined(RTEMS_MULTIPROCESSING) -/*partmp.h*/ 0 + -#endif - -/*priority.h*/ (sizeof _Priority_Major_bit_map) + - (sizeof _Priority_Bit_map) + - -/*ratemon.h*/ (sizeof _Rate_monotonic_Information) + - -/*region.h*/ (sizeof _Region_Information) + - -#if defined(RTEMS_MULTIPROCESSING) -/*regionmp.h*/ 0 + -#endif - -/*rtems.h*/ /* Not applicable */ - -/*sem.h*/ (sizeof _Semaphore_Information) + - -#if defined(RTEMS_MULTIPROCESSING) -/*semmp.h*/ 0 + -#endif - -/*signal.h*/ 0 + - -/*signalmp.h*/ 0 + - -/*stack.h*/ 0 + - -/*states.h*/ 0 + - -/*status.h*/ 0 + - -/*sysstate.h*/ (sizeof _System_state_Is_multiprocessing) + - (sizeof _System_state_Current) + - -/*system.h*/ (sizeof _CPU_Table) + - -#if defined(RTEMS_MULTIPROCESSING) -/*taskmp.h*/ 0 + -#endif - -/*tasks.h*/ (sizeof _RTEMS_tasks_Information) + - (sizeof _RTEMS_tasks_User_initialization_tasks) + - (sizeof _RTEMS_tasks_Number_of_initialization_tasks) + - -/*thread.h*/ (sizeof _Thread_BSP_context) + - (sizeof _Thread_Dispatch_disable_level) + - (sizeof _Thread_Do_post_task_switch_extension) + - (sizeof _Thread_Maximum_extensions) + - (sizeof _Thread_Ticks_per_timeslice) + - (sizeof _Thread_Ready_chain) + - (sizeof _Thread_Executing) + - (sizeof _Thread_Heir) + -#if (CPU_HARDWARE_FP == 1) || (CPU_SOFTWARE_FP == 1) - (sizeof _Thread_Allocated_fp) + -#endif - (sizeof _Thread_Internal_information) + - (sizeof _Thread_Idle) + - -#if defined(RTEMS_MULTIPROCESSING) -/*threadmp.h*/ (sizeof _Thread_MP_Receive) + - (sizeof _Thread_MP_Active_proxies) + - (sizeof _Thread_MP_Inactive_proxies) + -#endif - -/*threadq.h*/ - -/*timer.h*/ (sizeof _Timer_Information) + - -/*tod.h*/ (sizeof _TOD_Current) + - (sizeof _TOD_Seconds_since_epoch) + - (sizeof _TOD_Microseconds_per_tick) + - (sizeof _TOD_Ticks_per_second) + - (sizeof _TOD_Seconds_watchdog) + - -/*tqdata.h*/ 0 + - -/*types.h*/ 0 + - -/*userext.h*/ (sizeof _User_extensions_List) + - -/*watchdog.h*/ (sizeof _Watchdog_Sync_level) + - (sizeof _Watchdog_Sync_count) + - (sizeof _Watchdog_Ticks_since_boot) + - (sizeof _Watchdog_Ticks_chain) + - (sizeof _Watchdog_Seconds_chain) + - -/*wkspace.h*/ (sizeof _Workspace_Area); - -uninitialized = 0; - -#ifndef unix /* make sure this is not a native compile */ - -#ifdef __i386__ - -/* cpu.h */ -uninitialized += (sizeof _CPU_Null_fp_context); - -#if (CPU_ALLOCATE_INTERRUPT_STACK == TRUE) -uninitialized += (sizeof _CPU_Interrupt_stack_low) + - (sizeof _CPU_Interrupt_stack_high); -#endif - -#endif - -#ifdef __i960__ - -/* cpu.h */ -uninitialized += (sizeof _CPU_Interrupt_stack_low) + - (sizeof _CPU_Interrupt_stack_high); - -#endif - -#ifdef __hppa__ - -/* cpu.h */ -uninitialized += (sizeof _CPU_Null_fp_context) + -#if !defined(RTEMS_UNIX) - (sizeof _CPU_Default_gr27) + -#endif - (sizeof _CPU_Interrupt_stack_low) + - (sizeof _CPU_Interrupt_stack_high); -#endif - -#ifdef __mc68000__ - -/* cpu.h */ -uninitialized += (sizeof _CPU_Interrupt_stack_low) + - (sizeof _CPU_Interrupt_stack_high); - -#endif - -#ifdef __sparc__ - -/* cpu.h */ -uninitialized += (sizeof _CPU_Interrupt_stack_low) + - (sizeof _CPU_Interrupt_stack_high) + - (sizeof _CPU_Null_fp_context); - -#endif - - -#ifdef no_cpu - -/* cpu.h */ -uninitialized += (sizeof _CPU_Null_fp_context) + - (sizeof _CPU_Interrupt_stack_low) + - (sizeof _CPU_Interrupt_stack_high) + - (sizeof _CPU_Thread_dispatch_pointer); - -#endif - -#ifdef __PPC__ - -/* cpu.h */ -uninitialized += (sizeof _CPU_Interrupt_stack_low) + - (sizeof _CPU_Interrupt_stack_high) + - (sizeof _CPU_IRQ_info); - -#endif -#endif /* !unix */ - -initialized += -/*copyrt.h*/ (strlen(_Copyright_Notice)+1) + - -/*sptables.h*/ (sizeof _Initialization_Default_multiprocessing_table) + - (strlen(_RTEMS_version)+1) + - - -/*tod.h*/ (sizeof _TOD_Days_per_month) + - (sizeof _TOD_Days_to_date) + - (sizeof _TOD_Days_since_last_leap_year); - -#ifndef unix /* make sure this is not native */ -#ifdef __sparc__ - -initialized += (sizeof _CPU_Trap_slot_template); - -#endif -#endif /* !unix */ - -puts( "" ); - - if ( mode == 0 ) help_size(); - else print_formula(); - -printf( "\n" ); -printf( "RTEMS uninitialized data consumes %d bytes\n", uninitialized ); -printf( "RTEMS intialized data consumes %d bytes\n", initialized ); - -} - -void help_size() -{ -int c = '\0'; -int break_loop; -int total_size; -int task_stacks; -int interrupt_stack; -int maximum_tasks, size_tasks; -int maximum_sems, size_sems; -int maximum_timers, size_timers; -int maximum_msgqs, size_msgqs; -int maximum_msgs, size_msgs_overhead; -int maximum_regns, size_regns; -int maximum_parts, size_parts; -int maximum_ports, size_ports; -int maximum_periods, size_periods; -int maximum_extensions, size_extensions; -int maximum_drvs, size_drvs; -int maximum_fps, size_fps; -int maximum_nodes, size_nodes; -int maximum_gobjs, size_gobjs; -int maximum_proxies, size_proxies; - -total_size = sys_req; /* Fixed Overhead */ -printf( "What is maximum_tasks? " ); -maximum_tasks = getint(); -size_tasks = PER_TASK * maximum_tasks; -total_size += size_tasks; - -printf( "What is maximum_semaphores? " ); -maximum_sems = getint(); -size_sems = PER_SEMAPHORE * maximum_sems; -total_size += size_sems; - -printf( "What is maximum_timers? " ); -maximum_timers = getint(); -size_timers = PER_TIMER * maximum_timers; -total_size += size_timers; - -printf( "What is maximum_message_queues? " ); -maximum_msgqs = getint(); -size_msgqs = PER_MSGQ * maximum_msgqs; -total_size += size_msgqs; - -printf( "What is maximum_messages? XXXX " ); -maximum_msgs = getint(); -size_msgs_overhead = 0; -total_size += size_msgs_overhead; - -printf( "What is maximum_regions? " ); -maximum_regns = getint(); -size_regns = PER_REGN * maximum_regns; -total_size += size_regns; - -printf( "What is maximum_partitions? " ); -maximum_parts = getint(); -size_parts = PER_PART * maximum_parts; -total_size += size_parts; - -printf( "What is maximum_ports? " ); -maximum_ports = getint(); -size_ports = PER_PORT * maximum_ports; -total_size += size_ports; - -printf( "What is maximum_periods? " ); -maximum_periods = getint(); -size_periods = PER_PORT * maximum_periods; -total_size += size_periods; - -printf( "What is maximum_extensions? " ); -maximum_extensions = getint(); -size_extensions = PER_EXTENSION * maximum_extensions; -total_size += size_extensions; - -printf( "What is number_of_device_drivers? " ); -maximum_drvs = getint(); -size_drvs = PER_DRV * maximum_drvs; -total_size += size_drvs; - -printf( "What will be total stack requirement for all tasks? " ); -task_stacks = getint(); -total_size += task_stacks; - -printf( "What is the size of the interrupt stack? " ); -interrupt_stack = getint(); -total_size += interrupt_stack; - -printf( "How many tasks will be created with the FP flag? " ); -maximum_fps = getint(); -size_fps = PER_FPTASK * maximum_fps; -total_size += size_fps; - -printf( "Is this a single processor system? " ); -for ( break_loop=0 ; !break_loop; c = getchar() ) { - switch ( c ) { - case 'Y': case 'y': - case 'N': case 'n': - break_loop = 1; - break; - } -} -printf( "%c\n", c ); -if ( c == 'n' || c == 'N' ) { - printf( "What is maximum_nodes? " ); - maximum_nodes = getint(); - size_nodes = PER_NODE * maximum_nodes; - total_size += size_nodes; - printf( "What is maximum_global_objects? " ); - maximum_gobjs = getint(); - size_gobjs = PER_GOBJECT * maximum_gobjs; - total_size += size_gobjs; - printf( "What is maximum_proxies? " ); - maximum_proxies = getint(); - size_proxies = PER_PROXY * maximum_proxies; - total_size += size_proxies; -} else { - maximum_nodes = 0; - size_nodes = PER_NODE * 0; - maximum_gobjs = 0; - size_gobjs = PER_GOBJECT * 0; - maximum_proxies = 0; - size_proxies = PER_PROXY * 0; -} - -printf( "\n\n" ); -printf( " ************** EXECUTIVE WORK SPACE REQUIRED **************\n" ); -printf( " Tasks - %03d * %03ld = %ld\n", - maximum_tasks, PER_TASK, (long) size_tasks ); -printf( " Semaphores - %03d * %03ld = %ld\n", - maximum_sems, PER_SEMAPHORE, (long) size_sems ); -printf( " Timers - %03d * %03ld = %ld\n", - maximum_timers, PER_TIMER, (long) size_timers ); -printf( " Msg Queues - %03d * %03ld = %ld\n", - maximum_msgqs, PER_MSGQ, (long) size_msgqs ); -printf( " Messages Overhead - %03d * %03d = %ld\n", - maximum_msgs, 0 /* PER_MSG_OVERHEAD */, (long) size_msgs_overhead ); -printf( " Regions - %03d * %03ld = %ld\n", - maximum_regns, PER_REGN, (long) size_regns); -printf( " Partitions - %03d * %03ld = %ld\n", - maximum_parts, PER_PART, (long) size_parts ); -printf( " Periods - %03d * %03ld = %ld\n", - maximum_periods, PER_PERIOD, (long) size_periods ); -printf( " Extensions - %03d * %03ld = %ld\n", - maximum_extensions, PER_EXTENSION, (long) size_extensions ); -printf( " Device Drivers - %03d * %03ld = %ld\n", - maximum_drvs, PER_DRV, (long) size_drvs ); - -printf( " System Requirements - %04d = %d\n", - sys_req, sys_req ); - -printf( " Floating Point Tasks - %03d * %03ld = %ld\n", - maximum_fps, PER_FPTASK, (long) size_fps ); -printf( " Application Task Stacks - = %d\n", - task_stacks ); -printf( " Interrupt Stacks - = %d\n", - task_stacks ); -printf( " \n" ); -printf( " Global object tables - %03d * %03ld = %ld\n", - maximum_nodes, PER_NODE, (long) size_nodes ); -printf( " Global objects - %03d * %03ld = %ld\n", - maximum_gobjs, PER_GOBJECT, (long) size_gobjs ); -printf( " Proxies - %03d * %03ld = %ld\n", - maximum_proxies, PER_PROXY, (long) size_proxies ); -printf( "\n\n" ); -printf( " TOTAL = %d bytes\n", - total_size ); -} - -void print_formula() -{ -printf( " ************** EXECUTIVE WORK SPACE FORMULA **************\n" ); -printf( " Tasks - maximum_tasks * %ld\n", PER_TASK ); -printf( " Timers - maximum_timers * %ld\n", PER_TIMER ); -printf( " Semaphores - maximum_semaphores * %ld\n", PER_SEMAPHORE); -printf( " Message Queues - maximum_message_queues * %ld\n", PER_MSGQ ); -printf( " Messages -\n"); -printf( " Regions - maximum_regions * %ld\n", PER_REGN ); -printf( " Partitions - maximum_partitions * %ld\n", PER_PART ); -printf( " Ports - maximum_ports * %ld\n", PER_PORT ); -printf( " Periods - maximum_periods * %ld\n", PER_PORT ); -printf( " Extensions - maximum_extensions * %ld\n", PER_EXTENSION ); -printf( " Device Drivers - number_of_device_drivers * %ld\n", PER_DRV); -printf( " System Requirements - %d\n", sys_req ); -printf( " Floating Point Tasks - FPMASK Tasks * %ld\n", PER_FPTASK ); -printf( " User's Tasks' Stacks -\n" ); -printf( " Interrupt Stack -\n" ); -printf( " \n" ); -printf( " Global object tables - maximum_nodes * %ld\n", PER_NODE ); -printf( " Global objects - maximum_global_objects * %ld\n", PER_GOBJECT ); -printf( " Proxies - maximum_proxies * %ld\n", PER_PROXY ); -} diff --git a/testsuites/sptests/spsize/size.scn b/testsuites/sptests/spsize/size.scn deleted file mode 100644 index 6ca8147f8b..0000000000 --- a/testsuites/sptests/spsize/size.scn +++ /dev/null @@ -1 +0,0 @@ -This is a dummy file diff --git a/testsuites/sptests/spsize/system.h b/testsuites/sptests/spsize/system.h deleted file mode 100644 index b29a466c98..0000000000 --- a/testsuites/sptests/spsize/system.h +++ /dev/null @@ -1,45 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_task Test_task( - rtems_task_argument argument -); - -int getint( void ); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 1 -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* global variables */ - -TEST_EXTERN rtems_id Task_id[ 4 ]; /* array of task ids */ -TEST_EXTERN rtems_name Task_name[ 4 ]; /* array of task names */ - -/* end of include file */ diff --git a/testsuites/sptests/sptests.am b/testsuites/sptests/sptests.am deleted file mode 100644 index 1f11f4dfa5..0000000000 --- a/testsuites/sptests/sptests.am +++ /dev/null @@ -1,25 +0,0 @@ -## $Id$ - -project_bspdir=$(PROJECT_ROOT)/@RTEMS_BSP@ - -$(project_bspdir)/tests: - @$(mkinstalldirs) $@ - -$(project_bspdir)/tests/$(TEST)$(LIB_VARIANT).exe: $(PGM) - $(INSTALL_PROGRAM) $< $@ - -$(project_bspdir)/tests/screens: - @$(mkinstalldirs) $@ - -$(project_bspdir)/tests/screens/sptests: - @$(mkinstalldirs) $@ - -$(project_bspdir)/tests/screens/sptests/$(TEST).scn: $(TEST).scn - $(INSTALL_DATA) $< $@ - -TMPINSTALL_FILES = \ -$(project_bspdir)/tests \ -$(project_bspdir)/tests/$(TEST)$(LIB_VARIANT).exe \ -$(project_bspdir)/tests/screens \ -$(project_bspdir)/tests/screens/sptests \ -$(project_bspdir)/tests/screens/sptests/$(TEST).scn diff --git a/testsuites/support/.cvsignore b/testsuites/support/.cvsignore deleted file mode 100644 index bfdfd995be..0000000000 --- a/testsuites/support/.cvsignore +++ /dev/null @@ -1,14 +0,0 @@ -aclocal.m4 -autom4te*.cache -config.cache -config.guess -config.log -config.status -config.sub -configure -depcomp -install-sh -Makefile -Makefile.in -missing -mkinstalldirs diff --git a/testsuites/support/ChangeLog b/testsuites/support/ChangeLog deleted file mode 100644 index 5266edd251..0000000000 --- a/testsuites/support/ChangeLog +++ /dev/null @@ -1,93 +0,0 @@ -2003-02-11 Ralf Corsepius - - * configure.ac: AM_INIT_AUTOMAKE([1.7.2]). - -2003-02-11 Ralf Corsepius - - * configure.ac: AC_PREREQ(2.57). - -2002-10-21 Ralf Corsepius - - * .cvsignore: Reformat. - Add autom4te*cache. - Remove autom4te.cache. - -2002-08-21 Ralf Corsepius - - * include/Makefile.am: Remove. - * Makefile.am: Merge in former include/Makefile.am. - * configure.ac: Reflect changes above. - Take out unnecessary autoconf macros. - -2002-08-01 Joel Sherrill - - * Per PR47 add support for buffered test output. This involved - adding defines to redirect output to a buffer and dump it when - full, at "test pause", and at exit. To avoid problems when redefining - exit(), all tests were modified to call rtems_test_exit(). - Some tests, notable psxtests, had to be modified to include - the standard test macro .h file (pmacros.h or tmacros.h) to - enable this support. - * include/buffer_test_io.h: New file. - -2002-03-27 Ralf Corsepius - - * configure.ac: - AC_INIT(package,_RTEMS_VERSION,_RTEMS_BUGS). - AM_INIT_AUTOMAKE([no-define foreign 1.6]). - * include/Makefile.am: Remove AUTOMAKE_OPTIONS. - * Makefile.am: Remove AUTOMAKE_OPTIONS. - -2001-11-07 Joel Sherrill - - Tracked as PR72 but related to the object id problem (PR36) - reported by Todor.Todorov@barco.com. - but discovered independently. - * include/tmacros.h: Added fatal_directive_check_status_only(). -2001-10-11 Ralf Corsepius - - * .cvsignore: Add autom4te.cache for autoconf > 2.52. - * configure.in: Remove. - * configure.ac: New file, generated from configure.in by autoupdate. - -2001-08-16 Joel Sherrill - - * include/tmacros.h: Attempt to print errno as further information. - -2001-05-10 Ralf Corsepius - - * configure.in: Use RTEMS_PROG_CC_FOR_TARGET([-ansi -fasm]). - -2001-01-26 Ralf Corsepius - - * configure.in: Remove stubdr, wrapup, AC_INIT(include). - * Makefile.am: Remove stubdr, wrapup. - * stubdr/Makefile.am, stubdr/open.c, stubdr/close.c, stubdr/init.c, - stubdr/stubdrv.h, stubdr/cntrl.c, stubdr/.cvsignore, stubdr/read.c, - stubdr/write.c, wrapup/Makefile.am, wrapup/.cvsignore, stubdr/, - wrapup/: Remove. - -2000-11-09 Ralf Corsepius - - * Makefile.am: Use ... instead of RTEMS_TOPdir in ACLOCAL_AMFLAGS. - -2000-11-02 Ralf Corsepius - - * stubdr/Makefile.am: Replace leaf.cfg w/ automake/lib.am. - -2000-11-02 Ralf Corsepius - - * Makefile.am: Switch to ACLOCAL_AMFLAGS = -I $(RTEMS_TOPdir)/aclocal. - -2000-10-27 Ralf Corsepius - - * Makefile.am: ACLOCAL_AMFLAGS= -I $(RTEMS_TOPdir)/macros. - Switch to GNU canonicalization. - -2000-09-04 Ralf Corsepius - - * stubdr/Makefile.am, wrapup/Makefile.am: Include compile.am - -2000-08-10 Joel Sherrill - - * ChangeLog: New file. diff --git a/testsuites/support/Makefile.am b/testsuites/support/Makefile.am deleted file mode 100644 index 0cd6acdc57..0000000000 --- a/testsuites/support/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -## -## $Id$ -## - -ACLOCAL_AMFLAGS = -I ../../../../aclocal - -project_bspdir = $(PROJECT_ROOT)/@RTEMS_BSP@ - -noinst_HEADERS = include/tmacros.h include/buffer_test_io.h - -TMPINSTALLFILES = $(project_bspdir)/lib/include \ - $(project_bspdir)/lib/include/tmacros.h \ - $(project_bspdir)/lib/include/buffer_test_io.h - -$(project_bspdir)/lib/include: - $(mkinstalldirs) $@ -$(project_bspdir)/lib/include/%.h: include/%.h - $(INSTALL_DATA) $< $@ - -CLEANFILES = $(project_bspdir)/lib/include/tmacros.h \ - $(project_bspdir)/lib/include/buffer_test_io.h - -all-local: $(TMPINSTALLFILES) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/support/configure.ac b/testsuites/support/configure.ac deleted file mode 100644 index dc8fc48850..0000000000 --- a/testsuites/support/configure.ac +++ /dev/null @@ -1,23 +0,0 @@ -## Process this file with autoconf to produce a configure script. -## -## $Id$ - -AC_PREREQ(2.57) -AC_INIT([rtems-c-src-tests-support],[_RTEMS_VERSION],[rtems-bugs@OARcorp.com]) -AC_CONFIG_SRCDIR([include]) -RTEMS_TOP(../../../..) -AC_CONFIG_AUX_DIR(../../../..) - -RTEMS_CANONICAL_TARGET_CPU - -AM_INIT_AUTOMAKE([no-define foreign 1.7.2]) -AM_MAINTAINER_MODE - -RTEMS_ENV_RTEMSBSP - -RTEMS_PROJECT_ROOT - -# Explicitly list all Makefiles here -AC_CONFIG_FILES([Makefile -]) -AC_OUTPUT diff --git a/testsuites/support/include/.cvsignore b/testsuites/support/include/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/support/include/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/support/include/buffer_test_io.h b/testsuites/support/include/buffer_test_io.h deleted file mode 100644 index f4bb2333d4..0000000000 --- a/testsuites/support/include/buffer_test_io.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Support for running the test output through a buffer - * - * $Id$ - */ - -#ifndef __BUFFER_TEST_IO_h -#define __BUFFER_TEST_IO_h - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -/* - * Uncomment this to get buffered test output. When commented out, - * test output behaves as it always has and is printed ASAP. - */ - -/* #define TESTS_BUFFER_OUTPUT */ - -#if !defined(TESTS_BUFFER_OUTPUT) - -#define rtems_test_exit(_s) \ - do { \ - exit(_s); \ - } while (0) - -#define FLUSH_OUTPUT() \ - do { \ - fflush(stdout); \ - } while (0) - -#else /* buffer test output */ - -#define _TEST_OUTPUT_BUFFER_SIZE 2048 -extern char _test_output_buffer[_TEST_OUTPUT_BUFFER_SIZE]; -void _test_output_append(char *); -void _test_output_flush(void); - -#define rtems_test_exit(_s) \ - do { \ - _test_output_flush(); \ - exit(_s); \ - } while (0) - -#undef printf -#define printf(...) \ - do { \ - char _buffer[128]; \ - sprintf( _buffer, __VA_ARGS__); \ - _test_output_append( _buffer ); \ - } while (0) - -#undef puts -#define puts(_string) \ - do { \ - char _buffer[128]; \ - sprintf( _buffer, "%s\n", _string ); \ - _test_output_append( _buffer ); \ - } while (0) - -#undef putchar -#define putchar(_c) \ - do { \ - char _buffer[2]; \ - _buffer[0] = _c; \ - _buffer[1] = '\0'; \ - _test_output_append( _buffer ); \ - } while (0) - -/* we write to stderr when there is a pause() */ -#define FLUSH_OUTPUT() _test_output_flush() - -#if defined(TEST_INIT) || defined(CONFIGURE_INIT) - -char _test_output_buffer[_TEST_OUTPUT_BUFFER_SIZE]; -int _test_output_buffer_index = 0; - -void _test_output_append(char *_buffer) -{ - char *p; - - for ( p=_buffer ; *p ; p++ ) { - _test_output_buffer[_test_output_buffer_index++] = *p; - _test_output_buffer[_test_output_buffer_index] = '\0'; -#if 0 - if ( *p == '\n' ) { - fprintf( stderr, "BUFFER -- %s", _test_output_buffer ); - _test_output_buffer_index = 0; - _test_output_buffer[0] = '\0'; - } -#endif - if ( _test_output_buffer_index >= (_TEST_OUTPUT_BUFFER_SIZE - 80) ) - _test_output_flush(); - } -} - -#include -#include - -void _test_output_flush(void) -{ - fprintf( stderr, "%s", _test_output_buffer ); - _test_output_buffer_index = 0; - tcdrain( 2 ); -} - -#endif /* TEST_INIT */ -#endif /* TESTS_BUFFER_OUTPUT */ - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/testsuites/support/include/tmacros.h b/testsuites/support/include/tmacros.h deleted file mode 100644 index a49068f8b6..0000000000 --- a/testsuites/support/include/tmacros.h +++ /dev/null @@ -1,243 +0,0 @@ -/* tmacros.h - * - * This include file contains macros which are useful in the RTEMS - * test suites. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#ifndef __TMACROS_h -#define __TMACROS_h - -#ifdef __cplusplus -extern "C" { -#endif - -#include /* includes */ - -#include -#include -#include -#include -#include - -#define FOREVER 1 /* infinite loop */ - -#ifdef TEST_INIT -#define TEST_EXTERN -#define CONFIGURE_INIT -#else -#define TEST_EXTERN extern -#endif - -#include - -/* - * Check that that the dispatch disable level is proper for the - * mode/state of the test. Normally it should be 0 when in task space. - */ - -#define check_dispatch_disable_level( _expect ) \ - do { \ - extern volatile rtems_unsigned32 _Thread_Dispatch_disable_level; \ - if ( (_expect) != -1 && _Thread_Dispatch_disable_level != (_expect) ) { \ - printf( "\n_Thread_Dispatch_disable_level is (%d) not %d\n", \ - _Thread_Dispatch_disable_level, (_expect) ); \ - FLUSH_OUTPUT(); \ - rtems_test_exit( 1 ); \ - } \ - } while ( 0 ) - -/* - * These macros properly report errors within the Classic API - */ - -#define directive_failed( _dirstat, _failmsg ) \ - fatal_directive_status( _dirstat, RTEMS_SUCCESSFUL, _failmsg ) - -#define directive_failed_with_level( _dirstat, _failmsg, _level ) \ - fatal_directive_status_with_level( \ - _dirstat, RTEMS_SUCCESSFUL, _failmsg, _level ) - -#define fatal_directive_status( _stat, _desired, _msg ) \ - fatal_directive_status_with_level( _stat, _desired, _msg, 0 ) - -#define fatal_directive_check_status_only( _stat, _desired, _msg ) \ - do { \ - if ( (_stat) != (_desired) ) { \ - printf( "\n%s FAILED -- expected (%s) got (%s)\n", \ - (_msg), rtems_status_text(_desired), rtems_status_text(_stat) ); \ - FLUSH_OUTPUT(); \ - rtems_test_exit( _stat ); \ - } \ - } while ( 0 ) - -#define fatal_directive_status_with_level( _stat, _desired, _msg, _level ) \ - do { \ - check_dispatch_disable_level( _level ); \ - fatal_directive_check_status_only( _stat, _desired, _msg ); \ - } while ( 0 ) - -/* - * These macros properly report errors from the POSIX API - */ - -#define posix_service_failed( _dirstat, _failmsg ) \ - fatal_posix_service_status( _dirstat, RTEMS_SUCCESSFUL, _failmsg ) - -#define posix_service_failed_with_level( _dirstat, _failmsg, _level ) \ - fatal_posix_service_status_with_level( \ - _dirstat, RTEMS_SUCCESSFUL, _failmsg, _level ) - -#define fatal_posix_service_status( _stat, _desired, _msg ) \ - fatal_posix_service_status_with_level( _stat, _desired, _msg, 0 ) - -#define fatal_posix_service_status_with_level( _stat, _desired, _msg, _level ) \ - do { \ - check_dispatch_disable_level( _level ); \ - if ( (_stat) != (_desired) ) { \ - printf( "\n%s FAILED -- expected (%d - %s) got (%d - %s)\n", \ - (_msg), _desired, strerror(_desired), _stat, strerror(_stat) ); \ - printf( "\n FAILED -- errno (%d - %s)\n", \ - errno, strerror(errno) ); \ - FLUSH_OUTPUT(); \ - rtems_test_exit( _stat ); \ - } \ - } while ( 0 ) - -/* - * Generic integer version of the error reporting - */ - -#define int_service_failed( _dirstat, _failmsg ) \ - fatal_int_service_status( _dirstat, RTEMS_SUCCESSFUL, _failmsg ) - -#define int_service_failed_with_level( _dirstat, _failmsg, _level ) \ - fatal_int_service_status_with_level( \ - _dirstat, RTEMS_SUCCESSFUL, _failmsg, _level ) - -#define fatal_int_service_status( _stat, _desired, _msg ) \ - fatal_int_service_status_with_level( _stat, _desired, _msg, 0 ) - -#define fatal_int_service_status_with_level( _stat, _desired, _msg, _level ) \ - do { \ - check_dispatch_disable_level( _level ); \ - if ( (_stat) != (_desired) ) { \ - printf( "\n%s FAILED -- expected (%d) got (%d)\n", \ - (_msg), (_desired), (_stat) ); \ - FLUSH_OUTPUT(); \ - rtems_test_exit( _stat ); \ - } \ - } while ( 0 ) - - -/* - * Print the time - */ - -#define sprint_time(_str, _s1, _tb, _s2) \ - do { \ - sprintf( (str), "%s%02d:%02d:%02d %02d/%02d/%04d%s", \ - _s1, (_tb)->hour, (_tb)->minute, (_tb)->second, \ - (_tb)->month, (_tb)->day, (_tb)->year, _s2 ); \ - } while ( 0 ) - -#define print_time(_s1, _tb, _s2) \ - do { \ - printf( "%s%02d:%02d:%02d %02d/%02d/%04d%s", \ - _s1, (_tb)->hour, (_tb)->minute, (_tb)->second, \ - (_tb)->month, (_tb)->day, (_tb)->year, _s2 ); \ - } while ( 0 ) - -#define put_dot( _c ) \ - do { \ - putchar( _c ); \ - FLUSH_OUTPUT(); \ - } while ( 0 ) - -#define new_line puts( "" ) - -#define puts_nocr printf - -#ifdef RTEMS_TEST_NO_PAUSE -#define rtems_test_pause() \ - do { \ - printf( "\n" ); \ - FLUSH_OUTPUT(); \ - } while ( 0 ) - -#define rtems_test_pause_and_screen_number( _screen ) \ - do { \ - printf( "\n", (_screen) ); \ - FLUSH_OUTPUT(); \ - } while ( 0 ) -#else -#define rtems_test_pause() \ - do { \ - char buffer[ 80 ]; \ - printf( "" ); \ - FLUSH_OUTPUT(); \ - gets( buffer ); \ - puts( "" ); \ - } while ( 0 ) - -#define rtems_test_pause_and_screen_number( _screen ) \ - do { \ - char buffer[ 80 ]; \ - printf( "", (_screen) ); \ - FLUSH_OUTPUT(); \ - gets( buffer ); \ - puts( "" ); \ - } while ( 0 ) -#endif - -#define put_name( name, crlf ) \ -{ rtems_unsigned32 c0, c1, c2, c3; \ - c0 = (name >> 24) & 0xff; \ - c1 = (name >> 16) & 0xff; \ - c2 = (name >> 8) & 0xff; \ - c3 = name & 0xff; \ - putchar( (char)c0 ); \ - if ( c1 ) putchar( (char)c1 ); \ - if ( c2 ) putchar( (char)c2 ); \ - if ( c3 ) putchar( (char)c3 ); \ - if ( crlf ) \ - putchar( '\n' ); \ -} - -#ifndef build_time -#define build_time( TB, MON, DAY, YR, HR, MIN, SEC, TK ) \ - { (TB)->year = YR; \ - (TB)->month = MON; \ - (TB)->day = DAY; \ - (TB)->hour = HR; \ - (TB)->minute = MIN; \ - (TB)->second = SEC; \ - (TB)->ticks = TK; } -#endif - -#define task_number( tid ) \ - ( rtems_get_index( tid ) - \ - rtems_configuration_get_rtems_api_configuration()->number_of_initialization_tasks ) - -static inline rtems_unsigned32 get_ticks_per_second( void ) -{ - rtems_interval ticks_per_second; - (void) rtems_clock_get( RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticks_per_second ); - return ticks_per_second; -} - -#define TICKS_PER_SECOND get_ticks_per_second() - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/testsuites/tmitrontests/.cvsignore b/testsuites/tmitrontests/.cvsignore deleted file mode 100644 index bfdfd995be..0000000000 --- a/testsuites/tmitrontests/.cvsignore +++ /dev/null @@ -1,14 +0,0 @@ -aclocal.m4 -autom4te*.cache -config.cache -config.guess -config.log -config.status -config.sub -configure -depcomp -install-sh -Makefile -Makefile.in -missing -mkinstalldirs diff --git a/testsuites/tmitrontests/ChangeLog b/testsuites/tmitrontests/ChangeLog deleted file mode 100644 index 184af97031..0000000000 --- a/testsuites/tmitrontests/ChangeLog +++ /dev/null @@ -1,81 +0,0 @@ -2003-02-11 Ralf Corsepius - - * configure.ac: AM_INIT_AUTOMAKE([1.7.2]). - -2003-02-11 Ralf Corsepius - - * configure.ac: AC_PREREQ(2.57). - -2002-10-21 Ralf Corsepius - - * .cvsignore: Reformat. - Add autom4te*cache. - Remove autom4te.cache. - -2002-08-11 Ralf Corsepius - - * tmitronsem01/Makefile.am: Use .$(OBJEXT) instead of .o. - -2002-08-01 Joel Sherrill - - * Per PR47 add support for buffered test output. This involved - adding defines to redirect output to a buffer and dump it when - full, at "test pause", and at exit. To avoid problems when redefining - exit(), all tests were modified to call rtems_test_exit(). - Some tests, notable psxtests, had to be modified to include - the standard test macro .h file (pmacros.h or tmacros.h) to - enable this support. - * tmitronsem01/init.c: Modified. - -2002-04-14 Ralf Corsepius - - * configure.ac: Remove ENABLE_GCC28. - -2002-03-27 Ralf Corsepius - - * configure.ac: - AC_INIT(package,_RTEMS_VERSION,_RTEMS_BUGS). - AM_INIT_AUTOMAKE([no-define foreign 1.6]). - * include/Makefile.am: Remove AUTOMAKE_OPTIONS. - * Makefile.am: Remove AUTOMAKE_OPTIONS. - * tmitronsem01/Makefile.am: Remove AUTOMAKE_OPTIONS. - -2001-10-11 Ralf Corsepius - - * .cvsignore: Add autom4te.cache for autoconf > 2.52. - * configure.in: Remove. - * configure.ac: New file, generated from configure.in by autoupdate. - -2001-09-22 Ralf Corsepius - - * tmitrontests.am: Use TMPINSTALL_FILES = to make automake-1.5 happy. - -2001-09-19 Ralf Corsepius - - * tmitronsem01/Makefile.am: include leaf.am instead of leaf.cfg. - -2001-05-10 Ralf Corsepius - - * configure.in: Use RTEMS_PROG_CC_FOR_TARGET([-ansi -fasm]). - -2000-11-09 Ralf Corsepius - - * Makefile.am: Use ... instead of RTEMS_TOPdir in ACLOCAL_AMFLAGS. - -2000-11-02 Ralf Corsepius - - * Makefile.am: Switch to ACLOCAL_AMFLAGS = -I $(RTEMS_TOPdir)/aclocal. - -2000-10-27 Ralf Corsepius - - * Makefile.am: ACLOCAL_AMFLAGS= -I $(RTEMS_TOPdir)/macros. - Switch to GNU canonicalization. - * tmitrontests.am: Remove DEFS. - -2000-09-04 Ralf Corsepius - - * tmitronsem01/Makefile.am: Include compile.am - -2000-08-10 Joel Sherrill - - * ChangeLog: New file. diff --git a/testsuites/tmitrontests/Makefile.am b/testsuites/tmitrontests/Makefile.am deleted file mode 100644 index b7efdbac4a..0000000000 --- a/testsuites/tmitrontests/Makefile.am +++ /dev/null @@ -1,14 +0,0 @@ -## -## $Id$ -## - -ACLOCAL_AMFLAGS = -I ../../../../aclocal - -ITRON_DIRS = include tmitronsem01 - -SUBDIRS = $(ITRON_DIRS) - -EXTRA_DIST = tmitrontests.am - -include $(top_srcdir)/../../../../automake/subdirs.am -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/tmitrontests/README b/testsuites/tmitrontests/README deleted file mode 100644 index 65c5d4165d..0000000000 --- a/testsuites/tmitrontests/README +++ /dev/null @@ -1,6 +0,0 @@ -# -# $Id$ -# - -This directory contains the functionality tests for the ITRON 3.0 API -implementation. diff --git a/testsuites/tmitrontests/configure.ac b/testsuites/tmitrontests/configure.ac deleted file mode 100644 index c1a43ee097..0000000000 --- a/testsuites/tmitrontests/configure.ac +++ /dev/null @@ -1,45 +0,0 @@ -## Process this file with autoconf to produce a configure script. -## -## $Id$ - -AC_PREREQ(2.57) -AC_INIT([rtems-c-src-tests-tmitrontests],[_RTEMS_VERSION],[rtems-bugs@OARcorp.com]) -AC_CONFIG_SRCDIR([tmitronsem01]) -RTEMS_TOP(../../../..) -AC_CONFIG_AUX_DIR(../../../..) - -RTEMS_CANONICAL_TARGET_CPU - -AM_INIT_AUTOMAKE([no-define foreign 1.7.2]) -AM_MAINTAINER_MODE - -RTEMS_ENABLE_BARE - -RTEMS_ENV_RTEMSBSP -RTEMS_CHECK_CPU -RTEMS_CANONICAL_HOST - -RTEMS_PROJECT_ROOT - -RTEMS_PROG_CC_FOR_TARGET([-ansi -fasm]) - -RTEMS_CANONICALIZE_TOOLS - -RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP) - -AC_SUBST(BARE_CPU_CFLAGS) -AC_SUBST(BARE_CPU_MODEL) -AC_SUBST(CC_CFLAGS_DEFAULT) -AC_SUBST(CC_CFLAGS_DEBUG_V) -AC_SUBST(CC_CFLAGS_PROFILE_V) -AC_SUBST(CC_LDFLAGS_PROFILE_V) - -OPERATION_COUNT=${OPERATION_COUNT-100} -AC_SUBST(OPERATION_COUNT) - -# Explicitly list all Makefiles here -AC_CONFIG_FILES([Makefile -include/Makefile -tmitronsem01/Makefile -]) -AC_OUTPUT diff --git a/testsuites/tmitrontests/include/.cvsignore b/testsuites/tmitrontests/include/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/tmitrontests/include/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/tmitrontests/include/Makefile.am b/testsuites/tmitrontests/include/Makefile.am deleted file mode 100644 index 107bff9b2d..0000000000 --- a/testsuites/tmitrontests/include/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -## -## $Id$ -## - - -noinst_HEADERS = timesys.h - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/tmitrontests/include/timesys.h b/testsuites/tmitrontests/include/timesys.h deleted file mode 100644 index 4a9ebf55ad..0000000000 --- a/testsuites/tmitrontests/include/timesys.h +++ /dev/null @@ -1,55 +0,0 @@ -/* timesys.h - * - * This header file contains the global variables for the Time - * suite. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* - * How many times a particular operation is performed while timed. - */ - -#ifndef OPERATION_COUNT -#define OPERATION_COUNT 100 -#endif - -/* functions */ - -#define put_time( _message, _total_time, \ - _iterations, _loop_overhead, _overhead ) \ - printf( \ - "%s %d\n", \ - (_message), \ - (((_total_time) - (_loop_overhead)) / (_iterations)) - (_overhead) \ - ) - -#if defined(STACK_CHECKER_ON) || defined(RTEMS_DEBUG) -#define Print_Warning() \ - do { \ - puts( \ - "\n" \ - "THE TIMES REPORTED BY THIS TEST INCLUDE DEBUG CODE!\n" \ - "\n" \ - ); \ - } while (0) - -#else -#define Print_Warning() -#endif - -/* variables */ - -TEST_EXTERN volatile unsigned32 end_time; /* ending time variable */ -TEST_EXTERN volatile unsigned32 overhead; /* loop overhead variable */ - -/* end of include file */ diff --git a/testsuites/tmitrontests/tmitronsem01/.cvsignore b/testsuites/tmitrontests/tmitronsem01/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/tmitrontests/tmitronsem01/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/tmitrontests/tmitronsem01/Makefile.am b/testsuites/tmitrontests/tmitronsem01/Makefile.am deleted file mode 100644 index b833ee6061..0000000000 --- a/testsuites/tmitrontests/tmitronsem01/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -## -## $Id$ -## - - -TEST = tmitronsem01 - -MANAGERS = all - -C_FILES = init.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/tmitrontests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -OPERATION_COUNT = @OPERATION_COUNT@ -AM_CPPFLAGS += -I$(top_srcdir)/include -DOPERATION_COUNT=$(OPERATION_COUNT) - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/tmitrontests/tmitronsem01/init.c b/testsuites/tmitrontests/tmitronsem01/init.c deleted file mode 100644 index 8fe0f63fbc..0000000000 --- a/testsuites/tmitrontests/tmitronsem01/init.c +++ /dev/null @@ -1,144 +0,0 @@ -/* 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-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" -#include -#include - -void ITRON_Init( void ) -{ - T_CSEM pk_csem; - T_RSEM pk_rsem; - int index; - - pk_csem.isemcnt = 2; - pk_csem.maxsem = 3; - pk_csem.sematr = TA_TFIFO; - - printf( "\n\n*** TMITRON01 -- ITRON TIMING TEST ***\n" ); - - /* - * time one invocation of cre_sem - */ - - Timer_initialize(); - (void) cre_sem( 1, &pk_csem ); - end_time = Read_timer(); - put_time( - "cre_sem", - end_time, - 1, - 0, /* no loop overhead to take out */ - 0 /* no calling overhead */ - ); - - /* - * time one invocation of del_sem - */ - - Timer_initialize(); - (void) del_sem( 1 ); - end_time = Read_timer(); - put_time( - "del_sem", - end_time, - 1, - 0, /* no loop overhead to take out */ - 0 /* no calling overhead */ - ); - - pk_csem.isemcnt = 100; - pk_csem.maxsem = 100; - pk_csem.sematr = TA_TFIFO; - (void) cre_sem( 1, &pk_csem ); - - /* - * time preq_sem (available) - */ - - Timer_initialize(); - for ( index = 1 ; index<=OPERATION_COUNT ; index++ ) - (void) preq_sem( 1 ); - end_time = Read_timer(); - put_time( - "preq_sem (available)", - end_time, - OPERATION_COUNT, - 0, /* don't take the loop overhead out */ - 0 /* no calling overhead */ - ); - - /* - * time preq_sem (not available) - */ - - Timer_initialize(); - for ( index = 1 ; index<=OPERATION_COUNT ; index++ ) - (void) preq_sem( 1 ); - end_time = Read_timer(); - put_time( - "preq_sem (not available)", - end_time, - OPERATION_COUNT, - 0, /* don't take the loop overhead out */ - 0 /* no calling overhead */ - ); - - /* - * time sig_sem (no waiting tasks) - */ - - Timer_initialize(); - for ( index = 1 ; index<=OPERATION_COUNT ; index++ ) - (void) sig_sem( 1 ); - end_time = Read_timer(); - put_time( - "sig_sem (no waiting tasks)", - end_time, - OPERATION_COUNT, - 0, /* don't take the loop overhead out */ - 0 /* no calling overhead */ - ); - - /* - * time ref_sem - */ - - Timer_initialize(); - for ( index = 1 ; index<=OPERATION_COUNT ; index++ ) - (void) ref_sem( 1, &pk_rsem ); - end_time = Read_timer(); - put_time( - "ref_sem", - end_time, - OPERATION_COUNT, - 0, /* don't take the loop overhead out */ - 0 /* no calling overhead */ - ); - - printf( "\n\nXXX ADD BLOCKING AND PREEMPTING TIME TESTS\n\n" ); - - - printf( "*** END OF TMITRON01 -- ITRON TIMING TEST ***\n" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/tmitrontests/tmitronsem01/system.h b/testsuites/tmitrontests/tmitronsem01/system.h deleted file mode 100644 index 97ba89f9f2..0000000000 --- a/testsuites/tmitrontests/tmitronsem01/system.h +++ /dev/null @@ -1,39 +0,0 @@ -/* system.h - * - * This include file contains information that is included in every - * function in the test set. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include -#include -#include - -/* functions */ - -void ITRON_Init( void ); - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER - -#define CONFIGURE_MAXIMUM_ITRON_TASKS 1 -#define CONFIGURE_MAXIMUM_ITRON_SEMAPHORES 100 -#define CONFIGURE_ITRON_INIT_TASK_TABLE - -#include - -/* global variables */ - -TEST_EXTERN rtems_id Global_variable; /* example global variable */ - -/* end of include file */ diff --git a/testsuites/tmitrontests/tmitronsem01/tmitronsem01.doc b/testsuites/tmitrontests/tmitronsem01/tmitronsem01.doc deleted file mode 100644 index 558f0594c8..0000000000 --- a/testsuites/tmitrontests/tmitronsem01/tmitronsem01.doc +++ /dev/null @@ -1,9 +0,0 @@ -# -# $Id$ -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - -Time some basic ITRON semaphore operations diff --git a/testsuites/tmitrontests/tmitrontests.am b/testsuites/tmitrontests/tmitrontests.am deleted file mode 100644 index c17e0fac5f..0000000000 --- a/testsuites/tmitrontests/tmitrontests.am +++ /dev/null @@ -1,13 +0,0 @@ -## $Id$ - -project_bspdir=$(PROJECT_ROOT)/@RTEMS_BSP@ - -$(project_bspdir)/tests: - @$(mkinstalldirs) $@ - -$(project_bspdir)/tests/$(TEST)$(LIB_VARIANT).exe: $(PGM) - $(INSTALL_PROGRAM) $< $@ - -TMPINSTALL_FILES = \ -$(project_bspdir)/tests \ -$(project_bspdir)/tests/$(TEST)$(LIB_VARIANT).exe diff --git a/testsuites/tmtests/.cvsignore b/testsuites/tmtests/.cvsignore deleted file mode 100644 index bfdfd995be..0000000000 --- a/testsuites/tmtests/.cvsignore +++ /dev/null @@ -1,14 +0,0 @@ -aclocal.m4 -autom4te*.cache -config.cache -config.guess -config.log -config.status -config.sub -configure -depcomp -install-sh -Makefile -Makefile.in -missing -mkinstalldirs diff --git a/testsuites/tmtests/ChangeLog b/testsuites/tmtests/ChangeLog deleted file mode 100644 index acc1198c9b..0000000000 --- a/testsuites/tmtests/ChangeLog +++ /dev/null @@ -1,197 +0,0 @@ -2003-02-11 Ralf Corsepius - - * configure.ac: AM_INIT_AUTOMAKE([1.7.2]). - -2003-02-11 Ralf Corsepius - - * configure.ac: AC_PREREQ(2.57). - -2002-10-21 Ralf Corsepius - - * .cvsignore: Reformat. - Add autom4te*cache. - Remove autom4te.cache. - -2002-08-11 Ralf Corsepius - - * tm01/Makefile.am: Use $(OBJEXT) instead of .o. - * tm02/Makefile.am: Use $(OBJEXT) instead of .o. - * tm03/Makefile.am: Use $(OBJEXT) instead of .o. - * tm04/Makefile.am: Use $(OBJEXT) instead of .o. - * tm05/Makefile.am: Use $(OBJEXT) instead of .o. - * tm06/Makefile.am: Use $(OBJEXT) instead of .o. - * tm07/Makefile.am: Use $(OBJEXT) instead of .o. - * tm08/Makefile.am: Use $(OBJEXT) instead of .o. - * tm09/Makefile.am: Use $(OBJEXT) instead of .o. - * tm10/Makefile.am: Use $(OBJEXT) instead of .o. - * tm11/Makefile.am: Use $(OBJEXT) instead of .o. - * tm12/Makefile.am: Use $(OBJEXT) instead of .o. - * tm13/Makefile.am: Use $(OBJEXT) instead of .o. - * tm14/Makefile.am: Use $(OBJEXT) instead of .o. - * tm15/Makefile.am: Use $(OBJEXT) instead of .o. - * tm16/Makefile.am: Use $(OBJEXT) instead of .o. - * tm17/Makefile.am: Use $(OBJEXT) instead of .o. - * tm18/Makefile.am: Use $(OBJEXT) instead of .o. - * tm19/Makefile.am: Use $(OBJEXT) instead of .o. - * tm20/Makefile.am: Use $(OBJEXT) instead of .o. - * tm21/Makefile.am: Use $(OBJEXT) instead of .o. - * tm22/Makefile.am: Use $(OBJEXT) instead of .o. - * tm23/Makefile.am: Use $(OBJEXT) instead of .o. - * tm24/Makefile.am: Use $(OBJEXT) instead of .o. - * tm25/Makefile.am: Use $(OBJEXT) instead of .o. - * tm26/Makefile.am: Use $(OBJEXT) instead of .o. - * tm27/Makefile.am: Use $(OBJEXT) instead of .o. - * tm28/Makefile.am: Use $(OBJEXT) instead of .o. - * tm29/Makefile.am: Use $(OBJEXT) instead of .o. - * tmck/Makefile.am: Use $(OBJEXT) instead of .o. - * tmoverhd/Makefile.am: Use $(OBJEXT) instead of .o. - -2002-08-01 Joel Sherrill - - * Per PR47 add support for buffered test output. This involved - adding defines to redirect output to a buffer and dump it when - full, at "test pause", and at exit. To avoid problems when redefining - exit(), all tests were modified to call rtems_test_exit(). - Some tests, notable psxtests, had to be modified to include - the standard test macro .h file (pmacros.h or tmacros.h) to - enable this support. - * include/timesys.h, tm01/task1.c, tm02/task1.c, tm03/task1.c, - tm04/task1.c, tm05/task1.c, tm06/task1.c, tm07/task1.c, tm08/task1.c, - tm09/task1.c, tm10/task1.c, tm11/task1.c, tm12/task1.c, tm13/task1.c, - tm14/task1.c, tm15/task1.c, tm16/task1.c, tm17/task1.c, tm18/task1.c, - tm19/task1.c, tm20/task1.c, tm21/task1.c, tm22/task1.c, tm23/task1.c, - tm24/task1.c, tm25/task1.c, tm26/task1.c, tm27/task1.c, tm28/task1.c, - tm29/task1.c, tmck/task1.c, tmoverhd/testtask.c: Modified. -2002-04-14 Ralf Corsepius - - * configure.ac: Remove ENABLE_GCC28. - -2002-03-27 Ralf Corsepius - - * configure.ac: - AC_INIT(package,_RTEMS_VERSION,_RTEMS_BUGS). - AM_INIT_AUTOMAKE([no-define foreign 1.6]). - * include/Makefile.am: Remove AUTOMAKE_OPTIONS. - * Makefile.am: Remove AUTOMAKE_OPTIONS. - * tm01/Makefile.am: Remove AUTOMAKE_OPTIONS. - * tm02/Makefile.am: Remove AUTOMAKE_OPTIONS. - * tm03/Makefile.am: Remove AUTOMAKE_OPTIONS. - * tm04/Makefile.am: Remove AUTOMAKE_OPTIONS. - * tm05/Makefile.am: Remove AUTOMAKE_OPTIONS. - * tm06/Makefile.am: Remove AUTOMAKE_OPTIONS. - * tm07/Makefile.am: Remove AUTOMAKE_OPTIONS. - * tm08/Makefile.am: Remove AUTOMAKE_OPTIONS. - * tm09/Makefile.am: Remove AUTOMAKE_OPTIONS. - * tm10/Makefile.am: Remove AUTOMAKE_OPTIONS. - * tm11/Makefile.am: Remove AUTOMAKE_OPTIONS. - * tm12/Makefile.am: Remove AUTOMAKE_OPTIONS. - * tm13/Makefile.am: Remove AUTOMAKE_OPTIONS. - * tm14/Makefile.am: Remove AUTOMAKE_OPTIONS. - * tm15/Makefile.am: Remove AUTOMAKE_OPTIONS. - * tm16/Makefile.am: Remove AUTOMAKE_OPTIONS. - * tm17/Makefile.am: Remove AUTOMAKE_OPTIONS. - * tm18/Makefile.am: Remove AUTOMAKE_OPTIONS. - * tm19/Makefile.am: Remove AUTOMAKE_OPTIONS. - * tm20/Makefile.am: Remove AUTOMAKE_OPTIONS. - * tm21/Makefile.am: Remove AUTOMAKE_OPTIONS. - * tm22/Makefile.am: Remove AUTOMAKE_OPTIONS. - * tm23/Makefile.am: Remove AUTOMAKE_OPTIONS. - * tm24/Makefile.am: Remove AUTOMAKE_OPTIONS. - * tm25/Makefile.am: Remove AUTOMAKE_OPTIONS. - * tm26/Makefile.am: Remove AUTOMAKE_OPTIONS. - * tm27/Makefile.am: Remove AUTOMAKE_OPTIONS. - * tm28/Makefile.am: Remove AUTOMAKE_OPTIONS. - * tm29/Makefile.am: Remove AUTOMAKE_OPTIONS. - * tmck/Makefile.am: Remove AUTOMAKE_OPTIONS. - * tmoverhd/Makefile.am: Remove AUTOMAKE_OPTIONS. - -2001-11-08 Jiri Gaisler - - This fix is response to test results reported by Jerry Needell - for the SPARC/ERC32 and tracked as PR80. - * tm27/task1.c: Account for overhead in starting and stopping - the timer. - -2001-10-11 Ralf Corsepius - - * .cvsignore: Add autom4te.cache for autoconf > 2.52. - * configure.in: Remove. - * configure.ac: New file, generated from configure.in by autoupdate. - -2001-09-22 Ralf Corsepius - - * tmtests.am: Use TMPINSTALL_FILES = to make automake-1.5 happy. - -2001-09-19 Ralf Corsepius - - * tm27/Makefile.am: include leaf.am instead of leaf.cfg. - * tm26/Makefile.am: include leaf.am instead of leaf.cfg. - * tm24/Makefile.am: include leaf.am instead of leaf.cfg. - * tm16/Makefile.am: include leaf.am instead of leaf.cfg. - * tm18/Makefile.am: include leaf.am instead of leaf.cfg. - * tm02/Makefile.am: include leaf.am instead of leaf.cfg. - * tm10/Makefile.am: include leaf.am instead of leaf.cfg. - * tm11/Makefile.am: include leaf.am instead of leaf.cfg. - * tm15/Makefile.am: include leaf.am instead of leaf.cfg. - * tm19/Makefile.am: include leaf.am instead of leaf.cfg. - * tm04/Makefile.am: include leaf.am instead of leaf.cfg. - * tm17/Makefile.am: include leaf.am instead of leaf.cfg. - * tm28/Makefile.am: include leaf.am instead of leaf.cfg. - * tmck/Makefile.am: include leaf.am instead of leaf.cfg. - * tm08/Makefile.am: include leaf.am instead of leaf.cfg. - * tm12/Makefile.am: include leaf.am instead of leaf.cfg. - * tm03/Makefile.am: include leaf.am instead of leaf.cfg. - * tm13/Makefile.am: include leaf.am instead of leaf.cfg. - * tm29/Makefile.am: include leaf.am instead of leaf.cfg. - * tmoverhd/Makefile.am: include leaf.am instead of leaf.cfg. - * tm20/Makefile.am: include leaf.am instead of leaf.cfg. - * tm09/Makefile.am: include leaf.am instead of leaf.cfg. - * tm01/Makefile.am: include leaf.am instead of leaf.cfg. - * tm21/Makefile.am: include leaf.am instead of leaf.cfg. - * tm07/Makefile.am: include leaf.am instead of leaf.cfg. - * tm25/Makefile.am: include leaf.am instead of leaf.cfg. - * tm22/Makefile.am: include leaf.am instead of leaf.cfg. - * tm06/Makefile.am: include leaf.am instead of leaf.cfg. - * tm05/Makefile.am: include leaf.am instead of leaf.cfg. - * tm14/Makefile.am: include leaf.am instead of leaf.cfg. - * tm23/Makefile.am: include leaf.am instead of leaf.cfg. - -2001-05-10 Ralf Corsepius - - * configure.in: Use RTEMS_PROG_CC_FOR_TARGET([-ansi -fasm]). - -2001-01-26 Ralf Corsepius - - * tm20/Makefile.am: Remove stubdir.rel - -2000-11-09 Ralf Corsepius - - * Makefile.am: Use ... instead of RTEMS_TOPdir in ACLOCAL_AMFLAGS. - -2000-11-02 Ralf Corsepius - - * Makefile.am: Switch to ACLOCAL_AMFLAGS = -I $(RTEMS_TOPdir)/aclocal. - -2000-10-27 Ralf Corsepius - - * Makefile.am: ACLOCAL_AMFLAGS= -I $(RTEMS_TOPdir)/macros. - Switch to GNU canonicalization. - * tmtests.am: Remove DEFS. - -2000-09-04 Ralf Corsepius - - * tm01/Makefile.am, tm02/Makefile.am, tm03/Makefile.am, - tm04/Makefile.am, tm05/Makefile.am, tm06/Makefile.am, - tm07/Makefile.am, tm08/Makefile.am, tm09/Makefile.am, - tm10/Makefile.am, tm11/Makefile.am, tm12/Makefile.am, - tm13/Makefile.am, tm14/Makefile.am, tm15/Makefile.am, - tm16/Makefile.am, tm17/Makefile.am, tm18/Makefile.am, - tm19/Makefile.am, tm20/Makefile.am, tm21/Makefile.am, - tm22/Makefile.am, tm23/Makefile.am, tm24/Makefile.am, - tm25/Makefile.am, tm26/Makefile.am, tm27/Makefile.am, - tm28/Makefile.am, tm29/Makefile.am, tmck/Makefile.am, - tmoverhd/Makefile.am: Include compile.am - -2000-08-10 Joel Sherrill - - * ChangeLog: New file. diff --git a/testsuites/tmtests/Makefile.am b/testsuites/tmtests/Makefile.am deleted file mode 100644 index 4342a8c58c..0000000000 --- a/testsuites/tmtests/Makefile.am +++ /dev/null @@ -1,14 +0,0 @@ -## -## $Id$ -## - -ACLOCAL_AMFLAGS = -I ../../../../aclocal - -SUBDIRS = include tmck tmoverhd tm01 tm02 tm03 tm04 tm05 tm06 tm07 tm08 tm09 \ - tm10 tm11 tm12 tm13 tm14 tm15 tm16 tm17 tm18 tm19 tm20 tm21 tm22 tm23 \ - tm24 tm25 tm26 tm27 tm28 tm29 - -EXTRA_DIST = tmtests.am - -include $(top_srcdir)/../../../../automake/subdirs.am -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/tmtests/README b/testsuites/tmtests/README deleted file mode 100644 index c27617d5a3..0000000000 --- a/testsuites/tmtests/README +++ /dev/null @@ -1,21 +0,0 @@ -# -# $Id$ -# - -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. - -These tests attempt to benchmark RTEMS as the user would. They measure -the execution time for a directive (under various circumstances) -from the time RTEMS is entered until it is executed. Where possible, -the time is the average of at least 100 invocations of the directive. - -The accuracy of the times reported by these benchmarks is very dependent -on the resolution of the timer being used. It is also important to -insure that all sources of hardware interrupts are disabled during -execution of the tests. This insures that the directive time reported -does not include any interrupt time. - diff --git a/testsuites/tmtests/configure.ac b/testsuites/tmtests/configure.ac deleted file mode 100644 index 5af91e873b..0000000000 --- a/testsuites/tmtests/configure.ac +++ /dev/null @@ -1,76 +0,0 @@ -## Process this file with autoconf to produce a configure script. -## -## $Id$ - -AC_PREREQ(2.57) -AC_INIT([rtems-c-src-tests-tmtests],[_RTEMS_VERSION],[rtems-bugs@OARcorp.com]) -AC_CONFIG_SRCDIR([tm01]) -RTEMS_TOP(../../../..) -AC_CONFIG_AUX_DIR(../../../..) - -RTEMS_CANONICAL_TARGET_CPU - -AM_INIT_AUTOMAKE([no-define foreign 1.7.2]) -AM_MAINTAINER_MODE - -RTEMS_ENABLE_BARE - -RTEMS_ENV_RTEMSBSP -RTEMS_CHECK_RTEMS_TEST_NO_PAUSE -RTEMS_CHECK_CPU -RTEMS_CANONICAL_HOST - -RTEMS_PROJECT_ROOT - -RTEMS_PROG_CC_FOR_TARGET([-ansi -fasm]) - -RTEMS_CANONICALIZE_TOOLS - -RTEMS_CHECK_CUSTOM_BSP(RTEMS_BSP) - -AC_SUBST(BARE_CPU_CFLAGS) -AC_SUBST(BARE_CPU_MODEL) -AC_SUBST(CC_CFLAGS_DEFAULT) -AC_SUBST(CC_CFLAGS_DEBUG_V) -AC_SUBST(CC_CFLAGS_PROFILE_V) -AC_SUBST(CC_LDFLAGS_PROFILE_V) - -OPERATION_COUNT=${OPERATION_COUNT-100} -AC_SUBST(OPERATION_COUNT) - -# Explicitly list all Makefiles here -AC_CONFIG_FILES([Makefile -include/Makefile -tmck/Makefile -tmoverhd/Makefile -tm01/Makefile -tm02/Makefile -tm03/Makefile -tm04/Makefile -tm05/Makefile -tm06/Makefile -tm07/Makefile -tm08/Makefile -tm09/Makefile -tm10/Makefile -tm11/Makefile -tm12/Makefile -tm13/Makefile -tm14/Makefile -tm15/Makefile -tm16/Makefile -tm17/Makefile -tm18/Makefile -tm19/Makefile -tm20/Makefile -tm21/Makefile -tm22/Makefile -tm23/Makefile -tm24/Makefile -tm25/Makefile -tm26/Makefile -tm27/Makefile -tm28/Makefile -tm29/Makefile -]) -AC_OUTPUT diff --git a/testsuites/tmtests/include/.cvsignore b/testsuites/tmtests/include/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/tmtests/include/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/tmtests/include/Makefile.am b/testsuites/tmtests/include/Makefile.am deleted file mode 100644 index 107bff9b2d..0000000000 --- a/testsuites/tmtests/include/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -## -## $Id$ -## - - -noinst_HEADERS = timesys.h - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/tmtests/include/timesys.h b/testsuites/tmtests/include/timesys.h deleted file mode 100644 index b2b6ac870f..0000000000 --- a/testsuites/tmtests/include/timesys.h +++ /dev/null @@ -1,66 +0,0 @@ -/* timesys.h - * - * This header file contains the global variables for the Time - * suite. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include - -/* - * This constant determines the maximum number of a resource - * that will be created. For example, some test create multiple - * blocking tasks to determine the execution time of blocking - * services. By default, the blocking time of 100 tasks will - * be measured. Small targets often do not have enough memory - * to create 100 tasks. By overriding the default OPERATION_COUNT - * with a lower number (typically 10 or less), all of the time tests - * can usually be run. This is stil not very fine-grained but - * is enough to significantly reduce memory consumption. - */ - -#ifndef OPERATION_COUNT -#define OPERATION_COUNT 100 -#endif - -/* functions */ - -#define put_time( _message, _total_time, \ - _iterations, _loop_overhead, _overhead ) \ - printf( \ - "%s %d\n", \ - (_message), \ - (((_total_time) - (_loop_overhead)) / (_iterations)) - (_overhead) \ - ) - -#if defined(STACK_CHECKER_ON) || defined(RTEMS_DEBUG) -#define Print_Warning() \ - do { \ - puts( \ - "\n" \ - "THE TIMES REPORTED BY THIS TEST INCLUDE DEBUG CODE!\n" \ - "\n" \ - ); \ - } while (0) - -#else -#define Print_Warning() -#endif - -/* variables */ - -TEST_EXTERN volatile rtems_unsigned32 end_time; /* ending time variable */ -TEST_EXTERN volatile rtems_unsigned32 overhead; /* loop overhead variable */ - -TEST_EXTERN rtems_id Task_id[ OPERATION_COUNT+1 ]; /* array of task ids */ -TEST_EXTERN rtems_id Task_name[ OPERATION_COUNT+1 ]; /* array of task names */ - -/* end of include file */ diff --git a/testsuites/tmtests/tm01/.cvsignore b/testsuites/tmtests/tm01/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/tmtests/tm01/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/tmtests/tm01/Makefile.am b/testsuites/tmtests/tm01/Makefile.am deleted file mode 100644 index 04dedac091..0000000000 --- a/testsuites/tmtests/tm01/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -## -## $Id$ -## - - -TEST = tm01 - -MANAGERS = io semaphore - -C_FILES = task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/tmtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -OPERATION_COUNT = @OPERATION_COUNT@ -AM_CPPFLAGS += -I$(top_srcdir)/include -DOPERATION_COUNT=$(OPERATION_COUNT) - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/tmtests/tm01/system.h b/testsuites/tmtests/tm01/system.h deleted file mode 100644 index 23125086dd..0000000000 --- a/testsuites/tmtests/tm01/system.h +++ /dev/null @@ -1,40 +0,0 @@ -/* system.h - * - * This include file is used by all tests in the Time Suite. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - - -#include -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -#include - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 2 -#define CONFIGURE_MAXIMUM_SEMAPHORES 1 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* end of include file */ diff --git a/testsuites/tmtests/tm01/task1.c b/testsuites/tmtests/tm01/task1.c deleted file mode 100644 index 3912b5ad91..0000000000 --- a/testsuites/tmtests/tm01/task1.c +++ /dev/null @@ -1,188 +0,0 @@ -/* - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_task Test_task( - rtems_task_argument argument -); - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - - Print_Warning(); - - puts( "\n\n*** TIME TEST 1 ***" ); - - 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 ], - 128, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 1 ] - ); - directive_failed( status, "rtems_task_create of TA1" ); - - status = rtems_task_start( Task_id[ 1 ], Test_task, 0 ); - directive_failed( status, "rtems_task_start of TA1" ); - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); - -} - -rtems_task Test_task( - rtems_task_argument argument -) -{ - rtems_unsigned32 semaphore_obtain_time; - rtems_unsigned32 semaphore_release_time; - rtems_unsigned32 semaphore_obtain_no_wait_time; - rtems_unsigned32 semaphore_obtain_loop_time; - rtems_unsigned32 semaphore_release_loop_time; - rtems_unsigned32 index; - rtems_unsigned32 iterations; - rtems_name name; - rtems_id smid; - rtems_status_code status; - - name = rtems_build_name( 'S', 'M', '1', ' ' ); - - semaphore_obtain_time = 0; - semaphore_release_time = 0; - semaphore_obtain_no_wait_time = 0; - semaphore_obtain_loop_time = 0; - semaphore_release_loop_time = 0; - - - /* Time one invocation of rtems_semaphore_create */ - - Timer_initialize(); - (void) rtems_semaphore_create( - name, - OPERATION_COUNT, - RTEMS_DEFAULT_MODES, - RTEMS_NO_PRIORITY, - &smid - ); - end_time = Read_timer(); - put_time( - "rtems_semaphore_create", - end_time, - 1, - 0, - CALLING_OVERHEAD_SEMAPHORE_CREATE - ); - - /* Time one invocation of rtems_semaphore_delete */ - - Timer_initialize(); - (void) rtems_semaphore_delete( smid ); - end_time = Read_timer(); - put_time( - "rtems_semaphore_delete", - end_time, - 1, - 0, - CALLING_OVERHEAD_SEMAPHORE_CREATE - ); - - status = rtems_semaphore_create( - name, - OPERATION_COUNT, - RTEMS_DEFAULT_ATTRIBUTES, - RTEMS_NO_PRIORITY, - &smid - ); - - for ( iterations=OPERATION_COUNT ; iterations ; iterations-- ) { - - Timer_initialize(); - for ( index = 1 ; index<=OPERATION_COUNT ; index++ ) - (void) Empty_function(); - end_time = Read_timer(); - - semaphore_obtain_loop_time += end_time; - semaphore_release_loop_time += end_time; - - /* rtems_semaphore_obtain (available) */ - - Timer_initialize(); - for ( index = 1 ; index<=OPERATION_COUNT ; index++ ) - (void) rtems_semaphore_obtain( - smid, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); - end_time = Read_timer(); - - semaphore_obtain_time += end_time; - - /* rtems_semaphore_release */ - - Timer_initialize(); - for ( index = 1 ; index<=OPERATION_COUNT ; index++ ) - (void) rtems_semaphore_release( smid ); - end_time = Read_timer(); - - semaphore_release_time += end_time; - - /* semaphore obtain (RTEMS_NO_WAIT) */ - Timer_initialize(); - for ( index = 1 ; index<=OPERATION_COUNT ; index++ ) - rtems_semaphore_obtain( smid, RTEMS_NO_WAIT, RTEMS_NO_TIMEOUT ); - semaphore_obtain_no_wait_time += Read_timer(); - - Timer_initialize(); - for ( index = 1 ; index<=OPERATION_COUNT ; index++ ) - rtems_semaphore_release( smid ); - end_time = Read_timer(); - - semaphore_release_time += end_time; - } - - put_time( - "rtems_semaphore_obtain: available", - semaphore_obtain_time, - OPERATION_COUNT * OPERATION_COUNT, - semaphore_obtain_loop_time, - CALLING_OVERHEAD_SEMAPHORE_OBTAIN - ); - - put_time( - "rtems_semaphore_obtain: not available -- NO_WAIT", - semaphore_obtain_no_wait_time, - OPERATION_COUNT * OPERATION_COUNT, - semaphore_obtain_loop_time, - CALLING_OVERHEAD_SEMAPHORE_OBTAIN - ); - - put_time( - "rtems_semaphore_release: no waiting tasks", - semaphore_release_time, - OPERATION_COUNT * OPERATION_COUNT * 2, - semaphore_release_loop_time * 2, - CALLING_OVERHEAD_SEMAPHORE_RELEASE - ); - - puts( "*** END OF TEST 1 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/tmtests/tm01/tm01.doc b/testsuites/tmtests/tm01/tm01.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/tmtests/tm01/tm01.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/tmtests/tm02/.cvsignore b/testsuites/tmtests/tm02/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/tmtests/tm02/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/tmtests/tm02/Makefile.am b/testsuites/tmtests/tm02/Makefile.am deleted file mode 100644 index 8513519fa5..0000000000 --- a/testsuites/tmtests/tm02/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -## -## $Id$ -## - - -TEST = tm02 - -MANAGERS = io semaphore - -C_FILES = task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/tmtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -OPERATION_COUNT = @OPERATION_COUNT@ -AM_CPPFLAGS += -I$(top_srcdir)/include -DOPERATION_COUNT=$(OPERATION_COUNT) - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/tmtests/tm02/system.h b/testsuites/tmtests/tm02/system.h deleted file mode 100644 index 9219076f58..0000000000 --- a/testsuites/tmtests/tm02/system.h +++ /dev/null @@ -1,41 +0,0 @@ -/* system.h - * - * This include file is used by all tests in the Time Suite. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - - -#include -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -#include - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 111 -#define CONFIGURE_MAXIMUM_TIMERS 110 -#define CONFIGURE_MAXIMUM_SEMAPHORES 101 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* end of include file */ diff --git a/testsuites/tmtests/tm02/task1.c b/testsuites/tmtests/tm02/task1.c deleted file mode 100644 index d24e1cb765..0000000000 --- a/testsuites/tmtests/tm02/task1.c +++ /dev/null @@ -1,157 +0,0 @@ -/* - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_id High_id; -rtems_id Low_id; -rtems_id Semaphore_id; - -rtems_task High_task( - rtems_task_argument argument -); - -rtems_task Middle_tasks( - rtems_task_argument argument -); - -rtems_task Low_task( - rtems_task_argument argument -); - - -void test_init(); - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - - Print_Warning(); - - puts( "\n\n*** TIME TEST 2 ***" ); - - test_init(); - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete" ); -} - -void test_init() -{ - rtems_status_code status; - rtems_unsigned32 index; - rtems_task_priority priority; - - priority = 5; - - status = rtems_task_create( - rtems_build_name( 'H', 'I', 'G', 'H' ), - priority, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &High_id - ); - directive_failed( status, "rtems_task_create of high task" ); - - priority++; - - status = rtems_task_start( High_id, High_task, 0 ); - directive_failed( status, "rtems_task_start of high task" ); - - for ( index=2 ; index <= OPERATION_COUNT ; index++ ) { - status = rtems_task_create( - rtems_build_name( 'M', 'I', 'D', ' ' ), - priority, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Low_id - ); - directive_failed( status, "rtems_task_create middle" ); - - priority++; - - status = rtems_task_start( Low_id, Middle_tasks, 0 ); - directive_failed( status, "rtems_task_start middle" ); - } - - status = rtems_task_create( - rtems_build_name( 'L', 'O', 'W', ' ' ), - priority, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Low_id - ); - directive_failed( status, "rtems_task_create low" ); - - status = rtems_task_start( Low_id, Low_task, 0 ); - directive_failed( status, "rtems_task_start low" ); - - status = rtems_semaphore_create( - rtems_build_name( 'S', 'M', '1', ' '), - 0, - RTEMS_DEFAULT_ATTRIBUTES, - RTEMS_NO_PRIORITY, - &Semaphore_id - ); - directive_failed( status, "rtems_semaphore_create of SM1" ); -} - -rtems_task High_task( - rtems_task_argument argument -) -{ - rtems_status_code status; - - Timer_initialize(); /* start blocking rtems_semaphore_obtain time */ - status = rtems_semaphore_obtain( - Semaphore_id, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); -} - -rtems_task Middle_tasks( - rtems_task_argument argument -) -{ - rtems_status_code status; - - status = rtems_semaphore_obtain( - Semaphore_id, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); -} - -rtems_task Low_task( - rtems_task_argument argument -) -{ - end_time = Read_timer(); - - put_time( - "rtems_semaphore_obtain: not available -- caller blocks", - end_time, - OPERATION_COUNT, - 0, - CALLING_OVERHEAD_SEMAPHORE_OBTAIN - ); - - puts( "*** END OF TEST 2 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/tmtests/tm02/tm02.doc b/testsuites/tmtests/tm02/tm02.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/tmtests/tm02/tm02.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/tmtests/tm03/.cvsignore b/testsuites/tmtests/tm03/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/tmtests/tm03/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/tmtests/tm03/Makefile.am b/testsuites/tmtests/tm03/Makefile.am deleted file mode 100644 index 29f6b54a33..0000000000 --- a/testsuites/tmtests/tm03/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -## -## $Id$ -## - - -TEST = tm03 - -MANAGERS = io semaphore - -C_FILES = task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/tmtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -OPERATION_COUNT = @OPERATION_COUNT@ -AM_CPPFLAGS += -I$(top_srcdir)/include -DOPERATION_COUNT=$(OPERATION_COUNT) - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/tmtests/tm03/system.h b/testsuites/tmtests/tm03/system.h deleted file mode 100644 index 9219076f58..0000000000 --- a/testsuites/tmtests/tm03/system.h +++ /dev/null @@ -1,41 +0,0 @@ -/* system.h - * - * This include file is used by all tests in the Time Suite. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - - -#include -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -#include - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 111 -#define CONFIGURE_MAXIMUM_TIMERS 110 -#define CONFIGURE_MAXIMUM_SEMAPHORES 101 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* end of include file */ diff --git a/testsuites/tmtests/tm03/task1.c b/testsuites/tmtests/tm03/task1.c deleted file mode 100644 index e7df26fce8..0000000000 --- a/testsuites/tmtests/tm03/task1.c +++ /dev/null @@ -1,150 +0,0 @@ -/* - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_id Semaphore_id; -rtems_task test_init( - rtems_task_argument argument -); - -rtems_task Middle_tasks( - rtems_task_argument argument -); - -rtems_task High_task( - rtems_task_argument argument -); - - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - rtems_id task_id; - - Print_Warning(); - - puts( "\n\n*** TIME TEST 3 ***" ); - status = rtems_task_create( - rtems_build_name( 'T', 'A', '1', ' ' ), - 252, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &task_id - ); - directive_failed( status, "rtems_task_create of test_init" ); - - status = rtems_task_start( task_id, test_init, 0 ); - directive_failed( status, "rtems_task_start of test_init" ); - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} - -rtems_task test_init( - rtems_task_argument argument -) -{ - rtems_status_code status; - rtems_unsigned32 index; - rtems_id task_id; - rtems_task_priority priority; - - priority = 250; - - status = rtems_semaphore_create( - rtems_build_name( 'S', 'M', '1', '\0'), - 0, - RTEMS_DEFAULT_ATTRIBUTES, - RTEMS_NO_PRIORITY, - &Semaphore_id - ); - directive_failed( status, "rtems_semaphore_create of SM1" ); - - for ( index = 2 ; index <= OPERATION_COUNT ; index ++ ) { - rtems_task_create( - rtems_build_name( 'M', 'I', 'D', ' ' ), - priority, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &task_id - ); - directive_failed( status, "rtems_task_create middle" ); - - priority--; - - rtems_task_start( task_id, Middle_tasks, 0 ); - directive_failed( status, "rtems_task_start middle" ); - } - - status = rtems_task_create( - rtems_build_name( 'H', 'I', 'G', 'H' ), - priority, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &task_id - ); - directive_failed( status, "rtems_task_create of high task" ); - - status = rtems_task_start( task_id, High_task, 0 ); - directive_failed( status, "rtems_task_start of high task" ); - - Timer_initialize(); /* start the timer */ - status = rtems_semaphore_release( Semaphore_id ); -} - -rtems_task Middle_tasks( - rtems_task_argument argument -) -{ - rtems_status_code status; - - status = rtems_semaphore_obtain( - Semaphore_id, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); - - status = rtems_semaphore_release( Semaphore_id ); -} - -rtems_task High_task( - rtems_task_argument argument -) -{ - rtems_status_code status; - - status = rtems_semaphore_obtain( - Semaphore_id, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); - - end_time = Read_timer(); - - put_time( - "rtems_semaphore_release: task readied -- preempts caller", - end_time, - OPERATION_COUNT, - 0, - CALLING_OVERHEAD_SEMAPHORE_RELEASE - ); - - puts( "*** END OF TEST 3 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/tmtests/tm03/tm03.doc b/testsuites/tmtests/tm03/tm03.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/tmtests/tm03/tm03.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/tmtests/tm04/.cvsignore b/testsuites/tmtests/tm04/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/tmtests/tm04/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/tmtests/tm04/Makefile.am b/testsuites/tmtests/tm04/Makefile.am deleted file mode 100644 index d4313de041..0000000000 --- a/testsuites/tmtests/tm04/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -## -## $Id$ -## - - -TEST = tm04 - -MANAGERS = io semaphore - -C_FILES = task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/tmtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -OPERATION_COUNT = @OPERATION_COUNT@ -AM_CPPFLAGS += -I$(top_srcdir)/include -DOPERATION_COUNT=$(OPERATION_COUNT) - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/tmtests/tm04/system.h b/testsuites/tmtests/tm04/system.h deleted file mode 100644 index d3be287997..0000000000 --- a/testsuites/tmtests/tm04/system.h +++ /dev/null @@ -1,40 +0,0 @@ -/* system.h - * - * This include file is used by all tests in the Time Suite. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - - -#include -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -#include - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 111 -#define CONFIGURE_MAXIMUM_SEMAPHORES 1 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* end of include file */ diff --git a/testsuites/tmtests/tm04/task1.c b/testsuites/tmtests/tm04/task1.c deleted file mode 100644 index 8a6b27f4f6..0000000000 --- a/testsuites/tmtests/tm04/task1.c +++ /dev/null @@ -1,387 +0,0 @@ -/* - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_id Semaphore_id; -rtems_id Task_id[OPERATION_COUNT+1]; -rtems_unsigned32 task_count; -rtems_id Highest_id; - -rtems_task Low_tasks( - rtems_task_argument argument -); - -rtems_task High_task( - rtems_task_argument argument -); - -rtems_task Restart_task( - rtems_task_argument argument -); - -void test_init(); - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - - Print_Warning(); - - puts( "\n\n*** TIME TEST 4 ***" ); - - test_init(); - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} - -void test_init() -{ - rtems_status_code status; - rtems_unsigned32 index; - - task_count = OPERATION_COUNT; - - for ( index = 1 ; index <= OPERATION_COUNT ; index++ ) { - - status = rtems_task_create( - rtems_build_name( 'T', 'I', 'M', 'E' ), - 10, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_NO_PREEMPT, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ index ] - ); - directive_failed( status, "rtems_task_create loop" ); - - status = rtems_task_start( Task_id[ index ], Low_tasks, 0 ); - directive_failed( status, "rtems_task_start loop" ); - } - - status = rtems_semaphore_create( - rtems_build_name( 'S', 'M', '1', ' ' ), - 0, - RTEMS_DEFAULT_ATTRIBUTES, - RTEMS_NO_PRIORITY, - &Semaphore_id - ); - directive_failed( status, "rtems_semaphore_create of SM1" ); -} - -rtems_task Highest_task( - rtems_task_argument argument -) -{ - rtems_task_priority old_priority; - rtems_status_code status; - - if ( argument == 1 ) { - - end_time = Read_timer(); - - put_time( - "rtems_task_restart: blocked task -- preempts caller", - end_time, - 1, - 0, - CALLING_OVERHEAD_TASK_RESTART - ); - - status = rtems_task_set_priority( - RTEMS_CURRENT_PRIORITY, - 254, - &old_priority - ); - directive_failed( status, "rtems_task_set_priority" ); - - } else if ( argument == 2 ) { - - end_time = Read_timer(); - - put_time( - "rtems_task_restart: ready task -- preempts caller", - end_time, - 1, - 0, - CALLING_OVERHEAD_TASK_RESTART - ); - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); - - } else - (void) rtems_semaphore_obtain( - Semaphore_id, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); - -} - -rtems_task High_task( - rtems_task_argument argument -) -{ - rtems_status_code status; - rtems_unsigned32 index; - rtems_name name; - rtems_task_priority old_priority; - - Timer_initialize(); - (void) rtems_task_restart( Highest_id, 1 ); - /* preempted by Higher_task */ - - Timer_initialize(); - (void) rtems_task_restart( Highest_id, 2 ); - /* preempted by Higher_task */ - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) Empty_function(); - overhead = Read_timer(); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - rtems_semaphore_release( Semaphore_id ); - end_time = Read_timer(); - - put_time( - "rtems_semaphore_release: task readied -- returns to caller", - end_time, - OPERATION_COUNT, - 0, - CALLING_OVERHEAD_SEMAPHORE_RELEASE - ); - - name = rtems_build_name( 'T', 'I', 'M', 'E' ); - - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) { - status = rtems_task_delete( Task_id[index] ); - directive_failed( status, "rtems_task_delete" ); - } - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - rtems_task_create( - name, - 10, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_NO_PREEMPT, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ index ] - ); - end_time = Read_timer(); - - put_time( - "rtems_task_create", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_TASK_CREATE - ); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - rtems_task_start( Task_id[ index ], Low_tasks, 0 ); - - end_time = Read_timer(); - - put_time( - "rtems_task_start", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_TASK_START - ); - - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) { - status = rtems_task_delete( Task_id[ index ] ); - directive_failed( status, "rtems_task_delete" ); - } - - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) { - status = rtems_task_create( - name, - 250, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_NO_PREEMPT, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ index ] - ); - directive_failed( status, "rtems_task_create LOOP" ); - - status = rtems_task_start( Task_id[ index ], Restart_task, 0 ); - directive_failed( status, "rtems_task_start LOOP" ); - - status = rtems_task_suspend( Task_id[ index ] ); - directive_failed( status, "rtems_task_suspend LOOP" ); - } - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_task_restart( Task_id[ index ], 0 ); - end_time = Read_timer(); - - put_time( - "rtems_task_restart: suspended task -- returns to caller", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_TASK_RESTART - ); - - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_task_suspend( Task_id[ index ] ); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_task_delete( Task_id[ index ] ); - end_time = Read_timer(); - - put_time( - "rtems_task_delete: suspended task", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_TASK_DELETE - ); - - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) { - status = rtems_task_create( - name, - 250, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ index ] - ); - directive_failed( status, "rtems_task_create LOOP" ); - - status = rtems_task_start( Task_id[ index ], Restart_task, 0 ); - directive_failed( status, "rtems_task_start LOOP" ); - } - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_task_restart( Task_id[ index ], 1 ); - end_time = Read_timer(); - - put_time( - "rtems_task_restart: ready task -- returns to caller", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_TASK_RESTART - ); - - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) { - status = rtems_task_set_priority( Task_id[ index ], 5, &old_priority ); - directive_failed( status, "rtems_task_set_priority loop" ); - } - - /* yield processor -- tasks block */ - status = rtems_task_wake_after( RTEMS_YIELD_PROCESSOR ); - directive_failed( status, "rtems_task_wake_after" ); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_task_restart( Task_id[ index ], 1 ); - end_time = Read_timer(); - - put_time( - "rtems_task_restart: blocked task -- returns to caller", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_TASK_RESTART - ); - - /* yield processor -- tasks block */ - status = rtems_task_wake_after( RTEMS_YIELD_PROCESSOR ); - directive_failed( status, "rtems_task_wake_after" ); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_task_delete( Task_id[ index ] ); - end_time = Read_timer(); - - put_time( - "rtems_task_delete: blocked task", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_TASK_DELETE - ); - - puts( "*** END OF TEST 4 ***" ); - rtems_test_exit( 0 ); -} - -rtems_task Low_tasks( - rtems_task_argument argument -) -{ - rtems_id id; - rtems_status_code status; - - task_count--; - - if ( task_count == 0 ) { - status = rtems_task_create( - rtems_build_name( 'H', 'I', ' ', ' ' ), - 5, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &id - ); - directive_failed( status, "rtems_task_create HI" ); - - status = rtems_task_start( id, High_task, 0 ); - directive_failed( status, "rtems_task_start HI" ); - - status = rtems_task_create( - rtems_build_name( 'H', 'I', 'G', 'H' ), - 3, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Highest_id - ); - directive_failed( status, "rtems_task_create HIGH" ); - - status = rtems_task_start( Highest_id, Highest_task, 0 ); - directive_failed( status, "rtems_task_start HIGH" ); - - } - (void) rtems_semaphore_obtain( - Semaphore_id, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); -} - -rtems_task Restart_task( - rtems_task_argument argument -) -{ - if ( argument == 1 ) - (void) rtems_semaphore_obtain( - Semaphore_id, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); -} diff --git a/testsuites/tmtests/tm04/tm04.doc b/testsuites/tmtests/tm04/tm04.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/tmtests/tm04/tm04.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/tmtests/tm05/.cvsignore b/testsuites/tmtests/tm05/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/tmtests/tm05/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/tmtests/tm05/Makefile.am b/testsuites/tmtests/tm05/Makefile.am deleted file mode 100644 index 6549cf559d..0000000000 --- a/testsuites/tmtests/tm05/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -## -## $Id$ -## - - -TEST = tm05 - -MANAGERS = io - -C_FILES = task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/tmtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -OPERATION_COUNT = @OPERATION_COUNT@ -AM_CPPFLAGS += -I$(top_srcdir)/include -DOPERATION_COUNT=$(OPERATION_COUNT) - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/tmtests/tm05/system.h b/testsuites/tmtests/tm05/system.h deleted file mode 100644 index 9219076f58..0000000000 --- a/testsuites/tmtests/tm05/system.h +++ /dev/null @@ -1,41 +0,0 @@ -/* system.h - * - * This include file is used by all tests in the Time Suite. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - - -#include -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -#include - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 111 -#define CONFIGURE_MAXIMUM_TIMERS 110 -#define CONFIGURE_MAXIMUM_SEMAPHORES 101 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* end of include file */ diff --git a/testsuites/tmtests/tm05/task1.c b/testsuites/tmtests/tm05/task1.c deleted file mode 100644 index 291a68a514..0000000000 --- a/testsuites/tmtests/tm05/task1.c +++ /dev/null @@ -1,131 +0,0 @@ -/* - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_id Task_id[OPERATION_COUNT+1]; -rtems_unsigned32 Task_index; - -rtems_task High_task( - rtems_task_argument argument -); - -rtems_task Middle_tasks( - rtems_task_argument argument -); - -rtems_task Low_task( - rtems_task_argument argument -); - -void test_init(); - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - - Print_Warning(); - - puts( "\n\n*** TIME TEST 5 ***" ); - - test_init(); - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} - -void test_init() -{ - rtems_status_code status; - rtems_task_entry task_entry; - rtems_task_priority priority; - rtems_unsigned32 index; - - priority = 250; - - for( index = 0; index <= OPERATION_COUNT ; index++ ) { - - status = rtems_task_create( - rtems_build_name( 'T', 'I', 'M', 'E' ), - priority, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ index ] - ); - directive_failed( status, "rtems_task_create loop" ); - - priority--; - - if ( index==0 ) task_entry = Low_task; - else if ( index==OPERATION_COUNT ) task_entry = High_task; - else task_entry = Middle_tasks; - - status = rtems_task_start( Task_id[ index ], task_entry, 0 ); - directive_failed( status, "rtems_task_start loop" ); - } -} - -rtems_task High_task( - rtems_task_argument argument -) -{ - Timer_initialize(); - - (void) rtems_task_suspend( RTEMS_SELF ); - - end_time = Read_timer(); - - put_time( - "rtems_task_resume: task readied -- preempts caller", - end_time, - OPERATION_COUNT, - 0, - CALLING_OVERHEAD_TASK_RESUME - ); - - puts( "*** END OF TEST 5 ***" ); - rtems_test_exit( 0 ); -} - -rtems_task Middle_tasks( - rtems_task_argument argument -) -{ - (void) rtems_task_suspend( RTEMS_SELF ); - - Task_index++; - (void) rtems_task_resume( Task_id[ Task_index ] ); -} - -rtems_task Low_task( - rtems_task_argument argument -) -{ - - end_time = Read_timer(); - - put_time( - "rtems_task_suspend: calling task", - end_time, - OPERATION_COUNT, - 0, - CALLING_OVERHEAD_TASK_SUSPEND - ); - - Task_index = 1; - Timer_initialize(); - (void) rtems_task_resume( Task_id[ Task_index ] ); -} diff --git a/testsuites/tmtests/tm05/tm05.doc b/testsuites/tmtests/tm05/tm05.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/tmtests/tm05/tm05.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/tmtests/tm06/.cvsignore b/testsuites/tmtests/tm06/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/tmtests/tm06/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/tmtests/tm06/Makefile.am b/testsuites/tmtests/tm06/Makefile.am deleted file mode 100644 index be0366717d..0000000000 --- a/testsuites/tmtests/tm06/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -## -## $Id$ -## - - -TEST = tm06 - -MANAGERS = io - -C_FILES = task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/tmtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -OPERATION_COUNT = @OPERATION_COUNT@ -AM_CPPFLAGS += -I$(top_srcdir)/include -DOPERATION_COUNT=$(OPERATION_COUNT) - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/tmtests/tm06/system.h b/testsuites/tmtests/tm06/system.h deleted file mode 100644 index 9219076f58..0000000000 --- a/testsuites/tmtests/tm06/system.h +++ /dev/null @@ -1,41 +0,0 @@ -/* system.h - * - * This include file is used by all tests in the Time Suite. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - - -#include -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -#include - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 111 -#define CONFIGURE_MAXIMUM_TIMERS 110 -#define CONFIGURE_MAXIMUM_SEMAPHORES 101 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* end of include file */ diff --git a/testsuites/tmtests/tm06/task1.c b/testsuites/tmtests/tm06/task1.c deleted file mode 100644 index 562605820b..0000000000 --- a/testsuites/tmtests/tm06/task1.c +++ /dev/null @@ -1,161 +0,0 @@ -/* - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_id Task_id[ OPERATION_COUNT + 1 ]; - -rtems_unsigned32 Task_restarted; - -rtems_task null_task( - rtems_task_argument argument -); - -rtems_task Task_1( - rtems_task_argument argument -); - -void test_init( void ); - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - - Print_Warning(); - - puts( "\n\n*** TIME TEST 6 ***" ); - - test_init(); - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} - -void test_init( void ) -{ - rtems_status_code status; - rtems_id id; - - Task_restarted = OPERATION_COUNT; - - status = rtems_task_create( - rtems_build_name( 'T', 'I', 'M', 'E' ), - 128, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &id - ); - directive_failed( status, "rtems_task_create" ); - - status = rtems_task_start( id, Task_1, 0 ); - directive_failed( status, "rtems_task_start" ); -} - -rtems_task Task_1( - rtems_task_argument argument -) -{ - rtems_status_code status; - rtems_unsigned32 index; - - if ( Task_restarted == OPERATION_COUNT ) - Timer_initialize(); - - Task_restarted--; - - if ( Task_restarted != 0 ) - (void) rtems_task_restart( RTEMS_SELF, 0 ); - - end_time = Read_timer(); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) Empty_function(); - overhead = Read_timer(); - - put_time( - "rtems_task_restart: calling task", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_TASK_RESTART - ); - - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) { - status = rtems_task_create( - rtems_build_name( 'T', 'I', 'M', 'E' ), - 254, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ index ] - ); - directive_failed( status, "rtems_task_create loop" ); - - status = rtems_task_start( Task_id[ index ], null_task, 0 ); - directive_failed( status, "rtems_task_start loop" ); - } - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_task_suspend( Task_id[ index ] ); - end_time = Read_timer(); - - put_time( - "rtems_task_suspend: returns to caller", - end_time, - OPERATION_COUNT, - 0, - CALLING_OVERHEAD_TASK_SUSPEND - ); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_task_resume( Task_id[ index ] ); - end_time = Read_timer(); - - put_time( - "rtems_task_resume: task readied -- returns to caller", - end_time, - OPERATION_COUNT, - 0, - CALLING_OVERHEAD_TASK_RESUME - ); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_task_delete( Task_id[ index ] ); - end_time = Read_timer(); - - put_time( - "rtems_task_delete: ready task", - end_time, - OPERATION_COUNT, - 0, - CALLING_OVERHEAD_TASK_RESUME - ); - - puts( "*** END OF TEST 6 ***" ); - rtems_test_exit( 0 ); -} - -rtems_task null_task( - rtems_task_argument argument -) -{ - while ( FOREVER ) - ; -} diff --git a/testsuites/tmtests/tm06/tm06.doc b/testsuites/tmtests/tm06/tm06.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/tmtests/tm06/tm06.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/tmtests/tm07/.cvsignore b/testsuites/tmtests/tm07/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/tmtests/tm07/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/tmtests/tm07/Makefile.am b/testsuites/tmtests/tm07/Makefile.am deleted file mode 100644 index 4b57c489e8..0000000000 --- a/testsuites/tmtests/tm07/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -## -## $Id$ -## - - -TEST = tm07 - -MANAGERS = io - -C_FILES = task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/tmtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -OPERATION_COUNT = @OPERATION_COUNT@ -AM_CPPFLAGS += -I$(top_srcdir)/include -DOPERATION_COUNT=$(OPERATION_COUNT) - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/tmtests/tm07/system.h b/testsuites/tmtests/tm07/system.h deleted file mode 100644 index 9219076f58..0000000000 --- a/testsuites/tmtests/tm07/system.h +++ /dev/null @@ -1,41 +0,0 @@ -/* system.h - * - * This include file is used by all tests in the Time Suite. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - - -#include -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -#include - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 111 -#define CONFIGURE_MAXIMUM_TIMERS 110 -#define CONFIGURE_MAXIMUM_SEMAPHORES 101 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* end of include file */ diff --git a/testsuites/tmtests/tm07/task1.c b/testsuites/tmtests/tm07/task1.c deleted file mode 100644 index 6895e0ab97..0000000000 --- a/testsuites/tmtests/tm07/task1.c +++ /dev/null @@ -1,119 +0,0 @@ -/* - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_id Task_id[ OPERATION_COUNT+1 ], task_index; - -rtems_task High_task( - rtems_task_argument argument -); - -rtems_task Middle_tasks( - rtems_task_argument argument -); - -rtems_task Low_task( - rtems_task_argument argument -); - -void test_init(); - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - - Print_Warning(); - - puts( "\n\n*** TIME TEST 7 ***" ); - - test_init(); - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} - -void test_init() -{ - rtems_status_code status; - rtems_task_priority priority; - rtems_task_entry task_entry; - rtems_unsigned32 index; - - priority = 250; - - for( index=0 ; index <= OPERATION_COUNT ; index++ ) { - status = rtems_task_create( - rtems_build_name( 'T', 'I', 'M', 'E' ), - priority, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[index] - ); - directive_failed( status, "rtems_task_create" ); - priority--; - - if ( index == 0 ) task_entry = Low_task; - else if ( index == OPERATION_COUNT ) task_entry = High_task; - else task_entry = Middle_tasks; - - status = rtems_task_start( Task_id[index], task_entry, 0 ); - directive_failed( status, "rtems_task_start" ); - } -} - -rtems_task High_task( - rtems_task_argument argument -) -{ - if ( argument != 0 ) { - end_time = Read_timer(); - - put_time( - "rtems_task_restart: suspended task -- preempts caller", - end_time, - OPERATION_COUNT, - 0, - CALLING_OVERHEAD_TASK_RESTART - ); - } else - (void) rtems_task_suspend( RTEMS_SELF ); - - puts( "*** END OF TEST 7 ***" ); - rtems_test_exit( 0 ); -} - -rtems_task Middle_tasks( - rtems_task_argument argument -) -{ - task_index++; - - if ( argument != 0 ) - (void) rtems_task_restart( Task_id[ task_index ], 0xffffffff ); - else - (void) rtems_task_suspend( RTEMS_SELF ); -} - -rtems_task Low_task( - rtems_task_argument argument -) -{ - task_index = 1; - - Timer_initialize(); - (void) rtems_task_restart( Task_id[ task_index ], 0xffffffff ); -} diff --git a/testsuites/tmtests/tm07/tm07.doc b/testsuites/tmtests/tm07/tm07.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/tmtests/tm07/tm07.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/tmtests/tm08/.cvsignore b/testsuites/tmtests/tm08/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/tmtests/tm08/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/tmtests/tm08/Makefile.am b/testsuites/tmtests/tm08/Makefile.am deleted file mode 100644 index 970e1ec081..0000000000 --- a/testsuites/tmtests/tm08/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -## -## $Id$ -## - - -TEST = tm08 - -MANAGERS = io - -C_FILES = task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/tmtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -OPERATION_COUNT = @OPERATION_COUNT@ -AM_CPPFLAGS += -I$(top_srcdir)/include -DOPERATION_COUNT=$(OPERATION_COUNT) - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/tmtests/tm08/system.h b/testsuites/tmtests/tm08/system.h deleted file mode 100644 index 9219076f58..0000000000 --- a/testsuites/tmtests/tm08/system.h +++ /dev/null @@ -1,41 +0,0 @@ -/* system.h - * - * This include file is used by all tests in the Time Suite. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - - -#include -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -#include - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 111 -#define CONFIGURE_MAXIMUM_TIMERS 110 -#define CONFIGURE_MAXIMUM_SEMAPHORES 101 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* end of include file */ diff --git a/testsuites/tmtests/tm08/task1.c b/testsuites/tmtests/tm08/task1.c deleted file mode 100644 index 9cf06d7595..0000000000 --- a/testsuites/tmtests/tm08/task1.c +++ /dev/null @@ -1,254 +0,0 @@ -/* - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_id Test_task_id; - -rtems_task test_task( - rtems_task_argument argument -); -rtems_task test_task1( - rtems_task_argument argument -); -void test_init(); - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - - Print_Warning(); - - puts( "\n\n*** TIME TEST 8 ***" ); - - test_init(); - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} - -void test_init() -{ - rtems_status_code status; - - status = rtems_task_create( - 1, - 128, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Test_task_id - ); - directive_failed( status, "rtems_task_create" ); - - status = rtems_task_start( Test_task_id, test_task, 0 ); - directive_failed( status, "rtems_task_start" ); - - status = rtems_task_create( - 1, - 254, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Test_task_id - ); - directive_failed( status, "rtems_task_create" ); - - status = rtems_task_start( Test_task_id, test_task1, 0 ); - directive_failed( status, "rtems_task_start" ); -} - -rtems_task test_task( - rtems_task_argument argument -) -{ - rtems_status_code status; - rtems_unsigned32 index; - rtems_task_priority old_priority; - rtems_time_of_day time; - rtems_unsigned32 old_note; - rtems_unsigned32 old_mode; - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) Empty_function(); - overhead = Read_timer(); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_task_set_priority( - Test_task_id, - RTEMS_CURRENT_PRIORITY, - &old_priority - ); - end_time = Read_timer(); - - put_time( - "rtems_task_set_priority: obtain current priority", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_TASK_SET_PRIORITY - ); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_task_set_priority( Test_task_id, 253, &old_priority ); - end_time = Read_timer(); - - put_time( - "rtems_task_set_priority: returns to caller", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_TASK_SET_PRIORITY - ); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_task_mode( - RTEMS_CURRENT_MODE, - RTEMS_CURRENT_MODE, - &old_mode - ); - end_time = Read_timer(); - - put_time( - "rtems_task_mode: obtain current mode", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_TASK_MODE - ); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) { - (void) rtems_task_mode( - RTEMS_INTERRUPT_LEVEL(1), - RTEMS_INTERRUPT_MASK, - &old_mode - ); - (void) rtems_task_mode( - RTEMS_INTERRUPT_LEVEL(0), - RTEMS_INTERRUPT_MASK, - &old_mode - ); - } - end_time = Read_timer(); - - put_time( - "rtems_task_mode: no reschedule", - end_time, - OPERATION_COUNT * 2, - overhead, - CALLING_OVERHEAD_TASK_MODE - ); - - Timer_initialize(); /* must be one host */ - (void) rtems_task_mode( RTEMS_NO_ASR, RTEMS_ASR_MASK, &old_mode ); - end_time = Read_timer(); - - put_time( - "rtems_task_mode: reschedule -- returns to caller", - end_time, - 1, - 0, - CALLING_OVERHEAD_TASK_MODE - ); - - status = rtems_task_mode( RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &old_mode ); - directive_failed( status, "rtems_task_mode" ); - - status = rtems_task_set_priority( Test_task_id, 1, &old_priority ); - directive_failed( status, "rtems_task_set_priority" ); - - /* preempted by test_task1 */ - Timer_initialize(); - (void) rtems_task_mode( RTEMS_PREEMPT, RTEMS_PREEMPT_MASK, &old_mode ); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_task_set_note( Test_task_id, 8, 10 ); - end_time = Read_timer(); - - put_time( - "rtems_task_set_note", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_TASK_SET_NOTE - ); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_task_get_note( Test_task_id, 8, &old_note ); - end_time = Read_timer(); - - put_time( - "rtems_task_get_note", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_TASK_GET_NOTE - ); - - build_time( &time, 1, 1, 1988, 0, 0, 0, 0 ); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_clock_set( &time ); - end_time = Read_timer(); - - put_time( - "rtems_clock_set", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_CLOCK_SET - ); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_clock_get( RTEMS_CLOCK_GET_TOD, &time ); - end_time = Read_timer(); - - put_time( - "rtems_clock_get", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_CLOCK_GET - ); - - puts( "*** END OF TEST 8 ***" ); - rtems_test_exit( 0 ); -} - -rtems_task test_task1( - rtems_task_argument argument -) -{ - end_time = Read_timer(); - - put_time( - "rtems_task_mode: reschedule -- preempts caller", - end_time, - 1, - 0, - CALLING_OVERHEAD_TASK_MODE - ); - - (void) rtems_task_suspend( RTEMS_SELF ); -} diff --git a/testsuites/tmtests/tm08/tm08.doc b/testsuites/tmtests/tm08/tm08.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/tmtests/tm08/tm08.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/tmtests/tm09/.cvsignore b/testsuites/tmtests/tm09/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/tmtests/tm09/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/tmtests/tm09/Makefile.am b/testsuites/tmtests/tm09/Makefile.am deleted file mode 100644 index 07b3edc320..0000000000 --- a/testsuites/tmtests/tm09/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -## -## $Id$ -## - - -TEST = tm09 - -MANAGERS = io message - -C_FILES = task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/tmtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -OPERATION_COUNT = @OPERATION_COUNT@ -AM_CPPFLAGS += -I$(top_srcdir)/include -DOPERATION_COUNT=$(OPERATION_COUNT) - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/tmtests/tm09/system.h b/testsuites/tmtests/tm09/system.h deleted file mode 100644 index f5b30a1d04..0000000000 --- a/testsuites/tmtests/tm09/system.h +++ /dev/null @@ -1,42 +0,0 @@ -/* system.h - * - * This include file is used by all tests in the Time Suite. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - - -#include -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -#include - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 2 -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#define CONFIGURE_EXTRA_TASK_STACKS (1 * RTEMS_MINIMUM_STACK_SIZE) - -#include - -/* end of include file */ diff --git a/testsuites/tmtests/tm09/task1.c b/testsuites/tmtests/tm09/task1.c deleted file mode 100644 index 56a41ff1a7..0000000000 --- a/testsuites/tmtests/tm09/task1.c +++ /dev/null @@ -1,227 +0,0 @@ -/* - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_id Queue_id; - -rtems_task Test_task( - rtems_task_argument argument -); -void queue_test(); - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - - Print_Warning(); - - puts( "\n\n*** TIME TEST 9 ***" ); - - status = rtems_task_create( - 1, - 128, - RTEMS_MINIMUM_STACK_SIZE * 2, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 1 ] - ); - directive_failed( status, "rtems_task_create" ); - - status = rtems_task_start( Task_id[ 1 ], Test_task, 0 ); - directive_failed( status, "rtems_task_start" ); - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} - -#define MESSAGE_SIZE (sizeof(long) * 4) - -rtems_task Test_task ( - rtems_task_argument argument -) -{ - Timer_initialize(); - rtems_message_queue_create( - 1, - OPERATION_COUNT, - MESSAGE_SIZE, - RTEMS_DEFAULT_ATTRIBUTES, - &Queue_id - ); - end_time = Read_timer(); - - put_time( - "rtems_message_queue_create", - end_time, - 1, - 0, - CALLING_OVERHEAD_MESSAGE_QUEUE_CREATE - ); - - queue_test(); - - Timer_initialize(); - rtems_message_queue_delete( Queue_id ); - end_time = Read_timer(); - - put_time( - "rtems_message_queue_delete", - end_time, - 1, - 0, - CALLING_OVERHEAD_MESSAGE_QUEUE_DELETE - ); - - puts( "*** END OF TEST 9 ***" ); - rtems_test_exit( 0 ); -} - -void queue_test() -{ - rtems_unsigned32 send_loop_time; - rtems_unsigned32 urgent_loop_time; - rtems_unsigned32 receive_loop_time; - rtems_unsigned32 send_time; - rtems_unsigned32 urgent_time; - rtems_unsigned32 receive_time; - rtems_unsigned32 empty_flush_time; - rtems_unsigned32 flush_time; - rtems_unsigned32 empty_flush_count; - rtems_unsigned32 flush_count; - rtems_unsigned32 index; - rtems_unsigned32 iterations; - long buffer[4]; - rtems_status_code status; - rtems_unsigned32 size; - - send_loop_time = 0; - urgent_loop_time = 0; - receive_loop_time = 0; - send_time = 0; - urgent_time = 0; - receive_time = 0; - empty_flush_time = 0; - flush_time = 0; - flush_count = 0; - empty_flush_count = 0; - - for ( iterations = 1 ; iterations <= OPERATION_COUNT ; iterations++ ) { - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) Empty_function(); - send_loop_time += Read_timer(); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) Empty_function(); - urgent_loop_time += Read_timer(); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) Empty_function(); - receive_loop_time += Read_timer(); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_message_queue_send( Queue_id, buffer, MESSAGE_SIZE ); - send_time += Read_timer(); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_message_queue_receive( - Queue_id, - (long (*)[4])buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); - receive_time += Read_timer(); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_message_queue_urgent( Queue_id, buffer, MESSAGE_SIZE ); - urgent_time += Read_timer(); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_message_queue_receive( - Queue_id, - (long (*)[4])buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); - receive_time += Read_timer(); - - Timer_initialize(); - rtems_message_queue_flush( Queue_id, &empty_flush_count ); - empty_flush_time += Read_timer(); - - /* send one message to flush */ - status = rtems_message_queue_send( - Queue_id, - (long (*)[4])buffer, - MESSAGE_SIZE - ); - directive_failed( status, "rtems_message_queue_send" ); - - Timer_initialize(); - rtems_message_queue_flush( Queue_id, &flush_count ); - flush_time += Read_timer(); - } - - put_time( - "rtems_message_queue_send: no waiting tasks", - send_time, - OPERATION_COUNT * OPERATION_COUNT, - send_loop_time, - CALLING_OVERHEAD_MESSAGE_QUEUE_SEND - ); - - put_time( - "rtems_message_queue_urgent: no waiting tasks", - urgent_time, - OPERATION_COUNT * OPERATION_COUNT, - urgent_loop_time, - CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT - ); - - put_time( - "rtems_message_queue_receive: available", - receive_time, - OPERATION_COUNT * OPERATION_COUNT * 2, - receive_loop_time * 2, - CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE - ); - - put_time( - "rtems_message_queue_flush: no messages flushed", - empty_flush_time, - OPERATION_COUNT, - 0, - CALLING_OVERHEAD_MESSAGE_QUEUE_FLUSH - ); - - put_time( - "rtems_message_queue_flush: messages flushed", - flush_time, - OPERATION_COUNT, - 0, - CALLING_OVERHEAD_MESSAGE_QUEUE_FLUSH - ); - -} diff --git a/testsuites/tmtests/tm09/tm09.doc b/testsuites/tmtests/tm09/tm09.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/tmtests/tm09/tm09.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/tmtests/tm10/.cvsignore b/testsuites/tmtests/tm10/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/tmtests/tm10/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/tmtests/tm10/Makefile.am b/testsuites/tmtests/tm10/Makefile.am deleted file mode 100644 index c6fd9709de..0000000000 --- a/testsuites/tmtests/tm10/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -## -## $Id$ -## - - -TEST = tm10 - -MANAGERS = io message - -C_FILES = task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/tmtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -OPERATION_COUNT = @OPERATION_COUNT@ -AM_CPPFLAGS += -I$(top_srcdir)/include -DOPERATION_COUNT=$(OPERATION_COUNT) - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/tmtests/tm10/system.h b/testsuites/tmtests/tm10/system.h deleted file mode 100644 index 964ccc39c2..0000000000 --- a/testsuites/tmtests/tm10/system.h +++ /dev/null @@ -1,40 +0,0 @@ -/* system.h - * - * This include file is used by all tests in the Time Suite. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - - -#include -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -#include - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 110 -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* end of include file */ diff --git a/testsuites/tmtests/tm10/task1.c b/testsuites/tmtests/tm10/task1.c deleted file mode 100644 index 913579d1be..0000000000 --- a/testsuites/tmtests/tm10/task1.c +++ /dev/null @@ -1,164 +0,0 @@ -/* - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_id Queue_id; -long Buffer[4]; - -rtems_task High_task( - rtems_task_argument argument -); - -rtems_task Middle_tasks( - rtems_task_argument argument -); - -rtems_task Low_task( - rtems_task_argument argument -); - -void test_init(); - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - - Print_Warning(); - - puts( "\n\n*** TIME TEST 10 ***" ); - - test_init(); - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} - -void test_init() -{ - rtems_unsigned32 index; - rtems_unsigned32 size; - rtems_task_entry task_entry; - rtems_status_code status; - rtems_task_priority priority; - rtems_id task_id; - - priority = 5; - - for( index = 0; index <= OPERATION_COUNT ; index++ ) { - status = rtems_task_create( - rtems_build_name( 'T', 'I', 'M', 'E' ), - priority, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &task_id - ); - directive_failed( status, "rtems_task_create LOOP" ); - - priority++; - - if ( index==0 ) task_entry = High_task; - else if ( index==OPERATION_COUNT ) task_entry = Low_task; - else task_entry = Middle_tasks; - - status = rtems_task_start( task_id, task_entry, 0 ); - directive_failed( status, "rtems_task_start LOOP" ); - } - - status = rtems_message_queue_create( - 1, - OPERATION_COUNT, - 16, - RTEMS_DEFAULT_ATTRIBUTES, - &Queue_id - ); - directive_failed( status, "rtems_message_queue_create" ); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) Empty_function(); - overhead = Read_timer(); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_message_queue_receive( - Queue_id, - (long (*)[4]) Buffer, - &size, - RTEMS_NO_WAIT, - RTEMS_NO_TIMEOUT - ); - end_time = Read_timer(); - - put_time( - "rtems_message_queue_receive: not available -- NO_WAIT", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE - ); - -} - -rtems_task High_task( - rtems_task_argument argument -) -{ - rtems_unsigned32 size; - - Timer_initialize(); - (void) rtems_message_queue_receive( - Queue_id, - (long (*)[4]) Buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); -} - -rtems_task Middle_tasks( - rtems_task_argument argument -) -{ - rtems_unsigned32 size; - - (void) rtems_message_queue_receive( - Queue_id, - (long (*)[4]) Buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); -} - - -rtems_task Low_task( - rtems_task_argument argument -) -{ - end_time = Read_timer(); - - put_time( - "rtems_message_queue_receive: not available -- caller blocks", - end_time, - OPERATION_COUNT, - 0, - CALLING_OVERHEAD_MESSAGE_QUEUE_RECEIVE - ); - - puts( "*** END OF TEST 10 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/tmtests/tm10/tm10.doc b/testsuites/tmtests/tm10/tm10.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/tmtests/tm10/tm10.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/tmtests/tm11/.cvsignore b/testsuites/tmtests/tm11/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/tmtests/tm11/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/tmtests/tm11/Makefile.am b/testsuites/tmtests/tm11/Makefile.am deleted file mode 100644 index 7649ad9c53..0000000000 --- a/testsuites/tmtests/tm11/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -## -## $Id$ -## - - -TEST = tm11 - -MANAGERS = io message - -C_FILES = task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/tmtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -OPERATION_COUNT = @OPERATION_COUNT@ -AM_CPPFLAGS += -I$(top_srcdir)/include -DOPERATION_COUNT=$(OPERATION_COUNT) - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/tmtests/tm11/system.h b/testsuites/tmtests/tm11/system.h deleted file mode 100644 index d3f219713a..0000000000 --- a/testsuites/tmtests/tm11/system.h +++ /dev/null @@ -1,40 +0,0 @@ -/* system.h - * - * This include file is used by all tests in the Time Suite. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - - -#include -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -#include - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 111 -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* end of include file */ diff --git a/testsuites/tmtests/tm11/task1.c b/testsuites/tmtests/tm11/task1.c deleted file mode 100644 index 96bd31a6a0..0000000000 --- a/testsuites/tmtests/tm11/task1.c +++ /dev/null @@ -1,156 +0,0 @@ -/* - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_id Queue_id; - -long Buffer[4]; - -rtems_task test_init( - rtems_task_argument argument -); - -rtems_task Middle_tasks( - rtems_task_argument argument -); - -rtems_task High_task( - rtems_task_argument argument -); - - -void Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - rtems_id id; - - Print_Warning(); - - puts( "\n\n*** TIME TEST 11 ***" ); - - status = rtems_task_create( - 1, - 251, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &id - ); - directive_failed( status, "rtems_task_create" ); - - status = rtems_task_start( id, test_init, 0 ); - directive_failed( status, "rtems_task_start" ); - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} - -#define MESSAGE_SIZE (sizeof(long) * 4) - -rtems_task test_init( - rtems_task_argument argument -) -{ - rtems_unsigned32 index; - rtems_task_entry task_entry; - rtems_task_priority priority; - rtems_id task_id; - rtems_status_code status; - -/* As each task is started, it preempts this task and - * performs a blocking rtems_message_queue_receive. Upon completion of - * this loop all created tasks are blocked. - */ - - status = rtems_message_queue_create( - rtems_build_name( 'M', 'Q', '1', ' ' ), - OPERATION_COUNT, - MESSAGE_SIZE, - RTEMS_DEFAULT_ATTRIBUTES, - &Queue_id - ); - directive_failed( status, "rtems_message_queue_create" ); - - priority = 250; - - for( index = 0; index < OPERATION_COUNT ; index++ ) { - status = rtems_task_create( - rtems_build_name( 'T', 'I', 'M', 'E' ), - priority, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &task_id - ); - directive_failed( status, "rtems_task_create LOOP" ); - - priority--; - - if ( index==OPERATION_COUNT-1 ) task_entry = High_task; - else task_entry = Middle_tasks; - - status = rtems_task_start( task_id, task_entry, 0 ); - directive_failed( status, "rtems_task_start LOOP" ); - } - - Timer_initialize(); - (void) rtems_message_queue_send( Queue_id, Buffer, MESSAGE_SIZE ); -} - -rtems_task Middle_tasks( - rtems_task_argument argument -) -{ - rtems_unsigned32 size; - - (void) rtems_message_queue_receive( - Queue_id, - (long (*)[4]) Buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); - - (void) rtems_message_queue_send( Queue_id, (long (*)[4]) Buffer, size ); -} - -rtems_task High_task( - rtems_task_argument argument -) -{ - rtems_unsigned32 size; - - (void) rtems_message_queue_receive( - Queue_id, - (long (*)[4]) Buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); - - end_time = Read_timer(); - - put_time( - "rtems_message_queue_send: task readied -- preempts caller", - end_time, - OPERATION_COUNT, - 0, - CALLING_OVERHEAD_MESSAGE_QUEUE_SEND - ); - - puts( "*** END OF TEST 11 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/tmtests/tm11/tm11.doc b/testsuites/tmtests/tm11/tm11.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/tmtests/tm11/tm11.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/tmtests/tm12/.cvsignore b/testsuites/tmtests/tm12/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/tmtests/tm12/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/tmtests/tm12/Makefile.am b/testsuites/tmtests/tm12/Makefile.am deleted file mode 100644 index cb2348d40f..0000000000 --- a/testsuites/tmtests/tm12/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -## -## $Id$ -## - - -TEST = tm12 - -MANAGERS = io message - -C_FILES = task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/tmtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -OPERATION_COUNT = @OPERATION_COUNT@ -AM_CPPFLAGS += -I$(top_srcdir)/include -DOPERATION_COUNT=$(OPERATION_COUNT) - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/tmtests/tm12/system.h b/testsuites/tmtests/tm12/system.h deleted file mode 100644 index d3f219713a..0000000000 --- a/testsuites/tmtests/tm12/system.h +++ /dev/null @@ -1,40 +0,0 @@ -/* system.h - * - * This include file is used by all tests in the Time Suite. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - - -#include -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -#include - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 111 -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* end of include file */ diff --git a/testsuites/tmtests/tm12/task1.c b/testsuites/tmtests/tm12/task1.c deleted file mode 100644 index 17a48ec253..0000000000 --- a/testsuites/tmtests/tm12/task1.c +++ /dev/null @@ -1,146 +0,0 @@ -/* - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_id Queue_id; - -long Buffer[4]; - -rtems_task test_init( - rtems_task_argument argument -); - -rtems_task High_task( - rtems_task_argument argument -); - -rtems_task Low_tasks( - rtems_task_argument argument -); - -#define MESSAGE_SIZE (sizeof(long) * 4) - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_id task_id; - rtems_status_code status; - - Print_Warning(); - - puts( "\n\n*** TIME TEST 12 ***" ); - - status = rtems_task_create( - 1, - 251, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &task_id - ); - directive_failed( status, "rtems_task_create" ); - - status = rtems_task_start( task_id, test_init, 0 ); - directive_failed( status, "rtems_task_start" ); - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} - -rtems_task test_init( - rtems_task_argument argument -) -{ - rtems_unsigned32 index; - rtems_task_entry task_entry; - rtems_task_priority priority; - rtems_id task_id; - rtems_status_code status; - - - status = rtems_message_queue_create( - rtems_build_name( 'M', 'Q', '1', ' ' ), - OPERATION_COUNT, - MESSAGE_SIZE, - RTEMS_DEFAULT_ATTRIBUTES, - &Queue_id - ); - directive_failed( status, "rtems_message_queue_create" ); - - priority = 250; - - for( index = 0; index <= OPERATION_COUNT ; index++ ) { - status = rtems_task_create( - rtems_build_name( 'T', 'I', 'M', 'E' ), - priority, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &task_id - ); - directive_failed( status, "rtems_task_create LOOP" ); - - priority--; - - if ( index==OPERATION_COUNT ) task_entry = High_task; - else task_entry = Low_tasks; - - status = rtems_task_start( task_id, task_entry, 0 ); - directive_failed( status, "rtems_task_start LOOP" ); - } -} - -rtems_task High_task( - rtems_task_argument argument -) -{ - rtems_unsigned32 index; - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) Empty_function(); - overhead = Read_timer(); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_message_queue_send( Queue_id, Buffer, MESSAGE_SIZE ); - end_time = Read_timer(); - - put_time( - "rtems_message_queue_send: task readied -- returns to caller", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_MESSAGE_QUEUE_SEND - ); - - puts( "*** END OF TEST 12 ***" ); - rtems_test_exit( 0 ); -} - -rtems_task Low_tasks( - rtems_task_argument argument -) -{ - rtems_unsigned32 size; - - (void) rtems_message_queue_receive( - Queue_id, - (long (*)[4]) Buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); -} diff --git a/testsuites/tmtests/tm12/tm12.doc b/testsuites/tmtests/tm12/tm12.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/tmtests/tm12/tm12.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/tmtests/tm13/.cvsignore b/testsuites/tmtests/tm13/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/tmtests/tm13/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/tmtests/tm13/Makefile.am b/testsuites/tmtests/tm13/Makefile.am deleted file mode 100644 index fd5f9e33c0..0000000000 --- a/testsuites/tmtests/tm13/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -## -## $Id$ -## - - -TEST = tm13 - -MANAGERS = io message - -C_FILES = task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/tmtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -OPERATION_COUNT = @OPERATION_COUNT@ -AM_CPPFLAGS += -I$(top_srcdir)/include -DOPERATION_COUNT=$(OPERATION_COUNT) - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/tmtests/tm13/system.h b/testsuites/tmtests/tm13/system.h deleted file mode 100644 index d3f219713a..0000000000 --- a/testsuites/tmtests/tm13/system.h +++ /dev/null @@ -1,40 +0,0 @@ -/* system.h - * - * This include file is used by all tests in the Time Suite. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - - -#include -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -#include - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 111 -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* end of include file */ diff --git a/testsuites/tmtests/tm13/task1.c b/testsuites/tmtests/tm13/task1.c deleted file mode 100644 index 4e5de1cbc0..0000000000 --- a/testsuites/tmtests/tm13/task1.c +++ /dev/null @@ -1,155 +0,0 @@ -/* - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_id Queue_id; - -long Buffer[4]; - -rtems_task test_init( - rtems_task_argument argument -); - -rtems_task Middle_tasks( - rtems_task_argument argument -); - -rtems_task High_task( - rtems_task_argument argument -); - -#define MESSAGE_SIZE (sizeof(long) * 4) - -void Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - rtems_id id; - - Print_Warning(); - - puts( "\n\n*** TIME TEST 13 ***" ); - - status = rtems_task_create( - 1, - 251, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &id - ); - directive_failed( status, "rtems_task_create" ); - - status = rtems_task_start( id, test_init, 0 ); - directive_failed( status, "rtems_task_start" ); - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} - -rtems_task test_init( - rtems_task_argument argument -) -{ - rtems_unsigned32 index; - rtems_task_entry task_entry; - rtems_task_priority priority; - rtems_id task_id; - rtems_status_code status; - -/* As each task is started, it preempts this task and - * performs a blocking rtems_message_queue_receive. Upon completion of - * this loop all created tasks are blocked. - */ - - status = rtems_message_queue_create( - rtems_build_name( 'M', 'Q', '1', ' ' ), - OPERATION_COUNT, - MESSAGE_SIZE, - RTEMS_DEFAULT_ATTRIBUTES, - &Queue_id - ); - directive_failed( status, "rtems_message_queue_create" ); - - priority = 250; - - for( index = 0; index < OPERATION_COUNT ; index++ ) { - status = rtems_task_create( - rtems_build_name( 'T', 'I', 'M', 'E' ), - priority, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &task_id - ); - directive_failed( status, "rtems_task_create LOOP" ); - - priority--; - - if ( index==OPERATION_COUNT-1 ) task_entry = High_task; - else task_entry = Middle_tasks; - - status = rtems_task_start( task_id, task_entry, 0 ); - directive_failed( status, "rtems_task_start LOOP" ); - } - - Timer_initialize(); - (void) rtems_message_queue_urgent( Queue_id, Buffer, MESSAGE_SIZE ); -} - -rtems_task Middle_tasks( - rtems_task_argument argument -) -{ - rtems_unsigned32 size; - - (void) rtems_message_queue_receive( - Queue_id, - (long (*)[4]) Buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); - - (void) rtems_message_queue_urgent( Queue_id, (long (*)[4]) Buffer, size ); -} - -rtems_task High_task( - rtems_task_argument argument -) -{ - rtems_unsigned32 size; - - (void) rtems_message_queue_receive( - Queue_id, - (long (*)[4]) Buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); - - end_time = Read_timer(); - - put_time( - "rtems_message_queue_urgent: task readied -- preempts caller", - end_time, - OPERATION_COUNT, - 0, - CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT - ); - - puts( "*** END OF TEST 13 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/tmtests/tm13/tm13.doc b/testsuites/tmtests/tm13/tm13.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/tmtests/tm13/tm13.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/tmtests/tm14/.cvsignore b/testsuites/tmtests/tm14/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/tmtests/tm14/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/tmtests/tm14/Makefile.am b/testsuites/tmtests/tm14/Makefile.am deleted file mode 100644 index 533ff4882a..0000000000 --- a/testsuites/tmtests/tm14/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -## -## $Id$ -## - - -TEST = tm14 - -MANAGERS = io message - -C_FILES = task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/tmtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -OPERATION_COUNT = @OPERATION_COUNT@ -AM_CPPFLAGS += -I$(top_srcdir)/include -DOPERATION_COUNT=$(OPERATION_COUNT) - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/tmtests/tm14/system.h b/testsuites/tmtests/tm14/system.h deleted file mode 100644 index d3f219713a..0000000000 --- a/testsuites/tmtests/tm14/system.h +++ /dev/null @@ -1,40 +0,0 @@ -/* system.h - * - * This include file is used by all tests in the Time Suite. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - - -#include -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -#include - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 111 -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* end of include file */ diff --git a/testsuites/tmtests/tm14/task1.c b/testsuites/tmtests/tm14/task1.c deleted file mode 100644 index 89e8db1af0..0000000000 --- a/testsuites/tmtests/tm14/task1.c +++ /dev/null @@ -1,146 +0,0 @@ -/* - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_id Queue_id; - -long Buffer[4]; - -rtems_task test_init( - rtems_task_argument argument -); - -rtems_task High_task( - rtems_task_argument argument -); - -rtems_task Low_tasks( - rtems_task_argument argument -); - -#define MESSAGE_SIZE (sizeof(long) * 4) - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_id task_id; - rtems_status_code status; - - Print_Warning(); - - puts( "\n\n*** TIME TEST 14 ***" ); - - status = rtems_task_create( - 1, - 251, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &task_id - ); - directive_failed( status, "rtems_task_create" ); - - status = rtems_task_start( task_id, test_init, 0 ); - directive_failed( status, "rtems_task_start" ); - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} - -rtems_task test_init( - rtems_task_argument argument -) -{ - rtems_unsigned32 index; - rtems_task_entry task_entry; - rtems_task_priority priority; - rtems_id task_id; - rtems_status_code status; - - - status = rtems_message_queue_create( - rtems_build_name( 'M', 'Q', '1', ' ' ), - OPERATION_COUNT, - MESSAGE_SIZE, - RTEMS_DEFAULT_ATTRIBUTES, - &Queue_id - ); - directive_failed( status, "rtems_message_queue_create" ); - - priority = 250; - - for( index = 0; index <= OPERATION_COUNT ; index++ ) { - status = rtems_task_create( - rtems_build_name( 'T', 'I', 'M', 'E' ), - priority, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &task_id - ); - directive_failed( status, "rtems_task_create LOOP" ); - - priority--; - - if ( index==OPERATION_COUNT ) task_entry = High_task; - else task_entry = Low_tasks; - - status = rtems_task_start( task_id, task_entry, 0 ); - directive_failed( status, "rtems_task_start LOOP" ); - } -} - -rtems_task High_task( - rtems_task_argument argument -) -{ - rtems_unsigned32 index; - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) Empty_function(); - overhead = Read_timer(); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_message_queue_urgent( Queue_id, Buffer, MESSAGE_SIZE ); - end_time = Read_timer(); - - put_time( - "rtems_message_queue_urgent: task readied -- returns to caller", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_MESSAGE_QUEUE_URGENT - ); - - puts( "*** END OF TEST 14 ***" ); - rtems_test_exit( 0 ); -} - -rtems_task Low_tasks( - rtems_task_argument argument -) -{ - rtems_unsigned32 size; - - (void) rtems_message_queue_receive( - Queue_id, - (long (*)[4]) Buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); -} diff --git a/testsuites/tmtests/tm14/tm14.doc b/testsuites/tmtests/tm14/tm14.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/tmtests/tm14/tm14.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/tmtests/tm15/.cvsignore b/testsuites/tmtests/tm15/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/tmtests/tm15/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/tmtests/tm15/Makefile.am b/testsuites/tmtests/tm15/Makefile.am deleted file mode 100644 index aef4cb102b..0000000000 --- a/testsuites/tmtests/tm15/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -## -## $Id$ -## - - -TEST = tm15 - -MANAGERS = io event - -C_FILES = task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/tmtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -OPERATION_COUNT = @OPERATION_COUNT@ -AM_CPPFLAGS += -I$(top_srcdir)/include -DOPERATION_COUNT=$(OPERATION_COUNT) - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/tmtests/tm15/system.h b/testsuites/tmtests/tm15/system.h deleted file mode 100644 index d3f219713a..0000000000 --- a/testsuites/tmtests/tm15/system.h +++ /dev/null @@ -1,40 +0,0 @@ -/* system.h - * - * This include file is used by all tests in the Time Suite. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - - -#include -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -#include - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 111 -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* end of include file */ diff --git a/testsuites/tmtests/tm15/task1.c b/testsuites/tmtests/tm15/task1.c deleted file mode 100644 index 800eda7dd7..0000000000 --- a/testsuites/tmtests/tm15/task1.c +++ /dev/null @@ -1,221 +0,0 @@ -/* - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_unsigned32 time_set, eventout; - -rtems_task High_tasks( - rtems_task_argument argument -); - -rtems_task Low_task( - rtems_task_argument argument -); - -void test_init(); - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - - Print_Warning(); - - puts( "\n\n*** TIME TEST 15 ***" ); - - test_init(); - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} - -void test_init() -{ - rtems_id id; - rtems_unsigned32 index; - rtems_event_set event_out; - rtems_status_code status; - - time_set = FALSE; - - status = rtems_task_create( - rtems_build_name( 'L', 'O', 'W', ' ' ), - 10, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_NO_PREEMPT, - RTEMS_DEFAULT_ATTRIBUTES, - &id - ); - directive_failed( status, "rtems_task_create LOW" ); - - status = rtems_task_start( id, Low_task, 0 ); - directive_failed( status, "rtems_task_start LOW" ); - - for ( index = 1 ; index <= OPERATION_COUNT ; index++ ) { - status = rtems_task_create( - rtems_build_name( 'H', 'I', 'G', 'H' ), - 5, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ index ] - ); - directive_failed( status, "rtems_task_create LOOP" ); - - status = rtems_task_start( Task_id[ index ], High_tasks, 0 ); - directive_failed( status, "rtems_task_start LOOP" ); - } - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) Empty_function(); - overhead = Read_timer(); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - { - (void) rtems_event_receive( - RTEMS_PENDING_EVENTS, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &event_out - ); - } - - end_time = Read_timer(); - - put_time( - "rtems_event_receive: obtain current events", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_EVENT_RECEIVE - ); - - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - { - (void) rtems_event_receive( - RTEMS_ALL_EVENTS, - RTEMS_NO_WAIT, - RTEMS_NO_TIMEOUT, - &event_out - ); - } - end_time = Read_timer(); - - put_time( - "rtems_event_receive: not available -- NO_WAIT", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_EVENT_RECEIVE - ); -} - -rtems_task Low_task( - rtems_task_argument argument -) -{ - rtems_unsigned32 index; - rtems_event_set event_out; - - end_time = Read_timer(); - - put_time( - "rtems_event_receive: not available -- caller blocks", - end_time, - OPERATION_COUNT, - 0, - CALLING_OVERHEAD_EVENT_RECEIVE - ); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) Empty_function(); - overhead = Read_timer(); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_event_send( RTEMS_SELF, RTEMS_EVENT_16 ); - end_time = Read_timer(); - - put_time( - "rtems_event_send: no task readied", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_EVENT_SEND - ); - - Timer_initialize(); - (void) rtems_event_receive( - RTEMS_EVENT_16, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &event_out - ); - end_time = Read_timer(); - - put_time( - "rtems_event_receive: available", - end_time, - 1, - 0, - CALLING_OVERHEAD_EVENT_RECEIVE - ); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_event_send( Task_id[ index ], RTEMS_EVENT_16 ); - end_time = Read_timer(); - - put_time( - "rtems_event_send: task readied -- returns to caller", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_EVENT_SEND - ); - - puts( "*** END OF TEST 15 ***" ); - rtems_test_exit( 0 ); -} - -rtems_task High_tasks( - rtems_task_argument argument -) -{ - rtems_status_code status; - - if ( time_set ) - status = rtems_event_receive( - RTEMS_EVENT_16, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &eventout - ); - else { - time_set = 1; - Timer_initialize(); /* start blocking rtems_event_receive time */ - status = rtems_event_receive( - RTEMS_EVENT_16, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &eventout - ); - } -} diff --git a/testsuites/tmtests/tm15/tm15.doc b/testsuites/tmtests/tm15/tm15.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/tmtests/tm15/tm15.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/tmtests/tm16/.cvsignore b/testsuites/tmtests/tm16/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/tmtests/tm16/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/tmtests/tm16/Makefile.am b/testsuites/tmtests/tm16/Makefile.am deleted file mode 100644 index 8fdf786685..0000000000 --- a/testsuites/tmtests/tm16/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -## -## $Id$ -## - - -TEST = tm16 - -MANAGERS = io event - -C_FILES = task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/tmtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -OPERATION_COUNT = @OPERATION_COUNT@ -AM_CPPFLAGS += -I$(top_srcdir)/include -DOPERATION_COUNT=$(OPERATION_COUNT) - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/tmtests/tm16/system.h b/testsuites/tmtests/tm16/system.h deleted file mode 100644 index d3f219713a..0000000000 --- a/testsuites/tmtests/tm16/system.h +++ /dev/null @@ -1,40 +0,0 @@ -/* system.h - * - * This include file is used by all tests in the Time Suite. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - - -#include -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -#include - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 111 -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* end of include file */ diff --git a/testsuites/tmtests/tm16/task1.c b/testsuites/tmtests/tm16/task1.c deleted file mode 100644 index 0991c11052..0000000000 --- a/testsuites/tmtests/tm16/task1.c +++ /dev/null @@ -1,147 +0,0 @@ -/* - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_unsigned32 Task_count; - -rtems_task test_init( - rtems_task_argument argument -); - -rtems_task Middle_tasks( - rtems_task_argument argument -); - -rtems_task High_task( - rtems_task_argument argument -); - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_id id; - rtems_status_code status; - - Print_Warning(); - - puts( "\n\n*** TIME TEST 16 ***" ); - - status = rtems_task_create( - rtems_build_name( 'T', 'E', 'S', 'T' ), - 251, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &id - ); - directive_failed( status, "rtems_task_create of test_init" ); - - status = rtems_task_start( id, test_init, 0 ); - directive_failed( status, "rtems_task_start of test_init" ); - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} - -rtems_task test_init( - rtems_task_argument argument -) -{ - rtems_task_priority priority; - rtems_status_code status; - rtems_unsigned32 index; - rtems_task_entry task_entry; - -/* As each task is started, it preempts this task and - * performs a blocking rtems_event_receive. Upon completion of - * this loop all created tasks are blocked. - */ - - priority = 250; - - for( index = 0 ; index <= OPERATION_COUNT ; index++ ) { - status = rtems_task_create( - rtems_build_name( 'M', 'I', 'D', ' ' ), - priority, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ index ] - ); - directive_failed( status, "rtems_task_create LOOP" ); - - if ( index == OPERATION_COUNT ) task_entry = High_task; - else task_entry = Middle_tasks; - - status = rtems_task_start( Task_id[ index ], task_entry, 0 ); - directive_failed( status, "rtems_task_start LOOP" ); - - priority--; - } - - Task_count = 0; - - Timer_initialize(); - (void) rtems_event_send( Task_id[ Task_count ], RTEMS_EVENT_16 ); - /* preempts task */ -} - -rtems_task Middle_tasks( - rtems_task_argument argument -) -{ - rtems_event_set event_out; - - (void) rtems_event_receive( /* task blocks */ - RTEMS_EVENT_16, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &event_out - ); - - Task_count++; - - (void) rtems_event_send( /* preempts task */ - Task_id[ Task_count ], - RTEMS_EVENT_16 - ); -} - -rtems_task High_task( - rtems_task_argument argument -) -{ - rtems_event_set event_out; - - (void) rtems_event_receive( /* task blocks */ - RTEMS_EVENT_16, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &event_out - ); - - end_time = Read_timer(); - - put_time( - "rtems_event_send: task readied -- preempts caller", - end_time, - OPERATION_COUNT, - 0, - CALLING_OVERHEAD_EVENT_SEND - ); - - puts( "*** END OF TEST 16 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/tmtests/tm16/tm16.doc b/testsuites/tmtests/tm16/tm16.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/tmtests/tm16/tm16.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/tmtests/tm17/.cvsignore b/testsuites/tmtests/tm17/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/tmtests/tm17/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/tmtests/tm17/Makefile.am b/testsuites/tmtests/tm17/Makefile.am deleted file mode 100644 index 1c7e56493f..0000000000 --- a/testsuites/tmtests/tm17/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -## -## $Id$ -## - - -TEST = tm17 - -MANAGERS = io - -C_FILES = task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/tmtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -OPERATION_COUNT = @OPERATION_COUNT@ -AM_CPPFLAGS += -I$(top_srcdir)/include -DOPERATION_COUNT=$(OPERATION_COUNT) - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/tmtests/tm17/system.h b/testsuites/tmtests/tm17/system.h deleted file mode 100644 index d3f219713a..0000000000 --- a/testsuites/tmtests/tm17/system.h +++ /dev/null @@ -1,40 +0,0 @@ -/* system.h - * - * This include file is used by all tests in the Time Suite. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - - -#include -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -#include - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 111 -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* end of include file */ diff --git a/testsuites/tmtests/tm17/task1.c b/testsuites/tmtests/tm17/task1.c deleted file mode 100644 index 579fa03499..0000000000 --- a/testsuites/tmtests/tm17/task1.c +++ /dev/null @@ -1,126 +0,0 @@ -/* - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_unsigned32 Task_count; -rtems_task_priority Task_priority; - -rtems_task First_task( - rtems_task_argument argument -); - -rtems_task Middle_tasks( - rtems_task_argument argument -); - -rtems_task Last_task( - rtems_task_argument argument -); - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_task_entry task_entry; - rtems_unsigned32 index; - rtems_status_code status; - - Print_Warning(); - - puts( "\n\n*** TIME TEST 17 ***" ); - - Task_priority = 254; - - for( index = 0; index <= OPERATION_COUNT ; index++ ) { - status = rtems_task_create( - rtems_build_name( 'T', 'I', 'M', 'E' ), - Task_priority, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ index ] - ); - directive_failed( status, "rtems_task_create loop" ); - - if ( index == OPERATION_COUNT ) task_entry = Last_task; - else if ( index == 0 ) task_entry = First_task; - else task_entry = Middle_tasks; - - status = rtems_task_start( Task_id[ index ], task_entry, 0 ); - directive_failed( status, "rtems_task_start loop" ); - } - - Task_count = 1; - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} - -rtems_task First_task( - rtems_task_argument argument -) -{ - rtems_task_priority previous_priority; - - Timer_initialize(); - - Task_priority--; - Task_count++; - - (void) rtems_task_set_priority( - Task_id[ Task_count ], - Task_priority, - &previous_priority - ); -} - -rtems_task Middle_tasks( - rtems_task_argument argument -) -{ - rtems_task_priority previous_priority; - - Task_priority--; - Task_count++; - - (void) rtems_task_set_priority( - Task_id[ Task_count ], - Task_priority, - &previous_priority - ); -} - -rtems_task Last_task( - rtems_task_argument argument -) -{ - rtems_unsigned32 index; - - end_time = Read_timer(); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) Empty_function(); - overhead = Read_timer(); - - put_time( - "rtems_task_set_priority: preempts caller", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_TASK_SET_PRIORITY - ); - - puts( "*** END OF TEST 17 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/tmtests/tm17/tm17.doc b/testsuites/tmtests/tm17/tm17.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/tmtests/tm17/tm17.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/tmtests/tm18/.cvsignore b/testsuites/tmtests/tm18/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/tmtests/tm18/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/tmtests/tm18/Makefile.am b/testsuites/tmtests/tm18/Makefile.am deleted file mode 100644 index 2ba5855ec4..0000000000 --- a/testsuites/tmtests/tm18/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -## -## $Id$ -## - - -TEST = tm18 - -MANAGERS = io - -C_FILES = task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/tmtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -OPERATION_COUNT = @OPERATION_COUNT@ -AM_CPPFLAGS += -I$(top_srcdir)/include -DOPERATION_COUNT=$(OPERATION_COUNT) - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/tmtests/tm18/system.h b/testsuites/tmtests/tm18/system.h deleted file mode 100644 index d3f219713a..0000000000 --- a/testsuites/tmtests/tm18/system.h +++ /dev/null @@ -1,40 +0,0 @@ -/* system.h - * - * This include file is used by all tests in the Time Suite. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - - -#include -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -#include - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 111 -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* end of include file */ diff --git a/testsuites/tmtests/tm18/task1.c b/testsuites/tmtests/tm18/task1.c deleted file mode 100644 index a43066c772..0000000000 --- a/testsuites/tmtests/tm18/task1.c +++ /dev/null @@ -1,111 +0,0 @@ -/* - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_unsigned32 taskcount; -rtems_task_priority taskpri; - -rtems_task First_task( - rtems_task_argument argument -); - -rtems_task Middle_tasks( - rtems_task_argument argument -); - -rtems_task Last_task( - rtems_task_argument argument -); - - -void test_init(); - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - - Print_Warning(); - - puts( "\n\n*** TIME TEST 18 ***" ); - - test_init(); - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} - -void test_init() -{ - rtems_id id; - rtems_task_entry task_entry; - rtems_unsigned32 index; - rtems_status_code status; - - for ( index = 0 ; index <= OPERATION_COUNT ; index++ ) { - status = rtems_task_create( - rtems_build_name( 'T', 'I', 'M', 'E' ), - 128, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &id - ); - directive_failed( status, "rtems_task_create loop" ); - - if ( index == OPERATION_COUNT ) task_entry = Last_task; - else if ( index == 0 ) task_entry = First_task; - else task_entry = Middle_tasks; - - - status = rtems_task_start( id, task_entry, 0 ); - directive_failed( status, "rtems_task_start loop" ); - } - -} - -rtems_task First_task( - rtems_task_argument argument -) -{ - Timer_initialize(); - - (void) rtems_task_delete( RTEMS_SELF ); -} - -rtems_task Middle_tasks( - rtems_task_argument argument -) -{ - (void) rtems_task_delete( RTEMS_SELF ); -} - -rtems_task Last_task( - rtems_task_argument argument -) -{ - end_time = Read_timer(); - - put_time( - "rtems_task_delete: calling task", - end_time, - OPERATION_COUNT, - 0, - CALLING_OVERHEAD_TASK_DELETE - ); - - puts( "*** END OF TEST 18 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/tmtests/tm18/tm18.doc b/testsuites/tmtests/tm18/tm18.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/tmtests/tm18/tm18.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/tmtests/tm19/.cvsignore b/testsuites/tmtests/tm19/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/tmtests/tm19/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/tmtests/tm19/Makefile.am b/testsuites/tmtests/tm19/Makefile.am deleted file mode 100644 index 46a96d5043..0000000000 --- a/testsuites/tmtests/tm19/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -## -## $Id$ -## - - -TEST = tm19 - -MANAGERS = io signal - -C_FILES = task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/tmtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -OPERATION_COUNT = @OPERATION_COUNT@ -AM_CPPFLAGS += -I$(top_srcdir)/include -DOPERATION_COUNT=$(OPERATION_COUNT) - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/tmtests/tm19/system.h b/testsuites/tmtests/tm19/system.h deleted file mode 100644 index d3f219713a..0000000000 --- a/testsuites/tmtests/tm19/system.h +++ /dev/null @@ -1,40 +0,0 @@ -/* system.h - * - * This include file is used by all tests in the Time Suite. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - - -#include -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -#include - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 111 -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* end of include file */ diff --git a/testsuites/tmtests/tm19/task1.c b/testsuites/tmtests/tm19/task1.c deleted file mode 100644 index 629a582b4b..0000000000 --- a/testsuites/tmtests/tm19/task1.c +++ /dev/null @@ -1,207 +0,0 @@ -/* - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_asr Process_asr_for_pass_1( - rtems_signal_set signals -); - -rtems_asr Process_asr_for_pass_2( - rtems_signal_set signals -); - -rtems_task Task_1( - rtems_task_argument argument -); - -rtems_task Task_2( - rtems_task_argument argument -); - -rtems_task Task_3( - rtems_task_argument argument -); - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - - Print_Warning(); - - puts( "\n\n*** TIME TEST 19 ***" ); - - status = rtems_task_create( - rtems_build_name( 'T', 'I', 'M', 'E' ), - 128, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 1 ] - ); - directive_failed( status, "rtems_task_create of TASK1" ); - - status = rtems_task_start( Task_id[ 1 ], Task_1, 0 ); - directive_failed( status, "rtems_task_start of TASK1" ); - - status = rtems_task_create( - rtems_build_name( 'T', 'I', 'M', 'E' ), - 127, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 2 ] - ); - directive_failed( status, "rtems_task_create of TASK2" ); - - status = rtems_task_start( Task_id[ 2 ], Task_2, 0 ); - directive_failed( status, "rtems_task_start of TASK2" ); - - status = rtems_task_create( - rtems_build_name( 'T', 'I', 'M', 'E' ), - 126, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 3 ] - ); - directive_failed( status, "rtems_task_create of TASK3" ); - - status = rtems_task_start( Task_id[ 3 ], Task_3, 0 ); - directive_failed( status, "rtems_task_start of TASK3" ); - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} - -rtems_asr Process_asr_for_pass_1( - rtems_signal_set signals -) -{ - end_time = Read_timer(); - - put_time( - "rtems_signal_send: signal to self", - end_time, - 1, - 0, - CALLING_OVERHEAD_SIGNAL_SEND - ); - - Timer_initialize(); -} - -rtems_asr Process_asr_for_pass_2( - rtems_signal_set signals -) -{ - rtems_status_code status; - - status = rtems_task_resume( Task_id[ 3 ] ); - directive_failed( status, "rtems_task_resume" ); - - Timer_initialize(); -} - -rtems_task Task_1( - rtems_task_argument argument -) -{ - rtems_status_code status; - - Timer_initialize(); - (void) rtems_signal_catch( Process_asr_for_pass_1, RTEMS_DEFAULT_MODES ); - end_time = Read_timer(); - - put_time( - "rtems_signal_catch", - end_time, - 1, - 0, - CALLING_OVERHEAD_SIGNAL_CATCH - ); - - Timer_initialize(); - rtems_signal_send( Task_id[ 2 ], 1 ); - end_time = Read_timer(); - - put_time( - "rtems_signal_send: returns to caller", - end_time, - 1, - 0, - CALLING_OVERHEAD_SIGNAL_SEND - ); - - Timer_initialize(); - (void) rtems_signal_send( RTEMS_SELF, RTEMS_SIGNAL_1 ); - - /* end time is done is RTEMS_ASR */ - - end_time = Read_timer(); - - put_time( - "exit ASR overhead: returns to calling task", - end_time, - 1, - 0, - 0 - ); - - status = rtems_signal_catch( Process_asr_for_pass_2, RTEMS_NO_PREEMPT ); - directive_failed( status, "rtems_signal_catch" ); - - Timer_initialize(); - (void) rtems_signal_send( RTEMS_SELF, RTEMS_SIGNAL_1 ); -} - -rtems_asr Process_asr_for_task_2( - rtems_signal_set signals -) -{ - ; -} - -rtems_task Task_2( - rtems_task_argument argument -) -{ - rtems_status_code status; - - status = rtems_signal_catch( Process_asr_for_task_2, RTEMS_DEFAULT_MODES ); - directive_failed( status, "rtems_signal_catch" ); - - (void) rtems_task_suspend( RTEMS_SELF ); -} - -rtems_task Task_3( - rtems_task_argument argument -) -{ - (void) rtems_task_suspend( RTEMS_SELF ); - - end_time = Read_timer(); - - put_time( - "exit ASR overhead: returns to preempting task", - end_time, - 1, - 0, - 0 - ); - - puts( "*** END OF TEST 19 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/tmtests/tm19/tm19.doc b/testsuites/tmtests/tm19/tm19.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/tmtests/tm19/tm19.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/tmtests/tm20/.cvsignore b/testsuites/tmtests/tm20/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/tmtests/tm20/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/tmtests/tm20/Makefile.am b/testsuites/tmtests/tm20/Makefile.am deleted file mode 100644 index 2206a27fda..0000000000 --- a/testsuites/tmtests/tm20/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -## -## $Id$ -## - - -TEST = tm20 - -MANAGERS = io partition region - -C_FILES = task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/tmtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -OPERATION_COUNT = @OPERATION_COUNT@ -AM_CPPFLAGS += -I$(top_srcdir)/include -DOPERATION_COUNT=$(OPERATION_COUNT) - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/tmtests/tm20/system.h b/testsuites/tmtests/tm20/system.h deleted file mode 100644 index 52c36868c0..0000000000 --- a/testsuites/tmtests/tm20/system.h +++ /dev/null @@ -1,42 +0,0 @@ -/* system.h - * - * This include file is used by all tests in the Time Suite. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - - -#include -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -#include - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_STUB_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 3 -#define CONFIGURE_MAXIMUM_PARTITIONS 1 -#define CONFIGURE_MAXIMUM_REGIONS 1 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* end of include file */ diff --git a/testsuites/tmtests/tm20/task1.c b/testsuites/tmtests/tm20/task1.c deleted file mode 100644 index d2e95f8a4c..0000000000 --- a/testsuites/tmtests/tm20/task1.c +++ /dev/null @@ -1,473 +0,0 @@ -/* - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" -#include - -rtems_device_major_number _STUB_major = 1; - -rtems_id Region_id; -rtems_name Region_name; -rtems_unsigned8 Region_area[ 2048 ] CPU_STRUCTURE_ALIGNMENT; - -#define PARTITION_SIZE 2048 -#define PARTITION_ELEMENT_SIZE 128 -#define PARTITION_BUFFER_POINTERS \ - ((PARTITION_SIZE / PARTITION_ELEMENT_SIZE) + 2) - -rtems_id Partition_id; -rtems_name Partition_name; -rtems_unsigned8 Partition_area[ PARTITION_SIZE ] CPU_STRUCTURE_ALIGNMENT; - -void *Buffer_address_1; -void *Buffer_address_2; -void *Buffer_address_3; -void *Buffer_address_4; - -rtems_unsigned32 buffer_count; - -void *Buffer_addresses[ PARTITION_BUFFER_POINTERS ]; - -rtems_task Task_1( - rtems_task_argument argument -); - -rtems_task Task_2( - rtems_task_argument argument -); - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - - Print_Warning(); - - puts( "\n\n*** TIME TEST 20 ***" ); - - status = rtems_task_create( - rtems_build_name( 'T', 'I', 'M', '1' ), - 128, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 1 ] - ); - directive_failed( status, "rtems_task_create of TASK1" ); - - status = rtems_task_start( Task_id[ 1 ], Task_1, 0 ); - directive_failed( status, "rtems_task_start of TASK1" ); - - status = rtems_task_create( - rtems_build_name( 'T', 'I', 'M', '2' ), - 129, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 2 ] - ); - directive_failed( status, "rtems_task_create of TASK2" ); - - status = rtems_task_start( Task_id[ 2 ], Task_2, 0 ); - directive_failed( status, "rtems_task_start of TASK2" ); - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} - -rtems_task Task_1( - rtems_task_argument argument -) -{ - rtems_unsigned32 index; - rtems_mode previous_mode; - rtems_task_priority previous_priority; - rtems_status_code status; - - Partition_name = rtems_build_name( 'P', 'A', 'R', 'T' ); - - Timer_initialize(); - rtems_partition_create( - Partition_name, - Partition_area, - PARTITION_SIZE, - 128, - RTEMS_DEFAULT_ATTRIBUTES, - &Partition_id - ); - end_time = Read_timer(); - - put_time( - "rtems_partition_create", - end_time, - 1, - 0, - CALLING_OVERHEAD_PARTITION_CREATE - ); - - Region_name = rtems_build_name( 'R', 'E', 'G', 'N' ); - - Timer_initialize(); - rtems_region_create( - Region_name, - Region_area, - 2048, - 16, - RTEMS_DEFAULT_ATTRIBUTES, - &Region_id - ); - end_time = Read_timer(); - - put_time( - "rtems_region_create", - end_time, - 1, - 0, - CALLING_OVERHEAD_REGION_CREATE - ); - - Timer_initialize(); - (void) rtems_partition_get_buffer( Partition_id, &Buffer_address_1 ); - end_time = Read_timer(); - - put_time( - "rtems_partition_get_buffer: available", - end_time, - 1, - 0, - CALLING_OVERHEAD_PARTITION_GET_BUFFER - ); - - buffer_count = 0; - while ( FOREVER ) { - - status = rtems_partition_get_buffer( - Partition_id, - &Buffer_addresses[ buffer_count ] - ); - - if ( status == RTEMS_UNSATISFIED ) break; - - buffer_count++; - - assert( buffer_count < PARTITION_BUFFER_POINTERS ); - } - - Timer_initialize(); - (void) rtems_partition_get_buffer( Partition_id, &Buffer_address_2 ); - end_time = Read_timer(); - - put_time( - "rtems_partition_get_buffer: not available", - end_time, - 1, - 0, - CALLING_OVERHEAD_PARTITION_GET_BUFFER - ); - - Timer_initialize(); - (void) rtems_partition_return_buffer( Partition_id, Buffer_address_1 ); - end_time = Read_timer(); - - put_time( - "rtems_partition_return_buffer", - end_time, - 1, - 0, - CALLING_OVERHEAD_PARTITION_RETURN_BUFFER - ); - - for ( index = 0 ; index < buffer_count ; index++ ) { - - status = rtems_partition_return_buffer( - Partition_id, - Buffer_addresses[ index ] - ); - directive_failed( status, "rtems_partition_return_buffer" ); - - } - - Timer_initialize(); - (void) rtems_partition_delete( Partition_id ); - end_time = Read_timer(); - - put_time( - "rtems_partition_delete", - end_time, - 1, - 0, - CALLING_OVERHEAD_PARTITION_DELETE - ); - - status = rtems_region_get_segment( - Region_id, - 400, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &Buffer_address_2 - ); - directive_failed( status, "region_get_segment" ); - - Timer_initialize(); - (void) rtems_region_get_segment( - Region_id, - 400, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &Buffer_address_3 - ); - end_time = Read_timer(); - - put_time( - "rtems_region_get_segment: available", - end_time, - 1, - 0, - CALLING_OVERHEAD_REGION_GET_SEGMENT - ); - - Timer_initialize(); - (void) rtems_region_get_segment( - Region_id, - 1998, - RTEMS_NO_WAIT, - RTEMS_NO_TIMEOUT, - &Buffer_address_4 - ); - end_time = Read_timer(); - - put_time( - "rtems_region_get_segment: not available -- NO_WAIT", - end_time, - 1, - 0, - CALLING_OVERHEAD_REGION_GET_SEGMENT - ); - - status = rtems_region_return_segment( Region_id, Buffer_address_3 ); - directive_failed( status, "rtems_region_return_segment" ); - - Timer_initialize(); - (void) rtems_region_return_segment( Region_id, Buffer_address_2 ); - end_time = Read_timer(); - - put_time( - "rtems_region_return_segment: no waiting tasks", - end_time, - 1, - 0, - CALLING_OVERHEAD_REGION_RETURN_SEGMENT - ); - - status = rtems_region_get_segment( - Region_id, - 400, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &Buffer_address_1 - ); - directive_failed( status, "rtems_region_get_segment" ); - - Timer_initialize(); - (void) rtems_region_get_segment( - Region_id, - 1998, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &Buffer_address_2 - ); - - /* execute Task_2 */ - - end_time = Read_timer(); - - put_time( - "rtems_region_return_segment: task readied -- preempts caller", - end_time, - 1, - 0, - CALLING_OVERHEAD_REGION_RETURN_SEGMENT - ); - - status = rtems_region_return_segment( Region_id, Buffer_address_2 ); - directive_failed( status, "rtems_region_return_segment" ); - - status = rtems_task_mode( - RTEMS_NO_PREEMPT, - RTEMS_PREEMPT_MASK, - &previous_mode - ); - directive_failed( status, "rtems_task_mode" ); - - status = rtems_task_set_priority( RTEMS_SELF, 254, &previous_priority ); - directive_failed( status, "rtems_task_set_priority" ); - - status = rtems_region_get_segment( - Region_id, - 400, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &Buffer_address_1 - ); - directive_failed( status, "rtems_region_return_segment" ); - - status = rtems_region_get_segment( - Region_id, - 1998, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT, - &Buffer_address_2 - ); - directive_failed( status, "rtems_region_get_segment" ); - - /* execute Task_2 */ - - status = rtems_region_return_segment( Region_id, Buffer_address_2 ); - directive_failed( status, "rtems_region_return_segment" ); - - Timer_initialize(); - (void) rtems_region_delete( Region_id ); - end_time = Read_timer(); - - put_time( - "rtems_region_delete", - end_time, - 1, - 0, - CALLING_OVERHEAD_REGION_DELETE - ); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) Empty_function(); - overhead = Read_timer(); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_io_initialize( _STUB_major, 0, NULL ); - end_time = Read_timer(); - - put_time( - "rtems_io_initialize", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_IO_INITIALIZE - ); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_io_open( _STUB_major, 0, NULL ); - end_time = Read_timer(); - - put_time( - "rtems_io_open", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_IO_OPEN - ); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_io_close( _STUB_major, 0, NULL ); - end_time = Read_timer(); - - put_time( - "rtems_io_close", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_IO_CLOSE - ); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_io_read( _STUB_major, 0, NULL ); - end_time = Read_timer(); - - put_time( - "rtems_io_read", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_IO_READ - ); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_io_write( _STUB_major, 0, NULL ); - end_time = Read_timer(); - - put_time( - "rtems_io_write", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_IO_WRITE - ); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_io_control( _STUB_major, 0, NULL ); - end_time = Read_timer(); - - put_time( - "rtems_io_control", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_IO_CONTROL - ); - - puts( "*** END OF TEST 20 ***" ); - rtems_test_exit( 0 ); -} - -rtems_task Task_2( - rtems_task_argument argument -) -{ - rtems_status_code status; - - end_time = Read_timer(); - - put_time( - "rtems_region_get_segment: not available -- caller blocks", - end_time, - 1, - 0, - CALLING_OVERHEAD_REGION_GET_SEGMENT - ); - - Timer_initialize(); - (void) rtems_region_return_segment( Region_id, Buffer_address_1 ); - - /* preempt back to Task_1 */ - - Timer_initialize(); - (void) rtems_region_return_segment( Region_id, Buffer_address_1 ); - end_time = Read_timer(); - - put_time( - "rtems_region_return_segment: task readied -- returns to caller", - end_time, - 1, - 0, - CALLING_OVERHEAD_REGION_RETURN_SEGMENT - ); - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} diff --git a/testsuites/tmtests/tm20/tm20.doc b/testsuites/tmtests/tm20/tm20.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/tmtests/tm20/tm20.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/tmtests/tm21/.cvsignore b/testsuites/tmtests/tm21/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/tmtests/tm21/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/tmtests/tm21/Makefile.am b/testsuites/tmtests/tm21/Makefile.am deleted file mode 100644 index 2a03ddd14c..0000000000 --- a/testsuites/tmtests/tm21/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -## -## $Id$ -## - - -TEST = tm21 - -MANAGERS = io dpmem message partition region semaphore rate_monotonic timer - -C_FILES = task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/tmtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -OPERATION_COUNT = @OPERATION_COUNT@ -AM_CPPFLAGS += -I$(top_srcdir)/include -DOPERATION_COUNT=$(OPERATION_COUNT) - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/tmtests/tm21/system.h b/testsuites/tmtests/tm21/system.h deleted file mode 100644 index 1ad2d74306..0000000000 --- a/testsuites/tmtests/tm21/system.h +++ /dev/null @@ -1,47 +0,0 @@ -/* system.h - * - * This include file is used by all tests in the Time Suite. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - - -#include -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -#include - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 102 -#define CONFIGURE_MAXIMUM_TIMERS 100 -#define CONFIGURE_MAXIMUM_SEMAPHORES 100 -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 100 -#define CONFIGURE_MAXIMUM_PARTITIONS 100 -#define CONFIGURE_MAXIMUM_REGIONS 100 -#define CONFIGURE_MAXIMUM_PORTS 100 -#define CONFIGURE_MAXIMUM_PERIODS 100 - -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* end of include file */ diff --git a/testsuites/tmtests/tm21/task1.c b/testsuites/tmtests/tm21/task1.c deleted file mode 100644 index 08925e52c0..0000000000 --- a/testsuites/tmtests/tm21/task1.c +++ /dev/null @@ -1,237 +0,0 @@ -/* - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_unsigned8 Region_area[ 2048 ] CPU_STRUCTURE_ALIGNMENT; -rtems_unsigned8 Partition_area[ 2048 ] CPU_STRUCTURE_ALIGNMENT; - -rtems_task Task_1( - rtems_task_argument argument -); - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_id id; - rtems_status_code status; - - Print_Warning(); - - puts( "\n\n*** TIME TEST 21 ***" ); - - status = rtems_task_create( - rtems_build_name( 'T', 'I', 'M', 'E' ), - 250, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &id - ); - directive_failed( status, "rtems_task_create of TASK1" ); - - status = rtems_task_start( id, Task_1, 0 ); - directive_failed( status, "rtems_task_start of TASK1" ); - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} - -#define MESSAGE_SIZE (sizeof(long) * 4) - -rtems_task Task_1( - rtems_task_argument argument -) -{ - rtems_unsigned32 index; - rtems_id id; - rtems_status_code status; - - for( index = 1 ; index <= OPERATION_COUNT ; index++ ) { - status = rtems_task_create ( - index, - 254, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &id - ); - directive_failed( status, "rtems_task_create" ); - - status = rtems_message_queue_create( - index, - 1, /* only going to ident this queue */ - MESSAGE_SIZE, - RTEMS_DEFAULT_ATTRIBUTES, - &id - ); - directive_failed( status, "rtems_message_queue_create" ); - - status = rtems_semaphore_create( - index, - OPERATION_COUNT, - RTEMS_DEFAULT_ATTRIBUTES, - RTEMS_NO_PRIORITY, - &id - ); - directive_failed( status, "rtems_semaphore_create" ); - - status = rtems_region_create( - index, - Region_area, - 2048, - 16, - RTEMS_DEFAULT_ATTRIBUTES, - &id - ); - directive_failed( status, "rtems_region_create" ); - - status = rtems_partition_create( - index, - Partition_area, - 2048, - 128, - RTEMS_DEFAULT_ATTRIBUTES, - &id - ); - directive_failed( status, "rtems_partition_create" ); - - status = rtems_port_create( - index, - Partition_area, - Region_area, - 0xff, - &id - ); - directive_failed( status, "rtems_port_create" ); - - status = rtems_timer_create( index, &id ); - directive_failed( status, "rtems_timer_create" ); - - status = rtems_rate_monotonic_create( index, &id ); - directive_failed( status, "rtems_rate_monotonic_create" ); - } - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) Empty_function(); - overhead = Read_timer(); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_task_ident( index, RTEMS_SEARCH_ALL_NODES, &id ); - end_time = Read_timer(); - - put_time( - "rtems_task_ident", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_TASK_IDENT - ); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_message_queue_ident( index, RTEMS_SEARCH_ALL_NODES, &id ); - end_time = Read_timer(); - - put_time( - "rtems_message_queue_ident", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_MESSAGE_QUEUE_IDENT - ); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_semaphore_ident( index, RTEMS_SEARCH_ALL_NODES, &id ); - end_time = Read_timer(); - - put_time( - "rtems_semaphore_ident", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_SEMAPHORE_IDENT - ); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_partition_ident( index, RTEMS_SEARCH_ALL_NODES, &id ); - end_time = Read_timer(); - - put_time( - "rtems_partition_ident", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_PARTITION_IDENT - ); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_region_ident( index, &id ); - end_time = Read_timer(); - - put_time( - "rtems_region_ident", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_REGION_IDENT - ); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_port_ident( index, &id ); - end_time = Read_timer(); - - put_time( - "rtems_port_ident", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_PORT_IDENT - ); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_timer_ident( index, &id ); - end_time = Read_timer(); - - put_time( - "rtems_timer_ident", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_TIMER_IDENT - ); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_rate_monotonic_ident( index, &id ); - end_time = Read_timer(); - - put_time( - "rtems_rate_monotonic_ident", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_RATE_MONOTONIC_IDENT - ); - - puts( "*** END OF TEST 21 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/tmtests/tm21/tm21.doc b/testsuites/tmtests/tm21/tm21.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/tmtests/tm21/tm21.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/tmtests/tm22/.cvsignore b/testsuites/tmtests/tm22/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/tmtests/tm22/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/tmtests/tm22/Makefile.am b/testsuites/tmtests/tm22/Makefile.am deleted file mode 100644 index b79c01627e..0000000000 --- a/testsuites/tmtests/tm22/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -## -## $Id$ -## - - -TEST = tm22 - -MANAGERS = io message - -C_FILES = task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/tmtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -OPERATION_COUNT = @OPERATION_COUNT@ -AM_CPPFLAGS += -I$(top_srcdir)/include -DOPERATION_COUNT=$(OPERATION_COUNT) - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/tmtests/tm22/system.h b/testsuites/tmtests/tm22/system.h deleted file mode 100644 index ebdf6d4e80..0000000000 --- a/testsuites/tmtests/tm22/system.h +++ /dev/null @@ -1,40 +0,0 @@ -/* system.h - * - * This include file is used by all tests in the Time Suite. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - - -#include -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -#include - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 103 -#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 1 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* end of include file */ diff --git a/testsuites/tmtests/tm22/task1.c b/testsuites/tmtests/tm22/task1.c deleted file mode 100644 index 9416580fba..0000000000 --- a/testsuites/tmtests/tm22/task1.c +++ /dev/null @@ -1,201 +0,0 @@ -/* - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_id Queue_id; - -long Buffer[4]; - -rtems_task Low_task( - rtems_task_argument argument -); - -rtems_task High_task( - rtems_task_argument argument -); - -rtems_task Preempt_task( - rtems_task_argument argument -); - -#define MESSAGE_SIZE (sizeof(long) * 4) - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_id id; - rtems_status_code status; - - Print_Warning(); - - puts( "\n\n*** TIME TEST 22 ***" ); - - status = rtems_message_queue_create( - rtems_build_name( 'M', 'Q', '1', ' '), - 100, - MESSAGE_SIZE, - RTEMS_DEFAULT_ATTRIBUTES, - &Queue_id - ); - directive_failed( status, "rtems_message_queue_create" ); - - status = rtems_task_create( - rtems_build_name( 'L', 'O', 'W', ' ' ), - 10, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_NO_PREEMPT, - RTEMS_DEFAULT_ATTRIBUTES, - &id - ); - directive_failed( status, "rtems_task_create" ); - - status = rtems_task_start( id, Low_task, 0 ); - directive_failed( status, "rtems_task_start LOW" ); - - status = rtems_task_create( - 1, - 11, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &id - ); - directive_failed( status, "rtems_task_create RTEMS_PREEMPT" ); - - status = rtems_task_start( id, Preempt_task, 0 ); - directive_failed( status, "rtems_task_start RTEMS_PREEMPT" ); - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} - -rtems_task High_task( - rtems_task_argument argument -) -{ - rtems_unsigned32 count; - rtems_status_code status; - - Timer_initialize(); - (void) rtems_message_queue_broadcast( - Queue_id, - Buffer, - MESSAGE_SIZE, - &count - ); - end_time = Read_timer(); - - put_time( - "rtems_message_queue_broadcast: task readied -- returns to caller", - end_time, - 1, - 0, - CALLING_OVERHEAD_MESSAGE_QUEUE_BROADCAST - ); - - status = rtems_task_suspend(RTEMS_SELF); - directive_failed( status, "rtems_task_suspend" ); -} - -rtems_task Low_task( - rtems_task_argument argument -) -{ - rtems_id id; - rtems_unsigned32 index; - rtems_unsigned32 count; - rtems_unsigned32 size; - rtems_status_code status; - - status = rtems_task_create( - rtems_build_name( 'H', 'I', 'G', 'H' ), - 5, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_NO_PREEMPT, - RTEMS_DEFAULT_ATTRIBUTES, - &id - ); - directive_failed( status, "rtems_task_create" ); - - status = rtems_task_start( id, High_task, 0 ); - directive_failed( status, "rtems_task_start HIGH" ); - - status = rtems_message_queue_receive( - Queue_id, - (long (*)[4]) Buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); - directive_failed( status, "message_queu_receive" ); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_message_queue_broadcast( - Queue_id, - Buffer, - MESSAGE_SIZE, - &count - ); - end_time = Read_timer(); - - put_time( - "rtems_message_queue_broadcast: no waiting tasks", - end_time, - OPERATION_COUNT, - 1, - CALLING_OVERHEAD_MESSAGE_QUEUE_BROADCAST - ); - - (void) rtems_message_queue_receive( - Queue_id, - (long (*)[4]) Buffer, - &size, - RTEMS_DEFAULT_OPTIONS, - RTEMS_NO_TIMEOUT - ); - - /* should go to Preempt_task here */ - - end_time = Read_timer(); - - put_time( - "rtems_message_queue_broadcast: task readied -- preempts caller", - end_time, - 1, - 0, - CALLING_OVERHEAD_MESSAGE_QUEUE_BROADCAST - ); - - puts( "*** END OF TEST 22 ***" ); - rtems_test_exit( 0 ); -} - -rtems_task Preempt_task( - rtems_task_argument argument -) -{ - rtems_unsigned32 count; - - Timer_initialize(); - (void) rtems_message_queue_broadcast( - Queue_id, - Buffer, - MESSAGE_SIZE, - &count - ); - - /* should be preempted by low task */ -} diff --git a/testsuites/tmtests/tm22/tm22.doc b/testsuites/tmtests/tm22/tm22.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/tmtests/tm22/tm22.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/tmtests/tm23/.cvsignore b/testsuites/tmtests/tm23/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/tmtests/tm23/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/tmtests/tm23/Makefile.am b/testsuites/tmtests/tm23/Makefile.am deleted file mode 100644 index fe163d203e..0000000000 --- a/testsuites/tmtests/tm23/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -## -## $Id$ -## - - -TEST = tm23 - -MANAGERS = io event timer - -C_FILES = task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/tmtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -OPERATION_COUNT = @OPERATION_COUNT@ -AM_CPPFLAGS += -I$(top_srcdir)/include -DOPERATION_COUNT=$(OPERATION_COUNT) - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/tmtests/tm23/system.h b/testsuites/tmtests/tm23/system.h deleted file mode 100644 index d95e26699a..0000000000 --- a/testsuites/tmtests/tm23/system.h +++ /dev/null @@ -1,40 +0,0 @@ -/* system.h - * - * This include file is used by all tests in the Time Suite. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - - -#include -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -#include - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 111 -#define CONFIGURE_MAXIMUM_TIMERS 110 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* end of include file */ diff --git a/testsuites/tmtests/tm23/task1.c b/testsuites/tmtests/tm23/task1.c deleted file mode 100644 index 8d630a055b..0000000000 --- a/testsuites/tmtests/tm23/task1.c +++ /dev/null @@ -1,301 +0,0 @@ -/* - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_id Timer_id[ OPERATION_COUNT+1 ]; - -rtems_time_of_day time_of_day; - -void null_delay( - rtems_id ignored_id, - void *ignored_address -); - -rtems_task Low_task( - rtems_task_argument argument -); - -rtems_task Middle_tasks( - rtems_task_argument argument -); - -rtems_task High_task( - rtems_task_argument argument -); - - -rtems_task Init( - rtems_task_argument argument -) -{ - - rtems_task_priority priority; - rtems_unsigned32 index; - rtems_id id; - rtems_task_entry task_entry; - rtems_status_code status; - - Print_Warning(); - - puts( "\n\n*** TIME TEST 23 ***" ); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) Empty_function(); - overhead = Read_timer(); - - priority = 5; - - for( index=1 ; index <= OPERATION_COUNT ; index++ ) { - status = rtems_task_create( - rtems_build_name( 'T', 'I', 'M', 'E' ), - priority, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &id - ); - directive_failed( status, "rtems_task_create LOOP" ); - - if ( index == 1 ) task_entry = High_task; - else if ( index == OPERATION_COUNT ) task_entry = Low_task; - else task_entry = Middle_tasks; - - status = rtems_task_start( id, task_entry, 0 ); - directive_failed( status, "rtems_task_start LOOP" ); - - priority++; - } - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} - -void null_delay( - rtems_id ignored_id, - void *ignored_address -) -{ -} - -rtems_task High_task( - rtems_task_argument argument -) -{ - rtems_unsigned32 index; - rtems_status_code status; - int i; - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) Empty_function(); - overhead = Read_timer(); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_timer_create( index, &Timer_id[ index ] ); - end_time = Read_timer(); - - put_time( - "rtems_timer_create", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_TIMER_CREATE - ); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_timer_fire_after( Timer_id[ index ], 500, null_delay, NULL ); - end_time = Read_timer(); - - put_time( - "rtems_timer_fire_after: inactive", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_TIMER_FIRE_AFTER - ); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_timer_fire_after( Timer_id[ index ], 500, null_delay, NULL ); - end_time = Read_timer(); - - put_time( - "rtems_timer_fire_after: active", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_TIMER_FIRE_AFTER - ); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_timer_cancel( Timer_id[ index ] ); - end_time = Read_timer(); - - put_time( - "rtems_timer_cancel: active", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_TIMER_CANCEL - ); - - for ( Timer_initialize(), i=0 ; i -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -#include - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 111 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* end of include file */ diff --git a/testsuites/tmtests/tm24/task1.c b/testsuites/tmtests/tm24/task1.c deleted file mode 100644 index a0d6bee9ed..0000000000 --- a/testsuites/tmtests/tm24/task1.c +++ /dev/null @@ -1,123 +0,0 @@ -/* - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_unsigned32 Task_count; - -rtems_task Tasks( - rtems_task_argument argument -); - -rtems_task High_task( - rtems_task_argument argument -); - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_id id; - rtems_unsigned32 index; - rtems_status_code status; - - Print_Warning(); - - puts( "\n\n*** TIME TEST 24 ***" ); - - status = rtems_task_create( - rtems_build_name( 'H', 'I', 'G', 'H' ), - 10, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &id - ); - directive_failed( status, "rtems_task_create HIGH" ); - - status = rtems_task_start( id, High_task, 0 ); - directive_failed( status, "rtems_task_create HIGH" ); - - for ( index = 1 ; index <= OPERATION_COUNT ; index++ ) { - status = rtems_task_create( - rtems_build_name( 'R', 'E', 'S', 'T' ), - 128, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &id - ); - directive_failed( status, "rtems_task_create LOOP" ); - - status = rtems_task_start( id, Tasks, 0 ); - directive_failed( status, "rtems_task_start LOOP" ); - } - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} - -rtems_task High_task( - rtems_task_argument argument -) -{ - rtems_status_code status; - rtems_unsigned32 index; - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) Empty_function(); - overhead = Read_timer(); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_task_wake_after( RTEMS_YIELD_PROCESSOR ); - end_time = Read_timer(); - - put_time( - "rtems_task_wake_after: yield -- returns to caller", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_TASK_WAKE_AFTER - ); - - Task_count = 0; - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} - -rtems_task Tasks( - rtems_task_argument argument -) -{ - Task_count++; - - if ( Task_count == 1 ) - Timer_initialize(); - else if ( Task_count == OPERATION_COUNT ) { - end_time = Read_timer(); - - put_time( - "rtems_task_wake_after: yields -- preempts caller", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_TASK_WAKE_AFTER - ); - - puts( "*** END OF TEST 24 ***" ); - rtems_test_exit( 0 ); - } - (void) rtems_task_wake_after( RTEMS_YIELD_PROCESSOR ); -} diff --git a/testsuites/tmtests/tm24/tm24.doc b/testsuites/tmtests/tm24/tm24.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/tmtests/tm24/tm24.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/tmtests/tm25/.cvsignore b/testsuites/tmtests/tm25/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/tmtests/tm25/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/tmtests/tm25/Makefile.am b/testsuites/tmtests/tm25/Makefile.am deleted file mode 100644 index e825bd1833..0000000000 --- a/testsuites/tmtests/tm25/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -## -## $Id$ -## - - -TEST = tm25 - -MANAGERS = io semaphore - -C_FILES = task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/tmtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -OPERATION_COUNT = @OPERATION_COUNT@ -AM_CPPFLAGS += -I$(top_srcdir)/include -DOPERATION_COUNT=$(OPERATION_COUNT) - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/tmtests/tm25/system.h b/testsuites/tmtests/tm25/system.h deleted file mode 100644 index d3be287997..0000000000 --- a/testsuites/tmtests/tm25/system.h +++ /dev/null @@ -1,40 +0,0 @@ -/* system.h - * - * This include file is used by all tests in the Time Suite. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - - -#include -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -#include - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 111 -#define CONFIGURE_MAXIMUM_SEMAPHORES 1 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* end of include file */ diff --git a/testsuites/tmtests/tm25/task1.c b/testsuites/tmtests/tm25/task1.c deleted file mode 100644 index c456c6e778..0000000000 --- a/testsuites/tmtests/tm25/task1.c +++ /dev/null @@ -1,108 +0,0 @@ -/* - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_id Semaphore_id; - -rtems_task High_tasks( - rtems_task_argument argument -); - -rtems_task Low_task( - rtems_task_argument argument -); - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_id task_id; - rtems_unsigned32 index; - rtems_status_code status; - - Print_Warning(); - - puts( "\n\n*** TIME TEST 25 ***" ); - - status = rtems_semaphore_create( - rtems_build_name( 'S', 'M', '1', ' ') , - 0, - RTEMS_DEFAULT_ATTRIBUTES, - RTEMS_NO_PRIORITY, - &Semaphore_id - ); - directive_failed( status, "rtems_semaphore_create of SM1" ); - - status = rtems_task_create( - rtems_build_name( 'L', 'O', 'W', ' ' ), - 254, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &task_id - ); - directive_failed( status, "rtems_task_create LOW" ); - - status = rtems_task_start( task_id, Low_task, 0 ); - directive_failed( status, "rtems_task_start LOW" ); - - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) { - status = rtems_task_create( - rtems_build_name( 'T', 'I', 'M', 'E' ), - 128, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &task_id - ); - directive_failed( status, "rtems_task_create LOOP" ); - - status = rtems_task_start( task_id, High_tasks, 0 ); - directive_failed( status, "rtems_task_start LOOP" ); - } - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} - -rtems_task High_tasks( - rtems_task_argument argument -) -{ - (void) rtems_semaphore_obtain( - Semaphore_id, - RTEMS_DEFAULT_OPTIONS, - 0xffffffff - ); -} - -rtems_task Low_task( - rtems_task_argument argument -) -{ - Timer_initialize(); - (void) rtems_clock_tick(); - end_time = Read_timer(); - - put_time( - "rtems_clock_tick", - end_time, - 1, - 0, - CALLING_OVERHEAD_CLOCK_TICK - ); - - puts( "*** END OF TEST 25 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/tmtests/tm25/tm25.doc b/testsuites/tmtests/tm25/tm25.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/tmtests/tm25/tm25.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/tmtests/tm26/.cvsignore b/testsuites/tmtests/tm26/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/tmtests/tm26/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/tmtests/tm26/Makefile.am b/testsuites/tmtests/tm26/Makefile.am deleted file mode 100644 index fcc6639183..0000000000 --- a/testsuites/tmtests/tm26/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -## -## $Id$ -## - - -TEST = tm26 - -MANAGERS = io semaphore - -C_FILES = task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h fptest.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/tmtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -OPERATION_COUNT = @OPERATION_COUNT@ -AM_CPPFLAGS += -I$(top_srcdir)/include -DOPERATION_COUNT=$(OPERATION_COUNT) - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/tmtests/tm26/fptest.h b/testsuites/tmtests/tm26/fptest.h deleted file mode 100644 index 9ebe585168..0000000000 --- a/testsuites/tmtests/tm26/fptest.h +++ /dev/null @@ -1,164 +0,0 @@ -/* fptest.h - * - * This include file contains the CPU dependent implementation - * of the following routines needed to test RTEMS floating - * point support: - * FP_load( &context ) - * FP_check( &context ) - * - * FP_load - loads the specified floating point context - * FP_check - checks the specified floating point context - * - * NOTE: These routines are VERY CPU dependent and are thus - * located in in the CPU dependent include file - * fptest.h. These routines form the core of the - * floating point context switch test. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - - -#ifndef __FPTEST_h -#define __FPTEST_h - -#include - -#ifndef CPU_HARDWARE_FP -#error "This CPU does not have CPU_HARDWARE_FP defined" -#endif - -#if ( CPU_HARDWARE_FP == FALSE ) - -#define FP_DECLARE -#define FP_LOAD( _factor ) -#define FP_CHECK( _factor ) 0 - -#else - -#define FP_DECLARE \ - double fp01 = 1.0; \ - double fp02 = 2.0; \ - double fp03 = 3.0; \ - double fp04 = 4.0; \ - double fp05 = 5.0; \ - double fp06 = 6.0; \ - double fp07 = 7.0; \ - double fp08 = 8.0; \ - double fp09 = 9.0; \ - double fp10 = 10.0; \ - double fp11 = 11.0; \ - double fp12 = 12.0; \ - double fp13 = 13.0; \ - double fp14 = 14.0; \ - double fp15 = 15.0; \ - double fp16 = 16.0; \ - double fp17 = 17.0; \ - double fp18 = 18.0; \ - double fp19 = 19.0; \ - double fp20 = 20.0; \ - double fp21 = 21.0; \ - double fp22 = 22.0; \ - double fp23 = 23.0; \ - double fp24 = 24.0; \ - double fp25 = 25.0; \ - double fp26 = 26.0; \ - double fp27 = 27.0; \ - double fp28 = 28.0; \ - double fp29 = 29.0; \ - double fp30 = 30.0; \ - double fp31 = 31.0; \ - double fp32 = 32.0 - -#define FP_LOAD( _factor ) \ - do { \ - fp01 += _factor; \ - fp02 += _factor; \ - fp03 += _factor; \ - fp04 += _factor; \ - fp05 += _factor; \ - fp06 += _factor; \ - fp07 += _factor; \ - fp08 += _factor; \ - fp09 += _factor; \ - fp10 += _factor; \ - fp11 += _factor; \ - fp12 += _factor; \ - fp13 += _factor; \ - fp14 += _factor; \ - fp15 += _factor; \ - fp16 += _factor; \ - fp17 += _factor; \ - fp18 += _factor; \ - fp19 += _factor; \ - fp20 += _factor; \ - fp21 += _factor; \ - fp22 += _factor; \ - fp23 += _factor; \ - fp24 += _factor; \ - fp25 += _factor; \ - fp26 += _factor; \ - fp27 += _factor; \ - fp28 += _factor; \ - fp29 += _factor; \ - fp30 += _factor; \ - fp31 += _factor; \ - fp32 += _factor; \ - } while (0) - -#define EPSILON (0.0005) -#define FPABS(d) (((d) < 0.0) ? -(d) : (d)) -#define FPNEQ(a,b) (FPABS((a)-(b)) > EPSILON) - -#define FP_CHECK_ONE( _v, _base, _factor ) \ - if ( FPNEQ( (_v), ((_base) + (_factor)) ) ) { \ - printf("%d: " #_v " wrong -- (%g not %g)\n", \ - task_index, (_v), (_base + _factor)); \ - } - - -#define FP_CHECK( _factor ) \ - do { \ - FP_CHECK_ONE( fp01, 1.0, (_factor) ); \ - FP_CHECK_ONE( fp02, 2.0, (_factor) ); \ - FP_CHECK_ONE( fp03, 3.0, (_factor) ); \ - FP_CHECK_ONE( fp04, 4.0, (_factor) ); \ - FP_CHECK_ONE( fp05, 5.0, (_factor) ); \ - FP_CHECK_ONE( fp06, 6.0, (_factor) ); \ - FP_CHECK_ONE( fp07, 7.0, (_factor) ); \ - FP_CHECK_ONE( fp08, 8.0, (_factor) ); \ - FP_CHECK_ONE( fp09, 9.0, (_factor) ); \ - FP_CHECK_ONE( fp10, 10.0, (_factor) ); \ - FP_CHECK_ONE( fp11, 11.0, (_factor) ); \ - FP_CHECK_ONE( fp12, 12.0, (_factor) ); \ - FP_CHECK_ONE( fp13, 13.0, (_factor) ); \ - FP_CHECK_ONE( fp14, 14.0, (_factor) ); \ - FP_CHECK_ONE( fp15, 15.0, (_factor) ); \ - FP_CHECK_ONE( fp16, 16.0, (_factor) ); \ - FP_CHECK_ONE( fp17, 17.0, (_factor) ); \ - FP_CHECK_ONE( fp18, 18.0, (_factor) ); \ - FP_CHECK_ONE( fp19, 19.0, (_factor) ); \ - FP_CHECK_ONE( fp20, 20.0, (_factor) ); \ - FP_CHECK_ONE( fp21, 21.0, (_factor) ); \ - FP_CHECK_ONE( fp22, 22.0, (_factor) ); \ - FP_CHECK_ONE( fp23, 23.0, (_factor) ); \ - FP_CHECK_ONE( fp24, 24.0, (_factor) ); \ - FP_CHECK_ONE( fp25, 25.0, (_factor) ); \ - FP_CHECK_ONE( fp26, 26.0, (_factor) ); \ - FP_CHECK_ONE( fp27, 27.0, (_factor) ); \ - FP_CHECK_ONE( fp28, 28.0, (_factor) ); \ - FP_CHECK_ONE( fp29, 29.0, (_factor) ); \ - FP_CHECK_ONE( fp30, 30.0, (_factor) ); \ - FP_CHECK_ONE( fp31, 31.0, (_factor) ); \ - FP_CHECK_ONE( fp32, 32.0, (_factor) ); \ - } while (0) - -#endif - -#endif diff --git a/testsuites/tmtests/tm26/system.h b/testsuites/tmtests/tm26/system.h deleted file mode 100644 index d3be287997..0000000000 --- a/testsuites/tmtests/tm26/system.h +++ /dev/null @@ -1,40 +0,0 @@ -/* system.h - * - * This include file is used by all tests in the Time Suite. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - - -#include -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -#include - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 111 -#define CONFIGURE_MAXIMUM_SEMAPHORES 1 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* end of include file */ diff --git a/testsuites/tmtests/tm26/task1.c b/testsuites/tmtests/tm26/task1.c deleted file mode 100644 index 23dd41d47c..0000000000 --- a/testsuites/tmtests/tm26/task1.c +++ /dev/null @@ -1,594 +0,0 @@ -/* - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#define __RTEMS_VIOLATE_KERNEL_VISIBILITY__ -#include -#include "system.h" -#include "fptest.h" -#include -#include -#include - - -/* TEST DATA */ -rtems_id Semaphore_id; - -Objects_Locations location; /* uses internal RTEMS type */ - -Thread_Control *Middle_tcb; /* uses internal RTEMS type */ - -Thread_Control *Low_tcb; /* uses internal RTEMS type */ - -/* - * Variables to hold execution times until they are printed - * at the end of the test. - */ - -rtems_unsigned32 isr_disable_time; -rtems_unsigned32 isr_flash_time; -rtems_unsigned32 isr_enable_time; -rtems_unsigned32 thread_disable_dispatch_time; -rtems_unsigned32 thread_enable_dispatch_time; -rtems_unsigned32 thread_set_state_time; -rtems_unsigned32 thread_dispatch_no_fp_time; -rtems_unsigned32 context_switch_no_fp_time; -rtems_unsigned32 context_switch_self_time; -rtems_unsigned32 context_switch_another_task_time; -rtems_unsigned32 context_switch_restore_1st_fp_time; -rtems_unsigned32 context_switch_save_idle_restore_initted_time; -rtems_unsigned32 context_switch_save_restore_idle_time; -rtems_unsigned32 context_switch_save_restore_initted_time; -rtems_unsigned32 thread_resume_time; -rtems_unsigned32 thread_unblock_time; -rtems_unsigned32 thread_ready_time; -rtems_unsigned32 thread_get_time; -rtems_unsigned32 semaphore_get_time; -rtems_unsigned32 thread_get_invalid_time; - -rtems_task High_task( - rtems_task_argument argument -); - -rtems_task Middle_task( - rtems_task_argument argument -); - -rtems_task Low_task( - rtems_task_argument argument -); - -rtems_task Floating_point_task_1( - rtems_task_argument argument -); - -rtems_task Floating_point_task_2( - rtems_task_argument argument -); - -void complete_test( void ); - -rtems_task null_task( - rtems_task_argument argument -) -{ -} - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_unsigned32 index; - rtems_id task_id; - rtems_status_code status; - - Print_Warning(); - - puts( "\n\n*** TIME TEST 26 ***" ); - - status = rtems_task_create( - rtems_build_name( 'F', 'P', '1', ' ' ), - 201, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_FLOATING_POINT, - &task_id - ); - directive_failed( status, "rtems_task_create of FP1" ); - - status = rtems_task_start( task_id, Floating_point_task_1, 0 ); - directive_failed( status, "rtems_task_start of FP1" ); - - status = rtems_task_create( - rtems_build_name( 'F', 'P', '2', ' ' ), - 202, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_FLOATING_POINT, - &task_id - ); - directive_failed( status, "rtems_task_create of FP2" ); - - status = rtems_task_start( task_id, Floating_point_task_2, 0 ); - directive_failed( status, "rtems_task_start of FP2" ); - - status = rtems_task_create( - rtems_build_name( 'L', 'O', 'W', ' ' ), - 200, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &task_id - ); - directive_failed( status, "rtems_task_create of LOW" ); - - status = rtems_task_start( task_id, Low_task, 0 ); - directive_failed( status, "rtems_task_start of LOW" ); - - status = rtems_task_create( - rtems_build_name( 'M', 'I', 'D', ' ' ), - 128, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &task_id - ); - directive_failed( status, "rtems_task_create of MIDDLE" ); - - status = rtems_task_start( task_id, Middle_task, 0 ); - directive_failed( status, "rtems_task_start of MIDDLE" ); - - status = rtems_task_create( - rtems_build_name( 'H', 'I', 'G', 'H' ), - 5, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &task_id - ); - directive_failed( status, "rtems_task_create of HIGH" ); - - status = rtems_task_start( task_id, High_task, 0 ); - directive_failed( status, "rtems_task_start of HIGH" ); - - status = rtems_semaphore_create( - rtems_build_name( 'S', 'E', 'M', '1' ), - OPERATION_COUNT, - RTEMS_DEFAULT_ATTRIBUTES, - RTEMS_NO_PRIORITY, - &Semaphore_id - ); - directive_failed( status, "rtems_semaphore_create" ); - - for ( index = 1 ; index <= OPERATION_COUNT ; index++ ) { - status = rtems_task_create( - rtems_build_name( 'N', 'U', 'L', 'L' ), - 254, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &task_id - ); - directive_failed( status, "rtems_task_create LOOP" ); - - status = rtems_task_start( task_id, null_task, 0 ); - directive_failed( status, "rtems_task_start LOOP" ); - } - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} - -rtems_task High_task( - rtems_task_argument argument -) -{ - rtems_interrupt_level level; - - Timer_initialize(); - rtems_interrupt_disable( level ); - isr_disable_time = Read_timer(); - - Timer_initialize(); - rtems_interrupt_flash( level ); - isr_flash_time = Read_timer(); - - Timer_initialize(); - rtems_interrupt_enable( level ); - isr_enable_time = Read_timer(); - - Timer_initialize(); - _Thread_Disable_dispatch(); - thread_disable_dispatch_time = Read_timer(); - - Timer_initialize(); - _Thread_Enable_dispatch(); - thread_enable_dispatch_time = Read_timer(); - - Timer_initialize(); - _Thread_Set_state( _Thread_Executing, STATES_SUSPENDED ); - thread_set_state_time = Read_timer(); - - _Context_Switch_necessary = TRUE; - - Timer_initialize(); - _Thread_Dispatch(); /* dispatches Middle_task */ -} - -rtems_task Middle_task( - rtems_task_argument argument -) -{ - thread_dispatch_no_fp_time = Read_timer(); - - _Thread_Set_state( _Thread_Executing, STATES_SUSPENDED ); - - Middle_tcb = _Thread_Executing; - - _Thread_Executing = - (Thread_Control *) _Thread_Ready_chain[200].first; - - /* do not force context switch */ - - _Context_Switch_necessary = FALSE; - - _Thread_Disable_dispatch(); - - Timer_initialize(); - _Context_Switch( &Middle_tcb->Registers, &_Thread_Executing->Registers ); - - Timer_initialize(); - _Context_Switch(&Middle_tcb->Registers, &Low_tcb->Registers); -} - -rtems_task Low_task( - rtems_task_argument argument -) -{ - Thread_Control *executing; - - context_switch_no_fp_time = Read_timer(); - - executing = _Thread_Executing; - - Low_tcb = executing; - - Timer_initialize(); - _Context_Switch( &executing->Registers, &executing->Registers ); - - context_switch_self_time = Read_timer(); - - _Context_Switch(&executing->Registers, &Middle_tcb->Registers); - - context_switch_another_task_time = Read_timer(); - - _Thread_Executing = - (Thread_Control *) _Thread_Ready_chain[201].first; - - /* do not force context switch */ - - _Context_Switch_necessary = FALSE; - - _Thread_Disable_dispatch(); - - Timer_initialize(); -#if (CPU_HARDWARE_FP == 1) || (CPU_SOFTWARE_FP == 1) - _Context_Restore_fp( &_Thread_Executing->fp_context ); -#endif - _Context_Switch( &executing->Registers, &_Thread_Executing->Registers ); -} - -rtems_task Floating_point_task_1( - rtems_task_argument argument -) -{ - Thread_Control *executing; - FP_DECLARE; - - context_switch_restore_1st_fp_time = Read_timer(); - - executing = _Thread_Executing; - - _Thread_Executing = - (Thread_Control *) _Thread_Ready_chain[202].first; - - /* do not force context switch */ - - _Context_Switch_necessary = FALSE; - - _Thread_Disable_dispatch(); - - Timer_initialize(); -#if (CPU_HARDWARE_FP == 1) || (CPU_SOFTWARE_FP == 1) - _Context_Save_fp( &executing->fp_context ); - _Context_Restore_fp( &_Thread_Executing->fp_context ); -#endif - _Context_Switch( &executing->Registers, &_Thread_Executing->Registers ); - /* switch to Floating_point_task_2 */ - - context_switch_save_idle_restore_initted_time = Read_timer(); - - FP_LOAD( 1.0 ); - - executing = _Thread_Executing; - - _Thread_Executing = - (Thread_Control *) _Thread_Ready_chain[202].first; - - /* do not force context switch */ - - _Context_Switch_necessary = FALSE; - - _Thread_Disable_dispatch(); - - Timer_initialize(); -#if (CPU_HARDWARE_FP == 1) || (CPU_SOFTWARE_FP == 1) - _Context_Save_fp( &executing->fp_context ); - _Context_Restore_fp( &_Thread_Executing->fp_context ); -#endif - _Context_Switch( &executing->Registers, &_Thread_Executing->Registers ); - /* switch to Floating_point_task_2 */ -} - -rtems_task Floating_point_task_2( - rtems_task_argument argument -) -{ - Thread_Control *executing; - FP_DECLARE; - - context_switch_save_restore_idle_time = Read_timer(); - - executing = _Thread_Executing; - - _Thread_Executing = - (Thread_Control *) _Thread_Ready_chain[201].first; - - FP_LOAD( 1.0 ); - - /* do not force context switch */ - - _Context_Switch_necessary = FALSE; - - _Thread_Disable_dispatch(); - - Timer_initialize(); -#if (CPU_HARDWARE_FP == 1) || (CPU_SOFTWARE_FP == 1) - _Context_Save_fp( &executing->fp_context ); - _Context_Restore_fp( &_Thread_Executing->fp_context ); -#endif - _Context_Switch( &executing->Registers, &_Thread_Executing->Registers ); - /* switch to Floating_point_task_1 */ - - context_switch_save_restore_initted_time = Read_timer(); - - complete_test(); -} - -void complete_test( void ) -{ - rtems_unsigned32 index; - rtems_id task_id; - - Timer_initialize(); - _Thread_Resume( Middle_tcb, TRUE ); - thread_resume_time = Read_timer(); - - _Thread_Set_state( Middle_tcb, STATES_WAITING_FOR_MESSAGE ); - - Timer_initialize(); - _Thread_Unblock( Middle_tcb ); - thread_unblock_time = Read_timer(); - - _Thread_Set_state( Middle_tcb, STATES_WAITING_FOR_MESSAGE ); - - Timer_initialize(); - _Thread_Ready( Middle_tcb ); - thread_ready_time = Read_timer(); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) Empty_function(); - overhead = Read_timer(); - - task_id = Middle_tcb->Object.id; - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) _Thread_Get( task_id, &location ); - thread_get_time = Read_timer(); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) _Semaphore_Get( Semaphore_id, &location ); - semaphore_get_time = Read_timer(); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) _Thread_Get( 0x3, &location ); - thread_get_invalid_time = Read_timer(); - - /* - * Now dump all the times - */ - - put_time( - "_ISR_Disable", - isr_disable_time, - 1, - 0, - 0 - ); - - put_time( - "_ISR_Flash", - isr_flash_time, - 1, - 0, - 0 - ); - - put_time( - "_ISR_Enable", - isr_enable_time, - 1, - 0, - 0 - ); - - put_time( - "_Thread_Disable_dispatch", - thread_disable_dispatch_time, - 1, - 0, - 0 - ); - - put_time( - "_Thread_Enable_dispatch", - thread_enable_dispatch_time, - 1, - 0, - 0 - ); - - put_time( - "_Thread_Set_state", - thread_set_state_time, - 1, - 0, - 0 - ); - - put_time( - "_Thread_Disptach (NO FP)", - thread_dispatch_no_fp_time, - 1, - 0, - 0 - ); - - put_time( - "context switch: no floating point contexts", - context_switch_no_fp_time, - 1, - 0, - 0 - ); - - put_time( - "context switch: self", - context_switch_self_time, - 1, - 0, - 0 - ); - - put_time( - "context switch: to another task", - context_switch_another_task_time, - 1, - 0, - 0 - ); - -#if (CPU_HARDWARE_FP == 1) || (CPU_SOFTWARE_FP == 1) - put_time( - "fp context switch: restore 1st FP task", - context_switch_restore_1st_fp_time, - 1, - 0, - 0 - ); - - put_time( - "fp context switch: save idle, restore initialized", - context_switch_save_idle_restore_initted_time, - 1, - 0, - 0 - ); - - put_time( - "fp context switch: save idle, restore idle", - context_switch_save_restore_idle_time, - 1, - 0, - 0 - ); - - put_time( - "fp context switch: save initialized, restore initialized", - context_switch_save_restore_initted_time, - 1, - 0, - 0 - ); -#else - puts( "fp context switch: restore 1st FP task - NA" ); - puts( "fp context switch: save idle, restore initialized - NA" ); - puts( "fp context switch: save idle, restore idle - NA" ); - puts( "fp context switch: save initialized, restore initialized - NA" ); -#endif - - put_time( - "_Thread_Resume", - thread_resume_time, - 1, - 0, - 0 - ); - - put_time( - "_Thread_Unblock", - thread_unblock_time, - 1, - 0, - 0 - ); - - put_time( - "_Thread_Ready", - thread_ready_time, - 1, - 0, - 0 - ); - - put_time( - "_Thread_Get", - thread_get_time, - OPERATION_COUNT, - 0, - 0 - ); - - put_time( - "_Semaphore_Get", - semaphore_get_time, - OPERATION_COUNT, - 0, - 0 - ); - - put_time( - "_Thread_Get: invalid id", - thread_get_invalid_time, - OPERATION_COUNT, - 0, - 0 - ); - - puts( "*** END OF TEST 26 ***" ); - rtems_test_exit( 0 ); -} - diff --git a/testsuites/tmtests/tm26/tm26.doc b/testsuites/tmtests/tm26/tm26.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/tmtests/tm26/tm26.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/tmtests/tm27/.cvsignore b/testsuites/tmtests/tm27/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/tmtests/tm27/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/tmtests/tm27/Makefile.am b/testsuites/tmtests/tm27/Makefile.am deleted file mode 100644 index caa63165ad..0000000000 --- a/testsuites/tmtests/tm27/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -## -## $Id$ -## - - -TEST = tm27 - -MANAGERS = io - -C_FILES = task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/tmtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -OPERATION_COUNT = @OPERATION_COUNT@ -AM_CPPFLAGS += -I$(top_srcdir)/include -DOPERATION_COUNT=$(OPERATION_COUNT) - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/tmtests/tm27/system.h b/testsuites/tmtests/tm27/system.h deleted file mode 100644 index b6a42d2997..0000000000 --- a/testsuites/tmtests/tm27/system.h +++ /dev/null @@ -1,39 +0,0 @@ -/* system.h - * - * This include file is used by all tests in the Time Suite. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - - -#include -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -#include - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 10 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* end of include file */ diff --git a/testsuites/tmtests/tm27/task1.c b/testsuites/tmtests/tm27/task1.c deleted file mode 100644 index e1bc7944f9..0000000000 --- a/testsuites/tmtests/tm27/task1.c +++ /dev/null @@ -1,279 +0,0 @@ -/* - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -/* - * WARNING!!!!!!!!! - * - * THIS TEST USES INTERNAL RTEMS VARIABLES!!! - */ - -#define TEST_INIT -#define RTEMS_TM27 -#include "system.h" - -#include - -rtems_task Task_1( - rtems_task_argument argument -); - -rtems_task Task_2( - rtems_task_argument argument -); - -volatile rtems_unsigned32 Interrupt_occurred; -volatile rtems_unsigned32 Interrupt_enter_time, Interrupt_enter_nested_time; -volatile rtems_unsigned32 Interrupt_return_time, Interrupt_return_nested_time; -rtems_unsigned32 Interrupt_nest; -rtems_unsigned32 timer_overhead; - -rtems_isr Isr_handler( - rtems_vector_number vector -); - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - - Print_Warning(); - - puts( "\n\n*** TIME TEST 27 ***" ); - - status = rtems_task_create( - rtems_build_name( 'T', 'A', '1', ' ' ), - 254, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 1 ] - ); - directive_failed( status, "rtems_task_create Task_1" ); - - status = rtems_task_start( Task_id[ 1 ], Task_1, 0 ); - directive_failed( status, "rtems_task_start Task_1" ); - - status = rtems_task_create( - rtems_build_name( 'T', 'A', '2', ' ' ), - 254, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 2 ] - ); - directive_failed( status, "rtems_task_create of Task_2" ); - - status = rtems_task_start( Task_id[ 2 ], Task_2, 0 ); - directive_failed( status, "rtems_task_start of Task_2" ); - - Timer_initialize(); - Read_timer(); - Timer_initialize(); - timer_overhead = Read_timer(); - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} - -rtems_task Task_1( - rtems_task_argument argument -) -{ - Install_tm27_vector( Isr_handler ); - - /* - * No preempt .. no nesting - */ - - Interrupt_nest = 0; - - _Thread_Dispatch_disable_level = 0; - - Interrupt_occurred = 0; - - Timer_initialize(); - Cause_tm27_intr(); - /* goes to Isr_handler */ - -#if (MUST_WAIT_FOR_INTERRUPT == 1) - while ( Interrupt_occurred == 0 ); -#endif - Interrupt_return_time = Read_timer(); - - put_time( - "interrupt entry overhead: returns to interrupted task", - Interrupt_enter_time, - 1, - 0, - timer_overhead - ); - - put_time( - "interrupt exit overhead: returns to interrupted task", - Interrupt_return_time, - 1, - 0, - timer_overhead - ); - - /* - * No preempt .. nested - */ - - _Thread_Dispatch_disable_level = 1; - - Interrupt_nest = 1; - - Interrupt_occurred = 0; - Timer_initialize(); - Cause_tm27_intr(); - /* goes to Isr_handler */ - -#if (MUST_WAIT_FOR_INTERRUPT == 1) - while ( Interrupt_occurred == 0 ); -#endif - Interrupt_return_time = Read_timer(); - - put_time( - "interrupt entry overhead: returns to nested interrupt", - Interrupt_enter_nested_time, - 1, - 0, - 0 - ); - - put_time( - "interrupt exit overhead: returns to nested interrupt", - Interrupt_return_nested_time, - 1, - 0, - 0 - ); - - /* - * Does a preempt .. not nested - */ - - _Thread_Dispatch_disable_level = 0; - - _Thread_Heir = (rtems_tcb *) _Thread_Ready_chain[254].last; - - _Context_Switch_necessary = 1; - - Interrupt_occurred = 0; - Timer_initialize(); - Cause_tm27_intr(); - - /* - * goes to Isr_handler and then returns - */ - - puts( "*** END OF TEST 27 ***" ); - rtems_test_exit( 0 ); -} - -/* - * NOTE: When this task is executing, some of the assumptions made - * regarding the placement of the currently executing task's TCB - * on the ready chains have been violated. At least the assumption - * that this task is at the head of the chain for its priority - * has been violated. - */ - -rtems_task Task_2( - rtems_task_argument argument -) -{ -#if (MUST_WAIT_FOR_INTERRUPT == 1) - while ( Interrupt_occurred == 0 ); -#endif - end_time = Read_timer(); - - put_time( - "interrupt entry overhead: returns to preempting task", - Interrupt_enter_time, - 1, - 0, - timer_overhead - ); - - put_time( - "interrupt exit overhead: returns to preempting task", - end_time, - 1, - 0, - 0 - ); - - fflush( stdout ); - - /* - * Switch back to the other task to exit the test. - */ - - _Thread_Dispatch_disable_level = 0; - - _Thread_Heir = (rtems_tcb *) _Thread_Ready_chain[254].first; - - _Context_Switch_necessary = 1; - - _Thread_Dispatch(); - -} - -/* The Isr_handler() and Isr_handler_inner() routines are structured - * so that there will be as little entry overhead as possible included - * in the interrupt entry time. - */ - -void Isr_handler_inner( void ); - -rtems_isr Isr_handler( - rtems_vector_number vector -) -{ - end_time = Read_timer(); - - Interrupt_occurred = 1; - Isr_handler_inner(); -} - -void Isr_handler_inner( void ) -{ - - /*enable_tracing();*/ - Clear_tm27_intr(); - switch ( Interrupt_nest ) { - case 0: - Interrupt_enter_time = end_time; - break; - case 1: - Interrupt_enter_time = end_time; - Interrupt_nest = 2; - Interrupt_occurred = 0; - Lower_tm27_intr(); - Timer_initialize(); - Cause_tm27_intr(); - /* goes to a nested copy of Isr_handler */ -#if (MUST_WAIT_FOR_INTERRUPT == 1) - while ( Interrupt_occurred == 0 ); -#endif - Interrupt_return_nested_time = Read_timer(); - break; - case 2: - Interrupt_enter_nested_time = end_time; - break; - } - - Timer_initialize(); -} diff --git a/testsuites/tmtests/tm27/tm27.doc b/testsuites/tmtests/tm27/tm27.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/tmtests/tm27/tm27.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/tmtests/tm28/.cvsignore b/testsuites/tmtests/tm28/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/tmtests/tm28/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/tmtests/tm28/Makefile.am b/testsuites/tmtests/tm28/Makefile.am deleted file mode 100644 index 7aeac29ab9..0000000000 --- a/testsuites/tmtests/tm28/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -## -## $Id$ -## - - -TEST = tm28 - -MANAGERS = io dpmem - -C_FILES = task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/tmtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -OPERATION_COUNT = @OPERATION_COUNT@ -AM_CPPFLAGS += -I$(top_srcdir)/include -DOPERATION_COUNT=$(OPERATION_COUNT) - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/tmtests/tm28/system.h b/testsuites/tmtests/tm28/system.h deleted file mode 100644 index 4a7687545f..0000000000 --- a/testsuites/tmtests/tm28/system.h +++ /dev/null @@ -1,40 +0,0 @@ -/* system.h - * - * This include file is used by all tests in the Time Suite. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - - -#include -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -#include - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 2 -#define CONFIGURE_MAXIMUM_PORTS 1 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* end of include file */ diff --git a/testsuites/tmtests/tm28/task1.c b/testsuites/tmtests/tm28/task1.c deleted file mode 100644 index b665efcf1c..0000000000 --- a/testsuites/tmtests/tm28/task1.c +++ /dev/null @@ -1,133 +0,0 @@ -/* - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_id Port_id; - -rtems_unsigned8 Internal_area[ 256 ] CPU_STRUCTURE_ALIGNMENT; -rtems_unsigned8 External_area[ 256 ] CPU_STRUCTURE_ALIGNMENT; - -rtems_task Test_task( - rtems_task_argument argument -); - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_status_code status; - - Print_Warning(); - - puts( "\n\n*** TIME TEST 28 ***" ); - - status = rtems_task_create( - rtems_build_name( 'T', 'I', 'M', 'E' ), - 128, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &Task_id[ 1 ] - ); - directive_failed( status, "rtems_task_create" ); - - status = rtems_task_start( Task_id[ 1 ], Test_task, 0 ); - directive_failed( status, "rtems_task_start" ); - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} - -rtems_task Test_task ( - rtems_task_argument argument -) -{ - rtems_name name; - rtems_unsigned32 index; - void *converted; - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) Empty_function(); - overhead = Read_timer(); - - name = rtems_build_name( 'P', 'O', 'R', 'T' ), - - Timer_initialize(); - rtems_port_create( - name, - Internal_area, - External_area, - 0xff, - &Port_id - ); - end_time = Read_timer(); - - put_time( - "rtems_port_create", - end_time, - 1, - 0, - CALLING_OVERHEAD_PORT_CREATE - ); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_port_external_to_internal( - Port_id, - &External_area[ 0xf ], - &converted - ); - end_time = Read_timer(); - - put_time( - "rtems_port_external_to_internal", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_PORT_EXTERNAL_TO_INTERNAL - ); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_port_internal_to_external( - Port_id, - &Internal_area[ 0xf ], - &converted - ); - end_time = Read_timer(); - - put_time( - "rtems_port_internal_to_external", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_PORT_INTERNAL_TO_EXTERNAL - ); - - Timer_initialize(); - rtems_port_delete( Port_id ); - end_time = Read_timer(); - - put_time( - "rtems_port_delete", - end_time, - 1, - 0, - CALLING_OVERHEAD_PORT_DELETE - ); - - puts( "*** END OF TEST 28 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/tmtests/tm28/tm28.doc b/testsuites/tmtests/tm28/tm28.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/tmtests/tm28/tm28.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/tmtests/tm29/.cvsignore b/testsuites/tmtests/tm29/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/tmtests/tm29/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/tmtests/tm29/Makefile.am b/testsuites/tmtests/tm29/Makefile.am deleted file mode 100644 index bde99d7ee0..0000000000 --- a/testsuites/tmtests/tm29/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -## -## $Id$ -## - - -TEST = tm29 - -MANAGERS = io rate_monotonic - -C_FILES = task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/tmtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -OPERATION_COUNT = @OPERATION_COUNT@ -AM_CPPFLAGS += -I$(top_srcdir)/include -DOPERATION_COUNT=$(OPERATION_COUNT) - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/tmtests/tm29/system.h b/testsuites/tmtests/tm29/system.h deleted file mode 100644 index 4a6ebe21cd..0000000000 --- a/testsuites/tmtests/tm29/system.h +++ /dev/null @@ -1,41 +0,0 @@ -/* system.h - * - * This include file is used by all tests in the Time Suite. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - - -#include -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -#include - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 111 -#define CONFIGURE_MAXIMUM_PERIODS 111 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE -#define CONFIGURE_INIT_TASK_STACK_SIZE (RTEMS_MINIMUM_STACK_SIZE * 2) - -#include - -/* end of include file */ diff --git a/testsuites/tmtests/tm29/task1.c b/testsuites/tmtests/tm29/task1.c deleted file mode 100644 index ecb61d0267..0000000000 --- a/testsuites/tmtests/tm29/task1.c +++ /dev/null @@ -1,206 +0,0 @@ -/* - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_name Period_name; - -rtems_task Tasks( - rtems_task_argument argument -); - -rtems_task Low_task( - rtems_task_argument argument -); - -rtems_unsigned32 Task_count; - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_id id; - rtems_unsigned32 index; - rtems_status_code status; - - Print_Warning(); - - puts( "\n\n*** TIME TEST 29 ***" ); - - Period_name = rtems_build_name( 'P', 'R', 'D', ' ' ); - - Timer_initialize(); - (void) rtems_rate_monotonic_create( Period_name, &id ); - end_time = Read_timer(); - - put_time( - "rtems_rate_monotonic_create", - end_time, - 1, - 0, - CALLING_OVERHEAD_RATE_MONOTONIC_CREATE - ); - - Timer_initialize(); - (void) rtems_rate_monotonic_period( id, 10 ); - end_time = Read_timer(); - - put_time( - "rtems_rate_monotonic_period: initiate period -- returns to caller", - end_time, - 1, - 0, - CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD - ); - - Timer_initialize(); - (void) rtems_rate_monotonic_period( id, RTEMS_PERIOD_STATUS ); - end_time = Read_timer(); - - put_time( - "rtems_rate_monotonic_period: obtain status", - end_time, - 1, - 0, - CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD - ); - - Timer_initialize(); - (void) rtems_rate_monotonic_cancel( id ); - end_time = Read_timer(); - - put_time( - "rtems_rate_monotonic_cancel", - end_time, - 1, - 0, - CALLING_OVERHEAD_RATE_MONOTONIC_CANCEL - ); - - Timer_initialize(); - (void) rtems_rate_monotonic_delete( id ); - end_time = Read_timer(); - - put_time( - "rtems_rate_monotonic_delete: inactive", - end_time, - 1, - 0, - CALLING_OVERHEAD_RATE_MONOTONIC_DELETE - ); - - status = rtems_rate_monotonic_create( Period_name, &id ); - directive_failed( status, "rtems_rate_monotonic_create" ); - - status = rtems_rate_monotonic_period( id, 10 ); - directive_failed( status, "rtems_rate_monotonic_period" ); - - Timer_initialize(); - rtems_rate_monotonic_delete( id ); - end_time = Read_timer(); - - put_time( - "rtems_rate_monotonic_delete: active", - end_time, - 1, - 0, - CALLING_OVERHEAD_RATE_MONOTONIC_DELETE - ); - - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) { - status = rtems_task_create( - rtems_build_name( 'T', 'E', 'S', 'T' ), - 128, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &id - ); - directive_failed( status, "rtems_task_create LOOP" ); - - status = rtems_task_start( id, Tasks, 0 ); - directive_failed( status, "rtems_task_start LOOP" ); - } - - status = rtems_task_create( - rtems_build_name( 'L', 'O', 'W', ' ' ), - 200, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &id - ); - directive_failed( status, "rtems_task_create LOW" ); - - status = rtems_task_start( id, Low_task, 0 ); - directive_failed( status, "rtems_task_start LOW" ); - - Task_count = 0; - - status = rtems_task_delete( RTEMS_SELF ); - directive_failed( status, "rtems_task_delete of RTEMS_SELF" ); -} - -rtems_task Tasks( - rtems_task_argument argument -) -{ - rtems_id id; - rtems_status_code status; - - status = rtems_rate_monotonic_create( 1, &id ); - directive_failed( status, "rtems_rate_monotonic_create" ); - - status = rtems_rate_monotonic_period( id, 100 ); - directive_failed( status, "rtems_rate_monotonic_period" ); - - /* - * Give up the processor to allow all tasks to actually - * create and start their period timer before the benchmark - * timer is initialized. - */ - - (void) rtems_task_wake_after( RTEMS_YIELD_PROCESSOR ); - - Task_count++; - - if ( Task_count == 1 ) - Timer_initialize(); - - (void) rtems_rate_monotonic_period( id, 100 ); -} - -rtems_task Low_task( - rtems_task_argument argument -) -{ - rtems_unsigned32 index; - - end_time = Read_timer(); - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) Empty_function(); - overhead = Read_timer(); - - put_time( - "rtems_rate_monotonic_period: conclude periods -- caller blocks", - end_time, - OPERATION_COUNT, - overhead, - CALLING_OVERHEAD_RATE_MONOTONIC_PERIOD - ); - - puts( "*** END OF TEST 29 ***" ); - rtems_test_exit( 0 ); -} diff --git a/testsuites/tmtests/tm29/tm29.doc b/testsuites/tmtests/tm29/tm29.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/tmtests/tm29/tm29.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/tmtests/tmck/.cvsignore b/testsuites/tmtests/tmck/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/tmtests/tmck/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/tmtests/tmck/Makefile.am b/testsuites/tmtests/tmck/Makefile.am deleted file mode 100644 index f50fab9f2f..0000000000 --- a/testsuites/tmtests/tmck/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -## -## $Id$ -## - - -TEST = tmck - -MANAGERS = io - -C_FILES = task1.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/tmtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -OPERATION_COUNT = @OPERATION_COUNT@ -AM_CPPFLAGS += -I$(top_srcdir)/include -DOPERATION_COUNT=$(OPERATION_COUNT) - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/tmtests/tmck/system.h b/testsuites/tmtests/tmck/system.h deleted file mode 100644 index 750e2b3d22..0000000000 --- a/testsuites/tmtests/tmck/system.h +++ /dev/null @@ -1,39 +0,0 @@ -/* system.h - * - * This include file is used by all tests in the Time Suite. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - - -#include -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -#include - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 2 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* end of include file */ diff --git a/testsuites/tmtests/tmck/task1.c b/testsuites/tmtests/tmck/task1.c deleted file mode 100644 index 4234a32b71..0000000000 --- a/testsuites/tmtests/tmck/task1.c +++ /dev/null @@ -1,179 +0,0 @@ -/* - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - - -#define TEST_INIT -#include "system.h" - -#define MAXIMUM_DISTRIBUTION 10000 - -#undef OPERATION_COUNT -#define OPERATION_COUNT 100000 - -int Distribution[ MAXIMUM_DISTRIBUTION + 1 ]; - -rtems_task Task_1( - rtems_task_argument argument -); - -void check_read_timer( void ); - -rtems_task Init( - rtems_task_argument argument -) -{ - rtems_id id; - rtems_status_code status; - - /* - * Tell the Timer Driver what we are doing - */ - - Set_find_average_overhead( 1 ); - - Print_Warning(); - - puts( "\n\n*** TIME CHECKER ***" ); - - Task_name[ 1 ] = rtems_build_name( 'T', 'A', '1', ' ' ), - - status = rtems_task_create( - 1, - 5, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &id - ); - directive_failed( status, "rtems_task_create of TA1" ); - - status = rtems_task_start( id, 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" ); -} - -rtems_task Task_1( - rtems_task_argument argument -) -{ - rtems_unsigned32 index; - - check_read_timer(); -rtems_test_pause(); - - Timer_initialize(); - end_time = Read_timer(); - - put_time( - "NULL timer stopped at", - end_time, - 1, - 0, - 0 - ); - - Timer_initialize(); - for ( index = 1 ; index <= 1000 ; index++ ) - (void) Empty_function(); - end_time = Read_timer(); - - put_time( - "LOOP (1000) timer stopped at", - end_time, - 1, - 0, - 0 - ); - - Timer_initialize(); - for ( index = 1 ; index <= 10000 ; index++ ) - (void) Empty_function(); - end_time = Read_timer(); - - put_time( - "LOOP (10000) timer stopped at", - end_time, - 1, - 0, - 0 - ); - - Timer_initialize(); - for ( index = 1 ; index <= 50000 ; index++ ) - (void) Empty_function(); - end_time = Read_timer(); - - put_time( - "LOOP (50000) timer stopped at", - end_time, - 1, - 0, - 0 - ); - - Timer_initialize(); - for ( index = 1 ; index <= 100000 ; index++ ) - (void) Empty_function(); - end_time = Read_timer(); - - put_time( - "LOOP (100000) timer stopped at", - end_time, - 1, - 0, - 0 - ); - - puts( "*** END OF TIME CHECKER ***" ); - rtems_test_exit( 0 ); -} - -void check_read_timer() -{ - rtems_unsigned32 index; - rtems_unsigned32 time; - - for ( index = 1 ; index <= MAXIMUM_DISTRIBUTION ; index++ ) - Distribution[ index ] = 0; - - for ( index = 1 ; index <= OPERATION_COUNT ; index++ ) { - Timer_initialize(); - end_time = Read_timer(); - if ( end_time > MAXIMUM_DISTRIBUTION ) { - /* - * Under UNIX a simple process swap takes longer than we - * consider valid for our testing purposes. - */ - printf( "TOO LONG (%d) at index %d!!!\n", end_time, index ); -#if defined(unix) - index--; - continue; -#else - rtems_test_exit( 1 ); -#endif - } - else - Distribution[ end_time ]++; - } - - printf( "Units may not be in microseconds for this test!!!\n" ); - time = 0; - for ( index = 0 ; index <= MAXIMUM_DISTRIBUTION ; index++ ) { - time += (Distribution[ index ] * index); - if ( Distribution[ index ] != 0 ) - printf( "%d %d\n", index, Distribution[ index ] ); - } - printf( "Total time = %d\n", time ); - printf( "Average time = %d\n", time / OPERATION_COUNT ); -} diff --git a/testsuites/tmtests/tmck/tmck.doc b/testsuites/tmtests/tmck/tmck.doc deleted file mode 100644 index c88fc0fc97..0000000000 --- a/testsuites/tmtests/tmck/tmck.doc +++ /dev/null @@ -1,19 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - -This file describes the directives timed by this test. - -benchmark name: timecheck - -This becnchmark is used to calibrate the timer. It is only used to -when initial timing begins on a particular processor board. - diff --git a/testsuites/tmtests/tmoverhd/.cvsignore b/testsuites/tmtests/tmoverhd/.cvsignore deleted file mode 100644 index 282522db03..0000000000 --- a/testsuites/tmtests/tmoverhd/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/testsuites/tmtests/tmoverhd/Makefile.am b/testsuites/tmtests/tmoverhd/Makefile.am deleted file mode 100644 index 70c8eb3d0b..0000000000 --- a/testsuites/tmtests/tmoverhd/Makefile.am +++ /dev/null @@ -1,45 +0,0 @@ -## -## $Id$ -## - - -TEST = tmoverhd - -MANAGERS = io - -C_FILES = testtask.c empty.c -C_O_FILES = $(C_FILES:%.c=${ARCH}/%.$(OBJEXT)) - -H_FILES = system.h dumrtems.h -noinst_HEADERS = $(H_FILES) - -DOCTYPES = doc -DOCS = $(DOCTYPES:%=$(TEST).%) - -SRCS = $(DOCS) $(C_FILES) $(H_FILES) -OBJS = $(C_O_FILES) - -PRINT_SRCS = $(DOCS) - -PGM = ${ARCH}/$(TEST).exe - -include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg -include $(top_srcdir)/../../../../automake/compile.am -include $(top_srcdir)/../../../../automake/leaf.am -include $(top_srcdir)/tmtests.am - -# -# (OPTIONAL) Add local stuff here using += -# - -OPERATION_COUNT = @OPERATION_COUNT@ -AM_CPPFLAGS += -I$(top_srcdir)/include -DOPERATION_COUNT=$(OPERATION_COUNT) - -${PGM}: $(OBJS) $(LINK_FILES) - $(make-exe) - -all-local: $(ARCH) $(TMPINSTALL_FILES) - -EXTRA_DIST = $(C_FILES) $(DOCS) - -include $(top_srcdir)/../../../../automake/local.am diff --git a/testsuites/tmtests/tmoverhd/dumrtems.h b/testsuites/tmtests/tmoverhd/dumrtems.h deleted file mode 100644 index b1e1cbdfae..0000000000 --- a/testsuites/tmtests/tmoverhd/dumrtems.h +++ /dev/null @@ -1,254 +0,0 @@ -/* dumrtems.h - * - * This include file contains phony macros to map - * executive calls to Empty_directive(). - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#ifndef __DUMRTEMS_h -#define __DUMRTEMS_h - -/* RTEMS call redefinition macros */ - -#undef rtems_signal_catch -#undef rtems_signal_send -#undef rtems_io_close -#undef rtems_io_control -#undef rtems_io_initialize -#undef rtems_io_open -#undef rtems_io_read -#undef rtems_io_write -#undef rtems_port_internal_to_external -#undef rtems_port_external_to_internal -#undef rtems_port_create -#undef rtems_port_delete -#undef rtems_port_ident -#undef rtems_event_receive -#undef rtems_event_send -#undef rtems_initialize_executive -#undef rtems_shutdown_executive -#undef rtems_interrupt_catch -#undef rtems_partition_create -#undef rtems_partition_delete -#undef rtems_partition_get_buffer -#undef rtems_partition_ident -#undef rtems_partition_return_buffer -#undef rtems_message_queue_broadcast -#undef rtems_message_queue_create -#undef rtems_message_queue_delete -#undef rtems_message_queue_flush -#undef rtems_message_queue_ident -#undef rtems_message_queue_receive -#undef rtems_message_queue_send -#undef rtems_message_queue_urgent -#undef rtems_region_create -#undef rtems_region_delete -#undef rtems_region_get_segment -#undef rtems_region_ident -#undef rtems_region_return_segment -#undef rtems_semaphore_create -#undef rtems_semaphore_delete -#undef rtems_semaphore_ident -#undef rtems_semaphore_obtain -#undef rtems_semaphore_release -#undef rtems_task_create -#undef rtems_task_delete -#undef rtems_task_get_note -#undef rtems_task_ident -#undef rtems_task_mode -#undef rtems_task_restart -#undef rtems_task_resume -#undef rtems_task_set_note -#undef rtems_task_set_priority -#undef rtems_task_start -#undef rtems_task_suspend -#undef rtems_clock_get -#undef rtems_clock_set -#undef rtems_clock_tick -#undef rtems_task_wake_after -#undef rtems_task_wake_when -#undef rtems_fatal_error_occurred -#undef rtems_rate_monotonic_create -#undef rtems_rate_monotonic_ident -#undef rtems_rate_monotonic_delete -#undef rtems_rate_monotonic_cancel -#undef rtems_rate_monotonic_period -#undef rtems_multiprocessing_announce -#undef rtems_timer_create -#undef rtems_timer_ident -#undef rtems_timer_delete -#undef rtems_timer_cancel -#undef rtems_timer_fire_after -#undef rtems_timer_fire_when -#undef rtems_timer_reset - -#define rtems_signal_catch( asraddr, mode ) \ - Empty_directive( asraddr, mode ) -#define rtems_signal_send( tid, signal ) \ - Empty_directive( tid, signal ) - -#define rtems_io_close( major, minor, argp, rval ) \ - Empty_directive( major, minor, argp, rval ) -#define rtems_io_control( major, minor, argp, rval ) \ - Empty_directive( major, minor, argp, rval ) -#define rtems_io_initialize( major, minor, argp, rval ) \ - Empty_directive( major, minor, argp, rval ) -#define rtems_io_open( major, minor, argp, rval ) \ - Empty_directive( major, minor, argp, rval ) -#define rtems_io_read( major, minor, argp, rval ) \ - Empty_directive( major, minor, argp, rval ) -#define rtems_io_write( major, minor, argp, rval ) \ - Empty_directive( major, minor, argp, rval ) - -#define rtems_port_internal_to_external( dpid, internal, external ) \ - Empty_directive( dpid, internal, external ) -#define rtems_port_external_to_internal( dpid, external, internal ) \ - Empty_directive( dpid, external, internal ) -#define rtems_port_create( name, intaddr, extaddr, length, dpid ) \ - Empty_directive( name, intaddr, extaddr, length, dpid ) -#define rtems_port_delete( dpid ) \ - Empty_directive( dpid ) -#define rtems_port_ident( name, dpid ) \ - Empty_directive( name, dpid ) - -#define rtems_event_receive( eventin, options, timeout, eventout ) \ - Empty_directive( eventin, options, timeout, eventout ) -#define rtems_event_send( tid, event ) \ - Empty_directive( tid, event ) - -#define rtems_initialize_executive( conftbl, cputbl ) \ - Empty_directive( conftbl, cputbl ) -#define rtems_shutdown_executive( the_error ) \ - Empty_directive( the_error ) - -#define rtems_interrupt_catch( israddr, vector, oldisr ) \ - Empty_directive( israddr, vector, oldisr ) - -#define rtems_partition_create( name, paddr, length, bsize, attr, ptid ) \ - Empty_directive( name, paddr, length, bsize, attr, ptid ) -#define rtems_partition_delete( ptid ) \ - Empty_directive( ptid ) -#define rtems_partition_get_buffer( ptid, bufaddr ) \ - Empty_directive( ptid, bufaddr ) -#define rtems_partition_ident( name, node, ptid ) \ - Empty_directive( name, node, ptid ) -#define rtems_partition_return_buffer( ptid, bufaddr ) \ - Empty_directive( ptid, bufaddr ) - -#define rtems_message_queue_broadcast( qid, buffer, count ) \ - Empty_directive( qid, buffer, count ) -#define rtems_message_queue_create( name, count, attr, qid ) \ - Empty_directive( name, count, attr, qid ) -#define rtems_message_queue_delete( qid ) \ - Empty_directive( qid ) -#define rtems_message_queue_flush( qid, count ) \ - Empty_directive( qid, count ) -#define rtems_message_queue_ident( name, node, qid ) \ - Empty_directive( name, node, qid ) -#define rtems_message_queue_receive( qid, buffer, options, timeout ) \ - Empty_directive( qid, buffer, options, timeout ) -#define rtems_message_queue_send( qid, buffer ) \ - Empty_directive( qid, buffer ) -#define rtems_message_queue_urgent( qid, buffer ) \ - Empty_directive( qid, buffer ) - -#define rtems_region_create( name, paddr, length, pagesize, attr, rnid ) \ - Empty_directive( name, paddr, length, pagesize, attr, rnid ) -#define rtems_region_delete( rnid ) \ - Empty_directive( rnid ) -#define rtems_region_get_segment( rnid, size, options, timeout, segaddr ) \ - Empty_directive( rnid, size, options, timeout, segaddr ) -#define rtems_region_ident( name, rnid ) \ - Empty_directive( name, rnid ) -#define rtems_region_return_segment( rnid, segaddr ) \ - Empty_directive( rnid, segaddr ) - -#define rtems_semaphore_create( name, count, attr, priceil, smid ) \ - Empty_directive( name, count, attr, priceil, smid ) -#define rtems_semaphore_delete( smid ) \ - Empty_directive( smid ) -#define rtems_semaphore_ident( name, node, smid ) \ - Empty_directive( name, node, smid ) -#define rtems_semaphore_obtain( smid, options, timeout ) \ - Empty_directive( smid, options, timeout ) -#define rtems_semaphore_release( smid ) \ - Empty_directive( smid ) - -#define rtems_task_create( name, priority, stack_size, mode, attr, tid ) \ - Empty_directive( name, priority, stack_size, mode, attr, tid ) -#define rtems_task_delete( tid ) \ - Empty_directive( tid ) -#define rtems_task_get_note( tid, notepad, note ) \ - Empty_directive( tid, notepad, note ) -#define rtems_task_ident( name, node, tid ) \ - Empty_directive( name, node, tid ) -#define rtems_task_mode( mode, mask, pmode ) \ - Empty_directive( mode, mask, pmode ) -#define rtems_task_restart( tid, arg ) \ - Empty_directive( tid, arg ) -#define rtems_task_resume( tid ) \ - Empty_directive( tid ) -#define rtems_task_set_note( tid, notepad, note ) \ - Empty_directive( tid, notepad, note ) -#define rtems_task_set_priority( tid, priority, ppriority ) \ - Empty_directive( tid, priority, ppriority ) -#define rtems_task_start( tid, saddr, arg ) \ - Empty_directive( tid, saddr, arg ) -#define rtems_task_suspend( tid ) \ - Empty_directive( tid ) - -#define rtems_clock_get( options, time ) \ - Empty_directive( options, time ) -#define rtems_clock_set( time ) \ - Empty_directive( time ) -#define rtems_clock_tick() \ - Empty_directive() -#define rtems_task_wake_after( ticks ) \ - Empty_directive( ticks ) -#define rtems_task_wake_when( time ) \ - Empty_directive( time ) - -#define rtems_fatal_error_occurred( errcode ) \ - Empty_directive( errcode ) - -#define rtems_rate_monotonic_create( name, id ) \ - Empty_directive( name, id ) -#define rtems_rate_monotonic_ident( name, id ) \ - Empty_directive( name, id ) -#define rtems_rate_monotonic_delete( id ) \ - Empty_directive( id ) -#define rtems_rate_monotonic_cancel( id ) \ - Empty_directive( id ) -#define rtems_rate_monotonic_period( id, period ) \ - Empty_directive( id, period ) - -#define rtems_multiprocessing_announce() \ - Empty_directive() - -#define rtems_timer_create( name, tmid ) \ - Empty_directive( name, tmid ) -#define rtems_timer_delete( tmid ) \ - Empty_directive( tmid ) -#define rtems_timer_cancel( tmid ) \ - Empty_directive( tmid ) -#define rtems_timer_ident( name, tmid ) \ - Empty_directive( name, tmid ) -#define rtems_timer_fire_after( tmid, ticks, routine, user_data ) \ - Empty_directive( tmid, ticks, routine, user_data ) -#define rtems_timer_fire_when( tmid, time, routine, user_data ) \ - Empty_directive( tmid, time, routine, user_data ) -#define rtems_timer_reset( tmid ) \ - Empty_directive( tmid ) - -rtems_status_code Empty_directive(); - -#endif -/* end of include file */ diff --git a/testsuites/tmtests/tmoverhd/empty.c b/testsuites/tmtests/tmoverhd/empty.c deleted file mode 100644 index dc5c76f79d..0000000000 --- a/testsuites/tmtests/tmoverhd/empty.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#include "system.h" - -rtems_timer_service_routine Timer_handler( - rtems_id argument -) -{ -} - -rtems_asr Isr_handler( - rtems_signal_set signals -) -{ -} - -rtems_asr Asr_handler( - rtems_signal_set signals -) -{ -} - -rtems_task task_func() {} - -void null_func() {} - -rtems_status_code Empty_directive() -{ - return( RTEMS_SUCCESSFUL ); -} diff --git a/testsuites/tmtests/tmoverhd/system.h b/testsuites/tmtests/tmoverhd/system.h deleted file mode 100644 index 97d4a4e3e9..0000000000 --- a/testsuites/tmtests/tmoverhd/system.h +++ /dev/null @@ -1,57 +0,0 @@ -/* system.h - * - * This include file is used by all tests in the Time Suite. - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - - -#include -#include - -/* functions */ - -rtems_task Init( - rtems_task_argument argument -); - -rtems_timer_service_routine Timer_handler( - rtems_id argument -); - -rtems_asr Isr_handler( - rtems_signal_set signals -); - -rtems_asr Asr_handler( - rtems_signal_set signals -); - -rtems_task task_func(); - -void null_func(); - -rtems_status_code Empty_directive(); - -#include - -/* configuration information */ - -#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER -#define CONFIGURE_APPLICATION_NEEDS_TIMER_DRIVER - -#define CONFIGURE_MAXIMUM_TASKS 2 -#define CONFIGURE_TICKS_PER_TIMESLICE 0 - -#define CONFIGURE_RTEMS_INIT_TASKS_TABLE - -#include - -/* end of include file */ diff --git a/testsuites/tmtests/tmoverhd/testtask.c b/testsuites/tmtests/tmoverhd/testtask.c deleted file mode 100644 index 21fa59a4bd..0000000000 --- a/testsuites/tmtests/tmoverhd/testtask.c +++ /dev/null @@ -1,1278 +0,0 @@ -/* - * - * COPYRIGHT (c) 1989-1999. - * On-Line Applications Research Corporation (OAR). - * - * The license and distribution terms for this file may be - * found in the file LICENSE in this distribution or at - * http://www.OARcorp.com/rtems/license.html. - * - * $Id$ - */ - -#define TEST_INIT -#include "system.h" - -rtems_unsigned8 Memory_area[ 2048 ]; -rtems_unsigned8 Internal_port_area[ 256 ]; -rtems_unsigned8 External_port_area[ 256 ]; - -rtems_task Task_1( - rtems_task_argument argument -); - -rtems_task Init( - rtems_task_argument argument -) -{ rtems_id id; - rtems_status_code status; - - Set_find_average_overhead( TRUE ); - - Print_Warning(); - - puts( "\n\n*** TIME TEST OVERHEAD ***" ); - - status = rtems_task_create( - rtems_build_name( 'T', 'A', '1', ' ' ), - 254, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &id - ); - directive_failed( status, "rtems_task_create of TA1" ); - - status = rtems_task_start( id, 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" ); -} - -/* comment out the following include to verify type are correct */ -#include "dumrtems.h" - -rtems_task Task_1( - rtems_task_argument argument -) -{ - rtems_name name; - rtems_unsigned32 index; - rtems_cpu_table cpu_table; - rtems_id id; - rtems_task_priority in_priority; - rtems_task_priority out_priority; - rtems_mode in_mode; - rtems_mode mask; - rtems_mode out_mode; - rtems_unsigned32 note; - rtems_time_of_day time; - rtems_interval timeout; - rtems_signal_set signals; - void *address_1; - rtems_event_set events; - long buffer[ 4 ]; - rtems_unsigned32 count; - rtems_device_major_number major; - rtems_device_minor_number minor; - rtems_unsigned32 io_result; - rtems_unsigned32 error; - rtems_clock_get_options options; - - name = rtems_build_name( 'N', 'A', 'M', 'E' ); - in_priority = 250; - in_mode = RTEMS_NO_PREEMPT; - mask = RTEMS_PREEMPT_MASK; - note = 8; - timeout = 100; - signals = RTEMS_SIGNAL_1 | RTEMS_SIGNAL_3; - major = 10; - minor = 0; - error = 100; - options = 0; - -/* rtems_initialize_executive */ - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_initialize_executive( rtems_configuration_get_table(), &cpu_table ); - end_time = Read_timer(); - - put_time( - "rtems_initialize_executive", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_shutdown_executive */ - - Timer_initialize(); - for ( index=1 ; index <= OPERATION_COUNT ; index++ ) - (void) rtems_shutdown_executive( error ); - end_time = Read_timer(); - - put_time( - "rtems_shutdown_executive", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_task_create */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_task_create( - name, - in_priority, - RTEMS_MINIMUM_STACK_SIZE, - RTEMS_DEFAULT_MODES, - RTEMS_DEFAULT_ATTRIBUTES, - &id - ); - end_time = Read_timer(); - - put_time( - "rtems_task_create", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_task_ident */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_task_ident( name, RTEMS_SEARCH_ALL_NODES, id ); - end_time = Read_timer(); - - put_time( - "rtems_task_ident", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_task_start */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_task_start( id, Task_1, 0 ); - end_time = Read_timer(); - - put_time( - "rtems_task_start", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_task_restart */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_task_restart( id, 0 ); - end_time = Read_timer(); - - put_time( - "rtems_task_restart", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_task_delete */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_task_delete( id ); - end_time = Read_timer(); - - put_time( - "rtems_task_delete", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_task_suspend */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_task_suspend( id ); - end_time = Read_timer(); - - put_time( - "rtems_task_suspend", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_task_resume */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_task_resume( id ); - end_time = Read_timer(); - - put_time( - "rtems_task_resume", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_task_set_priority */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_task_set_priority( id, in_priority, &out_priority ); - end_time = Read_timer(); - - put_time( - "rtems_task_set_priority", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_task_mode */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_task_mode( in_mode, mask, &out_mode ); - end_time = Read_timer(); - - put_time( - "rtems_task_mode", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_task_get_note */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_task_get_note( id, 1, note ); - end_time = Read_timer(); - - put_time( - "rtems_task_get_note", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_task_set_note */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_task_set_note( id, 1, note ); - end_time = Read_timer(); - - put_time( - "rtems_task_set_note", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_task_wake_when */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_task_wake_when( time ); - end_time = Read_timer(); - - put_time( - "rtems_task_wake_when", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_task_wake_after */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_task_wake_after( timeout ); - end_time = Read_timer(); - - put_time( - "rtems_task_wake_after", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_interrupt_catch */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_interrupt_catch( Isr_handler, 5, address_1 ); - end_time = Read_timer(); - - put_time( - "rtems_interrupt_catch", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_clock_get */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_clock_get( options, time ); - end_time = Read_timer(); - - put_time( - "rtems_clock_get", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_clock_set */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_clock_set( time ); - end_time = Read_timer(); - - put_time( - "rtems_clock_set", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_clock_tick */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_clock_tick(); - end_time = Read_timer(); - - put_time( - "rtems_clock_tick", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -rtems_test_pause(); - -/* rtems_timer_create */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_timer_create( name, &id ); - end_time = Read_timer(); - - put_time( - "rtems_timer_create", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_timer_delete */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_timer_delete( id ); - end_time = Read_timer(); - - put_time( - "rtems_timer_delete", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_timer_ident */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_timer_ident( name, id ); - end_time = Read_timer(); - - put_time( - "rtems_timer_ident", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_timer_fire_after */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_timer_fire_after( - id, - timeout, - Timer_handler, - NULL - ); - end_time = Read_timer(); - - put_time( - "rtems_timer_fire_after", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_timer_fire_when */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_timer_fire_when( - id, - time, - Timer_handler, - NULL - ); - end_time = Read_timer(); - - put_time( - "rtems_timer_fire_when", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_timer_reset */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_timer_reset( id ); - end_time = Read_timer(); - - put_time( - "rtems_timer_reset", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_timer_cancel */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_timer_cancel( id ); - end_time = Read_timer(); - - put_time( - "rtems_timer_cancel", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_semaphore_create */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_semaphore_create( - name, - 128, - RTEMS_DEFAULT_ATTRIBUTES, - RTEMS_NO_PRIORITY, - &id - ); - end_time = Read_timer(); - - put_time( - "rtems_semaphore_create", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_semaphore_delete */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_semaphore_delete( id ); - end_time = Read_timer(); - - put_time( - "rtems_semaphore_delete", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_semaphore_ident */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_semaphore_ident( name, RTEMS_SEARCH_ALL_NODES, id ); - end_time = Read_timer(); - - put_time( - "rtems_semaphore_ident", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_semaphore_obtain */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_semaphore_obtain( id, RTEMS_DEFAULT_OPTIONS, timeout ); - end_time = Read_timer(); - - put_time( - "rtems_semaphore_obtain", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_semaphore_release */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_semaphore_release( id ); - end_time = Read_timer(); - - put_time( - "rtems_semaphore_release", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_message_queue_create */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_message_queue_create( - name, - 128, - RTEMS_DEFAULT_ATTRIBUTES, - &id - ); - end_time = Read_timer(); - - put_time( - "rtems_message_queue_create", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_message_queue_ident */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_message_queue_ident( - name, - RTEMS_SEARCH_ALL_NODES, - id - ); - end_time = Read_timer(); - - put_time( - "rtems_message_queue_ident", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_message_queue_delete */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_message_queue_delete( id ); - end_time = Read_timer(); - - put_time( - "rtems_message_queue_delete", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_message_queue_send */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_message_queue_send( id, (long (*)[4])buffer ); - end_time = Read_timer(); - - put_time( - "rtems_message_queue_send", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_message_queue_urgent */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_message_queue_urgent( id, (long (*)[4])buffer ); - end_time = Read_timer(); - - put_time( - "rtems_message_queue_urgent", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_message_queue_broadcast */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_message_queue_broadcast( - id, - (long (*)[4])buffer, - &count - ); - end_time = Read_timer(); - - put_time( - "rtems_message_queue_broadcast", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_message_queue_receive */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_message_queue_receive( - id, - (long (*)[4])buffer, - RTEMS_DEFAULT_OPTIONS, - timeout - ); - end_time = Read_timer(); - - put_time( - "rtems_message_queue_receive", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_message_queue_flush */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_message_queue_flush( id, &count ); - end_time = Read_timer(); - - put_time( - "rtems_message_queue_flush", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -rtems_test_pause(); - -/* rtems_event_send */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_event_send( id, events ); - end_time = Read_timer(); - - put_time( - "rtems_event_send", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_event_receive */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_event_receive( - RTEMS_EVENT_16, - RTEMS_DEFAULT_OPTIONS, - timeout, - &events - ); - end_time = Read_timer(); - - put_time( - "rtems_event_receive", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_signal_catch */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_signal_catch( Asr_handler, RTEMS_DEFAULT_MODES ); - end_time = Read_timer(); - - put_time( - "rtems_signal_catch", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_signal_send */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_signal_send( id, signals ); - end_time = Read_timer(); - - put_time( - "rtems_signal_send", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_partition_create */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_partition_create( - name, - Memory_area, - 2048, - 128, - RTEMS_DEFAULT_ATTRIBUTES, - &id - ); - end_time = Read_timer(); - - put_time( - "rtems_partition_create", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_partition_ident */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_partition_ident( name, RTEMS_SEARCH_ALL_NODES, id ); - end_time = Read_timer(); - - put_time( - "rtems_partition_ident", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_partition_delete */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_partition_delete( id ); - end_time = Read_timer(); - - put_time( - "rtems_partition_delete", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_partition_get_buffer */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_partition_get_buffer( id, address_1 ); - end_time = Read_timer(); - - put_time( - "rtems_partition_get_buffer", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_partition_return_buffer */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_partition_return_buffer( id, address_1 ); - end_time = Read_timer(); - - put_time( - "rtems_partition_return_buffer", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_region_create */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_region_create( - name, - Memory_area, - 2048, - 128, - RTEMS_DEFAULT_ATTRIBUTES, - &id - ); - end_time = Read_timer(); - - put_time( - "rtems_region_create", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_region_ident */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_region_ident( name, id ); - end_time = Read_timer(); - - put_time( - "rtems_region_ident", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_region_delete */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_region_delete( id ); - end_time = Read_timer(); - - put_time( - "rtems_region_delete", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_region_get_segment */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_region_get_segment( - id, - 243, - RTEMS_DEFAULT_OPTIONS, - timeout, - &address_1 - ); - end_time = Read_timer(); - - put_time( - "rtems_region_get_segment", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_region_return_segment */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_region_return_segment( id, address_1 ); - end_time = Read_timer(); - - put_time( - "rtems_region_return_segment", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_port_create */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_port_create( - name, - Internal_port_area, - External_port_area, - 0xff, - &id - ); - end_time = Read_timer(); - - put_time( - "rtems_port_create", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_port_ident */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_port_ident( name, id ); - end_time = Read_timer(); - - put_time( - "rtems_port_ident", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_port_delete */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_port_delete( id ); - end_time = Read_timer(); - - put_time( - "rtems_port_delete", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_port_external_to_internal */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_port_external_to_internal( - id, - &External_port_area[ 7 ], - address_1 - ); - end_time = Read_timer(); - - put_time( - "rtems_port_external_to_internal", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_port_internal_to_external */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_port_internal_to_external( - id, - &Internal_port_area[ 7 ], - address_1 - ); - end_time = Read_timer(); - - put_time( - "rtems_port_internal_to_external", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -rtems_test_pause(); - -/* rtems_io_initialize */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_io_initialize( - major, - minor, - address_1, - &io_result - ); - end_time = Read_timer(); - - put_time( - "rtems_io_initialize", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_io_open */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_io_open( - major, - minor, - address_1, - &io_result - ); - end_time = Read_timer(); - - put_time( - "rtems_io_open", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_io_close */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_io_close( - major, - minor, - address_1, - &io_result - ); - end_time = Read_timer(); - - put_time( - "rtems_io_close", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_io_read */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_io_read( - major, - minor, - address_1, - &io_result - ); - end_time = Read_timer(); - - put_time( - "rtems_io_read", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_io_write */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_io_write( - major, - minor, - address_1, - &io_result - ); - end_time = Read_timer(); - - put_time( - "rtems_io_write", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_io_control */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_io_control( - major, - minor, - address_1, - &io_result - ); - end_time = Read_timer(); - - put_time( - "rtems_io_control", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_fatal_error_occurred */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_fatal_error_occurred( error ); - end_time = Read_timer(); - - put_time( - "rtems_fatal_error_occurred", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_rate_monotonic_create */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_rate_monotonic_create( name, &id ); - end_time = Read_timer(); - - put_time( - "rtems_rate_monotonic_create", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_rate_monotonic_ident */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_rate_monotonic_ident( name, id ); - end_time = Read_timer(); - - put_time( - "rtems_rate_monotonic_ident", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_rate_monotonic_delete */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_rate_monotonic_delete( id ); - end_time = Read_timer(); - - put_time( - "rtems_rate_monotonic_delete", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_rate_monotonic_cancel */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_rate_monotonic_cancel( id ); - end_time = Read_timer(); - - put_time( - "rtems_rate_monotonic_cancel", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_rate_monotonic_period */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_rate_monotonic_period( id, timeout ); - end_time = Read_timer(); - - put_time( - "rtems_rate_monotonic_period", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - -/* rtems_multiprocessing_announce */ - - Timer_initialize(); - for ( index = 1 ; index <= OPERATION_COUNT ; index ++ ) - (void) rtems_multiprocessing_announce(); - end_time = Read_timer(); - - put_time( - "rtems_multiprocessing_announce", - end_time, - OPERATION_COUNT, - overhead, - 0 - ); - - puts( "*** END OF TIME OVERHEAD ***" ); - - rtems_test_exit( 0 ); -} diff --git a/testsuites/tmtests/tmoverhd/tmoverhd.doc b/testsuites/tmtests/tmoverhd/tmoverhd.doc deleted file mode 100644 index f7e063ff14..0000000000 --- a/testsuites/tmtests/tmoverhd/tmoverhd.doc +++ /dev/null @@ -1,12 +0,0 @@ -# -# $Id$ -# -# COPYRIGHT (c) 1989-1999. -# On-Line Applications Research Corporation (OAR). -# -# The license and distribution terms for this file may be -# found in the file LICENSE in this distribution or at -# http://www.OARcorp.com/rtems/license.html. -# - - diff --git a/testsuites/tmtests/tmtests.am b/testsuites/tmtests/tmtests.am deleted file mode 100644 index c17e0fac5f..0000000000 --- a/testsuites/tmtests/tmtests.am +++ /dev/null @@ -1,13 +0,0 @@ -## $Id$ - -project_bspdir=$(PROJECT_ROOT)/@RTEMS_BSP@ - -$(project_bspdir)/tests: - @$(mkinstalldirs) $@ - -$(project_bspdir)/tests/$(TEST)$(LIB_VARIANT).exe: $(PGM) - $(INSTALL_PROGRAM) $< $@ - -TMPINSTALL_FILES = \ -$(project_bspdir)/tests \ -$(project_bspdir)/tests/$(TEST)$(LIB_VARIANT).exe diff --git a/testsuites/tools/.cvsignore b/testsuites/tools/.cvsignore deleted file mode 100644 index bfdfd995be..0000000000 --- a/testsuites/tools/.cvsignore +++ /dev/null @@ -1,14 +0,0 @@ -aclocal.m4 -autom4te*.cache -config.cache -config.guess -config.log -config.status -config.sub -configure -depcomp -install-sh -Makefile -Makefile.in -missing -mkinstalldirs diff --git a/testsuites/tools/ChangeLog b/testsuites/tools/ChangeLog deleted file mode 100644 index d7d59b49da..0000000000 --- a/testsuites/tools/ChangeLog +++ /dev/null @@ -1,54 +0,0 @@ -2003-02-11 Ralf Corsepius - - * configure.ac: AM_INIT_AUTOMAKE([1.7.2]). - -2003-02-11 Ralf Corsepius - - * configure.ac: AC_PREREQ(2.57). - -2002-11-19 Ralf Corsepius - - * configure.ac: Remove RTEMS_OUTPUT_BUILD_SUBDIRS. - -2002-10-21 Ralf Corsepius - - * .cvsignore: Reformat. - Add autom4te*cache. - Remove autom4te.cache. - -2002-03-27 Ralf Corsepius - - * configure.ac: - AC_INIT(package,_RTEMS_VERSION,_RTEMS_BUGS). - AM_INIT_AUTOMAKE([no-define foreign 1.6]). - * Makefile.am: Remove AUTOMAKE_OPTIONS. - -2001-10-17 Ralf Corsepius - - * configure.ac: Apply RTEMS_CPU_SUBDIRS for potential CPU-subdirs. - * Makefile.am: Require automake-1.5. - -2001-10-11 Ralf Corsepius - - * .cvsignore: Add autom4te.cache for autoconf > 2.52. - * configure.in: Remove. - * configure.ac: New file, generated from configure.in by autoupdate. - -2000-11-09 Ralf Corsepius - - * Makefile.am: Use ... instead of RTEMS_TOPdir in ACLOCAL_AMFLAGS. - -2000-11-02 Ralf Corsepius - - * Makefile.am: Switch to ACLOCAL_AMFLAGS = -I $(RTEMS_TOPdir)/aclocal. - -2000-10-27 Ralf Corsepius - - * Makefile.am: ACLOCAL_AMFLAGS= -I $(RTEMS_TOPdir)/macros. - Switch to GNU canonicalization. - * configure.in: Replace AC_CONFIG_SUBDIRS with - RTEMS_CONFIG_BUILD_SUBDIRS. - -2000-08-10 Joel Sherrill - - * ChangeLog: New file. diff --git a/testsuites/tools/Makefile.am b/testsuites/tools/Makefile.am deleted file mode 100644 index 856762e1af..0000000000 --- a/testsuites/tools/Makefile.am +++ /dev/null @@ -1,10 +0,0 @@ -## -## $Id$ -## - -ACLOCAL_AMFLAGS = -I ../../../../aclocal - -SUBDIRS = @subdirs@ - -include $(top_srcdir)/../../../../automake/subdirs.am -include $(top_srcdir)/../../../../automake/host.am diff --git a/testsuites/tools/configure.ac b/testsuites/tools/configure.ac deleted file mode 100644 index 20ca0fd7c8..0000000000 --- a/testsuites/tools/configure.ac +++ /dev/null @@ -1,24 +0,0 @@ -## Process this file with autoconf to produce a configure script. -## -## $Id$ - -AC_PREREQ(2.57) -AC_INIT([rtems-c-src-tests-tools],[_RTEMS_VERSION],[rtems-bugs@OARcorp.com]) -AC_CONFIG_SRCDIR([generic]) -RTEMS_TOP(../../../..) -AC_CONFIG_AUX_DIR(../../../..) - -RTEMS_CANONICAL_TARGET_CPU - -AM_INIT_AUTOMAKE([no-define foreign 1.7.2]) -AM_MAINTAINER_MODE - -RTEMS_TOOLPATHS -AC_SUBST(program_prefix) - -RTEMS_CONFIG_BUILD_SUBDIRS(generic) -RTEMS_CPU_SUBDIRS - -# Explicitly list all Makefiles here -AC_CONFIG_FILES([Makefile]) -AC_OUTPUT diff --git a/testsuites/tools/generic/.cvsignore b/testsuites/tools/generic/.cvsignore deleted file mode 100644 index 43c59fdad0..0000000000 --- a/testsuites/tools/generic/.cvsignore +++ /dev/null @@ -1,16 +0,0 @@ -aclocal.m4 -autom4te*.cache -config.cache -config.guess -config.log -config.status -config.sub -configure -depcomp -difftest -install-sh -Makefile -Makefile.in -missing -mkinstalldirs -sorttimes diff --git a/testsuites/tools/generic/ChangeLog b/testsuites/tools/generic/ChangeLog deleted file mode 100644 index 1918767676..0000000000 --- a/testsuites/tools/generic/ChangeLog +++ /dev/null @@ -1,47 +0,0 @@ -2003-02-11 Ralf Corsepius - - * configure.ac: AM_INIT_AUTOMAKE([1.7.2]). - -2003-02-11 Ralf Corsepius - - * configure.ac: AC_PREREQ(2.57). - -2002-10-21 Ralf Corsepius - - * .cvsignore: Reformat. - Add autom4te*cache. - Remove autom4te.cache. - -2002-03-27 Ralf Corsepius - - * configure.ac: - AC_INIT(package,_RTEMS_VERSION,_RTEMS_BUGS). - AM_INIT_AUTOMAKE([no-define foreign 1.6]). - * Makefile.am: Remove AUTOMAKE_OPTIONS. - -2001-10-11 Ralf Corsepius - - * .cvsignore: Add autom4te.cache for autoconf > 2.52. - * configure.in: Remove. - * configure.ac: New file, generated from configure.in by autoupdate. - -2001-09-23 Ralf Corsepius - - * Makefile.am: Use 'PREINSTALL_FILES ='. - -2000-11-09 Ralf Corsepius - - * Makefile.am: Use ... instead of RTEMS_TOPdir in ACLOCAL_AMFLAGS. - -2000-11-02 Ralf Corsepius - - * Makefile.am: Switch to ACLOCAL_AMFLAGS = -I $(RTEMS_TOPdir)/aclocal. - -2000-10-27 Ralf Corsepius - - * Makefile.am: ACLOCAL_AMFLAGS= -I $(RTEMS_TOPdir)/macros. - Switch to GNU canonicalization. - -2000-08-10 Joel Sherrill - - * ChangeLog: New file. diff --git a/testsuites/tools/generic/Makefile.am b/testsuites/tools/generic/Makefile.am deleted file mode 100644 index cd0808ed9e..0000000000 --- a/testsuites/tools/generic/Makefile.am +++ /dev/null @@ -1,25 +0,0 @@ -## -## $Id$ -## - -ACLOCAL_AMFLAGS = -I ../../../../../aclocal - -noinst_SCRIPTS = difftest sorttimes - -project_bspdir = $(PROJECT_ROOT)/@RTEMS_BSP@ - -PREINSTALL_FILES = $(project_bspdir)/tests $(project_bspdir)/tests/difftest \ - $(project_bspdir)/tests/sorttimes - -$(project_bspdir)/tests: - @$(mkinstalldirs) $@ - -$(project_bspdir)/tests/difftest: difftest - $(INSTALL_SCRIPT) $< $@ - -$(project_bspdir)/tests/sorttimes: sorttimes - $(INSTALL_SCRIPT) $< $@ - -all-local: $(PREINSTALL_FILES) - -include $(top_srcdir)/../../../../../automake/local.am diff --git a/testsuites/tools/generic/configure.ac b/testsuites/tools/generic/configure.ac deleted file mode 100644 index d2d179c969..0000000000 --- a/testsuites/tools/generic/configure.ac +++ /dev/null @@ -1,26 +0,0 @@ -## Process this file with autoconf to produce a configure script. -## -## $Id$ - -AC_PREREQ(2.57) -AC_INIT([rtems-c-src-tests-tools-generic],[_RTEMS_VERSION],[rtems-bugs@OARcorp.com]) -AC_CONFIG_SRCDIR([sorttimes.in]) -RTEMS_TOP(../../../../..) -AC_CONFIG_AUX_DIR(../../../../..) - -RTEMS_CANONICAL_TARGET_CPU - -AM_INIT_AUTOMAKE([no-define foreign 1.7.2]) -AM_MAINTAINER_MODE -# Override the set of BSPs to be built. - -RTEMS_ENV_RTEMSBSP -RTEMS_PROJECT_ROOT - -RTEMS_PATH_KSH - -# Explicitly list all Makefiles here -AC_CONFIG_FILES([Makefile -difftest -sorttimes]) -AC_OUTPUT diff --git a/testsuites/tools/generic/difftest.in b/testsuites/tools/generic/difftest.in deleted file mode 100644 index cf25602f0d..0000000000 --- a/testsuites/tools/generic/difftest.in +++ /dev/null @@ -1,117 +0,0 @@ -#!@KSH@ -p -# -# Check test results against official output from the src tree -# -# $Id$ -# - -# XXX: do not run size.exe with this; it asks questions we don't answer - -# how to do arith in bash -# i=$((i * 2)) -# b=$((b + 1)) - -# progname=`basename $0` -progname=${0##*/} # fast basename hack for ksh, bash - -USAGE=\ -"usage: $progname [ -opts ] test [ test ... ] - -v -- verbose - -l logdir -- specify log directory (default is 'logdir') -" - -# log an error to stderr -prerr() -{ - echo "$*" >&2 -} - -fatal() { - [ "$1" ] && prerr $* - prerr "$USAGE" - exit 1 -} - -warn() { - [ "$1" ] && prerr $* -} - -# -# process the options -# -# defaults for getopt vars -# - -verbose="" -logdir=log - -while getopts v12o:l: OPT -do - case "$OPT" in - v) - verbose="yes";; - l) - logdir="$OPTARG";; - *) - fatal;; - esac -done -shiftcount=`expr $OPTIND - 1` -shift $shiftcount - -args=$* - -# -# Run the tests -# - -test -d $logdir || fatal "No log directory: ./$logdir" - -tests="$args" -if [ ! "$tests" ] -then - cd $logdir - set -- `ls -1 sp* mp??_? psx* itron* mp*_?_g 2>/dev/null | grep -v info` - cd .. - tests="$*" -fi - -for t in $tests -do - logfile=$t - - if [ ! -f $logdir/$logfile ] - then - continue - fi - - echo $logfile - echo - - case $t in - mp*) - mptest=`echo $t | sed 's/_.//'` - node=`echo $t | sed 's/...._//'` - tmp_scn_file=mptests/node$node/$mptest.scn;; - sp*) - tmp_scn_file=sptests/$t.scn;; - psx*) - tmp_scn_file=psxtests/$t.scn;; - itron*) - tmp_scn_file=itrontests/$t.scn;; - *) - fatal "unknown test $t";; - esac - - scn_file=`echo $tmp_scn_file | sed -e s/_g//` - sed -e '/^$/d' < $logdir/$logfile | diff -b screens/$scn_file - - echo - echo -done - -exit 0 - -# Local Variables: *** -# mode:ksh *** -# End: *** - diff --git a/testsuites/tools/generic/sorttimes.in b/testsuites/tools/generic/sorttimes.in deleted file mode 100644 index 594ae4397d..0000000000 --- a/testsuites/tools/generic/sorttimes.in +++ /dev/null @@ -1,194 +0,0 @@ -#!@KSH@ -p -# -# This script takes the output from the Timing Test Suite, reorders -# it, and adds headers so it is in the same order as is printed in -# the supplement. -# -# $Id$ -# - -usage() -{ - echo "${progname} file [more files]" -} - -header() -{ - echo - echo $* - echo -} - -lookup() -{ - grep "$*" $files - -} - -progname=$0 - -if [ $# -eq 0 ] ; then - usage - exit 0 -fi - -files=$* - -header Context Switch -lookup context switch: self -lookup context switch: to another task -lookup context switch: no floating point contexts -lookup fp context switch: restore 1st FP task -lookup fp context switch: save initialized, restore initialized -lookup fp context switch: save idle, restore initialized -lookup fp context switch: save idle, restore idle - -header Task Manager -lookup rtems_task_create -lookup rtems_task_ident -lookup rtems_task_start -lookup rtems_task_restart: calling task -lookup rtems_task_restart: suspended task -- returns to caller -lookup rtems_task_restart: blocked task -- returns to caller -lookup rtems_task_restart: ready task -- returns to caller -lookup rtems_task_restart: suspended task -- preempts caller -lookup rtems_task_restart: blocked task -- preempts caller -lookup rtems_task_restart: ready task -- preempts caller -lookup rtems_task_delete: calling task -lookup rtems_task_delete: suspended task -lookup rtems_task_delete: blocked task -lookup rtems_task_delete: ready task -lookup rtems_task_suspend: calling task -lookup rtems_task_suspend: returns to caller -lookup rtems_task_resume: task readied -- returns to caller -lookup rtems_task_resume: task readied -- preempts caller -lookup rtems_task_set_priority: obtain current priority -lookup rtems_task_set_priority: returns to caller -lookup rtems_task_set_priority: preempts caller -lookup rtems_task_mode: obtain current mode -lookup rtems_task_mode: no reschedule -lookup rtems_task_mode: reschedule -- returns to caller -lookup rtems_task_mode: reschedule -- preempts caller -lookup rtems_task_get_note -lookup rtems_task_set_note -lookup rtems_task_wake_after: yield -- returns to caller -lookup rtems_task_wake_after: yields -- preempts caller -lookup rtems_task_wake_when - -header Interrupt Manager -lookup interrupt entry overhead: returns to nested interrupt -lookup interrupt entry overhead: returns to interrupted task -lookup interrupt entry overhead: returns to preempting task -lookup interrupt exit overhead: returns to nested interrupt -lookup interrupt exit overhead: returns to interrupted task -lookup interrupt exit overhead: returns to preempting task - -header Clock Manager -lookup rtems_clock_set -lookup rtems_clock_get -lookup rtems_clock_tick - -header Timer Manager -lookup rtems_timer_create -lookup rtems_timer_ident -lookup rtems_timer_delete: inactive -lookup rtems_timer_delete: active -lookup rtems_timer_fire_after: inactive -lookup rtems_timer_fire_after: active -lookup rtems_timer_fire_when: inactive -lookup rtems_timer_fire_when: active -lookup rtems_timer_reset: inactive -lookup rtems_timer_reset: active -lookup rtems_timer_cancel: inactive -lookup rtems_timer_cancel: active - -header Semaphore Manager -lookup rtems_semaphore_create -lookup rtems_semaphore_ident -lookup rtems_semaphore_delete -lookup rtems_semaphore_obtain: available -lookup rtems_semaphore_obtain: not available -- NO_WAIT -lookup rtems_semaphore_obtain: not available -- caller blocks -lookup rtems_semaphore_release: no waiting tasks -lookup rtems_semaphore_release: task readied -- returns to caller -lookup rtems_semaphore_release: task readied -- preempts caller - -header Message Queue Manager -lookup rtems_message_queue_create -lookup rtems_message_queue_ident -lookup rtems_message_queue_delete -lookup rtems_message_queue_send: no waiting tasks -lookup rtems_message_queue_send: task readied -- returns to caller -lookup rtems_message_queue_send: task readied -- preempts caller -lookup rtems_message_queue_urgent: no waiting tasks -lookup rtems_message_queue_urgent: task readied -- returns to caller -lookup rtems_message_queue_urgent: task readied -- preempts caller -lookup rtems_message_queue_broadcast: no waiting tasks -lookup rtems_message_queue_broadcast: task readied -- returns to caller -lookup rtems_message_queue_broadcast: task readied -- preempts caller -lookup rtems_message_queue_receive: available -lookup rtems_message_queue_receive: not available -- NO_WAIT -lookup rtems_message_queue_receive: not available -- caller blocks -lookup rtems_message_queue_flush: no messages flushed -lookup rtems_message_queue_flush: messages flushed - -header Event Manager -lookup rtems_event_send: no task readied -lookup rtems_event_send: task readied -- returns to caller -lookup rtems_event_send: task readied -- preempts caller -lookup rtems_event_receive: obtain current events -lookup rtems_event_receive: available -lookup rtems_event_receive: not available -- NO_WAIT -lookup rtems_event_receive: not available -- caller blocks - -header Signal Manager -lookup rtems_signal_catch -lookup rtems_signal_send: returns to caller -lookup rtems_signal_send: signal to self -lookup exit ASR overhead: returns to calling task -lookup exit ASR overhead: returns to preempting task - -header Partition Manager -lookup rtems_partition_create -lookup rtems_partition_ident -lookup rtems_partition_delete -lookup rtems_partition_get_buffer: available -lookup rtems_partition_get_buffer: not available -lookup rtems_partition_return_buffer - -header Region Manager -lookup rtems_region_create -lookup rtems_region_ident -lookup rtems_region_delete -lookup rtems_region_get_segment: available -lookup rtems_region_get_segment: not available -- NO_WAIT -lookup rtems_region_get_segment: not available -- caller blocks -lookup rtems_region_return_segment: no waiting tasks -lookup rtems_region_return_segment: task readied -- returns to caller -lookup rtems_region_return_segment: task readied -- preempts caller - -header Dual-Ported Memory Manager -lookup rtems_port_create -lookup rtems_port_ident -lookup rtems_port_delete -lookup rtems_port_internal_to_external -lookup rtems_port_external_to_internal - -header IO Manager -lookup rtems_io_initialize -lookup rtems_io_open -lookup rtems_io_close -lookup rtems_io_read -lookup rtems_io_write -lookup rtems_io_control - -header Rate Monotonic Manager -lookup rtems_rate_monotonic_create -lookup rtems_rate_monotonic_ident -lookup rtems_rate_monotonic_cancel -lookup rtems_rate_monotonic_delete: active -lookup rtems_rate_monotonic_delete: inactive -lookup rtems_rate_monotonic_period: obtain status -lookup rtems_rate_monotonic_period: initiate period -- returns to caller -lookup rtems_rate_monotonic_period: conclude periods -- caller blocks -exit 0